Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Parsing XML in a Web Worker

1,330 views
Skip to first unread message

LukasSkywalker

unread,
Aug 22, 2011, 12:13:57 PM8/22/11
to
I wanted to parse a local XML file in a chrome web worker. I tried to load the XML file in the worker with a XMLHttpRequest, but noticed that responseXML is always null in workers (https://developer.mozilla.org/En/DOM/Worker).
Is there another way to parse XML files in workers?
I failed to load the file outside the worker and pass the responseXML data to the worker ("Unable to clone object" or similar).

passfree

unread,
Aug 25, 2011, 6:11:14 PM8/25/11
to

I believe that you should be able to use XPCOM from chrome workers.

Jonas Sicking

unread,
Aug 25, 2011, 11:01:37 PM8/25/11
to passfree, dev-pl...@lists.mozilla.org

That's no longer true as of Firefox 8. Additionally, while you could
use XPCOM in earlier versions, trying to use the DOM through XPCOM
would be no more threadsafe than any other way to use the DOM.

/ Jonas

martin.j...@gmail.com

unread,
Feb 4, 2012, 3:45:50 AM2/4/12
to passfree, dev-pl...@lists.mozilla.org
http://xmljs.sourceforge.net/index.html

I use it and it works perfectly - and it is ALMOST 100% compatible with inbedded DOM (well, Chromium's, at least) - just a couple of tweaks to the code and you can get it running perfectly with both. Needless to say, it's slower, but then that really isn't an issue since you are running in a background thread.

martin.j...@gmail.com

unread,
Feb 4, 2012, 3:45:50 AM2/4/12
to mozilla.de...@googlegroups.com, passfree, dev-pl...@lists.mozilla.org
0 new messages