mirror of
https://github.com/DevLARLEY/WidevineProxy2.git
synced 2026-04-02 02:28:34 +00:00
+ Added notification icon
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
BIN
images/icon-128-notification.png
Normal file
BIN
images/icon-128-notification.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
18
lib/util.js
18
lib/util.js
@@ -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 */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "WidevineProxy2",
|
||||
"version": "0.9.0",
|
||||
"version": "0.9.1",
|
||||
"permissions": [
|
||||
"activeTab",
|
||||
"tabs",
|
||||
|
||||
Reference in New Issue
Block a user