Skip to content

Workaround declarativeNetRequest element collapsing bug #452

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

Merged

Conversation

kzar
Copy link
Contributor

@kzar kzar commented Apr 20, 2023

There's a bug[1] with the declarativeNetRequest API that means that
after blocked iframes are collapsed (hidden) they sometimes can't be
uncollapsed (shown again) after they load successfully. That causes
Click to Load to get messed up for Chrome MV3 builds of the extension,
as the content is sometimes not shown to the user again after it has
been unblocked. The bug is triggered when the collapsed iframe is
removed from the DOM.

As a workaround, let's load a benign data URI in blocked iframes
before removing them from the DOM. That way they are uncollapsed, and
so if they are added back to the page they will be visible to the
user.

1 - https://crbug.com/1428971

@kzar kzar requested a review from ladamski as a code owner April 20, 2023 14:22
@kzar kzar requested a review from franfaccin April 20, 2023 14:23
@kzar kzar force-pushed the fix-ctl-youtube-placeholders-p13 branch 2 times, most recently from 8029a6b to 7dedcad Compare April 20, 2023 14:29
@kzar kzar force-pushed the fix-ctl-youtube-placeholders-p13 branch 6 times, most recently from dff7bb8 to 97c7e57 Compare April 25, 2023 08:27
There's a bug[1] with the declarativeNetRequest API that means that
after blocked iframes are collapsed (hidden) they sometimes can't be
uncollapsed (shown again) after they load successfully. That causes
Click to Load to get messed up for Chrome MV3 builds of the extension,
as the content is sometimes not shown to the user again after it has
been unblocked. The bug is triggered when the collapsed iframe is
removed from the DOM.

As a workaround, let's load a benign data URI in blocked iframes
before removing them from the DOM. That way they are uncollapsed, and
so if they are added back to the page they will be visible to the
user.

1 - https://crbug.com/1428971
@kzar kzar force-pushed the fix-ctl-youtube-placeholders-p13 branch from 97c7e57 to 63165ae Compare April 25, 2023 11:33
@jonathanKingston jonathanKingston merged commit 527e711 into duckduckgo:main Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants