4 ms·
Ask HN: What Technology does Optimizely use?
I was playing with Optimizely's experiment creator today and I really want to know how they grab any website and then allow the user to interact with it.
I want to do something similar, but instead of editing the code, I want to allow the user to select a region of the page and take a screenshot of it.
If someone can comment on how they do that, I would really appreciate it.
- dawie 16y agoClickable Link: https://optimizely.appspot.com/edit#url=http://tabtrick.com https://optimizely.appspot.com/edit#url=http://tabtrick.com
- bretthopper 16y agoAfter a quick glance, they load the page in an iFrame and inject their CSS + JS into it. Any of changes you make will be "compiled" into a JS file which you then include on your page. Whatever edits you made will only be reflected client side on load. Generating a screenshot is a completely different process than editing a website so I'm not sure Optimizely's tech is that useful to you.
- excid3 16y agoBuilding a browser extension wold probably make the most sense for taking a screenshot of a full page or portion of it.
- trizk 16y agoCheck out "wkhtmltopdf", I think it has a library to take a screenshot.
- antimatter15 16y agoThere's a proxy that attaches JS to a frame. It needs to be proxied to bypass the same origin js limitations. Another way you could take would be to make a browser extension. I used a similar technique in http://wikify.antimatter15.com/server/proxy?http://optimizely.com http://wikify.antimatter15.com/server/proxy?http://optimizel... source code: http://code.google.com/p/wikify/source/browse/trunk/appengine/webwikify/main.py#124 http://code.google.com/p/wikify/source/browse/trunk/appengin...
- dawie 16y agoHow can I contact you? You can also drop me an email at tabtrickapp at google's email service
- antimatter15 16y agoIt's not possible to take a screenshot with unprivledged javascript (there's a method to draw a window into a canvas for privledge js in firefox and a screenshot api for chrome and safari). The only way would be to use a browser extension unless you wanted to use implement your own rendering engine (perhaps based on getComputedStyle) in canvas (that would be cool though!).
- j_s 16y agoi would say typically sites use a java applet: http://www.barklund.org/blog/2009/10/14/how-snapabug-works/ http://www.barklund.org/blog/2009/10/14/how-snapabug-works/ examples in action: http://screenr.com/record http://screenr.com/record http://www.screencast-o-matic.com/create http://www.screencast-o-matic.com/create google it for you: http://stackoverflow.com/questions/701798/how-to-take-a-screen-shot-of-a-web-page http://stackoverflow.com/questions/701798/how-to-take-a-scre... http://stackoverflow.com/questions/60455/take-a-screenshot-of-a-webpage-with-javascript http://stackoverflow.com/questions/60455/take-a-screenshot-o... http://stackoverflow.com/questions/2046812/javascript-to-take-a-screenshot-of-a-website-without-using-activex http://stackoverflow.com/questions/2046812/javascript-to-tak...
- dawie 16y agoI am more interested in getting an existing website to display inside my own, than doing screenshots. There are services and APIs out there that does screenshots quite well.