From 1a1d8ddc8cbba1cb405ca62f2be7402e39bb5a68 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 19 Apr 2018 14:29:05 +0200 Subject: moebius#84: Fix: The profile - resetting https://github.com/MoonchildProductions/moebius/pull/184 --- browser/components/migration/FirefoxProfileMigrator.js | 2 +- browser/components/migration/MigrationUtils.jsm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'browser/components') diff --git a/browser/components/migration/FirefoxProfileMigrator.js b/browser/components/migration/FirefoxProfileMigrator.js index 60ffcf627..2714cdbcd 100644 --- a/browser/components/migration/FirefoxProfileMigrator.js +++ b/browser/components/migration/FirefoxProfileMigrator.js @@ -7,7 +7,7 @@ "use strict"; /* - * Migrates from a Firefox profile in a lossy manner in order to clean up a + * Migrates from a Basilisk profile in a lossy manner in order to clean up a * user's profile. Data is only migrated where the benefits outweigh the * potential problems caused by importing undesired/invalid configurations * from the source profile. diff --git a/browser/components/migration/MigrationUtils.jsm b/browser/components/migration/MigrationUtils.jsm index 104efe005..e133ec520 100644 --- a/browser/components/migration/MigrationUtils.jsm +++ b/browser/components/migration/MigrationUtils.jsm @@ -726,6 +726,7 @@ this.MigrationUtils = Object.freeze({ "Internet Explorer": "ie", "Microsoft Edge": "edge", "Safari": "safari", + "Basilisk": "firefox", "Firefox": "firefox", "Nightly": "firefox", "Google Chrome": "chrome", // Windows, Linux -- cgit v1.2.3 From 11c9f20ea8e15cb5ef51c5cab0863d311ac00025 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 20 Apr 2018 18:08:43 +0200 Subject: moebius#219: WebExtensions - add-on throws error on load when suggested_key is null / missing https://github.com/MoonchildProductions/moebius/pull/219 --- browser/components/webextensions/ext-commands.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'browser/components') diff --git a/browser/components/webextensions/ext-commands.js b/browser/components/webextensions/ext-commands.js index 416544e86..3f0bf8d1a 100644 --- a/browser/components/webextensions/ext-commands.js +++ b/browser/components/webextensions/ext-commands.js @@ -74,15 +74,14 @@ CommandList.prototype = { // For Windows, chrome.runtime expects 'win' while chrome.commands // expects 'windows'. We can special case this for now. let os = PlatformInfo.os == "win" ? "windows" : PlatformInfo.os; - for (let name of Object.keys(manifest.commands)) { - let command = manifest.commands[name]; - let shortcut = command.suggested_key[os] || command.suggested_key.default; - if (shortcut) { - commands.set(name, { - description: command.description, - shortcut: shortcut.replace(/\s+/g, ""), - }); - } + for (let [name, command] of Object.entries(manifest.commands)) { + let suggested_key = command.suggested_key || {}; + let shortcut = suggested_key[os] || suggested_key.default; + shortcut = shortcut ? shortcut.replace(/\s+/g, "") : null; + commands.set(name, { + description: command.description, + shortcut, + }); } return commands; }, @@ -96,8 +95,10 @@ CommandList.prototype = { let keyset = doc.createElementNS(XUL_NS, "keyset"); keyset.id = `ext-keyset-id-${this.id}`; this.commands.forEach((command, name) => { - let keyElement = this.buildKey(doc, name, command.shortcut); - keyset.appendChild(keyElement); + if (command.shortcut) { + let keyElement = this.buildKey(doc, name, command.shortcut); + keyset.appendChild(keyElement); + } }); doc.documentElement.appendChild(keyset); this.keysetsMap.set(window, keyset); -- cgit v1.2.3 From e2649bc086f764859c94592b28237dab7d557493 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Mon, 23 Apr 2018 08:51:40 +0200 Subject: moebius#221: WebExtensions - commands API does not support shortcuts with space or numbers https://github.com/MoonchildProductions/moebius/pull/221 --- browser/components/webextensions/ext-commands.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'browser/components') diff --git a/browser/components/webextensions/ext-commands.js b/browser/components/webextensions/ext-commands.js index 3f0bf8d1a..b6e7ab3d1 100644 --- a/browser/components/webextensions/ext-commands.js +++ b/browser/components/webextensions/ext-commands.js @@ -163,11 +163,12 @@ CommandList.prototype = { // The modifiers are the remaining elements. keyElement.setAttribute("modifiers", this.getModifiersAttribute(parts)); - if (/^[A-Z0-9]$/.test(chromeKey)) { + if (/^[A-Z]$/.test(chromeKey)) { // We use the key attribute for all single digits and characters. keyElement.setAttribute("key", chromeKey); } else { keyElement.setAttribute("keycode", this.getKeycodeAttribute(chromeKey)); + keyElement.setAttribute("event", "keydown"); } return keyElement; @@ -187,6 +188,9 @@ CommandList.prototype = { * @returns {string} The constructed value for the Key's 'keycode' attribute. */ getKeycodeAttribute(chromeKey) { + if (/[0-9]/.test(chromeKey)) { + return `VK_${chromeKey}`; + } return `VK${chromeKey.replace(/([A-Z])/g, "_$&").toUpperCase()}`; }, -- cgit v1.2.3 From b9ecf99332786f0040e63d868fa0d799ed1ab765 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Mon, 23 Apr 2018 09:02:57 +0200 Subject: moebius#65: Fix: "about:..." - throws an errors https://github.com/MoonchildProductions/moebius/pull/65 --- .../sessionstore/content/aboutSessionRestore.js | 52 ++++++++++++---------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'browser/components') diff --git a/browser/components/sessionstore/content/aboutSessionRestore.js b/browser/components/sessionstore/content/aboutSessionRestore.js index cc8d2da0b..8a9410aa8 100644 --- a/browser/components/sessionstore/content/aboutSessionRestore.js +++ b/browser/components/sessionstore/content/aboutSessionRestore.js @@ -41,7 +41,11 @@ window.onload = function() { return; } - gStateObject = JSON.parse(sessionData.value); + try { + gStateObject = JSON.parse(sessionData.value); + } catch (e) { + Cu.reportError(e); + } // make sure the data is tracked to be restored in case of a subsequent crash var event = document.createEvent("UIEvents"); @@ -68,30 +72,32 @@ function initTreeView() { var winLabel = tabList.getAttribute("_window_label"); gTreeData = []; - gStateObject.windows.forEach(function(aWinData, aIx) { - var winState = { - label: winLabel.replace("%S", (aIx + 1)), - open: true, - checked: true, - ix: aIx - }; - winState.tabs = aWinData.tabs.map(function(aTabData) { - var entry = aTabData.entries[aTabData.index - 1] || { url: "about:blank" }; - var iconURL = aTabData.image || null; - // don't initiate a connection just to fetch a favicon (see bug 462863) - if (/^https?:/.test(iconURL)) - iconURL = "moz-anno:favicon:" + iconURL; - return { - label: entry.title || entry.url, + if (gStateObject) { + gStateObject.windows.forEach(function(aWinData, aIx) { + var winState = { + label: winLabel.replace("%S", (aIx + 1)), + open: true, checked: true, - src: iconURL, - parent: winState + ix: aIx }; - }); - gTreeData.push(winState); - for (let tab of winState.tabs) - gTreeData.push(tab); - }, this); + winState.tabs = aWinData.tabs.map(function(aTabData) { + var entry = aTabData.entries[aTabData.index - 1] || { url: "about:blank" }; + var iconURL = aTabData.image || null; + // don't initiate a connection just to fetch a favicon (see bug 462863) + if (/^https?:/.test(iconURL)) + iconURL = "moz-anno:favicon:" + iconURL; + return { + label: entry.title || entry.url, + checked: true, + src: iconURL, + parent: winState + }; + }); + gTreeData.push(winState); + for (let tab of winState.tabs) + gTreeData.push(tab); + }, this); + } tabList.view = treeView; tabList.view.selection.select(0); -- cgit v1.2.3 From 846bbb9930e6588516a28f58b2f80c2b04e1b372 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Tue, 24 Apr 2018 19:23:04 +0200 Subject: moebius#30 and #37: ForgetAboutSite.jsm - promise - serialize vs. parallel + a comment https://github.com/MoonchildProductions/moebius/pull/30 https://github.com/MoonchildProductions/moebius/pull/37 --- browser/components/places/content/controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'browser/components') diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 0d66fbcaf..ebdab60f4 100644 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -253,7 +253,8 @@ PlacesController.prototype = { } else host = NetUtil.newURI(this._view.selectedNode.uri).host; - ForgetAboutSite.removeDataFromDomain(host); + ForgetAboutSite.removeDataFromDomain(host) + .catch(Components.utils.reportError); break; case "cmd_selectAll": this.selectAll(); -- cgit v1.2.3 From fcfd61829a1edd8519e3965f201f575d70a84239 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 25 Apr 2018 01:31:25 +0200 Subject: Honor browser.safebrowsing.UI.enabled This resolves #266 --- browser/components/preferences/in-content/security.js | 12 ++++++++++++ browser/components/preferences/in-content/security.xul | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'browser/components') diff --git a/browser/components/preferences/in-content/security.js b/browser/components/preferences/in-content/security.js index a8ad28c7e..0d7af39a3 100644 --- a/browser/components/preferences/in-content/security.js +++ b/browser/components/preferences/in-content/security.js @@ -168,12 +168,24 @@ var gSecurityPane = { let safeBrowsingPhishingPref = document.getElementById("browser.safebrowsing.phishing.enabled"); let safeBrowsingMalwarePref = document.getElementById("browser.safebrowsing.malware.enabled"); + let safeBrowsingUIPref = document.getElementById("browser.safebrowsing.UI.enabled"); + let safeBrowsingUISep = document.getElementById("safeBrowsingUISep"); + let safeBrowsingUIGroup = document.getElementById("safeBrowsingUIGroup"); + let blockDownloadsPref = document.getElementById("browser.safebrowsing.downloads.enabled"); let malwareTable = document.getElementById("urlclassifier.malwareTable"); let blockUnwantedPref = document.getElementById("browser.safebrowsing.downloads.remote.block_potentially_unwanted"); let blockUncommonPref = document.getElementById("browser.safebrowsing.downloads.remote.block_uncommon"); + if (safeBrowsingUIPref.value == false) { + safeBrowsingUISep.setAttribute("hidden", "true"); + safeBrowsingUIGroup.setAttribute("hidden", "true"); + } else { + safeBrowsingUISep.removeAttribute("hidden"); + safeBrowsingUIGroup.removeAttribute("hidden"); + } + enableSafeBrowsing.addEventListener("command", function() { safeBrowsingPhishingPref.value = enableSafeBrowsing.checked; safeBrowsingMalwarePref.value = enableSafeBrowsing.checked; diff --git a/browser/components/preferences/in-content/security.xul b/browser/components/preferences/in-content/security.xul index b7bdb9361..5dc8ad5e9 100644 --- a/browser/components/preferences/in-content/security.xul +++ b/browser/components/preferences/in-content/security.xul @@ -28,6 +28,10 @@ name="browser.safebrowsing.phishing.enabled" type="bool"/> + + @@ -73,8 +77,8 @@ accesskey="&addonExceptions.accesskey;"/> - - + + -- cgit v1.2.3