From 0ec7e4aee393530431ed421224cc37d234f94135 Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Mon, 3 Jul 2017 11:11:48 -0700 Subject: [PATCH] Use new theme_icons manifest for specifying light and dark icons. Fixes #603 --- webextension/background.js | 11 ++++++++++- webextension/manifest.json | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/webextension/background.js b/webextension/background.js index 2884dfd..8effdd4 100644 --- a/webextension/background.js +++ b/webextension/background.js @@ -1,5 +1,6 @@ const MAJOR_VERSIONS = ["2.3.0", "2.4.0"]; const LOOKUP_KEY = "$ref"; +const THEME_BUILD_DATE = 20170630; const assignManager = { MENU_ASSIGN_ID: "open-in-this-container", @@ -594,10 +595,18 @@ const messageHandler = { const themeManager = { existingTheme: null, - init() { + disabled: false, + async init() { + const browserInfo = await browser.runtime.getBrowserInfo(); + if (Number(browserInfo.buildID.substring(0, 8)) >= THEME_BUILD_DATE) { + this.disabled = true; + } this.check(); }, setPopupIcon(theme) { + if (this.disabled) { + return; + } let icons = { 16: "img/container-site-d-24.png", 32: "img/container-site-d-48.png" diff --git a/webextension/manifest.json b/webextension/manifest.json index 8f7dec0..9d0d04c 100644 --- a/webextension/manifest.json +++ b/webextension/manifest.json @@ -48,6 +48,38 @@ "16": "img/container-site-d-24.png", "32": "img/container-site-d-48.png" }, + "theme_icons": [ + { + "size": 16, + "dark": "img/container-site-d-24.png", + "light": "img/container-site-w-24.png" + }, + { + "size": 24, + "dark": "img/container-site-d-24.png", + "light": "img/container-site-w-24.png" + }, + { + "size": 32, + "dark": "img/container-site-d-48.png", + "light": "img/container-site-w-48.png" + }, + { + "size": 48, + "dark": "img/container-site-d-48.png", + "light": "img/container-site-w-48.png" + }, + { + "size": 96, + "dark": "img/container-site-d-96.png", + "light": "img/container-site-w-96.png" + }, + { + "size": 192, + "dark": "img/container-site-d-192.png", + "light": "img/container-site-w-192.png" + } + ], "default_title": "Containers", "default_popup": "popup.html" },