12

Vlad

Safari lists all shortcuts here: https://support.apple.com/en-au/guide/safari/cpsh003/mac (I don't know if this is up to date as it says Cmd+F is to open preferences which I couldn't make happen)

I reviewed all of them. Many are irrelevant because:

  • They are Safari-specific
  • They are a Keyboard+Click combo (that said maybe these are relevant, but never had an issue with a website hijacking this modifier key + click)
  • They are not use when a website is in focus, so a website couldn't hijack it

In the end, this is my list of keyboard shortcuts which a website should not be allowed to intercept:
Tab (Accessibility)
Option-Tab (Accessibility)
Cmd-C
Cmd-V
Ctrl-Tab / Shift-Cmd-]
Ctrl-Shift-Tab / Shift-Cmd-[
Cmd-W
Shift-Cmd-T (
Cmd-[
Cmd-]
Cmd-Plus / Cmd-Minus
Cmd-`
Shift-Cmd-T
Shift-Cmd-R
Esc (This is only while in Reader mode, may be irrelevant as I think Reader mode disables JS?)
Ctrl-Cmd-1

Most of these shortcuts reach outside the tab state to do something essential, so they should never be prevented.

As far as I can tell, it is only listeners which use e.preventDefault() that hijack the shortcuts - e.stopPropagation() and e.stopImmediatePropagation() do not cause the problem.

I made a Numbers spreadsheet of all the options and put a very few comments in before thinking it's not very useful. Here it is anyways in case the list itself is useful:

orion-keyboard-shortcut-handling.zip
182kB

    I'll add that consideration needs to be given to browser extensions, like the ones that make your browser work like vi/vim. I'm unsure of how they should be handled, and I don't think we can look to Safari yet (unless the extension store is growing, I haven't really looked).

      Cannabat

      In the end, this is my list of keyboard shortcuts which a website should not be allowed to intercept:

      Amazing, thank you we can use that list as a starting point and revise in the future.

      None of these shortcuts work on Orion, but they do on Safari. It seems the browser simply intercepts all function shortcuts, including the control+R shortcut because there aren't any native macOS or browser ceommands that use the shortcut command+R, but that shortcut does not work anyways when I define it to focus on the menu bar, but when I assign another shortcut to command+R in the system, it still works. It seems that Orion blocks shortcuts from accessing the menu bar for some reason.

      • eirk replied to this.
        a year later
        2 months later
        2 months later

        eirk But the issue remains.
        If you do a search in Reddit, the results page hijacks Cmd-Click, forcing the content to open in the current tab. I very much want to suppress that, but the Chrome extensions designed to do that don't work in Orion.

          Brief Summary
          Orion has site specific settings to enable, disable or protect Content Blockers, JavaScript, Cookies, zoom, etc.
          It also has one-time tools to enable Copy&Paste and edit.
          But it lacks any ability to prevent hijacking Cmd-Click (open in new tab) and other shortcuts.
          I'd like this added.
          Details:
          In Reddit (as a popular example), when you perform a search for topics in a sub, the links open in the current tab even if you cmd-click them. In (pre-2023) Chrome and in Firefox, I would have used TamperMonkey, but it's not solid in Orion, and I'm okay with that.

          A per-site setting for this, for Cmd-{Click|F|G} and maybe a few others would be great.
          Image/Video:

          • Vlad replied to this.

            TCat

            How would you call this setting, what shortucts would it protect and can you verify Safari's behavior with the same issue (if it prevents hijacking that is a good reason for us to priritize as well, maybe enable by default isntead of an option)

              Merged 2 posts from Option to protect keyboard shortcuts.

                Just noticed it is related to this discussion. Looks like there is no standard browser behavior and that the state of this is a total mess across browsers.

                So we'd need guidance from someone who has patience to think this through.

                  Steps to reproduce:

                  1. Go to a google doc document
                  2. Click Command P or print button.
                  3. The document will download as a pdf

                  Expected behavior:
                  Show the print menu

                  Orion, OS version; hardware type:
                  Version 0.99.124.3-beta : MacBook Pro 2017 (macOS Ventura 13.3.1 build 22E261)

                    Merged 1 post from ⌘P not working in google docs.
                      2 years later

                      BTW cmd-p isn't an issue with keyboard shortcuts. its just because google docs can't print directly on webkit. see #8630

                      also, this post is related to #8479

                        Some website intercept some keyboard shortcuts, for example command-F to active their own search field. When I type a macOS or Orion shortcut, I don't want the website to do something else!

                        Please add a preference to disable this (maybe a per site preference, but just a global pref is OK for me).

                          Merged 2 posts from Don't let websites intercept keyboard shortcuts.
                            No one is typing