aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils.ts
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-06-02 21:08:34 -0400
committerAjay <[email protected]>2022-06-02 21:38:26 -0400
commit3d9221eb8dcccd3dbe2c84e6b8e5157bc01e6d7e (patch)
tree51b0af9f4d937341a63f35502aa9616754ac89f8 /src/utils.ts
parent96173dd901bf95bfdf5e55d76c8f1e23cab8c6f3 (diff)
downloadSponsorBlock-3d9221eb8dcccd3dbe2c84e6b8e5157bc01e6d7e.tar.gz
SponsorBlock-3d9221eb8dcccd3dbe2c84e6b8e5157bc01e6d7e.zip
improve display while popup loads
Diffstat (limited to 'src/utils.ts')
-rw-r--r--src/utils.ts25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/utils.ts b/src/utils.ts
index d89e1a3d..f72f4dd0 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -256,31 +256,6 @@ export default class Utils {
}
}
- localizeHtmlPage(): void {
- //Localize by replacing __MSG_***__ meta tags
- const localizedMessage = this.getLocalizedMessage(document.title);
- if (localizedMessage) document.title = localizedMessage;
- const objects = document.getElementsByClassName("sponsorBlockPageBody")[0].children;
- for (let j = 0; j < objects.length; j++) {
- const obj = objects[j];
- const localizedMessage = this.getLocalizedMessage(obj.innerHTML.toString());
- if (localizedMessage) obj.innerHTML = localizedMessage;
- }
- }
-
- getLocalizedMessage(text: string): string | false {
- const valNewH = text.replace(/__MSG_(\w+)__/g, function(match, v1) {
- return v1 ? chrome.i18n.getMessage(v1).replace(/</g, "&#60;")
- .replace(/"/g, "&quot;").replace(/\n/g, "<br/>") : "";
- });
-
- if(valNewH != text) {
- return valNewH;
- } else {
- return false;
- }
- }
-
/**
* @returns {String[]} Domains in regex form
*/