Just to close the loop on this topic, I spoke with Vishal off-list and we figured out the problem. Thanks everyone.
Adam On Thu, May 10, 2012 at 1:32 AM, Vishal Shah <vis...@sokrati.com> wrote: > Hello, > > I have implemented a web worker that handles XMLHttpRequest object for my > application > When I create a separate *.js file for the worker's script it works > perfectly fine. > However, when trying to instantiate the worker using a Blob, Chrome throws > an error as follows: > > XMLHttpRequest cannot load . Cross origin requests are only supported for > HTTP. > > The URL of the blob is > "blob:http%3A//localhost%3A8080/047cca65-b588-4077-a81d-84e772dde20d" which > when decoded is > "blob:http://localhost:8080/047cca65-b588-4077-a81d-84e772dde20d" > And my application is also running at localhost:8080 > > I think somehow the same origin check is failing for the blob. > Following is the code snippet I am trying to implement: > > var blobBuilder, blobBuilderClass, blobURL, urlClass, worker; > blobBuilderClass = wObj.BlobBuilder || wObj.WebKitBlobBuilder || > wObj.MozBlobBuilder; > urlClass = wObj.URL || wObj.webkitURL; > blobBuilder = new blobBuilderClass(); > blobBuilder.append(workerFunction.toString() + > ";\nworkerFunction();"); > blobURL = urlClass.createObjectURL(blobBuilder.getBlob()); > > worker = new Worker(blobURL); > urlClass.revokeObjectURL(blobURL); > > Am I doing anything wrong here or is it a known bug in Chrome? > > Please suggest. References to any related article will be helpful. > If this is not the correct list to be contacted, please suggest me the > correct one. > > Thanks and Regards, > Vishal Shah > Sokrati Inc. > _______________________________________________ > webkit-dev mailing list > webkit-dev@lists.webkit.org > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev > _______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev