add manifest URL in frontend

This commit is contained in:
voldemort 2025-07-20 16:00:59 +07:00
parent 9c738d8a3e
commit 5678c9b5da
3 changed files with 41 additions and 10 deletions

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width" />
<title>CDRM Decryption Extension v%APPVERSION%</title> <title>CDRM Decryption Extension v%APPVERSION%</title>
</head> </head>
<body class="min-w-full min-h-full w-full h-full"> <body class="min-w-full min-h-full w-full h-full">

View File

@ -5,14 +5,23 @@ function Results() {
const [pssh, setPssh] = useState(""); const [pssh, setPssh] = useState("");
const [licenseUrl, setLicenseUrl] = useState(""); const [licenseUrl, setLicenseUrl] = useState("");
const [keys, setKeys] = useState([]); const [keys, setKeys] = useState([]);
const [manifestUrl, setManifestUrl] = useState("");
useEffect(() => { useEffect(() => {
chrome.storage.local.get( chrome.storage.local.get(
["drmType", "latestPSSH", "latestLicenseRequest", "latestKeys", "licenseURL"], [
"drmType",
"latestPSSH",
"latestLicenseRequest",
"latestKeys",
"licenseURL",
"manifestURL",
],
(result) => { (result) => {
if (result.drmType) setDrmType(result.drmType); if (result.drmType) setDrmType(result.drmType);
if (result.latestPSSH) setPssh(result.latestPSSH); if (result.latestPSSH) setPssh(result.latestPSSH);
if (result.licenseURL) setLicenseUrl(result.licenseURL); if (result.licenseURL) setLicenseUrl(result.licenseURL);
if (result.manifestURL) setManifestUrl(result.manifestURL);
if (result.latestKeys) { if (result.latestKeys) {
try { try {
const parsed = Array.isArray(result.latestKeys) const parsed = Array.isArray(result.latestKeys)
@ -38,6 +47,9 @@ function Results() {
if (changes.licenseURL) { if (changes.licenseURL) {
setLicenseUrl(changes.licenseURL.newValue); setLicenseUrl(changes.licenseURL.newValue);
} }
if (changes.manifestURL) {
setManifestUrl(changes.manifestURL.newValue);
}
if (changes.latestKeys) { if (changes.latestKeys) {
setKeys(changes.latestKeys.newValue); setKeys(changes.latestKeys.newValue);
} }
@ -54,6 +66,7 @@ function Results() {
drmType: "None", drmType: "None",
latestPSSH: "None", latestPSSH: "None",
licenseURL: "None", licenseURL: "None",
manifestURL: "None",
latestKeys: [], latestKeys: [],
}); });
@ -97,39 +110,52 @@ function Results() {
> >
Capture current tab Capture current tab
</button> </button>
<p className="text-2xl mt-5">DRM Type</p> <p className="text-2xl mt-5">DRM Type</p>
<input <input
type="text" type="text"
value={drmType} value={drmType}
className="w-full h-10 bg-slate-800/50 rounded-md p-2 mt-2 text-white" className="w-full h-10 bg-slate-800/50 rounded-md p-2 mt-2 text-white font-mono"
placeholder="None" placeholder="[Not available]"
disabled disabled
/> />
<p className="text-2xl mt-5">Manifest URL</p>
<input
type="text"
value={manifestUrl}
className="w-full h-10 bg-slate-800/50 rounded-md p-2 mt-2 text-white font-mono"
placeholder="[Not available]"
disabled
/>
<p className="text-2xl mt-5">PSSH</p> <p className="text-2xl mt-5">PSSH</p>
<input <input
type="text" type="text"
value={pssh} value={pssh}
className="w-full h-10 bg-slate-800/50 rounded-md p-2 mt-2 text-white" className="w-full h-10 bg-slate-800/50 rounded-md p-2 mt-2 text-white font-mono"
placeholder="None" placeholder="[Not available]"
disabled disabled
/> />
<p className="text-2xl mt-5">License URL</p> <p className="text-2xl mt-5">License URL</p>
<input <input
type="text" type="text"
value={licenseUrl} value={licenseUrl}
className="w-full h-10 bg-slate-800/50 rounded-md p-2 mt-2 text-white" className="w-full h-10 bg-slate-800/50 rounded-md p-2 mt-2 text-white font-mono"
placeholder="None" placeholder="[Not available]"
disabled disabled
/> />
<p className="text-2xl mt-5">Keys</p> <p className="text-2xl mt-5">Keys</p>
<div className="w-full min-h-64 h-64 flex items-center justify-center text-center overflow-y-auto bg-slate-800/50 rounded-md p-2 mt-2 text-white whitespace-pre-line"> <div className="w-full min-h-64 h-64 flex items-center justify-center text-center overflow-y-auto bg-slate-800/50 rounded-md p-2 mt-2 text-white whitespace-pre-line font-mono">
{Array.isArray(keys) && keys.filter((k) => k.type !== "SIGNING").length > 0 ? ( {Array.isArray(keys) && keys.filter((k) => k.type !== "SIGNING").length > 0 ? (
keys keys
.filter((k) => k.type !== "SIGNING") .filter((k) => k.type !== "SIGNING")
.map((k) => `${k.key_id || k.keyId}:${k.key}`) .map((k) => `${k.key_id || k.keyId}:${k.key}`)
.join("\n") .join("\n")
) : ( ) : (
<span className="text-gray-400">None</span> <span className="text-gray-400">[Not available]</span>
)} )}
</div> </div>
</div> </div>

View File

@ -33,6 +33,11 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
chrome.storage.local.set({ licenseURL: data }); chrome.storage.local.set({ licenseURL: data });
break; break;
case "MANIFEST_URL_FOUND":
console.log("Storing Manifest URL:", data);
chrome.storage.local.set({ manifestURL: data });
break;
default: default:
console.warn("Unknown message type received:", type); console.warn("Unknown message type received:", type);
} }