Unable to capture error when adding chrome.webRequest.* listener for invalid URL pattern
Reported by
tamer.zo...@blazemeter.com,
Feb 27 2017
|
||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Steps to reproduce the problem:
1. Register one of chrome.webRequest.* listeners
for example:
chrome.webRequest.onBeforeRequest.addListener( blockSites, { urls: ["<bad_url>"] }, ['blocking'] );
with bad url which doesn't pass Chrome Match patterns validation (https://developer.chrome.com/extensions/match_patterns)
2. In console we will get syntax error:
Unchecked runtime.lastError while running webRequestInternal.addEventListener: '<bad url>' is not a valid URL pattern.
What is the expected behavior?
We tried to use onErrorOccurred but it never gets called for this specific error.
Also checking for chrome.runtime.lastError inside WebRequest callback doesn't supress the error (it even doesn't reach the callback since error happens before).
We expect to be able to catch this error using chrome.runtime.lastError similar to the rest of the extension system.
What went wrong?
In our use case we allow users to enter list of URLs in our extension, however if user enters wrong URL pattern we have no way of reporting this error to the user.
Did this work before? No
Does this work in other browsers? Yes
Chrome version: 56.0.2924.87 Channel: stable
OS Version: OS X 10.12.3
Flash Version: Shockwave Flash 24.0 r0
,
Feb 27 2017
,
Feb 27 2017
,
Mar 1 2017
tamer.zoubi@ Thanks for the issue. Could you please provide us any sample URL to triage the issue from test team end. Thanks,
,
Mar 1 2017
kavvaru@, this bug report is about the extension API itself, not about a web page. Simplified repro if you really need it: 1. Unpack the attached extension zip 2. Open chrome://extensions and enable [x] Developer mode 3. Drag'n'drop the unpacked folder onto the page or use "Load unpacked extension" 4. Click "Inspect views: background page" of the installed extension 5. Observe the Console panel in the devtools that just appeared EXPECTED output: Error successfully caught OBSERVED output: Detecting via exception: FAILED, none thrown Detecting via runtime.lastError: FAILED, not set Detecting via webRequest.hasListener: FAILED, the nonfunctional listener is attached Unchecked runtime.lastError while running webRequestInternal.addEventListener: '<bad_url>' is not a valid URL pattern.
,
Mar 10 2017
Seems to be blocked on issue 366282.
,
Jan 22 2018
Mac triage: Assigning to rdevlin.cronin@ for further triage or routing, since they own issue 366282.
,
Aug 7
This is also happening on Windows 10 machines. User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
,
Aug 8
Triage! -> karandeepb@, who has been doing webRequest work lately. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by woxxom@gmail.com
, Feb 27 2017