10

Vlad Create a list of integral shortcuts, then have another preference named "Block website keyboard shortcuts." Most important would be to make the shortcuts transparent, because currently even though Netflix does not define command+M, the key itself does not allow to minimize the video while netflix is showing, and only mutes the video on netflix.
So Cmd+Q, W, R, T, Y, U, O, P, A, S, D, F, H, L, Z, X, C, V, N, M are all integral shortcuts. Basically everything with command. Perhaps certain "leniencies" can be created for such, and only Q, W, R, T, N, L and M are cnosidered integral shortcuts.

    Vlad I did some testing and found that the issue is related to the preventDefault method of events. In this case, the website does this (minimal example):

    window.addEventListener('keydown', (e) => {e.preventDefault()})

    Different browsers allow this to prevent a different selection of the browser's keyboard shortcuts. Testing on Ungoogled Chromium, FF, Safari, and Orion, on a test page I made which runs the above function on load:

    Cmd + Opt + I: works on none
    Cmd + W: works on all EXCEPT Orion
    Cmd + R: works on Safari ONLY
    Cmd + T: works on all
    Cmd + Shift + T: works on Chromium ONLY

    So basically, this is a big mess. I suppose the best thing to do is follow Safari's lead. I am not quite in the mood right now to do this testing for all possible shortcuts...

    Fortrikka I think your list of Q, W, R, T, N, L (address bar) and M are a good starting point, just make sure those are never overridden.

      Cannabat Also perhaps there should be an option to allow websites to have access to have unfettered access to shortcuts.

        Arguably, command+D is not an essential shortcut. It is used by certain sites such as google meet.

          Cannabat Thank you for a very strong comment, as usual.

          Can you make a solid/specific recommendation what should Orion do exactly (listing shotrcuts)?

            Vlad Command+shift+/ should also be a critical shortcut.

              Also shortcuts should be transparent. That is, if no website uses them, then the browser and subsequently operating system shortcuts will be priotized. This is currently not the case, with control+\ being used by the system of mine and not working when I set it here.

              But it works when I set it here:

              Both of these shortcuts work in Safari, so Orion has a shortcut mishandling based on where it comes from. Despite not being a defined shortcut in Safari, it is still intercepted in Orion. control+F3 and other shortcuts are not.

                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.