Fix meta detection method

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

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

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

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

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

@ -442,13 +442,16 @@ class Wappalyzer {
analyzeMeta(app, html) {
var regex = /<meta[^>]+>/ig;
var patterns = this.parsePatterns(app.props.meta);
var content;
var match;
var content = '';
var matches = [];
while ( patterns && ( match = regex.exec(html) ) ) {
while ( patterns && ( matches = regex.exec(html) ) ) {
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 => {
if ( content && content.length === 4 && pattern.regex.test(content[2]) ) {

Loading…
Cancel
Save