forked from mirrors/gecko-dev
Bug 1889232 - Removed firefox-bridge and firefox-private-bridge protocol creation r=mhughes,Gijs,firefox-desktop-core-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D206419
This commit is contained in:
parent
85a29bfa16
commit
78d468b22c
8 changed files with 285 additions and 429 deletions
|
|
@ -232,22 +232,6 @@
|
||||||
<string>file</string>
|
<string>file</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
|
||||||
<key>CFBundleURLName</key>
|
|
||||||
<string>Firefox Protocol</string>
|
|
||||||
<key>CFBundleURLSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>firefox-bridge</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleURLName</key>
|
|
||||||
<string>Firefox Private Browsing Protocol</string>
|
|
||||||
<key>CFBundleURLSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>firefox-private-bridge</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>@MAC_BUNDLE_VERSION@</string>
|
<string>@MAC_BUNDLE_VERSION@</string>
|
||||||
|
|
|
||||||
|
|
@ -60,62 +60,8 @@ function shouldLoadURI(aURI) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateFirefoxProtocol(aCmdLine, launchedWithArg_osint) {
|
function resolveURIInternal(aCmdLine, aArgument) {
|
||||||
let paramCount = 0;
|
|
||||||
// Only accept one parameter when we're handling the protocol.
|
|
||||||
for (let i = 0; i < aCmdLine.length; i++) {
|
|
||||||
if (!aCmdLine.getArgument(i).startsWith("-")) {
|
|
||||||
paramCount++;
|
|
||||||
}
|
|
||||||
if (paramCount > 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// `-osint` and handling registered file types and protocols is Windows-only.
|
|
||||||
return AppConstants.platform != "win" || launchedWithArg_osint;
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolveURIInternal(
|
|
||||||
aCmdLine,
|
|
||||||
aArgument,
|
|
||||||
launchedWithArg_osint = false
|
|
||||||
) {
|
|
||||||
let principal = lazy.gSystemPrincipal;
|
let principal = lazy.gSystemPrincipal;
|
||||||
|
|
||||||
// If using Firefox protocol handler remove it from URI
|
|
||||||
// at this stage. This is before we would otherwise
|
|
||||||
// record telemetry so do that here.
|
|
||||||
let handleFirefoxProtocol = protocol => {
|
|
||||||
let protocolWithColon = protocol + ":";
|
|
||||||
if (aArgument.startsWith(protocolWithColon)) {
|
|
||||||
if (!validateFirefoxProtocol(aCmdLine, launchedWithArg_osint)) {
|
|
||||||
throw new Error(
|
|
||||||
"Invalid use of Firefox-bridge and Firefox-private-bridge protocols."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
aArgument = aArgument.substring(protocolWithColon.length);
|
|
||||||
|
|
||||||
if (
|
|
||||||
!aArgument.startsWith("http://") &&
|
|
||||||
!aArgument.startsWith("https://")
|
|
||||||
) {
|
|
||||||
throw new Error(
|
|
||||||
"Firefox-bridge and Firefox-private-bridge protocols can only be used in conjunction with http and https urls."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
principal = Services.scriptSecurityManager.createNullPrincipal({});
|
|
||||||
Services.telemetry.keyedScalarAdd(
|
|
||||||
"os.environment.launched_to_handle",
|
|
||||||
protocol,
|
|
||||||
1
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
handleFirefoxProtocol("firefox-bridge");
|
|
||||||
handleFirefoxProtocol("firefox-private-bridge");
|
|
||||||
|
|
||||||
var uri = aCmdLine.resolveURI(aArgument);
|
var uri = aCmdLine.resolveURI(aArgument);
|
||||||
var uriFixup = Services.uriFixup;
|
var uriFixup = Services.uriFixup;
|
||||||
|
|
||||||
|
|
@ -602,17 +548,7 @@ nsBrowserContentHandler.prototype = {
|
||||||
"private-window",
|
"private-window",
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
// Check for Firefox private browsing protocol handler here.
|
if (privateWindowParam) {
|
||||||
let url = null;
|
|
||||||
let urlFlagIdx = cmdLine.findFlag("url", false);
|
|
||||||
if (urlFlagIdx > -1 && cmdLine.length > 1) {
|
|
||||||
url = cmdLine.getArgument(urlFlagIdx + 1);
|
|
||||||
}
|
|
||||||
if (privateWindowParam || url?.startsWith("firefox-private-bridge:")) {
|
|
||||||
// Check if the osint flag is present on Windows
|
|
||||||
let launchedWithArg_osint =
|
|
||||||
AppConstants.platform == "win" &&
|
|
||||||
cmdLine.findFlag("osint", false) == 0;
|
|
||||||
let forcePrivate = true;
|
let forcePrivate = true;
|
||||||
let resolvedInfo;
|
let resolvedInfo;
|
||||||
if (!lazy.PrivateBrowsingUtils.enabled) {
|
if (!lazy.PrivateBrowsingUtils.enabled) {
|
||||||
|
|
@ -623,19 +559,8 @@ nsBrowserContentHandler.prototype = {
|
||||||
uri: Services.io.newURI("about:privatebrowsing"),
|
uri: Services.io.newURI("about:privatebrowsing"),
|
||||||
principal: lazy.gSystemPrincipal,
|
principal: lazy.gSystemPrincipal,
|
||||||
};
|
};
|
||||||
} else if (url?.startsWith("firefox-private-bridge:")) {
|
|
||||||
cmdLine.removeArguments(urlFlagIdx, urlFlagIdx + 1);
|
|
||||||
resolvedInfo = resolveURIInternal(
|
|
||||||
cmdLine,
|
|
||||||
url,
|
|
||||||
launchedWithArg_osint
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
resolvedInfo = resolveURIInternal(
|
resolvedInfo = resolveURIInternal(cmdLine, privateWindowParam);
|
||||||
cmdLine,
|
|
||||||
privateWindowParam,
|
|
||||||
launchedWithArg_osint
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
handURIToExistingBrowser(
|
handURIToExistingBrowser(
|
||||||
resolvedInfo.uri,
|
resolvedInfo.uri,
|
||||||
|
|
@ -1430,11 +1355,7 @@ nsDefaultCommandLineHandler.prototype = {
|
||||||
try {
|
try {
|
||||||
var ar;
|
var ar;
|
||||||
while ((ar = cmdLine.handleFlagWithParam("url", false))) {
|
while ((ar = cmdLine.handleFlagWithParam("url", false))) {
|
||||||
let { uri, principal } = resolveURIInternal(
|
let { uri, principal } = resolveURIInternal(cmdLine, ar);
|
||||||
cmdLine,
|
|
||||||
ar,
|
|
||||||
launchedWithArg_osint
|
|
||||||
);
|
|
||||||
urilist.push(uri);
|
urilist.push(uri);
|
||||||
principalList.push(principal);
|
principalList.push(principal);
|
||||||
|
|
||||||
|
|
@ -1506,9 +1427,6 @@ nsDefaultCommandLineHandler.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't open multiple URLs without using system principal.
|
// Can't open multiple URLs without using system principal.
|
||||||
// The firefox-bridge and firefox-private-bridge protocols should only
|
|
||||||
// accept a single URL due to using the -osint option
|
|
||||||
// so this isn't very relevant.
|
|
||||||
var URLlist = urilist.filter(shouldLoadURI).map(u => u.spec);
|
var URLlist = urilist.filter(shouldLoadURI).map(u => u.spec);
|
||||||
if (URLlist.length) {
|
if (URLlist.length) {
|
||||||
openBrowserWindow(cmdLine, lazy.gSystemPrincipal, URLlist);
|
openBrowserWindow(cmdLine, lazy.gSystemPrincipal, URLlist);
|
||||||
|
|
|
||||||
|
|
@ -3769,7 +3769,7 @@ BrowserGlue.prototype = {
|
||||||
_migrateUI() {
|
_migrateUI() {
|
||||||
// Use an increasing number to keep track of the current migration state.
|
// Use an increasing number to keep track of the current migration state.
|
||||||
// Completely unrelated to the current Firefox release number.
|
// Completely unrelated to the current Firefox release number.
|
||||||
const UI_VERSION = 144;
|
const UI_VERSION = 145;
|
||||||
const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
|
const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
|
||||||
|
|
||||||
if (!Services.prefs.prefHasUserValue("browser.migration.version")) {
|
if (!Services.prefs.prefHasUserValue("browser.migration.version")) {
|
||||||
|
|
@ -3777,12 +3777,6 @@ BrowserGlue.prototype = {
|
||||||
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
|
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
|
||||||
this._isNewProfile = true;
|
this._isNewProfile = true;
|
||||||
|
|
||||||
if (AppConstants.platform == "win") {
|
|
||||||
// Ensure that the Firefox Bridge protocols are registered for the new profile.
|
|
||||||
// No-op if they are registered for the user or the local machine already.
|
|
||||||
lazy.FirefoxBridgeExtensionUtils.maybeRegisterFirefoxBridgeProtocols();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4383,24 +4377,7 @@ BrowserGlue.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentUIVersion < 143) {
|
if (currentUIVersion < 143) {
|
||||||
if (AppConstants.platform == "win") {
|
// Version 143 has been superseded by version 145 below.
|
||||||
// In Firefox 122, we enabled the firefox and firefox-private protocols.
|
|
||||||
// We switched over to using firefox-bridge and firefox-private-bridge,
|
|
||||||
// but we want to clean up the use of the other protocols.
|
|
||||||
lazy.FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries();
|
|
||||||
|
|
||||||
// Register the new firefox bridge related protocols now
|
|
||||||
lazy.FirefoxBridgeExtensionUtils.maybeRegisterFirefoxBridgeProtocols();
|
|
||||||
|
|
||||||
// Clean up the old user prefs from FX 122
|
|
||||||
Services.prefs.clearUserPref(
|
|
||||||
"network.protocol-handler.external.firefox"
|
|
||||||
);
|
|
||||||
Services.prefs.clearUserPref(
|
|
||||||
"network.protocol-handler.external.firefox-private"
|
|
||||||
);
|
|
||||||
Services.prefs.clearUserPref("browser.shell.customProtocolsRegistered");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentUIVersion < 144) {
|
if (currentUIVersion < 144) {
|
||||||
|
|
@ -4420,6 +4397,40 @@ BrowserGlue.prototype = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentUIVersion < 145) {
|
||||||
|
if (AppConstants.platform == "win") {
|
||||||
|
// In Firefox 122, we enabled the firefox and firefox-private protocols.
|
||||||
|
// We switched over to using firefox-bridge and firefox-private-bridge,
|
||||||
|
// but we want to clean up the use of the other protocols.
|
||||||
|
lazy.FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
||||||
|
lazy.FirefoxBridgeExtensionUtils.OLD_PUBLIC_PROTOCOL,
|
||||||
|
lazy.FirefoxBridgeExtensionUtils.OLD_PRIVATE_PROTOCOL
|
||||||
|
);
|
||||||
|
|
||||||
|
// Clean up the old user prefs from FX 122
|
||||||
|
Services.prefs.clearUserPref(
|
||||||
|
"network.protocol-handler.external.firefox"
|
||||||
|
);
|
||||||
|
Services.prefs.clearUserPref(
|
||||||
|
"network.protocol-handler.external.firefox-private"
|
||||||
|
);
|
||||||
|
|
||||||
|
// In Firefox 126, we switched over to using native messaging so the
|
||||||
|
// protocols are no longer necessary even in firefox-bridge and
|
||||||
|
// firefox-private-bridge form
|
||||||
|
lazy.FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
||||||
|
lazy.FirefoxBridgeExtensionUtils.PUBLIC_PROTOCOL,
|
||||||
|
lazy.FirefoxBridgeExtensionUtils.PRIVATE_PROTOCOL
|
||||||
|
);
|
||||||
|
Services.prefs.clearUserPref(
|
||||||
|
"network.protocol-handler.external.firefox-bridge"
|
||||||
|
);
|
||||||
|
Services.prefs.clearUserPref(
|
||||||
|
"network.protocol-handler.external.firefox-private-bridge"
|
||||||
|
);
|
||||||
|
Services.prefs.clearUserPref("browser.shell.customProtocolsRegistered");
|
||||||
|
}
|
||||||
|
}
|
||||||
// Update the migration version.
|
// Update the migration version.
|
||||||
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
|
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -91,18 +91,6 @@
|
||||||
<uap:Logo>Assets\Document44x44.png</uap:Logo>
|
<uap:Logo>Assets\Document44x44.png</uap:Logo>
|
||||||
</uap3:Protocol>
|
</uap3:Protocol>
|
||||||
</uap3:Extension>
|
</uap3:Extension>
|
||||||
<uap3:Extension Category="windows.protocol">
|
|
||||||
<uap3:Protocol Name="firefox-bridge" Parameters="-osint -url "%1"">
|
|
||||||
<uap:DisplayName>Firefox Bridge Protocol</uap:DisplayName>
|
|
||||||
<uap:Logo>Assets\Document44x44.png</uap:Logo>
|
|
||||||
</uap3:Protocol>
|
|
||||||
</uap3:Extension>
|
|
||||||
<uap3:Extension Category="windows.protocol">
|
|
||||||
<uap3:Protocol Name="firefox-private-bridge" Parameters="-osint -private-window "%1"">
|
|
||||||
<uap:DisplayName>Firefox Private Bridge Protocol</uap:DisplayName>
|
|
||||||
<uap:Logo>Assets\Document44x44.png</uap:Logo>
|
|
||||||
</uap3:Protocol>
|
|
||||||
</uap3:Extension>
|
|
||||||
<!-- COM registrations for the notification server. -->
|
<!-- COM registrations for the notification server. -->
|
||||||
<com:Extension Category="windows.comServer">
|
<com:Extension Category="windows.comServer">
|
||||||
<com:ComServer>
|
<com:ComServer>
|
||||||
|
|
|
||||||
|
|
@ -474,25 +474,6 @@ Section "-Application" APP_IDX
|
||||||
${AddDisabledDDEHandlerValues} "FirefoxURL-$AppUserModelID" "$2" "$8,${IDI_DOCUMENT_ZERO_BASED}" \
|
${AddDisabledDDEHandlerValues} "FirefoxURL-$AppUserModelID" "$2" "$8,${IDI_DOCUMENT_ZERO_BASED}" \
|
||||||
"${AppRegName} URL" "true"
|
"${AppRegName} URL" "true"
|
||||||
|
|
||||||
; Create protocol registry keys for FirefoxBridge extensions - only if not already set
|
|
||||||
SetShellVarContext current ; Set SHCTX to HKCU
|
|
||||||
!define FIREFOX_PROTOCOL "firefox-bridge"
|
|
||||||
ClearErrors
|
|
||||||
ReadRegStr $0 SHCTX "Software\Classes\${FIREFOX_PROTOCOL}" ""
|
|
||||||
${If} $0 == ""
|
|
||||||
${AddDisabledDDEHandlerValues} "${FIREFOX_PROTOCOL}" "$2" "$8,${IDI_APPICON_ZERO_BASED}" \
|
|
||||||
"Firefox Bridge Protocol" "true"
|
|
||||||
${EndIf}
|
|
||||||
|
|
||||||
!define FIREFOX_PRIVATE_PROTOCOL "firefox-private-bridge"
|
|
||||||
ClearErrors
|
|
||||||
ReadRegStr $0 SHCTX "Software\Classes\${FIREFOX_PRIVATE_PROTOCOL}" ""
|
|
||||||
${If} $0 == ""
|
|
||||||
${AddDisabledDDEHandlerValues} "${FIREFOX_PRIVATE_PROTOCOL}" "$\"$8$\" -osint -private-window $\"%1$\"" \
|
|
||||||
"$8,${IDI_PBICON_PB_EXE_ZERO_BASED}" "Firefox Private Bridge Protocol" "true"
|
|
||||||
${EndIf}
|
|
||||||
SetShellVarContext all ; Set SHCTX to HKLM
|
|
||||||
|
|
||||||
; The keys below can be set in HKCU if needed.
|
; The keys below can be set in HKCU if needed.
|
||||||
${If} $TmpVal == "HKLM"
|
${If} $TmpVal == "HKLM"
|
||||||
; Set the Start Menu Internet and Registered App HKLM registry keys.
|
; Set the Start Menu Internet and Registered App HKLM registry keys.
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,10 @@ export const FirefoxBridgeExtensionUtils = {
|
||||||
* In Firefox 122, we enabled the firefox and firefox-private protocols.
|
* In Firefox 122, we enabled the firefox and firefox-private protocols.
|
||||||
* We switched over to using firefox-bridge and firefox-private-bridge,
|
* We switched over to using firefox-bridge and firefox-private-bridge,
|
||||||
*
|
*
|
||||||
|
* In Firefox 126, we deleted the above firefox-bridge and
|
||||||
|
* firefox-private-bridge protocols in favor of using native
|
||||||
|
* messaging so we are only keeping the deletion code.
|
||||||
|
*
|
||||||
* but we want to clean up the use of the other protocols.
|
* but we want to clean up the use of the other protocols.
|
||||||
*
|
*
|
||||||
* deleteBridgeProtocolRegistryEntryHelper handles everything outside of the logic needed for
|
* deleteBridgeProtocolRegistryEntryHelper handles everything outside of the logic needed for
|
||||||
|
|
@ -66,7 +70,15 @@ export const FirefoxBridgeExtensionUtils = {
|
||||||
* them with. If the entries are changed in any way, it is assumed that the user
|
* them with. If the entries are changed in any way, it is assumed that the user
|
||||||
* mucked with them manually and knows what they are doing.
|
* mucked with them manually and knows what they are doing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
PUBLIC_PROTOCOL: "firefox-bridge",
|
||||||
|
PRIVATE_PROTOCOL: "firefox-private-bridge",
|
||||||
|
OLD_PUBLIC_PROTOCOL: "firefox",
|
||||||
|
OLD_PRIVATE_PROTOCOL: "firefox-private",
|
||||||
|
|
||||||
maybeDeleteBridgeProtocolRegistryEntries(
|
maybeDeleteBridgeProtocolRegistryEntries(
|
||||||
|
publicProtocol = this.PUBLIC_PROTOCOL,
|
||||||
|
privateProtocol = this.PRIVATE_PROTOCOL,
|
||||||
deleteBridgeProtocolRegistryEntryHelper = new DeleteBridgeProtocolRegistryEntryHelperImplementation()
|
deleteBridgeProtocolRegistryEntryHelper = new DeleteBridgeProtocolRegistryEntryHelperImplementation()
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -110,9 +122,9 @@ export const FirefoxBridgeExtensionUtils = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
maybeDeleteRegistryKey("firefox", `\"${path}\" -osint -url \"%1\"`);
|
maybeDeleteRegistryKey(publicProtocol, `\"${path}\" -osint -url \"%1\"`);
|
||||||
maybeDeleteRegistryKey(
|
maybeDeleteRegistryKey(
|
||||||
"firefox-private",
|
privateProtocol,
|
||||||
`\"${path}\" -osint -private-window \"%1\"`
|
`\"${path}\" -osint -private-window \"%1\"`
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -122,111 +134,6 @@ export const FirefoxBridgeExtensionUtils = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the firefox-bridge and firefox-private-bridge protocols
|
|
||||||
* on the Windows platform.
|
|
||||||
*/
|
|
||||||
maybeRegisterFirefoxBridgeProtocols() {
|
|
||||||
const FIREFOX_BRIDGE_HANDLER_NAME = "firefox-bridge";
|
|
||||||
const FIREFOX_PRIVATE_BRIDGE_HANDLER_NAME = "firefox-private-bridge";
|
|
||||||
const path = Services.dirsvc.get("XREExeF", Ci.nsIFile).path;
|
|
||||||
let wrk = Cc["@mozilla.org/windows-registry-key;1"].createInstance(
|
|
||||||
Ci.nsIWindowsRegKey
|
|
||||||
);
|
|
||||||
try {
|
|
||||||
wrk.open(wrk.ROOT_KEY_CLASSES_ROOT, "", wrk.ACCESS_READ);
|
|
||||||
let FxSet = wrk.hasChild(FIREFOX_BRIDGE_HANDLER_NAME);
|
|
||||||
let FxPrivateSet = wrk.hasChild(FIREFOX_PRIVATE_BRIDGE_HANDLER_NAME);
|
|
||||||
wrk.close();
|
|
||||||
if (FxSet && FxPrivateSet) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
wrk.open(wrk.ROOT_KEY_CURRENT_USER, "Software\\Classes", wrk.ACCESS_ALL);
|
|
||||||
const maybeUpdateRegistry = (isSetAlready, handler, protocolName) => {
|
|
||||||
if (isSetAlready) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let FxKey = wrk.createChild(handler, wrk.ACCESS_ALL);
|
|
||||||
try {
|
|
||||||
// Write URL protocol key
|
|
||||||
FxKey.writeStringValue("", protocolName);
|
|
||||||
FxKey.writeStringValue("URL Protocol", "");
|
|
||||||
FxKey.close();
|
|
||||||
// Write defaultIcon key
|
|
||||||
FxKey.create(
|
|
||||||
FxKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
"Software\\Classes\\" + handler + "\\DefaultIcon",
|
|
||||||
FxKey.ACCESS_ALL
|
|
||||||
);
|
|
||||||
FxKey.open(
|
|
||||||
FxKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
"Software\\Classes\\" + handler + "\\DefaultIcon",
|
|
||||||
FxKey.ACCESS_ALL
|
|
||||||
);
|
|
||||||
FxKey.writeStringValue("", `\"${path}\",1`);
|
|
||||||
FxKey.close();
|
|
||||||
// Write shell\\open\\command key
|
|
||||||
FxKey.create(
|
|
||||||
FxKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
"Software\\Classes\\" + handler + "\\shell",
|
|
||||||
FxKey.ACCESS_ALL
|
|
||||||
);
|
|
||||||
FxKey.create(
|
|
||||||
FxKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
"Software\\Classes\\" + handler + "\\shell\\open",
|
|
||||||
FxKey.ACCESS_ALL
|
|
||||||
);
|
|
||||||
FxKey.create(
|
|
||||||
FxKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
"Software\\Classes\\" + handler + "\\shell\\open\\command",
|
|
||||||
FxKey.ACCESS_ALL
|
|
||||||
);
|
|
||||||
FxKey.open(
|
|
||||||
FxKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
"Software\\Classes\\" + handler + "\\shell\\open\\command",
|
|
||||||
FxKey.ACCESS_ALL
|
|
||||||
);
|
|
||||||
if (handler == FIREFOX_PRIVATE_BRIDGE_HANDLER_NAME) {
|
|
||||||
FxKey.writeStringValue(
|
|
||||||
"",
|
|
||||||
`\"${path}\" -osint -private-window \"%1\"`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
FxKey.writeStringValue("", `\"${path}\" -osint -url \"%1\"`);
|
|
||||||
}
|
|
||||||
} catch (ex) {
|
|
||||||
console.error(ex);
|
|
||||||
} finally {
|
|
||||||
FxKey.close();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
maybeUpdateRegistry(
|
|
||||||
FxSet,
|
|
||||||
FIREFOX_BRIDGE_HANDLER_NAME,
|
|
||||||
"URL:Firefox Bridge Protocol"
|
|
||||||
);
|
|
||||||
} catch (ex) {
|
|
||||||
console.error(ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
maybeUpdateRegistry(
|
|
||||||
FxPrivateSet,
|
|
||||||
FIREFOX_PRIVATE_BRIDGE_HANDLER_NAME,
|
|
||||||
"URL:Firefox Private Bridge Protocol"
|
|
||||||
);
|
|
||||||
} catch (ex) {
|
|
||||||
console.error(ex);
|
|
||||||
}
|
|
||||||
} catch (ex) {
|
|
||||||
console.error(ex);
|
|
||||||
} finally {
|
|
||||||
wrk.close();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getNativeMessagingHostId() {
|
getNativeMessagingHostId() {
|
||||||
let nativeMessagingHostId = "org.mozilla.firefox_bridge_nmh";
|
let nativeMessagingHostId = "org.mozilla.firefox_bridge_nmh";
|
||||||
if (AppConstants.NIGHTLY_BUILD) {
|
if (AppConstants.NIGHTLY_BUILD) {
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@ const { FirefoxBridgeExtensionUtils } = ChromeUtils.importESModule(
|
||||||
"resource:///modules/FirefoxBridgeExtensionUtils.sys.mjs"
|
"resource:///modules/FirefoxBridgeExtensionUtils.sys.mjs"
|
||||||
);
|
);
|
||||||
|
|
||||||
const FIREFOX_SHELL_OPEN_COMMAND_PATH = "firefox\\shell\\open\\command";
|
const OLD_FIREFOX_SHELL_OPEN_COMMAND_PATH = `${FirefoxBridgeExtensionUtils.OLD_PUBLIC_PROTOCOL}\\shell\\open\\command`;
|
||||||
const FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH =
|
const OLD_FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH = `${FirefoxBridgeExtensionUtils.OLD_PRIVATE_PROTOCOL}\\shell\\open\\command`;
|
||||||
"firefox-private\\shell\\open\\command";
|
const FIREFOX_SHELL_OPEN_COMMAND_PATH = `${FirefoxBridgeExtensionUtils.PUBLIC_PROTOCOL}\\shell\\open\\command`;
|
||||||
|
const FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH = `${FirefoxBridgeExtensionUtils.PRIVATE_PROTOCOL}\\shell\\open\\command`;
|
||||||
|
|
||||||
class StubbedRegistryKey {
|
class StubbedRegistryKey {
|
||||||
#children;
|
#children;
|
||||||
|
|
@ -145,206 +146,274 @@ class StubbedDeleteBridgeProtocolRegistryEntryHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(async function test_DeleteWhenSameFirefoxInstall() {
|
add_task(async function test_DeleteWhenSameFirefoxInstall() {
|
||||||
const applicationPath = "testPath";
|
for (let protocols of [
|
||||||
|
[
|
||||||
|
FirefoxBridgeExtensionUtils.OLD_PUBLIC_PROTOCOL,
|
||||||
|
FirefoxBridgeExtensionUtils.OLD_PRIVATE_PROTOCOL,
|
||||||
|
OLD_FIREFOX_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
OLD_FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
FirefoxBridgeExtensionUtils.PUBLIC_PROTOCOL,
|
||||||
|
FirefoxBridgeExtensionUtils.PRIVATE_PROTOCOL,
|
||||||
|
FIREFOX_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
],
|
||||||
|
]) {
|
||||||
|
let [publicProtocol, privateProtocol, publicPath, privatePath] = protocols;
|
||||||
|
const applicationPath = "testPath";
|
||||||
|
|
||||||
const firefoxEntries = new Map();
|
const firefoxEntries = new Map();
|
||||||
firefoxEntries.set("", `\"${applicationPath}\" -osint -url \"%1\"`);
|
firefoxEntries.set("", `\"${applicationPath}\" -osint -url \"%1\"`);
|
||||||
|
|
||||||
const firefoxProtocolRegKey = new StubbedRegistryKey(
|
const firefoxProtocolRegKey = new StubbedRegistryKey(
|
||||||
new Map(),
|
new Map(),
|
||||||
firefoxEntries
|
firefoxEntries
|
||||||
);
|
);
|
||||||
|
|
||||||
const firefoxPrivateEntries = new Map();
|
const firefoxPrivateEntries = new Map();
|
||||||
firefoxPrivateEntries.set(
|
firefoxPrivateEntries.set(
|
||||||
"",
|
"",
|
||||||
`\"${applicationPath}\" -osint -private-window \"%1\"`
|
`\"${applicationPath}\" -osint -private-window \"%1\"`
|
||||||
);
|
);
|
||||||
const firefoxPrivateProtocolRegKey = new StubbedRegistryKey(
|
const firefoxPrivateProtocolRegKey = new StubbedRegistryKey(
|
||||||
new Map(),
|
new Map(),
|
||||||
firefoxPrivateEntries
|
firefoxPrivateEntries
|
||||||
);
|
);
|
||||||
|
|
||||||
const children = new Map();
|
const children = new Map();
|
||||||
children.set(FIREFOX_SHELL_OPEN_COMMAND_PATH, firefoxProtocolRegKey);
|
children.set(publicPath, firefoxProtocolRegKey);
|
||||||
children.set(
|
children.set(privatePath, firefoxPrivateProtocolRegKey);
|
||||||
FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
|
||||||
firefoxPrivateProtocolRegKey
|
|
||||||
);
|
|
||||||
|
|
||||||
const registryRootKey = new StubbedRegistryKey(children, new Map());
|
const registryRootKey = new StubbedRegistryKey(children, new Map());
|
||||||
|
|
||||||
const stubbedDeleteBridgeProtocolRegistryHelper =
|
const stubbedDeleteBridgeProtocolRegistryHelper =
|
||||||
new StubbedDeleteBridgeProtocolRegistryEntryHelper({
|
new StubbedDeleteBridgeProtocolRegistryEntryHelper({
|
||||||
applicationPath,
|
applicationPath,
|
||||||
registryRootKey,
|
registryRootKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
||||||
stubbedDeleteBridgeProtocolRegistryHelper
|
publicProtocol,
|
||||||
);
|
privateProtocol,
|
||||||
|
stubbedDeleteBridgeProtocolRegistryHelper
|
||||||
|
);
|
||||||
|
|
||||||
ok(registryRootKey.wasCloseCalled, "Root key closed");
|
ok(registryRootKey.wasCloseCalled, "Root key closed");
|
||||||
|
|
||||||
ok(firefoxProtocolRegKey.wasOpenedForRead, "Firefox key opened");
|
ok(firefoxProtocolRegKey.wasOpenedForRead, "Firefox key opened");
|
||||||
ok(firefoxProtocolRegKey.wasCloseCalled, "Firefox key closed");
|
ok(firefoxProtocolRegKey.wasCloseCalled, "Firefox key closed");
|
||||||
ok(
|
ok(
|
||||||
registryRootKey.isChildDeleted("firefox"),
|
registryRootKey.isChildDeleted(publicProtocol),
|
||||||
"Firefox protocol registry entry deleted"
|
"Firefox protocol registry entry deleted"
|
||||||
);
|
);
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
firefoxPrivateProtocolRegKey.wasOpenedForRead,
|
firefoxPrivateProtocolRegKey.wasOpenedForRead,
|
||||||
"Firefox private key opened"
|
"Firefox private key opened"
|
||||||
);
|
);
|
||||||
ok(firefoxPrivateProtocolRegKey.wasCloseCalled, "Firefox private key closed");
|
ok(
|
||||||
ok(
|
firefoxPrivateProtocolRegKey.wasCloseCalled,
|
||||||
registryRootKey.isChildDeleted("firefox-private"),
|
"Firefox private key closed"
|
||||||
"Firefox private protocol registry entry deleted"
|
);
|
||||||
);
|
ok(
|
||||||
|
registryRootKey.isChildDeleted(privateProtocol),
|
||||||
|
"Firefox private protocol registry entry deleted"
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_DeleteWhenDifferentFirefoxInstall() {
|
add_task(async function test_DeleteWhenDifferentFirefoxInstall() {
|
||||||
const applicationPath = "testPath";
|
for (let protocols of [
|
||||||
const badApplicationPath = "testPath2";
|
[
|
||||||
|
FirefoxBridgeExtensionUtils.OLD_PUBLIC_PROTOCOL,
|
||||||
|
FirefoxBridgeExtensionUtils.OLD_PRIVATE_PROTOCOL,
|
||||||
|
OLD_FIREFOX_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
OLD_FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
FirefoxBridgeExtensionUtils.PUBLIC_PROTOCOL,
|
||||||
|
FirefoxBridgeExtensionUtils.PRIVATE_PROTOCOL,
|
||||||
|
FIREFOX_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
],
|
||||||
|
]) {
|
||||||
|
let [publicProtocol, privateProtocol, publicPath, privatePath] = protocols;
|
||||||
|
const applicationPath = "testPath";
|
||||||
|
const badApplicationPath = "testPath2";
|
||||||
|
|
||||||
const firefoxEntries = new Map();
|
const firefoxEntries = new Map();
|
||||||
firefoxEntries.set("", `\"${badApplicationPath}\" -osint -url \"%1\"`);
|
firefoxEntries.set("", `\"${badApplicationPath}\" -osint -url \"%1\"`);
|
||||||
|
|
||||||
const firefoxProtocolRegKey = new StubbedRegistryKey(
|
const firefoxProtocolRegKey = new StubbedRegistryKey(
|
||||||
new Map(),
|
new Map(),
|
||||||
firefoxEntries
|
firefoxEntries
|
||||||
);
|
);
|
||||||
|
|
||||||
const firefoxPrivateEntries = new Map();
|
const firefoxPrivateEntries = new Map();
|
||||||
firefoxPrivateEntries.set(
|
firefoxPrivateEntries.set(
|
||||||
"",
|
"",
|
||||||
`\"${badApplicationPath}\" -osint -private-window \"%1\"`
|
`\"${badApplicationPath}\" -osint -private-window \"%1\"`
|
||||||
);
|
);
|
||||||
const firefoxPrivateProtocolRegKey = new StubbedRegistryKey(
|
const firefoxPrivateProtocolRegKey = new StubbedRegistryKey(
|
||||||
new Map(),
|
new Map(),
|
||||||
firefoxPrivateEntries
|
firefoxPrivateEntries
|
||||||
);
|
);
|
||||||
|
|
||||||
const children = new Map();
|
const children = new Map();
|
||||||
children.set(FIREFOX_SHELL_OPEN_COMMAND_PATH, firefoxProtocolRegKey);
|
children.set(publicPath, firefoxProtocolRegKey);
|
||||||
children.set(
|
children.set(privatePath, firefoxPrivateProtocolRegKey);
|
||||||
FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
|
||||||
firefoxPrivateProtocolRegKey
|
|
||||||
);
|
|
||||||
|
|
||||||
const registryRootKey = new StubbedRegistryKey(children, new Map());
|
const registryRootKey = new StubbedRegistryKey(children, new Map());
|
||||||
|
|
||||||
const stubbedDeleteBridgeProtocolRegistryHelper =
|
const stubbedDeleteBridgeProtocolRegistryHelper =
|
||||||
new StubbedDeleteBridgeProtocolRegistryEntryHelper({
|
new StubbedDeleteBridgeProtocolRegistryEntryHelper({
|
||||||
applicationPath,
|
applicationPath,
|
||||||
registryRootKey,
|
registryRootKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
||||||
stubbedDeleteBridgeProtocolRegistryHelper
|
publicProtocol,
|
||||||
);
|
privateProtocol,
|
||||||
|
stubbedDeleteBridgeProtocolRegistryHelper
|
||||||
|
);
|
||||||
|
|
||||||
ok(registryRootKey.wasCloseCalled, "Root key closed");
|
ok(registryRootKey.wasCloseCalled, "Root key closed");
|
||||||
|
|
||||||
ok(firefoxProtocolRegKey.wasOpenedForRead, "Firefox key opened");
|
ok(firefoxProtocolRegKey.wasOpenedForRead, "Firefox key opened");
|
||||||
ok(firefoxProtocolRegKey.wasCloseCalled, "Firefox key closed");
|
ok(firefoxProtocolRegKey.wasCloseCalled, "Firefox key closed");
|
||||||
ok(
|
ok(
|
||||||
!registryRootKey.isChildDeleted("firefox"),
|
!registryRootKey.isChildDeleted(publicProtocol),
|
||||||
"Firefox protocol registry entry not deleted"
|
"Firefox protocol registry entry not deleted"
|
||||||
);
|
);
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
firefoxPrivateProtocolRegKey.wasOpenedForRead,
|
firefoxPrivateProtocolRegKey.wasOpenedForRead,
|
||||||
"Firefox private key opened"
|
"Firefox private key opened"
|
||||||
);
|
);
|
||||||
ok(firefoxPrivateProtocolRegKey.wasCloseCalled, "Firefox private key closed");
|
ok(
|
||||||
ok(
|
firefoxPrivateProtocolRegKey.wasCloseCalled,
|
||||||
!registryRootKey.isChildDeleted("firefox-private"),
|
"Firefox private key closed"
|
||||||
"Firefox private protocol registry entry not deleted"
|
);
|
||||||
);
|
ok(
|
||||||
|
!registryRootKey.isChildDeleted(privateProtocol),
|
||||||
|
"Firefox private protocol registry entry not deleted"
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_DeleteWhenNoRegistryEntries() {
|
add_task(async function test_DeleteWhenNoRegistryEntries() {
|
||||||
const applicationPath = "testPath";
|
for (let protocols of [
|
||||||
|
[
|
||||||
|
FirefoxBridgeExtensionUtils.OLD_PUBLIC_PROTOCOL,
|
||||||
|
FirefoxBridgeExtensionUtils.OLD_PRIVATE_PROTOCOL,
|
||||||
|
OLD_FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
FirefoxBridgeExtensionUtils.PUBLIC_PROTOCOL,
|
||||||
|
FirefoxBridgeExtensionUtils.PRIVATE_PROTOCOL,
|
||||||
|
FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
],
|
||||||
|
]) {
|
||||||
|
let [publicProtocol, privateProtocol, privatePath] = protocols;
|
||||||
|
const applicationPath = "testPath";
|
||||||
|
|
||||||
const firefoxPrivateEntries = new Map();
|
const firefoxPrivateEntries = new Map();
|
||||||
const firefoxPrivateProtocolRegKey = new StubbedRegistryKey(
|
const firefoxPrivateProtocolRegKey = new StubbedRegistryKey(
|
||||||
new Map(),
|
new Map(),
|
||||||
firefoxPrivateEntries
|
firefoxPrivateEntries
|
||||||
);
|
);
|
||||||
|
|
||||||
const children = new Map();
|
const children = new Map();
|
||||||
children.set(
|
children.set(privatePath, firefoxPrivateProtocolRegKey);
|
||||||
FIREFOX_PRIVATE_SHELL_OPEN_COMMAND_PATH,
|
|
||||||
firefoxPrivateProtocolRegKey
|
|
||||||
);
|
|
||||||
|
|
||||||
const registryRootKey = new StubbedRegistryKey(children, new Map());
|
const registryRootKey = new StubbedRegistryKey(children, new Map());
|
||||||
|
|
||||||
const stubbedDeleteBridgeProtocolRegistryHelper =
|
const stubbedDeleteBridgeProtocolRegistryHelper =
|
||||||
new StubbedDeleteBridgeProtocolRegistryEntryHelper({
|
new StubbedDeleteBridgeProtocolRegistryEntryHelper({
|
||||||
applicationPath,
|
applicationPath,
|
||||||
registryRootKey,
|
registryRootKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
||||||
stubbedDeleteBridgeProtocolRegistryHelper
|
publicProtocol,
|
||||||
);
|
privateProtocol,
|
||||||
|
stubbedDeleteBridgeProtocolRegistryHelper
|
||||||
|
);
|
||||||
|
|
||||||
ok(registryRootKey.wasCloseCalled, "Root key closed");
|
ok(registryRootKey.wasCloseCalled, "Root key closed");
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
firefoxPrivateProtocolRegKey.wasOpenedForRead,
|
firefoxPrivateProtocolRegKey.wasOpenedForRead,
|
||||||
"Firefox private key opened"
|
"Firefox private key opened"
|
||||||
);
|
);
|
||||||
ok(firefoxPrivateProtocolRegKey.wasCloseCalled, "Firefox private key closed");
|
ok(
|
||||||
ok(
|
firefoxPrivateProtocolRegKey.wasCloseCalled,
|
||||||
!registryRootKey.isChildDeleted("firefox"),
|
"Firefox private key closed"
|
||||||
"Firefox protocol registry entry deleted when it shouldn't be"
|
);
|
||||||
);
|
ok(
|
||||||
ok(
|
!registryRootKey.isChildDeleted(publicProtocol),
|
||||||
!registryRootKey.isChildDeleted("firefox-private"),
|
"Firefox protocol registry entry deleted when it shouldn't be"
|
||||||
"Firefox private protocol registry deleted when it shouldn't be"
|
);
|
||||||
);
|
ok(
|
||||||
|
!registryRootKey.isChildDeleted(privateProtocol),
|
||||||
|
"Firefox private protocol registry deleted when it shouldn't be"
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_DeleteWhenUnexpectedRegistryEntries() {
|
add_task(async function test_DeleteWhenUnexpectedRegistryEntries() {
|
||||||
const applicationPath = "testPath";
|
for (let protocols of [
|
||||||
|
[
|
||||||
|
FirefoxBridgeExtensionUtils.OLD_PUBLIC_PROTOCOL,
|
||||||
|
FirefoxBridgeExtensionUtils.OLD_PRIVATE_PROTOCOL,
|
||||||
|
OLD_FIREFOX_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
FirefoxBridgeExtensionUtils.PUBLIC_PROTOCOL,
|
||||||
|
FirefoxBridgeExtensionUtils.PRIVATE_PROTOCOL,
|
||||||
|
FIREFOX_SHELL_OPEN_COMMAND_PATH,
|
||||||
|
],
|
||||||
|
]) {
|
||||||
|
let [publicProtocol, privateProtocol, publicPath] = protocols;
|
||||||
|
const applicationPath = "testPath";
|
||||||
|
|
||||||
const firefoxEntries = new Map();
|
const firefoxEntries = new Map();
|
||||||
firefoxEntries.set("", `\"${applicationPath}\" -osint -url \"%1\"`);
|
firefoxEntries.set("", `\"${applicationPath}\" -osint -url \"%1\"`);
|
||||||
firefoxEntries.set("extraEntry", "extraValue");
|
firefoxEntries.set("extraEntry", "extraValue");
|
||||||
const firefoxProtocolRegKey = new StubbedRegistryKey(
|
const firefoxProtocolRegKey = new StubbedRegistryKey(
|
||||||
new Map(),
|
new Map(),
|
||||||
firefoxEntries
|
firefoxEntries
|
||||||
);
|
);
|
||||||
|
|
||||||
const children = new Map();
|
const children = new Map();
|
||||||
children.set(FIREFOX_SHELL_OPEN_COMMAND_PATH, firefoxProtocolRegKey);
|
children.set(publicPath, firefoxProtocolRegKey);
|
||||||
|
|
||||||
const registryRootKey = new StubbedRegistryKey(children, new Map());
|
const registryRootKey = new StubbedRegistryKey(children, new Map());
|
||||||
|
|
||||||
const stubbedDeleteBridgeProtocolRegistryHelper =
|
const stubbedDeleteBridgeProtocolRegistryHelper =
|
||||||
new StubbedDeleteBridgeProtocolRegistryEntryHelper({
|
new StubbedDeleteBridgeProtocolRegistryEntryHelper({
|
||||||
applicationPath,
|
applicationPath,
|
||||||
registryRootKey,
|
registryRootKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
FirefoxBridgeExtensionUtils.maybeDeleteBridgeProtocolRegistryEntries(
|
||||||
stubbedDeleteBridgeProtocolRegistryHelper
|
publicProtocol,
|
||||||
);
|
privateProtocol,
|
||||||
|
stubbedDeleteBridgeProtocolRegistryHelper
|
||||||
|
);
|
||||||
|
|
||||||
ok(registryRootKey.wasCloseCalled, "Root key closed");
|
ok(registryRootKey.wasCloseCalled, "Root key closed");
|
||||||
|
|
||||||
ok(firefoxProtocolRegKey.wasOpenedForRead, "Firefox key opened");
|
ok(firefoxProtocolRegKey.wasOpenedForRead, "Firefox key opened");
|
||||||
ok(firefoxProtocolRegKey.wasCloseCalled, "Firefox key closed");
|
ok(firefoxProtocolRegKey.wasCloseCalled, "Firefox key closed");
|
||||||
ok(
|
ok(
|
||||||
!registryRootKey.isChildDeleted("firefox"),
|
!registryRootKey.isChildDeleted(publicProtocol),
|
||||||
"Firefox protocol registry entry deleted when it shouldn't be"
|
"Firefox protocol registry entry deleted when it shouldn't be"
|
||||||
);
|
);
|
||||||
ok(
|
ok(
|
||||||
!registryRootKey.isChildDeleted("firefox-private"),
|
!registryRootKey.isChildDeleted(privateProtocol),
|
||||||
"Firefox private protocol registry deleted when it shouldn't be"
|
"Firefox private protocol registry deleted when it shouldn't be"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1101,8 +1101,6 @@ pref("network.protocol-handler.external.disk", false);
|
||||||
pref("network.protocol-handler.external.disks", false);
|
pref("network.protocol-handler.external.disks", false);
|
||||||
pref("network.protocol-handler.external.afp", false);
|
pref("network.protocol-handler.external.afp", false);
|
||||||
pref("network.protocol-handler.external.moz-icon", false);
|
pref("network.protocol-handler.external.moz-icon", false);
|
||||||
pref("network.protocol-handler.external.firefox-bridge", false);
|
|
||||||
pref("network.protocol-handler.external.firefox-private-bridge", false);
|
|
||||||
|
|
||||||
// Don't allow external protocol handlers for common typos
|
// Don't allow external protocol handlers for common typos
|
||||||
pref("network.protocol-handler.external.ttp", false); // http
|
pref("network.protocol-handler.external.ttp", false); // http
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue