What is the public API for getting JavaFX WebView console events? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!What is the difference between public, protected, package-private and private in Java?Exporting non-public type through public APISpring Interceptors not firingWhy not use java.util.logging?Touch Events in webView - JavaFX“Not on FX application thread” exception with Netty and JavaFXSpontaneous NullPointerExceptions when firing EventsGet all stages on JavaFX scene graphJavaFx WebView video: onended eventMulti thread app hangs after executing onclickBtn
Did pre-Columbian Americans know the spherical shape of the Earth?
Is it OK to use the testing sample to compare algorithms?
Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?
Centre cell vertically in tabularx
Is there any significance to the prison numbers of the Beagle Boys starting with 176-?
Why can't fire hurt Daenerys but it did to Jon Snow in season 1?
How do you write "wild blueberries flavored"?
Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?
Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?
Vertical ranges of Column Plots in 12
Is this Kuo-toa homebrew race balanced?
The test team as an enemy of development? And how can this be avoided?
Sally's older brother
Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?
Short story about astronauts fertilizing soil with their own bodies
Find general formula for the terms
What is a more techy Technical Writer job title that isn't cutesy or confusing?
Is there a spell that can create a permanent fire?
Can the Haste spell grant both a Beast Master ranger and their animal companion extra attacks?
Is there a verb for listening stealthily?
As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?
How to make triangles with rounded sides and corners? (squircle with 3 sides)
Noise in Eigenvalues plot
Is the time—manner—place ordering of adverbials an oversimplification?
What is the public API for getting JavaFX WebView console events?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!What is the difference between public, protected, package-private and private in Java?Exporting non-public type through public APISpring Interceptors not firingWhy not use java.util.logging?Touch Events in webView - JavaFX“Not on FX application thread” exception with Netty and JavaFXSpontaneous NullPointerExceptions when firing EventsGet all stages on JavaFX scene graphJavaFx WebView video: onended eventMulti thread app hangs after executing onclickBtn
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want to log WebView console events. They sometimes pick up quirks in the underlying browser used and can help with troubleshooting.
It is possible to use an Sun implementation class to interact with the WebView console:
import
//...
WebConsoleListener.setDefaultListener((webView, message, lineNumber, sourceId) ->
LOGGER.info(() -> "WebConsoleListener: " + message + "[" + webEngine.getLocation() + ":" + lineNumber + "]")
);
However, com.sun.javafx.webkit.WebConsoleListener, is an implementation class and not part of the JavaFX public API.
What is the public API for getting JavaFX WebView console events?
Alternatively, what is the correct way to get these events for troubleshooting?
java javafx
add a comment |
I want to log WebView console events. They sometimes pick up quirks in the underlying browser used and can help with troubleshooting.
It is possible to use an Sun implementation class to interact with the WebView console:
import
//...
WebConsoleListener.setDefaultListener((webView, message, lineNumber, sourceId) ->
LOGGER.info(() -> "WebConsoleListener: " + message + "[" + webEngine.getLocation() + ":" + lineNumber + "]")
);
However, com.sun.javafx.webkit.WebConsoleListener, is an implementation class and not part of the JavaFX public API.
What is the public API for getting JavaFX WebView console events?
Alternatively, what is the correct way to get these events for troubleshooting?
java javafx
add a comment |
I want to log WebView console events. They sometimes pick up quirks in the underlying browser used and can help with troubleshooting.
It is possible to use an Sun implementation class to interact with the WebView console:
import
//...
WebConsoleListener.setDefaultListener((webView, message, lineNumber, sourceId) ->
LOGGER.info(() -> "WebConsoleListener: " + message + "[" + webEngine.getLocation() + ":" + lineNumber + "]")
);
However, com.sun.javafx.webkit.WebConsoleListener, is an implementation class and not part of the JavaFX public API.
What is the public API for getting JavaFX WebView console events?
Alternatively, what is the correct way to get these events for troubleshooting?
java javafx
I want to log WebView console events. They sometimes pick up quirks in the underlying browser used and can help with troubleshooting.
It is possible to use an Sun implementation class to interact with the WebView console:
import
//...
WebConsoleListener.setDefaultListener((webView, message, lineNumber, sourceId) ->
LOGGER.info(() -> "WebConsoleListener: " + message + "[" + webEngine.getLocation() + ":" + lineNumber + "]")
);
However, com.sun.javafx.webkit.WebConsoleListener, is an implementation class and not part of the JavaFX public API.
What is the public API for getting JavaFX WebView console events?
Alternatively, what is the correct way to get these events for troubleshooting?
java javafx
java javafx
asked Mar 9 at 0:32
Alain O'DeaAlain O'Dea
14.4k13458
14.4k13458
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can enable browser console logging via Java™ 2 platform's core logging facilities by adding this to logging.properties:
com.sun.webkit.WebPage.level = FINE
Make sure that a log handler with FINE or lower level is present in the logging configuration or the logs will be filtered before they are logged. Example:
handlers = java.util.logging.ConsoleHandler
.level = INFO
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.XMLFormatter
com.sun.webkit.WebPage.level = FINE
Here's a more in-depth explanation of how I figured that out:
WebConsoleListener#setDefaultListener(WebConsoleListener) calls WebPageClientImpl#setConsoleListener(WebConsoleListener).
WebPageClientImpl#setConsoleListener(WebConsoleListener) stores the listener in its static field consoleListener.
consoleListener is only interacted with by WebPageClientImpl#addMessageToConsole(String,int,String).
WebPageClientImpl#addMessageToConsole(String,int,String) overrides WebPageClient#addMessageToConsole(String,int,String).
WebPageClient#addMessageToConsole(String,int,String) is called by WebPage#fwkAddMessageToConsole(String,int,String). There are no other call sites in the code base at the time of this writing.
That same method logs the console information:
log.log(Level.FINE, "fwkAddMessageToConsole(): message = " + message
+ ", lineNumber = " + lineNumber + ", sourceId = " + sourceId);
That means you can get the logging you need by enabling FINE logging on com.sun.webkit.WebPage limiting the implementation-level dependency to logging configuration:
com.sun.webkit.WebPage.level = FINE
I could not find a public API for this.
Based on my review of the OpenJDK JFX repo source, there isn't a public API for this.
This solution is still not ideal as it depends on a private implementation classname, but that dependency is in a configuration file where if the implementation class changes or disappears, the impact is a loss of logging rather than a likely fatal NoClassDefFoundError or NoSuchMethodError.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072824%2fwhat-is-the-public-api-for-getting-javafx-webview-console-events%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can enable browser console logging via Java™ 2 platform's core logging facilities by adding this to logging.properties:
com.sun.webkit.WebPage.level = FINE
Make sure that a log handler with FINE or lower level is present in the logging configuration or the logs will be filtered before they are logged. Example:
handlers = java.util.logging.ConsoleHandler
.level = INFO
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.XMLFormatter
com.sun.webkit.WebPage.level = FINE
Here's a more in-depth explanation of how I figured that out:
WebConsoleListener#setDefaultListener(WebConsoleListener) calls WebPageClientImpl#setConsoleListener(WebConsoleListener).
WebPageClientImpl#setConsoleListener(WebConsoleListener) stores the listener in its static field consoleListener.
consoleListener is only interacted with by WebPageClientImpl#addMessageToConsole(String,int,String).
WebPageClientImpl#addMessageToConsole(String,int,String) overrides WebPageClient#addMessageToConsole(String,int,String).
WebPageClient#addMessageToConsole(String,int,String) is called by WebPage#fwkAddMessageToConsole(String,int,String). There are no other call sites in the code base at the time of this writing.
That same method logs the console information:
log.log(Level.FINE, "fwkAddMessageToConsole(): message = " + message
+ ", lineNumber = " + lineNumber + ", sourceId = " + sourceId);
That means you can get the logging you need by enabling FINE logging on com.sun.webkit.WebPage limiting the implementation-level dependency to logging configuration:
com.sun.webkit.WebPage.level = FINE
I could not find a public API for this.
Based on my review of the OpenJDK JFX repo source, there isn't a public API for this.
This solution is still not ideal as it depends on a private implementation classname, but that dependency is in a configuration file where if the implementation class changes or disappears, the impact is a loss of logging rather than a likely fatal NoClassDefFoundError or NoSuchMethodError.
add a comment |
You can enable browser console logging via Java™ 2 platform's core logging facilities by adding this to logging.properties:
com.sun.webkit.WebPage.level = FINE
Make sure that a log handler with FINE or lower level is present in the logging configuration or the logs will be filtered before they are logged. Example:
handlers = java.util.logging.ConsoleHandler
.level = INFO
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.XMLFormatter
com.sun.webkit.WebPage.level = FINE
Here's a more in-depth explanation of how I figured that out:
WebConsoleListener#setDefaultListener(WebConsoleListener) calls WebPageClientImpl#setConsoleListener(WebConsoleListener).
WebPageClientImpl#setConsoleListener(WebConsoleListener) stores the listener in its static field consoleListener.
consoleListener is only interacted with by WebPageClientImpl#addMessageToConsole(String,int,String).
WebPageClientImpl#addMessageToConsole(String,int,String) overrides WebPageClient#addMessageToConsole(String,int,String).
WebPageClient#addMessageToConsole(String,int,String) is called by WebPage#fwkAddMessageToConsole(String,int,String). There are no other call sites in the code base at the time of this writing.
That same method logs the console information:
log.log(Level.FINE, "fwkAddMessageToConsole(): message = " + message
+ ", lineNumber = " + lineNumber + ", sourceId = " + sourceId);
That means you can get the logging you need by enabling FINE logging on com.sun.webkit.WebPage limiting the implementation-level dependency to logging configuration:
com.sun.webkit.WebPage.level = FINE
I could not find a public API for this.
Based on my review of the OpenJDK JFX repo source, there isn't a public API for this.
This solution is still not ideal as it depends on a private implementation classname, but that dependency is in a configuration file where if the implementation class changes or disappears, the impact is a loss of logging rather than a likely fatal NoClassDefFoundError or NoSuchMethodError.
add a comment |
You can enable browser console logging via Java™ 2 platform's core logging facilities by adding this to logging.properties:
com.sun.webkit.WebPage.level = FINE
Make sure that a log handler with FINE or lower level is present in the logging configuration or the logs will be filtered before they are logged. Example:
handlers = java.util.logging.ConsoleHandler
.level = INFO
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.XMLFormatter
com.sun.webkit.WebPage.level = FINE
Here's a more in-depth explanation of how I figured that out:
WebConsoleListener#setDefaultListener(WebConsoleListener) calls WebPageClientImpl#setConsoleListener(WebConsoleListener).
WebPageClientImpl#setConsoleListener(WebConsoleListener) stores the listener in its static field consoleListener.
consoleListener is only interacted with by WebPageClientImpl#addMessageToConsole(String,int,String).
WebPageClientImpl#addMessageToConsole(String,int,String) overrides WebPageClient#addMessageToConsole(String,int,String).
WebPageClient#addMessageToConsole(String,int,String) is called by WebPage#fwkAddMessageToConsole(String,int,String). There are no other call sites in the code base at the time of this writing.
That same method logs the console information:
log.log(Level.FINE, "fwkAddMessageToConsole(): message = " + message
+ ", lineNumber = " + lineNumber + ", sourceId = " + sourceId);
That means you can get the logging you need by enabling FINE logging on com.sun.webkit.WebPage limiting the implementation-level dependency to logging configuration:
com.sun.webkit.WebPage.level = FINE
I could not find a public API for this.
Based on my review of the OpenJDK JFX repo source, there isn't a public API for this.
This solution is still not ideal as it depends on a private implementation classname, but that dependency is in a configuration file where if the implementation class changes or disappears, the impact is a loss of logging rather than a likely fatal NoClassDefFoundError or NoSuchMethodError.
You can enable browser console logging via Java™ 2 platform's core logging facilities by adding this to logging.properties:
com.sun.webkit.WebPage.level = FINE
Make sure that a log handler with FINE or lower level is present in the logging configuration or the logs will be filtered before they are logged. Example:
handlers = java.util.logging.ConsoleHandler
.level = INFO
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.XMLFormatter
com.sun.webkit.WebPage.level = FINE
Here's a more in-depth explanation of how I figured that out:
WebConsoleListener#setDefaultListener(WebConsoleListener) calls WebPageClientImpl#setConsoleListener(WebConsoleListener).
WebPageClientImpl#setConsoleListener(WebConsoleListener) stores the listener in its static field consoleListener.
consoleListener is only interacted with by WebPageClientImpl#addMessageToConsole(String,int,String).
WebPageClientImpl#addMessageToConsole(String,int,String) overrides WebPageClient#addMessageToConsole(String,int,String).
WebPageClient#addMessageToConsole(String,int,String) is called by WebPage#fwkAddMessageToConsole(String,int,String). There are no other call sites in the code base at the time of this writing.
That same method logs the console information:
log.log(Level.FINE, "fwkAddMessageToConsole(): message = " + message
+ ", lineNumber = " + lineNumber + ", sourceId = " + sourceId);
That means you can get the logging you need by enabling FINE logging on com.sun.webkit.WebPage limiting the implementation-level dependency to logging configuration:
com.sun.webkit.WebPage.level = FINE
I could not find a public API for this.
Based on my review of the OpenJDK JFX repo source, there isn't a public API for this.
This solution is still not ideal as it depends on a private implementation classname, but that dependency is in a configuration file where if the implementation class changes or disappears, the impact is a loss of logging rather than a likely fatal NoClassDefFoundError or NoSuchMethodError.
answered Mar 10 at 16:43
Alain O'DeaAlain O'Dea
14.4k13458
14.4k13458
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072824%2fwhat-is-the-public-api-for-getting-javafx-webview-console-events%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown