New issue
Advanced search Search tips

Issue 916498 link

Starred by 5 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

Feature Enhancement | add support for 'asyncBlocking' in chrome.webRequest.onBeforeRequest

Reported by assaf.al...@gmail.com, Dec 19

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Steps to reproduce the problem:
1. we created an enterprise Chrome extension 
2. In the Chrome extension we use chrome.WebRequest.onBeforeRequest.addListener function to receive a call before file uploads and form-text posting (see https://developer.chrome.com/extensions/webRequest#event-onBeforeRequest)
3. Open dropbox.com or gmail.com or box.com (or any other web-application that allows to attach/upload files to a web-application)
4. upload a file to the web-application using drag&drop or using file-browse dialog
5. the onBeforeRequest callback function in our Chrome extension is called by Chrome and our Chrome extension needs to call an external C++ process which we do using a native messaging process.
6. The call to the external C++ native messaging process is done using port.postMessage() and this call is asynchronous which means that our extension does not wait to get a response and the file/text upload is completed.

What is the expected behavior?
Our product is an enterprise product with hundreds of fortune 500 customers that use the product to prevent employees stealing confidential data of the company.
Our Chrome extension needs to communicate with an external process to determine IF the WebRequest needs to be blocked or allowed.

Since the port.postmessage is asynchronous the product cannot block the request and by the time the response of the port.postmessage function return asynchronously the file or text has already been uploaded...

we need Chrome API to be extended to support AsyncBlocking similar to how Firefox 52 and onward provides a similar functionality
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest 

What went wrong?
Chrome API webRequest.onBeforeRequest does not support asyncBlocking NOR synchronous blocking so by the time our product returns a a response to BLOCK the file (or text) are already uploaded so it is too late and the data is stolen. 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 71.0.3578.98  Channel: stable
OS Version: 10.0
Flash Version:
 
It was asked multiple times over the last 5 or 10 years so I doubt they'll implement it now.
The usual reason is they can't implement it in a performant fashion (e.g.  bug 111844 ).

Also note, Chrome extensions API is about to be redesigned which will limit webRequest even further:
https://docs.google.com/document/d/1nPu6Wy4LWR66EFLeYInl3NzzhHzc-qnk4w4PX-0XMw8/view#heading=h.xe5njuo7voeb

Components: Platform>Extensions
Labels: Needs-Triage-M71
Cc: phanindra.mandapaka@chromium.org
Labels: -Type-Bug Triaged-ET Target-73 M-73 FoundIn-71 FoundIn-72 FoundIn-73 Type-Feature
Status: Untriaged (was: Unconfirmed)
Thanks for filing the issue...

As per comment #0, it seems to be a feature request. Hence, marking it as untriaged for further inputs from Dev team.

Thanks..!
Cc: rdevlin....@chromium.org jawag@chromium.org
Status: Available (was: Untriaged)
@1 described our concerns pretty well - doing this in a performant fashion is hard, and it could much more easily lead to a terrible user experience.

It is possible that we would allow enterprise extensions to do this, since there is less concern there.  However, it's not something the extensions team will get to in the near future.

Sign in to add a comment