UInternetBrowser
#include <InternetBrowserUMG/Public/InternetBrowser.h>class UInternetBrowserDefined in InternetBrowser.h:203
Inherits:
UWidget
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UInternetBrowser["UInternetBrowser"]
class UWidget["UWidget"]
UWidget <|-- UInternetBrowser
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UInternetBrowser["UInternetBrowser"]
class UInternetBrowserSaveGame["UInternetBrowserSaveGame"]
UInternetBrowser *-- UInternetBrowserSaveGame
class FBrowserBookmark["FBrowserBookmark"]
UInternetBrowser *-- FBrowserBookmark
class FBrowserCookie["FBrowserCookie"]
UInternetBrowser *-- FBrowserCookie
Class detail
Section titled “Class detail”---
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.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
FOnAccessDenied | OnAccessDenied | |
FOnBeforePopup | OnBeforePopup | |
FOnUrlChanged | OnUrlChanged | |
FOnWebBrowserLoadStarted | OnLoadStarted | |
FOnWebBrowserLoadCompleted | OnLoadCompleted | |
FOnWebBrowserLoadError | OnLoadError | |
FOnLoadBrowserURL | OnLoadBrowserURL |
OnAccessDenied
Section titled “OnAccessDenied”FOnAccessDenied OnAccessDeniedDefined in InternetBrowser.h:277
Referenced by
Section titled “Referenced by”OnBeforePopup
Section titled “OnBeforePopup”FOnBeforePopup OnBeforePopupDefined in InternetBrowser.h:281
Section titled “Defined in InternetBrowser.h:281”OnUrlChanged
Section titled “OnUrlChanged”FOnUrlChanged OnUrlChangedDefined in InternetBrowser.h:285
Section titled “Defined in InternetBrowser.h:285”OnLoadStarted
Section titled “OnLoadStarted”FOnWebBrowserLoadStarted OnLoadStartedDefined in InternetBrowser.h:289
Section titled “Defined in InternetBrowser.h:289”OnLoadCompleted
Section titled “OnLoadCompleted”FOnWebBrowserLoadCompleted OnLoadCompletedDefined in InternetBrowser.h:293
Section titled “Defined in InternetBrowser.h:293”OnLoadError
Section titled “OnLoadError”FOnWebBrowserLoadError OnLoadErrorDefined in InternetBrowser.h:297
Section titled “Defined in InternetBrowser.h:297”OnLoadBrowserURL
Section titled “OnLoadBrowserURL”FOnLoadBrowserURL OnLoadBrowserURLDefined in InternetBrowser.h:301
Referenced by
Section titled “Referenced by”Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UInternetBrowser | ||
TSharedRef< SWidget > | RebuildWidget virtual override | |
void | ReleaseSlateResources virtual override | |
void | InitializeInternetBrowser | public UInternetBrowser::InitializeInternetBrowser Assign delegates to back, forward, reload buttons and address bar. Make sure you assign them first. Load initial URL. |
bool | LoadURL | 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 |
void | LoadString | public UInternetBrowser::LoadString Load a string as data to create a web page. |
void | ExecuteJavascript | public UInternetBrowser::ExecuteJavascript Execute javascript on the current window |
void | AddBookmark | public UInternetBrowser::AddBookmark Adds the given bookmark to bookmarks array. |
void | RemoveBookmark | public UInternetBrowser::RemoveBookmark Removes the given bookmark. |
TArray< FBrowserBookmark > | GetBookmarks const inline | public UInternetBrowser::GetBookmarks const Returns all the bookmarks. |
void | SetCookie | 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. |
void | SetCookieForAll | 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. |
void | DeleteCookie | public UInternetBrowser::DeleteCookie Deletes the given cookie for the given URL. |
void | DeleteAllCookies | public UInternetBrowser::DeleteAllCookies Delete the entire cookie database. |
FString | GetCookieName const inline | public UInternetBrowser::GetCookieName const Gets the name of the given cookie. |
FText | GetTitleText const | public UInternetBrowser::GetTitleText const Gets the title of the loaded URL. |
FString | GetUrl const | public UInternetBrowser::GetUrl const Returns the currently loaded URL. |
FText | GetAddressbarUrl const | 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. |
FString | GetBrowserProtocolLink const | public UInternetBrowser::GetBrowserProtocolLink const Gets the protocol link for this browser. Similar to chrome:// @See BrowserIdentifier variable. |
TArray< FInternetBrowserHistory > | GetHistory const | public UInternetBrowser::GetHistory const Returns array of FWebHistory. This array contains all the web pages the user has visited if History is enabled. |
UInternetBrowser
Section titled “UInternetBrowser”UInternetBrowser(const FObjectInitializer & ObjectInitializer)Defined in InternetBrowser.h:303
References
Section titled “References”bEnableHistorybOnlyHTTPSBrowserIdentifierbShowWhitelistOnlybSupportBrowserURLsbSupportLocalhostbSupportsTransparencyInitialURLInternetBrowserSaveGameClass
RebuildWidget
Section titled “RebuildWidget”virtual override
virtual TSharedRef< SWidget > RebuildWidget() overrideDefined in InternetBrowser.h:305
References
Section titled “References”ReleaseSlateResources
Section titled “ReleaseSlateResources”virtual override
virtual void ReleaseSlateResources(bool bReleaseChildren) overrideDefined in InternetBrowser.h:306
References
Section titled “References”InitializeInternetBrowser
Section titled “InitializeInternetBrowser”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.
Parameters
Section titled “Parameters”InOverrideURL[const FText]
References
Section titled “References”AddressbarBackButtonForwardButtonIBROWSER_ERRIBROWSER_LOGInitialURLLoadURLReloadButtonReloadWebPage
LoadURL
Section titled “LoadURL”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
Parameters
Section titled “Parameters”URL[const FText &] URL to load. Adds https:// protocol if not present.
Returns
Section titled “Returns”[bool] True if URL is loaded.
Referenced by
Section titled “Referenced by”References
Section titled “References”AddressbarbOnlyHTTPSbShowWhitelistOnlyLastLoadedURLOnAccessDeniedOnLoadBrowserURLWebBrowserWidgetWhitelistWebsites
LoadString
Section titled “LoadString”void LoadString(FString Contents, FString DummyURL)Defined in InternetBrowser.h:346 public UInternetBrowser::LoadString Load a string as data to create a web page.
Parameters
Section titled “Parameters”-
Contents[FString] HTML string to load. -
DummyURL[FString] Dummy URL for the page.
References
Section titled “References”ExecuteJavascript
Section titled “ExecuteJavascript”void ExecuteJavascript(const FString & ScriptText)Defined in InternetBrowser.h:354 public UInternetBrowser::ExecuteJavascript Execute javascript on the current window
Parameters
Section titled “Parameters”ScriptText[const FString&] Javascript to execute.
References
Section titled “References”AddBookmark
Section titled “AddBookmark”void AddBookmark(const FBrowserBookmark & InBookmark)Defined in InternetBrowser.h:362 public UInternetBrowser::AddBookmark Adds the given bookmark to bookmarks array.
Parameters
Section titled “Parameters”InBookmark[const FBrowserBookmark&] Bookmark struct.
References
Section titled “References”RemoveBookmark
Section titled “RemoveBookmark”void RemoveBookmark(const FBrowserBookmark & InBookmark)Defined in InternetBrowser.h:370 public UInternetBrowser::RemoveBookmark Removes the given bookmark.
Parameters
Section titled “Parameters”InBookmark[const FBrowserBookmark&] Bookmark struct.
References
Section titled “References”GetBookmarks
Section titled “GetBookmarks”const inline
inline TArray< FBrowserBookmark > GetBookmarks() constDefined in InternetBrowser.h:378 public UInternetBrowser::GetBookmarks const Returns all the bookmarks.
Returns
Section titled “Returns”[TArray<FBrowserBookmark>] Bookmarks array.
Referenced by
Section titled “Referenced by”SetCookie
Section titled “SetCookie”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.
Parameters
Section titled “Parameters”-
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.
Referenced by
Section titled “Referenced by”References
Section titled “References”SetCookieForAll
Section titled “SetCookieForAll”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.
Parameters
Section titled “Parameters”-
InCookie[const FBrowserCookie&] Cookie to set. -
Delegate[FOnCookieSetComplete] A callback delegate that will be invoked when the set is complete passing success bool.
References
Section titled “References”DeleteCookie
Section titled “DeleteCookie”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.
Parameters
Section titled “Parameters”-
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.
Referenced by
Section titled “Referenced by”DeleteAllCookies
Section titled “DeleteAllCookies”void DeleteAllCookies(FOnCookieDeleteComplete Delegate)Defined in InternetBrowser.h:421 public UInternetBrowser::DeleteAllCookies Delete the entire cookie database.
Parameters
Section titled “Parameters”Delegate[FOnCookieDeleteComplete] A callback delegate that will be invoked when the deletion is complete passing number of deleted cookies.
References
Section titled “References”GetCookieName
Section titled “GetCookieName”const inline
inline FString GetCookieName(const FBrowserCookie & InCookie) constDefined in InternetBrowser.h:430 public UInternetBrowser::GetCookieName const Gets the name of the given cookie.
Parameters
Section titled “Parameters”InCookie[const FBrowserCookie&] Cookie to get the name from.
Returns
Section titled “Returns”[FString] Name of the cookie.
GetTitleText
Section titled “GetTitleText”const
FText GetTitleText() constDefined in InternetBrowser.h:438 public UInternetBrowser::GetTitleText const Gets the title of the loaded URL.
Returns
Section titled “Returns”[FText] Title for the loaded URL.
References
Section titled “References”GetUrl
Section titled “GetUrl”const
FString GetUrl() constDefined in InternetBrowser.h:446 public UInternetBrowser::GetUrl const Returns the currently loaded URL.
Returns
Section titled “Returns”[FString] Currently loaded URL.
References
Section titled “References”GetAddressbarUrl
Section titled “GetAddressbarUrl”const
FText GetAddressbarUrl() constDefined 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.
Returns
Section titled “Returns”[FText] URL that appears in the address bar
References
Section titled “References”GetBrowserProtocolLink
Section titled “GetBrowserProtocolLink”const
FString GetBrowserProtocolLink() constDefined in InternetBrowser.h:472 public UInternetBrowser::GetBrowserProtocolLink const Gets the protocol link for this browser. Similar to chrome:// @See BrowserIdentifier variable.
Returns
Section titled “Returns”[FString] Returns browser protocol link.
References
Section titled “References”GetHistory
Section titled “GetHistory”const
TArray< FInternetBrowserHistory > GetHistory() constDefined 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.
Returns
Section titled “Returns”[TArray<FWebHistory>] History array.
References
Section titled “References”Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
bool | IsHistoryValid static inline | public static UInternetBrowser::IsHistoryValid Checks if the given history is a valid entry. |
FText | GetCleanDomainName static | 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 |
IsHistoryValid
Section titled “IsHistoryValid”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.
Parameters
Section titled “Parameters”InHistory[const FInternetBrowserHistory&] History struct to check.
GetCleanDomainName
Section titled “GetCleanDomainName”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
Parameters
Section titled “Parameters”InURL[const FText&] URL to get
Returns
Section titled “Returns”[FText] Proper domain name.
Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | ReloadWebPage | Reloads the current web page in the internet browser. |
ReloadWebPage
Section titled “ReloadWebPage”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.
Referenced by
Section titled “Referenced by”References
Section titled “References”Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
FString | InitialURL | URL that the browser will initially navigate to. The URL should include the protocol, eg http:// |
uint8 | bSupportsTransparency | Should the browser window support transparency. |
uint8 | bShowWhitelistOnly | If enabled, web browser widget will only load websites provided in WhitelistWebsites array. |
uint8 | bEnableHistory | If enabled, web browser will add visited websites to History. |
uint8 | bOnlyHTTPS | If enabled, web browser will convert http to https. |
uint8 | bSupportBrowserURLs | If enabled, then support browser protocol link similar to chrome://. @See BrowserIdentifier |
uint8 | bSupportLocalhost | Support localhost and 127.0.0.1 |
FName | BrowserIdentifier | [NOT YET IMPLEMENTED] An internal identifier used for browser urls. @See UInternetBrowser::GetBrowserProtocolLink() |
TSubclassOf< UInternetBrowserSaveGame > | InternetBrowserSaveGameClass | Save game class for saving loading browser properties. |
TArray< FString > | WhitelistWebsites | 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 | Browser bookmarks. |
UButton * | BackButton | |
UButton * | ForwardButton | |
UButton * | ReloadButton | |
UEditableTextBox * | Addressbar | |
TSharedPtr< SWebBrowser > | WebBrowserWidget | |
FString | LastLoadedURL | |
FBrowserCookie | Cookie | |
TMap< FString, FString > | SavedBookmarks |
InitialURL
Section titled “InitialURL”FString InitialURLDefined in InternetBrowser.h:209 URL that the browser will initially navigate to. The URL should include the protocol, eg http://
Referenced by
Section titled “Referenced by”bSupportsTransparency
Section titled “bSupportsTransparency”uint8 bSupportsTransparencyDefined in InternetBrowser.h:213 Should the browser window support transparency.
Referenced by
Section titled “Referenced by”bShowWhitelistOnly
Section titled “bShowWhitelistOnly”uint8 bShowWhitelistOnlyDefined in InternetBrowser.h:217 If enabled, web browser widget will only load websites provided in WhitelistWebsites array.
Referenced by
Section titled “Referenced by”bEnableHistory
Section titled “bEnableHistory”uint8 bEnableHistoryDefined in InternetBrowser.h:221 If enabled, web browser will add visited websites to History.
Referenced by
Section titled “Referenced by”bOnlyHTTPS
Section titled “bOnlyHTTPS”uint8 bOnlyHTTPSDefined in InternetBrowser.h:225 If enabled, web browser will convert http to https.
Referenced by
Section titled “Referenced by”bSupportBrowserURLs
Section titled “bSupportBrowserURLs”uint8 bSupportBrowserURLsDefined in InternetBrowser.h:229 If enabled, then support browser protocol link similar to chrome://. @See BrowserIdentifier
Referenced by
Section titled “Referenced by”bSupportLocalhost
Section titled “bSupportLocalhost”uint8 bSupportLocalhostDefined in InternetBrowser.h:233 Support localhost and 127.0.0.1
Referenced by
Section titled “Referenced by”BrowserIdentifier
Section titled “BrowserIdentifier”FName BrowserIdentifierDefined in InternetBrowser.h:237 [NOT YET IMPLEMENTED] An internal identifier used for browser urls. @See UInternetBrowser::GetBrowserProtocolLink()
Referenced by
Section titled “Referenced by”InternetBrowserSaveGameClass
Section titled “InternetBrowserSaveGameClass”TSubclassOf< UInternetBrowserSaveGame > InternetBrowserSaveGameClassDefined in InternetBrowser.h:241 Save game class for saving loading browser properties.
Referenced by
Section titled “Referenced by”WhitelistWebsites
Section titled “WhitelistWebsites”TArray< FString > WhitelistWebsitesDefined 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.
Referenced by
Section titled “Referenced by”Bookmarks
Section titled “Bookmarks”TArray< FBrowserBookmark > BookmarksDefined in InternetBrowser.h:249 Browser bookmarks.
Referenced by
Section titled “Referenced by”BackButton
Section titled “BackButton”UButton * BackButtonDefined in InternetBrowser.h:252
Referenced by
Section titled “Referenced by”ForwardButton
Section titled “ForwardButton”UButton * ForwardButtonDefined in InternetBrowser.h:255
Referenced by
Section titled “Referenced by”ReloadButton
Section titled “ReloadButton”UButton * ReloadButtonDefined in InternetBrowser.h:258
Referenced by
Section titled “Referenced by”Addressbar
Section titled “Addressbar”UEditableTextBox * AddressbarDefined in InternetBrowser.h:261
Referenced by
Section titled “Referenced by”WebBrowserWidget
Section titled “WebBrowserWidget”TSharedPtr< SWebBrowser > WebBrowserWidgetDefined in InternetBrowser.h:263
Referenced by
Section titled “Referenced by”ExecuteJavascriptGetAddressbarUrlGetTitleTextGetUrlLoadStringLoadURLRebuildWidgetReleaseSlateResourcesReloadWebPage
LastLoadedURL
Section titled “LastLoadedURL”FString LastLoadedURLDefined in InternetBrowser.h:266
Referenced by
Section titled “Referenced by”Cookie
Section titled “Cookie”FBrowserCookie CookieDefined in InternetBrowser.h:269
Section titled “Defined in InternetBrowser.h:269”SavedBookmarks
Section titled “SavedBookmarks”TMap< FString, FString > SavedBookmarksDefined in InternetBrowser.h:272