From ae8683873a59d172dc96502f20b1955e6f7deff5 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 26 Jul 2015 05:24:18 +0300 Subject: [PATCH] fixes for Chrome 31 --- background.js | 3 ++- edit.js | 3 +++ localization.js | 9 ++++++--- storage.js | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/background.js b/background.js index 161b4221..655c52da 100644 --- a/background.js +++ b/background.js @@ -76,7 +76,7 @@ chrome.commands.onCommand.addListener(function(command) { // contextMenus API is present in ancient Chrome but it throws an exception // upon encountering the unsupported parameter value "browser_action", so we have to catch it. - +try { chrome.contextMenus.create({ id: "show-badge", title: chrome.i18n.getMessage("menuShowBadge"), type: "checkbox", contexts: ["browser_action"], checked: prefs.getPref("show-badge") @@ -85,6 +85,7 @@ chrome.contextMenus.create({ id: "disableAll", title: chrome.i18n.getMessage("disableAllStyles"), type: "checkbox", contexts: ["browser_action"], checked: prefs.getPref("disableAll") }, function() { var clearError = chrome.runtime.lastError; }); +} catch(e) {} chrome.contextMenus.onClicked.addListener(function(info, tab) { if (info.menuItemId == "disableAll") { disableAllStylesToggle(info.checked); diff --git a/edit.js b/edit.js index 8e4b176e..d3c76588 100644 --- a/edit.js +++ b/edit.js @@ -58,6 +58,9 @@ var jumpToLineTemplate = t('editGotoLine') + ':