diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-08-05 14:43:02 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-08-05 14:43:02 +0800 |
commit | aaed44f1ec98e879ca08b1c73b2244a4f70438c4 (patch) | |
tree | aa76756d3d71d4005631d1109588f41ece637378 /app/vendor/trezor/usb-permissions.js | |
parent | f2194e8482203988909da75e0442e66840c0bcab (diff) | |
download | tangerine-wallet-browser-aaed44f1ec98e879ca08b1c73b2244a4f70438c4.tar tangerine-wallet-browser-aaed44f1ec98e879ca08b1c73b2244a4f70438c4.tar.gz tangerine-wallet-browser-aaed44f1ec98e879ca08b1c73b2244a4f70438c4.tar.bz2 tangerine-wallet-browser-aaed44f1ec98e879ca08b1c73b2244a4f70438c4.tar.lz tangerine-wallet-browser-aaed44f1ec98e879ca08b1c73b2244a4f70438c4.tar.xz tangerine-wallet-browser-aaed44f1ec98e879ca08b1c73b2244a4f70438c4.tar.zst tangerine-wallet-browser-aaed44f1ec98e879ca08b1c73b2244a4f70438c4.zip |
trezor v5 working on firefox
Diffstat (limited to 'app/vendor/trezor/usb-permissions.js')
-rw-r--r-- | app/vendor/trezor/usb-permissions.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/vendor/trezor/usb-permissions.js b/app/vendor/trezor/usb-permissions.js new file mode 100644 index 000000000..bdda062af --- /dev/null +++ b/app/vendor/trezor/usb-permissions.js @@ -0,0 +1,20 @@ +/* +Handling messages from usb permissions iframe +*/ + +window.addEventListener('message', event => { + if (event.data === 'usb-permissions-init') { + const iframe = document.getElementById('trezor-usb-permissions'); + iframe.contentWindow.postMessage({ + type: 'usb-permissions-init', + extension: chrome.runtime.id, + }, '*'); + } else if (event.data === 'usb-permissions-close') { + chrome.tabs.query({ + currentWindow: true, + active: true, + }, (tabs) => { + chrome.tabs.remove(tabs[0].id); + }); + } +});
\ No newline at end of file |