Fix technology links in bookmarklet driver

main
Elbert Alias 5 years ago
parent f819c4dd09
commit 323dafd7bd

@ -1,9 +1,7 @@
/**
* Bookmarklet driver
*/
/** global: wappalyzer */
/** global: XMLHttpRequest */
/* eslint-env browser */
/* eslint-disable func-names, no-unused-expressions, no-restricted-globals */
/* eslint-disable no-restricted-syntax, no-continue */
/* global wappalyzer */
(function () {
wappalyzer.driver.document = document;
@ -16,6 +14,7 @@
* Log messages to console
*/
wappalyzer.driver.log = (message, source, type) => {
// eslint-disable-next-line no-console
console.log(`[wappalyzer ${type}]`, `[${source}]`, message);
};
@ -51,14 +50,14 @@
if (xhr.readyState === 4 && xhr.status) {
const headers = xhr.getAllResponseHeaders().split('\n');
if (headers.length > 0 && headers[0] != '') {
if (headers.length > 0 && headers[0]) {
wappalyzer.log(`responseHeaders: ${xhr.getAllResponseHeaders()}`, 'driver');
const responseHeaders = {};
headers.forEach((line) => {
let name,
value;
let name;
let value;
if (line) {
name = line.substring(0, line.indexOf(': '));
@ -81,6 +80,10 @@
xhr.send();
}
function slugify(string) {
return string.toLowerCase().replace(/[^a-z0-9-]/g, '-').replace(/--+/g, '-').replace(/(?:^-|-$)/, '');
}
/**
* Display apps
*/
@ -103,12 +106,13 @@
continue;
}
let version = detected[app].version,
confidence = detected[app].confidence;
const { version, confidence } = detected[app];
category = wappalyzer.categories[wappalyzer.apps[app].cats[0]].name;
html
+= `<div class="wappalyzer-app${first ? ' wappalyzer-first' : ''}">`
+ `<a target="_blank" class="wappalyzer-application" href="${wappalyzer.config.websiteURL}applications/${app.toLowerCase().replace(/ /g, '-').replace(/[^a-z0-9-]/g, '')}">`
+ `<a target="_blank" class="wappalyzer-application" href="${wappalyzer.config.websiteURL}technologies/${slugify(category)}/${slugify(app)}">`
+ '<strong>'
+ `<img src="${wappalyzer.config.websiteURL}images/icons/${wappalyzer.apps[app].icon || 'default.svg'}" width="16" height="16"/> ${app
}</strong>${
@ -122,7 +126,7 @@
category = wappalyzer.categories[wappalyzer.apps[app].cats[i]].name;
html += `<a target="_blank" class="wappalyzer-category" href="${wappalyzer.config.websiteURL}categories/${slugify(category)}">${category}</a>`;
html += `<a target="_blank" class="wappalyzer-category" href="${wappalyzer.config.websiteURL}technologies/${slugify(category)}">${category}</a>`;
}
html += '</div>';
@ -130,25 +134,14 @@
first = false;
}
} else {
html += '<div id="wappalyzer-empty">No applications detected</div>';
html += '<div id="wappalyzer-empty">No technologies detected</div>';
}
html += '</div>';
container.innerHTML = html;
},
/**
* Open a tab
*/
function openTab(args) {
open(args.url);
};
function slugify(string) {
return string.toLowerCase().replace(/[^a-z0-9-]/g, '-').replace(/--+/g, '-').replace(/(?:^-|-$)/, '');
}
getPageContent();
getResponseHeaders();
}());

@ -2,7 +2,7 @@
"name": "wappalyzer",
"description": "Identify technology on websites",
"homepage": "https://www.wappalyzer.com",
"version": "5.9.33",
"version": "5.9.34",
"author": "Wappalyzer",
"license": "MIT",
"repository": {

Loading…
Cancel
Save