Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a phantomjs/slimmerjs sandbox #24

Closed
gkatsev opened this issue Nov 17, 2013 · 9 comments
Closed

Add a phantomjs/slimmerjs sandbox #24

gkatsev opened this issue Nov 17, 2013 · 9 comments

Comments

@gkatsev
Copy link
Member

gkatsev commented Nov 17, 2013

This would allow us to run code in a browser environment and have access to things like window.
phantomjs: http://phantomjs.org/
slimmerjs: http://slimerjs.org/
Slimmer is basically phantom except running on top of gecko/firefox.

@imbcmdth
Copy link
Member

I thought our discussion from IRC regarding this feature request might be interesting to those who missed it:

<FireFly> it'd be handy for the neverending DOM questions
<gkatsev> yeah, that's why I suggested it
<ImBcmDth> I just don't see what you would be able to show people.. event binding? no. dom
           manipulation? except for little things like properties vs. attributes you wouldn't
           be able to see the results..
<gkatsev> create a demo page with all the html elements in it? :P
<yogurt_truck> ImBcmDth: O.o? there's like a billion things you could show people
<ImBcmDth> ..and sandboxing that might be hard. you would have to disallow iframes, script tags,
           forms, etc. and sanitize innerHTML strings among a dozen other things :D 
<ImBcmDth> yogurt_truck: name 2 :P
<yogurt_truck> with the DOM being the hyper ultra horrible overcomplicated poorly-designed
               irreparably-ambiguous piece of crap that it is, there's a billion possible
               questions people could have about every single DOM function
<FireFly> ImBcmDth: you could show things with appendChild/createTextNode/things like that
<FireFly> iterating over DOM collections. Live NodeLists
<FireFly> maybe it isn't as useful as I imagine it to be
<ImBcmDth> yogurt_truck: so you can't think of any good uses either, huh
<yogurt_truck> ImBcmDth: I just told you
<yogurt_truck> oh It's certainly not that useful
<ImBcmDth> I know.
<yogurt_truck> I'm just saying the questions _are_ endless
<ImBcmDth> yes but unfortunately a (mostly) stateless command-line interface is one of the worst
           possible ways to show/help people with DOM-related things
<yogurt_truck> I disagree
<yogurt_truck> it's especially good for answering those annoying "but how could you ever achieve
               X without jquery?!?!" questions
<yogurt_truck> "u're tellin me u dont use libz for gettin elements by class??!!!11"
<yogurt_truck> -_-
<ImBcmDth> you can already show them that with code. the problem is that if the DOM is just
           `about:blank` then you still can't answer that and if it is some pre-initialized page,
           then you would have to link the user to an example of what the DOM is like each
           time you answer a question
<ImBcmDth> at that point, just use fiddle or jsbin
<FireFly> I guess
<yogurt_truck> yeah
<yogurt_truck> probably not worth the hassle then

@dsamarin
Copy link
Member

Closed on account of jsFiddle and jsBin existing. :-)

@gkatsev
Copy link
Member Author

gkatsev commented Dec 15, 2013

You're missing the point. The whole point is so that you do it from within IRC without requiring either person to leave to another application.

@dsamarin
Copy link
Member

Does either jsBin or jsFiddle provide an API? If so, I can think of a good idea.

@ljharb
Copy link
Member

ljharb commented Dec 15, 2013

I don't think it's appropriate to simulate a browser (a non command-line interface) inside IRC. When does someone have an IRC client but going to a browser is a burden?

@robotlolita
Copy link
Contributor

I can't really think of any good way of initialising a useful DOM piece, manipulating it, and showing the results in a way that is relatively concise to fit into one IRC message.

@dsamarin
Copy link
Member

How about something like this:
fiddle> document.body.style.backgroundColor = "rgb("+(Math.random()*256|0)+","+(Math.random()*256|0)+","+(Math.random()*256|0)+")";
in which the bot will respond with: dsamarin: http://jsfiddle.net/3brT2/

@ljharb
Copy link
Member

ljharb commented Dec 16, 2013

i like the idea of the output being a link, but in that case, how often do you have fiddle content that's short enough for an IRC message, where it actually takes you that long to open up a browser and make a fiddle?

I think this feature is starting to get us into bloat land.

@gkatsev
Copy link
Member Author

gkatsev commented Dec 16, 2013

This issue was opened mostly to get a discussion going as opposed to necessarily getting this feature 🚢ed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants