aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-08-27 21:10:35 -0400
committerAjay Ramachandran <[email protected]>2019-08-27 21:10:35 -0400
commit32dd7d43d7fc4928a94579c397b475fcbebfea5e (patch)
tree0c92cb791d7cac3455fbfa9d838335a239ad2719
parent284efe990252f1a7964fd8b01c874173b4a33198 (diff)
downloadSponsorBlock-32dd7d43d7fc4928a94579c397b475fcbebfea5e.tar.gz
SponsorBlock-32dd7d43d7fc4928a94579c397b475fcbebfea5e.zip
Updated it to make it work in the info menu (on page popup).
-rw-r--r--popup.js2
-rw-r--r--utils.js5
2 files changed, 3 insertions, 4 deletions
diff --git a/popup.js b/popup.js
index c7fd4b9a..3476747a 100644
--- a/popup.js
+++ b/popup.js
@@ -1,7 +1,7 @@
-localizeHtmlPage();
//make this a function to allow this to run on the content page
function runThePopup() {
+ localizeHtmlPage();
//is it in the popup or content script
var inPopup = true;
diff --git a/utils.js b/utils.js
index 2ec274a5..d9ce3a22 100644
--- a/utils.js
+++ b/utils.js
@@ -49,9 +49,8 @@ function getYouTubeVideoID(url) {
function localizeHtmlPage() {
//Localize by replacing __MSG_***__ meta tags
- var objects = document.getElementsByTagName('html');
- for (var j = 0; j < objects.length; j++)
- {
+ var objects = document.getElementsByClassName("popupBody")[0].children;
+ for (var j = 0; j < objects.length; j++) {
var obj = objects[j];
var valStrH = obj.innerHTML.toString();