Hi,
I’m building an extension that should block all requests to twitter.com.
I’m using the declarativeNetRequest to catch all requests for pages from twitter.com and redirect them to my page in the extension.
This is the dynamic rule I’m using to redirect all request to twitter to my page:
{
"action": {
"redirect": {
"extensionPath": "/public/twitter-blocked.html"
},
"type": "redirect"
},
"condition": {
"isUrlFilterCaseSensitive": false,
"regexFilter": "https?:\\/\\/(www\\.)?twitter\\.com",
"resourceTypes": ["main_frame"]
},
"id": 1,
"priority": 1
}
I noticed that if I’m visiting https://twitter.com/home for the first time this page redirects to ‘/public/twitter-blocked.html’.
But if it’s the nth visit(n >= 2) I’m getting the response from the service worker and the page is not redirected. I guess declarativeNetRequest doesn’t catch requests going to the service worker cache.
See my attached image:

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/31f65b9b-4af4-42c1-bc5a-e820becf16dan%40chromium.org.