Skip to content

feat(novelsbr): add Novels BR plugin and icon - #2624

Open
felipebonfim2006 wants to merge 2 commits into
lnreader:masterfrom
felipebonfim2006:master
Open

felipebonfim2006 wants to merge 2 commits into
lnreader:masterfrom
felipebonfim2006:master

Conversation

@felipebonfim2006

@felipebonfim2006 felipebonfim2006 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1570

  • Update version code if an existing plugin was modified — N/A
  • Test changes in Plugin Playground or the app
  • Reference related issues in the PR body
  • Commit messages follow type(scope): description

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 1/5

[Medium risk] Adds a new novel-scraping plugin for a Portuguese site.

The PR is not safe to merge until chapter HTML is made safe and the browsing and chapter-content losses are fixed.

Findings

  1. P1 Security Chapter code can run ▶
  2. P1 Later pages lose list order ▶
  3. P1 Parts of chapters disappear ▶

Summary

Adds Novels BR as a Portuguese source, with browsing, category filters, search, novel details, and chapter reading. It also adds a source icon.

  • Readers can browse recent or popular novels, filter by category, and search titles.
  • Novel pages provide details and chapter lists; chapter pages provide cleaned reading text.

Reviews (1) · Last reviewed commit: "feat(novelsbr): add Novels BR plugin and..."

Comment on lines +488 to +496
const paragraphs = content
.find('p')
.map((_, element) => $(element).html()?.trim() || '')
.get()
.filter(Boolean);

return paragraphs.length > 0
? paragraphs.join('<br><br>')
: content.html()?.trim() || '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Chapter code can run. parseChapter removes some tags but leaves attributes such as onerror on images. If a fetched chapter contains <img src=x onerror=...>, that attribute remains in the returned HTML. The reader inserts that HTML into the page, where the handler can run. Strip active attributes before returning the chapter.

How this was verified: Fetched chapter HTML keeps image event attributes, and the reader inserts the returned string with dangerouslySetInnerHTML.

Comment on lines +284 to +294
const params = new URLSearchParams();

params.set('simplifiedField', '');

if (category) {
params.set('categoryId', category);
}

params.set('page', String(Math.max(0, pageNo - 1)));

const body = await fetchText(`${this.site}/novels?${params.toString()}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Later pages lose list order. showLatestNovels picks the recent home section on page one, but later pages send the same /novels request for both latest and popular mode. At least one mode therefore loses its chosen order after page one. Send the selected order with later-page requests.

Comment on lines +468 to +472
content
.find(
'script, style, noscript, iframe, ins, .adsbygoogle, button, .navigation-buttons, a',
)
.remove();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Parts of chapters disappear. parseChapter removes every link along with its text. When it finds any <p>, it also returns only paragraph contents. A chapter with linked prose or an image beside its paragraphs loses those parts. Keep the readable link text and the chapter’s other content.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sources Request] Novels BR (Brazilian portuguese)

1 participant