+ Added notification icon

This commit is contained in:
titus
2026-03-15 08:05:58 +01:00
parent d126357aa4
commit c47ebbe3e9
4 changed files with 26 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ const { LicenseType, SignedMessage, LicenseRequest, License } = protobuf.roots.d
import "./lib/forge.min.js";
import { Session } from "./lib/cdm.js";
import { DeviceManager, SettingsManager, AsyncLocalStorage, RemoteCDMManager, Util } from "./lib/util.js";
import { DeviceManager, SettingsManager, AsyncLocalStorage, RemoteCDMManager, IconManager, Util } from "./lib/util.js";
import { WidevineDevice } from "./lib/device.js";
import { RemoteCdm } from "./lib/remote_cdm.js";
@@ -142,6 +142,7 @@ async function parseLicense(body, sendResponse, tab_url) {
}
logs.push(log);
await AsyncLocalStorage.setStorage({[pssh]: log});
IconManager.setNotificationIcon();
sessions.delete(loaded_request_id);
sendResponse();
@@ -328,6 +329,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
case "CLEAR":
logs = [];
manifests.clear();
IconManager.setDefaultIcon();
break;
case "MANIFEST":
const parsed = JSON.parse(message.body);
@@ -351,3 +353,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
})();
return true;
});
chrome.runtime.onSuspend.addListener(() => {
IconManager.setDefaultIcon();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -315,6 +315,24 @@ export class SettingsManager {
}
}
export class IconManager {
static setDefaultIcon() {
chrome.action.setIcon({
path: {
128: "images/icon-128.png"
}
});
}
static setNotificationIcon() {
chrome.action.setIcon({
path: {
128: "images/icon-128-notification.png"
}
});
}
}
export class Util {
static utf8 = {
/* Uint8Array -> String */

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "WidevineProxy2",
"version": "0.9.0",
"version": "0.9.1",
"permissions": [
"activeTab",
"tabs",