From 32dd7d43d7fc4928a94579c397b475fcbebfea5e Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 27 Aug 2019 21:10:35 -0400 Subject: [PATCH] Updated it to make it work in the info menu (on page popup). --- popup.js | 2 +- utils.js | 5 ++--- 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();