本文介绍了如何使用DOM Inspector(或类似的)检查我的独立Xul应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我试图检查独立的Xul应用程序,但 DOM Inspector 如何检查我的独立XUL应用程序?解析方案 DOM Inspector只能检查其主机应用程序中的文档 - 它正在扩展的应用程序(只有安装到其中的配置文件)。如果您想检查XULRunner应用程序,您需要安装DOM Inspector。 $ b $ b 如果Add- ons Manager尚未启用,请将这两行添加到您的application.ini中: [XRE] EnableExtensionManager = 1 我假设你正在开发一个XULRunner应用程序,你已经有Error Console从您的应用程序访问。打开它并粘贴到那里打开附加组件管理器: $ p $ window.openDialog(chrome:// mozapps / content / extensions / extensions.xul,,chrome,dialog = no,resizable = yes); 在这里,点击Install ...,找到系统上的DOM Inspector XPI,您的XULRunner应用程序的当前配置文件。 您现在应该能够通过-inspector开关从命令行启动DOM Inspector,但是您可能需要一种方法来打开它从您的应用程序。 < script type =application / javascript包含DOM Inspector启动器钩子, src =chrome://inspector/content/hooks.js/> 现在添加一个XUL按钮,menuitem等等属性 oncommand =inspectDOMDocument(); 或者您可以使 $ p> 按需= inspectDOMDocument(文件); 这将使得DOM Inspector默认检查应用程序的文档。 b $ b [1]: https://developer.mozilla.org/zh/XULRunner_tips #DOM_Inspector XULRunner提示。 MDC。 I'm trying to inspect my standalone Xul app, but the DOM Inspector's page talks just about documents loaded on the browser.How can I inspect my standalone Xul app? 解决方案 DOM Inspector can only inspect documents from its host application—the application it's extending (and then only the profile it's installed into). You need to install DOM Inspector on your XULRunner app if you want to be able to inspect it.There's some documentation about how to get DOM Inspector installed on XULRunner apps,[1] and it looks correct from a quick look, but it's way overkill, especially if you already have the Add-on Manager enabled in your app.If the Add-ons Manager isn't already enabled, add these two lines to your your application.ini:[XRE]EnableExtensionManager=1I'm assuming since you are developing a XULRunner app, you already have the Error Console accessible from your app. Open it up and paste this there to open the Add-ons Manager:window.openDialog("chrome://mozapps/content/extensions/extensions.xul", "", "chrome,dialog=no,resizable=yes");From there, click "Install…" and find the DOM Inspector XPI on your system to install it to your XULRunner app's current profile.You should now be able to launch DOM Inspector from the command line with "-inspector" switch, but you probably want a way to open it from within your app. Include the DOM Inspector launcher hooks by adding the following line to your app's XUL:<script type="application/javascript" src="chrome://inspector/content/hooks.js"/>Now add a XUL button, menuitem, et cetera with the attributeoncommand="inspectDOMDocument();"Or you can make thatoncommand="inspectDOMDocument(document);"This will make DOM Inspector default to inspecting the app's document.[1]: https://developer.mozilla.org/en/XULRunner_tips#DOM_Inspector "XULRunner tips". MDC. 这篇关于如何使用DOM Inspector(或类似的)检查我的独立Xul应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-11 00:04