Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the 'href' attribute of the base tag points to the web page's base.. #308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant