Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scriptlets are injected too late on website reload/navigation #2855

Open
3 tasks done
kodiakhub opened this issue Jun 27, 2024 · 6 comments
Open
3 tasks done

Scriptlets are injected too late on website reload/navigation #2855

kodiakhub opened this issue Jun 27, 2024 · 6 comments
Assignees

Comments

@kodiakhub
Copy link

kodiakhub commented Jun 27, 2024

Please answer the following questions for yourself before submitting an issue

  • Filters were updated before reproducing an issue
  • I checked the knowledge base and found no answer
  • I checked to make sure that this issue has not already been filed

AdGuard Extension version

4.3.53

Browser version

Chrome 126.0.6478.127

OS version

Windows 10

Ad Blocking

AdGuard Base filter

Privacy

AdGuard Tracking Protection filter, AdGuard URL Tracking filter

Social

AdGuard Social Media filter

Annoyances

AdGuard Annoyances filter

Security

No response

Other

No response

Language-specific

AdGuard Turkish filter

What Stealth Mode options do you have enabled?

No response

Issue Details

First of all, the issue was that pop-ups were appearing on different sites when they were first opened or in certain situations and when I wanted to verify the issue again at same time, I could not reproduce it, so I did a test.

During the testing phase, I only used AdGuard filters in the uBO extension. There seems to be a issue with the AdGuard extension. It can also be noticed that the uBO extension functions faster and more fluidly than the AdGuard extension.

Steps to reproduce:

  1. Watch compare videos and reproduce the issue.

Expected Behavior

The AdGuard extension does not leak pop-ups.

Actual Behavior

The AdGuard extension leaks pop-ups.

Videos

AdGuard

AdGuard.P.mp4

uBO

uBO.P.mp4

Additional Information

No response

@AdamWr
Copy link
Member

AdamWr commented Jun 29, 2024

I guess that the problem might be like mentioned here - AdguardTeam/AdguardFilters#182479 (comment)
It looks like that on website reload/navigation sometimes scriptlets are injected too late.

Steps to reproduce:

  1. Add these rules:
fiddle.jshell.net#%#//scriptlet('set-constant', 'alert', 'noopFunc')
fiddle.jshell.net#%#debugger;

2 Go to - https://jsfiddle.net/1tmha0g8/

Code:
<script>
debugger;
alert(1);
</script>

Alert dialog should be prevented by scriptlet.

On "hard reload", scriptlet is injected in time, but when I click on "Run" button or reload website then almost always rules are injected too late.

Video
Screen.Recording.2024-06-29.121904.mp4

I have checked old version 4.2.110 and it doesn't occur in this version (I have checked this version, because it was easy to download it from - https://github.com/AdguardTeam/AdguardBrowserExtension/releases, newer versions require to build them).

@kodiakhub
Copy link
Author

kodiakhub commented Jun 30, 2024

website reload/navigation

Also happens on first visit too.


Another issue: AdguardTeam/AdguardFilters#182571

Refresh the page (no hard refresh) anti-adblock appears and some rare popups.

Update: This issue a bit different (may not related), take a look this video:

Video

Trigger.mp4

Update 2: After some test, yes it's related. See the video:

Video 2

trigger.2.mp4

Update 3: On this comment, somehow issue has been fixed, see: AdguardTeam/AdguardFilters#182902

@kodiakhub kodiakhub changed the title Pop-ups leaking in some situation. Race condition issue in some situation. Jun 30, 2024
@adguard-bot adguard-bot changed the title Race condition issue in some situation. Scriptlets are injected too late on website reload/navigation Jul 2, 2024
@adguard-bot adguard-bot assigned maximtop and unassigned alexx7311 Jul 2, 2024
@kodiakhub
Copy link
Author

Possibility another one: AdguardTeam/AdguardFilters#182802

@kodiakhub
Copy link
Author

Possibility another one: AdguardTeam/AdguardFilters#182802

Just tested again 4.1.55 vs 4.3.53 see the video:

Video

uzay.manga.mp4

This is a serious issue as end user.

@kodiakhub
Copy link
Author

Another issue: AdguardTeam/AdguardFilters#182795

Tested AdGuard extension v4.1.55 vs v4.3.53 see the video:

Video

dizikorea.vip.mp4

I think different sites and different tests are enough. 😄

@zloyden
Copy link

zloyden commented Jul 10, 2024

Another issue AdguardTeam/AdguardFilters#183315.
The rules do not work in the extension 4.3.53. Perhaps they apply too late on the site. However, they work fine in the app.

cety.app#%#//scriptlet('prevent-addEventListener', 'click', 'openPopup')
cety.app#%#//scriptlet('set-constant', 'openPopup', 'noopFunc')
cety.app#%#//scriptlet('remove-node-text', 'script', 'openPopup')

To reproduce this, you should add the exception cety.app#@%#//scriptlet('abort-on-stack-trace', 'document.createElement', 'openPopup').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants