Last active
December 14, 2015 22:39
-
-
Save june29/5159979 to your computer and use it in GitHub Desktop.
LDR customizer just for june29
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== | |
// @id ldr29 | |
// @name ldr29 | |
// @version 1.0 | |
// @namespace http://june29.jp/ | |
// @author june29 | |
// @description LDR customizer just for june29 | |
// @include http://reader.livedoor.com/reader* | |
// @run-at document-end | |
// ==/UserScript== | |
window.addEventListener("load", function() { | |
with (unsafeWindow) { | |
Keybind.add("j", Control.go_next); | |
Keybind.add("k", Control.go_prev); | |
Keybind.add("p", function() { | |
Control.pin(); | |
Control.go_next(); | |
}) | |
Keybind.add("o", function() { | |
var item = get_active_item(true); | |
if (!item) { | |
var pins = unsafeWindow.pin.pins; | |
for (var i = 0; i < pins.length; i++) { | |
var pin = pins[i]; | |
setTimeout(function(url) { | |
GM_openInTab(url, true); | |
}, 0, pin.url); | |
} | |
unsafeWindow.pin.clear(); | |
return; | |
} | |
setTimeout(function() { | |
GM_openInTab(item.link, true); | |
}, 0); | |
Control.go_next(); | |
}) | |
Keybind.remove("b"); | |
Keybind.remove("i"); | |
} | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment