Commit Graph

138 Commits

Author SHA1 Message Date
Tobias Taschner
ab7098b33b Add note to RunScript() to recommend RunScriptAsync() 2021-11-05 10:04:45 +01:00
Tobias Taschner
9114122837 Additional wxWebView::RunScriptAsync() documentation 2021-11-03 14:04:23 +01:00
Tobias Taschner
d31f1dc400 Add wxWebViewEvent::IsError() 2021-11-03 13:35:24 +01:00
Tobias Taschner
d93db6bba5 Add initial RunScriptAsync() documentation 2021-11-03 11:19:09 +01:00
Tobias Taschner
a756ed93c2 wxWebViewEdge: Improve wxEVT_WEBVIEW_LOADED
Previously the edge event ContentLoading was used which was
triggered earlier than DOMContentLoaded. This event wasn't
available in earlier SDK versions.

Minimum required SDK version is now:
1.0.705.50 (Released 2021-01-25)

Fixes #19202

See https://github.com/wxWidgets/wxWidgets/pull/2468
2021-08-17 23:50:13 +02:00
Ian McInerney
33c1088aad Escape the HTML tags in the doxygen comments 2021-05-21 02:26:31 +01:00
Ian McInerney
4bb1fe8e0a Fix doxygen section bugs 2021-05-21 02:26:24 +01:00
Vadim Zeitlin
4a08c5f965 Document wxWebView backend name constants
Mention the constants that are used to identify the backends.

