首页 > 其他分享 >开发谷歌插件--web3钱包(一)

开发谷歌插件--web3钱包(一)

时间:2022-12-05 18:11:07浏览次数:37  
标签:插件 popup -- js web3 钱包 唤起 页面

之前开发了一款谷歌插件,因为很简单没有什么好记录的。

这次记录下一款新的钱包功能的插件,其中遇到的问题,以及解决方案。

首先遇到的问题就是唤醒:

小狐狸钱包应该都用过,点击图标就会唤起登录页面(popup),而且你的网页访问小狐狸钱包的时候也会调起那个页面。

但是我找了谷歌的文档并没有发现有这个功能,后来在多次对比了样式之后,发现小狐狸并没有主动唤起popup的那个页面。

除了点击头像外,你调用js主动唤起的是另一个background的页面,这两个页面一样,所以会以为是同一个页面。

 

唤醒的问题解决了,那么另一个问题就来了,background的配置里面与页面相关的有两个配置:

1、script      2、page

script可以配置多个js,会自动生成页面,但是这多个js都会加载到一个页面里面去,而且不能自定义页面名称

page只能配置一个页面,不支持多个

最坑爹的来了,这两个配置只能二选一

主动唤起的页面是悬浮的,跟之前的小页面一样的大小,而我们后面一些功能的页面有全屏的页面,这个就很难搞了。

目前没得找到解决办法,只能舍弃其中一个页面,将其集中到另一个里面。

还有就是如何新开一个浏览器的问题,然后把浏览器定位到popup页面的位置上去。

标签:插件,popup,--,js,web3,钱包,唤起,页面
From: https://www.cnblogs.com/sixrookie/p/16953072.html

相关文章

  • LeetCode: 322. Coin Change
    LeetCode:322.CoinChange题目描述Youaregivencoinsofdifferentdenominationsandatotalamountofmoneyamount.Writeafunctiontocomputethefewestnum......
  • LeetCode:295. Find Median from Data Stream
    LeetCode:295.FindMedianfromDataStream题目描述Medianisthemiddlevalueinanorderedintegerlist.Ifthesizeofthelistiseven,thereisnomiddleval......
  • LeetCode:282. Expression Add Operators
    LeetCode:282.ExpressionAddOperators题目描述Givenastringthatcontainsonlydigits0-9andatargetvalue,returnallpossibilitiestoaddbinaryoperators......
  • LeetCode:224.Basic Calculator
    LeetCode:224.BasicCalculator题目描述Implementabasiccalculatortoevaluateasimpleexpressionstring.Theexpressionstringmaycontainopen​​(​​​and......
  • LeetCode: 221. Maximal Square
    LeetCode:221.MaximalSquare题目描述Givena2Dbinarymatrixfilledwith​​0​​​'sand​​1​​​'s,findthelargestsquarecontainingonly​​1​​'s......
  • LeetCode: 223. Rectangle Area
    LeetCode:223.RectangleArea题目描述Findthetotalareacoveredbytworectilinearrectanglesina2Dplane.Eachrectangleisdefinedbyitsbottomleftcorne......
  • LeetCode: 225. Implement Stack using Queues
    LeetCode:225.ImplementStackusingQueues题目描述Implementthefollowingoperationsofastackusingqueues.​​push(x)​​–Pushelementxontostack.​......
  • LeetCode: 232. Implement Queue using Stacks
    LeetCode:232.ImplementQueueusingStacks题目描述Implementthefollowingoperationsofaqueueusingstacks.​​push(x)​​​–Pushelementxtothebacko......
  • LeetCode: 227. Basic Calculator II
    LeetCode:227.BasicCalculatorII题目描述Implementabasiccalculatortoevaluateasimpleexpressionstring.Theexpressionstringcontainsonlynon-negative......
  • LeetCode: 239. Sliding Window Maximum
    LeetCode:239.SlidingWindowMaximum题目描述Givenanarraynums,thereisaslidingwindowofsizekwhichismovingfromtheveryleftofthearraytotheve......