@xapp/arachne-parsers
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -25,4 +25,5 @@ /*! Copyright (c) 2023, XAPP AI */ | ||
export * from "./WebflowDetector"; | ||
export * from "./WhatsAppDetector"; | ||
export * from "./WixDetector"; | ||
export * from "./WordPressDetector"; | ||
export * from "./XAPPDetector"; |
@@ -41,2 +41,3 @@ "use strict"; | ||
__exportStar(require("./WebflowDetector"), exports); | ||
__exportStar(require("./WhatsAppDetector"), exports); | ||
__exportStar(require("./WixDetector"), exports); | ||
@@ -43,0 +44,0 @@ __exportStar(require("./WordPressDetector"), exports); |
import { DetectorResult } from "./Detector"; | ||
import { EvaluatorDetector } from "./EvaluatorDetector"; | ||
export declare const WIX_CMS = "Wix CMS"; | ||
export declare const WIX_CHAT = "Wix Chat"; | ||
export declare const WIX_CHAT_URL = "engage.wixapps.net/chat-widget-server/renderChatWidget"; | ||
/** | ||
* Looks for Wix CMS and Wix Chat | ||
*/ | ||
export declare class WixDetector extends EvaluatorDetector { | ||
detect(): Promise<DetectorResult[]>; | ||
} |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WixDetector = exports.WIX_CMS = void 0; | ||
exports.WixDetector = exports.WIX_CHAT_URL = exports.WIX_CHAT = exports.WIX_CMS = void 0; | ||
/*! Copyright (c) 2023, XAPP AI */ | ||
@@ -18,2 +18,7 @@ const stentor_logger_1 = require("stentor-logger"); | ||
exports.WIX_CMS = "Wix CMS"; | ||
exports.WIX_CHAT = "Wix Chat"; | ||
exports.WIX_CHAT_URL = "engage.wixapps.net/chat-widget-server/renderChatWidget"; | ||
/** | ||
* Looks for Wix CMS and Wix Chat | ||
*/ | ||
class WixDetector extends EvaluatorDetector_1.EvaluatorDetector { | ||
@@ -52,2 +57,21 @@ detect() { | ||
} | ||
// now look for WIX Chat, which is in an iframe with src starting with //https://engage.wixapps.net/chat-widget-server/renderChatWidget | ||
const iframeTags = this.cheerio("iframe"); | ||
let hasChat = false; | ||
iframeTags.each((index, element) => { | ||
if ('attribs' in element) { | ||
const src = element.attribs['src']; | ||
if (src) { | ||
try { | ||
const url = new URL(src); | ||
const urlWithoutProtocol = url.host + url.pathname; | ||
if (urlWithoutProtocol.toLowerCase().includes(exports.WIX_CHAT_URL.toLowerCase())) { | ||
hasChat = true; | ||
} | ||
} | ||
catch (e) { // Invalid URL or other error, ignore | ||
} | ||
} | ||
} | ||
}); | ||
return [ | ||
@@ -57,2 +81,6 @@ { | ||
installed: isWix | ||
}, | ||
{ | ||
technology: exports.WIX_CHAT, | ||
installed: hasChat | ||
} | ||
@@ -59,0 +87,0 @@ ]; |
{ | ||
"name": "@xapp/arachne-parsers", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"types": "lib/index", | ||
@@ -45,3 +45,3 @@ "main": "lib/index", | ||
}, | ||
"gitHead": "6c6b736c1eba7d061df84c7e331bf904716d1c14" | ||
"gitHead": "b9167895efcf15c0537118319bab91d00cb86517" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
146854
107
2155