Re: Overriding JS to allow for opening in a new tab?

2017-10-26 Thread Andrew Overholt
On Thu, Oct 26, 2017 at 12:34 AM, Boris Zbarsky  wrote:

> Either approach would break at least some legitimate sites.
>

Thanks for confirming this.

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.


Ok, thanks for the clarification (also to Myk and Dave!). Sounds like in
this case there's no easy answer.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Overriding JS to allow for opening in a new tab?

2017-10-25 Thread Boris Zbarsky

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


Re: Overriding JS to allow for opening in a new tab?

2017-10-25 Thread Myk Melez

Andrew Overholt 
2017 October 25 at 09:41
Is there precedent for doing what a user intended which would be contrary
to what the site is attempting?
I recall some discussion about preventing sites from using transparent 
elements to block click event handling, in particular context click on 
an image to copy/save it. That might be bug 102695 - [EVENTTARG]Treat 
some transparent elements as "transparent to events" [1].


The other bug that comes to mind is 380637 - Should web pages be 
restricted from being able to override the browser's keyboard shortcuts? 
[2].


Neither of those bugs have been resolved, however, so it's unclear that 
they create precedent.


-myk

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=102695
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=380637

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


Re: Overriding JS to allow for opening in a new tab?

2017-10-25 Thread Dave Townsend
We have some precedent for overriding a site. Popup blocking and
redirecting new windows to tabs for example. But I'm not sure how we could
technically do this here. If the site is doing some JS work (possibly
including async stuff) ultimately ending with an assignment to
window.location how would we know to override that to open in a new tab?

On Wed, Oct 25, 2017 at 9:42 AM Andrew Overholt 
wrote:

> Is there precedent for doing what a user intended which would be contrary
> to 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?
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Overriding JS to allow for opening in a new tab?

2017-10-25 Thread Andrew Overholt
Is there precedent for doing what a user intended which would be contrary
to 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?
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform