Skip to content

Commit

Permalink
Use new theme_icons manifest for specifying light and dark icons. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanKingston committed Aug 2, 2017
1 parent ee63f72 commit 0ec7e4a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
11 changes: 10 additions & 1 deletion webextension/background.js
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
32 changes: 32 additions & 0 deletions webextension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 0ec7e4a

Please sign in to comment.