Hi,

As describe in the title, I'm not able to open links from coffee in a new tab, like it did on D6.
In chrome and FF it does't work, on Edge, Coffee doesn't open...with ⌘ + click on macOs (?) and like CTRL + click on W10 or Linux.

Thanks

CommentFileSizeAuthor
#4 coffee-open-in-new-tab-3069537-4.patch760 bytesdas-peter

Comments

aiphes created an issue. See original summary.

belazoth’s picture

Hi,

I was also trying to figure out how to open the links in a new tab as well. So I looked at the code and in the coffee.js file I found that it is using "event.metaKey" to check for the keystroke to open the links in a new tab.

According to this documentation, that should mean that it is ⌘ + click on macOS and ⊞(Windows key) + click for people using WindowsOS will open the link in a new tab. The documentation also says that

as of Firefox 48, the ⊞ Windows key is not considered the "Meta" key. KeyboardEvent.metaKey is false when the ⊞ Windows is pressed.

so Firefox users on WindowsOS will not be able to use this feature at all.

If you are using WindowsOS and want to use CTRL + click. you can replace all uses of "event.metaKey" with "event.ctrlKey" and within the coffee.js file and you should then be able to use CTRL + click for opening links in new tab. Doing this will however probably stop ⌘ + click on macOS from working, I can't test if it does as I don't own a macOS device.

It would be nice if the module added in functionality for event.ctrlKey so that WindowsOS users can open links in a new tab without having the start menu(programme select area) open up each time they want to open a link in a new tab.

Unfortunately, I'm not good enough at programming to make a patch for the module that would allow this functionality but hopefully, someone that reads this is and can make a patch so it can be added to the module.

aiphes’s picture

Good to know. Thanks for this investigation. Hope the module maintener will do the change.

das-peter’s picture

Status: Active » Needs review
StatusFileSize
new760 bytes

Blunt, but how about reacting to metaKey & ctrlKey?

kyoder’s picture

+1 for reacting to both metaKey and ctrlKey

  • michaelmol committed ce666e6 on 8.x-1.x authored by das-peter
    Issue #3069537 by das-peter, aiphes, Azoth, kyoder: Open in new window...
michaelmol’s picture

Status: Needs review » Fixed

Thanks!

aiphes’s picture

After updating to 1.0, "open in new window" via ctl+click or right click doesn't work. Normal behaviour ?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.