Webrequest events not triggered for https://mail.google.com

99 views
Skip to first unread message

Silambarasan Raju

unread,
May 31, 2023, 12:30:47 PM5/31/23
to Chromium Extensions
//this is my webrequest api handle which will trigger for all APIs where as but not trigger for https://mail.google.com. On analysis it loads from service worker. How to over come this. 


NOTE : But some other extension have the events get this event triggered successfully. and there is no much difference from my extension. please suggest
chrome.webRequest.onBeforeRequest.addListener(
    function (details) {
      if (details.type === "main_frame") {
        console.log(details)
      }
    },
    { urls: ["<all_urls>"] }
  );

wOxxOm

unread,
May 31, 2023, 4:53:18 PM5/31/23
to Chromium Extensions, Silambarasan Raju
You'll have to unregister the site's service worker and clear its cache, see https://stackoverflow.com/a/69177790

Simeon Vincent

unread,
May 31, 2023, 11:52:46 PM5/31/23
to wOxxOm, Chromium Extensions, Silambarasan Raju
While wOxxOm's suggestion will work, removing a site's service worker may have unexpected side effects on the user's experience.

I feel like this may be an XY problem, so let's take a step back. What are you trying to accomplish with the webRequest.onBeforeRequest listener? 

Simeon - @dotproto


--
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/ee6501b9-13d5-4c09-a5ff-144b739bd9f7n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages