Add ability to specify keyboard shortcut to folder actions plugins #3732
Replies: 4 comments
|
Ah yes. I was thinking the other day that it'd be nice to have plugins be able to register their own shortcuts. |
|
It would be very useful indeed! For something like folder actions it'll probably mean a bit more logic to determine on which of all folders to apply the action. I guess the easiest way probably is based on where the focus is, if it's on a folder itself then the choice is obvious, if it's on a request the it'll probably run it for the folder that request is in. The question is, what if the focus is on a request that's not part of a folder? I guess it'll just do nothing? |
|
Hmm, ya I didn't think about that. Very good point. I think it could just do nothing if the active request isn't in a folder |
|
I was looking into writing my own (first) insomnia plugin and ran into this. I want to add a keyboard shortcut action to comment/uncomment a line(s) in the post body. Any chance this is in the works? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Details
The folder actions plugin is very useful, but it would be even more awesome if a keyboard shortcut could be specified in the plugin code, something like:
module.exports.requestGroupActions = [ { label: 'Send Requests', + shortcut: 'cmd+alt+r', action: async (context, data) => { const { requests } = data; let results = []; for (const request of requests) { const response = await context.network.sendRequest(request); results.push(`<li>${request.name}: ${response.statusCode}</li>`); } const html = `<ul>${results.join('\n')}</ul>`; context.app.showGenericModalDialog('Results', { html }); }, }, ];All reactions