Created
February 14, 2011 14:09
-
-
Save punytan/825918 to your computer and use it in GitHub Desktop.
Open feed item with InstaReader in background by pressing 'v'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google Reader with InstaReader | |
// @namespace http://linknode.net | |
// @description Open feed item with InstaReader in background by pressing 'v' | |
// @include http*://www.google.com/reader/view/* | |
// ==/UserScript== | |
document.addEventListener('keypress', function(event) { | |
if(event.which == 118) { // 118 is 'v' | |
if (document.getElementById('current-entry') == null) return; // no current entry | |
var link = document.getElementById('current-entry').getElementsByTagName('a').item(0).getAttribute('href'); | |
var url = 'http://www.instapaper.com/text?u=' + encodeURIComponent(link); | |
event.stopPropagation(); | |
event.preventDefault(); | |
GM_openInTab(url); | |
} | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment