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

Restore Ctrl+Click behavior on Firefox #1406

Merged
merged 3 commits into from
Nov 15, 2022

Conversation

ianeli1
Copy link
Member

@ianeli1 ianeli1 commented Nov 14, 2022

Ctrl+Clicking an anchor with the Hyperlink plugin enabled no longer opens a new tab on Firefox. Restore behavior by removing the Firefox specific code found in Hyperlink plugin and calling window.open always.

image

Comment on lines 143 to 146
if (
!Browser.isFirefox &&
(href = this.tryGetHref(anchor)) &&
isCtrlOrMetaPressed(event.rawEvent) &&
event.rawEvent.button === 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this behavior changed overtime and Firefox is no longer opening the links by default, should we prevent the default behavior of the event if browser is Firefox in case a user with an older version and tries to open a link with Ctrl + Click?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, I don't think this would have any side effects so might as well preventDefault it just in case

@ianeli1 ianeli1 merged commit 9917817 into master Nov 15, 2022
@JiuqingSong JiuqingSong deleted the u/ianeli/firefox-ctrl-click-anchor branch September 8, 2023 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants