-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
A cross-origin url cannot be redirected to if "externalLinkTarget" is set to "_self" and "routerMode" is set to "history" #1046
Comments
Also available on Firefox Browser (
|
excuse me. FYR:
|
@Koooooo-7 Sorry. I forgot to report that |
thx a lot.
@anikethsaha |
Thanks @Koooooo-7 for triaging this ! 💯 I am not so into security things that's why I can't give 100% opinion.
What do you think about having a separate option for this ? |
@anikethsaha |
by option, I meant separate option for |
History mode by default shows the origin issue, so bypassing (doing the workaround to show the page) by default won't be a good idea . What do you think ? |
yep, where do u wanna set the option? As an independent configuration or the configuration with the URL?
yep, we do keep the present one. As a independent option, it seems like this: if ( optionFlag&& isCrossOriginUrl (url)){
windows. open(url, '_self')
}
windows. history. pushState(... ) and, how about setting a sign/flag with the URL? only if we find the flag, we use Example: [example.com](https://example.com/ ':crossurl=true') |
this is much better. Lets do this one |
…is set to "_self" and "routerMode" is set to "history". (#1062) * [fix #1046] fix cross-origin url cannot be redirected when "externalLinkTarget" is set to "_self" and "routerMode" is set to "history". * [code format] code format. * update docs * docs refine. * fix(core): cross-orgin link work incorrect (#1046) Fix cross-origin url cannot be redirected when "externalLinkTarget" is set to "_self" and "routerMode" is set to "history". Add new configuration for those cases and completed docs. Fixes #1046 PR Close #1062
@Koooooo-7 @anikethsaha I have a _coverpage file and added some external links to it and also enabled history routing mode. Getting the same error. I'll add my coverpage and index.html file here. Thanks in advance! Getting this error "Uncaught DOMException: Failed to execute 'pushState' on 'History': A history state object with URL 'https://tfs.insidenci.com/Energy-=contents' cannot be created in a document with origin 'http://127.0.0.1:5500' and URL 'http://127.0.0.1:5500/docs-home'."Index page
Coverpage Data Tools Landing Page
Welcome to the Data Tools Landing Page for Advanced Solutions. Here you will find access to and documentation for (almost) all the data management, analytics, modeling and visualization tools supported by Advanced Solutions.
Please reach out on Teams if you have any questions or concerns.
|
@BeamerIsHere thx for ur report! |
Bug Report
Steps to reproduce
Set the options firstly:
Then write a link whose url is from another domain:
What is current behaviour
If our domain were
docsify.now.sh
, it would do nothing and pop an error on the debug console:The corresponding source code is here.
What is the expected behaviour
Redirect to
https://example.com/
normally.Other relevant information
Bug does still occur when all/other plugins are disabled?
Your OS:
Linux ZZZ-PC-4 5.4.0-4-amd64 #1 SMP Debian 5.4.19-1 (2020-02-13) x86_64 GNU/Linux
Node.js version:
v12.14.0
npm/yarn version:
6.13.4
Browser version:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36
Docsify version:
4.10.2
Docsify plugins:
None
The text was updated successfully, but these errors were encountered: