From 218cd46670f77ce253dc38305948e57d7dbb4e64 Mon Sep 17 00:00:00 2001 From: Jeremy Schomery Date: Thu, 23 Feb 2017 11:07:25 +0330 Subject: [PATCH] updating 'turn all styles off' in the right click context menu when prefs are loaded --- background.js | 8 +++++++- manifest.json | 2 +- storage.js | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index efea89bb..14a012fd 100644 --- a/background.js +++ b/background.js @@ -53,7 +53,6 @@ chrome.tabs.onRemoved.addListener(function(tabId, info) { }); chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { - switch (request.method) { case "getStyles": var styles = getStyles(request, sendResponse); @@ -179,3 +178,10 @@ var codeMirrorThemes; getCodeMirrorThemes(function(themes) { codeMirrorThemes = themes; }); + +// to-do, user-feedback (https://github.com/schomery/stylish-chrome/issues/22#issuecomment-279936160) +(function (oV, nV) { + if (oV !== nV) { + prefs.set('version', nV); + } +})(prefs.get('version', null), chrome.runtime.getManifest().version) diff --git a/manifest.json b/manifest.json index 813c30bc..53cb3b19 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "Stylus", - "version": "1.0.1", + "version": "1.0.2", "description": "__MSG_description__", "homepage_url": "https://github.com/schomery/stylish-chrome", "manifest_version": 2, diff --git a/storage.js b/storage.js index 403de38a..9a6c0174 100644 --- a/storage.js +++ b/storage.js @@ -419,6 +419,8 @@ var prefs = chrome.extension.getBackgroundPage().prefs || new function Prefs() { } } } + // make sure right click context menu is in the right state when prefs are loaded + chrome.contextMenus.update("disableAll", {checked: prefs.get("disableAll")}); }); chrome.storage.onChanged.addListener(function(changes, area) {