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

Improve cosmetic filtering performance on iOS #42530

Open
3 of 5 tasks
StephenHeaps opened this issue Nov 26, 2024 · 0 comments · May be fixed by brave/brave-core#27272
Open
3 of 5 tasks

Improve cosmetic filtering performance on iOS #42530

StephenHeaps opened this issue Nov 26, 2024 · 0 comments · May be fixed by brave/brave-core#27272
Assignees
Labels
feature/shields/adblock Blocking ads & trackers with Shields OS/iOS Fixes related to iOS browser functionality priority/P3 The next thing for us to work on. It'll ride the trains. privacy

Comments

@StephenHeaps
Copy link

Description

We should try to improve the performance / time before hiding elements with cosmetic filtering.

Steps to reproduce

  1. Visit https://www.codeweavers.com/ with Shields up
  2. Observe a few second delay before cookie consent banner is hidden

Actual result

4+ seconds before cookie consent is hidden

Expected result

Hide cookie consent faster

Reproduces how often

Easily reproduced

Brave version

Any

Device/iOS version

Any

Affected browser versions

  • latest AppStore
  • latest TestFlight
  • previous TestFlight

Reproducibility

  • with Brave Shields disabled
  • in the latest version of mobile Safari

Miscellaneous information

Currently the SelectorsPollerScript.js is debouncing not throttling:
https://github.com/brave/brave-core/blob/b8b2288791d6e8c5160c0c7c9dc2c49f05bd5cfe/ios/brave-ios/Sources/Brave/Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Sandboxed/SelectorsPollerScript.js#L1067

This causes us to delay applying the stylesheet changes until a site stops mutating, despite us having a list of selectors we wish to hide. We should be able to adjust this logic to throttle instead of debounce to improve the delay before applying cosmetic filtering.

Some more info:
https://bravesoftware.slack.com/archives/C3GNZANPR/p1728083196381259?thread_ts=1727926087.911499&cid=C3GNZANPR

@StephenHeaps StephenHeaps added feature/shields/adblock Blocking ads & trackers with Shields OS/iOS Fixes related to iOS browser functionality privacy labels Nov 26, 2024
@StephenHeaps StephenHeaps self-assigned this Nov 26, 2024
@StephenHeaps StephenHeaps changed the title Improve cosmetic filtering performance Improve cosmetic filtering performance on iOS Nov 26, 2024
@ShivanKaul ShivanKaul added the priority/P3 The next thing for us to work on. It'll ride the trains. label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/shields/adblock Blocking ads & trackers with Shields OS/iOS Fixes related to iOS browser functionality priority/P3 The next thing for us to work on. It'll ride the trains. privacy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants