Taro Crown
unread,Jun 21, 2023, 6:31:28 AM6/21/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, kinoko koutya, wOxxOm, Deco, Chromium Extensions
Hello. I am also facing this problem.
I am developing an extension that controls requests using webRequestBlocking.
I am also unable to get the first request onBeforeRequest when launched on a Chromebook.
I tried wOxxOm's method below, but ran into issues.
>1. Block all main_frame requests by default via declarativeNetRequest (actually redirect them to your own dummy html and save the original URL via regexFilter, example), and then use chrome.tabs.query + chrome.tabs.update on all such tabs when your extension finally starts.By setting the default rule for declarativeNetRequest to block all main_frames, I can block the first request.
But then I need to disable the default rule in order to browse as normal,
and I also need to enable the rule just before browsing is complete (logging out of the Chromebook or shutting down the Chromebook).
I do not know how to re-enable the rule when I am done using the Chromebook.
I have considered chrome.runtime.onSuspend() but it seems not suitable as I am using background scripts.
Am I missing something?
I would like to know if there is a way to enable the declarativeNetRequest rule when the Chromebook usage is complete.
Or I would like to know how to control all requests from the time the Chromebook is started until it is finished.
Thanks.
2023年4月21日金曜日 11:19:32 UTC+9 kinoko koutya: