Total change of project, all scripts removed
This commit is contained in:
parent
d3fd1b8645
commit
7a86c8e717
|
@ -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
|
||||
}
|
||||
|
|
17
options.html
17
options.html
|
@ -1,17 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form>
|
||||
<hr>
|
||||
<input type="checkbox" name="Disable" id="commentsRemoveCheck" value="Comments">Disable Comments?<br>
|
||||
<hr>
|
||||
<button id="submitbtn" type="submit">Save</button>
|
||||
</form>
|
||||
<script src="options.js"></script>
|
||||
</body>
|
||||
</html>
|
16
options.js
16
options.js
|
@ -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);
|
|
@ -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 {
|
||||
|
|
22
styles.js
22
styles.js
|
@ -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);
|
Loading…
Reference in a new issue