Skip to content

Commit cb450a2

Browse files
committed
fixed some bugs
1 parent 0a3970d commit cb450a2

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

manifest/chrome.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"scripts/messaging.js",
2828
"scripts/userstyle.js",
2929
"scripts/storage.js",
30+
"scripts/GhostText.js",
3031
"scripts/background.js"
3132
]
3233
},

manifest/firefox.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"scripts/messaging.js",
3232
"scripts/userstyle.js",
3333
"scripts/storage.js",
34+
"scripts/GhostText.js",
3435
"scripts/background.js"
3536
]
3637
},

scripts/messaging.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
function notifyAllTabs(request) {
22
return new Promise((resolve) => {
3+
const exturl = browser.extension.getURL("");
4+
browser.runtime.sendMessage(request);
35
if (IS_MOBILE) {
46
browser.tabs.query({}).then((tabs) => {
5-
for (let tab of tabs) {
7+
tabs.forEach((tab) => {
68
updateIcon(tab);
7-
if (canStyle(tab.url)) {
9+
if (canStyle(tab.url) && !tab.url.includes(exturl)) {
810
browser.tabs.sendMessage(tab.id, request);
911
}
10-
}
12+
});
1113
resolve();
1214
});
1315
} else {
16+
// notify all open popups
17+
var reqPopup = shallowMerge({}, request, {method: "updatePopup", reason: request.method});
18+
browser.runtime.sendMessage(reqPopup);
19+
// notify other tabs
1420
browser.windows.getAll({populate: true}).then((windows) => {
1521
windows.forEach((win) => {
1622
win.tabs.forEach((tab) => {
1723
updateIcon(tab);
18-
if (canStyle(tab.url)) {
24+
if (canStyle(tab.url) && !tab.url.includes(exturl)) {
1925
browser.tabs.sendMessage(tab.id, request);
2026
}
2127
});
2228
});
2329
resolve();
2430
});
25-
// notify all open popups
26-
var reqPopup = shallowMerge({}, request, {method: "updatePopup", reason: request.method});
27-
browser.runtime.sendMessage(reqPopup);
2831
}
2932
});
3033
}

0 commit comments

Comments
 (0)