-
Notifications
You must be signed in to change notification settings - Fork 1
Reworks #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: working2
Are you sure you want to change the base?
Reworks #12
Conversation
Turned off put_AllowHostInputProcessing due to it messing with AllowDualControl. Should be turned on once we start implementing a Non-JS AllowDualControl version.
|
Thank you for the PR. I will test it and merge it after I return home. |
|
RicardoTM, could you please publish the compiled DLL with the changes? |
Sure, you'll find it here |
|
I'm ok with the direction (values, actions, commands, options) this is going (looks like CallJS will be the only way to return a value from the plugin, which is fine with me - we'll see if and what can be done on the sync issue). A bit crowded now with stuff, but each thing is useful in some way. That being said, this crashes Rainmeter on skin refresh every time for me, so, unless there is some mistake in my code (doubt it, since all I do is refresh the skin and whatever stuff ahead of this version should be invalid and gracefully be ignored), it needs to be redone / fixed in that regard. By the way, Ricardo, the test builds corresponding to this (with roughly the same changes) that you sent me were fine and not experiencing these issues, only this one you posted now. Here is the code I'm using, for reference - it includes some of my tests, but they don't matter to this, just the .ini file: |
|
Oh yeah, I had fixed that before but forgot to do it for this branch. I’ll update it when I get on the PC. Thanks for letting me know. |
…to false Turned off put_AllowHostInputProcessing due to it messing with AllowDualControl. Should be turned on once we start implementing a Non-JS AllowDualControl version. Stop WebView on Finalize to avoid crashes.
|
Crash is fixed, updated the file on #9 (comment). Please test |
|
Just an update, I've found how to inject nested frames. I will commit again after I get it properly tested and make sure everything works fine. Edit: Now we are just waiting for @Yincognyto to finish his fix for AllowDualControl's misalign and if possible for YouTube and this will be ready to be merged. |
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
window.OnInitializeandwindow.OnUpdateno longer change the measure’s string nor number values.URLoption on the measure now works as a Home Page URL and is the URL to which WebView will navigate after starting. To navigate somewhere else 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 base URL that is trying to frame, e.g.http://localhost:port/. More information on how to use ahttp-serverhere.Bug Fixes
Known Issues