Update files
This commit is contained in:
@@ -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}`
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user