brookhong / Surfingkeys

Map your keys for web surfing, expand your browser with javascript and keyboard.
https://chrome.google.com/webstore/detail/surfingkeys/gfbliohnnapiefjpjlpjnehglfpaknnc
MIT License
5.23k stars 474 forks source link

Let's make a new standard and beat Vimium. #981

Open george43g opened 5 years ago

george43g commented 5 years ago

I switched from vimium because it became clear to me that despite being less popular, surfingKeys is the most comprehensive keyboard browsing extension. As a power user, it's invaluable.

Some websites have built their own keyboard shortcut systems.

You press ? on github or facebook or gmail and the help screen comes up.

There are three possible scenarios:

  1. The site has no shortcuts, so surfingKeys provides shortcut functionality. This is the main focus of these plugins, but as you will see that this isn't the most useful or common scenario.

  2. Sites that have shortcuts, however, they aren't comprehensive enough to actually use the site without a mouse. You would need a combination of the site's own shortcuts and surfingkeys bindings to fully use the site without a mouse.

  3. The last scenario is when the site is fully keyboard shortcut compatible. In which case, surfingkeys interferes with those key mappings and needs to be manually disabled.

SOLUTION

So here's my idea of how we can make this super useful. We need to create a markup standard in HTML that takes care of scenario 2 and 3.

We need to have a <meta> tag that automatically disables all shortcut browsing plugins. The plugins check for this tag and disable if they find it. It should be up to the web designers to decide how this works since if it is their responsibility they'll ensure a better user experience.

This is the most basic thing that is easy to implement now.

Until this happens, surfingkeys really should have a feature to easily add sites to a blacklist that surfingkeys does not activate on. This should happen in the extension GUI when clicked. Like vimium does.

To solve problem number 2, we need something more comprehensive - an actual markup language. KSML (Keyboard Shortcut Markup Language) - this defines keyboard shortcuts in a standardised way and is in the <head> of the website. The site creators define each key mapping with a standardised list of functions/motions, and can also provide a description of each function. This is read by any and all shortcut managers.

So the app, based on user preference, will use logic to do the following. The user can separate the site's shortcuts with their own. So the software will remap all the site's shortcuts to work the same, except you press the fn key or a prefix combo to activate them. Another possibility is that the plugin will simply merge the shortcuts if there aren't any keymap conflicts. There may be a small number of conflicts, in which case some kind of automated conflict resolution can be implemented.

One of the benefits of this is a consistent help panel. You should be able to go on any site and press ? and it will show you an updated list of all the shortcuts on that site, so both the site's devs shortcuts and surfingkeys shortcuts. You should be able to set and save custom shortcut preferences for each site you visit.

One of the things site owners may do is provide backup or alternative key mappings for all of the site's functions, in case their existing mapped keys conflict with the site's setup.

I hope this all makes sense, and I hope this is an original idea that can be implemented without too much trouble - but we need the cooperation and support of the big extensions (this, vimium, cvim, all of them) and some of the biggest sites on the net.

I could maybe contribute code. What do you guys think?

dufferzafar commented 4 years ago

I wonder how people deal with this problem today. So for eg, on some sites like GMail and Google Calendar, I want to allow some keys to pass through directly. Like the n key on Calendar takes me to next week / month etc.

Currently, I press alt+s to disable surfingkeys, press n to do my thing, and then press alt+s again when I need SK again.

Related: #980, #964

dufferzafar commented 4 years ago

Well, Turns out, p is the key to pass through a single key.

clarkwang commented 4 years ago

For such sites, I call unmapAllExcept() first and then explicitly enable more mappings I need.

Abdullah16M commented 2 months ago

surfingkeys is better in someways and worse in others, for example hinting, frame hinting and scrolling is better in vimium, i encountered many problems in youtube, reddit related to frames with surfingkeys selecting the wrong frame (mostly images or videos) to scroll instead of the main frame (also seen in tridactly).

george43g commented 2 months ago

With a little more experience in coding and web standards, now 4 years on - I like this idea. I can sharpen it a little in that I understand that this extension is easily customised with custom JS - many site areas already have an aria markup for accessibility. This existing framework can be utilised and extended to implement a solution. ie - <nav role="navigation"> - a keybinding could identify the menu/navigation on any app or site and provide a simple way to keyboard navigate the site nav (maybe a letter hint shown only for the nav ul li items in the menu). The markup could just be an attribute on html elements - <div aria-keyboard-shortcut='{shortcut markup}'>...</div>