You are here
Home > Java > Update of Create Browser using JavaFX

Update of Create Browser using JavaFX

update-create-browser-javafx-featured

Hello Friends, today I am going share an update of create Browser using JavaFX. Actually I was working on a JavaFX application which was making use of WebView but while testing I just browsed flipkart.com and suddenly it started showing “Something’s not right!” error then figured out and found that flipkart has CORS policy disabled for a domain to list products but JavaFX has same origin policy enabled by default. Then I googled and found a solution which I am sharing now. But wait story not ends here, after applying this solution I found another problem which was that while browsing flipkart, url was not reflecting in address bar but webpage was updating then again I googled and found that change listener on LocationProperty of webview is the solution for this problem. Finally I thought to share these solutions by creating update of an existing browser which I have developed and shared long time ago.

So, Here is solution

Browser.fxml



BrowserController.java

Main.java

Output/Screen Shot

output-before-allowRestrictedHeaders output-before-locationproperty-listener
Before allowRestrictedHeaders Before LocationProperty Listener
output-after-allowRestrictedHeaders output-after-locationproperty-listener
After allowRestrictedHeaders After LocationProperty Listener

Download NetBeans Project

Please don’t forget to share if you find this helpful

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
https://www.zatackcoder.com

Comments

zatackcoder
Top