Fix icon not displaying and popup not expanding

main
Elbert Alias 7 years ago
parent 0a008afcfa
commit c4328afa30

@ -30,7 +30,7 @@ $ node index.js https://wappalyzer.com
```javascript ```javascript
const wappalyzer = require('wappalyzer'); const wappalyzer = require('wappalyzer');
wappalyzer('https://wappalyzer.com') wappalyzer.analyze('https://wappalyzer.com')
.then(json => { .then(json => {
console.log(JSON.stringify(json, null, 2)); console.log(JSON.stringify(json, null, 2));
}) })

@ -230,13 +230,13 @@ wappalyzer.driver.displayApps = (detected, context) => {
var app = detected[appName]; var app = detected[appName];
app.props.cats.forEach(category => { app.props.cats.forEach(category => {
var icon = app.icon || 'default.svg'; if ( category === match && !found ) {
var icon = app.props.icon || 'default.svg';
if ( !dynamicIcon ) { if ( !dynamicIcon ) {
icon = 'default.svg'; icon = 'default.svg';
} }
if ( category === match && !found ) {
if ( /\.svg$/i.test(icon) ) { if ( /\.svg$/i.test(icon) ) {
icon = 'converted/' + icon.replace(/\.svg$/, '.png'); icon = 'converted/' + icon.replace(/\.svg$/, '.png');
} }

@ -138,7 +138,7 @@ var exports = {};
'', '',
'tracking_enabled_response', 'tracking_enabled_response',
function(message) { function(message) {
if ( message.tracking_enabled ) { if ( message && message.tracking_enabled ) {
callback(); callback();
} else { } else {

@ -1,8 +1,6 @@
/** global: chrome */ /** global: chrome */
/** global: browser */ /** global: browser */
replaceDomWhenReady([ 'p', {}, ' ' ], document, {});
var func = tabs => { var func = tabs => {
( chrome || browser ).runtime.sendMessage({ ( chrome || browser ).runtime.sendMessage({
id: 'get_apps', id: 'get_apps',
@ -44,6 +42,16 @@ function replaceDom(domTemplate) {
var nodes = document.querySelectorAll('[data-i18n]'); var nodes = document.querySelectorAll('[data-i18n]');
for ( let ms = 200; ms < 500; ms += 50 ) {
setTimeout(() => {
let div = document.createElement('div');
div.style.display = 'none';
body.appendChild(div);
}, ms);
};
Array.prototype.forEach.call(nodes, node => { Array.prototype.forEach.call(nodes, node => {
node.childNodes[0].nodeValue = browser.i18n.getMessage(node.dataset.i18n); node.childNodes[0].nodeValue = browser.i18n.getMessage(node.dataset.i18n);
}); });

Loading…
Cancel
Save