diff options
-rw-r--r-- | application/palemoon/base/content/browser.js | 112 | ||||
-rw-r--r-- | dom/fetch/Request.cpp | 2 | ||||
-rw-r--r-- | dom/tests/mochitest/fetch/test_fetch_cors.js | 4 | ||||
-rw-r--r-- | dom/tests/mochitest/fetch/test_request.js | 4 | ||||
-rw-r--r-- | testing/web-platform/tests/fetch/api/request/request-init-003.sub.html | 2 | ||||
-rw-r--r-- | testing/web-platform/tests/fetch/api/request/request-structure.html | 2 |
6 files changed, 64 insertions, 62 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index c1643caa4..c8f287693 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -420,7 +420,8 @@ var gPopupBlockerObserver = { if (!this._reportButton && gURLBar) this._reportButton = document.getElementById("page-report-button"); - if (!gBrowser.selectedBrowser.blockedPopups) { + if (!gBrowser.selectedBrowser.blockedPopups || + !gBrowser.selectedBrowser.blockedPopups.length) { // Hide the icon in the location bar (if the location bar exists) if (gURLBar) this._reportButton.hidden = true; @@ -522,65 +523,66 @@ var gPopupBlockerObserver = { else blockedPopupAllowSite.removeAttribute("disabled"); - var foundUsablePopupURI = false; - var blockedPopups = browser.blockedPopups; - if (blockedPopups) { - for (let i = 0; i < blockedPopups.length; i++) { - let blockedPopup = blockedPopups[i]; - - // popupWindowURI will be null if the file picker popup is blocked. - // xxxdz this should make the option say "Show file picker" and do it (Bug 590306) - if (!blockedPopup.popupWindowURI) - continue; - var popupURIspec = blockedPopup.popupWindowURI.spec; - - // Sometimes the popup URI that we get back from the blockedPopup - // isn't useful (for instance, netscape.com's popup URI ends up - // being "http://www.netscape.com", which isn't really the URI of - // the popup they're trying to show). This isn't going to be - // useful to the user, so we won't create a menu item for it. - if (popupURIspec == "" || popupURIspec == "about:blank" || - popupURIspec == uri.spec) - continue; - - // Because of the short-circuit above, we may end up in a situation - // in which we don't have any usable popup addresses to show in - // the menu, and therefore we shouldn't show the separator. However, - // since we got past the short-circuit, we must've found at least - // one usable popup URI and thus we'll turn on the separator later. - foundUsablePopupURI = true; - - var menuitem = document.createElement("menuitem"); - var label = gNavigatorBundle.getFormattedString("popupShowPopupPrefix", - [popupURIspec]); - menuitem.setAttribute("label", label); - menuitem.setAttribute("popupWindowURI", popupURIspec); - menuitem.setAttribute("popupWindowFeatures", blockedPopup.popupWindowFeatures); - menuitem.setAttribute("popupWindowName", blockedPopup.popupWindowName); - menuitem.setAttribute("oncommand", "gPopupBlockerObserver.showBlockedPopup(event);"); - menuitem.setAttribute("popupReportIndex", i); - menuitem.popupReportBrowser = browser; - aEvent.target.appendChild(menuitem); - } - } - - // Show or hide the separator, depending on whether we added any - // showable popup addresses to the menu. - var blockedPopupsSeparator = - document.getElementById("blockedPopupsSeparator"); - if (foundUsablePopupURI) - blockedPopupsSeparator.removeAttribute("hidden"); - else - blockedPopupsSeparator.setAttribute("hidden", true); - - var blockedPopupDontShowMessage = document.getElementById("blockedPopupDontShowMessage"); - var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage"); + let blockedPopupDontShowMessage = document.getElementById("blockedPopupDontShowMessage"); + let showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage"); blockedPopupDontShowMessage.setAttribute("checked", !showMessage); if (aEvent.target.anchorNode.id == "page-report-button") { aEvent.target.anchorNode.setAttribute("open", "true"); blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromLocationbar")); - } else + } else { blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage")); + } + + let blockedPopupsSeparator = + document.getElementById("blockedPopupsSeparator"); + blockedPopupsSeparator.setAttribute("hidden", true); + + gBrowser.selectedBrowser.retrieveListOfBlockedPopups().then(blockedPopups => { + let foundUsablePopupURI = false; + if (blockedPopups) { + for (let i = 0; i < blockedPopups.length; i++) { + let blockedPopup = blockedPopups[i]; + + // popupWindowURI will be null if the file picker popup is blocked. + // xxxdz this should make the option say "Show file picker" and do it (Bug 590306) + if (!blockedPopup.popupWindowURIspec) + continue; + + var popupURIspec = blockedPopup.popupWindowURIspec; + + // Sometimes the popup URI that we get back from the blockedPopup + // isn't useful (for instance, netscape.com's popup URI ends up + // being "http://www.netscape.com", which isn't really the URI of + // the popup they're trying to show). This isn't going to be + // useful to the user, so we won't create a menu item for it. + if (popupURIspec == "" || popupURIspec == "about:blank" || + popupURIspec == "<self>" || + popupURIspec == uri.spec) + continue; + + // Because of the short-circuit above, we may end up in a situation + // in which we don't have any usable popup addresses to show in + // the menu, and therefore we shouldn't show the separator. However, + // since we got past the short-circuit, we must've found at least + // one usable popup URI and thus we'll turn on the separator later. + foundUsablePopupURI = true; + + var menuitem = document.createElement("menuitem"); + var label = gNavigatorBundle.getFormattedString("popupShowPopupPrefix", + [popupURIspec]); + menuitem.setAttribute("label", label); + menuitem.setAttribute("oncommand", "gPopupBlockerObserver.showBlockedPopup(event);"); + menuitem.setAttribute("popupReportIndex", i); + menuitem.popupReportBrowser = browser; + aEvent.target.appendChild(menuitem); + } + } + + // Show the separator if we added any + // showable popup addresses to the menu. + if (foundUsablePopupURI) + blockedPopupsSeparator.removeAttribute("hidden"); + }, null); }, onPopupHiding: function (aEvent) { diff --git a/dom/fetch/Request.cpp b/dom/fetch/Request.cpp index bc17afae3..c119a503e 100644 --- a/dom/fetch/Request.cpp +++ b/dom/fetch/Request.cpp @@ -327,7 +327,7 @@ Request::Constructor(const GlobalObject& aGlobal, RequestCache fallbackCache = RequestCache::EndGuard_; if (aInput.IsUSVString()) { fallbackMode = RequestMode::Cors; - fallbackCredentials = RequestCredentials::Omit; + fallbackCredentials = RequestCredentials::Same_origin; fallbackCache = RequestCache::Default; } diff --git a/dom/tests/mochitest/fetch/test_fetch_cors.js b/dom/tests/mochitest/fetch/test_fetch_cors.js index ac83d050d..f375ce73f 100644 --- a/dom/tests/mochitest/fetch/test_fetch_cors.js +++ b/dom/tests/mochitest/fetch/test_fetch_cors.js @@ -64,9 +64,9 @@ function testSameOriginCredentials() { withCred: "same-origin", }, { - // Default mode is "omit". + // Default mode is "same-origin". pass: 1, - noCookie: 1, + cookie: cookieStr, }, { pass: 1, diff --git a/dom/tests/mochitest/fetch/test_request.js b/dom/tests/mochitest/fetch/test_request.js index badad61b9..5be361a46 100644 --- a/dom/tests/mochitest/fetch/test_request.js +++ b/dom/tests/mochitest/fetch/test_request.js @@ -6,7 +6,7 @@ function testDefaultCtor() { is(req.context, "fetch", "Default context is fetch."); is(req.referrer, "about:client", "Default referrer is `client` which serializes to about:client."); is(req.mode, "cors", "Request mode for string input is cors"); - is(req.credentials, "omit", "Default Request credentials is omit"); + is(req.credentials, "same-origin", "Default Request credentials is same-origin"); is(req.cache, "default", "Default Request cache is default"); var req = new Request(req); @@ -16,7 +16,7 @@ function testDefaultCtor() { is(req.context, "fetch", "Default context is fetch."); is(req.referrer, "about:client", "Default referrer is `client` which serializes to about:client."); is(req.mode, "cors", "Request mode string input is cors"); - is(req.credentials, "omit", "Default Request credentials is omit"); + is(req.credentials, "same-origin", "Default Request credentials is same-origin"); is(req.cache, "default", "Default Request cache is default"); } diff --git a/testing/web-platform/tests/fetch/api/request/request-init-003.sub.html b/testing/web-platform/tests/fetch/api/request/request-init-003.sub.html index 8860d6074..1f95c5ae9 100644 --- a/testing/web-platform/tests/fetch/api/request/request-init-003.sub.html +++ b/testing/web-platform/tests/fetch/api/request/request-init-003.sub.html @@ -44,7 +44,7 @@ "referrer" : "http://{{host}}:{{ports[http][0]}}/", "referrerPolicy" : "", "mode" : "cors", - "credentials" : "omit", + "credentials" : "same-origin", "cache" : "default", "redirect" : "follow", "integrity" : "", diff --git a/testing/web-platform/tests/fetch/api/request/request-structure.html b/testing/web-platform/tests/fetch/api/request/request-structure.html index cbe6cee99..9494689c7 100644 --- a/testing/web-platform/tests/fetch/api/request/request-structure.html +++ b/testing/web-platform/tests/fetch/api/request/request-structure.html @@ -82,7 +82,7 @@ break; case "credentials": - defaultValue = "omit"; + defaultValue = "same-origin"; newValue = "cors"; break; |