Last active
June 21, 2023 18:40
-
-
Save Splaktar/8198776 to your computer and use it in GitHub Desktop.
Enable Firebug Lite in a JavaFX WebView.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isDebugging()) | |
engine.documentProperty().addListener(new ChangeListener<Document>() { | |
@Override | |
public void changed(ObservableValue<? extends Document> prop, | |
Document oldDoc, Document newDoc) { | |
enableFirebug(engine); | |
} | |
}); | |
/** | |
* Enables Firebug Lite for debugging a webEngine. | |
* @param engine the webEngine for which debugging is to be enabled. | |
*/ | |
private static void enableFirebug(final WebEngine engine) { | |
engine.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');}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the webiste mentioned in this code canot be accessed any more.
after some search i got this one
https://cdn.bootcdn.net/ajax/libs/firebug-lite/1.4.0/firebug-lite.js
from https://blog.csdn.net/m0_60688978/article/details/127660395