2018-04-17 08:03:47 +02:00
|
|
|
const ENVIRONMENT_TYPE_POPUP = 'popup'
|
|
|
|
const ENVIRONMENT_TYPE_NOTIFICATION = 'notification'
|
|
|
|
const ENVIRONMENT_TYPE_FULLSCREEN = 'fullscreen'
|
Close window after opening fullscreen (#6966)
* Add background environment type
The `getEnvironmentType` method now checks for the background
environment as well, instead of returning 'notification' for that case.
Instead of adding another regex for the background path, the regexes
for each environment have been replaced with the URL constructor[0].
This is the standard method of parsing URLs, and is available in all
supported browsers.
[0]: https://developer.mozilla.org/en-US/docs/Web/API/URL
* Add note regarding a missing manifest permission
The `url` parameter to `tabs.query(...)` requires the `tabs` permission,
and will be ignored otherwise. We are missing this permission, so that
call does not work.
* Close window after opening full screen
The browser behaviour when opening a new tab differs between Chrome and
Firefox. In the case of a popup, Chrome will close the popup whereas
Firefox will leave it open. In the case of the notification window,
Chrome will move the new tab to the foreground, whereas Firefox will
leave the notification window in the foreground when opening a new tab.
We always want to close the current UI (popup or notification) when
switching to a full-screen view. The only exception to this is when the
switch is triggered from the background, which has no UI.
Closes #6513, #6685
2019-08-08 16:50:32 +02:00
|
|
|
const ENVIRONMENT_TYPE_BACKGROUND = 'background'
|
2018-04-17 08:03:47 +02:00
|
|
|
|
2018-08-08 09:00:39 +02:00
|
|
|
const PLATFORM_BRAVE = 'Brave'
|
|
|
|
const PLATFORM_CHROME = 'Chrome'
|
|
|
|
const PLATFORM_EDGE = 'Edge'
|
|
|
|
const PLATFORM_FIREFOX = 'Firefox'
|
|
|
|
const PLATFORM_OPERA = 'Opera'
|
|
|
|
|
2019-09-10 02:31:34 +02:00
|
|
|
const MAINNET_CHAIN_ID = '0x1'
|
|
|
|
const ROPSTEN_CHAIN_ID = '0x3'
|
|
|
|
const RINKEBY_CHAIN_ID = '0x4'
|
|
|
|
const KOVAN_CHAIN_ID = '0x2a'
|
|
|
|
const GOERLI_CHAIN_ID = '0x5'
|
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
export {
|
2018-04-17 08:03:47 +02:00
|
|
|
ENVIRONMENT_TYPE_POPUP,
|
|
|
|
ENVIRONMENT_TYPE_NOTIFICATION,
|
|
|
|
ENVIRONMENT_TYPE_FULLSCREEN,
|
Close window after opening fullscreen (#6966)
* Add background environment type
The `getEnvironmentType` method now checks for the background
environment as well, instead of returning 'notification' for that case.
Instead of adding another regex for the background path, the regexes
for each environment have been replaced with the URL constructor[0].
This is the standard method of parsing URLs, and is available in all
supported browsers.
[0]: https://developer.mozilla.org/en-US/docs/Web/API/URL
* Add note regarding a missing manifest permission
The `url` parameter to `tabs.query(...)` requires the `tabs` permission,
and will be ignored otherwise. We are missing this permission, so that
call does not work.
* Close window after opening full screen
The browser behaviour when opening a new tab differs between Chrome and
Firefox. In the case of a popup, Chrome will close the popup whereas
Firefox will leave it open. In the case of the notification window,
Chrome will move the new tab to the foreground, whereas Firefox will
leave the notification window in the foreground when opening a new tab.
We always want to close the current UI (popup or notification) when
switching to a full-screen view. The only exception to this is when the
switch is triggered from the background, which has no UI.
Closes #6513, #6685
2019-08-08 16:50:32 +02:00
|
|
|
ENVIRONMENT_TYPE_BACKGROUND,
|
2018-08-08 09:00:39 +02:00
|
|
|
PLATFORM_BRAVE,
|
|
|
|
PLATFORM_CHROME,
|
|
|
|
PLATFORM_EDGE,
|
|
|
|
PLATFORM_FIREFOX,
|
|
|
|
PLATFORM_OPERA,
|
2019-09-10 02:31:34 +02:00
|
|
|
MAINNET_CHAIN_ID,
|
|
|
|
ROPSTEN_CHAIN_ID,
|
|
|
|
RINKEBY_CHAIN_ID,
|
|
|
|
KOVAN_CHAIN_ID,
|
|
|
|
GOERLI_CHAIN_ID,
|
2018-04-17 08:03:47 +02:00
|
|
|
}
|