webRequest.handlerBehaviorChanged should clear caches, including stylesheet cache
Categories
(WebExtensions :: Request Handling, defect, P2)
Tracking
(firefox-esr68 unaffected, firefox-esr78 unaffected, firefox79 affected, firefox80 affected, firefox81 affected)
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox-esr78 | --- | unaffected |
firefox79 | --- | affected |
firefox80 | --- | affected |
firefox81 | --- | affected |
People
(Reporter: evilpie, Unassigned)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-needed)
Steps to reproduce:
- Install Adblock Plus https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/?src=search
- Open https://testpages.adblockplus.org/en/exceptions/image
- Goto the the filter settings.
- Open the ABP menu
- Click the cog wheel
- Go to Advanced
- Scroll down My Filter List
- Add the filter
||testpages.adblockplus.org/testfiles/image_exception/*
- Reload the tab with the testpage
- "This should be a green element." should have a green background instead of red.
This test works before bug 1599160. It also works on Chrome with the ABP extension.
Reporter | ||
Comment 1•4 years ago
|
||
It seems like the single rule in <link rel="stylesheet" href="/testfiles/image_exception/stylesheet.css?1125569188">
that changes the background to red still applies after blocking.
Comment 2•4 years ago
|
||
This is working as expected I think. We have no way to know that something has changed that makes a webrequest hook return a different result...
Maybe we should expose some API to allow clearing the caches or something so that ABP can call it or what not, but otherwise...
This already happened before my patch if you don't reload the page and instead add the stylesheet dynamically in the same document. It'd load fine instead of getting blocked for the same reason.
Comment 3•4 years ago
|
||
Set release status flags based on info from the regressing bug 1599160
Comment 4•4 years ago
|
||
Maybe we should expose some API to allow clearing the caches or something so that ABP can call it
Well, such an API exists already and is called by Adblock Plus, see webRequest.handlerBehaviorChanged.
Comment 5•4 years ago
|
||
It's no-op code...
Moving WebExtensions.
Comment 6•4 years ago
|
||
Lol
Comment 7•4 years ago
|
||
(In reply to sebastian.noack from comment #4)
Maybe we should expose some API to allow clearing the caches or something so that ABP can call it
Well, such an API exists already and is called by Adblock Plus, see webRequest.handlerBehaviorChanged.
eh, that's a pretty elaborate description (in the mdn API doc page) for a method that is currently a no-op.
we should also fix the compatibility table (in the mdn/browser-compat-data github repo), given that it is listing this method as supported in Firefox starting from Firefox 45 (and Firefox for Android 48): https://github.com/mdn/browser-compat-data/blob/a45c3de062d0d70ddeacc6181a11cde18ee51519/webextensions/api/webRequest.json#L981-L996
Updated•4 years ago
|
Updated•4 years ago
|
Comment 8•4 years ago
|
||
Calling this a regression is a bit of a stretch. Caching improvements broke something, but the underlying cause is pre-existing.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Description
•