How to use console.log() to debug a Chrome extension?

给你一囗甜甜゛ 提交于 2019-11-29 02:37:01

问题


I'm trying to debug my Chrome extension using

console.log("message");

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.

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.


回答1:


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.



来源:https://stackoverflow.com/questions/16846081/how-to-use-console-log-to-debug-a-chrome-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!