Skip to content

Commit deeeb77

Browse files
committed
fix
1 parent 9023e2b commit deeeb77

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

Picviewer CE+/Picviewer CE+.user.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4018,7 +4018,7 @@
40184018
self.href=self.canonicalUri(href);
40194019
GM_xmlhttpRequest({
40204020
method: 'GET',
4021-
overrideMimeType:"text/html;charset="+document.charset,
4021+
headers:{"Referer": + window.location.href},
40224022
url: self.href,
40234023
onload: function(d) {
40244024
let html=document.implementation.createHTMLDocument('');
@@ -4032,20 +4032,17 @@
40324032
});
40334033
imgs.forEach(function(img) {
40344034
var isrc=img.getAttribute("src");
4035+
if (self._dataCache[isrc]) return;
40354036
var nimg = new Image();
40364037
nimg.src = isrc;
4037-
nimg.style.display="none";
4038-
document.body.appendChild(nimg);
40394038
nimg.onload=function(){
4040-
if (self._dataCache[this.src]) return;
40414039
var result = findPic(this);
40424040
if (result) {
40434041
self.data.push(result);
40444042
self._appendThumbSpans([result]);
40454043
self.loadThumb();
40464044
}
40474045
self._dataCache[this.src] = true;
4048-
document.body.removeChild(nimg);
40494046
};
40504047
});
40514048
if(prefs.gallery.loadAll)self.prePage();
@@ -4096,8 +4093,8 @@
40964093
self.href=self.canonicalUri(href);
40974094
GM_xmlhttpRequest({
40984095
method: 'GET',
4099-
overrideMimeType:"text/html;charset="+document.charset,
41004096
url: self.href,
4097+
headers:{"Referer": + window.location.href},
41014098
onload: function(d) {
41024099
let html=document.implementation.createHTMLDocument('');
41034100
html.documentElement.innerHTML = d.responseText;
@@ -4110,20 +4107,17 @@
41104107
});
41114108
imgs.forEach(function(img) {
41124109
var isrc=img.getAttribute("src");
4110+
if (self._dataCache[isrc]) return;
41134111
var nimg = new Image();
41144112
nimg.src = isrc;
4115-
nimg.style.display="none";
4116-
document.body.appendChild(nimg);
41174113
nimg.onload=function(){
4118-
if (self._dataCache[this.src]) return;
41194114
var result = findPic(this);
41204115
if (result) {
41214116
self.data.push(result);
41224117
self._appendThumbSpans([result]);
41234118
self.loadThumb();
41244119
}
41254120
self._dataCache[this.src] = true;
4126-
document.body.removeChild(this);
41274121
};
41284122
});
41294123
if(prefs.gallery.loadAll)self.nextPage();

0 commit comments

Comments
 (0)