WebView Lifecycle, Measure returns rework and iframes support #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This update contains the following:
New Measure Number Values
The measure's number value now represents the state of WebView2 before any navigation, and the state of the navigation afterwards. The following numbers apply:
-2-101100200300400New Measure String Value
Current URLNow the measure will return the current url whenever is available.
Example:
https://www.forum.rainmeter.net/New Actions
To reflect states, we also have new actions.
OnWebViewStopActionTriggers when WebView stops successfully.
OnStateChangeActionTriggers every time the state changes
OnUrlChangeActionTriggers every time the URL changes
OnPageDOMLoadActionTrigger when the DOM content finishes loading, it triggers before
OnPageLoadFinishAction.New Commands
As a part of the new lifecycle system, we can now start and stop WebView by using the following commands.
StopStops any navigation.
GoHomeNavigates to the URL set on the measure's
URLoption.WebViewStartStarts WebView manually if not running.
WebViewStopStops WebView manually if running.
WebViewRestartRestarts WebView manually if running.
New Options
AllowNewWindowdefault:0When enabled, the user will be able to open new windows, while disabled all navigations will happen on the main window.
AllowNotificationsdefault:0WebView doesn't allow to use the Notifications API by default, now we can use it by setting this option to
1.AutoStartdefalut:1When disabled, WebView will not start automatically when the skin loads.
Other Changes
URLoption on the measure now works as a Home Page URL, to navigate you now have to use theNavigatecommand. To navigate back to the home page set on theURLoption you now use theGoHomecommand. In other words, updating theURLoption will not navigate to it, it will only set the new URL as the Home Page.ExecuteScriptwill inject to the main document and all available top-level iframes when possible.http-server. This works by bypassingX-Frame-Optionsand injecting our own "frame ancestor", which would be the current URL that is trying to frame, e.g.http://localhost:port. More information on how to use ahttp-serverhere.Bug Fixes