Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name E621 Swimmer
- // @description Navigate e621's pools with arrow keys
- // @include http*://e621.net/posts/*
- // @grant none
- // ==/UserScript==
- window.onload = function () {
- if (document.getElementsByClassName('pool-category-series')[0]) {
- let poolNavList = Array.prototype.slice.call(document.getElementsByClassName('pool-category-series')[0].childNodes);
- var prev = poolNavList.find(c => c.className === 'prev');
- var next = poolNavList.find(c => c.className === 'next');
- console.log(next.href);
- document.addEventListener('keydown', function (e) {
- if (e.keyCode === 37 && prev.href && e.ctrlKey) {
- window.location = prev.href;
- }
- else if (e.keyCode === 39 && next.href && e.ctrlKey) {
- window.location = next.href;
- }
- }, false);
- }
- }()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement