Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Unified Diff: client/dart.js

Issue 52023002: Use userAgent instead of webkitStartDart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/browser/lib/dart.js » ('j') | pkg/browser/lib/dart.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dart.js
diff --git a/client/dart.js b/client/dart.js
index f13841a3dc85bbf8a8b3c46dfc1b4a9fea0ba9cb..43a6497e336e71ca408fa64db53a3fec48e218b8 100644
--- a/client/dart.js
+++ b/client/dart.js
@@ -10,11 +10,7 @@ var warning = [
console.error(warning);
// Bootstrap support for Dart scripts on the page as this script.
-if (navigator.webkitStartDart) {
- if (!navigator.webkitStartDart()) {
- document.body.innerHTML = 'This build has expired. Please download a new Dartium at http://www.dartlang.org/dartium/index.html';
- }
-} else {
+if (navigator.userAgent.indexOf('(Dart)') === -1) {
ricow1 2013/10/30 06:35:25 indexOf should always return a number, so strictly
// TODO:
// - Support in-browser compilation.
// - Handle inline Dart scripts.
@@ -211,7 +207,7 @@ function ReceivePortSync() {
delete ReceivePortSync.map[this.id];
};
- if (navigator.webkitStartDart) {
+ if (navigator.userAgent.indexOf('(Dart)') !== -1) {
window.addEventListener('js-sync-message', function(event) {
var data = JSON.parse(getPortSyncEventData(event));
var deserialized = deserialize(data.message);
« no previous file with comments | « no previous file | pkg/browser/lib/dart.js » ('j') | pkg/browser/lib/dart.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698