diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index f0605a5ab0c..24845987daf 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1588,6 +1588,15 @@ pref("services.push.serverURL", "wss://push.services.mozilla.com/"); pref("social.sidebar.unload_timeout_ms", 10000); +// activation from inside of share panel is possible if activationPanelEnabled +// is true. Pref'd off for release while usage testing is done through beta. +#ifdef RELEASE_BUILD +pref("social.share.activationPanelEnabled", false); +#else +pref("social.share.activationPanelEnabled", true); +#endif +pref("social.shareDirectory", "https://activations.cdn.mozilla.net/en-US/sharePanel.html"); + pref("dom.identity.enabled", false); // Block insecure active content on https pages diff --git a/browser/base/content/aboutSocialError.xhtml b/browser/base/content/aboutSocialError.xhtml index eba803a915c..5cb78accca6 100644 --- a/browser/base/content/aboutSocialError.xhtml +++ b/browser/base/content/aboutSocialError.xhtml @@ -43,12 +43,17 @@ function parseQueryString() { let url = document.documentURI; - let queryString = url.replace(/^about:socialerror\??/, ""); + var searchParams = new URLSearchParams(url); - let modeMatch = queryString.match(/mode=([^&]+)/); - let mode = modeMatch && modeMatch[1] ? modeMatch[1] : ""; - let originMatch = queryString.match(/origin=([^&]+)/); - config.origin = originMatch && originMatch[1] ? decodeURIComponent(originMatch[1]) : ""; + let mode = searchParams.get("mode"); + config.directory = searchParams.get("directory"); + config.origin = searchParams.get("origin"); + let encodedURL = searchParams.get("url"); + let url = decodeURIComponent(encodedURL); + if (config.directory) { + let URI = Services.io.newURI(url, null, null); + config.origin = Services.scriptSecurityManager.getNoAppCodebasePrincipal(URI).origin; + } switch (mode) { case "compactInfo": @@ -59,10 +64,6 @@ document.getElementById("btnCloseSidebar").style.display = 'none'; //intentional fall-through case "tryAgain": - let urlMatch = queryString.match(/url=([^&]+)/); - let encodedURL = urlMatch && urlMatch[1] ? urlMatch[1] : ""; - let url = decodeURIComponent(encodedURL); - config.tryAgainCallback = loadQueryURL; config.queryURL = url; break; @@ -80,7 +81,7 @@ let productName = brandBundle.GetStringFromName("brandShortName"); let provider = Social._getProviderFromOrigin(config.origin); - let providerName = provider && provider.name; + let providerName = provider ? provider.name : config.origin; // Sets up the error message let msg = browserBundle.formatStringFromName("social.error.message", [productName, providerName], 2); diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc index b9afa3ab09f..1cf108785da 100644 --- a/browser/base/content/browser-sets.inc +++ b/browser/base/content/browser-sets.inc @@ -119,7 +119,7 @@ #endif - +