diff options
author | bitpshr <mail@bitpshr.net> | 2018-11-08 00:11:08 +0800 |
---|---|---|
committer | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-11-08 00:47:25 +0800 |
commit | 1ce3591c8ea844eab2dbd9b585e7f5dd3cf18ce8 (patch) | |
tree | b309e5acd0d5c9e5ff93a45c3d6e7879530b4472 /app/scripts/contentscript.js | |
parent | 0ab5c1c6e2ef5adb2f33d2e0e85e2f84b2edfeef (diff) | |
download | tangerine-wallet-browser-1ce3591c8ea844eab2dbd9b585e7f5dd3cf18ce8.tar tangerine-wallet-browser-1ce3591c8ea844eab2dbd9b585e7f5dd3cf18ce8.tar.gz tangerine-wallet-browser-1ce3591c8ea844eab2dbd9b585e7f5dd3cf18ce8.tar.bz2 tangerine-wallet-browser-1ce3591c8ea844eab2dbd9b585e7f5dd3cf18ce8.tar.lz tangerine-wallet-browser-1ce3591c8ea844eab2dbd9b585e7f5dd3cf18ce8.tar.xz tangerine-wallet-browser-1ce3591c8ea844eab2dbd9b585e7f5dd3cf18ce8.tar.zst tangerine-wallet-browser-1ce3591c8ea844eab2dbd9b585e7f5dd3cf18ce8.zip |
wip
Diffstat (limited to 'app/scripts/contentscript.js')
-rw-r--r-- | app/scripts/contentscript.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 1a10cdb34..efb14233d 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -151,20 +151,20 @@ function listenForProviderRequest () { switch (action) { case 'approve-provider-request': isEnabled = true - injectScript(`window.dispatchEvent(new CustomEvent('ethereumprovider', { detail: {}}))`) + window.postMessage({ type: 'ethereumprovider' }, '*') break case 'reject-provider-request': - injectScript(`window.dispatchEvent(new CustomEvent('ethereumprovider', { detail: { error: 'User rejected provider access' }}))`) + window.postMessage({ type: 'ethereumprovider', error: 'User rejected provider access' }, '*') break case 'answer-is-approved': - injectScript(`window.dispatchEvent(new CustomEvent('ethereumisapproved', { detail: { isApproved: ${isApproved}, caching: ${caching}}}))`) + window.postMessage({ type: 'ethereumisapproved', isApproved, caching }, '*') break case 'answer-is-unlocked': - injectScript(`window.dispatchEvent(new CustomEvent('metamaskisunlocked', { detail: { isUnlocked: ${isUnlocked}}}))`) + window.postMessage({ type: 'metamaskisunlocked', isUnlocked }, '*') break case 'metamask-set-locked': isEnabled = false - injectScript(`window.dispatchEvent(new CustomEvent('metamasksetlocked', { detail: {}}))`) + window.postMessage({ type: 'metamasksetlocked' }, '*') break } }) |