Opened on 10/30/2015 at 07:46:56 AM
Last modified on 12/21/2017 at 11:29:03 AM
#3249 new defect
Popup blocking is applied to pages opened by the user in a new tab
Reported by: | mapx | Assignee: | |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | Unknown | Keywords: | |
Cc: | greiner, sebastian, SMed79, kzar, mjethani, arthur | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by mapx)
Environment
chrome 47 ABP 1.9.3.1488
still happens in Chrome Version 62.0.3202.62 (Official Build) beta (64-bit) ABP 1.13.4.1892
How to reproduce
update easylist
go to
https://adblockplus.org/forum/viewtopic.php?p=141887#p141887
1.in chrome try to open any of the links there, for example:
https://ads.nipr.ac.jp/
try clicking the middle mouse button or even open link in a new tab
The attempts will fail due to the filter:
://ads.$popup
2.try the same in firefox ==> no issue, the new tab will be opened.
Expected behavior
Popup blocking filters should not cause tabs opened by the user to be closed.
Attachments (0)
Change History (21)
comment:1 Changed on 11/02/2015 at 12:16:13 PM by trev
- Cc sebastian added
- Description modified (diff)
comment:2 Changed on 11/02/2015 at 12:28:15 PM by trev
In fact, neither chrome.webNavigation.onBeforeNavigate (sourceTabId) nor chrome.tabs (openerTabId) seem to distinguish between user-opened and website-opened tabs, the tab ID of the original tag is set regardless - much unlike window.opener.
comment:3 Changed on 04/05/2016 at 05:44:50 PM by mapx
other test case
http://uptobox.com/w851onwc1ujq
Liste FR contains this filter:
|http://$popup,domain=uptobox.com
clicking the middle mouse button or even open link in a new tab (for example for home link/button) fails.
comment:4 Changed on 04/05/2016 at 05:46:57 PM by mapx
- Cc SMed79 added
comment:5 Changed on 04/05/2016 at 05:57:05 PM by mapx
- Cc kzar added
comment:6 Changed on 04/05/2016 at 06:07:50 PM by sebastian
- Component changed from Adblock-Plus-for-Firefox to Platform
- Description modified (diff)
- Owner set to sebastian
- Priority changed from Unknown to P3
- Ready set
- Summary changed from Different behaviour firefox / chrome in treating the popups requests to Popup blocking is applied to pages opened by the user in a new tab
As trev indicated above, the webNavigation API doesn't distinguish between actual popups and pages opened in a tab by the user. However It seems to be possible to identify popups by their windowType.
comment:7 Changed on 04/05/2016 at 06:25:55 PM by sebastian
- Component changed from Platform to Unknown
- Owner sebastian deleted
- Ready unset
Apparently, I was too ambitious that the Chrome API does what it indicates. Even though "popup" is a documented value for windowType, it's not used for popups created with window.open() as those are presented as regular tabs. So yeah, unfortunately, I don't see any way either to distinguish between actual popups and pages opened in a new tab by the user.
comment:8 Changed on 08/14/2016 at 12:06:14 AM by Lain_13
Since ABP already wrapping WebSocket, why don't wrap window.open as well? I'm already doing so for a few sites in my RU AdList JS Fixes and it works.
comment:9 Changed on 08/15/2016 at 12:31:31 PM by trev
Wrapping window.open doesn't work in the same way, as established on https://stackoverflow.com/questions/6649742/changing-window-prototype-open-in-a-way-that-isnt-detectable-reversible such manipulation would be trivial for the website to revert.
comment:10 Changed on 09/01/2016 at 12:12:49 PM by kzar
Is it possible we could use the transitionQualifiers and transitionType keys provided by chrome.webNavigation.onCommitted?
When I middle-click a link I get these values:
transitionQualifiers: [], transitionType: "link"
But when I use window.open(...) I get these:
transitionQualifiers: ["server_redirect"] transitionType: "link"
(Problem is I think onCommitted is after we block the popups at the moment, so we'd have to change the logic so that they weren't blocked until onComitted fired.)
comment:11 Changed on 09/27/2017 at 12:51:15 PM by mapx
Probably you can use now Event.isTrusted
https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted
available since chrome 46
same done by uBo
https://github.com/gorhill/uBlock/issues/2919#issuecomment-325703777
comment:12 Changed on 09/27/2017 at 04:47:06 PM by mapx
Event.isTrusted was already used here:
https://issues.adblockplus.org/ticket/3828
comment:13 Changed on 10/19/2017 at 08:48:00 PM by mapx
another case:
Impossible to google the words "popunder" and "clickunder" when ABP is on. I was just reading an article about SEO, landing pages and ClickUnder ads and at one moment decided to search the word "ClickUnder" using the context menu of Google Chrome (right-click the selected words on the page). Seems to me it's not ok to recognize the simple text as clickunder or popunder... Looking forward to ur feedback, thnx!
https://adblockplus.org/forum/viewtopic.php?f=10&t=54284
workaround:
@@||google.*/search?q=popunder$popup
comment:14 Changed on 10/20/2017 at 11:31:52 AM by mapx
- Cc mjethani added
comment:15 Changed on 10/20/2017 at 11:33:35 AM by mapx
- Description modified (diff)
comment:16 Changed on 10/20/2017 at 11:34:02 AM by mapx
- Description modified (diff)
comment:17 Changed on 10/20/2017 at 03:10:14 PM by mjethani
We don't really get an Event object in the webNavigation API so we can't use Event.isTrusted
comment:18 Changed on 10/20/2017 at 03:44:05 PM by mapx
As I posted above it seems uBo fixed such issue
https://github.com/gorhill/uBlock/commit/2660bee0d20e8355380b1b8c64973601514526cd
I tested the same (last) case in uBo and no issue here. (hmm ... wrong ... I still get a closed popup)
comment:19 Changed on 10/20/2017 at 03:56:51 PM by mapx
- Cc arthur added
comment:20 Changed on 10/20/2017 at 03:57:19 PM by mapx
Well, at least the filter above should be added to easylist.
comment:21 Changed on 12/21/2017 at 11:29:03 AM by fhd
- Cc trev removed
Added Analysis section to the description. From what I remember, checking window.opener wasn't possible in Chrome, maybe Sebastian can confirm.