简体   繁体   English

扩展名.js文件未显示在Chrome调试程序中

[英]Extension .js files don't show up in Chrome debugger

When I right click on the icon for my extension-in-development and click Inspect Popup (or when I click the icon and choose "Inspect Element") and look under the "Sources" tab, my .js file is nowhere to be seen - only a long list of inspect-able files like apitest, devtools, json_schema, etc. I can, however, find the code through the Elements tab by following the link in the .html file, but that doesn't bring to anywhere where I can actual debugging. 当我右键单击我的扩展开发中的图标并单击Inspect Popup(或当我单击图标并选择“Inspect Element”)并查看“Sources”选项卡下时,我的.js文件无处可见 - 只有很长的可检查文件列表,如apitest,devtools,json_schema等。但是,我可以通过跟踪.html文件中的链接,通过Elements选项卡找到代码,但这不会带到任何地方我可以实际调试。

I've also loaded the "Hello, world" extension that Google's tutorial provides, and when I Inspect that one, its .js file is right there. 我还加载了Google教程提供的“Hello,world”扩展,当我检查那个时,它的.js文件就在那里。 I can't imagine what I've done differently from the tutorial example to cause this. 我无法想象我从教程示例中做了哪些不同的事情来导致这种情况。

It's Chrome version 22.0.1229.94 run in a Linux VM. 它是在Linux VM中运行的Chrome版本22.0.1229.94。 If there's any more information I should be providing, please let me know. 如果我需要提供更多信息,请告诉我。

Type location.reload(true) in the console. 在控制台中键入location.reload(true)。

http://developer.chrome.com/extensions/tut_debugging.html http://developer.chrome.com/extensions/tut_debugging.html

If I understand your question right, 如果我理解你的问题,

Under the sources tab, there are two more tabs, one says Sources and the other says Content scripts. 在sources选项卡下,还有两个选项卡,一个显示Sources,另一个显示Content script。 You need to click on the content scripts tab, and there you will find what you are looking for. 您需要单击内容脚本选项卡,然后您将找到所需内容。

在此输入图像描述

Okay So I figured it out, simply click on you extension icon, and a little dialog will pop up, then right click on it and click on inspect element. 好吧所以我想通了,只需点击你的扩展图标,弹出一个小对话框,然后右键单击它并点击inspect元素。 You can figure it out from there I reckon. 你可以从那里弄明白。 (My other answer would be good if it was a content script, but this is a popup script.) (如果是内容脚本,我的另一个答案会很好,但这是一个弹出脚本。)

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM