Debug JavaFX web view with weinre - javafx-2

Has anyone tried to debug a webpages rendered in a javafx web view with weinre? Is this possible or is web view lacking the necessary infrastructure?

As the Weinre interface to the browser is just JavaScript and JavaScript executes just fine in WebView, WebView has the "necessary infrastructure" to use weinre.
To give an indication of how to execute JavaScript within the context of WebView, you can look at the code I used to debug WebView using the JavaScript based Firebug Lite tool: Html/Javascript debugging in JavaFX WebView. The code is a slightly modified version of the code found in the Firebug Lite bookmarklet. As Weinre also has a bookmarklet which can be used to initiate it, you could perform a similar translation for Weinre as I did for Firebug Lite.
Additionally Weinre is usable by placing a script tag inside the target web page. Take a look at some sample code that I created for embedding the jQuery script library into WebView - you could do the same for the Weinre script library.
I doubt anybody has tried using WebView with Weinre before.

Related

Pepper Robot Web Debugging

We're trying to show a web page on pepper's tablet, but something goes wrong. How can we get the browser's error messages to debug the web page?
We know js 1.5 is implemented, so we installed all kind of polyfills for Promises, forEach, etc. But no luck. How can we get meaningful debugging info?
thx
Sven
I create a git for showing a web page and send event with the module ALMemory ( see it for an example). For debugging, it is more complicated but you can also try this. You can create a template for showing web page and connect directly it to your robot. For example, you install it on your pc and create a web-page template with python jumpstart.py service-tabletpage my-package-name MyServiceName. A package will be create in a file output. Open this app on choregraphe and install it on the robot. You can after that launch on your computer the web page (double click on index.html, name by default) and just adding at the end of the url ?robot=ip_of_the_robot. You can now debug your code.

Linux: Eclipse Internal web browser does not show html5 contents

I have a html page which uses the html5 canvas. When I open this page in Eclipse 4.5.2 on Windows and Mac OS Internal Web Browser it shows me the canvas and other things defined correctly. However when I tried the same on Linux (Eclipse 4.5.2) the internal web browser showed me all other contents except for the html5 canvas.
Please could you help me understand why the Linux variant of Eclipse does not show html5 contents in the internal web browser. What am I missing?
Thank you.
The problem was with xulrunner version.
I used the xulrunner version 24 and specified the following arguments in the vm arguments tab of the run launch configuration and it worked!
-Dorg.eclipse.swt.browser.DefaultType="mozilla"
-Dorg.eclipse.swt.browser.XULRunnerPath="pathToXulRunner"
OR you can do that same by setting the System property through your java code
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "pathToXulRunner");
and then use the SWT.MOZILLA flag to create browser
eg Browser b = new Browser(parent, SWT.MOZILLA);
Cheers
-Kapil

Does Kendo UI support chrome apps/extentions?

I tried to port my succesefuly worked my kendo-based site as chrome app. But app does not works. I found on chrome developer console exception message "extensions::platformApp:17 history.pushState is not available in packaged apps." on
<script src="kendo/js/kendo.mobile.min.js"></script> string
I found the same problem on angular with a solution, but did not found for the Kendo.
Any way to resolve it?
By default Kendo UI (and Mobile) doesn't use the History API, due to its rather limited support in the past. If you explicitly enabled it, you can delete this option, though you will probably have to update your navigation throughout the apps:
http://docs.telerik.com/kendo-ui/api/javascript/mobile/application#configuration-pushState

SWT Browser component blocks SWT UI thread

I am embedding an org.eclipse.swt.browser.Browser into a view in a modified eclipse (Indigo), for use as a preview pane of a form editor component. On a form model change or an element selection change the code renders the form via vaadin 6 and displays it in the browser component.
Now, this works like a charm in most cases. But for some highly complex forms the HTML+JS generated by vaadin generates a lot of stress on the browser, rendering it unresponsive for up to a few seconds. That in itself wouldn't be tragic (1), but as long as the SWT Browser component is busy rendering that stuff, the entire eclipse UI thread is blocked.
A simple way to reproduce this is to create an HTML page that blocks inside a javascript function (see https://gist.github.com/creinig/5150747 for an example) and display it in the SWT browser. As long as that JS function is running, the entire SWT application is not responding to anything.
The only info I've found on this problem are
one SO question (without resolution) and
one question on EclipseZone (unanswered).
Not that helpful :(
The API docs of the Browser component don't seem to offer any insight on whether its rendering is triggered periodically by the UI thread or if itself triggers something that blocks the UI.
Is there a way to decouple the Browser component's rendering from the SWT UI thread? Or anything else that could be done to protect the eclipse UI from hanging stuff in the browser?
(1): We need forms of this complexity level, we're already optimizing the rendering performance and a switch to vaadin7 will most likely also speed things up. But the problem will certainly persist, if only in reduced severity.
Not a real solution, but a workaround that Works For Me (TM):
As described here it is really easy to launch the system's default browser from SWT. So I'm going to add an option to the view containing the browser control that will "detach" the view by disabling the browser control and opening the system browser instead.
In case the linked page drops off the net, here's the gist:
org.eclipse.swt.program.Program.launch("http://my.funny.url/");
launches the application registered for HTTP URLs. In other words: the system default browser.
Happiness ensues :)

How can I display a javascript webpage inside a WebView in JavaFx 2.0 in Browser

I am trying to display a twitterBox inside a webview in a JavaFx 2.0 web application. Is there any know problems with trying to do this? When I launch the application from my desktop the script shows up but from the browser it doesn't load the script.
You need to sign your application.
Being run in browser JavaFX applications falls under restrictions of Java plugin and you twitterBox can't connect to another domain twitter.com.
If you are using NetBeans you can self-sign application in Project Properties.
Otherwise look here: http://docs.oracle.com/javafx/2.0/deployment/javafx_ant_task_reference001.htm#CIAJGAFH

Resources