diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-08-17 07:46:44 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-08-17 07:46:44 +0800 |
commit | 030bdec27a95390207b9147c95b810893756db6d (patch) | |
tree | 459f0411c7f57b7ae86dce77a8dc71c55fef257b /app/scripts/lib | |
parent | 4ba90969ee8fa9b9e21e88f5c6f0d646874049a3 (diff) | |
download | tangerine-wallet-browser-030bdec27a95390207b9147c95b810893756db6d.tar tangerine-wallet-browser-030bdec27a95390207b9147c95b810893756db6d.tar.gz tangerine-wallet-browser-030bdec27a95390207b9147c95b810893756db6d.tar.bz2 tangerine-wallet-browser-030bdec27a95390207b9147c95b810893756db6d.tar.lz tangerine-wallet-browser-030bdec27a95390207b9147c95b810893756db6d.tar.xz tangerine-wallet-browser-030bdec27a95390207b9147c95b810893756db6d.tar.zst tangerine-wallet-browser-030bdec27a95390207b9147c95b810893756db6d.zip |
Unify notification and popup ui files
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/extension-instance.js | 6 | ||||
-rw-r--r-- | app/scripts/lib/is-popup-or-notification.js | 8 | ||||
-rw-r--r-- | app/scripts/lib/notifications.js | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/app/scripts/lib/extension-instance.js b/app/scripts/lib/extension-instance.js index eb3b8a1e9..d284895bc 100644 --- a/app/scripts/lib/extension-instance.js +++ b/app/scripts/lib/extension-instance.js @@ -42,6 +42,12 @@ function Extension () { } catch (e) {} try { + if (browser[api]) { + _this[api] = browser[api] + } + } + + try { _this.api = browser.extension[api] } catch (e) {} diff --git a/app/scripts/lib/is-popup-or-notification.js b/app/scripts/lib/is-popup-or-notification.js new file mode 100644 index 000000000..5c38ac823 --- /dev/null +++ b/app/scripts/lib/is-popup-or-notification.js @@ -0,0 +1,8 @@ +module.exports = function isPopupOrNotification() { + const url = window.location.href + if (url.match(/popup.html$/)) { + return 'popup' + } else { + return 'notification' + } +} diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 75fb60dd0..e6bdeff09 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -31,7 +31,7 @@ function createMsgNotification (state) { } function showNotification() { - chrome.windows.create({ + extension.windows.create({ url:"notification.html", type:"panel", width:360, |