Fixes for MS Edge

main
Elbert Alias 8 years ago
parent ff3bee380e
commit 087fc5ed2b

@ -2,7 +2,7 @@
"name": "Wappalyzer", "name": "Wappalyzer",
"description": "Uncovers the technologies used on websites", "description": "Uncovers the technologies used on websites",
"homepage": "https://github.com/AliasIO/Wappalyzer", "homepage": "https://github.com/AliasIO/Wappalyzer",
"version": "4.1.3", "version": "4.1.4",
"author": "Elbert Alias", "author": "Elbert Alias",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

@ -33,9 +33,17 @@
* Get a value from localStorage * Get a value from localStorage
*/ */
getOption: function(name, defaultValue, callback) { getOption: function(name, defaultValue, callback) {
browser.storage.local.get(name).then(function(item) { var func = function(item) {
callback(item.hasOwnProperty(name) ? item[name] : defaultValue); callback(item.hasOwnProperty(name) ? item[name] : defaultValue);
}); };
try {
// Chrome, Firefox
browser.storage.local.get(name).then(func);
} catch ( e ) {
// Edge
browser.storage.local.get(name, func);
}
}, },
/** /**

@ -3,7 +3,7 @@
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
var nodes = document.querySelectorAll('[data-i18n]'); var nodes = document.querySelectorAll('[data-i18n]');
nodes.forEach(function(node) { Array.prototype.forEach.call(nodes, function (node) {
node.childNodes[0].nodeValue = browser.i18n.getMessage(node.dataset.i18n); node.childNodes[0].nodeValue = browser.i18n.getMessage(node.dataset.i18n);
}); });
}); });

@ -6,7 +6,7 @@
init: function() { init: function() {
popup.update([ 'p', {}, ' ' ], document, {}); popup.update([ 'p', {}, ' ' ], document, {});
var callback = function(tabs) { var func = function(tabs) {
( chrome || browser ).runtime.sendMessage({ id: 'get_apps', tab: tabs[0], source: 'popup.js' }, function(response) { ( chrome || browser ).runtime.sendMessage({ id: 'get_apps', tab: tabs[0], source: 'popup.js' }, function(response) {
popup.update(popup.appsToDomTemplate(response)); popup.update(popup.appsToDomTemplate(response));
}); });
@ -14,15 +14,15 @@
try { try {
// Chrome, Firefox // Chrome, Firefox
browser.tabs.query({ active: true, currentWindow: true }).then(callback); browser.tabs.query({ active: true, currentWindow: true }).then(func);
} catch ( e ) { } catch ( e ) {
// Edge // Edge
browser.tabs.query({ active: true, currentWindow: true }, callback); browser.tabs.query({ active: true, currentWindow: true }, func);
} }
}, },
update: function(dom) { update: function(dom) {
if ( /complete|interacrive|loaded/.test(document.readyState) ) { if ( /complete|interactive|loaded/.test(document.readyState) ) {
popup.replaceDom(dom); popup.replaceDom(dom);
} else { } else {
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
@ -38,7 +38,7 @@
body.removeChild(body.firstChild); body.removeChild(body.firstChild);
} }
body.append(jsonToDOM(domTemplate, document, {})); body.appendChild(jsonToDOM(domTemplate, document, {}));
}, },
appsToDomTemplate: function(response) { appsToDomTemplate: function(response) {

@ -4,7 +4,7 @@
"author": "Elbert Alias", "author": "Elbert Alias",
"homepage_url": "https://wappalyzer.com/", "homepage_url": "https://wappalyzer.com/",
"description": "Identify web technologies", "description": "Identify web technologies",
"version": "4.1.3", "version": "4.1.4",
"default_locale": "en", "default_locale": "en",
"manifest_version": 2, "manifest_version": 2,
"icons": { "icons": {

@ -4,7 +4,7 @@
"author": "Elbert Alias", "author": "Elbert Alias",
"homepage_url": "https://wappalyzer.com/", "homepage_url": "https://wappalyzer.com/",
"description": "Identify web technologies", "description": "Identify web technologies",
"version": "4.1.3", "version": "4.1.4",
"default_locale": "en", "default_locale": "en",
"manifest_version": 2, "manifest_version": 2,
"icons": { "icons": {

Loading…
Cancel
Save