Open Bug 1803799 Opened 3 years ago Updated 3 years ago

Use the Sanitizer.sanitize API instead of invoking cleaners directly

Categories

(WebExtensions :: General, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: mak, Unassigned)

References

Details

ExtensionBrowsingData.jsm is directly invoking the single cleaners in Sanitizer:
https://searchfox.org/mozilla-central/rev/ce78234f5e653a5d3916813ff990f053510227bc/browser/components/extensions/ExtensionBrowsingData.jsm#39-43

While that's not a big deal in itself, it's not the official API that the Sanitizer would like consumers to use, and it's limiting the possibilities to change the Sanitizer internals. I suspect the Sanitizer.items property should be private and an implementation detail.
The only other use of .items. out of the Sanitizer is to get the list of all the cleaners in Sync, for which a dedicated API could be exposed.
https://searchfox.org/mozilla-central/search?q=sanit.*%5C.items%5B%5Ea-z%5D&path=&case=false&regexp=true

I found this because In https://phabricator.services.mozilla.com/D163352 I'm making an additional argument to the cleaners mandatory, and the test here started failing.
I will put in a workaround for now (that likely one of you will review).

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Security' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Security
Product: WebExtensions → Core
Component: DOM: Security → General
Product: Core → WebExtensions

More background on the internal APIs is in bug 1531276.

See Also: → 1531276

(In reply to Marco Bonardo [:mak] from comment #0)

ExtensionBrowsingData.jsm is directly invoking the single cleaners in Sanitizer:
https://searchfox.org/mozilla-central/rev/ce78234f5e653a5d3916813ff990f053510227bc/browser/components/extensions/ExtensionBrowsingData.jsm#39-43

In https://phabricator.services.mozilla.com/D162721 I added another workaround in the sanitizer for the same reason. I marked it with a comment so we don't foreget to remove it once this bug is fixed.

Severity: -- → N/A
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.