Skip to content

Commit c27b3cf

Browse files
committed
fix
1 parent 78e4a4a commit c27b3cf

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

HacgGodTurn/HacgGodTurn.user.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
// @include http*://yui-nya.com/*
7373
// @include http*://www.l-sj.cc/*
7474
// @include http*://htacg.cc/*
75-
// @version 3.21.03
75+
// @version 3.21.05
7676
// @grant GM_notification
7777
// @grant GM_xmlhttpRequest
7878
// @grant GM_setClipboard
@@ -692,11 +692,11 @@
692692
var bgUrls,sum=0,maxCss=5;
693693
var batchBg=document.createElement("ul");
694694
batchBg.classList.add("dropdown-menu");
695-
batchBg.innerHTML="<li><a href=\"javascript:void(0)\">复制所有背景图片链接</a></li>";
695+
batchBg.innerHTML="<li><a href=\"javascript:void(0)\">复制当组背景图链接</a></li>";
696696
batchBg.onclick=function(e){
697697
if(bgUrls==undefined){
698698
bgUrls="";
699-
for(let j=0;j<=maxCss;j++){
699+
/*for(let j=0;j<=maxCss;j++){
700700
GM_xmlhttpRequest({
701701
method: 'GET',
702702
url: "https://www.mygalgame.com/wp-content/themes/mygalgame/ui/css/background"+j+".css",
@@ -721,7 +721,15 @@
721721
console.log(e);
722722
}
723723
});
724+
}*/
725+
var style=document.querySelector("style");
726+
var curRegs=style.innerHTML.pmatch(/background\-image:\s*url\('?([^\')]+)'?\)/gi);
727+
for(var curReg of curRegs){
728+
if(bgUrls.indexOf(curReg[0])==-1)
729+
bgUrls+=curReg[0]+"\n";
724730
}
731+
GM_setClipboard(bgUrls);
732+
alert("背景图片链接复制完毕");
725733
}else{
726734
if(bgUrls!=""){
727735
GM_setClipboard(bgUrls);

0 commit comments

Comments
 (0)