From 7a86c8e71742e6fc113d2378831904f51041c00d Mon Sep 17 00:00:00 2001 From: kappa Date: Mon, 20 Apr 2020 17:18:50 +0200 Subject: [PATCH] Total change of project, all scripts removed --- manifest.json | 17 ++--------------- options.html | 17 ----------------- options.js | 16 ---------------- styles.css | 7 ++++--- styles.js | 22 ---------------------- 5 files changed, 6 insertions(+), 73 deletions(-) delete mode 100644 options.html delete mode 100644 options.js delete mode 100644 styles.js diff --git a/manifest.json b/manifest.json index 7e9c5df..6dcc248 100644 --- a/manifest.json +++ b/manifest.json @@ -6,21 +6,8 @@ { "run_at": "document_start", "matches": ["https://www.youtube.com/*"], - "css": ["styles.css"], - "js": ["styles.js"] + "css": ["styles.css"] } ], - "browser_specific_settings": { - "gecko": { - "id": "youtube-unhooked@ffffff.gov" - } - }, - "manifest_version": 2, - "options_ui": { - "page": "options.html", - "browser_style": true - }, - "permissions": [ - "storage" - ] + "manifest_version": 2 } diff --git a/options.html b/options.html deleted file mode 100644 index 97a1ac7..0000000 --- a/options.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - -
-
- Disable Comments?
-
- -
- - - diff --git a/options.js b/options.js deleted file mode 100644 index ae532cd..0000000 --- a/options.js +++ /dev/null @@ -1,16 +0,0 @@ -function saveOptions(e) { - browser.storage.sync.set({ - commentsRemove: document.getElementById("commentsRemoveCheck").checked - }); - e.preventDefault(); -} - -function restoreOptions() { - var gettingItem = browser.storage.sync.get({commentsRemove: false}); - gettingItem.then((res) => { - document.getElementById("commentsRemoveCheck").checked = res.commentsRemove; - }); -} - -document.addEventListener('DOMContentLoaded', restoreOptions); -document.querySelector("form").addEventListener("submit", saveOptions); diff --git a/styles.css b/styles.css index 5213709..0c4ed7d 100644 --- a/styles.css +++ b/styles.css @@ -29,10 +29,11 @@ ytd-watch-next-secondary-results-renderer { /** COMMENTS **/ -/* changed +/* ytd-comments { - visibility: visible !important; -} */ + visibility: hidden !important; +} +*/ /** RELATED VIDEOS (END OF VIDEO SCREEN) **/ .ytp-videowall-still, .ytp-endscreen-previous, .ytp-endscreen-next { diff --git a/styles.js b/styles.js deleted file mode 100644 index 22b4903..0000000 --- a/styles.js +++ /dev/null @@ -1,22 +0,0 @@ -let gettingItem = browser.storage.sync.get({commentsRemove: false}); -// Retrieves the storage variable to determine whether comments should be removed - -function setComments(remove) { - if (!remove) - return; - var commentStyle = document.createElement('style'); - document.head.appendChild(commentStyle); - - commentStyle.sheet.insertRule("ytd-comments {visibility: hidden !important}"); -} - -function onGot(result) { - var remove = result.commentsRemove; - setComments(remove); - // Sets the visibility of the comments section depending on the storage vairable -} -function onFailure(error) { - alert(`Error: ${error}`); -} - -gettingItem.then(onGot, onFailure);