Skip to content

Instantly share code, notes, and snippets.

@mjohnsey
Last active February 27, 2019 05:09
Show Gist options
  • Save mjohnsey/424ab1c1acead5df08085723ef3629aa to your computer and use it in GitHub Desktop.
Save mjohnsey/424ab1c1acead5df08085723ef3629aa to your computer and use it in GitHub Desktop.
UserScripts
// ==UserScript==
// @name Feedly Tweak - Open feed item in background by pressing ';'
// @description Feedly Tweak - Open feed item in background by pressing ';'
// @include http*://feedly.com/*
// @grant GM_openInTab
// ==/UserScript==
var x;
var link;
// https://unixpapa.com/js/testkey.html
const key = 59;
document.addEventListener('keypress', function(event) {
//if user press ';' key, then open links in new tab in background
if (event.which == key) {
x = document.getElementsByClassName('entry selected');
//if no feed item selected, exit
if (x == null){
return;
}
link = x[0].getAttribute('data-alternate-link');
event.stopPropagation();
event.preventDefault();
GM_openInTab(link, {active: false});
}
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment