Revert "get rid of polyfill since this is just chrome anyway."

This reverts commit a935a8c026.
This commit is contained in:
fiatjaf
2022-12-18 14:42:18 -03:00
parent 166f8a39bb
commit 6911f4b25b
10 changed files with 55 additions and 53 deletions

View File

@@ -1,9 +1,10 @@
import browser from 'webextension-polyfill'
// inject the script that will provide window.nostr
let script = document.createElement('script')
script.setAttribute('async', 'false')
script.setAttribute('type', 'text/javascript')
script.setAttribute('src', chrome.runtime.getURL('nostr-provider.js'))
script.setAttribute('src', browser.runtime.getURL('nostr-provider.js'))
document.head.appendChild(script)
// listen for messages from that script
@@ -16,7 +17,7 @@ window.addEventListener('message', async message => {
// pass on to background
var response
try {
response = await chrome.runtime.sendMessage({
response = await browser.runtime.sendMessage({
type: message.data.type,
params: message.data.params,
host: location.host