Compare commits
2 Commits
724bec321b
...
0a00b1c1f1
Author | SHA1 | Date | |
---|---|---|---|
0a00b1c1f1 | |||
41d70eb3f0 |
20
src/bg.js
20
src/bg.js
@@ -115,21 +115,13 @@ browser.runtime.onMessageExternal.addListener((aMessage, aSender) => {
|
||||
}
|
||||
});
|
||||
|
||||
//when a tab is created
|
||||
browser.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
|
||||
var tstTabs = await browser.runtime.sendMessage(kTST_ID, {
|
||||
type: 'get-tree',
|
||||
window: tab.windowId
|
||||
//when something happens with a tab
|
||||
let tabEvents = ['onUpdated', 'onAttached', 'onDetached', 'onMoved', 'onRemoved']
|
||||
tabEvents.forEach((ev) => {
|
||||
browser.tabs[ev].addListener(async (tabId, changeInfo, tab) => {
|
||||
updateAllColorsOnAllTabs();
|
||||
});
|
||||
});
|
||||
|
||||
if (tab.status === 'complete') {
|
||||
var t = getTabParent(tstTabs, tab.id);
|
||||
|
||||
browser.tabs.executeScript(tab.id, {
|
||||
code: '(' + changeIcon.toString() + ')' +
|
||||
'("' + generateRandomColor(t.parentIndex) + '", "' + t.faviconUrl + '")'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
registerToTST(); // aggressive registration on initial installation
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"description": "Color tabs based on their parent.",
|
||||
"manifest_version": 2,
|
||||
"name": "Color Tab Group",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"homepage_url": "https://git.e.tern.al/s2/tab-groupcolor",
|
||||
"icons": {
|
||||
"48": "img/icon-48.png"
|
||||
|
Reference in New Issue
Block a user