mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Issue #910 part 1. Don't navigate when location.protocol is set to anything other than http or https.
This commit is contained in:
parent
4a6e3e375a
commit
32eb361301
1 changed files with 17 additions and 0 deletions
|
|
@ -730,6 +730,23 @@ Location::SetProtocol(const nsAString& aProtocol)
|
|||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool isHttp;
|
||||
rv = uri->SchemeIs("http", &isHttp);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool isHttps;
|
||||
rv = uri->SchemeIs("https", &isHttps);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (!isHttp && !isHttps) {
|
||||
// No-op, per spec.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return SetURI(uri);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue