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

external links don't work in history router mode #1803

Closed
1 task done
pagyew opened this issue May 19, 2022 · 2 comments · Fixed by #1967
Closed
1 task done

external links don't work in history router mode #1803

pagyew opened this issue May 19, 2022 · 2 comments · Fixed by #1967
Labels
bug confirmed as a bug

Comments

@pagyew
Copy link

pagyew commented May 19, 2022

Bug Report

Steps to reproduce

  1. Set routerMode to history.
  2. Create mailto link with <my@mail.com>, or any external link.
  3. Click on rendered link.

What is current behaviour

Crashes with error:

SecurityError
Failed to execute 'replaceState' on 'History': A history state object with URL 'mailto:my@email.com' cannot be created in a document with origin 'https://kc32ry.csb.app' and URL 'https://kc32ry.csb.app/'.

What is the expected behaviour

Native behaviour

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: macOS Catalina, version 10.15.7

  • Node.js version: 16.13.2

  • npm/yarn version: npm v8.1.2

  • Browser version: Google Chrome 100.0.4896.127

  • Docsify version: 4.12.2

  • Docsify plugins: -

Please create a reproducible sandbox

Edit immutable-sunset-kc32ry

Live example: https://docs.lume.io/

Mention the docsify version in which this bug was not present (if any)

@trusktr
Copy link
Member

trusktr commented Jan 9, 2023

Indeed, non-docsify links (external links) are currently not working in history router mode. We need to fix this and add tests.

live example: https://docs.lume.io/

@trusktr trusktr added the bug confirmed as a bug label Jan 9, 2023
@trusktr trusktr changed the title mailto link doesn't work in history mode external links don't work in history router mode Jan 9, 2023
@trusktr
Copy link
Member

trusktr commented Jan 22, 2023

I found the issue. It happens when externalLinkTarget: '_self' is specified. Fix WIP

trusktr added a commit to lume/lume.github.io that referenced this issue Jan 22, 2023
trusktr added a commit to lume/docsify that referenced this issue Jan 22, 2023
…remove misspelled "crossorgin" link helper, and instead detect cross origin links and don't handle them as internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed as a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants