@@ -7,16 +7,20 @@ DynamicWindowSize=1
77Name =BangCommand
88Author =nstechbytes
99Information =Demonstrates controlling WebView2 via !CommandMeasure bangs.
10- Version =0.0.6
10+ Version =0.0.7
1111License =Creative Commons Attribution-Non-Commercial-Share Alike 3.0
1212
1313[Variables]
1414WebURL =https://nstechbytes.pages.dev/
1515WebW =600
16- WebH =350
16+ WebH =500
1717WebX =300
18- WebY =25
18+ WebY =45
19+ ZoomFactor =1.0
1920Hidden =0
21+ ClickThrough =0
22+ AllowDualControl =1
23+
2024; ========================================
2125; Measure
2226; ========================================
@@ -28,15 +32,25 @@ W=#WebW#
2832H =# WebH#
2933X =# WebX#
3034Y =# WebY#
35+ ZoomFactor =# ZoomFactor#
3136Hidden =# Hidden#
37+ ClickThrough =# ClickThrough#
38+ AllowDualControl =# AllowDualControl#
39+ OnWebViewLoadAction =[!log " WebView loaded succesfully!" ]
40+ OnWebViewFailAction =[!log " WebView failed :(" ]
41+ OnPageFirstLoadAction =[!log " First time on this page!" ]
42+ OnPageLoadStartAction =[!log " Navigation has started!" ]
43+ OnPageLoadingAction =[!log " Page is loading!" ]
44+ OnPageLoadFinishAction =[!log " Navigation has finished!" ]
45+ OnPageReloadAction =[!log " Page has been reloaded!" ]
3246DynamicVariables =1
3347
3448; ========================================
3549; Background
3650; ========================================
3751[MeterBackground]
3852Meter =Shape
39- Shape =Rectangle 0,0,950,420 ,12 | FillColor 0,0,0,200 | StrokeWidth 0
53+ Shape =Rectangle 0,0,920,570 ,12 | FillColor 0,0,0,200 | StrokeWidth 0
4054
4155[Title]
4256Meter =String
@@ -65,23 +79,23 @@ MeterStyle=StyleButtonText
6579Text =Navigate to Google (via Variable)
6680X =150
6781Y =58
68- LeftMouseUpAction =[!SetVariable WebURL " https://www.google.com" ][!UpdateMeasure MeasureWebView][!Redraw]
82+ LeftMouseUpAction =[!SetVariable WebURL " https://www.google.com" ][!UpdateMeasure MeasureWebView]
6983
7084[TxtNavigateGitHub]
7185Meter =String
7286MeterStyle =StyleButtonText
7387Text =Navigate to GitHub (via Variable)
7488X =150
7589Y =88
76- LeftMouseUpAction =[!SetVariable WebURL " https://github.com" ][!UpdateMeasure MeasureWebView][!Redraw]
90+ LeftMouseUpAction =[!SetVariable WebURL " https://github.com" ][!UpdateMeasure MeasureWebView]
7791
78- [TxtNavigateExample ]
92+ [TxtNavigateForum ]
7993Meter =String
8094MeterStyle =StyleButtonText
81- Text =Navigate to Example (via Bang)
95+ Text =Navigate to Forum (via Bang)
8296X =150
8397Y =118
84- LeftMouseUpAction =[!CommandMeasure MeasureWebView " Navigate https://example.com " ]
98+ LeftMouseUpAction =[!CommandMeasure MeasureWebView " Navigate https://forum.rainmeter.net/ " ]
8599
86100[TxtReload]
87101Meter =String
@@ -119,7 +133,7 @@ W=122
119133H =24
120134X =86
121135Y =208
122- LeftMouseUpAction =[!SetVariable Hidden 0][!UpdateMeasure MeasureWebView][!Redraw]
136+ LeftMouseUpAction =[!SetVariable Hidden 0][!UpdateMeasure MeasureWebView]
123137
124138[TxtHide]
125139Meter =String
@@ -129,15 +143,15 @@ W=125
129143H =24
130144X =212
131145Y =208
132- LeftMouseUpAction =[!SetVariable Hidden 1][!UpdateMeasure MeasureWebView][!Redraw]
146+ LeftMouseUpAction =[!SetVariable Hidden 1][!UpdateMeasure MeasureWebView]
133147
134148[TxtExecuteScript]
135149Meter =String
136150MeterStyle =StyleButtonText
137151Text =Execute Script
138152X =150
139153Y =238
140- LeftMouseUpAction =[!CommandMeasure MeasureWebView " ExecuteScript alert('Hello! ')" ]
154+ LeftMouseUpAction =[!CommandMeasure MeasureWebView " ExecuteScript console.log('Script has been executed. ')" ]
141155
142156[TxtOpenDevTools]
143157Meter =String
@@ -153,31 +167,73 @@ MeterStyle=StyleButtonText
153167Text =Set Width: 500 (via Variable)
154168X =150
155169Y =298
156- LeftMouseUpAction =[!SetVariable WebW 500][!UpdateMeasure MeasureWebView][!Redraw]
170+ LeftMouseUpAction =[!SetVariable WebW (# WebW#=600?500:600)][!UpdateMeasure MeasureWebView][!UpdateMeter #CURRENTSECTION#][!Redraw]
171+ DynamicVariables =1
157172
158173[TxtSetHeight]
159174Meter =String
160175MeterStyle =StyleButtonText
161176Text =Set Height: 400 (via Variable)
162177X =150
163178Y =328
164- LeftMouseUpAction =[!SetVariable WebH 400][!UpdateMeasure MeasureWebView][!Redraw]
179+ LeftMouseUpAction =[!SetVariable WebH (# WebH#=410?470:410)][!UpdateMeasure MeasureWebView][!UpdateMeter #CURRENTSECTION#][!Redraw]
180+ DynamicVariables =1
165181
166182[TxtSetX]
167183Meter =String
168184MeterStyle =StyleButtonText
169- Text =Set X: 100 (via Variable)
185+ Text =Set X: 320 (via Variable)
170186X =150
171187Y =358
172- LeftMouseUpAction =[!SetVariable WebX 100][!UpdateMeasure MeasureWebView][!Redraw]
188+ LeftMouseUpAction =[!SetVariable WebX (# WebX#=300?320:300)][!UpdateMeasure MeasureWebView][!UpdateMeter #CURRENTSECTION#][!Redraw]
189+ DynamicVariables =1
173190
174191[TxtSetY]
175192Meter =String
176193MeterStyle =StyleButtonText
177194Text =Set Y: 50 (via Variable)
178195X =150
179196Y =388
180- LeftMouseUpAction =[!SetVariable WebY 50][!UpdateMeasure MeasureWebView][!Redraw]
197+ LeftMouseUpAction =[!SetVariable WebY (# WebY#=45?50:45)][!UpdateMeasure MeasureWebView][!UpdateMeter #CURRENTSECTION#][!Redraw]
198+ DynamicVariables =1
181199
200+ [TxtSetZoom]
201+ Meter =String
202+ MeterStyle =StyleButtonText
203+ Text =Set ZoomFactor: 2.0 (via Variable)
204+ X =150
205+ Y =418
206+ LeftMouseUpAction =[!SetVariable ZoomFactor (# ZoomFactor#=1?2:1)][!UpdateMeasure MeasureWebView][!UpdateMeter #CURRENTSECTION#][!Redraw]
207+ DynamicVariables =1
182208
209+ [TxtSetEnableClickThrough]
210+ Meter =String
211+ MeterStyle =StyleButtonText
212+ Text =Set ClickThrough: 1 (via Variable)
213+ X =150
214+ Y =448
215+ LeftMouseUpAction =[!SetVariable ClickThrough 1][!UpdateMeasure MeasureWebView]
183216
217+ [TxtSetDisableClickThrough]
218+ Meter =String
219+ MeterStyle =StyleButtonText
220+ Text =Set ClickThrough: 0 (via Variable)
221+ X =150
222+ Y =478
223+ LeftMouseUpAction =[!SetVariable ClickThrough 0][!UpdateMeasure MeasureWebView]
224+
225+ [TxtSetEnableAllowDualControl]
226+ Meter =String
227+ MeterStyle =StyleButtonText
228+ Text =Set AllowDualControl: 1 (Variable)
229+ X =150
230+ Y =508
231+ LeftMouseUpAction =[!SetVariable AllowDualControl 1][!UpdateMeasure MeasureWebView]
232+
233+ [TxtSetDisableAllowDualControl]
234+ Meter =String
235+ MeterStyle =StyleButtonText
236+ Text =Set AllowDualControl: 0 (Variable)
237+ X =150
238+ Y =538
239+ LeftMouseUpAction =[!SetVariable AllowDualControl 0][!UpdateMeasure MeasureWebView]
0 commit comments