Contact emails
Spec
The relevant link is https://html.spec.whatwg.org/#dom-alert .
Summary
Their use in scams is a severe and ongoing problem. We have made multiple attempts to rein them in before, and sites have continued to abuse them. Sites have 1) abused bugs in our shared implementation with onbeforeunload 2) put up walls of text to push the "please stop it" button offscreen 3) used absurdly-long hostnames to push the "please stop it" button offscreen 4) timed themselves to avoid being stopped by our "please stop it" button 5) used wildcard DNS to avoid our origin restrictions on the "please stop it" button, and those are just the ones I can remember.
These functions were designed in the early web where the ability they granted to web pages to escape the browser chrome wasn't an issue. But it is a huge and ongoing issue today. Ask ConOps.
The spec already allows us to block dialogs at our discretion. In https://html.spec.whatwg.org/#dom-alert , the spec says for step 3 for alert(), confirm(), and prompt():
"Optionally, abort these steps."
"Optionally, return false and abort these steps."
"Optionally, return null and abort these steps."
Given that the spec already allows us discretion to block dialogs entirely, IMO a decision to restrict the number of characters displayed in them is entirely spec-compliant.
Motivation
Users are being harmed by bad actors. This mitigates much of the abuse of the API by bad actors.
Interoperability and Compatibility Risk
I'm not aware of any other browser doing this.
Ongoing technical constraints
None.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
OWP launch tracking bug
Link to entry on the feature dashboard
This is a change to existing behavior that remains spec-compliant. I don't believe it requires a feature dashboard entry.
Requesting approval to ship?
Yes.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
I totally support trying something aggressive here. I've seen even moderately tek-savvy users become afraid of using the web when they see such dialogs.
The fact that such scams appear to work indicates that alert and friends are a poorly designed platform feature - blur the line between system and application.
But what exactly is your proposal (sorry can't check the bug right now due to monorail transition)? Truncate the message? Suppress showing such dialogs? Do we have any metrics about how often such long dialogs are shown? Will you generate a console warning with details to help legitimate developers? I'm sure there are at least some legacy sites (maybe internal IT apps) relying on this, have any thoughts on how to mitigate the pain for them?
Rick
Another use of these sorts of dialogs is onbeforeunload prompting to prevent data loss and explain the implications of navigation to users. Admittedly this isn't a great experience, but I'm wondering if/how this factors into your plans.
Another use of these sorts of dialogs is onbeforeunload prompting to prevent data loss and explain the implications of navigation to users. Admittedly this isn't a great experience, but I'm wondering if/how this factors into your plans.
My current CL is https://codereview.chromium.org/1711863004/ which generated some discussion about where in the stack to do truncation, whether we need to log, etc.I'm not proposing dropping the dialogs, just truncating the text inside. My argument is that because the spec allows me to drop the dialogs, I'm within my rights, spec-wise, to truncate the message that they show.
+1. See http://www.chromium.org/blink#TOC-Policy-for-shipping-and-removing-web-platform-API-features for the principles here. It says we seek to balance moving the web forward (which this clearly does) and compatibility/interoperability. Specs are just a (imperfect) tool for helping to achieve interop and compat.
That said, with a bit of diligence I suspect this won't be too hard to pull off respectfully. Eg. add a length histogram, pick a value that's initially conservative (eg. The longest 1% of alerts), add a console warning, do a bit of developer outreach (which will mostly happen for you by filing a chromestatus entry), gather feedback in beta, and iterate (maybe lowering the threshold over time as our confidence increases).
If we can find what seems to be a sweet spot that reduces abuse without much compat fallout, then it'll probably be easy to get such a threshold written into the spec.
Rick
Because then every scam site will pop up alerts starting with "Important security alert! Click 'Show More' for full details!"
The 'scam website stops user from leaving page' issue is not about alert() dialogs, though. That's an abuse of onbeforeunload
BTW, userland solutions do NOT provide this to the end user.
Contact emails
Spec
The relevant link is https://html.spec.whatwg.org/#dom-alert .
Summary
JavaScript dialogs (and I'm including alert(), confirm(), and prompt() in the discussion here) are used for two things on the Modern Web: 1. JavaScript tutorials. 2. Scamming users.
Given that the spec already allows us discretion to block dialogs entirely, IMO a decision to restrict the number of characters displayed in them is entirely spec-compliant.
On 2/22/16 7:17 AM, Torne (Richard Coles) wrote:
> In a non-multiprocess browser this is even more
> difficult as they typically just have one JS main thread for the entire
> browser, and so all tabs will be blocked.
Firefox in non-multiprocess mode scopes alerts to a single tab.
It's not fully sync in the sense that script can run in _another_
window/tab and poke at this one, but we judged that to be a lesser evil
than blocking the world. Note that blocking the world is pretty
user-hostile even with caps on the alert string and whatnot.
-Boris
> (typically developers use synchronous APIs like these *because* they're synchronous
> and that's the property they want)
Typically developers do it because they just haven't thought that much
about it.
-Boris
--