Firefox returns status code 0 for cross domain requests, don't reload pictures only in 404'd threads.
Close #22
This commit is contained in:
parent
8a91a4e7fc
commit
0e076a1bcf
@ -2876,7 +2876,7 @@
|
|||||||
img = $.el('img', {
|
img = $.el('img', {
|
||||||
src: a.href
|
src: a.href
|
||||||
});
|
});
|
||||||
if (engine === "gecko" && a.parentNode.className !== 'op') {
|
if (engine === 'gecko' && a.parentNode.className !== 'op') {
|
||||||
filesize = $('.filesize', a.parentNode);
|
filesize = $('.filesize', a.parentNode);
|
||||||
_ref = filesize.textContent.match(/(\d+)x/), _ = _ref[0], max = _ref[1];
|
_ref = filesize.textContent.match(/(\d+)x/), _ = _ref[0], max = _ref[1];
|
||||||
img.style.maxWidth = "" + max + "px";
|
img.style.maxWidth = "" + max + "px";
|
||||||
@ -2889,7 +2889,7 @@
|
|||||||
var req, thumb;
|
var req, thumb;
|
||||||
thumb = this.previousSibling;
|
thumb = this.previousSibling;
|
||||||
imgExpand.contract(thumb);
|
imgExpand.contract(thumb);
|
||||||
if (navigator.appName !== 'Opera') {
|
if (engine === 'webkit') {
|
||||||
req = $.ajax(this.src, null, 'head');
|
req = $.ajax(this.src, null, 'head');
|
||||||
return req.onreadystatechange = function() {
|
return req.onreadystatechange = function() {
|
||||||
if (this.status !== 404) {
|
if (this.status !== 404) {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ master
|
|||||||
- mayhem
|
- mayhem
|
||||||
new Indicate Duckrolls feature
|
new Indicate Duckrolls feature
|
||||||
put regex.info sauce back - disabled by default
|
put regex.info sauce back - disabled by default
|
||||||
|
fix for auto image reloading in 404'd threads on Firefox
|
||||||
|
|
||||||
2.21.4
|
2.21.4
|
||||||
- mayhem
|
- mayhem
|
||||||
|
|||||||
@ -2203,7 +2203,7 @@ imgExpand =
|
|||||||
a = thumb.parentNode
|
a = thumb.parentNode
|
||||||
img = $.el 'img',
|
img = $.el 'img',
|
||||||
src: a.href
|
src: a.href
|
||||||
if engine is "gecko" and a.parentNode.className isnt 'op'
|
if engine is 'gecko' and a.parentNode.className isnt 'op'
|
||||||
filesize = $ '.filesize', a.parentNode
|
filesize = $ '.filesize', a.parentNode
|
||||||
[_, max] = filesize.textContent.match /(\d+)x/
|
[_, max] = filesize.textContent.match /(\d+)x/
|
||||||
img.style.maxWidth = "#{max}px"
|
img.style.maxWidth = "#{max}px"
|
||||||
@ -2215,9 +2215,11 @@ imgExpand =
|
|||||||
thumb = @previousSibling
|
thumb = @previousSibling
|
||||||
imgExpand.contract thumb
|
imgExpand.contract thumb
|
||||||
#navigator.online is not x-browser/os yet
|
#navigator.online is not x-browser/os yet
|
||||||
if navigator.appName isnt 'Opera'
|
if engine is 'webkit'
|
||||||
req = $.ajax @src, null, 'head'
|
req = $.ajax @src, null, 'head'
|
||||||
req.onreadystatechange = -> setTimeout imgExpand.retry, 10000, thumb if @status isnt 404
|
req.onreadystatechange = -> setTimeout imgExpand.retry, 10000, thumb if @status isnt 404
|
||||||
|
#Firefox returns a status code of 0 because of the same origin policy
|
||||||
|
#Oprah doesn't send any request
|
||||||
else unless g.dead
|
else unless g.dead
|
||||||
setTimeout imgExpand.retry, 10000, thumb
|
setTimeout imgExpand.retry, 10000, thumb
|
||||||
retry: (thumb) ->
|
retry: (thumb) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user