11

I'm confused...

Steps to reproduce:

  • Go to http://louphole.com/divers/magical-poems/
  • Observe that Cmd + W, Cmd + R, Cmd + Q, Cmd + L, Cmd + Opt + I (and probably others) do not work
  • Click in the Address bar or manually open Web Inspector via Menu
  • Observe that the keyboard shortcuts now work

Also happens in compatibility mode. Does not happen on Safari.

Expected behavior:

  • Keyboard shortcuts always work

Orion, OS version; hardware type:
Orion 0.99.109.1.3-beta (WebKit 613.1.12)
macOS Version 12.1 (Build 21C52)
MacBookPro18,3

Session Info:

Enabled Extensions:

  • Request Control (firefox)
  • SponsorBlock for YouTube - Skip Sponsorships (firefox)
  • Dark Reader (firefox)
  • Bitwarden - Free Password Manager (firefox)
  • Reddit Enhancement Suite (firefox)

Disabled Extensions:

Non Default Settings:

  • AlwaysShowToolbarInFullScreen => 0
  • AutofillEnabled => 0
  • PreferredBookmarkFolderId => 14
  • HistorySuggestionsEnabled => 1
  • ContentBlockerLastUpdated => 2021-12-21 00:00:00 +0000
  • CustomAppIcon => appicon3
  • CustomAppIconData => {length = 2231096, bytes = 0x89504e47 0d0a1a0a 0000000d 49484452 ... 49454e44 ae426082 }
  • isBackgroundImageDarkOnStartPage => 0
  • DownloadLocation => /Users/spencer/Downloads
  • AskForEachDownload => 1
  • FirstLaunch => 0
  • FirstTimeWebExtensionNotice => 1
  • FocusMode => 0
  • HyperlinkAuditingEnabled => 0
  • ShowErrorIndicator => 0
  • ReaderModeBorderShadowEnabled => 0
  • LastUsedBuildVersion => 109.1.3
  • PreCompiledContentRuleListVersion => 109.1.3
  • LastCrashCheckDate => 2022-01-01 05:58:09 +0000
  • NetworkPredictionEnabled => 0
  • NextBookmarkID => 18
  • NextDownloadID => 122
  • SavedWindowSize => 1512.0,944.0
  • SavedWindowPosition => 1.0,0.0
  • SearchSuggestEnabled => 1
  • ShowPrivacyButtonNotifications => 1
  • BookmarksSidebarVisible => 0
  • BookmarksSidebarVisibleOnStartPageOnly => 0
  • BookmarksSidebarWidth => 240
  • QuitWithConfirmation => 0
  • CurrentToolbarSize => small
  • VerticalTabsWidth => 96
  • ActiveLibraryTab => extensions
  • ActivePreferenceTab => websites
  • CyclesThroughRecentTabs => 0
  • UndoTabClose => 0

    Basically it seems that we would need a certains et of shortcuts that can not be intercepted by the site?

    How do we come up with such a list?

      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.