🏠 Home 

Mangalib: Download all chapters

download manga from mangalib.me


Install this script?
  1. // ==UserScript==
  2. // @name Mangalib: Download all chapters
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.0
  5. // @description download manga from mangalib.me
  6. // @author You
  7. // @match *://mangalib.me/*
  8. // @grant none
  9. // ==/UserScript==
  10. (function() {
  11. 'use strict';
  12. const header = document.querySelector('#main-page .media-tabs .tabs__list');
  13. if (!header) {
  14. return;
  15. }
  16. const button = document.createElement('span');
  17. button.classList.add('volume-anchor__trigger');
  18. button.innerText = 'Скачать все главы';
  19. button.addEventListener('click', function() {
  20. const chapters = document.querySelectorAll('.media-chapter__icon.media-chapter__icon_download');
  21. chapters.forEach(function(node) {
  22. if (node.getAttribute('data-chapter-dropdown')) {
  23. node.dispatchEvent(new MouseEvent('mouseenter'));
  24. setTimeout(() => {
  25. const tippyId = node.getAttribute('aria-describedby');
  26. const tippy = document.getElementById(tippyId);
  27. const translations = tippy.querySelectorAll('.menu a.menu__item');
  28. translations[translations.length - 1].click();
  29. }, 500);
  30. }
  31. node.click();
  32. });
  33. });
  34. button.style.marginLeft = '12px';
  35. header.appendChild(button);
  36. })();