加载chrome扩展程序弹出窗口更快

编程入门 行业动态 更新时间:2024-10-28 10:27:27
本文介绍了加载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" }

推荐答案

与任何异步调用一样,返回它可能需要花费不确定的时间.一种干净的解决方案是简单地添加将图标加载到您的main.html.在加载iframe之后,只需隐藏加载图标即可.

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扩展程序弹出窗口更快

本文发布于:2023-08-06 05:18:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1310291.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:更快   弹出窗口   加载   程序   chrome

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!