Lately there has been a change on how Dart can be started in the browser. Since no other browser except Dartium, a special build of Chromium, has built-in Dart support, the process has two possible strategies. This is evidenced if you start a simple project from Dart Editor and peek at the HTML file, especially the last script tag which points to dart.js in Dart project repository:
<script type="application/dart" src="hello.dart"></script> <script src="http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"> </script>
What does this
dart.js file do? The logic is basically as follows.
navigator.webkitStartDartis defined, then run that function. I believe this is specifically intended for Dartium only.
- Otherwise, find all script tags which refer to
.dartfile and replace it with the corresponding
.jsfile. For example,
hello.dartwill turn into
Last but not least, this mailing-list post (dated Feb 5) states that this is still temporary, i.e. things may change again in the near future.