Google Chrome Javascript调试器和内容脚本 [英] Google Chrome Javascript Debugger and Content Scripts

查看:151
本文介绍了Google Chrome Javascript调试器和内容脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题同样被要求在之前

a>,但我似乎无法在Google Chrome中调试Javascript。


$ b

如果我去Page> Developer>调试Javascript( Ctrl < kbd> + Shift + L )被禁用。 我正在开发'内容脚本'扩展程序, m使用启用chrome - enable-extensions



我最想做的事情是设置断点并在脚本执行时执行/执行/执行。当谈到JavaScript的时候,我有些茫然不知所措,因此任何指导都是值得赞赏的。



我可以访问'JavaScript控制台',但无法找到里面的内容脚本。我也不确定这与'JavaScript调试器'有什么不同。



我在Windows XP上使用最新的Chrome版本(2.0.181.1)。

解决方案

这些答案似乎都过时了,因为这在google中排名很高,日期回答:



在Chrome中按下 CTRL + SHIFT + i 来调出开发者工具。



选择'Sources'



点击小箭头,您可以从脚本中选择

然后选择'内容脚本'





然后,您需要知道您的扩展程序的id(可从chrome manage extensions页面获得)以便正常访问您的脚本并进行调试。


This question has been asked similarly before, but I can't seem to debug Javascript in Google Chrome.

If I go to Page > Developer the "Debug Javascript" (Ctrl+Shift+L) is disabled. Alt + ` doesn't work.

I'm developing a 'content script' extension so I'm launching chrome with --enable-extensions.

What I'd ideally like to do is set breakpoints and step/run through my script as it executes. I'm a little over my head when it comes to JavaScript, so any guidance is appreciated.

I can get to the 'JavaScript Console,' but can't find the content scripts inside of that. I'm also not sure how that differs from the 'JavaScript Debugger.'

I'm using the latest Dev build of Chrome (2.0.181.1) on Windows XP.

解决方案

These answers all seem to be out of date, and since this is ranking highly in google, here's the up-to-date answer:

In Chrome press CTRL+SHIFT+i to bring up the developer tools.

Select 'Sources'

Click the small arrow that allows you to select from the scripts

Then select 'Content scripts'

You'll then need to know the id of your extension (available from the chrome manage extensions page) to get to your scripts and debug them as normal.

这篇关于Google Chrome Javascript调试器和内容脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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