MetaMask / metamask-snaps-beta

Fork of MetaMask that supports plugins! Read the Wiki!
https://github.com/MetaMask/metamask-snaps-beta/wiki
MIT License
143 stars 57 forks source link

Can't connect to a plugin in Firefox #108

Closed xuhcc closed 4 years ago

xuhcc commented 4 years ago

Describe the bug

Metamask can't connect to a locally hosted plugin in Firefox:

MetaMask - RPC Error: Problem loading plugin http://localhost:8081/package.json: NetworkError when attempting to fetch resource. 
{…}
​code: -32603
​data: Object { originalError: {} }
​message: "Problem loading plugin http://localhost:8081/package.json: NetworkError when attempting to fetch resource."
​stack: "_add@moz-extension://c34e7a7b-b3cb-40de-98b9-058c052ca5d2/background.js:1:51840\n"
​<prototype>: Object { … }

To Reproduce

  1. Build Firefox extension from develop branch.
  2. Create a new 'Hello World' plugin with Snaps CLI.
  3. Open plugin page in Firefox, press 'Connect' button.
  4. Press 'Submit' in popup window.

Expected behavior

Metamask should connect to a plugin.

Browser details (please complete the following information):

Additional context

I solved it by adding http://localhost/* to the manifest.json:permissions array.

rekmarks commented 4 years ago

@xuhcc, thank you for bringing this to our attention. We're deploying a fix here: https://github.com/MetaMask/metamask-snaps-beta/pull/109