无法在开发人员工具窗口中查看内容脚本引用 [英] Unable to view content script references in the developer tools window

查看:218
本文介绍了无法在开发人员工具窗口中查看内容脚本引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用开发人员工具查看我的扩展名时,我只看到生成的后台文件background.js;我的内容脚本不会显示在内容脚本选项卡下。任何想法为什么?清单的相关部分如下所示:

 content_scripts:[{
run_at:document_end ,
js:[postMsg.js],
matches:[https://groups.google.com/forum/*]
}],

postMsg.js注入页面,但不会显示在开发人员工具窗口中, m无法调试。

解决方案

只要你在一个与






有关匹配的更多信息


When I view my extension with the developer tools, I only see the generated background file, background.js; my content script doesn't appear under the content scripts tab. Any ideas why? The relevant part of the manifest looks like this:

"content_scripts": [{
"run_at": "document_end",
"js": ["postMsg.js"],
"matches": ["https://groups.google.com/forum/*"]
}],

postMsg.js gets injected into the page, but never appears in the developer tool window, so I'm unable to debug it.

解决方案

As long as you are on a page that matches the "Match patterns and globs" from your manifest, you will see the content script(s) under the Sources -> Content Scripts pane.
You may need to refresh (F5) the page (and/or your extension, then the page) to see it:

(Click for larger image)


For more information on matching that cryptic number to an extension, see this answer.

这篇关于无法在开发人员工具窗口中查看内容脚本引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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