Closes #19168.
2021-05-01 14:25:18 +02:00
Tobias Taschner
97e469c255 Add access to user agent for wxWebView
Allow setting a custom user agent for a webview.
Also allow access to the current user agent.
2021-03-16 22:53:00 +01:00
Vadim Zeitlin
c88f23db3e Merge branch 'doc_misc' of https://github.com/TcT2k/wxWidgets
Various wxWebView docs improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2266
2021-03-13 13:27:00 +01:00
Blake Madden
28d705424b Fix double words and article mismatches in docs. 2021-03-10 14:28:20 -05:00
Tobias Taschner
ecce094522 Document previously missing macOS wxWebView features 2021-03-09 22:13:15 +01:00
Tobias Taschner
b493970336 Apply suggestions from code review
Co-authored-by: VZ <vz-github@zeitlins.org>
2021-03-09 22:09:16 +01:00
Tobias Taschner
4e2b746ec2 Update wxWebView documentation
- Use subsections
- Unify layout of backend sections
- Refer to backends by consistent naming
- Remove Trident reference (while technically correct it's probably not very helpful for most)
- Add a warning to IE backend
- Add wxWebViewEdge doc
- Add missing event from wxWebViewEvent docs
2021-03-09 22:09:16 +01:00
Tobias Taschner
1e42ea4e97 Update some outdated notes from wxWebView docs 2021-03-09 22:09:15 +01:00
Tobias Taschner
80c04e3941 Merge branch 'master' into webview_script_message 2021-03-01 09:57:13 +01:00
Maarten Bent
7532532800 Mention GCC/Clang support in wxWebViewEdge documentation
And add a comment explaining the name of the EventRegistrationToken include guard.
2021-03-01 00:09:23 +01:00
Tobias Taschner
5a30bbe38f Apply suggestions from code review
Co-authored-by: PB <PBforDev@gmail.com>
2021-02-28 22:33:15 +01:00
Tobias Taschner
f419240335 Add Apple transport security to wxWebView docs 2021-02-28 20:44:38 +01:00
Tobias Taschner
ca5133fff7 Add usage documentation to wxWebView::AddScriptMessageHandler() 2021-02-28 20:41:49 +01:00
Tobias Taschner
575ae90d85 Fix trailing whitespace 2021-02-28 20:03:36 +01:00
Tobias Taschner
6f7ac6a934 Add wxWebView::AddUserScript()
This allows to inject javascript code across multiple pages
2021-02-26 23:41:39 +01:00
Tobias Taschner
f2bfa7d446 Initial AddScriptMessageHandler() documentation 2021-02-26 22:35:49 +01:00
Tobias Taschner
b1d558a612 Disabled dev tools per default for Edge
This unifies the behavior among backends and is probably
the more useful default for most applications.
2021-02-26 21:55:10 +01:00
Tobias Taschner
3af4702b11 Implement wxWebView::EnableAccessToDevTools() for GTK 2021-02-26 18:53:46 +01:00
Tobias Taschner
c3d0d7d000 Identify script handler in message event 2021-02-26 16:59:56 +01:00
Tobias Taschner
011035ef08 Add wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED event 2021-02-26 15:41:41 +01:00
Tobias Taschner
e09063186c Provide generic wxWebView::Find() implementation
This implementation is based on javascript 'window.find()'
https://developer.mozilla.org/en-US/docs/Web/API/Window/find
It's not standard, but implemented in most browsers.

It's not a complete implementation as it can't determine how
many search results can be found.

If the backends API provides a native find interface it should be
used instead of this implementation, but it's good fallback.
2021-02-10 23:55:18 +01:00
Tobias Taschner
5512089d5b Apply suggestions from code review
Co-authored-by: VZ <vz-github@zeitlins.org>
2021-02-09 23:35:01 +01:00
Tobias Taschner
a3f85e9cd5 Implement wxEVT_WEBVIEW_FULLSCREEN_CHANGED in GTK 2021-02-09 22:28:29 +01:00
Tobias Taschner
f6a23a0431 Add wxEVT_WEBVIEW_FULLSCREEN_CHANGED event
The event is triggered by wxWebView when the page requests fullscreen view.

It's currently only implemented for the edge backend.
2021-02-09 22:28:29 +01:00
Tobias Taschner
1ee05c54ed CMake: Download SDK when wxUSE_WEBVIEW_EDGE=ON
Automatically download the WebView2 SDK from nuget (official repo for the SDK)
when enabling wxUSE_WEBVIEW_EDGE to simplify usage.
Copying to 3rdparty/webview2 is still supported optionally.
2021-02-08 21:29:08 +01:00
Tobias Taschner
d17e8978a6 Make wxWebView::RunScript() const 2021-02-05 22:18:31 +01:00
Tobias Taschner
788bef2cf2 Select Edge as the default backend on MSW
If enabled and available at runtime use the Edge backend.
This is probably more useful for most users.
2021-02-05 22:18:29 +01:00
Tobias Taschner
b351e7762d Move common wxWebView code to base class
Removes duplicate code in the various webview backends
2021-02-05 22:18:29 +01:00
Tobias Taschner
0d82348328 Add wxWebView::GetBackendVersionInfo()
Allows to get the WebView backend version if available
Currently implemented for IE, Edge and webkit2.
2021-02-05 22:18:28 +01:00
Tobias Taschner
489afb3336 Allow using a fixed version with wxWebViewEdge
A fixed version may be distributed with the application
and wxWebViewEdge::MSWSetBrowserExecutableDir() allows
it's usage with wxWebViewEdge.
2021-02-05 22:18:28 +01:00
Tobias Taschner
10398b8f72 macOS: Document missing wxWebView features and don't test for them 2020-12-14 13:40:32 +01:00
Tobias Taschner
4df334cec4 macOS/iOS: Use WKWebView for wxWebView Implementation
WKWebView replaces
WebView on macOS (available since 10.10, deprecated since 10.14) and
UIWebView on iOS (available since 8.0 deprecated since 10.0).
Using WKWebView ensures future compatiblity and unifies the interface
used for iOS and macOS.
2020-12-14 10:18:01 +01:00
Tobias Taschner
46d123b953 WebViewEdge: Allow edge webview2 installation during runtime
Check if edge webview runtime is available in the call to
wxWebView::IsBackendAvailable() instead of only doing it during
process initialization. This allows an application to install
the Edge WebView2 Runtime during runtime and use the edge webview
afterwards without restarting the process.
2020-11-06 09:19:17 +01:00
Tobias Taschner
038782a684 Update WebView Edge min required version to 1.0.622.22
While technically it still builds with older versions,
version 1.0.622.22 ist the first non preview release which should
make the included webview loader DLL the most compatible for the
forseable future.
2020-10-20 15:12:09 +02:00
Maarten Bent
300fe1a6f9 Add option to wxWebViewHandler to set a custom security URL
This will be used by wxWebViewIE to modify the security URL and domain when
parsing a URL.
2020-07-28 21:22:21 +02:00
Tobias Taschner
1666f58bc6 Change documentation references from OS X to macOS (#1927)
Since OS X 10.12 it has been named macOS so it makes sense
to reference it in documentation as such, even when it
sometimes refers to older versions which were called (Mac) OS X.
2020-07-04 22:08:24 +02:00
Vadim Zeitlin
d7f19ee610 Fix spelling in comments and documentation using codespell
Apply the utility from https://github.com/codespell-project/codespell/
to fix spelling issues in the headers under both include and interface
directories and add a file with a couple of exceptions.

The exact command line used was:

    $ codespell -w -I misc/scripts/codespell.ignore -i 3 in*
2020-06-27 22:56:22 +02:00
Hertatijanto Hartono
895424ecc0 Add wxWebView::SetZoomFactor(float) and GetZoomFactor()
The new method allows to set the zoom level more precisely than the
existing SetZoom(wxWebViewZoom).

Also improve the webview sample by using radio menu items instead of
check items and manually resetting them.

Closes https://github.com/wxWidgets/wxWidgets/pull/1894

Closes #18769.
2020-06-18 03:13:00 +02:00
Tobias Taschner
7d1c40ecf5 Updated wxWebViewEdge for SDK to 0.9.488
Requires Edge 84.0.488.0 or newer

Another SDK release before 1.0 includes some
breaking changes regarding naming
2020-04-20 23:00:10 +02:00
Tobias Taschner
613687ecb5 Updated wxWebViewEdge for SDK 0.9.430
This first beta release of the WebView2 SDK has many identifiers
renamed and webview interfaces split to Host and WebView.

Closes https://github.com/wxWidgets/wxWidgets/pull/1743
2020-02-29 15:40:45 +01:00
Vadim Zeitlin
0b2dd516c1 Slightly improve Edge webview backend setup instructions
Make it even more clear where should the files go and which files should
be copied, to avoid any ambiguity.
2020-01-22 03:36:38 +01:00
Tobias Taschner
fb0e82e9d1 Implement GetPageSource() and GetPageText() 2020-01-17 21:09:51 +01:00
Tobias Taschner
bb508dc347 Implement text selection in wxWebViewEdge
Text selection/copy/paste etc implemented via javascript
2020-01-16 20:50:26 +01:00