Hello everyone,
I am currently trying to access the content of a SWebBrowser when the right URL is loaded, by using the GetSource() function.
I got my code to work for Windows and it was bulletproof. Now, I want to move to Android. And shortly after the GetSource() gets called my SWebBrowers brings up a error message not being able to load the Page.
I debugged a little and found out, that shortly after the GetSource() function call my URL changes for no apparent reason from https://oidcdebugger.com/debug
to https://oidcdebugger.com/GetSource/%3Chead%3E%0A%20%20%20%20%3Cmeta%20charset%3D%22...
.
(Reminder: The same code worked very fine on Windows and triggered my callback function with the page content as intended).
For me it seems, that GetSource(), for whatever reason, appends the page content to the URL which results in my SWebBrowser not to being able to load the page (because it does not exist obviously).
Here is my code:
if (sBrowser.Get()->IsLoaded()) //gets called every 0.1 seconds
{
FString currURL = sBrowser.Get()->GetUrl();
UE_LOG(LogTemp, Warning, TEXT("Current URL: %s"), *currURL);
if (sBrowser.Get()->GetUrl() == "https://oidcdebugger.com/debug")
{
if (!m_SourceRequested) {
TFunction<void(const FString&)> MyProcessFunction = ([&](const FString& content) {
...
});
sBrowser.Get()->GetSource(MyProcessFunction);
UE_LOG(LogTemp, Warning, TEXT("GetSource was Called"));
m_SourceRequested = true;
}
...
}
I really hope someone can help me to figure out what I am doing wrong.
BR,
Florian