Guys, hello everyone, the question arose: how to get the url of the page in javafx? I work with vkapi.

I make a normal request

https://oauth.vk.com/authorize?client_id=x&scope=friends,notify,photos,photos,audio,video,docs,notes,pages,groups,offline&redirect_uri=https://oauth.vk.com/blank.html&display=mobile&v=5.5&response_type=token&revoke=1 

After authorization and issuance of access rights, there is a redirect to the following url:

 http://REDIRECT_URI#access_token= 533bacf01e11f55b536a565b57531ad114461ae8736d6506a3&expires_in=86400&user_id=8492 

How to get the url of this particular page? (I want to pull out acess_token) I know that you can use .getLocation (), but how can I access the browser form only after the redirect? thank

    1 answer 1

      WebEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<Worker.State>() { @Override public void changed(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) { if (newValue == Worker.State.SUCCEEDED) { if (WebEngine.getLocation.contains("access_token")){ //code here }}}}