Skip to content

Instantly share code, notes, and snippets.

@angusdev
Created October 1, 2023 20:42
Show Gist options
  • Save angusdev/786d24b656b40b85ac16bc29674f7eb7 to your computer and use it in GitHub Desktop.
Save angusdev/786d24b656b40b85ac16bc29674f7eb7 to your computer and use it in GitHub Desktop.
manhuagui.com - view in full screen - use left / right arrow to view prev / next page
javascript:!function(){document.querySelectorAll(".header,.title,.tc,.gg_728,.sub-btn,.backToTop,.backToTop ~ *").forEach((e=>e.parentNode.removeChild(e)));const e=e=>{const t=document.querySelector("#mangaFile");t.style.width&&(t.style.width="",t.style.height=window.innerHeight-20+"px",t.style.marginTop="10px")};e(),new MutationObserver((t=>{t.forEach((t=>{t.addedNodes.length&&new MutationObserver(e).observe(t.addedNodes[0],{attributes:!0,attributeFilter:["style"]})}))})).observe(document.querySelector("#mangaFile").parentNode,{subtree:!0,childList:!0})}();
(function() {
document.querySelectorAll('.header,.title,.tc,.gg_728,.sub-btn,.backToTop,.backToTop ~ *').forEach(e=>e.parentNode.removeChild(e));
const imageStyler = _ => {
const ele = document.querySelector('#mangaFile');
if (ele.style.width) {
ele.style.width = '';
ele.style.height = (window.innerHeight - 20) + 'px';
ele.style.marginTop = '10px';
}
};
imageStyler();
new MutationObserver(ms => {
ms.forEach(m => {
if (m.addedNodes.length) {
new MutationObserver(imageStyler).observe(m.addedNodes[0], { attributes : true, attributeFilter : ['style'] });
}
})
}).observe(document.querySelector('#mangaFile').parentNode, {subtree: true, childList: true});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment