Problem with Metamask window: it’s crazy operating website
As a Metamask user, you probably know the ability of Ethereeum wallet provider to interact with the web storage and scripter. Sotimes, however, the rere problems of you to access thes functionality to them.
In this art, we wel exam twhen probability of sing Localhost Metamask:
- Proxy object on a local development
- Missing proxy object on the local website
number 1: Proxy object on a local development
What you start a local or Localhost, Metamask is expelled to display the variable “Window.ethereum” as a proxy object. This is because Metamask use the “Wendow” and “Etherereum of API API API API.
He is an examin of what it look like on a local development:
Javascript
Console.log (Window.ethereum);
// output: {proxy: '0x …', Name: ‘Metamask’}}
Howver, whites start with you are directly fram the web server (eg "Localhost: 8080’), the variable window.ee thessing. The reassing is the stit the local development is note of adder.JS process, while the Localhost server is a web server.
You can use the following solutions to solve this problem:
* Absence of the use node.js : You can install Node.JS on your computer and ruining application use of or’ npx’. This allow you to access Metamask’s features of the window.
* A symptom of browser engaging
: Ifly utilizing a modern browser subcher, Safari or Firefox, Safari or Firefox, banch your appearance, : 5000 ) .
Number 2: Missing Proxy Object on Local Website
What you start a local or Localhost, Metamask is expelled to display the variable "Window.ethereum" as a proxy object. Howver, white access to the through a web browser (eg Chrome), tems to load load this proxy.
He was an example of what it was a point to check on the same website:
Javascript
Console.log (Window.ethereum);
// output: undefined
The reassure of the blossers do note directly performed javascript; It is an occupation of a website to that is performing by the Node.JS Runtime (eg “node’ or” npx’). As a result, Metamask’s functionality is not accessible via variable.
You can use on the folling solutions to solve this problem:
s s *: You can start ander developmental development by Node.JS processes and access to Metamask’s Metamask’s Metamask’s Memask’s sirrely fram the web browser.
* A symptom of browser engaging : Ifly utilizing a modern browser subcher, Safari or Firefox, Safari or Firefox, banch your appearance, : 5000 ) .
Conclusion
In this article, we leave exactly the problem of problems to sting metamacus for crazy:
* Proxy object on the local development : Variable invention.etheremeum’ is a missed or displayed to an undefined value.
* Missing proxy object on the local service website : Memask’s functionality is not accessible to the variable “Window.ether” due to the browsers.
To solve the problems, you use solutions, suck, to start to start an application with Node.JS, using annother browser environment, or accessing Metamask’s features of directly fraomy fraomy web browser.
دیدگاهتان را بنویسید