JannesMeyer / TabAttack

Advanced Tab management
GNU Affero General Public License v3.0
190 stars 12 forks source link

How to trigger option to only export the current window #8

Open sknebel opened 9 years ago

sknebel commented 9 years ago

As the title says, I think it would be useful to be able to optionally export only the tabs in the current window. The code for this is easy enough, but I'm searching for a way to activate it. Sadly it seems chrome extensions can't neither add entries to the right-click menu of their icon nor react to key-click combinations on it (I was thinking CTRL-iconClick to trigger it).

Options I see:

Comments? Further ideas? Preferences?

JannesMeyer commented 9 years ago

I would suggest to just edit the file in the editor before saving it. You can use code folding to quickly get the first window out of the way and then delete the rest. There should be keyboard shortcuts for the code folding, too. Unfortunately they don't seem to work for me right now, but you can try your luck here: https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts

It would be nice to have a key combination to do this directly (i.e. option 1), though. But I prefer not to add any extra UI elements for something that is already quite elegantly covered by the UI, so I don't like option 2 and 3 that much.

Update: Actually the shortcuts do work, I was just pressing the wrong keys :-) Try Command+Option+0 on OSX or Alt+0 on Windows to fold all windows (except the one in which the cursor is located).

sknebel commented 9 years ago

Ok, the shortcuts make the editing real quick, thanks for the tip!

I agree on the UI, I really don't like the idea of a popup menu and having a menu option to edit the current selection also seems iffy. Really disappointed that the Chrome API is so inflexible in this regard. I'll use manual editing for a while and might implement a dedicated shortcut later if I feel the need for it.

JannesMeyer commented 9 years ago

I just found out that in canary it's already possible to add items to the browserAction's context menu, so in a few weeks we should be able to do this:

untitled-1

sknebel commented 9 years ago

Cool. Prompted by this I searched again, and found these links that seem to indicate it should be already possible? (38+, I somehow must have missed them the first time round). Could you test it on a current non-canary version (or share your code somewhere so I can do so)? (No hurry, I really should spend my time on other things anyways right now)

https://stackoverflow.com/questions/25784901/can-you-rename-the-option-label-chrome-extension/25785574#25785574

https://code.google.com/p/chromium/issues/detail?id=234425

JannesMeyer commented 9 years ago

Unfortunately there was a bug (which was fixed only about three weeks ago) that prevented this from working in the Mac version of Chrome. The fix hasn't arrived in stable yet.

https://code.google.com/p/chromium/issues/detail?id=420768