From e90f066c59cfa2254f8fb606e2b885ffeb59ca9f Mon Sep 17 00:00:00 2001 From: Vaibhav <183315953+D3ICIDE@users.noreply.github.com> Date: Sat, 1 Aug 2026 10:45:16 +0530 Subject: [PATCH] fix(fenrirrealm): fixed broken webview (#2366) Co-authored-by: D3ICIDE --- plugins/english/fenrirrealm.ts | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins/english/fenrirrealm.ts b/plugins/english/fenrirrealm.ts index 291dc6c..3c2ce59 100644 --- a/plugins/english/fenrirrealm.ts +++ b/plugins/english/fenrirrealm.ts @@ -75,7 +75,7 @@ class FenrirRealmPlugin implements Plugin.PluginBase { name = 'Fenrir Realm'; icon = 'src/en/fenrirrealm/icon.png'; site = 'https://fenrirealm.com'; - version = '1.1.1'; + version = '1.1.2'; imageRequestInit?: Plugin.ImageRequestInit | undefined = undefined; hideLocked = storage.get('hideLocked'); @@ -304,9 +304,20 @@ class FenrirRealmPlugin implements Plugin.PluginBase { const loadedCheerio = loadCheerio(body); - let chapterText = loadedCheerio('div.content-area p') - .map((_, el) => `

${loadCheerio(el).html()}

`) + // Clean up anti-scraping and watermark elements first + loadedCheerio('[aria-hidden="true"]').remove(); + loadedCheerio('.reader-attribution').remove(); + loadedCheerio('[data-fr-attr]').remove(); + + let chapterText = loadedCheerio( + '.reader-area p, div.content-area p, [id^="reader-area"] p', + ) + .map((_, el) => { + const html = loadedCheerio(el).html()?.trim(); + return html ? `

${html}

` : ''; + }) .get() + .filter(Boolean) .join('\n'); if (chapterText) { @@ -400,8 +411,9 @@ class FenrirRealmPlugin implements Plugin.PluginBase { }; } - // resolveUrl = (path: string, isNovel?: boolean) => - // this.site + '/series/' + path.split('~~')[0]; + resolveUrl(path: string): string { + return `${this.site}/series/${path.split('~~')[0]}`; + } filters = { status: {