Greasy Fork is available in English.
Images can be extracted and batch downloaded from most websites. Especially for websites the right click fails or image can not save. Extra features: zip download / auto-enlarge image. See the script description at info page (suitable for chrome/firefox+tampermonkey)
< Feedback on Image Downloader
要不就在这里贴代码,我看下没问题,就提交到版本里去。
主要是在git上要多转一次,我代码都是直接写好了,就提交到这里了。就一个文件,再用git转一次转到这里,觉得有点麻烦。
先是一个不太重要的文字提示 zipCheckText 我改为了『启用zip下载』和『Enable ZipDownload』,因为我发现这个选项实际控制的是不勾选的话,zip下载是否能够使用
接下来是『全选/去选全选相关的代码』(我贴在下面单独一个评论里)
diff -r R:\modified.js R:\original.js
881d882
< let checkSvg;
883,889c883
< if (ePath[0].classList.contains('bi-check')) {
< checkSvg = ePath[0];
< } else if (ePath[0].classList.contains('select-image')) {
< checkSvg = ePath[0].querySelector('.bi-check');
< } else {
< checkSvg = ePath.find((ele) => ele.classList[1] === "bi-check");
< }
---
> let checkSvg = ePath.find((ele) => ele.classList[1] === "bi-check");
898d890
< checkSvg.parentElement.classList.remove('xm-is-checked');
903d894
< checkSvg.parentElement.classList.add('xm-is-checked');
1030,1032c1021,1022
< document.querySelectorAll('.tyc-image-wrapper span.select-image:not(.xm-is-checked)').forEach(el=>el.click())
< //imgWaitDownload = filteredImgUrls;
< //zipImgWaitDownload=cutoffNotBase64Img(zipFilteredImgUrls);
---
> imgWaitDownload = filteredImgUrls;
> zipImgWaitDownload=cutoffNotBase64Img(zipFilteredImgUrls);
1034,1036c1024,1025
< document.querySelectorAll('.tyc-image-wrapper span.select-image.xm-is-checked').forEach(el=>el.click())
< //imgWaitDownload=transIndexToLink(filteredImgUrls,imgSelected);
< //zipImgWaitDownload=transIndexToLink(zipFilteredImgUrls,zipImgSelected);
---
> imgWaitDownload=transIndexToLink(filteredImgUrls,imgSelected);
> zipImgWaitDownload=transIndexToLink(zipFilteredImgUrls,zipImgSelected);
1117c1106
< return ele.classList.contains("select-image");
---
> return ele.className == "select-image";
好的,谢谢你的提交。
https://github.com/taoyuancun123/userScriptCollections
我把2.28版本的提交到了这里,你发pr过来吧。下次如果有其他的修改,也更方便一点。
提过去了
如何提交PR?
github上的代码似乎还是很久之前的。 我做了一些小修改,主要是修改了全选/取消全选相关的逻辑,现在全选后会是在UI上直接进行全选,这样可以方便再做进一步的筛选。