Code:
function showpanel() {
var video = document.getElementsByClassName("jw-video")[0].src;
console.log(video);
window.open(video, '_blank');
}
setTimeout(showpanel, 1000);
Description:
This question is more about wondering why this is happening rather than trying to fix it.
The point of the extension is, I made it from my brother because he wanted to download videos from 123movies.is without downloading viruses. I originally was gonna make it through my web portfolio site but I then noticed it would be much easier to do it with an extension.
When I host the files locally on my personal pc everything runs fine. when the movie page loads, it opens up a new tab with the src of the video
tag where I can simply press the download button. But when I published the extension files to the google chrome web store, any time I load up the movie page I get these two errors:
Uncaught TypeError: Cannot read property 'src' of undefined
at showpanel (chrome-extension://pefemfiejenbjbbbilkiejfnpcjpeoaf/content.js:2)
Failed to load resource: net::ERR_TOO_MANY_REDIRECTS
Whats causing these errors to only happen if the extension is published to the web store?