Hevilmystic
said
:
Oo I see, it makes sense now that you explain it.
I am assuming there's no way for Linkify to tell the difference between a 1-frame gif, and an animation gif?
It is possible, but it requires some changes to linkify that I'm not keen on doing. To analyse a sample of the file some useful info can be obtained. But this would require either relaxing the strict restrictions (content policy) I have imposed on linkify, and it would require use of google api's that mean RS Linkify would have to run persistently (more resource hungry).
While these are not necessarily major issues, I'd rather not change them unless the benefits are huge. The other thing is, the info obtained from doing this can't be 100% guaranteed as correct or safe. In most cases it would be fine. But I'm sure you'd agree
most cases
is not good enough when there is trade off. It's these restrictions that make me confident enough to say I stand by Linkify as being safe.
On top of all that, it only address a part of the problem. I still need to cover other hosts and not just gifs, a 25MB png isn't something I want to encounter either.
I must take into account the occurrences of this happening, and that offending users can be blacklisted as can the links.
So I think a simple option: Abort image loading after X seconds (X being you're own preference) is the way to go.
Worst case is your browser is laggy for those few seconds. Every unfinished task will be aborted, the images/gifs that didn't load will be clickable links that open in a new tab should you wish to view them.
Need to put into practice and test it, then I'll know for sure.
There is other stuff I haven't mentioned or explained, like images can't be aborted. Even deleting a partial image doesn't abort the request, it continues until complete. However the browser can be stopped, and then everything stops, and that's the way I have to go.
Ryan M
said
:
So I got bored and did some edits to AjaxRC for RS. It's not bad and I'm going to at least use it with my TM/GM scripts.
http://pastebin.com/AuV4ztgz If you want it.
Oh sweet, that looks really nice. Just about to run it in the console now.
I really like seeing other people's code, especially when it's something I can relate to or even better, something I can apply.