Chrome扩展程序:如何以编程方式检查扩展程序的后台页面 [英] Chrome extension: how to programmatically inspect extension's background page
本文介绍了Chrome扩展程序:如何以编程方式检查扩展程序的后台页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用Chrome扩展API以编程方式打开Chrome扩展程序后台页面的开发人员工具窗口?
How does one programmatically open the Developer Tools window of a Chrome extension's background page using the Chrome Extensions API?
实际上,我希望获得手动点击给定Chrome扩展程序的检查后台页面链接的程序化功能。
Essentially, I'm looking to achieve the programmatic equivalent of manually clicking on the "inspect background page" link of a given Chrome extension.
推荐答案
有趣的问题。
我不认为有办法做到这一点; Google自己的应用 Chrome Apps&扩展程序开发者工具,为此使用私人 API:
I don't think there is a way to do it; Google's own app, Chrome Apps & Extensions Developer Tool, uses a private API for this:
// Opens the devtools inspect window for the page.
chrome.developerPrivate.inspect({
extension_id: String(item.id),
render_process_id: String(view.render_process_id),
render_view_id: String(view.render_view_id),
incognito: view.incognito,
});
显然,这只适用于特别列入白名单的应用程序和扩展名。
Obviously, this only works in specially-whitelisted apps and extensions.
这篇关于Chrome扩展程序:如何以编程方式检查扩展程序的后台页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文