aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/scripts/lib/environment-type.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/scripts/lib/environment-type.js b/app/scripts/lib/environment-type.js
index 7966926eb..f13a1574d 100644
--- a/app/scripts/lib/environment-type.js
+++ b/app/scripts/lib/environment-type.js
@@ -1,3 +1,12 @@
+/**
+ * Used to determine the window type through which the app is being viewed.
+ * - 'popup' refers to the extension opened through the browser app icon (in top right corner in chrome and firefox)
+ * - 'responsive' refers to the main browser window
+ * - 'notification' refers to the popup that appears in its own window when taking action outside of metamask
+ *
+ * @returns {string} A single word label that represents the type of window through which the app is being viewed
+ *
+ */
module.exports = function environmentType () {
const url = window.location.href
if (url.match(/popup.html$/)) {