mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
Merge pull request #145 from ajayyy/experimental-ajay
Fixed info button + videoChannelID errors
This commit is contained in:
15
content.js
15
content.js
@@ -240,12 +240,12 @@ function videoIDChange(id) {
|
|||||||
|
|
||||||
resetValues();
|
resetValues();
|
||||||
|
|
||||||
let channelIDPromise = wait(getChannelID);
|
|
||||||
channelIDPromise.then(() => channelIDPromise.isFulfilled = true).catch(() => channelIDPromise.isRejected = true)
|
|
||||||
|
|
||||||
//id is not valid
|
//id is not valid
|
||||||
if (!id) return;
|
if (!id) return;
|
||||||
|
|
||||||
|
let channelIDPromise = wait(getChannelID);
|
||||||
|
channelIDPromise.then(() => channelIDPromise.isFulfilled = true).catch(() => channelIDPromise.isRejected = true);
|
||||||
|
|
||||||
//setup the preview bar
|
//setup the preview bar
|
||||||
if (previewBar == null) {
|
if (previewBar == null) {
|
||||||
//create it
|
//create it
|
||||||
@@ -791,11 +791,18 @@ function openInfoMenu() {
|
|||||||
//add the close button
|
//add the close button
|
||||||
popup.prepend(closeButton);
|
popup.prepend(closeButton);
|
||||||
|
|
||||||
let parentNode = document.getElementById("secondary");
|
let parentNodes = document.querySelectorAll("#secondary");
|
||||||
|
let parentNode = null;
|
||||||
|
for (let i = 0; i < parentNodes.length; i++) {
|
||||||
|
if (parentNodes[i].firstElementChild !== null) {
|
||||||
|
parentNode = parentNodes[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
if (parentNode == null) {
|
if (parentNode == null) {
|
||||||
//old youtube theme
|
//old youtube theme
|
||||||
parentNode = document.getElementById("watch7-sidebar-contents");
|
parentNode = document.getElementById("watch7-sidebar-contents");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//make the logo source not 404
|
//make the logo source not 404
|
||||||
//query selector must be used since getElementByID doesn't work on a node and this isn't added to the document yet
|
//query selector must be used since getElementByID doesn't work on a node and this isn't added to the document yet
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "__MSG_Name__",
|
"short_name": "__MSG_Name__",
|
||||||
"version": "1.1.8",
|
"version": "1.1.9",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
|
|||||||
Reference in New Issue
Block a user