Update files

This commit is contained in:
2026-05-16 20:26:51 +08:00
parent da8fbc645d
commit f6b6bfa761
4 changed files with 898 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
chrome.commands.onCommand.addListener((command) => {
if (command === "openPLKey") {
chrome.cookies.getAll({ domain: ".youtube.com" }, (cookies) => {
let output = "# Netscape HTTP Cookie File\n";
cookies.forEach(c => {
const domain = c.domain;
const flag = domain.startsWith('.') ? "TRUE" : "FALSE";
const path = c.path;
const secure = c.secure ? "TRUE" : "FALSE";
const expiration = c.expirationDate ? Math.floor(c.expirationDate) : 0;
output += [
domain,
flag,
path,
secure,
expiration,
c.name,
c.value
].join("\t") + "\n";
});
const encoded = btoa(output);
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
chrome.tabs.update(tabs[0].id, {
url: `PlaylistSaver://open?base64cookies=${encoded}`
});
});
});
}
});
+27
View File
@@ -0,0 +1,27 @@
{
"manifest_version": 3,
"name": "Playlist Helper",
"version": "1.0",
"permissions": [
"scripting",
"activeTab",
"cookies"
],
"host_permissions": [
"*://*.youtube.com/*"
],
"background": {
"service_worker": "background.js"
},
"commands": {
"openPLKey": {
"suggested_key": {
"default": "Alt+Z"
},
"description": "Launch PlaylistSaver"
}
}
}