Does anyone know how TreeStyleTabs handles keyboard shortcut
6 posts
• Page 1 of 1
I am trying to create alternate keyboard shortcuts for TST by calling the messages it uses to handle said shortcuts, but I am not familiar with the code and don't know where to look.
I know it is the kind of thing that is easy when you what to look for and where, but addon APIs are not my forte. Truth be told I should learn to locate where and how all addons handle keyboard shortcuts as TST will not be the only one. You can set the keyboard shortcuts in the options.
i.e. about:addons > Extensions > Tree Style Tab > Options > Keyboard shortcuts Tree Style Tab http://addons.mozilla.org/firefox/addon/5890 Are you asking about the WebExtensions API or are you asking about some type of AutoConfig or userChrome.js hack to programmatically set the keyboard shortcuts? WebExtensions API manifest.json commands http://developer.mozilla.org/docs/Mozil ... n/commands Piro uses the ShortcutCustomizeUI.js file to customize the keyboard shortcuts. Generates configuration UI for keyboard shortcuts http://github.com/piroor/webextensions-lib-shortcut-customize-ui P.S. Addons are explicitly blocked from operating on another addon's moz-extension page. How can I execute a userscript on a moz-extension page? http://stackoverflow.com/questions/52131490 You can't execute a userscript on the about:addons page. You can't hack the addon since it's signed.
I asked him about how to call its functions from the SurfingKeys addon, and he gave me some pointers about it - it doesn't need registration and the link to the API Messages Index From what I have learnt addons register some messages and their keyboard shortcuts to the addon system, probably in manifest.json, and the keyboard shortcuts UI, whether his own or the browsers Manage Extension Shortcuts page, will bind those defined or changed by the user to those events/messages. What I am looking for are: 1. The files where those messages, events and their default shortcuts are registered to the addon system 2. The place where Firefox handles the keyboard shortcut events 3. The files provided by the addon developer where the messages/events are processed. When you look at the keyboard shortcuts of TreeStyleTab in the Preferences page you see that many of the operations don't have default shortcuts, so there must be: 4. A file where TST reads the additional shortcuts defined by the user, and registers them and their related messages to Firefox. This is the file or files I am looking for. TST is more complicated than other addons, but other addons must have similar features. I got these keys working with Surfingkeys.
API for other addons http://github.com/piroor/treestyletab/wiki/API-for-other-addons Surfingkeys http://addons.mozilla.org/firefox/addon/886233 Sorry, I don't think I can help.
Thanks, I was able to make some progress with your example. Is there a way of testing in the customizations to know if the mapkey functions work background or content scripts? I tried many of the functions from SurfingKeys and they don't seem to work.
If the code is executed as a background script, then location.href property is (1) in the browser console, like when using the about:debugging page. If the code is executed as a content script, then location.href property is (2) in the browser console. 1. moz-extension://{UUID}/_generated_background_page.html 2. http://www.mozillazine.org/ Test page http://www.mozillazine.org/
The addon doesn't allow code using the browser.tabs API. Surfingkeys default mappings http://github.com/brookhong/Surfingkeys/blob/master/pages/default.js Surfingkeys example mappings http://gist.github.com/search?q=Surfingkeys+mapkey http://gist.github.com/minhoolee/ed69ba53ff660fb27a618494d1287ef1 tabOpenLink function is defined in utils.js http://github.com/brookhong/Surfingkeys/blob/master/content_scripts/utils.js Clipboard module is defined in content_scripts.js http://github.com/brookhong/Surfingkeys/blob/master/content_scripts/content_scripts.js
6 posts
• Page 1 of 1
Return to Extension Development Who is onlineUsers browsing this forum: No registered users and 0 guests |
![]() |