Extension doesn't inject scripts into frame in the Firefox on welt.de
Issue Details
- AdGuard version:
- AdGuard 4.1.22
- Browser and version:
- Firefox 104.0.2
- Operating system and version:
- Windows 11 Build 22000.978
- Filters you use in AdGuard:
- Base, Mobile, URL-Tracking, Tracking, Social, Annoyance, German
- Stealth Mode settings:
- Tracker, Tracker-param, hide search, donottrack, hide referrer
- Other browser extensions:
- AdGuard Extra
For some reason, some filtering rules, noticable for Cookie Pop-ups are not performed in the Extension for Firefox.
Examples:
https://www.heise.de/
Screenshot:

cmp.heise.de#%#AG_onLoad(function(){if(window.location.href.includes("consentUUID")){var g=new MutationObserver(function(){var b=document.querySelector('button[title*="ustimmen"]');b&&(g.disconnect(),b.click())});g.observe(document,{childList:!0,subtree:!0});setTimeout(function(){g.disconnect()},1E4)}});
https://www.computerbase.de/
Screenshot:

computerbase.de#%#AG_onLoad(function(){if(-1==document.cookie.indexOf("OptanonAlertBoxClosed") || -1==document.cookie.indexOf("consent") ){var a=new MutationObserver(function(){var b=document.querySelector("dialog.js-consent"),d=document.querySelector("body.consent-dialog-open");c=document.querySelector(".consent__options .js-consent-accept-button");b&&d&&c&&(a.disconnect(),c.click(),d.classList.remove("accept-cookies-button"),b.style="display: none !important;")});a.observe(document,{childList:!0,subtree:!0});setTimeout(function(){a.disconnect()},1E4)}});
https://www.welt.de/
Screenshot:

cmp.wowtv.de,sourcepoint.tvnow.de,cmp2.freiepresse.de,cmp-sp.neuepresse.de,cdn.privacy-mgmt.com,cmp.techbook.de#%#AG_onLoad(function() {var b=new MutationObserver(function() {var c=document.querySelector('button[title="Alle akzeptieren"]'); c&&(b.disconnect(),c.click()) });b.observe(document, {childList: !0,subtree: !0});setTimeout(function() {b.disconnect()}, 1E4)});
When I use Firefox with AdGuard for Windows, I don't have the issue. All 3 Pop-ups are autoclicked fine. Also when I use a Chromium based browser with Extension, it works fine. It's only Firefox+Extension.
I can reproduce the issue on a fresh browser profile, different systems, in a vm, so there is something not working in the extension. There is also no limitation for Firefox, since the Extension I don't care about cookies can bypass all 3 examples fine.
Attached my settings.
Hi! What do you mean by works unreliable?
I've pasted this rule in user rules
cmp.heise.de#%#AG_onLoad(function(){if(window.location.href.includes("consentUUID")){var g=new MutationObserver(function(){var b=document.querySelector('button[title*="ustimmen"]');b&&(g.disconnect(),b.click())});g.observe(document,{childList:!0,subtree:!0});setTimeout(function(){g.disconnect()},1E4)}});
Navigated to https://www.heise.de, and cookie consent was clicked.
This rule won't work if added via custom filters, because Firefox policy doesn't allow remote scripts to be executed in the extension. Still, it would work if added to the embedded filters with a new version of the extension.
Hi,
you are right. If I paste the heise.de filter into custom filter as single rule, it's working for me as well. Same for the computerbase rule.
When I paste the welt.de Cookie rule into custom filter, it's not working even then.
See the following video:
https://user-images.githubusercontent.com/6276915/190592159-41a6666b-73d1-4761-9d6c-fdbf67033c5c.mp4
However, all 3 rules are part of AdGuard Annoyance filterlist where I copied out.
Now, see another video where I past all 3 filter rules into the customer user rules:
https://user-images.githubusercontent.com/6276915/190592966-7e846ccd-e892-4e45-9cff-917ba729e842.mp4
For whatever reason, only the Computerbase clicking rule worked in this try. The heise Pop-up which was working before in user rules stopped working. The welt.de Pop-up filter rule never works at any try and configuration.
Thats what I mean by unreliable. The Chromium extension doesn't have that issue at all.
Again I'd like to note that if script rules were not embedded into firefox extension they won't work.
I can confirm that welt.de is not working even from userrules for firefox.
It either firefox bug, or extension try to inject script in iframe in the unsuitable time for it, because it throws error:
Error: Missing host permission for the tab or frames
even thought extension has such permissions.
We will take a closer look over this issue. With your permission I'll adjust title of this issue.
STR:
- disable all other rules
- go to userrules and add rule
cdn.privacy-mgmt.com#%#console.log('test') - go to https://www.welt.de/ actual
testis not printed in console expectedtestshould be printed in console
I don't have the deep technical knowledge to understand, why it's not working in Firefox. It's my observation. And if it is a limitation or bug by Firefox, I still don't understand, why heise.de and computerbase.de only works when I put the filter rule in custom rules when it's already in Annoyance filters.
It should always work, like when put in custom filters. And I probably will find other pages where it doesn't work as well. So for me, it's not just a welt.de issue.
Also "I don't care about cookies" also prove that autoclicking does work for 100% for all 3 pages in Firefox.
I have done your steps and thats the result. Hope I have done correctly:
Screenshots:



Looks like the same bug occurs for these websites sometimes too. I was able to reproduce it on other websites.