Greasy Fork 还支持 简体中文。

DM5 image download

動漫屋圖片下載

  1. // ==UserScript==
  2. // @name DM5 image download
  3. // @author Shiaupiau (https://github.com/stu43005)
  4. // @include http://*.dm5.com/*
  5. // @include https://*.dm5.com/*
  6. // @version 1.1
  7. // @namespace https://greasyfork.org/users/445066
  8. // @description 動漫屋圖片下載
  9. // ==/UserScript==
  10.  
  11. (function init(func) {
  12. setTimeout(function () {
  13. if (typeof jQuery === 'undefined') {
  14. console.log('[DM5 image download] No jQuery, try again later');
  15. init(func);
  16. return;
  17. }
  18. const script = document.createElement('script');
  19. script.textContent = '(' + func.toString() + ')(window)';
  20. document.body.appendChild(script);
  21. }, 500);
  22. })(function () {
  23. if (!jQuery(".view-main").length) return;
  24.  
  25. jQuery(".rightToolBar").prepend(`<a href="javascript:void(0);" title="下載圖片" id="img-download-button" class="logo_1" style="display: block !important;transform: rotate(-90deg);" target="_blank"><div class="tip">下載圖片</div></a>`);
  26.  
  27. const btn = jQuery("#img-download-button");
  28.  
  29. jQuery(document).on("mousemove touchmove", ".view-main img", function (e) {
  30. const img = e.target;
  31. btn.attr("href", img.src);
  32. });
  33. });