alientube icon indicating copy to clipboard operation
alientube copied to clipboard

Error and doesn't show reddit comments until refresh

Open grothe6 opened this issue 9 years ago • 2 comments

I'm using Google Chrome 48.0.2564.82 m and AlienTube 2.6.

When I load a youtube video, the extension does not load and the normal g+/yt-comments are shown. When I hit refresh, the extension and the reddit comments load fine.

At every first load there is following error in the chrome js-console:

Uncaught TypeError: Cannot read property 'getAttribute' of null
CommentSection.getDisplayActionForCurrentChannel @ script.js:1190
CommentSection.set @ script.js:877
(anonymous function) @ script.js:686
(anonymous function) @ script.js:193

The error is located in the function you changed in 7115b997a5ee5939d643eb1b58e00b64002732cf for #148 which had a similar issue.

CommentSection.prototype.getDisplayActionForCurrentChannel = function () {
    var channelId;
    if (AlienTube.Application.currentMediaService() === Service.YouTube) {
       channelId = document.querySelector("meta[itemprop='channelId']").getAttribute("content");
    }
    [...]
};

When I copy

document.querySelector("meta[itemprop='channelId']").getAttribute("content");

directly into the console the error does not occur.

grothe6 avatar Jan 25 '16 12:01 grothe6

One thing to add: The error occurs only when I click on a video inside youtube itself. When I copy a link directly or click on a link from reddit/twitter/etc. there is no problem.

grothe6 avatar Jan 25 '16 16:01 grothe6

I have this problem as well, completely reinstalled chrome and removed all other plugins to see if there was a conflict. There likely to be a fix? Quite a few people have this.

kashinoda avatar Feb 24 '16 05:02 kashinoda