Skip to content

UInternetBrowser

#include <InternetBrowserUMG/Public/InternetBrowser.h>
class UInternetBrowser

Defined in InternetBrowser.h:203

Inherits: UWidget

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UInternetBrowser["UInternetBrowser"]
  class UWidget["UWidget"]
  UWidget <|-- UInternetBrowser
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UInternetBrowser["UInternetBrowser"]
  class UInternetBrowserSaveGame["UInternetBrowserSaveGame"]
  UInternetBrowser *-- UInternetBrowserSaveGame
  class FBrowserBookmark["FBrowserBookmark"]
  UInternetBrowser *-- FBrowserBookmark
  class FBrowserCookie["FBrowserCookie"]
  UInternetBrowser *-- FBrowserCookie
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UInternetBrowser {
    +OnAccessDenied : FOnAccessDenied
    +OnBeforePopup : FOnBeforePopup
    +OnUrlChanged : FOnUrlChanged
    +OnLoadStarted : FOnWebBrowserLoadStarted
    +OnLoadCompleted : FOnWebBrowserLoadCompleted
    +OnLoadError : FOnWebBrowserLoadError
    +OnLoadBrowserURL : FOnLoadBrowserURL
    +UInternetBrowser(const FObjectInitializer &ObjectInitializer
    +RebuildWidget() override TSharedRef< SWidget >
    +ReleaseSlateResources(bool bReleaseChildren) override
    +InitializeInternetBrowser(const FString InOverrideURL="")
    +LoadURL(const FText &URL) bool
    +LoadString(FString Contents, FString DummyURL)
    +ExecuteJavascript(const FString &ScriptText)
    +AddBookmark(const FBrowserBookmark &InBookmark)
    +RemoveBookmark(const FBrowserBookmark &InBookmark)
    +GetBookmarks() const TArray< FBrowserBookmark() >
    +SetCookie(const FString &URL, const FBrowserCookie &I
    +SetCookieForAll(const FBrowserCookie &InCookie, FOnCookieSe
    +DeleteCookie(const FString &URL, const FString &CookieNa
    +DeleteAllCookies(FOnCookieDeleteComplete Delegate)
    +GetCookieName(const FBrowserCookie &InCookie) const FString
    +GetTitleText() const FText
    +GetUrl() const FString
    +GetAddressbarUrl() const FText
    +GetBrowserProtocolLink() const FString
    +GetHistory() const TArray< FInternetBrowserHistory() >
    +IsHistoryValid(const FInternetBrowserHistory &InHistory) bool
    +GetCleanDomainName(const FText &InURL) FText
    +ReloadWebPage()
    +InitialURL : FString
    +bSupportsTransparency : uint8
    +bShowWhitelistOnly : uint8
    +bEnableHistory : uint8
    +bOnlyHTTPS : uint8
    +bSupportBrowserURLs : uint8
    +bSupportLocalhost : uint8
    +BrowserIdentifier : FName
    +InternetBrowserSaveGameClass : TSubclassOf< UInternetBrowserSaveGame() 
    +WhitelistWebsites : TArray< FString >
    +Bookmarks : TArray< FBrowserBookmark() >
    +BackButton : UButton *
    +ForwardButton : UButton *
    +ReloadButton : UButton *
    +Addressbar : UEditableTextBox *
    +WebBrowserWidget : TSharedPtr< SWebBrowser >
    +LastLoadedURL : FString
    +Cookie : FBrowserCookie()
    +SavedBookmarks : TMap< FString, FString >
  }

Represents a web browser widget that can be embedded in a UMG widget.

ReturnNameDescription
FOnAccessDeniedOnAccessDenied
FOnBeforePopupOnBeforePopup
FOnUrlChangedOnUrlChanged
FOnWebBrowserLoadStartedOnLoadStarted
FOnWebBrowserLoadCompletedOnLoadCompleted
FOnWebBrowserLoadErrorOnLoadError
FOnLoadBrowserURLOnLoadBrowserURL

FOnAccessDenied OnAccessDenied

Defined in InternetBrowser.h:277


FOnBeforePopup OnBeforePopup
FOnUrlChanged OnUrlChanged
FOnWebBrowserLoadStarted OnLoadStarted
FOnWebBrowserLoadCompleted OnLoadCompleted
FOnWebBrowserLoadError OnLoadError
FOnLoadBrowserURL OnLoadBrowserURL

Defined in InternetBrowser.h:301

ReturnNameDescription
UInternetBrowser
TSharedRef< SWidget >RebuildWidget virtual override
voidReleaseSlateResources virtual override
voidInitializeInternetBrowserpublic UInternetBrowser::InitializeInternetBrowser Assign delegates to back, forward, reload buttons and address bar. Make sure you assign them first. Load initial URL.
boolLoadURLpublic UInternetBrowser::LoadURL Loads the given URL with support for internal browser URLs. Automatically adds https:// protocol if not present. So if you pass google.com to URL, it will be converted to https://google.com
voidLoadStringpublic UInternetBrowser::LoadString Load a string as data to create a web page.
voidExecuteJavascriptpublic UInternetBrowser::ExecuteJavascript Execute javascript on the current window
voidAddBookmarkpublic UInternetBrowser::AddBookmark Adds the given bookmark to bookmarks array.
voidRemoveBookmarkpublic UInternetBrowser::RemoveBookmark Removes the given bookmark.
TArray< FBrowserBookmark >GetBookmarks const inlinepublic UInternetBrowser::GetBookmarks const Returns all the bookmarks.
voidSetCookiepublic UInternetBrowser::SetCookie Sets a cookie for given URL. This function expects each attribute to be well-formed. It will check for disallowed characters (e.g. the ’;’ character is disallowed within the cookie Value field) and fail without setting the cookie if such characters are found.
voidSetCookieForAllpublic UInternetBrowser::SetCookieForAll Sets a cookie for all URLs. This function expects each attribute to be well-formed. It will check for disallowed characters (e.g. the ’;’ character is disallowed within the cookie Value field) and fail without setting the cookie if such characters are found.
voidDeleteCookiepublic UInternetBrowser::DeleteCookie Deletes the given cookie for the given URL.
voidDeleteAllCookiespublic UInternetBrowser::DeleteAllCookies Delete the entire cookie database.
FStringGetCookieName const inlinepublic UInternetBrowser::GetCookieName const Gets the name of the given cookie.
FTextGetTitleText constpublic UInternetBrowser::GetTitleText const Gets the title of the loaded URL.
FStringGetUrl constpublic UInternetBrowser::GetUrl const Returns the currently loaded URL.
FTextGetAddressbarUrl constpublic UInternetBrowser::GetAddressbarUrl const Gets the URL that appears in the address bar, this may not be the URL that is currently loaded in the frame.
FStringGetBrowserProtocolLink constpublic UInternetBrowser::GetBrowserProtocolLink const Gets the protocol link for this browser. Similar to chrome:// @See BrowserIdentifier variable.
TArray< FInternetBrowserHistory >GetHistory constpublic UInternetBrowser::GetHistory const Returns array of FWebHistory. This array contains all the web pages the user has visited if History is enabled.

UInternetBrowser(const FObjectInitializer & ObjectInitializer)

Defined in InternetBrowser.h:303


virtual override

virtual TSharedRef< SWidget > RebuildWidget() override

Defined in InternetBrowser.h:305


virtual override

virtual void ReleaseSlateResources(bool bReleaseChildren) override

Defined in InternetBrowser.h:306


void InitializeInternetBrowser(const FString InOverrideURL = "")

Defined in InternetBrowser.h:327 public UInternetBrowser::InitializeInternetBrowser Assign delegates to back, forward, reload buttons and address bar. Make sure you assign them first. Load initial URL.

  • InOverrideURL [const FText]

bool LoadURL(const FText & URL)

Defined in InternetBrowser.h:337 public UInternetBrowser::LoadURL Loads the given URL with support for internal browser URLs. Automatically adds https:// protocol if not present. So if you pass google.com to URL, it will be converted to https://google.com

  • URL [const FText &] URL to load. Adds https:// protocol if not present.

[bool] True if URL is loaded.


void LoadString(FString Contents, FString DummyURL)

Defined in InternetBrowser.h:346 public UInternetBrowser::LoadString Load a string as data to create a web page.

  • Contents [FString] HTML string to load.

  • DummyURL [FString] Dummy URL for the page.


void ExecuteJavascript(const FString & ScriptText)

Defined in InternetBrowser.h:354 public UInternetBrowser::ExecuteJavascript Execute javascript on the current window

  • ScriptText [const FString&] Javascript to execute.

void AddBookmark(const FBrowserBookmark & InBookmark)

Defined in InternetBrowser.h:362 public UInternetBrowser::AddBookmark Adds the given bookmark to bookmarks array.


void RemoveBookmark(const FBrowserBookmark & InBookmark)

Defined in InternetBrowser.h:370 public UInternetBrowser::RemoveBookmark Removes the given bookmark.


const inline

inline TArray< FBrowserBookmark > GetBookmarks() const

Defined in InternetBrowser.h:378 public UInternetBrowser::GetBookmarks const Returns all the bookmarks.

[TArray<FBrowserBookmark>] Bookmarks array.


void SetCookie(const FString & URL, const FBrowserCookie & InCookie, FOnCookieSetComplete Delegate)

Defined in InternetBrowser.h:391 public UInternetBrowser::SetCookie Sets a cookie for given URL. This function expects each attribute to be well-formed. It will check for disallowed characters (e.g. the ’;’ character is disallowed within the cookie Value field) and fail without setting the cookie if such characters are found.

  • URL [const FString&] URL to match when searching for cookie to set.

  • InCookie [const FBrowserCookie &] Cookie to set.

  • Delegate [FOnCookieSetComplete] A callback delegate that will be invoked when the set is complete passing success bool.


void SetCookieForAll(const FBrowserCookie & InCookie, FOnCookieSetComplete Delegate)

Defined in InternetBrowser.h:403 public UInternetBrowser::SetCookieForAll Sets a cookie for all URLs. This function expects each attribute to be well-formed. It will check for disallowed characters (e.g. the ’;’ character is disallowed within the cookie Value field) and fail without setting the cookie if such characters are found.

  • InCookie [const FBrowserCookie&] Cookie to set.

  • Delegate [FOnCookieSetComplete] A callback delegate that will be invoked when the set is complete passing success bool.


void DeleteCookie(const FString & URL, const FString & CookieName, FOnCookieDeleteComplete Delegate)

Defined in InternetBrowser.h:413 public UInternetBrowser::DeleteCookie Deletes the given cookie for the given URL.

  • URL [const FString&] URL to match when searching for cookie to remove.

  • CookieName [const FString&] The name of the cookie to delete. If left unspecified, all cookies will be removed.

  • Delegate [FOnCookieDeleteComplete] A callback delegate that will be invoked when the deletion is complete passing number of deleted cookies.


void DeleteAllCookies(FOnCookieDeleteComplete Delegate)

Defined in InternetBrowser.h:421 public UInternetBrowser::DeleteAllCookies Delete the entire cookie database.

  • Delegate [FOnCookieDeleteComplete] A callback delegate that will be invoked when the deletion is complete passing number of deleted cookies.

const inline

inline FString GetCookieName(const FBrowserCookie & InCookie) const

Defined in InternetBrowser.h:430 public UInternetBrowser::GetCookieName const Gets the name of the given cookie.

[FString] Name of the cookie.


const

FText GetTitleText() const

Defined in InternetBrowser.h:438 public UInternetBrowser::GetTitleText const Gets the title of the loaded URL.

[FText] Title for the loaded URL.


const

FString GetUrl() const

Defined in InternetBrowser.h:446 public UInternetBrowser::GetUrl const Returns the currently loaded URL.

[FString] Currently loaded URL.


const

FText GetAddressbarUrl() const

Defined in InternetBrowser.h:454 public UInternetBrowser::GetAddressbarUrl const Gets the URL that appears in the address bar, this may not be the URL that is currently loaded in the frame.

[FText] URL that appears in the address bar


const

FString GetBrowserProtocolLink() const

Defined in InternetBrowser.h:472 public UInternetBrowser::GetBrowserProtocolLink const Gets the protocol link for this browser. Similar to chrome:// @See BrowserIdentifier variable.

[FString] Returns browser protocol link.


const

TArray< FInternetBrowserHistory > GetHistory() const

Defined in InternetBrowser.h:480 public UInternetBrowser::GetHistory const Returns array of FWebHistory. This array contains all the web pages the user has visited if History is enabled.

[TArray<FWebHistory>] History array.

ReturnNameDescription
boolIsHistoryValid static inlinepublic static UInternetBrowser::IsHistoryValid Checks if the given history is a valid entry.
FTextGetCleanDomainName staticpublic static UInternetBrowser::GetCleanDomainName Returns a clean domain name from given url. For example: www.google.com if you pass https://www.google.com/search?q=test

static inline

static inline bool IsHistoryValid(const FInternetBrowserHistory & InHistory)

Defined in InternetBrowser.h:318 public static UInternetBrowser::IsHistoryValid Checks if the given history is a valid entry.


static

static FText GetCleanDomainName(const FText & InURL)

Defined in InternetBrowser.h:463 public static UInternetBrowser::GetCleanDomainName Returns a clean domain name from given url. For example: www.google.com if you pass https://www.google.com/search?q=test

  • InURL [const FText&] URL to get

[FText] Proper domain name.

ReturnNameDescription
voidReloadWebPageReloads the current web page in the internet browser.

void ReloadWebPage()

Defined in InternetBrowser.h:494 Reloads the current web page in the internet browser.

This method checks if the web browser widget is valid. If it is, it checks if the web browser widget is currently loading a page using the IsLoading() function. If the web browser widget is loading a page, the StopLoad() function is called to stop the loading. If the web browser widget is not loading a page, the Reload() function is called to reload the current web page.

ReturnNameDescription
FStringInitialURLURL that the browser will initially navigate to. The URL should include the protocol, eg http://
uint8bSupportsTransparencyShould the browser window support transparency.
uint8bShowWhitelistOnlyIf enabled, web browser widget will only load websites provided in WhitelistWebsites array.
uint8bEnableHistoryIf enabled, web browser will add visited websites to History.
uint8bOnlyHTTPSIf enabled, web browser will convert http to https.
uint8bSupportBrowserURLsIf enabled, then support browser protocol link similar to chrome://. @See BrowserIdentifier
uint8bSupportLocalhostSupport localhost and 127.0.0.1
FNameBrowserIdentifier[NOT YET IMPLEMENTED] An internal identifier used for browser urls. @See UInternetBrowser::GetBrowserProtocolLink()
TSubclassOf< UInternetBrowserSaveGame >InternetBrowserSaveGameClassSave game class for saving loading browser properties.
TArray< FString >WhitelistWebsitesIf “Show Whitelist Only” is enabled then Web Browser will only allow to load web pages defined in this array. Accessing any web page not defined in this array will show error page.
TArray< FBrowserBookmark >BookmarksBrowser bookmarks.
UButton *BackButton
UButton *ForwardButton
UButton *ReloadButton
UEditableTextBox *Addressbar
TSharedPtr< SWebBrowser >WebBrowserWidget
FStringLastLoadedURL
FBrowserCookieCookie
TMap< FString, FString >SavedBookmarks

FString InitialURL

Defined in InternetBrowser.h:209 URL that the browser will initially navigate to. The URL should include the protocol, eg http://


uint8 bSupportsTransparency

Defined in InternetBrowser.h:213 Should the browser window support transparency.


uint8 bShowWhitelistOnly

Defined in InternetBrowser.h:217 If enabled, web browser widget will only load websites provided in WhitelistWebsites array.


uint8 bEnableHistory

Defined in InternetBrowser.h:221 If enabled, web browser will add visited websites to History.


uint8 bOnlyHTTPS

Defined in InternetBrowser.h:225 If enabled, web browser will convert http to https.


uint8 bSupportBrowserURLs

Defined in InternetBrowser.h:229 If enabled, then support browser protocol link similar to chrome://. @See BrowserIdentifier


uint8 bSupportLocalhost

Defined in InternetBrowser.h:233 Support localhost and 127.0.0.1


FName BrowserIdentifier

Defined in InternetBrowser.h:237 [NOT YET IMPLEMENTED] An internal identifier used for browser urls. @See UInternetBrowser::GetBrowserProtocolLink()


TSubclassOf< UInternetBrowserSaveGame > InternetBrowserSaveGameClass

Defined in InternetBrowser.h:241 Save game class for saving loading browser properties.


TArray< FString > WhitelistWebsites

Defined in InternetBrowser.h:245 If “Show Whitelist Only” is enabled then Web Browser will only allow to load web pages defined in this array. Accessing any web page not defined in this array will show error page.


TArray< FBrowserBookmark > Bookmarks

Defined in InternetBrowser.h:249 Browser bookmarks.


UButton * BackButton

Defined in InternetBrowser.h:252


UButton * ForwardButton

Defined in InternetBrowser.h:255


UButton * ReloadButton

Defined in InternetBrowser.h:258


UEditableTextBox * Addressbar

Defined in InternetBrowser.h:261


TSharedPtr< SWebBrowser > WebBrowserWidget

Defined in InternetBrowser.h:263


FString LastLoadedURL

Defined in InternetBrowser.h:266


FBrowserCookie Cookie
TMap< FString, FString > SavedBookmarks

Defined in InternetBrowser.h:272