adguardteam / popupblocker Goto Github PK
View Code? Open in Web Editor NEWPopup blocking userscript
License: GNU Lesser General Public License v3.0
Popup blocking userscript
License: GNU Lesser General Public License v3.0
Firefox 55.0.3 x64
Adguard 6.2.400
Popup Blocker 2.1.7
Sample URL for testing: https://clicknupload.org/mqmnl7mnqbsg
Proceed to generate download link.
Issue:
When the final download button is present and you click on it, it opens a new tab, download goes to your browser or download manager and the new blank tab remains as it is.
Expected Behavior:
In chrome, although after clicking the final download button, chrome also opens a new tab but as soon as the download start, that new tab closes by itself.
Build process is constantly being complicated, I need to make it more organized. I have to bundle up 2 sources separately, one to run on the page's context and the other to run on userscript hosts' sandboxed context (to use GM_getValue
api). Below are build task components:
Report from the Telegram channel:
I need a bit help. On https://www.ubisoft.com/ apparently AdGuard inteferes with the site function. When I clicked my account management link, Adguard reacted and blocked the pop up. It also asked me on that page if I wanted to allow it. I pressed yes to allow it and clicked the same link again, but adguard again asked me if I want to put it in whitelist and blocks the popup. This happened for another round, so then instead of answering yes, I just disabled adguard from my systray altogether and relogin to the ubisoft account and it worked :<
PopupBlocker blocks log in window If you try to log in with Google+ or Facebook:
http://www.dailymotion.com/us (Click on "SIGN IN" at top right)
Continuing with the trend of converting everything from 'Adguard' to 'AdGuard'.
Should the userscript be also mentioned as - AdGuard Popup Blocker Beta?
A popup script, when not blocked, generates an overlay having z-index: 2147483647
on each of page's links, which seem to be disappearing only when certain popups are opened, making links unusable.
Steps to reproduce:
||odbabo.info^$third-party
in English filter.Expected result:
Actual result:
Chrome pdf viewer: please wait...
is triggered.This is partly a regression caused by using postMessage
inside empty iframes.
Adguard 6.2.400
Popup Blocker 2.1.7
Sample URL: http://ur.ly/xW5vmeM
Another e.g: http://ur.ly/xDRGQ00
Popups on the site after clicking on generating URL, getting link after timer(5seconds).
And after that it's not redirecting(this maybe a filter issue, not sure though).
Happens in both Chrome and firefox stable releases.
The very first task is to create a repo with a userscript meta, empty script, and unit-tests.
Take a look here to get an example:
https://github.com/AdguardTeam/AdguardAssistant
There should be three build configurations. The only difference is downloadURL/updateURL
meta attributes.
dev
-- will be published to gh-pages
beta
-- will be published to cdn.adguard.com/.../Beta
release
-- will be published to cdn.adguard.com
Prepare a file with unit-tests.
Just like it's done in the Assistant repo: build, run unit-tests, publish dev build.
PopupBlocker 2.1.7
AdGuard for Windows 6.2.424.2123
Clicking on any link will result in an error and the link won't open. Normal desktop view of the page works fine.
Otherwise, users have to uninstall and reinstall their userscript.
It could be done by a dedicated settings pane.
when using the script in Violentmonkey, if the parrot is blocked, then it is suggested to allow it on some sites, but after permission, I can not find settings with the sites for which I allowed them
Some sites, e.g. https://www.iwatchonline.cr/tv-shows/58490-wynonna-earp, tries to open popups on each clicks. Such issues can be resolved by emulating a successful popup, but it is not a reliable solution and we should provide an option like silence domain
, disable notifications (altogether)
Set up automatic export/import to/from adguard.oneskyapp.com
Script on Rapidvideo.com few week ago working perfect. No popup, no redirects - like Openload, but last weeks something change. Video working when script is active, but no working video scroll slider. When disable script and refresh rapidvideo.com slider of course working, but again opens new windows and redirects. It is possible fix this? Add Rapidvideo to whitelist not resolve problem.
Example link:
https://www.rapidvideo.com/v/FLHD1DY4YV
STR:
https://uploads.adguard.com/up05_i6z4e.png
Expected result: The pop-up has beed added to the whitelist.
Actual result: Nothing happens.
Here's the video:
https://uploads.adguard.com/up05_4axfd.mp4
reported on our forum, reproduced
With Chrome 63, when I click on image links in the page, a popup from ExoClick ads are blocked by PopupBlocker, but an underlying link is not clicked.
On a side note, the popup script appears to be abusing fullscreen api for certain old chrome version, we may need to prevent any side-effects caused by it.
Source: AdguardTeam/AdguardFilters#6606
Here are the mockups of these alerts:
https://app.moqups.com/ameshkov/ZgAlYnihrU/view/page/aa9df7b72
@IldarKamalov use the same styles as in the new extension: https://monosnap.com/file/rM0L7wwtM4FZz7ySFxkwTtbDMelIrr
Alerts will be shown inside of an iframe (to not mess with the website's own styles), so just make alerts having full width/height inside of an iframe.
Original issue:
AdguardTeam/AdguardForWindows#1851
http://www.hdsector.com/
http://www.itdmusic.com/
https://www.djmaza.life/
Steps to reproduce:
Result:
An error is displayed in the devtools console.
We need to wrap every place where we access Function.arguments
with try-catch block. Also, we need to include disqus iframe into default exceptions in release versions.
Certain popunders open a current page in a new tab and navigates the current tab to an ad page.
Some of them are respectful to the hosting page, in that it does not navigates away the current tab when an attempt to open a new tab was unsuccessful. However, others are not, and they are using window.location.href="..."
which we cannot really put any additional check onto.
I can think of following ways:
beforeunload
event to allow users to choose whether to leave the page or not. Although it is not allowed to provide custom texts in beforeunload alerts, when blocked popup alerts are implemented, user may reasonably decide about it.window.location.href
again on beforeunload
event, but it will still cause a refresh of a page. And possibly show a message "This page was refreshed to prevent redirection by popup scripts. Try this option for this website...."Function.caller
, and if it can be determined to be a disrespectful popunder, throws on the userscript to abort the popunder script.beforeunload
event with the url of the previously blocked popup request.Here respectful/disrespectful is obviously about the publisher, not to site users. Popup/popunder scripts are supposed to cooperate with the publisher to earn them money, not sabotage the publisher's website by arbitrarily navigating away.
This issue can be reproduced on https://worldwidetorrents.eu/ with Chrome.
Facebook, Disqus, VK.com use empty frames for server communication.
We should avoid injecting our userscripts to these frames.
VM8872:283 Uncaught TypeError: Cannot read property 'classList' of undefined
at Alert.$collapse (<anonymous>:283:14)
at AlertController.collapseAlert (<anonymous>:348:15)
at <anonymous>:397:27
Alert.$collapse @ VM8872:283
AlertController.collapseAlert @ VM8872:348
(anonymous) @ VM8872:397
setTimeout (async)
applyWithUnproxiedThis @ VM8872:920
o.(anonymous function) @ VM8862:3
(anonymous) @ VM8872:396
AlertController.onMouseOut @ VM8872:388
(anonymous) @ VM8872:316
https://forum.adguard.com/index.php?threads/resolved-mp3fiber-com-anti-adblock-windows.24559/
topboard.org
Such websites attach event listeners on anchor or input submit buttons. When a user clicks on such elements, it calls window.open
with an ad url, or swaps the original href attribute to ad url and call window.open
with the original href.
I have to think about what we can do to block those; I suppose, no user interaction is meant to trigger 2 navigations at once, and any such attempt is an undue abuse of APIs. We may use this as a guiding principle in detecting unwanted popups.
Source issue: AdguardTeam/AdguardFilters#7559
In http://code.ptcong.com/demos/bjp/demo.html?type=tabunder, a popunder script replicates the page to a new tab, and navigates the parent tab to a new page. However, this is currently undetected, and the second line of defense, beforeunload
event handler is triggered. Also, replicating a link url is not detected.
It may --
window.open
calls,dispatchEvent
on anchors that are disconnected from the document,click
on anchors that are disconnected from the document.The notes imply this can be installed directly into the Mac desktop app. Can it? I know you can use TamperMonkey for Safari. The Desktop v1.5 does not use this v2.1 blocker, correct? Does the desktop blocker even work?
http://tugaflix.com/Filme?F=4633690
It is almost impossible to use the site. Clicking anywhere triggers 2-3 blocked popup notifications, and it requires a lot of click to 'click' on the video player's play button. Also doubleclick or text selection does not work.
I have to figure out what they do when they detect Edge.
I can hardcode serve.popads.net
url if it works.
He has a point actually. While we want to collect the feedback on false positives, it makes sense to do it in beta/dev builds and to exclude the most popular websites in the release build.
At least these:
google
gmail
yahoo
bing
linkedin
facebook
There should be a separate build wrapping userscript into a chromium/webextensions add-on.
Basically, the userscript code should be executed in a context of a web page. Something like this:
content-script.js
var userscriptCode = getUserscriptCode();
var script = document.createElement('script');
script.innerText = userscriptCode;
document.rootElement.appendChild(script);
// Remove it once it has finished its work
document.rootElement.removeChild(script);
GM_
functions should be replaced with your own implementations.
For instance, on AdGuard Forum when it is enabled, I cannot post anything inside of a conversion or in the forum thread.
The input box in the "reply" area is invisible.
I have popup blocker installed via ViolentMonkey btw.
Video:
https://uploads.adguard.com/up04_cxpzp.mp4
Open https://www.google.com/analytics/ to reproduce it.
Think about implementing some kind of a history log that stores information about the recently blocked pop-ups:
Partly this is needed in order to circumvent the problem when the pop-up is blocked as you follow a link to another page. The notification will not be shown on the new page.
Here is the task for the alerts layout:
#12
Some general notes on the task:
Alert is shown when you block an attempt to open a window.
example.org
: domain of the pop-up window. Clicking on this link opens the popup.Always allow example.org
: allows all the pop-up windows leading to example.org
from the current website.Allow all pop-ups on this website
: that's simple.After some time alert collapses into state 2:
Click on the "pop-up" link expands it back to the state 1.
Also, if pop-up is detected by a "generic" algorithm from the first version of an extension, we should show alert in the collapsed state right away.
Basically, they are located one under one:
https://monosnap.com/file/PFeTq9dLBERo0DYPbBeadRIcuqg11U
There should be no more than 4 alerts. When fifth emerges, remove the oldest one.
2 seconds in the state 1.
5 seconds in the state 2.
Disappears after that.
Please, you could not add an option that would hide any notification of a blocked popup. Thank you
using domains are not enough, domain for about:blank
and data:text/html,base64;...
will be counted as ""
.
Also, we should determine what string to show in alert. Currently a full url is being shown, however for example we can trim it to domain only.
Example: https://vk.com/comssru
Screenshot:
When you click on this link, you are taken to the comss.ru website (new tab), but there's also a notification about the blocked popup.
The current method almost does not work in FF, because FF does not support window.event
, and retrieving event via Function.caller
is not reliable, because it cannot be used in strict mode
and can't handle recursions in the call stack. An alternative mechanism will provide much benefit for such cases.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.