headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.49k stars 160 forks source link

[question] javascript runtime? #41

Closed u007 closed 7 years ago

u007 commented 8 years ago

Hi,

does it run javascript after loading the page? thanks

Ovid commented 7 years ago

No, it does not.

mdaliyan commented 7 years ago

Surf is so fast and uses very low resources. but the problem is web is going towards the point that you can see AngularJS, Vue, React, Ember and so many more frameworks everywhere. not being able to render those pages by surf, makes me use phantomjs, that is too slow and eats resources like a whale.

May you please add surf the ability to run JavaScript on the page? (width some option to make it enabled or disabled)

May you please consider this feature?

yalay commented 7 years ago

me too.

Splizard commented 7 years ago

This is possible, just need to create a DOM and integrate https://github.com/robertkrimen/otto

lxt2 commented 7 years ago

The thing is, it's a LOT more complicated then that. Otto is a (partial) javascript interpreter, but you need to handle the DOM and all of the quirks of a browser. It's outside of the scope of what Surf does. I'd suggest looking at something like Chrome's new Headless mode.