You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create a file with a method to access data using httprequest and a main method
import this file as a web-worker using Isolate.spawnURI
What is the expected output? What do you see instead?
I'd expect the isolate to fire an httprequest. In dartium this doesn't happen. When I compile the code to javascript it runs fine. the http request is sent and the data is fetched.
What version of the product are you using? On what operating system?
Dart Editor version 1.2.0.dev_03_02 (DEV)
Dart SDK version 1.2.0-dev.3.2
I would love a solution to this issue. I'm including a working copy of the above test.
HttpRequest throws the following exception: "DOM access is not enabled in this isolate".
This issue was originally filed by [email protected]
What steps will reproduce the problem?
What is the expected output? What do you see instead?
I'd expect the isolate to fire an httprequest. In dartium this doesn't happen. When I compile the code to javascript it runs fine. the http request is sent and the data is fetched.
What version of the product are you using? On what operating system?
Dart Editor version 1.2.0.dev_03_02 (DEV)
Dart SDK version 1.2.0-dev.3.2
Ubuntu 12.04
Many thanks!
minimal code:
in main.dart:
import 'dart:html';
import 'dart:isolate';
SendPort sendPort;
void main() {
ReceivePort receivePort = new ReceivePort();
Isolate.spawnUri(Uri.parse("worker.dart"), null, receivePort.sendPort);
receivePort.listen((var m) {
print(m);
if(sendPort==null) {
sendPort=m;
} else {
print(m);
}
});
}
in worker.dart:
import "dart:isolate";
ReceivePort receivePort;
void main(List<String> args, SendPort sp) {
receivePort = new ReceivePort();
sp.send(receivePort.sendPort);
sp.send("this string arrives");
HttpRequest.getString(COMPLETE_URL)
.then((String string)=>sp.send("this string doesn't arrive");
}
The text was updated successfully, but these errors were encountered: