JAVAFX/WebView/WebEngine FireBugLite 还是其他一些调试器? [英] JAVAFX / WebView / WebEngine FireBugLite or Some other debugger?

查看:34
本文介绍了JAVAFX/WebView/WebEngine FireBugLite 还是其他一些调试器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,需要在应用程序的 WebView/WebEngine 部分运行调试器,以便更好地调试我的应用程序.但是我在互联网上找到的用于注入 Firebug Lite 的代码由于某种原因不起作用.

I am developing an app and need to run a debugger on the WebView/WebEngine part of the application so I can better debug my application. But the code I found across the internet to inject Firebug Lite is not working for some reason.

如果我在 Firefox 控制台上运行 Javascript 代码本身可以正常工作,但当通过 JavaFX webview/webengine 执行相同的代码时则不行.netbeans 控制台不会抛出任何其他错误......所以我不确定为什么 FirebugLite UI 没有呈现/加载.

The Javascript code itself works fine if I run it on the Firefox Console, but not when the same code is executed through the JavaFX webview/webengine. The netbeans console doesn't throw any errors others... so I am not sure why the FirebugLite UI is not rendering/loading.

这是什么原因,还有其他选择吗?

What could be causing this, any other alternatives?

我使用的是 JavaFX 2.2

I'm using JavaFX 2.2

//不起作用....

webView.getEngine().executeScript("if (!document.getElementById('FirebugLite')){E = document['createElement' + 'NS'] && document.documentElement.namespaceURI;E = E ? document['createElement' + 'NS'](E, 'script') : document['createElement']('script');E['setAttribute']('id', 'FirebugLite');E['setAttribute']('src', 'https://getfirebug.com/' + 'firebug-lite.js' + '#startOpened');E['setAttribute']('FirebugLite', '4');(document['getElementsByTagName']('head')[0] || document['getElementsByTagName']('body')[0]).appendChild(E);E = new Image;E['setAttribute']('src', 'https://getfirebug.com/' + '#startOpened');}"); 

推荐答案

我解决了这个问题.FirebugLite 的当前稳定版本似乎适用于传统浏览器,但有些不同之处使其无法用于 JAVAFX WebView 查看的应用程序.

I was able to fix the problem. It seems like the current stable version of FirebugLite works well for traditional browsers but something is different that makes it fail for an application viewed by the JAVAFX WebView.

我可以使用 FirebugLite 的未压缩版本将 Firebug 添加到我的应用程序中

I was able to add Firebug to my application by using an uncompressed version of FirebugLite

<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>

解决方案来自:使用 Firebug Lite 测试 IE6

这篇关于JAVAFX/WebView/WebEngine FireBugLite 还是其他一些调试器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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