加载chrome扩展程序弹出窗口更快 [英] load chrome extension popup faster

查看:158
本文介绍了加载chrome扩展程序弹出窗口更快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的chrome扩展程序非常简单.单击弹出窗口后,将加载iframe. chrome扩展程序有点慢.我单击该图标,大约需要一秒钟半的时间来加载,我觉得那太慢了.我希望弹出窗口立即显示,但是之后会加载iframe.或者也许有一种更快的方法...我正在格式化的网站上只有一个可见的文本框,因此从理论上讲,弹出窗口应该很快加载,但是我只是不明白.

My chrome extension is very simple. After the popup is clicked an iframe is loaded. The chrome extension is slightly slow. I click the icon and it takes about a second and a half to load, and I feel like that is too slow. I'd like the popup to show instantly but have the iframe load after.. or perhaps there is an even quicker way... The site that I am iframing only has a textbox visible so in theory the popup should load pretty quickly but I'm just not getting it.

我的清单文件基本上是:

My manifest file basically is:

"browser_action": {
"default_icon": "icon128.png",
"default_popup": "main.html"
 },
   "background": {
    "page": "main.html"
  }

推荐答案

与任何异步调用一样,返回它可能需要花费不确定的时间.一种干净的解决方案是简单地添加

As any async call, it may take an undeterminable amount of time to return. One clean solution would be to simply add a loading icon to your main.html. And after the iframe loads simply hide the loading icon.

它应该有助于改善用户体验,因为他们在单击图标后至少可以立即看到某些内容.

It should help with the user experience as they'll be able to see at least something right after clicking the icon.

这篇关于加载chrome扩展程序弹出窗口更快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