Skip to content

Commit

Permalink
Merge pull request #145 from ajayyy/experimental-ajay
Browse files Browse the repository at this point in the history
Fixed info button + videoChannelID errors
  • Loading branch information
ajayyy authored Sep 3, 2019
2 parents c6460b0 + ef1b96b commit 1782376
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ function videoIDChange(id) {

resetValues();

let channelIDPromise = wait(getChannelID);
channelIDPromise.then(() => channelIDPromise.isFulfilled = true).catch(() => channelIDPromise.isRejected = true)

//id is not valid
if (!id) return;

let channelIDPromise = wait(getChannelID);
channelIDPromise.then(() => channelIDPromise.isFulfilled = true).catch(() => channelIDPromise.isRejected = true);

//setup the preview bar
if (previewBar == null) {
//create it
Expand Down Expand Up @@ -791,11 +791,18 @@ function openInfoMenu() {
//add the close button
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) {
//old youtube theme
parentNode = document.getElementById("watch7-sidebar-contents");
}


//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
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "__MSG_Name__",
"version": "1.1.8",
"version": "1.1.9",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [
Expand Down

0 comments on commit 1782376

Please sign in to comment.