Skip to content

Conversation

WetHat
Copy link

@WetHat WetHat commented Mar 28, 2024

Fixes issue #201 .

Some website specify the href of the base tag as '/' rather than the base uri of the website. This causes the JDOMParser to set:

  • dom.baseURI = 'chrome-extension://nghfdnngoejlhedogdpikdlkmdfoojii/'
  • dom.documentURI = 'chrome-extension://nghfdnngoejlhedogdpikdlkmdfoojii/_generated_background_page.html'

when it parse HTML text in the background context.
As a consequence Readability.js generates garbage for local links.

With this change https://steven-giesel.com/blogPost/79ce95ad-17a9-4537-8f1b-48d71efc585d reported by @nicolaiarocci works ok;

image

web page's base.

Some website specify the href of the base tag as '/'.
This causes the JDOMParser to set:

* dom.baseURI = 'chrome-extension://nghfdnngoejlhedogdpikdlkmdfoojii/'
* dom.documentURI = 'chrome-extension://nghfdnngoejlhedogdpikdlkmdfoojii/_generated_background_page.html'

when it parse HTML text in the background context and subsequently Readability.js
genarates garbage for local links
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.

2 participants