I was navigating on this page and clicked "Available for your computer" image.
Then a native browser popup that is like an alert was opened:
Please compare the one above with the following alert() that everybody knows:
How did they create such an alert?
alert seems not to support images, according to this question.
Is this possible to open with JavaScript? I guess yes, but how?
Is this cross-browser? On Firefox, I am redirected to Chrome download page.
NOTE: I DO know that there are a lot of JavaScript libraries to show alerts, but I DO NOT want to use any of them. I want a clear answer to my question.
Chrome has some specialized windows/popups available for it's own use .. things you can't do via regular JavaScript.
Other things you can't do via regular JavaScript are the
Enable Webcam prompt window
Download file window.
If you are trying to do something similar in pure JavaScript, this is a great little replacement:
http://www.codersgrid.com/2013/07/05/alertify-js-replacement-of-your-browser-alert-dialog/
This seems to be a "chrome specific" popup. The application you want to install by clicking on this button is a Google App, which install is handled by Chrome. I think.
Except Bootstrap-like modals, I have never seen such thing in Javascript before.
Check this if you want to implement such popups on your website:
http://getbootstrap.com/javascript/#modals
instead of using alert . you can use any external plugin confirm box.Then you can customize your dialog box
Related
I am trying to click on page two using JS
https://www.abbreviations.com/sr
So I opened the console and put
document.getElementsByClassName('rc5')[1].click();
But it didn't click it and go to that page
This worked for me:
document.querySelectorAll(".pager > .rc5")[1].click()
what kind action you want to get as your 'click' result? first, it may be important to determine, that browser defines clicks as 'native' and 'generated by the code' and in the case of security and browsers policies.
but there is one smart method to work with DOM - headless browsers, like puppeteer.
you can do really anything with the webpage, using pure javascript.
I need to handle site's popups window in nightmarejs. I mean things like windows open list, close, scrape those created popups and maybe suscribe to popup creation event
Thank you
I got the same problem in the 2 mouth ago.
I think the nightmarejs cant do the popups.
I used the spookyjs to slove this problem.
Depends on what kind of popups you're talking about. For external windows, we're currently out of luck until Electron #2605 is fixed. For HTML flyovers, Nightmare should work fine. For native popups - confirm, alert, etc - you'll need to take a look at defining your own preload.
I was looking for examples of Javascript games and I came across this. It looks like Flash. I tried looking at the source code, and all I see are a bunch of div tags, but not really any Javascript. I couldn't find the code that actually runs the game.
Is this Flash or Javascript? How can you tell?
It's Javascript.
When you right click it gives you the native browser context menu. Right-clicking anything in Flash will give you a Flash context menu. The only time that method fails is when you get no context menu at all.
Also, highlight the text "Press enter". It uses native text highlighting.
As far as I know is impossible to hide the typical secondary flash context menu telling the version, etc...
I found is using a core.js javascript
Hope it helps.
You can try to disable the plugin of shockwave flash from browser's options. Then refresh page and see, whether 'target flash' disappears. If so then it was flash.
On the iPad my alert('hi') pops up with a URL in the title zone. Can I turn this URL off? I do not want to see it. I am considering using some jQuery plugin as a workaround, but it sure would be nice to just fix it.
I don't think that can be turned off, alerts are defined in the browser itself. You can redefine alert (window.alert = jqueryAlertPLugin.alert) and not have to worry about your code calling the native one. I recommend the jAlert plugin. You will lose the blocking functionality of the native alert, but I bet that isn't usually an issue for most people.
You can't change the title of a javascript alert box, for user security reasons. You could use an alternative such as a pop-up <div>.
I want to implement a utility for myself that should provide a small console where I can execute random JS in any browser (much like Firebug's console - I don't reinvent the wheel, I just want to do something I need and just have fun doing it).
So the usage use-case would be this:
Click a bookmarklet from any browser.
It shows dialog (much like jQuery dialog or similar) with text area and couple of buttons.
User enter a JS in the text area.
User clicks a button and it gets executed.
User closes the dialog.
I don't know how I can display nice dialog on any web page (Gmail, news, static pages, whatever).
I think it would be possible to create a jQuery dialog (or other library) and show it on the page. But it could lead to a lot of issues as the dialog might conflict with page CSS, JS and so on.
So the question is how to display a custom dialog on any web page from all (major) browsers using JavaScript.
The NOTES: I don't want to have a popup window. IFRAME would be ok but we cannot use it as the web page's DOCTYPE might not support it.
Thanks,
Dmitriy.
http://getfirebug.com/lite.html
Works in IE, Opera, Safari - basically gives you firebug's functionality in any browser.
bookmarklets are pieces of JS code, so you can basically develop any kind of JS program and use it via bookmarklet... just do what you would do normally. check how other bookmarklets work.
regarding the window display - use lightbox-like effect (DIV layered over other content).