Hey all!
I am trying to delete cookies in the browser that UE4 has. There’s a problem with this variable called WebBrowserSingleton. Visual Studio is saying that identifier is undefined. The browser is actually a UE4 plugin, so you won’t see it in a clean project if you haven’t enabled the plugin.
Here’s my cpp, you can see the variable on line 7.
#include "CookiesFunctionLibrary.h"
#include "Runtime\WebBrowser\Public\IWebBrowserSingleton.h"
#include "Runtime\WebBrowser\Public\WebBrowserModule.h"
#include "Runtime\WebBrowser\Public\IWebBrowserCookieManager.h"
void UCookiesFunctionLibrary::D
https:\/\/forums.unrealengine.com\/core\/image\/gif;base64
eleteCookies() {
IWebBrowserSingleton* WebBrowserSingleton = IWebBrowserModule::Get().GetSingleton();
if (WebBrowserSingleton)
{
TSharedPtr<IWebBrowserCookieManager> CookieManager = WebBrowserSingleton->GetCookieManager();
if (CookieManager.IsValid())
{
CookieManager->DeleteCookies();
}
}
}
Here’s my header file:
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "CookiesFunctionLibrary.generated.h"
/**
*
*/
UCLASS()
class RISEOFASMODEUS_API UCookiesFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable)
static void DeleteCookies();
};
I’ve also tried adding the headers to my projectName.h file and also adding the “WebBrowser” module to the PublicDependencyModuleNames in my projectName.Build.cs but it didn’t seem to do anything. Any ideas what I’m missing? I’m new to this!