pmalecka / shortkeys

A Firefox extension for custom keyboard shortcuts
https://addons.mozilla.org/en-US/firefox/addon/shortkeys
MIT License
11 stars 4 forks source link

Possible to use API? #11

Open Gotolei opened 7 years ago

Gotolei commented 7 years ago

I'm trying to use this to control the functions of a different webextension, Tree Style Tab, specifically the tab-moving scripts in the second link:

https://github.com/piroor/treestyletab/wiki/API-for-other-addons https://github.com/piroor/treestyletab/wiki/Code-snippets-for-custom-keyboard-shortcuts

Is this sort of thing possible to do currently, or might it be possible in the future?

sumyungguy commented 6 years ago

I'd like to do the same thing. But if I try to simply open a tab for example, even without using the TST api:

browser.tabs.create({
    url:"https://example.org"
  });

I get "ReferenceError: browser is not defined" in the web console.

There's a similar (unanswered) issue for the Chrome version, https://github.com/mikecrittenden/chrome-shortkeys/issues/64#issue-264312345

PS @Gotolei the scripts in the second link are only for the legacy version of Tree Style Tab. They wouldn't work with the new Web Extensions version. New scripts would have to be made using the new API in the first link.

TKHuang commented 6 years ago

I have a similar question. I want to switch my tab by "Run Javascript", not by "Next tab" action. keyconfig extension provides gBrowser.mTabContainer API can be used. Is there any API can do this?