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 on the website doesn't work as expected #1393

Closed
maple3142 opened this issue Aug 16, 2019 · 17 comments · Fixed by #1394
Closed

External links on the website doesn't work as expected #1393

maple3142 opened this issue Aug 16, 2019 · 17 comments · Fixed by #1394

Comments

@maple3142
Copy link
Contributor

maple3142 commented Aug 16, 2019

Issue Checklist

When I try to middle click any external link on the website, it won't open in newtab like regular link, which is really bad for UX.
What's more, it opens a window instead of newtab when I left click on it.
Video: https://streamable.com/w5lwa

@1v9
Copy link
Member

1v9 commented Aug 16, 2019

Why do I have a wheel present instead of opening a new window after middle clicking any external link?

@1v9
Copy link
Member

1v9 commented Aug 16, 2019

Left click is normal, open a new tab.

@liolok
Copy link
Member

liolok commented Aug 16, 2019

Shouldn't that link be opened in a new window? It's an authorization page after all. I guess it's expected behavior. :3

Never mind, it's only because maple's example is too special. @1v9 and I just tested other links in the site. It's an issue about something like window.open.

@maple3142
Copy link
Contributor Author

maple3142 commented Aug 16, 2019

@liolok IMO, I don't think it is good to override the normal behavior of links, because it will break a lot of things such as middle click to open in new tab.

Besides, I think it is the third parameter of window.open cause this.

window.open(location.href, '_blank') // open new tab normally
window.open(location.href, '_blank', 'noopener') // open a new window

@stevenjoezhang
Copy link
Contributor

stevenjoezhang commented Aug 16, 2019

@maple3142
Copy link
Contributor Author

@stevenjoezhang What do you mean in this link? I am not using Edge.

@maple3142
Copy link
Contributor Author

maple3142 commented Aug 17, 2019

But I am using CentBrowser, which is based on Chromium.
Besides, it is annoying that I can't use middle click to open link in new tab.

@1v9
Copy link
Member

1v9 commented Aug 17, 2019

@maple3142 It's CentBrowser's fault, even Edge Chromium is normal as Chrome.

@maple3142
Copy link
Contributor Author

maple3142 commented Aug 17, 2019

@1v9 I know that window.open only not working correctly in CentBrowser, but middle click to open in new tab (and all the other normal anchor link behavior and gesture) works nowhere(Chrome, Firefox...)

@1v9
Copy link
Member

1v9 commented Aug 17, 2019

@maple3142 In fact, we didn't meet this issue. Middle click ------> a wheel, Firefox & Chrome is same. There's not a new tab or window open.

@1v9
Copy link
Member

1v9 commented Aug 17, 2019

Maybe try another computer(

@maple3142
Copy link
Contributor Author

maple3142 commented Aug 17, 2019

@1v9 You can middle click on any normal <a> link on a fresh installed Chrome or Firefox and see what happens.
Chrome: https://streamable.com/mvpnc
Firefox: https://streamable.com/hl662

Streamable
Check out this video on Streamable using your phone, tablet or desktop.
Streamable
Check out this video on Streamable using your phone, tablet or desktop.

@1v9
Copy link
Member

1v9 commented Aug 17, 2019

@maple3142 Are you in our tele group? My english is bad(

@maple3142
Copy link
Contributor Author

What's about making exturl to be a simple <a> like this:
<a href="..." rel="noopener">...</a>

@ivan-nginx
Copy link
Member

ivan-nginx commented Aug 17, 2019

I don't think what we can change <span> to <a> to external links because SEO issues.
I think we can just add middle click action via JS in exturl script?
https://stackoverflow.com/questions/1795734/triggering-onclick-event-using-middle-click

About new window → it's CentBrowser bug, on all other browsers new tab opened always.

@stevenjoezhang stevenjoezhang transferred this issue from theme-next/theme-next.org Mar 1, 2020
@stevenjoezhang stevenjoezhang reopened this Mar 1, 2020
@stevenjoezhang stevenjoezhang reopened this Mar 1, 2020
@stevenjoezhang stevenjoezhang added Bug and removed Invalid labels Mar 1, 2020
@theme-next theme-next deleted a comment from close-issue-app bot Mar 1, 2020
@theme-next theme-next deleted a comment from close-issue-app bot Mar 1, 2020
@stevenjoezhang
Copy link
Contributor

Related Issues:
#589
iissnan/hexo-theme-next#1438

@stevenjoezhang
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants