Improve cosmetic filtering performance on iOS #42530
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
Description
We should try to improve the performance / time before hiding elements with cosmetic filtering.
Steps to reproduce
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
Reproducibility
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
The text was updated successfully, but these errors were encountered: