On 10/25/17 12:41 PM, Andrew Overholt wrote:
Is there precedent for doing what a user intended which would be contrary
to what the site is attempting?

The first problem is this: How do you know the user wasn't intending what the site is attempting?

In the case that prompted my question, the user was attempting to
middle-click open photos from a Facebook photo album in tabs but the
middle-click was handled by the page's JS:
https://bugzilla.mozilla.org/show_bug.cgi?id=1365260. Maybe this is just a
middle-click thing?

So for this specific case, the problem is that maybe the user meant open in new tab, or maybe the user meant to use the web app's UI in some way that it provides. It's hard for the browser to tell this in a programmatic way...

In the same situation, given an unambiguous user-intent signal (e.g. the context menu's "open in new tab" option), we would obviously follow the user intent.

Could we do something where we disallowed pages from preventing the browser default action on various user inputs? Absolutely. Pretty easy to do that, actually, in a technical sense. Could we also prevent the page from taking whatever action they're taking? That's somewhat harder; it involves not dispatching the relevant event to the page at all. Either approach would break at least some legitimate sites.

Now there is in fact precedent for breaking legitimate sites to enforce presumed user intent when we're _fairly_ sure about the user intent and there is common abuse of the non-user-intent behavior. Popup blocking is the poster child here. It's not clear to me that overriding of middle-click on links is in that category so far. Also, note that with popup blocking we included a way for the user to override when we guess wrong about intent.

In general, as Myk points out, the question of when web pages should be able to respond to what sorts of input, and whether they should be able to prevent the default browser respond to that same input, is something that keeps coming up. It's not clear to me that there is a general context-independent answer here.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to