1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Documentation for environemnt-type.js

This commit is contained in:
Dan 2018-04-12 13:17:46 -02:30
parent 29dab1e9e0
commit 8fb1237d64

View File

@ -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$/)) {