Customizing SMF > Mod Requests

Mouseover Link Preview

<< < (2/3) > >>

Sorck:
Arantor's right. It's not something that would be very easy to do by any stretch of the imagination.

I remember seeing a Javascript function that would render a web page into a canvas but it only supported some attributes and it used a lot of things not available to PHP (DOM, canvas element, etc) and it relied on data provided by the browser parsed page to render the element I would assume (CSS info was probably from DOM element properties).

PHP could do it with a combination of parsing the HTML DOM of the target page, parsing all the attached CSS and then shoving that into an GD image. It might sound simple but it would be inefficient (slow) and would need many thousands, probably tens of thousands, of lines of code to create a decent match to what a normal browser would render the page in question as. Even parsing HTML/CSS is a challenge in itself never mind rendering it/understanding it.

Summing it up: possible but not practically possible.

Texan78:
So no Mods out there currently that will do this available for 2.0.2

Arantor:
Given all the technical details we've just explained, do you really think there would be?

Texan78:
There are working mods for previous releases that have worked just fine. Google seems to be able to do it just fine without viruses or injections. I don't see how a snap shot of link could pose those problems. I'm sorry, but the information you have provided isn't sufficient enough for me. Just because you don't know of a way for it to work does not mean it is not possible seeing there have been working mods in the past for previous releases up to 2.0.2

Arantor:
Well done for misreading the argument, yet again.

All the integrations for doing it all use third party services for doing it. And all of those third party services set up dedicated resources for running browsers solely for gathering screenshots.

There never have been any mods for doing it purely on your server because it's beyond impractical to do it on your own server. And places like Google or BrowserShots have many dedicated machine resources for this purpose, far more than you can manage yourself conveniently or cheaply.

But hey, why would I know this? It's not like I've ever written HTML parsing code or anything to mimic browser behaviour. (That was irony.)

Should I get even more detailed as to the number of problems with implementing such things, or is this sufficient detail for you? Or do I need to go through and provide detailed research on every point I'm asserting because you're not willing to take my word?


ETA: OK, so let me explain some other details.

You are aware the web has malware on it, yet? You are also aware that there are a great many sites that use all sorts of JS and CSS trickery, yes? That means you have to completely clone a browser - or sandbox it - to be able to satisfactorily render the content on a lot of sites. Since you are doing that, you have to sandbox the browser very well because there is an awful lot of malware out there to protect against.

The alternative to avoiding the whole 'snapshot' aspect is to simply dump the content in an iframe which will cause the browser to load it for you automatically. And if there's a vulnerability in your browser that's exploited by the page being linked to, boom, you're hit even without you actually clicking the link. Yes, that's secure ::)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version