How to enable OpenJFX web view remote inspector - webkit

I am currently trying to enable remote inspector for a OpenJFX web view component in order to be able to debug javascript code interactions with the Java part of the application. This is why I cannot debug the web part in a standalone browser.
There appears to be no detailed documentation related to remote inspector besides a few fixed scenarios which have pre-configured solutions available. Based on reverse-engineering and other research, I was able to piece together the following:
I have obtained an instance of Debugger interface out of the OpenJFX WebEngine instance;
I have created a simple TCP server which communicates with the WebKit browser using its protocol (eg. messages like "SetupInspectorClient", "GetTargetList", "SendMessageToBackend", etc.). This is enough to make the remote WebKit browser recognize my view when opening the inspector://localhost:<port> URI;
When attempting to connect to a particular view, the majority of the communication is handled by the "SendMessageToBackend" and "SendMessageToFrontend" messages forwarded by my code between remote WebKit browser and the Debugger instance. However, based on communication traces the only response that the remote browser receives to its requests is a "'Target' domain was not found" and "'Browser' domain was not found" errors.
I presume the above problem may be caused by either incompatible webkit versions between OpenJFX and my remote browser - although I am using WebKit 613.1 on both ends. Other possibility is that the OpenJFX uses some sort of stripped-down WebKit which does not support the inspector commands at all. However, I don't know enough about WebKit to be able to find it out on my own.
Is it possible to get remote inspector working in OpenJFX 17, and if yes, then how?

Related

Create/embed Firefox/Chrome base browser in Visual Studio

Im creating a freeware application (long live the free community) and I'm trying to add various features that might drive people to use the application such as implementing whatsapp web https://web.whatsapp.com/ into the app so that the user will always have an "always on top" window with their chats rather than everytime having to switch tabs if they're multitasking on their browser.
The problem i am having is that the built in Browser control with VS 2013 does not work with whatsapp web and i get the option to use supported browsers like firefox...chrome...safari.
Is there anyway to make a VB.NET application open an actual chrome/firefox based browser within itself?
I found an article on Gecko Browser...I am not sure if web.whatsapp.com would see this as a firefox browser: http://www.vbforums.com/showthread.php?692005-Mozilla-Firefox-Gecko-Xulrunner-in-VB-NET-%28versions-14-and-up%29
Help appreciated.

Capture web driver network traffic across all browsers

I want to capture all the network calls from Web Driver in Java. I am not doing any UI testing, just testing JS execution and, requests and responses of some network calls.
I tried using Browser Mob as is suggested in most forums, but I need it to work across all browsers. It worked flawlessly with Firefox, but I was facing some issues with the others. Safari driver doesn't event support a Proxy capability.
I don't want to use Fiddler as it involves some manual steps around invoking and storing the calls. Whereas, Browser Mob being an in-code proxy can be integrated in a more smoother fashion.
I also tried using the RC-like package included in Selenium standalone server package. But, I have some HTTPS calls and some nested iframes in cross domains. I am particularly interested in some cross domain POST call and it doesn't work out that well. Also, people keep saying it's not recommended to use that package.
So, I had a solution where we can use a standalone proxy server running on a machine. Using host entries, we'll point Web Driver to hit the proxy instead of the actual server. The proxy will record all the incoming calls and route them to the actual server host. Later, I can make a request to the proxy which will return me all the calls it intercepted. I am not sure whether it's still called a proxy or a router.
I came across TCPmon, but it's no longer being supported. Does anyone know some similar tools that could run on Unix systems or any alternate solutions?
We modified the Fiddler rules script to include a new exec action. If you use their native script editor, it also provide auto complete features and we were comfortably able to get around it. The syntax is similar to that of JavaScript.
The Fiddler package comes with a ExecActions.exe which can be used to pass console arguments to a running Fiddler instance using the command prompt.
The code we wrote processed all the sessions captured by Fiddler and wrote it to a file in a custom JSON format and later used GSON to deserialize it.
Please let me know, if you want further details.

How to run Dart Editor without firewall privileges?

Okay, I'm developing a web app using Dart, I'm making encrypter - which works fine at home. But, I'm in college and I need to run my Dart app from a USB stick. When I run my Dart app, the version of Chrome that comes with Dart opens but nothing loads. I have the "stop loading this page" button showing, which tells me that it is trying to load something, but I've left it for half an hour and nothing happens. I think it's because I cannot give Dart any Firewall privileges, because I'm not an admin, the VM that Dart uses won't launch. Has anybody got any tips of how to get around this?
I disconnected my notebook from the network and Darteditor runs just fine. I can start web pages without any problem.
Probably Darteditor tries to download pub dependencies which won't work without a network connection.
If you can open a public website like google.com in your browser then it's probably not a firewall limitation. AFAIK Dart uses only HTTP port 80 which is usually open.
If your HTTP connection goes over a proxy that might not work - that is a common problem with Dart.

How to export Safari Web Inspector timeline data?

Just like in Chrome Developer Tool, I was wondering if there is any tool/extension/plugin which would allow me to export timeline data in Safari. I tried the nightly build of webkit but it does not have that feature. Seems like this is a Chrome specific functionality.
I have to use Safari because I am testing a webapp on iPhone.
I searched around for any hints but could not get any. As of now I am thinking of two options to get the timeline information:
Build a Safari extension
Get Chrome Dev Tool's timeline code and build my own version of webkit (if that's even possible!)
Any guides/insights would be highly appreciated!
Update 1: I downloaded Webkit and found out that it supports remote iPhone debugging through USB. Probably I can find the code for web inspector for Webkit and use that code to export the timeline data.
Safari's Web inspector does use the WebKit remote debugging protocol.
However, Safari does not use TCP/HTTP as a transport layer, thus
making it incompatible with Chrome. source
Thankfully, someone from Google wrote a proxy allowing to overcome this limitation.

Background js doesn't work on error pages

Is there any way to load background js even on error pages (such as net::ERR_NETWORK_CHANGED)? I need to keep persistence connection with WS server from the extension, but error pages don't load background js. So I lose the connection and possibility to restart it (due this is automated tool without access to browser ui).
The only solution I found is to use proxy server to customize error pages and load background js inside of them.
The assertion "Background js doesn't work on error pages" does not make any sense, because there's only one background page per extension two if you use split incognito mode.
So I assume that you want to detect a network connectivity loss in order to restore the web socket. Chrome offers two reliable global events for this: online and offline.
I have published the source code of Real-time desktop notifications for Stack Exchange inbox, which also accounts for network connectivity loss/regain. The relevant Web Socket part of the Chrome extension is found in stackexchange-notifications/Chrome/using-websocket.js on Github.