|
4018 | 4018 | self.href=self.canonicalUri(href); |
4019 | 4019 | GM_xmlhttpRequest({ |
4020 | 4020 | method: 'GET', |
4021 | | - overrideMimeType:"text/html;charset="+document.charset, |
| 4021 | + headers:{"Referer": + window.location.href}, |
4022 | 4022 | url: self.href, |
4023 | 4023 | onload: function(d) { |
4024 | 4024 | let html=document.implementation.createHTMLDocument(''); |
|
4032 | 4032 | }); |
4033 | 4033 | imgs.forEach(function(img) { |
4034 | 4034 | var isrc=img.getAttribute("src"); |
| 4035 | + if (self._dataCache[isrc]) return; |
4035 | 4036 | var nimg = new Image(); |
4036 | 4037 | nimg.src = isrc; |
4037 | | - nimg.style.display="none"; |
4038 | | - document.body.appendChild(nimg); |
4039 | 4038 | nimg.onload=function(){ |
4040 | | - if (self._dataCache[this.src]) return; |
4041 | 4039 | var result = findPic(this); |
4042 | 4040 | if (result) { |
4043 | 4041 | self.data.push(result); |
4044 | 4042 | self._appendThumbSpans([result]); |
4045 | 4043 | self.loadThumb(); |
4046 | 4044 | } |
4047 | 4045 | self._dataCache[this.src] = true; |
4048 | | - document.body.removeChild(nimg); |
4049 | 4046 | }; |
4050 | 4047 | }); |
4051 | 4048 | if(prefs.gallery.loadAll)self.prePage(); |
|
4096 | 4093 | self.href=self.canonicalUri(href); |
4097 | 4094 | GM_xmlhttpRequest({ |
4098 | 4095 | method: 'GET', |
4099 | | - overrideMimeType:"text/html;charset="+document.charset, |
4100 | 4096 | url: self.href, |
| 4097 | + headers:{"Referer": + window.location.href}, |
4101 | 4098 | onload: function(d) { |
4102 | 4099 | let html=document.implementation.createHTMLDocument(''); |
4103 | 4100 | html.documentElement.innerHTML = d.responseText; |
|
4110 | 4107 | }); |
4111 | 4108 | imgs.forEach(function(img) { |
4112 | 4109 | var isrc=img.getAttribute("src"); |
| 4110 | + if (self._dataCache[isrc]) return; |
4113 | 4111 | var nimg = new Image(); |
4114 | 4112 | nimg.src = isrc; |
4115 | | - nimg.style.display="none"; |
4116 | | - document.body.appendChild(nimg); |
4117 | 4113 | nimg.onload=function(){ |
4118 | | - if (self._dataCache[this.src]) return; |
4119 | 4114 | var result = findPic(this); |
4120 | 4115 | if (result) { |
4121 | 4116 | self.data.push(result); |
4122 | 4117 | self._appendThumbSpans([result]); |
4123 | 4118 | self.loadThumb(); |
4124 | 4119 | } |
4125 | 4120 | self._dataCache[this.src] = true; |
4126 | | - document.body.removeChild(this); |
4127 | 4121 | }; |
4128 | 4122 | }); |
4129 | 4123 | if(prefs.gallery.loadAll)self.nextPage(); |
|
0 commit comments