9 Commits

Author SHA1 Message Date
s2
e675bc4372 v0.0.13 2017-12-13 13:48:07 +01:00
s2
a1c8f5bb6e use 7 colors 2017-12-13 13:46:15 +01:00
s2
19571e036f v0.0.12 2017-12-13 11:35:48 +01:00
s2
7911e8a898 handle "null" favicon 2017-12-13 11:34:39 +01:00
s2
5c4ed146e6 default for ignore value 2017-12-13 11:31:13 +01:00
s2
dcd76d7240 v0.0.11 2017-12-13 11:21:36 +01:00
s2
3dc143c9d8 pffff 2017-12-13 11:21:25 +01:00
s2
21dd898d44 v0.0.10 2017-12-13 11:19:35 +01:00
s2
757adc4722 need to test more 2017-12-13 11:19:20 +01:00
4 changed files with 7 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ var changeIcon = function(color, currentIcon, options) {
var ctx = canvas.getContext('2d');
var img = new Image();
if (currentIcon && typeof(currentIcon) !== 'undefined' && currentIcon !== null && currentIcon !== 'undefined') {
if (currentIcon && typeof(currentIcon) !== 'undefined' && currentIcon !== null && currentIcon !== "null" && currentIcon !== 'undefined') {
img.src = currentIcon;
} else {
img.src = 'data:image/x-icon;base64,AAABAAEAEBACAAEAAQCwAAAAFgAAACgAAAAQAAAAIAAAAAEAAQAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA';
@@ -46,7 +46,7 @@ var generateRandomColor = function(seed) {
return "hsl(" + (colorNum * (360 / colors) % 360) + ",100%,50%)";
}
return selectColor(seed, 8);
return selectColor(seed, 7);
};
var registerToTST = async function() {
@@ -115,7 +115,7 @@ var updateAllColorsOnAllTabs = async () => {
if (tabHost) {
tabHost = tabHost.toLowerCase();
}
if (!(options.ignore && options.ignore.split('\n').includes(tabHost))) {
if (!(options.globals.ignore && options.globals.ignore.split('\n').includes(tabHost))) {
browser.tabs.executeScript(tabs[i].id, {
code: '(' + changeIcon.toString() + ')' +
'("' + generateRandomColor(t.parentIndex) + '", "' + t.faviconUrl + '", ' + JSON.stringify(options) + ')'

View File

@@ -2,7 +2,7 @@
"description": "Color tabs based on their parent.",
"manifest_version": 2,
"name": "Color Tab Group",
"version": "0.0.9",
"version": "0.0.13",
"homepage_url": "https://git.e.tern.al/s2/tab-groupcolor",
"icons": {
"48": "img/icon-48.png"

View File

@@ -16,6 +16,7 @@ document.addEventListener('DOMContentLoaded', () => {
loadOptions().then((options) => {
document.querySelector('#indicator-width').value = options.globals.width;
document.querySelector('#indicator-orientation').value = options.globals.orientation;
document.querySelector('#ignore').value = options.globals.ignore;
});
});

View File

@@ -2,7 +2,8 @@ function loadOptions() {
return browser.storage.local.get({
globals: {
width: 3,
orientation: 'vertical'
orientation: 'vertical',
ignore: ''
}
});
}