如何访问.log .info。从Services.console警告功能 [英] How to access .log .info. warn functions from Services.console

查看:92
本文介绍了如何访问.log .info。从Services.console警告功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的插件作用域中,我试图使用 console.log console.info 等,请参见此处 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屋!

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