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

查看:775
本文介绍了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

//不起作用....

// Doesn't work....

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天全站免登陆