Greasy Fork

来自缓存

Greasy Fork is available in English.

Arrow Keys: Frameless Comic-Rocket

Arrow Key Keyboard shortcuts for (Frameless) Comic Rocket comics.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Arrow Keys: Frameless Comic-Rocket
// @namespace    http://greasyfork.icu/users/45933
// @version      0.1.3
// @author       Fizzfaldt
// @description  Arrow Key Keyboard shortcuts for (Frameless) Comic Rocket comics.
// @run-at       document-start
// @grant        none
// @noframes
// @note         Requires turning off frames at https://www.comic-rocket.com/settings/ui/

// @match        *://*.dumbingofage.com/*
// @match        *://*.egscomics.com/*
// @match        *://*.giantitp.com/*
// @match        *://*.goblinscomic.com/*
// @match        *://*.leasticoulddo.com/*
// @match        *://*.vgcats.com/*
// @match        *://*.xkcd.com/*
// ==/UserScript==

/*
 * Some sites have built-in Left=>Prev, Right=>Next functionality.
 * Built-in functionality is almost always faster due to skipping comic-rocket.
 * In theory there could be value in overriding it so that comic-rocket can track where you are
 * via marks but that may require debugging to make sure it overrides correctly.
 *
 * Has built-in arrow-key functionality (have not tried to override)
 *    // @match *://*.lfg.co/*
 *    // @match *://*.questionablecontent.net/*
 *    // @match *://*.schlockmercenary.com/*
 *    // @match *://*.smbc-comics.com/*
 */

function comic_rocket_arrows(e) {
   switch (e.keyCode) {
      case 37: // Left
         location.href='https://www.comic-rocket.com/go?mark&nav=prev&uri='+encodeURIComponent(location.href);
         break;
      case 39: // Right
         location.href='https://www.comic-rocket.com/go?mark&nav=next&uri='+encodeURIComponent(location.href);
         break;
      // case 38: // Up
      // case 40: // Down
      default:
         break;
   }
}
document.addEventListener('keyup', comic_rocket_arrows, false);