JSDOM in browser

1,066 views
Skip to first unread message

Sunil Agrawal

unread,
Mar 25, 2013, 9:37:42 PM3/25/13
to js...@googlegroups.com
Hi,
I am a JSDOM newbie and have a basic question. Has anyone used JSDOM in a browser?  My use case is to provide a 'virtual DOM' within web workers. 

I saw a similar thread, but that was closed, and I couldn't figure if the issue was resolved (and there is support), or that was determined as out of scope.
Thanks, Sunil

Zach Smith

unread,
Mar 26, 2013, 2:10:43 PM3/26/13
to js...@googlegroups.com
It's not possible, it relies on a lot of native node modules, like the file system, as well as contextify, which is a c extension.

Scott Elcomb

unread,
Mar 26, 2013, 9:53:15 PM3/26/13
to js...@googlegroups.com
On Tue, Mar 26, 2013 at 2:10 PM, Zach Smith <x.code...@gmail.com> wrote:
> On Monday, March 25, 2013 9:37:42 PM UTC-4, Sunil Agrawal wrote:
>>
>> I am a JSDOM newbie and have a basic question. Has anyone used JSDOM in a
>> browser? My use case is to provide a 'virtual DOM' within web workers.
>
> It's not possible, it relies on a lot of native node modules, like the file
> system, as well as contextify, which is a c extension.

I wonder if it would be possible with node-webkit? At first, the
thought of using jsdom in the browser didn't make much sense to me -
but using it in webworkers... that conjures up some interesting ideas.

--
Scott Elcomb
@psema4 on Twitter / Identi.ca / Github & more

Atomic OS: Self Contained Microsystems
http://code.google.com/p/atomos/

Member of the Pirate Party of Canada
http://www.pirateparty.ca/

Zach Smith

unread,
Mar 27, 2013, 4:06:04 PM3/27/13
to js...@googlegroups.com
If you just need a jquery-ish api in a web worker you could use https://github.com/MatthewMueller/cheerio



--
You received this message because you are subscribed to a topic in the Google Groups "jsdom" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsdom/MYRPSbOWikM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to jsdom+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Hugo Ferreira

unread,
Oct 21, 2019, 9:46:39 AM10/21/19
to jsdom
Hi Sunil,

It should be possible but you have to "browserify" it first to import the shims and polyfills.
Unfortunately I have not had success and will be posting a question here about this.
In my case I want jsdom for a JS engine.

HTHs,
HF

Hugo Ferreira

unread,
Oct 21, 2019, 9:57:23 AM10/21/19
to jsdom
Reply all
Reply to author
Forward
0 new messages