Last active
February 1, 2024 22:11
Revisions
-
xim revised this gist
Feb 1, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,8 @@ // @description Script that remembers the "gap" setting per manga // @author xim // @match https://mangasee123.com/read-online/* // @downloadURL https://gist.github.com/xim/581c409b924ee01e4bc9bf5e9fa2abfc/raw/mangasee123-gap-persisting.user.js // @updateURL https://gist.github.com/xim/581c409b924ee01e4bc9bf5e9fa2abfc/raw/mangasee123-gap-persisting.user.js // @icon https://www.google.com/s2/favicons?sz=64&domain=mangasee123.com // @grant GM_getValue // @grant GM_setValue -
xim created this gist
Feb 1, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ // ==UserScript== // @name Mangasee123 page gap persisting // @namespace https://gist.github.com/xim // @version 2024-02-01 // @description Script that remembers the "gap" setting per manga // @author xim // @match https://mangasee123.com/read-online/* // @icon https://www.google.com/s2/favicons?sz=64&domain=mangasee123.com // @grant GM_getValue // @grant GM_setValue // ==/UserScript== function set_gap(manga, gap) { console.log('set_gap', manga, gap); var data = JSON.parse(GM_getValue('pageGaps', '{}')); data[manga] = gap; GM_setValue('pageGaps', JSON.stringify(data)); } (function() { 'use strict'; const manga = document.querySelector('i.fa-book').parentElement.href.split('/')[4]; console.log(manga); if (!manga) { console.log('Unable to determine manga name'); return; } const button = document.querySelector('button[ng-click="vm.ToggleGap()"]'); var gap = button.children[0].classList.contains('fa-compress'); const clone = button.cloneNode(true); function toggle() { button.click(); clone.children[0].className = gap ? 'fas fa-compress' : 'fas fa-expand'; } clone.onclick = function() { gap = !gap; set_gap(manga, gap); toggle(); }; button.style.setProperty('display', 'none', 'important'); button.insertAdjacentElement('afterend', clone); const data = JSON.parse(GM_getValue('pageGaps', "{}")); if (data[manga] !== undefined && data[manga] !== gap) { gap = data[manga]; console.log('Setting', manga, 'gap to', gap, 'because of persisted data'); toggle(); } })();