Last active
February 27, 2019 05:09
-
-
Save mjohnsey/424ab1c1acead5df08085723ef3629aa to your computer and use it in GitHub Desktop.
UserScripts
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 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