summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/webapp/base.js')
-rw-r--r--remoting/webapp/base.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/remoting/webapp/base.js b/remoting/webapp/base.js
index d12db235..54f1984 100644
--- a/remoting/webapp/base.js
+++ b/remoting/webapp/base.js
@@ -112,6 +112,23 @@ base.values = function(dict) {
});
};
+/**
+ * @type {boolean|undefined}
+ * @private
+ */
+base.isAppsV2_ = undefined;
+
+/**
+ * @return {boolean} True if this is a v2 app; false if it is a legacy app.
+ */
+base.isAppsV2 = function() {
+ if (base.isAppsV2_ === undefined) {
+ var manifest = chrome.runtime.getManifest();
+ base.isAppsV2_ =
+ Boolean(manifest && manifest.app && manifest.app.background);
+ }
+ return base.isAppsV2_;
+};
/**
* Joins the |url| with optional query parameters defined in |opt_params|