diff options
author | Moonchild <moonchild@palemoon.org> | 2023-04-30 10:55:21 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-04-30 10:55:21 +0000 |
commit | 4d4d8cfc9f73d48208afcfde9216fcddf9aecec3 (patch) | |
tree | 40f64e8c13e06113b10b582cf7533a9f1c7526b6 /dom/fetch/Request.cpp | |
parent | ff537f4ffd19fd56a15635e5b3b711f14e502fcb (diff) | |
parent | 80a323d747f33e9e918bfde381c97346c1052a97 (diff) | |
download | uxp-4d4d8cfc9f73d48208afcfde9216fcddf9aecec3.tar.gz |
Merge pull request 'Bug 1432272 - Make Fetch API use the global's base URL instead of the entry document's base URL' (#2217) from FranklinDM/UXP-contrib:work_js-bz-1432272 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2217
Diffstat (limited to 'dom/fetch/Request.cpp')
-rw-r--r-- | dom/fetch/Request.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dom/fetch/Request.cpp b/dom/fetch/Request.cpp index 7a93a81799..ab87a3215a 100644 --- a/dom/fetch/Request.cpp +++ b/dom/fetch/Request.cpp @@ -313,7 +313,8 @@ Request::Constructor(const GlobalObject& aGlobal, nsAutoString requestURL; nsCString fragment; if (NS_IsMainThread()) { - nsIDocument* doc = GetEntryDocument(); + nsCOMPtr<nsPIDOMWindowInner> inner(do_QueryInterface(global)); + nsIDocument* doc = inner ? inner->GetExtantDoc() : nullptr; if (doc) { GetRequestURLFromDocument(doc, input, requestURL, fragment, aRv); } else { @@ -362,7 +363,8 @@ Request::Constructor(const GlobalObject& aGlobal, } else { nsAutoString referrerURL; if (NS_IsMainThread()) { - nsIDocument* doc = GetEntryDocument(); + nsCOMPtr<nsPIDOMWindowInner> inner(do_QueryInterface(global)); + nsIDocument* doc = inner ? inner->GetExtantDoc() : nullptr; nsCOMPtr<nsIURI> uri; if (doc) { uri = ParseURLFromDocument(doc, referrer, aRv); |