如何访问.log .info。从Services.console警告功能 [英] How to access .log .info. warn functions from Services.console
问题描述
在我的插件作用域中,我试图使用 console.log
和 console.info $ c之类的功能将消息记录到浏览器控制台中$ c>等,请参见此处 MDN-Web API接口-控制台
From my addon scope I am trying to log messages to the Browser Console with functions like console.log
and console.info
etc as seen here MDN - Web API Interfaces - Console
但是Services.jsm给了我 nsIConsoleService
。那么如何从nsIConsoleService(nsiconsoleservice上的文档: https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIConsoleService )
However Services.jsm gives me nsIConsoleService
. So how to access the functions above (web api console) from the nsIConsoleService (docs on nsiconsoleservice: https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIConsoleService)
推荐答案
弄清楚答案是 Console.jsm
这篇关于如何访问.log .info。从Services.console警告功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!