mastodon detection nonsense

This commit is contained in:
Evert Prants 2023-11-08 20:55:38 +02:00
parent f2a0eeb799
commit 3cdf4dac45
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
3 changed files with 6 additions and 5 deletions

View File

@ -27,7 +27,7 @@
}, },
{ {
"name": "url-fediverse", "name": "url-fediverse",
"version": "1.0.3" "version": "1.0.4"
}, },
{ {
"name": "url-peertube", "name": "url-peertube",

View File

@ -2,7 +2,7 @@
"main": "plugin.js", "main": "plugin.js",
"name": "url-fediverse", "name": "url-fediverse",
"description": "URLReply Fediverse", "description": "URLReply Fediverse",
"version": "1.0.3", "version": "1.0.4",
"tags": ["urlreply"], "tags": ["urlreply"],
"dependencies": ["urlreply"], "dependencies": ["urlreply"],
"npmDependencies": [] "npmDependencies": []

View File

@ -114,12 +114,13 @@ class FediResponsePlugin extends Plugin {
if (type === 'Pleroma') { if (type === 'Pleroma') {
pass = true; pass = true;
} else { } else {
const tag = body('a[href="https://joinmastodon.org/"]'); const tag = body('a[href="https://joinmastodon.org"]');
const initTag = body('head > script[id="initial-state"][type="application/json"]');
if ( if (
tag && initTag || (tag &&
tag.text() && tag.text() &&
((tag.text() as string).includes('Mastodon') || ((tag.text() as string).includes('Mastodon') ||
(tag.text() as string).includes('About')) (tag.text() as string).includes('About')))
) { ) {
pass = true; pass = true;
} }