9 Commits

Author SHA1 Message Date
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
s2
26e7b44b36 v0.0.9 2017-12-13 11:15:59 +01:00
s2
675900d0c8 move screenshots folder 2017-12-13 11:15:37 +01:00
s2
34d0f821a0 actually persist hosts option 2017-12-13 11:15:06 +01:00
s2
75e6a73f7f v0.0.8 2017-12-13 10:31:28 +01:00
s2
bd501edba3 ignore hosts option 2017-12-13 10:30:18 +01:00
5 changed files with 22 additions and 8 deletions

View File

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 257 KiB

View File

@@ -111,12 +111,17 @@ var updateAllColorsOnAllTabs = async () => {
if (tabs[i].status === 'complete') { if (tabs[i].status === 'complete') {
let t = getTabParent(tstTabs, tabs[i].id); let t = getTabParent(tstTabs, tabs[i].id);
let options = await loadOptions(); let options = await loadOptions();
let tabHost = new URL(tabs[i].url).host;
if (tabHost) {
tabHost = tabHost.toLowerCase();
}
if (!(options.globals.ignore && options.globals.ignore.split('\n').includes(tabHost))) {
browser.tabs.executeScript(tabs[i].id, { browser.tabs.executeScript(tabs[i].id, {
code: '(' + changeIcon.toString() + ')' + code: '(' + changeIcon.toString() + ')' +
'("' + generateRandomColor(t.parentIndex) + '", "' + t.faviconUrl + '", ' + JSON.stringify(options) + ')' '("' + generateRandomColor(t.parentIndex) + '", "' + t.faviconUrl + '", ' + JSON.stringify(options) + ')'
}); });
} }
}
if (tabs[i].children && tabs[i].children.length > 0) { if (tabs[i].children && tabs[i].children.length > 0) {
await changeTabs(tabs[i].children); await changeTabs(tabs[i].children);

View File

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

View File

@@ -26,6 +26,13 @@
</select> </select>
</div> </div>
<div class="panel-formElements-item browser-style">
<label for="ignore">Ignore hosts (one per line - ex.: google.com):</label>
</div>
<div class="panel-formElements-item browser-style">
<textarea id="ignore"></textarea>
</div>
</div> </div>
</section> </section>

View File

@@ -3,7 +3,8 @@ function persistOptions() {
globals = { globals = {
width: document.querySelector('#indicator-width').value, width: document.querySelector('#indicator-width').value,
orientation: document.querySelector('#indicator-orientation').value orientation: document.querySelector('#indicator-orientation').value,
ignore: document.querySelector('#ignore').value
}; };
return browser.storage.local.set({ return browser.storage.local.set({
@@ -15,10 +16,11 @@ document.addEventListener('DOMContentLoaded', () => {
loadOptions().then((options) => { loadOptions().then((options) => {
document.querySelector('#indicator-width').value = options.globals.width; document.querySelector('#indicator-width').value = options.globals.width;
document.querySelector('#indicator-orientation').value = options.globals.orientation; document.querySelector('#indicator-orientation').value = options.globals.orientation;
document.querySelector('#ignore').value = options.globals.ignore;
}); });
}); });
var list = document.querySelectorAll('select,input'); var list = document.querySelectorAll('select,input,textarea');
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
list[i].addEventListener('change', (ev) => { list[i].addEventListener('change', (ev) => {
persistOptions(); persistOptions();