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') 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 b2aab9283acec271adf1176a1f034fac18bcb591 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 21 Apr 2018 02:33:37 +0200 Subject: Define vendorFullName in Official Branding --- browser/branding/official/locales/en-US/brand.dtd | 1 + 1 file changed, 1 insertion(+) (limited to 'browser') diff --git a/browser/branding/official/locales/en-US/brand.dtd b/browser/branding/official/locales/en-US/brand.dtd index 7bfa07f71..1d2ac791e 100644 --- a/browser/branding/official/locales/en-US/brand.dtd +++ b/browser/branding/official/locales/en-US/brand.dtd @@ -6,4 +6,5 @@ + -- cgit v1.2.3 From 7e01cff204147ecd6fca4d547a1448ed423d1a34 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 21 Apr 2018 02:40:43 +0200 Subject: Remove region-specific overrides for search engines. --- browser/locales/search/list.json | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'browser') diff --git a/browser/locales/search/list.json b/browser/locales/search/list.json index 9f7d82b4e..722f3186f 100644 --- a/browser/locales/search/list.json +++ b/browser/locales/search/list.json @@ -5,36 +5,6 @@ ] }, "regionOverrides": { - "US": { - "google": "google-nocodes" - }, - "CA": { - "google": "google-nocodes" - }, - "KZ": { - "google": "google-nocodes" - }, - "BY": { - "google": "google-nocodes" - }, - "RU": { - "google": "google-nocodes" - }, - "TR": { - "google": "google-nocodes" - }, - "UA": { - "google": "google-nocodes" - }, - "CN": { - "google": "google-nocodes" - }, - "TW": { - "google": "google-nocodes" - }, - "HK": { - "google": "google-nocodes" - } }, "locales": { "en-US": { -- cgit v1.2.3 From fb37ed0a373a0bbc29bbe6e20ca684e856185c5c Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 21 Apr 2018 02:58:41 +0200 Subject: Disable grabbing geo-specific search engines from Mozilla servers. --- browser/locales/en-US/firefox-l10n.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'browser') diff --git a/browser/locales/en-US/firefox-l10n.js b/browser/locales/en-US/firefox-l10n.js index c1e5510f3..642ad6534 100644 --- a/browser/locales/en-US/firefox-l10n.js +++ b/browser/locales/en-US/firefox-l10n.js @@ -4,8 +4,4 @@ #filter substitution -# LOCALIZATION NOTE: this preference is set to true for en-US specifically, -# locales without this line have the setting set to false by default. -pref("browser.search.geoSpecificDefaults", true); - pref("general.useragent.locale", "@AB_CD@"); -- cgit v1.2.3