Skip to content

Conversation

@RicardoTM05
Copy link
Contributor

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:

  • WebView failed: -2
  • WebView not running: -1
  • WebView Initializing: 0
  • WebView Initialized: 1
  • Navigation Start: 100
  • Loading Site: 200
  • DOM Content loaded: 300
  • Navigation Complete: 400

New Measure String Value

  • Current URL
    Now 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.

  • OnWebViewStopAction
    Triggers when WebView stops successfully.
  • OnStateChangeAction
    Triggers every time the state changes
  • OnUrlChangeAction
    Triggers every time the URL changes
  • OnPageDOMLoadAction
    Trigger 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.

  • Stop
    Stops any navigation.
  • GoHome
    Navigates to the URL set on the measure's URL option.
  • WebViewStart
    Starts WebView manually if not running.
  • WebViewStop
    Stops WebView manually if running.
  • WebViewRestart
    Restarts WebView manually if running.

New Options

  • AllowNewWindow default: 0
    When enabled, the user will be able to open new windows, while disabled all navigations will happen on the main window.
  • AllowNotifications default: 0
    WebView doesn't allow to use the Notifications API by default, now we can use it by setting this option to 1.
    AutoStart defalut: 1
    When disabled, WebView will not start automatically when the skin loads.

Other Changes

  • The URL option on the measure now works as a Home Page URL, to navigate you now have to use the Navigate command. To navigate back to the home page set on the URL option you now use the GoHome command. In other words, updating the URL option will not navigate to it, it will only set the new URL as the Home Page.
  • Now ExecuteScript will inject to the main document and all available top-level iframes when possible.
  • Now websites won't be able to trigger undesired pop-up windows.
  • Disabling the measure will now disable all commands from triggering, and all options from updating until the measure is enabled. Navigation is not affected while the measure is disabled.
  • It is now possible to frame websites, but this requires the use of a http-server. This works by bypassing X-Frame-Options and 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 a http-server here.

Bug Fixes

  • Fixed a minor bug when dragging the skin while AllowDualControl was enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant