Manga Loader

Support for over 70 sites! Loads manga chapter into one page in a long strip format, supports switching chapters, minimal script with no dependencies, easy to implement new sites, loads quickly and works on mobile devices through bookmarklet

Old: v1.10.6 2016-09-06 fix thanks to @nobody123 "Fixed curpages and numpages on dm5"
New: v1.11.0 2016-09-07 new feature!! zoom, press +/- keys to zoom images in and out, and 0 key to reset image zoom; fixed defaulting to "default" profile

  • --- /tmp/diffy20220122-763651-okpuiv 2022-01-22 01:53:04.479525206 +0000
  • +++ /tmp/diffy20220122-763651-4ctbhr 2022-01-22 01:53:04.479525206 +0000
  • @@ -1,7 +1,7 @@
  • // ==UserScript==
  • // @name Manga Loader
  • // @namespace http://www.fuzetsu.com/MangaLoader
  • -// @version 1.10.6
  • +// @version 1.11.0
  • // @description Support for over 70 sites! Loads manga chapter into one page in a long strip format, supports switching chapters, minimal script with no dependencies, easy to implement new sites, loads quickly and works on mobile devices through bookmarklet
  • // @copyright 2016+, fuzetsu
  • // @noframes
  • @@ -1367,7 +1367,7 @@
  • addStyle('main', true, viewerCss, imagesCss, imageCss, counterCss, navCss, navHoverCss, statsCss, statsCollapseCss, statsHoverCss, boxCss, floatingMsgCss, buttonCss, keySettingCss, autoloadSettingCss, floatingMsgAnchorCss);
  • // add user styles
  • var userCss = storeGet('ml-setting-css-profiles');
  • - var curProf = storeGet('ml-setting-css-current') || '';
  • + var curProf = storeGet('ml-setting-css-current') || 'Default';
  • if(userCss && userCss.length > 0) userCss = userCss.filter(function(p) { return p.name === curProf; });
  • userCss = userCss && userCss.length > 0 ? userCss[0].css : (storeGet('ml-setting-css') || '');
  • addStyle('user', true, userCss);
  • @@ -1506,12 +1506,15 @@
  • '',
  • 'CSS feature has now been enhanced to support multiple profiles you can switch between.',
  • '',
  • - '<strong>Keybindings:</strong>',
  • + '<strong>Default Keybindings:</strong>',
  • 'Z - previous chapter',
  • 'X - exit',
  • 'C - next chapter',
  • 'W - scroll up',
  • 'S - scroll down',
  • + '+ - zoom in',
  • + '- - zoom out',
  • + '0 - reset zoom',
  • 'Click the info button again to close this message.'
  • ].join('<br>'), null, true);
  • }
  • @@ -1640,10 +1643,22 @@
  • };
  • }
  • });
  • + // zoom
  • + var changeZoom = function(action, elem) {
  • + var curImage = getCurrentImage();
  • + var zoom = parseFloat(elem.style.zoom) || 1;
  • + if(action === '+') zoom += 0.15;
  • + if(action === '-') zoom -= 0.15;
  • + if(action === '=') zoom = 1;
  • + elem.style.zoom = zoom;
  • + showFloatingMsg('zoom: ' + Math.round(zoom * 100) + '%', 500);
  • + curImage.scrollIntoView();
  • + };
  • // keybindings
  • UI.keys = {
  • PREV_CHAP: 90, EXIT: 88, NEXT_CHAP: 67,
  • - SCROLL_UP: 87, SCROLL_DOWN: 83
  • + SCROLL_UP: 87, SCROLL_DOWN: 83,
  • + ZOOM_IN: 187, ZOOM_OUT: 189, RESET_ZOOM: 48
  • };
  • UI.scrollAmt = 50;
  • // override the defaults with the user defined ones
  • @@ -1679,6 +1694,15 @@
  • case UI.keys.SCROLL_DOWN:
  • window.scrollBy(0, UI.scrollAmt);
  • break;
  • + case UI.keys.ZOOM_IN:
  • + changeZoom('+', UI.images);
  • + break;
  • + case UI.keys.ZOOM_OUT:
  • + changeZoom('-', UI.images);
  • + break;
  • + case UI.keys.RESET_ZOOM:
  • + changeZoom('=', UI.images);
  • + break;
  • default:
  • evt.stopPropagation();
  • break;
  • @@ -1687,6 +1711,15 @@
  • return UI;
  • };
  • +var getCurrentImage = function() {
  • + var image;
  • + getEls('.ml-images img').some(function(img) {
  • + image = img;
  • + return img.getBoundingClientRect().bottom > 200;
  • + });
  • + return image;
  • +};
  • +
  • var getCounter = function(imgNum) {
  • var counter = document.createElement('div');
  • counter.classList.add('ml-counter');
  • @@ -1878,7 +1911,7 @@
  • }
  • // setup load hotkey
  • var loadHotKey = function(e) {
  • - if(e.ctrlKey && e.keyCode == 188) {
  • + if(e.ctrlKey && e.keyCode == 188) { // ctrl + , (comma)
  • e.preventDefault();
  • btnLoad.click();
  • window.removeEventListener('keydown', loadHotKey);