mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-23 07:37:29 +09:00
Bug 1432272 - Make Fetch API use the global's base URL instead of the entry document's base URL
This commit is contained in:
parent
1ac1e90b6a
commit
62e2fbc4e9
2 changed files with 6 additions and 3 deletions
|
|
@ -313,7 +313,8 @@ Request::Constructor(const GlobalObject& aGlobal,
|
||||||
nsAutoString requestURL;
|
nsAutoString requestURL;
|
||||||
nsCString fragment;
|
nsCString fragment;
|
||||||
if (NS_IsMainThread()) {
|
if (NS_IsMainThread()) {
|
||||||
nsIDocument* doc = GetEntryDocument();
|
nsCOMPtr<nsPIDOMWindowInner> inner(do_QueryInterface(global));
|
||||||
|
nsIDocument* doc = inner ? inner->GetExtantDoc() : nullptr;
|
||||||
if (doc) {
|
if (doc) {
|
||||||
GetRequestURLFromDocument(doc, input, requestURL, fragment, aRv);
|
GetRequestURLFromDocument(doc, input, requestURL, fragment, aRv);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -362,7 +363,8 @@ Request::Constructor(const GlobalObject& aGlobal,
|
||||||
} else {
|
} else {
|
||||||
nsAutoString referrerURL;
|
nsAutoString referrerURL;
|
||||||
if (NS_IsMainThread()) {
|
if (NS_IsMainThread()) {
|
||||||
nsIDocument* doc = GetEntryDocument();
|
nsCOMPtr<nsPIDOMWindowInner> inner(do_QueryInterface(global));
|
||||||
|
nsIDocument* doc = inner ? inner->GetExtantDoc() : nullptr;
|
||||||
nsCOMPtr<nsIURI> uri;
|
nsCOMPtr<nsIURI> uri;
|
||||||
if (doc) {
|
if (doc) {
|
||||||
uri = ParseURLFromDocument(doc, referrer, aRv);
|
uri = ParseURLFromDocument(doc, referrer, aRv);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,8 @@ Response::Redirect(const GlobalObject& aGlobal, const nsAString& aUrl,
|
||||||
|
|
||||||
if (NS_IsMainThread()) {
|
if (NS_IsMainThread()) {
|
||||||
nsCOMPtr<nsIURI> baseURI;
|
nsCOMPtr<nsIURI> baseURI;
|
||||||
nsIDocument* doc = GetEntryDocument();
|
nsCOMPtr<nsPIDOMWindowInner> inner(do_QueryInterface(aGlobal.GetAsSupports()));
|
||||||
|
nsIDocument* doc = inner ? inner->GetExtantDoc() : nullptr;
|
||||||
if (doc) {
|
if (doc) {
|
||||||
baseURI = doc->GetBaseURI();
|
baseURI = doc->GetBaseURI();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue