Chrome 扩展程序弹出窗口、图片和链接不起作用
我正在编写一个 chrome 扩展,当按下按钮时会创建一个弹出窗口。弹出窗口是一个简单的 HTML 文件,其中包含链接和图像。当我按下弹出窗口上的链接时,没有任何反应,图片显示为空的白框。有谁知道我该如何解决这个问题?如果有影响的话,图片文件会保存在扩展文件夹中。
太感谢了!
I'm writing a chrome extension that creates a popup when the button is pressed. The popup is a simple HTML file that includes links and images. When I press the links on the popup nothing happens, and the pictures show up as empty white boxes. Does anyone know how I could fix this? The picture files are saved in the extension folder if that makes a difference.
Thank you so much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您很可能正在处理两个不同的问题。
对于无效链接,最简单的处理方法是添加到弹出窗口的 HEAD 部分或每个链接的特定目标。
例如,其他方法涉及将 onclick javascript 事件关联起来,以打开新的浏览器选项卡与关联的 url。
Most probably you're dealing with two different issues.
Regarding the non working links, the simplest way to deal with it is to add to the HEAD section of your popup or a specific target to each link.
Other approach, for instance, involves associating onclick javascript events to open new browser tabs with the associated url.
您是否在 http://code.google 上查看了有关如何编写扩展程序的入门教程.com/chrome/extensions/getstarted.html?
它拥有您完成编写几乎完全相同的扩展的基础知识所需的一切。还有一个调试扩展的链接,希望可以帮助您确定是否还有其他问题发生。
谢谢!
聚乙二醇
Did you check out the Getting Started Tutorial about how to write extensions at http://code.google.com/chrome/extensions/getstarted.html?
It's got everything you need to walk through the basics of writing an extension that does almost exactly that. There's also a link to debugging extensions, which will hopefully help you to figure out if it's something else that's going on.
Thanks!
PEte