Is there a way to get OSX-style keyboard shortcuts in google docs on Linux?

To be explicit, what I actually want are Emacs-style shortcuts (e.g. Ctrl+f moves the cursor forward a character or Alt+b moves it backward a word, or Ctrl+e moves to the end of a word, and hopefully Alt+e the end of a sentence.)

Google docs provide these keyboard shortcuts for MacOS (because they are system defaults) but when you appear to have a Linux computer they give you Windows-style shortcuts. My system has the gtk key-theme set to Emacs (but I don’t think chrome has a way to pass this information on to web apps) so using Windows-style shortcuts is wrong.

I’m not aware of a setting for this in google docs, so I think I need to do something like:

  1. spoof my user agent to look like MacOS
  2. possibly something else
  3. ideally convert some bindings like ^⌥B (= C-M-b; moves cursor backwards one word in MacOS) into M-b, which is the key in emacs.

I tried with limited success to spoof my user agent but I don’t think I had reliable results (I don’t quite recall what failed, but I think partly I don’t have a good way to enter ⌘ Command.) Hence the “possibly something else” line above.

I would like to use this at my work which limits the range of possible solutions:

  • no gdocs add ons
  • likely no big or weird chrome extensions
  • however I do have the ability to inject javascript into random pages.