mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
parent
43b43d858e
commit
454873b6df
@ -185,14 +185,26 @@
|
|||||||
browser.runtime.onMessage.addListener(function(data){
|
browser.runtime.onMessage.addListener(function(data){
|
||||||
if (Array.isArray(data["canvasBlocker-notifications"])){
|
if (Array.isArray(data["canvasBlocker-notifications"])){
|
||||||
message("got notifications");
|
message("got notifications");
|
||||||
data["canvasBlocker-notifications"].forEach(function(notification){
|
const notifications = data["canvasBlocker-notifications"];
|
||||||
|
let i = 0;
|
||||||
|
const length = notifications.length;
|
||||||
|
const tick = window.setInterval(function(){
|
||||||
|
if (i >= length){
|
||||||
|
window.clearInterval(tick);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (var delta = 0; delta < 20 && i + delta < length; delta += 1){
|
||||||
|
let notification = notifications[i + delta];
|
||||||
verbose(notification);
|
verbose(notification);
|
||||||
notification.url = new URL(notification.url);
|
notification.url = new URL(notification.url);
|
||||||
domainNotification(
|
domainNotification(
|
||||||
notification.url.hostname,
|
notification.url.hostname,
|
||||||
notification.messageId
|
notification.messageId
|
||||||
).addNotification(new Notification(notification));
|
).addNotification(new Notification(notification));
|
||||||
});
|
}
|
||||||
|
i += delta;
|
||||||
|
}
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
message("request notifications from tab", tab.id);
|
message("request notifications from tab", tab.id);
|
||||||
|
@ -14,6 +14,7 @@ Version 0.5.3:
|
|||||||
- detection if the options page was displayed in a separate tab did not work reliably
|
- detection if the options page was displayed in a separate tab did not work reliably
|
||||||
- popup text not readable in some dark themes
|
- popup text not readable in some dark themes
|
||||||
- display conditions for notification settings
|
- display conditions for notification settings
|
||||||
|
- page action not useable with a lot of notifications
|
||||||
|
|
||||||
known issues:
|
known issues:
|
||||||
- if a data URL is blocked the page action button does not appear
|
- if a data URL is blocked the page action button does not appear
|
||||||
|
Loading…
x
Reference in New Issue
Block a user