mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
[uri] Fix issues with external protocol handlers.
Remove early return in nsExternalProtocolHandler::NewChannel when handler doesn't exist. Fix devtools expectation that newChannel throws for unsupported external handlers
This commit is contained in:
parent
bcdf7dc845
commit
a09accc204
4 changed files with 13 additions and 43 deletions
|
|
@ -537,6 +537,7 @@ function newChannelForURL(url, { policy, window, principal }) {
|
|||
// scheme to see if it helps.
|
||||
uri = Services.io.newURI("file://" + url, null, null);
|
||||
}
|
||||
|
||||
let channelOptions = {
|
||||
contentPolicyType: policy,
|
||||
securityFlags: securityFlags,
|
||||
|
|
@ -557,15 +558,7 @@ function newChannelForURL(url, { policy, window, principal }) {
|
|||
}
|
||||
channelOptions.loadingPrincipal = prin;
|
||||
|
||||
try {
|
||||
return NetUtil.newChannel(channelOptions);
|
||||
} catch (e) {
|
||||
// In xpcshell tests on Windows, nsExternalProtocolHandler::NewChannel()
|
||||
// can throw NS_ERROR_UNKNOWN_PROTOCOL if the external protocol isn't
|
||||
// supported by Windows, so we also need to handle the exception here if
|
||||
// parsing the URL above doesn't throw.
|
||||
return newChannelForURL("file://" + url, { policy, window, principal });
|
||||
}
|
||||
return NetUtil.newChannel(channelOptions);
|
||||
}
|
||||
|
||||
// Fetch is defined differently depending on whether we are on the main thread
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue