From 04531bdee5315204b4b6fcaea24eb566677882ca Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sun, 21 May 2017 09:05:20 +1000 Subject: [PATCH] Fix internationalisation in WebExtension --- src/apps.json | 4 ++-- src/drivers/webextension/js/i18n.js | 12 ++++-------- src/drivers/webextension/options.html | 1 - src/wappalyzer.js | 7 ------- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/apps.json b/src/apps.json index 40cb8cd92..2e8ee4c79 100755 --- a/src/apps.json +++ b/src/apps.json @@ -10070,7 +10070,7 @@ "html": "(?:]+id=\"recaptcha_image|]+recaptcha|document\\.getElementById\\('recaptcha')", "icon": "reCAPTCHA.png", "script": "(?:api-secure\\.recaptcha\\.net|recaptcha_ajax\\.js)", - "website": "http://recaptcha.net" + "website": "https://www.google.com/recaptcha/" }, "sIFR": { "cats": [ @@ -10494,4 +10494,4 @@ "priority": "9" } } -} \ No newline at end of file +} diff --git a/src/drivers/webextension/js/i18n.js b/src/drivers/webextension/js/i18n.js index 1b69f9f58..c5ea110e3 100644 --- a/src/drivers/webextension/js/i18n.js +++ b/src/drivers/webextension/js/i18n.js @@ -1,13 +1,9 @@ /** global: browser */ document.addEventListener('DOMContentLoaded', function() { - var - i, value, - nodes = document.querySelector('*'); + var nodes = document.querySelectorAll('[data-i18n]'); - for ( i = 0; i < nodes.length; i ++ ) { - if ( value = nodes[i].dataset.i18n ) { - nodes[i].innerHTML = browser.i18n.getMessage(value); - } - } + nodes.forEach(function(node) { + node.innerHTML = browser.i18n.getMessage(node.dataset.i18n); + }); }); diff --git a/src/drivers/webextension/options.html b/src/drivers/webextension/options.html index 755b909e2..caee7dcdc 100644 --- a/src/drivers/webextension/options.html +++ b/src/drivers/webextension/options.html @@ -12,7 +12,6 @@ - diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 540ad46ec..093ab7c80 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -470,13 +470,6 @@ var wappalyzer = (function() { regex = /]+>/ig, patterns = parsePatterns(w.apps[app.app].meta); - w.log('Function call: analyzeMeta'); - - if ( app.app === 'CloudCart' ) { - w.log('xxx'); - w.log(patterns); - } - if ( patterns ) { while ( match = regex.exec(html) ) { for ( meta in patterns ) {