KristofferStrube.Blazor.Window 0.1.0-alpha.3

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
This is a prerelease version of KristofferStrube.Blazor.Window.
dotnet add package KristofferStrube.Blazor.Window --version 0.1.0-alpha.3
NuGet\Install-Package KristofferStrube.Blazor.Window -Version 0.1.0-alpha.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KristofferStrube.Blazor.Window" Version="0.1.0-alpha.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KristofferStrube.Blazor.Window --version 0.1.0-alpha.3
#r "nuget: KristofferStrube.Blazor.Window, 0.1.0-alpha.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install KristofferStrube.Blazor.Window as a Cake Addin
#addin nuget:?package=KristofferStrube.Blazor.Window&version=0.1.0-alpha.3&prerelease

// Install KristofferStrube.Blazor.Window as a Cake Tool
#tool nuget:?package=KristofferStrube.Blazor.Window&version=0.1.0-alpha.3&prerelease

License: MIT GitHub issues GitHub forks GitHub stars NuGet Downloads (official NuGet)

Blazor.Window

A Blazor wrapper for the Window interface from the HTML Specification. This interface standardizes methods for controlling the global object used in browser windows called Window. This project implements a wrapper around the interface and its types for Blazor so that we can easily and safely work with all the methods, attributes, and events surfaced in the Window interface.

These functionalities are vast, and we do not wish to support them all, as some of them are of little use or work against the principles of Blazor. Here, I have made a high-level list of the different functionalities that the Window interface supplies and marked which this wrapper will cover.

  • 🚫 Access to the top level Document of the window.
  • ✅ Navigation control for the window.
  • ✅ Option to register WebComponents using the CustomElementRegistry.
  • 🚫 Attributes indicating whether toolbar, scrollbars, location bar, etc. are visible.
  • ✅ Access to the parent WindowProxy that this window is hosted in/by in case it is in an iframe or is a pop-up window.
  • ✅ Option to open a new window given some URL and target.
  • 🚫 Attributes giving information about the user agent through the Navigator.
  • ✅ Initialize alert, confirm, prompt, and print user prompts.
  • ✅ Posting messages to the window and listening for messages sent to it.
  • ✅ Event listeners for events that are triggered when the user interacts with the window, such as mouse clicks, scrolling, resizing, etc.
  • ✅ Event listeners for events related to the actions available in the window, such as changes in internet connectivity, changes in navigation location, or when the page is shown or hidden.

This wrapper is still under development.

Demo

The sample project can be demoed at https://kristofferstrube.github.io/Blazor.Window/

On each page, you can find the corresponding code for the example in the top right corner.

The library uses the following other packages to support its features:

This repository was built with inspiration and help from the following series of articles:

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0-alpha.3 73 4/8/2024
0.1.0-alpha.2 63 4/1/2024
0.1.0-alpha.1 47 4/1/2024