Fixes for MS Edge

main
Elbert Alias 8 years ago
parent ff3bee380e
commit 087fc5ed2b

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

@ -33,9 +33,17 @@
* Get a value from localStorage
*/
getOption: function(name, defaultValue, callback) {
browser.storage.local.get(name).then(function(item) {
var func = function(item) {
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() {
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);
});
});

@ -6,7 +6,7 @@
init: function() {
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) {
popup.update(popup.appsToDomTemplate(response));
});
@ -14,15 +14,15 @@
try {
// Chrome, Firefox
browser.tabs.query({ active: true, currentWindow: true }).then(callback);
browser.tabs.query({ active: true, currentWindow: true }).then(func);
} catch ( e ) {
// Edge
browser.tabs.query({ active: true, currentWindow: true }, callback);
browser.tabs.query({ active: true, currentWindow: true }, func);
}
},
update: function(dom) {
if ( /complete|interacrive|loaded/.test(document.readyState) ) {
if ( /complete|interactive|loaded/.test(document.readyState) ) {
popup.replaceDom(dom);
} else {
document.addEventListener('DOMContentLoaded', function() {
@ -38,7 +38,7 @@
body.removeChild(body.firstChild);
}
body.append(jsonToDOM(domTemplate, document, {}));
body.appendChild(jsonToDOM(domTemplate, document, {}));
},
appsToDomTemplate: function(response) {

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

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

Loading…
Cancel
Save