fiatjaf / nos2x

nostr signer extension
278 stars 55 forks source link

Denying load / Resources must be listed in the web_accessible_resources manifest key #51

Closed laantungir closed 10 months ago

laantungir commented 10 months ago

I'm getting the following error in the console of both Chrome, and Ungoogled Chromium in PopOS Linux:

Denying load of chrome-extension://kpgefcfmnafjgpblomihpgmejjdanjjp/nostr-provider.js. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.

Using the following web page:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

<script>
console.log(window.nostr)
</script>

</body>
</html>

Also, window.nostr returns undefined.

Screenshot from 2023-10-26 10-33-21

fiatjaf commented 10 months ago

But it is there already: https://github.com/fiatjaf/nos2x/blob/9c9d591b46c03c64349911c1c6d14ac22bd985b9/extension/manifest.json#L32

laantungir commented 10 months ago

I'm sorry, I guess I'm not following. How do I access window.nostr, and how do I get rid of the errors?

Thanks.

fiatjaf commented 10 months ago

I don't know. What I know is that your suggestion is already implemented.

I think you may be trying to use the extension in a page that isn't hosted under https, maybe?

laantungir commented 10 months ago

Ahhh, that was it. You have to be using https.

Thanks!