From 344d9c3111fb93e5bcb0ab8f3d3a74ae479eb814 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 11 Mar 2024 19:06:07 -0400 Subject: [PATCH 1/3] update to chrome extension manifest version 3 from 2 --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 4b376cf..467b173 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "YouTube Blocker", -"version": "3.4", -"manifest_version": 2, +"version": "3.5", +"manifest_version": 3, "description": "Block non educational YouTube videos", "icons": { "128": "resources/icon.png" From 2ab86fe3443b4926d25a1134ac57aeebc0115a48 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 11 Mar 2024 19:17:42 -0400 Subject: [PATCH 2/3] update the manifest.json * Update spacing * add new property host_permissions https://developer.chrome.com/docs/extensions/develop/migrate/manifest --- manifest.json | 66 ++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/manifest.json b/manifest.json index 467b173..a3f31b7 100644 --- a/manifest.json +++ b/manifest.json @@ -1,34 +1,36 @@ { -"name": "YouTube Blocker", -"version": "3.5", -"manifest_version": 3, -"description": "Block non educational YouTube videos", -"icons": { - "128": "resources/icon.png" -}, -"background": { - "scripts": ["js/jquery-3.4.1.min.js","js/background.js"], - "persistent": true -}, -"content_scripts": [ - { - "matches": ["*://*.youtube.com/*"], - "run_at": "document_idle", - "js": ["js/jquery-3.4.1.min.js", "js/contentScript.js"] - } -], -"browser_action": { - "default_title": "YouTube Blocker", - "default_popup": "pages/popup.html" -}, -"content_security_policy": "script-src 'self' https://ajax.googleapis.com https://www.googleapis.com; object-src 'self'", -"options_page": "pages/options.html", -"permissions": [ - "notifications", - "storage", - "background", - "*://*.youtube.com/*", - "tabs", - "webNavigation" - ] + "name": "YouTube Blocker", + "version": "3.5", + "manifest_version": 3, + "description": "Block non educational YouTube videos", + "icons": { + "128": "resources/icon.png" + }, + "background": { + "scripts": ["js/jquery-3.4.1.min.js","js/background.js"], + "persistent": true + }, + "content_scripts": [ + { + "matches": ["*://*.youtube.com/*"], + "run_at": "document_idle", + "js": ["js/jquery-3.4.1.min.js", "js/contentScript.js"] + } + ], + "browser_action": { + "default_title": "YouTube Blocker", + "default_popup": "pages/popup.html" + }, + "content_security_policy": "script-src 'self' https://ajax.googleapis.com https://www.googleapis.com; object-src 'self'", + "options_page": "pages/options.html", + "permissions": [ + "notifications", + "storage", + "background", + "tabs", + "webNavigation" + ], + "host_permissions": [ + "*://*.youtube.com/*" + ] } From 4501a780e26c5f54a38dfff4467a78b1bb1901e9 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 11 Mar 2024 19:22:54 -0400 Subject: [PATCH 3/3] Fix error on "load unpacked" extension in chrome://extensions * Error: Invalid value for 'content_security_policy'"? * Solution: https://stackoverflow.com/questions/67130826/why-am-i-getting-failed-to-load-extension-invalid-value-for-content-security --- manifest.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a3f31b7..b78fb90 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,10 @@ "default_title": "YouTube Blocker", "default_popup": "pages/popup.html" }, - "content_security_policy": "script-src 'self' https://ajax.googleapis.com https://www.googleapis.com; object-src 'self'", + "content_security_policy": { + "script-src": "self https://ajax.googleapis.com https://www.googleapis.com", + "object-src": "self" + }, "options_page": "pages/options.html", "permissions": [ "notifications",