From 6b28ce5e3075473570685bec3fc0a01b156fa094 Mon Sep 17 00:00:00 2001 From: Araxeus Date: Fri, 23 Aug 2024 14:57:51 +0300 Subject: [PATCH] fix iframe embeds (#153) --- package.json | 3 +-- unpacked/manifest.json | 12 ++++++++++-- unpacked/pageAccess.js | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c5e5463..b1f28b0 100644 --- a/package.json +++ b/package.json @@ -85,8 +85,7 @@ "hooks": { "before:init": "bun check", "after:bump": "bun format", - "before:release": "bun b", - "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}." + "after:release": "bun b" }, "git": { "requireBranch": "main", diff --git a/unpacked/manifest.json b/unpacked/manifest.json index bbe2fde..d4d7b10 100644 --- a/unpacked/manifest.json +++ b/unpacked/manifest.json @@ -6,7 +6,11 @@ "permissions": ["storage"], "content_scripts": [ { - "matches": ["https://www.youtube.com/*", "https://music.youtube.com/*"], + "matches": [ + "https://www.youtube.com/*", + "https://music.youtube.com/*", + "https://www.youtube-nocookie.com/embed/*" + ], "all_frames": true, "js": ["index.js"], "css": ["style.css"], @@ -16,7 +20,11 @@ "web_accessible_resources": [ { "resources": ["pageAccess.js"], - "matches": ["https://www.youtube.com/*", "https://music.youtube.com/*"] + "matches": [ + "https://www.youtube.com/*", + "https://music.youtube.com/*", + "https://www.youtube-nocookie.com/*" + ] } ], "icons": { diff --git a/unpacked/pageAccess.js b/unpacked/pageAccess.js index 1827caf..cc3847b 100644 --- a/unpacked/pageAccess.js +++ b/unpacked/pageAccess.js @@ -499,7 +499,7 @@ class YoutubeVolumeScroll { const pref = ytvs .getCookie('PREF') - .replace(/volume=(\d+)/, `volume=${volume}`); + ?.replace(/volume=(\d+)/, `volume=${volume}`); if (pref) { document.cookie = `${pref};domain=.youtube.com;max-age=${ ytvs.oneMonth / 1000 // convert to seconds