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

Unable to command/ctrl click to open links in a new tab #5

Closed
ccampbell opened this issue Jul 1, 2020 · 7 comments
Closed

Unable to command/ctrl click to open links in a new tab #5

ccampbell opened this issue Jul 1, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@ccampbell
Copy link

ccampbell commented Jul 1, 2020

Hi there, Thanks so much for all the work you put into this, it is impressive. One issue that I noticed is that when this is installed command click on links no longer opens them in a new tab.

It seems that some links work, but some do not. I am not sure the exact behavior causing it, but probably a preventDefault() somewhere where it should not be if (e.metaKey || e.ctrlKey) is pressed

Ah ya the problematic part looks to be:

a.addEventListener("click", async function(e) {
e.stopPropagation();
e.preventDefault();
navigate(getAbsoluteURL(this.href));
});

Anchor links also don’t seem to work correctly

@Kir-Antipov
Copy link
Owner

Thanks so much for all the work you put into this, it is impressive

Really glad to here that :3

command click on links no longer opens them in a new tab

Whoops, didn't noticed that cause I'm using middle mouse button for these purposes (seems like its behavior can't be overridden).

Ah ya the problematic part looks to be [...]
if (e.metaKey || e.ctrlKey) [...]

Yeah, you're absolutely right. Will fix it in a minute

Anchor links also don’t seem to work correctly

Are you sure about that? 'Cause v1.2.0 fixed that

@Kir-Antipov Kir-Antipov self-assigned this Jul 1, 2020
@Kir-Antipov Kir-Antipov added the bug Something isn't working label Jul 1, 2020
Kir-Antipov added a commit that referenced this issue Jul 1, 2020
@Kir-Antipov
Copy link
Owner

Fixed in v1.3.0

Don't forget to force your userscript engine to update the script to get fix as fast as possible :)

@ccampbell
Copy link
Author

Thanks for the quick turnaround, just updated and it is fixed. The anchor links are still broken for me though.

To test go to your own repo page:
https://github.com/Kir-Antipov/GitHub-Defreshed

Then hover over one of the headers and click on the anchor

image

It refreshes the page inline and does not link to the anchor

@Kir-Antipov
Copy link
Owner

@ccampbell, oh... Yeah... I fixed only "#" links, not "#something"... What a shame...

Moved it into new issue. Third (or even fourth) update for one day is coming xD

@Kir-Antipov
Copy link
Owner

@ccampbell, v1.3.5 is onboard, everything should be fine now :)

@ccampbell
Copy link
Author

Awesome, just updated and looks good 👍 will open a new issue if I run into anything else. Thanks!

@Kir-Antipov
Copy link
Owner

You're welcome! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants