I am using 10.2.2 Tokyo Enterprise and FireMonkey's
TWebBrowser in an App. I wish to receive a callback response, but I don't receive a URL back when the
ShouldStartLoadWithRequest fires when I run my code.
I would like to know if this is possible without writing a wrapper. I feel I have missed something simple.
I have checked these sites and many more and have tried many different ways...
Here is my simple code version:
<!DOCTYPE html><html lang="en"> <body> <h2> Get Callback</h2> </body> </html>
Changing the end of the URL should, in principle, trick the WebBrowser into believing that it is a new URL, and I should be able to extract the number 67 while still keeping the page refreshed.
Please can you point me in the right direction?
I continued to investigate further ...
Normally when sending a Header to a Server, the Server accepts the Header but in the above instance the Header is sent from a local URL to a local URL, the browser will picked this up and flag the Header as ill- formed. That is because CORS policy steps in.
The same-origin request policy can be disabled in Chrome using the --disable-web-security flag. But as I am using the standard Firemonkey Web-browser, the Chrome solution is not fully applicable.
However it seems that the changeable security/zone settings of IE 11 and Edge are completely removed. The only way in which you can access this is via a wrapper.
Hopefully Embarcadero will add the callback function into the Firemonkey Web browser sometime soon. So in the interim I discovered an easy workaround. I downloaded from the Getit Package Manager and used their wrapper library. Although it is not the real solution to my question, it is a solution for others who are looking for a quick fix.
Here is the callback function that I used to make it happen…
©2020 All rights reserved.