gildas-lormeau / SingleFile

Web Extension for saving a faithful copy of a complete web page in a single HTML file
GNU Affero General Public License v3.0
14.29k stars 943 forks source link

Custom keyboard Accelerator abbreviations for all menu items #1420

Open eugenesvk opened 3 months ago

eugenesvk commented 3 months ago

Is your feature request related to a problem? Please describe. Currently it's a bit inefficient to pick a specific profile/option from the context menu since you have to look at it and select via a mouse

Describe the solution you'd like Allow custom accelerators so you could open and execute a profile via a sequence of , for example, CtrlA,G1 (activate extension, open a Group, select 1Profile just like you can right-click the extension button and press O to open options)

Currently the first shortcut doesn't open the extension menu, but launches a page saving operation instead, but that's another feature request https://github.com/gildas-lormeau/SingleFile/issues/1419

Describe alternatives you've considered (optional) Using cursor keys :)

Additional context (optional) N/a

gildas-lormeau commented 2 months ago

As discussed in entry #1419, there is no technical way of associating a menu entry with a shortcut. However, I need to see if it would be possible to associate one (or more) for each profile.

eugenesvk commented 2 months ago

Well, the mouse (and extension button) context menu subitems can have accelerators, just checked by editing

    "menuSaveWithProfile": {
        "message": "&U Save page with profile",
        "description": "Menu entry: 'Save with profile'"
    },

And this works

That's already progress as that makes the selection within the menu easier

But then

(and I can add &profile_name to even have accelerators working with dynamic profile selection menu!)

gildas-lormeau commented 2 months ago

Thank you very much for the info, I was not aware of this feature. I'll do some tests and keep you updated.

gildas-lormeau commented 2 months ago

I guess I'm missing something here, I tested your messages.json file. However, this does not seem to work as expected. On my machine (macOS/Apple Silicon), if I type for example & and d when the first item is selected in the SingleFile menu then it does not select the "Save selection" entry. I did the test in Firefox and Chrome.

eugenesvk commented 2 months ago

Yeah, macOS doesn't support the & convention by default (though interestingly enough, the & sign isn't shown, so there is some awareness? ).

I don't know how whether there is a workaround/alternative for this (and don't understand why browsers don't support this)