您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Makes the image a link to the next comic, and arrow keys control movement.
- // ==UserScript==
- // @name Schlock Mercenary Navigation Improvements
- // @namespace http://userscripts.org/users/Scuzzball
- // @description Makes the image a link to the next comic, and arrow keys control movement.
- // @include http://www.schlockmercenary.com/*
- // @version 1.0
- // ==/UserScript==
- if(document.getElementById('nav-next').tagName == "A") //If the next link is a link(It's a div when no new comic)
- {
- var navNext = document.getElementById('nav-next');
- }
- else
- {
- var navNext = ""
- }
- document.getElementById('comic').innerHTML = '<a href="' + navNext + '">' + document.getElementById('comic').innerHTML + '</a>';
- function leftArrowPressed() {
- window.location = document.getElementById('nav-previous');
- }
- function rightArrowPressed() {
- window.location = navNext;
- }
- document.onkeydown = function(evt) {
- evt = evt || window.event;
- switch (evt.keyCode) {
- case 37:
- leftArrowPressed();
- break;
- case 39:
- rightArrowPressed();
- break;
- }
- };