Last active
October 30, 2024 06:27
-
-
Save xim/9ca907c77abf0687d1beac910888966d to your computer and use it in GitHub Desktop.
Mangaread/nightcomic/manhuafast page gap toggler
This file contains hidden or 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== | |
| // @name Mangaread.org page gap toggler | |
| // @namespace https://gist.github.com/xim | |
| // @version 2024-01-17 | |
| // @description Running this toggles the "no-gap" css class on all .page-break page elements | |
| // @author xim | |
| // @match https://www.mangaread.org/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=mangaread.org | |
| // @grant none | |
| // ==/UserScript== | |
| function toggle_gap() { | |
| var pages = document.getElementsByClassName('page-break'); | |
| for (const page of pages) { | |
| if (page.classList.contains('no-gaps')) { | |
| page.classList.remove('no-gaps'); | |
| } else { | |
| page.classList.add('no-gaps'); | |
| } | |
| } | |
| } | |
| (function() { | |
| 'use strict'; | |
| var icon = document.createElement('i'); | |
| icon.classList.add('icon'); | |
| icon.classList.add('ion-logo-javascript'); | |
| var link = document.createElement('a'); | |
| link.classList.add('wp-manga-action-button'); | |
| link.onclick = toggle_gap; | |
| link.appendChild(icon); | |
| var li = document.createElement('li'); | |
| li.appendChild(link); | |
| var list = document.getElementsByClassName('action_list_icon')[0]; | |
| list.appendChild(li); | |
| //node.parentElement.insertBefore(new_el, node); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment