Fix meta detection method

main
Elbert Alias 7 years ago
parent 2e5651f3c9
commit 4a711891fc

@ -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": "5.4.4", "version": "5.4.5",
"author": "Elbert Alias", "author": "Elbert Alias",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

@ -5,8 +5,8 @@ if ( typeof browser !== 'undefined' && typeof document.body !== 'undefined' ) {
try { try {
var html = new XMLSerializer().serializeToString(document); var html = new XMLSerializer().serializeToString(document);
if ( html.length > 50000 ) { if ( html.length > 500000 ) {
html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length); html = html.substring(0, 250000) + html.substring(html.length - 250000, html.length);
} }
const scripts = Array.prototype.slice const scripts = Array.prototype.slice

@ -1,7 +1,6 @@
(function() { (function() {
try { try {
addEventListener('message', (event => { addEventListener('message', (event => {
console.log({ event });
if ( event.data.id !== 'patterns' ) { if ( event.data.id !== 'patterns' ) {
return; return;
} }

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

@ -442,13 +442,16 @@ class Wappalyzer {
analyzeMeta(app, html) { analyzeMeta(app, html) {
var regex = /<meta[^>]+>/ig; var regex = /<meta[^>]+>/ig;
var patterns = this.parsePatterns(app.props.meta); var patterns = this.parsePatterns(app.props.meta);
var content; var content = '';
var match; var matches = [];
while ( patterns && ( match = regex.exec(html) ) ) { while ( patterns && ( matches = regex.exec(html) ) ) {
for ( var meta in patterns ) { for ( var meta in patterns ) {
if ( new RegExp('(name|property)=["\']' + meta + '["\']', 'i').test(match) ) {
content = match.toString().match(/content=("|')([^"']+)("|')/i); const r = new RegExp('(?:name|property)=["\']' + meta + '["\']', 'i');
if ( new RegExp('(?:name|property)=["\']' + meta + '["\']', 'i').test(matches[0]) ) {
content = matches[0].match(/content=("|')([^"']+)("|')/i);
patterns[meta].forEach(pattern => { patterns[meta].forEach(pattern => {
if ( content && content.length === 4 && pattern.regex.test(content[2]) ) { if ( content && content.length === 4 && pattern.regex.test(content[2]) ) {

Loading…
Cancel
Save