Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to consider: Add keyboard shortcut. #21

Open
raffaeleflorio opened this issue Feb 13, 2018 · 5 comments
Open

to consider: Add keyboard shortcut. #21

raffaeleflorio opened this issue Feb 13, 2018 · 5 comments

Comments

@raffaeleflorio
Copy link
Owner

raffaeleflorio commented Feb 13, 2018

As suggested in #18 is useful to have the possibility to define custom shortcuts. For example one for dispVM and one for open-here. Obviously it is intended for redirect to less trusted VMs.

@raffaeleflorio raffaeleflorio self-assigned this Feb 13, 2018
@raffaeleflorio raffaeleflorio added this to the v2.2 milestone Feb 13, 2018
@raffaeleflorio raffaeleflorio changed the title Add keyboard shortcut. to consider: Add keyboard shortcut. Oct 13, 2018
@raffaeleflorio
Copy link
Owner Author

Because Javascript could simulate keypress and click, this feature will be analyzed really careful.

@rugk
Copy link

rugk commented Oct 13, 2018

Because Javascript could simulate keypress and click,

I doubt though web pages could trigger an add-on shortcut, that would be a major problem of the browser. Also WebExtensions should be separated against each other, too.

What you may need is https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands, but it can only define static shortcuts. Adjusting them could be harder… (I also got back to static ones for now: rugk/offline-qr-code#54)
Maybe a lib for that could prove to be useful as it may be a thing many add-ons need to do.

@raffaeleflorio
Copy link
Owner Author

I doubt though web pages could trigger an add-on shortcut, that would be a major problem of the browser. Also WebExtensions should be separated against each other, too.

I tried, in a naif way, to trigger the extension command with Javascript, however the browser doesn't forward the event to the add-on... This is good. Nonetheless I'd like to find some official resource, or I'd like to try some other way..

What you may need is https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands, but it can only define static shortcuts. Adjusting them could be harder… (I also got back to static ones for now: rugk/offline-qr-code#54)

Thanks for the link, but these shortcuts needs to be associated with the click on an link. Probably adjusting isn't feasible.

Maybe a lib for that could prove to be useful as it may be a thing many add-ons need to do.

I think that only an official API could be really useful: for example with dialog to allow overriding of key combinations and so on..
However some hacky solution could be written, but I think that a lot of issue will arise..

@rugk
Copy link

rugk commented Oct 15, 2018

but these shortcuts needs to be associated with the click on an link

Well… you can just then trigger a JS injection and then check whether a link is selected or so.

In any case I would always prefer specifying that in the JSON or so (via WebExtension commands). As you said, otherwise it may be hard to prevent websites from triggering that.

A needed lib would be just for having an UI to adjust the setting and the shortcut (i.e. this here). I.e. only the settings part.
Obviously you have to use the commands API.

@raffaeleflorio
Copy link
Owner Author

Well… you can just then trigger a JS injection and then check whether a link is selected or so.

In any case I would always prefer specifying that in the JSON or so (via WebExtension commands). As you said, otherwise it may be hard to prevent websites from triggering that.

Exactly, but for this reason I excluded this approach.

A needed lib would be just for having an UI to adjust the setting and the shortcut (i.e. this here). I.e. only the settings part.
Obviously you have to use the commands API.

Now I understand what you meant. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants