you are definitely right, we discussed explicitly about this in D60244, the conversation we had about this can still be found nearby this comment https://phabricator.services.mozilla.com/D60244#inline-428541, where I did mention exactly this bug.
Quoting the parts related to this here:
My first comment about this:
I'm wondering if it would be reasonable to guard it with its own pref, separately from the pref that toggle the availability of the extension background ServiceWorker, I remember that there were some requests to make the Cache API available to the extension code (separately from the requests to allow the extension to register their own service workers), e.g. Bug 1575625 (comment 1 does mention the use case for the extension developer that reported that enhancement request).
Is there any issue that we may trigger if we do enable the Cache API before we are going to allow the extension to register a service worker?
It's reasonable for it to be its own preference, but then we might want these Cache API checks to basically be the logical OR-ing of the service worker pref and the explicit Cache API pref to avoid users creating fundamentally broken preference permutations.
The bar for turning Cache API on and leaving it on is much lower, we just want to make sure we're intentional about letting it ride beyond nightly.
my last reply:
totally agree, "permutations" of these preferences isn't definitely something that we want to deal with :-)
oky, sounds great, I may try to do it in this patch, but it isn't really a priority and so it may as well something to defer to a follow up (which could actually be Bug 1575625 itself)
how that would sounds to you?
And so it looks that yes, we were meant to follow up about this issue at some point.
Thanks to André for picking this up!!!
It is also worth to mention (because we will likely hit these tests while changing the related behaviors), as part of Bug 1609920 we landed also two test cases that are covering the expected behavior of using the Cache API from an extension page:
Let me know if there is any other detail that may help André with this, otherwise I'll be looking forward to the patch that will fix this issue and I'll be very happy to review and signing it off from our perspective \o/