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

Unified Diff: components/neterror/resources/offline.js

Issue 2132333003: Fix dinosaur offline game for iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/neterror/resources/offline.js
diff --git a/components/neterror/resources/offline.js b/components/neterror/resources/offline.js
index 005f4f3ae20dc570369df092d783a9e5bfec0e13..5fa3050629dc6da4bc2fbd02e01081f3dcef2edd 100644
--- a/components/neterror/resources/offline.js
+++ b/components/neterror/resources/offline.js
@@ -89,8 +89,7 @@ var FPS = 60;
var IS_HIDPI = window.devicePixelRatio > 1;
/** @const */
-var IS_IOS = window.navigator.userAgent.indexOf('CriOS') > -1 ||
- window.navigator.userAgent == 'UIWebViewForStaticFileContent';
+var IS_IOS = window.navigator.platform.substr(0,2) === 'iP';
/** @const */
var IS_MOBILE = window.navigator.userAgent.indexOf('Mobi') > -1 || IS_IOS;
@@ -660,7 +659,9 @@ Runner.prototype = {
if (!this.activated) {
this.loadSounds();
this.activated = true;
- errorPageController.trackEasterEgg();
+ if (window.errorPageController) {
+ errorPageController.trackEasterEgg();
+ }
}
if (!this.tRex.jumping && !this.tRex.ducking) {
@@ -970,7 +971,7 @@ function decodeBase64ToArrayBuffer(base64String) {
* @return {number}
*/
function getTimeStamp() {
- return IS_IOS ? new Date().getTime() : performance.now();
+ return performance.now();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698