29#if JUCE_WEB_BROWSER || DOXYGEN
142 return withMember (*
this, &WinWebView2::backgroundColour, colour);
146 File getDLLLocation()
const {
return dllLocation; }
147 File getUserDataFolder()
const {
return userDataFolder; }
148 bool getIsStatusBarDisabled() const noexcept {
return disableStatusBar; }
149 bool getIsBuiltInErrorPageDisabled() const noexcept {
return disableBuiltInErrorPage; }
150 Colour getBackgroundColour()
const {
return backgroundColour; }
154 File dllLocation, userDataFolder;
155 bool disableStatusBar =
false, disableBuiltInErrorPage =
false;
156 Colour backgroundColour;
159 [[nodiscard]] Options withWinWebView2Options (
const WinWebView2& winWebView2Options)
const
161 return withMember (*
this, &Options::winWebView2, winWebView2Options);
165 Backend getBackend() const noexcept {
return browserBackend; }
166 bool keepsPageLoadedWhenBrowserIsHidden() const noexcept {
return keepPageLoadedWhenBrowserIsHidden; }
167 String getUserAgent()
const {
return userAgent; }
168 WinWebView2 getWinWebView2BackendOptions()
const {
return winWebView2; }
172 Backend browserBackend = Backend::defaultBackend;
173 bool keepPageLoadedWhenBrowserIsHidden =
false;
175 WinWebView2 winWebView2;
232 virtual bool pageAboutToLoad (
const String& newURL);
235 virtual void pageFinishedLoading (
const String& url);
247 virtual bool pageLoadHadNetworkError (
const String& errorInfo);
252 virtual void windowCloseRequest();
258 virtual void newWindowAttemptingToLoad (
const String& newURL);
278 return std::make_unique<AccessibilityHandler> (*
this, AccessibilityRole::group);
283 bool blankPageShown =
false, unloadPageWhenHidden;
288 void reloadLastURL();
289 void checkWindowAssociation();
Represents a colour, also including a transparency value.
bool isOpaque() const noexcept
Returns true if this colour is completely opaque.
bool isTransparent() const noexcept
Returns true if this colour is completely transparent.
The base class for all JUCE user-interface objects.
FocusChangeType
Enumeration used by the focusGained() and focusLost() methods.
FocusChangeDirection
Enumeration used by the focusGainedWithDirection() method.
Represents a local file or directory.
A graphics context, used for drawing a component or image.
A class to hold a resizable block of raw data.
A special array for holding a list of strings.
Options specific to the WebView2 backend.
WinWebView2 withBackgroundColour(const Colour &colour) const
Sets the background colour that WebView2 renders underneath all web content.
WinWebView2 withStatusBarDisabled() const
If this is set, the status bar usually displayed in the lower-left of the webview will be disabled.
WinWebView2 withUserDataFolder(const File &folder) const
Sets a non-default location for storing user data for the browser instance.
WinWebView2 withBuiltInErrorPageDisabled() const
If this is set, a blank page will be displayed on error instead of the default built-in error page.
WinWebView2 withDLLLocation(const File &location) const
Sets a custom location for the WebView2Loader.dll that is not a part of the standard system DLL searc...
Options to configure WebBrowserComponent.
Options withKeepPageLoadedWhenBrowserIsHidden() const
Tell JUCE to keep the web page alive when the WebBrowserComponent is not visible.
Options withBackend(Backend backend) const
Use a particular backend to create the WebViewBrowserComponent.
Options withUserAgent(String ua) const
Use a specific user agent string when requesting web pages.
A component that displays an embedded web browser.
static void clearCookies()
Clear cookies that the OS has stored for the WebComponents of this application.
void goBack()
Sends the browser back one page.
void goForward()
Sends the browser forward one page.
void parentHierarchyChanged() override
Called to indicate that the component's parents have changed.
void refresh()
Refreshes the browser.
void paint(Graphics &) override
Components can override this method to draw their content.
void resized() override
Called when this component's size has been changed.
WebBrowserComponent()
Creates a WebBrowserComponent with default options.
static bool areOptionsSupported(const Options &options)
Check if the specified options are supported on this platform.
void focusGainedWithDirection(FocusChangeType, FocusChangeDirection) override
Called to indicate that this component has just acquired the keyboard focus.
void visibilityChanged() override
Called when this component's visibility changes.
void stop()
Stops the current page loading.
WebBrowserComponent(const Options &options)
Creates a WebBrowserComponent.
void goToURL(const String &url, const StringArray *headers=nullptr, const MemoryBlock *postData=nullptr)
Sends the browser to a particular URL.
~WebBrowserComponent() override
Destructor.
Object withMember(Object copy, Member OtherObject::*member, Other &&value)
Copies an object, sets one of the copy's members to the specified value, and then returns the copy.