diff --git a/Build-CPP.ps1 b/Build-CPP.ps1 index 1e001a1..19cfe87 100644 --- a/Build-CPP.ps1 +++ b/Build-CPP.ps1 @@ -1,4 +1,4 @@ -#usage -----> powershell -ExecutionPolicy Bypass -Command "& {. .\Build-CPP.ps1; Dist -major 1 -minor 2 -patch 0}" +#usage -----> powershell -ExecutionPolicy Bypass -Command "& {. .\Build-CPP.ps1; Dist -major 0 -minor 0 -patch 3}" $msbuild = "C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe" function Add-RMSkinFooter { diff --git a/README.md b/README.md index 791debb..0f6e747 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ A powerful Rainmeter plugin that embeds Microsoft Edge WebView2 control to display web content or local HTML files directly in your Rainmeter skins. - +  - + ## ✨ Features @@ -12,9 +12,10 @@ A powerful Rainmeter plugin that embeds Microsoft Edge WebView2 control to displ - 📄 **Local HTML Files** - Display custom HTML/CSS/JavaScript content - 🪟 **Seamless Integration** - WebView window automatically parents to skin window - 🎮 **Full Control** - Navigate, reload, go back/forward via bang commands -- 💻 **JavaScript Support** - Execute JavaScript code in the WebView +- 💻 **JavaScript Support** - Full JavaScript execution with event handling - 🎨 **Customizable** - Configure size, position, and visibility - ⚡ **Modern** - Uses Microsoft Edge WebView2 (Chromium-based) +- 🔌 **Rainmeter API Bridge** - Access Rainmeter functions from JavaScript ## 📋 Requirements @@ -27,8 +28,8 @@ A powerful Rainmeter plugin that embeds Microsoft Edge WebView2 control to displ ### Installation -1. Download the latest release from [Releases](https://github.com/nstechbytes/WebView2/releases) -2. Install the `.rmskin` package, or +1. Download the latest release `.rmskin` package +2. Double-click to install, or 3. Manually copy `WebView2.dll` to `%APPDATA%\Rainmeter\Plugins\` ### Basic Usage @@ -40,12 +41,11 @@ Update=1000 [MeasureWebView] Measure=Plugin Plugin=WebView2 -Url=https://www.google.com +URL=https://www.google.com Width=1000 Height=700 X=0 Y=0 -Visible=1 ``` ## 📖 Documentation @@ -54,7 +54,7 @@ Visible=1 | Option | Type | Default | Description | |--------|------|---------|-------------| -| `Url` | String | (empty) | URL or file path to load. Supports web URLs and local file paths | +| `URL` | String | (empty) | URL or file path to load. Supports web URLs and local file paths | | `Width` | Integer | 800 | Width of the WebView window in pixels | | `Height` | Integer | 600 | Height of the WebView window in pixels | | `X` | Integer | 0 | X position relative to skin window | @@ -65,93 +65,74 @@ Visible=1 Execute commands using `!CommandMeasure`: -#### Navigate to URL ```ini +; Navigate to URL LeftMouseUpAction=[!CommandMeasure MeasureWebView "Navigate https://example.com"] -``` -#### Reload Current Page -```ini +; Reload current page LeftMouseUpAction=[!CommandMeasure MeasureWebView "Reload"] -``` -#### Navigation Controls -```ini +; Navigation controls LeftMouseUpAction=[!CommandMeasure MeasureWebView "GoBack"] LeftMouseUpAction=[!CommandMeasure MeasureWebView "GoForward"] -``` -#### Show/Hide WebView -```ini +; Show/Hide WebView LeftMouseUpAction=[!CommandMeasure MeasureWebView "Show"] LeftMouseUpAction=[!CommandMeasure MeasureWebView "Hide"] -``` -#### Execute JavaScript -```ini -LeftMouseUpAction=[!CommandMeasure MeasureWebView "ExecuteScript alert('Hello from Rainmeter!')"] -``` +; Execute JavaScript +LeftMouseUpAction=[!CommandMeasure MeasureWebView "ExecuteScript alert('Hello!')"] -## 💡 Examples +;Open DevTools +LeftMouseUpAction=[!CommandMeasure MeasureWebView "OpenDevTools"] -### Example 1: Web Browser Skin +; SetWidth +LeftMouseUpAction=[!CommandMeasure MeasureWebView "SetWidth 500"] +; Dynamically sets the width of the WebView2 control in pixels. -```ini -[Rainmeter] -Update=1000 -BackgroundMode=2 -SolidColor=30,30,30,255 +; SetHeight +LeftMouseUpAction=[!CommandMeasure MeasureWebView "SetHeight 400"] +; Dynamically sets the height of the WebView2 control in pixels. + +; SetX +LeftMouseUpAction=[!CommandMeasure MeasureWebView "SetX 100"] +; Dynamically sets the X position of the WebView2 control relative to the skin window. + +;SetY +LeftMouseUpAction=[!CommandMeasure MeasureWebView "SetY 50"] +;Dynamically sets the Y position of the WebView2 control relative to the skin window. +``` + +## 💡 Examples -[Variables] -WebWidth=1200 -WebHeight=800 +### Example 1: Mouse Drag Test +```ini [MeasureWebView] Measure=Plugin Plugin=WebView2 -Url=https://www.rainmeter.net -Width=#WebWidth# -Height=#WebHeight# +URL=#@#mouse-drag-test.html +Width=600 +Height=400 X=0 -Y=50 -Visible=1 - -[MeterNavigate] -Meter=String -X=20 -Y=15 -FontSize=12 -FontColor=100,150,255 -Text="Go to Google" -LeftMouseUpAction=[!CommandMeasure MeasureWebView "Navigate https://www.google.com"] - -[MeterReload] -Meter=String -X=150 -Y=15 -FontSize=12 -FontColor=200,200,200 -Text="Reload" -LeftMouseUpAction=[!CommandMeasure MeasureWebView "Reload"] +Y=0 ``` -### Example 2: Local HTML Dashboard +### Example 2: Web Browser Skin ```ini -[Rainmeter] -Update=1000 - [MeasureWebView] Measure=Plugin Plugin=WebView2 -Url=#@#dashboard.html -Width=800 -Height=600 +URL=https://www.rainmeter.net +Width=1200 +Height=800 X=0 -Y=0 -Visible=1 +Y=50 ``` +### Example 3: Local HTML Dashboard + Create `@Resources\dashboard.html`: ```html @@ -164,52 +145,50 @@ Create `@Resources\dashboard.html`: color: white; padding: 40px; } - h1 { font-size: 3em; }
Current time:
+Time: