A simple wrapper to turn web applications into desktop applications using WebView. Exposes WebMessages to allow communication between the web page and the wrapper, allowing you to execute code in the wrapper using JavaScript 🚀.
Used in 🤖 Pwsh.Ai
- Open the powershell in your
index.htmlfolder and run:Invoke-WebRequest -Uri "https://github.com/JoaoVKS/WebWrapperNet/releases/download/v2.0.0/WebWrapV2.zip" -OutFile "temp.zip"; Expand-Archive -Path "temp.zip" -DestinationPath "."; Remove-Item "temp.zip"
- Run the
.exe
Or
- Publish the project (e.g.:
dotnet publish -c Release -r win-x64 --self-contained) — the.exewill be generated atbin\Release\net10.0-windows\win-x64\publish\WebWrap\ - Place the generated
.exein the same folder as yourindex.html - Run the
.exe
Or
- Download the
.zipof the latest release - Extract the contents where your
index.htmlis located - Run the extracted
.exe
See the folder SampleProject for an example of how to use WebWrapperNet in a project.
WebWrapper will:
- Start a web server to serve the
index.htmlcontent. - Open a window with the
index.htmlcontent. - Automatically load the page title and icon.
- Expose an HTTP proxy for requests.
- Expose web messages to handle PowerShell manipulation and other interactions.
- httpRequest - Make HTTP requests
- pwshNew - Create a new PowerShell process
- pwshInput - Send input to PowerShell
- pwshKill - Kill a PowerShell process
- pwshStop - Stop a PowerShell process
- pwshAsyncOutput - Get async output from PowerShell
- brwsReload - Reload the browser
- fileWrite - Write content to a file
- fileRead - Read content from a file
- fileTextSearch - Search text in a file
- sysInfo - Get system information
- rawToMd - Convert documents (PDF, Word, HTML, JSON, etc.) to Markdown
Sample of how to use the WebWrapperNet WebMessages to make requests using JavaScript
- Download:
Invoke-WebRequest -Uri "https://github.com/JoaoVKS/WebWrapperNet/releases/download/v2.0.0/webWrapV2SampleHttp.zip" -OutFile "temp.zip"; Expand-Archive -Path "temp.zip" -DestinationPath "."; Remove-Item "temp.zip"
- .NET 10 — https://dotnet.microsoft.com/en-us/download/dotnet/10.0
- WebView2 Runtime — https://developer.microsoft.com/en-us/microsoft-edge/webview2/
