Advertisement
Crystalmyst

TamperMonkey Next Chapter binding for Comick.cc

Feb 10th, 2024
1,340
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.25 KB | Software | 1 0
  1. // ==UserScript==
  2. // @name         Comick.cc Next Chapter Keybinding
  3. // @namespace    http://comick.cc/
  4. // @version      1.0
  5. // @description  Binds Comick.cc's next chapter button to CTRL+ALT+` which can be set via other applications to mouse buttons etc
  6. // @author       Tim Robb
  7. // @match        http*://*.comick.cc/*
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=comic.cc
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function () {
  13.     'use strict';
  14.     document.onkeydown = function (e) {
  15.         e = e || window.event;
  16.         if (e.key === '`' && e.ctrlKey === true && e.altKey === true) {
  17.             // NOTE: The below CSS selector is fragile and may need updating if the HTML changes.
  18.             //  To set it yourself, you'll need to analyze the source of the page and pull out a unique selector for the element.
  19.             //  Most sites actually have a specific class for this link, like `.next-ch-btn`, but Comick.cc sadly doesn't.
  20.             //  If you use this script for another site, make sure to not only check the CSS selector, but the array index too (`[1]`).
  21.             var href = document.querySelectorAll('.reader-container .items-center a')[1].href;
  22.             window.location = href;
  23.         }
  24.     };
  25. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement