violentmonkey icon indicating copy to clipboard operation
violentmonkey copied to clipboard

Feature request: Include existing `./codemirror/keymap/*.js` files so we can specify vim/emacs/sublime keymaps in the editor config JSON

Open mattalxndr opened this issue 4 years ago • 4 comments
trafficstars

The code is already there in the library, and then the configuration JSON could contain:

{
    [...]
    "keymap": "vim"
}

I would write a user script to handle it but I'm not allowed, apparently. :-)

mattalxndr avatar Nov 07 '21 03:11 mattalxndr

Personally, I'm against this because a) it adds 100kB of minified code, which will be used only by a few users, and b) Violentmonkey's general stance on editing is that you should use an external editor and enable tracking: https://violentmonkey.github.io/posts/how-to-edit-scripts-with-your-favorite-editor/

However, I'll defer to @gera2ld, who likes VIM.

tophf avatar Nov 07 '21 07:11 tophf

I wouldn't want the extra load either. I'm not famililar with the code base, but is there a way to side load it or inject it from a CDN?

mattalxndr avatar Nov 07 '21 13:11 mattalxndr

Loading from network into the extension process is possible but it requires 1) relaxing content_security_policy, which the web store reviewers really don't like so the extension would go into the slow queue and 2) to prevent tampering of the script's contents that would allow a MitM proxy to inject arbitrary coed into the highly privileged extension context we would have to use hashes on the link and probably also include them into content_security_policy. Overall, it's too much of a PITA.

tophf avatar Nov 07 '21 13:11 tophf

Ok I'll just hack it in :-)

mattalxndr avatar Nov 07 '21 13:11 mattalxndr