Skip to content

Instantly share code, notes, and snippets.

@tynrare
Last active October 8, 2020 02:32
Show Gist options
  • Save tynrare/70aae8518e07f81d18fa7b747f6decd3 to your computer and use it in GitHub Desktop.
Save tynrare/70aae8518e07f81d18fa7b747f6decd3 to your computer and use it in GitHub Desktop.
Tampermonkey mintmanga read improve
// ==UserScript==
// @name mintmanga-fullheight-view
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author tynrare
// @match https://mintmanga.live/*
// @match https://readmanga.live/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function scrollUp(){
console.log('croll up');
window.scrollTo(0, 0);
document.getElementById('mangaPicture').onclick = scrollUp;
}
function apply(){
if(!/page=/.test(location.hash)) {
setTimeout(apply, 1000);
return;
}
console.log('Apply script read mode');
var box = document.getElementById('mangaBox');
document.body.insertBefore(box, document.body.firstChild);
for(var i in box.children){
var ch = box.children[i];
if(ch.classList && ch.id !== "fotocontext"){
ch.classList.add('hide')
}
}
var styles = `
#mangaBox {
height: 100%;
}
#mangaBox div {
height: 100%;
}
#mangaBox div img {
height: 100%;
width: auto
}
`;
var styleSheet = document.createElement("style");
styleSheet.type = "text/css";
styleSheet.innerText = styles;
document.head.appendChild(styleSheet);
scrollUp();
}
apply();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment