timche / gmail-desktop

:postbox: Nifty Gmail desktop app for macOS, Linux & Windows
MIT License
832 stars 91 forks source link

allow back & forward navigation shortcuts on macos #387

Closed MattKetmo closed 5 months ago

MattKetmo commented 1 year ago

Hello,

As mentioned in this comment, I noticed that there is no shortcut working for back/forward navigation on macOS.

Therefore, I have created this PR to enable the ⌘← / ⌘→ shortcuts exclusively for macOS.

This approach is based on a solution found here. I have tested it locally, and it works quite well.

However, there is one drawback: when editing a textarea (such as when writing an email), pressing ⌘← should not navigate to the previous page. Although it is still better than having no shortcut at all, it does not exactly match the behavior of a browser. One possible alternative would be to inject JavaScript directly into the mainWindow to detect whether it is in editing mode or not.