Open Bug 1657575 Opened 4 years ago Updated 3 years ago

webRequest.handlerBehaviorChanged should clear caches, including stylesheet cache

Categories

(WebExtensions :: Request Handling, defect, P2)

defect

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:

  1. Open the ABP menu
  2. Click the cog wheel
  3. Go to Advanced
  4. 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.

Flags: needinfo?(emilio)

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.

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.

Flags: needinfo?(emilio)

Set release status flags based on info from the regressing bug 1599160

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.

It's no-op code...

Moving WebExtensions.

Component: CSS Parsing and Computation → General
Product: Core → WebExtensions

Lol

Summary: Stylesheet caching broke Adblock Plus test → webRequest.handlerBehaviorChanged should clear caches, including stylehseet cache

(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

Calling this a regression is a bit of a stretch. Caching improvements broke something, but the underlying cause is pre-existing.

Keywords: regression
No longer regressed by: 1599160
Summary: webRequest.handlerBehaviorChanged should clear caches, including stylehseet cache → webRequest.handlerBehaviorChanged should clear caches, including stylesheet cache
Severity: -- → S3
Component: General → Request Handling
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.