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

Unified Diff: ui/webui/resources/js/cr.js

Issue 2138183002: [ios] Added cr.isIOS function to use in WebUI pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing comma, s/navigator.userAgent/navigator.platform 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: ui/webui/resources/js/cr.js
diff --git a/ui/webui/resources/js/cr.js b/ui/webui/resources/js/cr.js
index 090cfd94f7d7067fbfeca0ed4e0a44c97294d7a9..3c1b75ec09a88217c47a756253eafb2c0797141d 100644
--- a/ui/webui/resources/js/cr.js
+++ b/ui/webui/resources/js/cr.js
@@ -475,6 +475,11 @@ var cr = cr || function() {
/** Whether this is on Android. */
get isAndroid() {
return /Android/.test(navigator.userAgent);
+ },
+
+ /** Whether this is on iOS. */
+ get isIOS() {
+ return /iPad|iPhone|iPod/.test(navigator.platform);
}
};
}();
« 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