

Ask HN: What Technology does Optimizely use? - dawie

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.<p>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.<p>If someone can comment on how they do that, I would really appreciate it.
======
antimatter15
There'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://optimizel...](http://wikify.antimatter15.com/server/proxy?http://optimizely.com)

source code:
[http://code.google.com/p/wikify/source/browse/trunk/appengin...](http://code.google.com/p/wikify/source/browse/trunk/appengine/webwikify/main.py#124)

~~~
dawie
How can I contact you? You can also drop me an email at tabtrickapp at
google's email service

------
bretthopper
After 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.

------
antimatter15
It'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!).

------
dawie
Clickable Link: <https://optimizely.appspot.com/edit#url=http://tabtrick.com>

------
j_s
i would say typically sites use a java applet:
<http://www.barklund.org/blog/2009/10/14/how-snapabug-works/>

examples in action: <http://screenr.com/record> <http://www.screencast-o-
matic.com/create>

google it for you: [http://stackoverflow.com/questions/701798/how-to-take-a-
scre...](http://stackoverflow.com/questions/701798/how-to-take-a-screen-shot-
of-a-web-page) [http://stackoverflow.com/questions/60455/take-a-
screenshot-o...](http://stackoverflow.com/questions/60455/take-a-screenshot-
of-a-webpage-with-javascript)
[http://stackoverflow.com/questions/2046812/javascript-to-
tak...](http://stackoverflow.com/questions/2046812/javascript-to-take-a-
screenshot-of-a-website-without-using-activex)

------
trizk
Check out "wkhtmltopdf", I think it has a library to take a screenshot.

------
dawie
I 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.

------
excid3
Building a browser extension wold probably make the most sense for taking a
screenshot of a full page or portion of it.

