question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A cross-origin url on _coverpage file cannot be redirected to if "routerMode" is set to "history"

See original GitHub issue

Bug Report

Steps to reproduce

Set these lines in index.html

  window.$docsify = {
    //...
    loadSidebar: true,
    routerMode: 'history',
    coverpage: true,
    onlyCover: true,

Then use any other doman URLs in _coverpage file, See below…

<a href="https://rstudio.com/auth-sign-in">Login</a><br />

What is the current behavior

when clicking on the link on the cover page there is no response, while checking the browser console getting the following error.

Uncaught DOMException: Failed to execute ‘pushState’ on ‘History’: A history state object with URL ‘https://rstudio.com/auth-sign-in’ cannot be created in a document with origin ‘https://datatools.inhouse.com’ and URL ‘https://datatools.inhouse.com/’. at https://cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js:1:93866

What is the expected behavior

Redirect to the mentioned web page directly.

Other relevant information

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

  • Your OS: Using the docsify index.html file in an apache container, the apache server serves the web site.

  • Docsify version: Using “src=”//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js" " in the index page. I believe this will use the latest version of docsify.

  • Have you seen this issue with other docsify projects? Yes, see #1046 @Koooooo-7 @anikethsaha

  • Docsify plugins:

  1. search.min.js
  2. docsify-plugin-flexible-alerts
  3. mermaid.js

Mentioned index.html and _coverpage files are in the below repository. Please check it.

Git repo

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Siddhu1096commented, Oct 1, 2020

I’m also facing the same issue.

Sent from my OnePlus 5 using FastHub

0reactions
Koooooo-7commented, Oct 7, 2020

@Koooooo-7 Thank you for the solution, I tried the same and it worked as expected.

Aha, no problem.

I’ve solved the issue differently using href attribute ‘“target=”_blank’. See below.

<a href=“https://rstudio.com/rsc/connect/#/login/target="blank">

Adding the ‘“target=”_blank’ with the URL solved the issue by opening it in a different browser tab.

Cool.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allowing cross-origin use of images and canvas - HTML
The first thing we need is a server that's configured to host images with the Access-Control-Allow-Origin header configured to permit cross- ...
Read more >
Changelog - docsify
... cross-origin url cannot be redirected when "externalLinkTarget" is set to "_self" and "routerMode" is set to "history". (#1062) (fd2cec6), closes #1046 ...
Read more >
CHANGELOG.md · docsifyjs/docsify - Gitee.com
... cross-origin url cannot be redirected when "externalLinkTarget" is set to "_self" and "routerMode" is set to "history". (#1062) (fd2cec6), closes #1046 ...
Read more >
Untitled
Lord of ajasa ojumo ire, Country bucks tv, A derma cytelium per varicella, ... Too many redirects, Letter borrowing money sample, Mcalpine shower...
Read more >
docsify: Versions - Openbase
Full version history for docsify including change logs. ... cross-origin url cannot be redirected when "externalLinkTarget" is set to "_self" and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found