Oh no, you're thinking, yet another cookie pop-up. Well, sorry, it's the law. We measure how many people read us, and ensure you see relevant ads, by storing cookies on your device. If you're cool with that, hit “Accept all Cookies”. For more info and to customize your settings, hit “Customize Settings”.

Review and manage your consent

Here's an overview of our use of cookies, similar technologies and how to manage them. You can also change your choices at any time, by hitting the “Your Consent Options” link on the site's footer.

Manage Cookie Preferences
  • These cookies are strictly necessary so that you can navigate the site as normal and use all features. Without these cookies we cannot provide you with the service that you expect.

  • These cookies are used to make advertising messages more relevant to you. They perform functions like preventing the same ad from continuously reappearing, ensuring that ads are properly displayed for advertisers, and in some cases selecting advertisements that are based on your interests.

  • These cookies collect information in aggregate form to help us understand how our websites are being used. They allow us to count visits and traffic sources so that we can measure and improve the performance of our sites. If people say no to these cookies, we do not know how many people have visited and we cannot monitor performance.

See also our Cookie policy and Privacy policy.

This article is more than 1 year old

Web-app devs note: Google wants to banish JavaScript dialogues

Do you really want to leave this malware-serving page? No/No

Annoying sites that open hard-to-eradicate “Do you want to leave this site? Are you sure?” dialogues are in Chrome's cross-hairs: the Chrome team has decided JavaScript dialogues offer too much scope for abuse, and is laying out a roadmap to get rid of them.

The JavaScript dialogue is also a favourite of “Your Computer May Be Infected!” scammers (there's a Malwarebytes note from February here), with simple non-expert users easily sent off to malware domains if they fall for the scumware.

Since people also happen to write non-malicious applications that use JavaScript dialogues, the Chrome bods are giving warning of what they have in mind here.

Instead of app-modal JavaScript, the post asks developers to consider using:

  • The Notifications API, if you're just popping up an event notification;
  • HTML's <dialog> tag for collecting user input; and;
  • For researchers running cross-site-scripting proofs, there's devtool's console.log(document.origin).

On mobile platforms, “if you need to save state, you should use the Page Visibility API”, the post adds.

The team's future plans include changing the alert(), confirm() and prompt() dialogues will no longer be app-modal, but like Safari, dismissed when their tab is switched from – meaning if a JavaScript dialogue is raised, it won't stay on top if you switch tabs.

Finally, “We are investigating the possibility of gating alert()/confirm()/prompt()/onbeforeunload dialogs on site engagement, so if the user isn’t engaging with the page, the page’s dialogs will not be shown. Details have yet to be ironed out.”

Don't say you weren't warned. ®

Similar topics

TIP US OFF

Send us news


Other stories you might like