metamask源码学习-contentscript.js】的更多相关文章

When a new site is visited, the WebExtension creates a new ContentScript in that page's context, which can be seen at app/scripts/contentscript.js. This script represents a per-page setup process, which creates the per-page web3api, connects it to th…
The most confusing part about porting MetaMask to a new platform is the way we provide the Web3 API over a series of streams between contexts. Once you understand how we create the InpageProvider in the inpage.js script, you will be able to understan…
这个就是浏览器后台所进行操作的地方了,它就是页面也区块链进行交互的中间部分. metamask-background描述了为web扩展单例的文件app/scripts/background.js.该上下文实例化了一个MetaMask控制器的实例,该实例表示用户的帐户.到区块链的连接以及与新Dapps的交互. Since background.js is essentially the Extension setup file, we can see it doing all the things…
The UI-即上图左下角metamask-ui部分,即其图形化界面 The MetaMask UI is essentially just a website that can be configured by passing it the API and state subscriptions from above. Anyone could make a UI that consumes these, effectively reskinning MetaMask. MetaMask UI…
()MetaMask Browser Extension https://github.com/MetaMask/metamask-extension 这就是整个metamask的源码所在之处,好好看看 https://metamask.github.io/metamask-extension/这是源码的类.对象等的详细解释 1)了解整个代码的学习流程,看:https://github.com/MetaMask/metamask-extension/blob/develop/docs/porti…
()metamask-extension/app/scripts/controllers/transactions Transaction Controller is an aggregate of sub-controllers and trackers exposed to the MetaMask controller. 交易控制器是暴露于metamask控制器的子控制器和跟踪器的集合 txStateManager responsible for the state of a transa…
The MetaMask Controller——The central metamask controller. Aggregates other controllers and exports an api. The core functionality of MetaMask all lives in what we call The MetaMask Controller. Our goal for this file is for it to eventually be its own…
https://github.com/MetaMask/metamask-extension/tree/master/app/scripts/controllers/network metamask-extension/app/scripts/controllers/network/network.js const assert = require('assert') const EventEmitter = require('events') const createMetamaskProvi…
学习源码,除了学习对一些方法的更加聪明的代码实现,同时也要学习源码的设计,把握整体的架构.(推荐对源码有一定熟悉了之后,再看这篇文章) 目录结构:第一部分:zepto 设计分析第二部分:underscore 设计分析 第一部分: zepto 设计分析zepto 是一个轻量级的 Javascript 库.相对于 jquery 来说在 size 上更加小,主要是定位于移动设备.它是非常好的学习源码的入门级 javascript 库.这里重点说一下,这个库的设计,而对于详细的源码学习大家可以 star…
上接 Underscore.js 源码学习笔记(上) === 756 行开始 函数部分. var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prot…