Skip to content

Conversation

@danielhjacobs
Copy link
Contributor

This section of code tests if the responseHeaders RuleCondition is supported and not behind a flag, but if the RuleCondition is enabled behind a flag it will successfully register a rule which matches any request, even if it doesn't match the unsupported RuleCondition. What that means is on Chromium 121-127 a rule is registered via lines 37 - 50 that blocks every request. It shouldn't matter though, as that rule is removed by lines 57 - 59, but just in case that fails to remove the rule, it's better if the rule does nothing.

@danielhjacobs danielhjacobs added A-web Area: Web & Extensions extension Related to the Ruffle WebExtension T-fix Type: Bug fix (in something that's supposed to work already) labels Dec 23, 2025
@danielhjacobs
Copy link
Contributor Author

This last cropped up in #20045 due, ultimately, to a webpack bug. It is possible, though currently unknown, that it may be the cause of #22589 too.

Copy link
Member

@kjarosh kjarosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense even if it doesn't fix #22589

@kjarosh
Copy link
Member

kjarosh commented Dec 23, 2025

Is it somehow possible that we need cleanup even if needsCleanup is false?

@danielhjacobs
Copy link
Contributor Author

We shouldn't i don't think as it's only false if the rule registering throws in both trys (which should mean no rules were registered).

@danielhjacobs
Copy link
Contributor Author

The code was suggested by Rob--W of the Mozilla extension team: w3c/webextensions#638 (comment)

@torokati44
Copy link
Member

(I just don't understand the PR title / commit message ... is there a word missing?)

@danielhjacobs
Copy link
Contributor Author

danielhjacobs commented Dec 23, 2025

Make it (so) if cleanup fails (the) RuleCondition test (still) does nothing

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

Labels

A-web Area: Web & Extensions extension Related to the Ruffle WebExtension T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants