Skip to content

Instantly share code, notes, and snippets.

@alexeyr
Forked from micbase/feedly.user.js
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexeyr/3fe7b7f91ec8c0cc8947 to your computer and use it in GitHub Desktop.
Save alexeyr/3fe7b7f91ec8c0cc8947 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Feedly Tweak - Open feed item in background by pressing 'v'
// @namespace http://micbase.com/feedly-tweak-open-item-background-tab-firefox
// @description Feedly Tweak - Open feed item in background by pressing 'v'
// @include http*://*feedly.com/*
// @grant GM_openInTab
// ==/UserScript==
var x;
var link;
document.addEventListener('keypress', function(event) {
//if user press 'v' key, then open links in new tab in background
if (event.which == 118) {
x = document.getElementsByClassName('selectedEntry');
//if no feed item selected, exit
if (x == null){
return;
}
link = x[0].getAttribute('data-alternate-link');
link = link.replace('?utm_source=feedly', '');
event.stopPropagation();
event.preventDefault();
GM_openInTab(link);
}
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment