bookieio / Bookie

Python based delicious.com replacement
GNU Affero General Public License v3.0
633 stars 139 forks source link

add keyboard shortcut to the chrome extension #89

Open mitechie opened 13 years ago

mitechie commented 13 years ago

In order to add it, you have to inject a script to each page that watches for the keyboard shortcut. See http://code.google.com/chrome/extensions/samples.html#65b2fe595b7ac38dddd89cca50f5efd0017b0bd4

for an example of injecting the js into the current page as a content script and then triggering a command

greggrossmeier commented 13 years ago

ctrl+d is the Chromium shortcut to add a browser bookmark, so I suggest ctrl+alt+d for bookie. It is what I used for Diigo on Fx.

mitechie commented 13 years ago

The new tab is a url that'll never be bookmarked. chrome-extension...

In order to show the + in the icon if we've bookmarked the current url we're peeking at, we'll need to pass a is_bookmarked flag and then trigger the plugin icon manually.

To do this, we might also need to pass the extension id to the popup.html for it to do the set.

mitechie commented 11 years ago

Chome's added a bunch of keyboard related features we should be able to tap into now to trigger and use the extension.

suryatech commented 10 years ago

@mitechie is right. Point your browser to chrome://extensions and select Keyboard Shortcuts to customize the keyboard shortcut.

You don't need additional code to implement this feature.

Also, the current extension opens a new tab when the key combination is pressed. When the save button is pushed, the bookmark actually is saved to the server that is configured to use.

mitechie commented 10 years ago

Thanks for the update. We should add some docs then to help users find out about setting the keyboard shortcut. We currently support ctrl-shift-d I believe. Allowing users to override ctrl-d for it would be awesome. Maybe in the options page we can provide that hint or something.

suryatech commented 10 years ago

One way is to open the settings page of Chrome and set whatever shortcut you want to.

Ctrl + D would be overridden using the above method. If we try and do the same in the extension, i guess it fires the default Chrome action too.

Ctrl + Alt + D is currently implemented.

Options page is a good place to let the users know about it.