From 28a93d5bec3fc4b40479e6eeec08185583e27ac3 Mon Sep 17 00:00:00 2001
From: Elbert Alias <77259+AliasIO@users.noreply.github.com>
Date: Sun, 4 Feb 2018 11:33:51 +1100
Subject: [PATCH] Improve Joomla pattern, decrease processed HTML sise
---
src/apps.json | 2 +-
src/drivers/webextension/js/content.js | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/apps.json b/src/apps.json
index 201cbddc3..0148c3290 100644
--- a/src/apps.json
+++ b/src/apps.json
@@ -4729,7 +4729,7 @@
"headers": {
"X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1"
},
- "html": "(?:
]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|
]+class=\"pill)\\;confidence:50",
+ "html": "(?:]+id=\"wrapper_r\"|<(?:link|script)[^>]+(?:feed|components)/com_|
]+class=\"pill)\\;confidence:50",
"icon": "Joomla.svg",
"implies": "PHP",
"meta": {
diff --git a/src/drivers/webextension/js/content.js b/src/drivers/webextension/js/content.js
index 8404c4b92..e60df6894 100644
--- a/src/drivers/webextension/js/content.js
+++ b/src/drivers/webextension/js/content.js
@@ -5,8 +5,8 @@ if ( typeof browser !== 'undefined' && typeof document.body !== 'undefined' ) {
try {
var html = new XMLSerializer().serializeToString(document);
- if ( html.length > 500000 ) {
- html = html.substring(0, 250000) + html.substring(html.length - 250000, html.length);
+ if ( html.length > 100 * 1024 ) {
+ html = html.substring(0, 50 * 1024) + html.substring(html.length - 50 * 1024, html.length);
}
const scripts = Array.prototype.slice