Block and Forward request in V3

96 views
Skip to first unread message

IJB_DEV

unread,
Sep 30, 2024, 1:43:07 PMSep 30
to Chromium Extensions
Hi,
In V2, using webrequest, we were able to analyze the data being posted for data leak and block/allow accordingly.
May I know how to achieve the same functionality in V3.
Thanks

woxxom

unread,
Sep 30, 2024, 6:54:27 PMSep 30
to Chromium Extensions, IJB_DEV
The only way to do it in Chrome is to force-install the extension via policies to enable the webRequestBlocking permission.

A limited workaround is to intercept all methods that upload data in the main world of the page (fetch, XMLHttpRequest, submitting forms), but it won't help with requests issued from a worker or when the page extracts the original functions from an iframe before a content script runs inside due to an ancient bug with document_start timing in all browsers.

You can add a feature request in https://crbug.com and in https://github.com/w3c/webextensions/issues/610 or https://github.com/w3c/webextensions/issues/109, but I wouldn't expect it to happen any time soon, judging by the fact that it took six years or so for declaratveNetRequest to reach its current state with spotty coverage of the most basic needs.

Reply all
Reply to author
Forward
0 new messages