如何使用console.log()调试Chrome扩展? [英] How to use console.log() to debug a Chrome extension?

查看:1000
本文介绍了如何使用console.log()调试Chrome扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用

I'm trying to debug my Chrome extension using

console.log("message");

我的扩展工作正常(大部分),我点击调用函数执行的按钮一些东西。每一个函数都作为一个consloe.log()调试行。

My extension works fine (for the most part), I'm clicking buttons that call function which perform something. Every function as a consloe.log() debug line.

如果我在chrome加载后打开了chrome控制台(ctrl + shift + i),它仍然是空的,无论如何我做的事。 Chrome设置为开发者模式。

If I open the chrome console (ctrl + shift + i) after chrome loads, it remains empty, no matter what I do. Chrome is set to developer mode.

推荐答案

确保您打开了正确的开发控制台。您需要转到背景页面控制台的生成的背景页面右键单击 - >检查弹出控制台的弹出。有一个很好的gif的类似问题的答案,我会链接它,如果我能找到它。

Make sure that you are opening the correct dev console. You need to go to the generated background page for the background page console and right click -> inspect popup for the popup console. There was an answer to a similar question with a nice gif, I will link it if I can find it.

这篇关于如何使用console.log()调试Chrome扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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