All Projects → RemiBou → Browserinterop

RemiBou / Browserinterop

Licence: mit
Wrapper for Browser JS API for Blazor and JSInterop

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Browserinterop

Wikipediap2p
WikipediaP2P.org Chrome Extension
Stars: ✭ 105 (-6.25%)
Mutual labels:  browser
Validatorjs
A data validation library in JavaScript for the browser and Node.js, inspired by Laravel's Validator.
Stars: ✭ 1,534 (+1269.64%)
Mutual labels:  browser
Instagram Profilecrawl
💻 Quickly crawl the information (e.g. followers, tags, etc...) of an instagram profile. No login required!
Stars: ✭ 110 (-1.79%)
Mutual labels:  browser
Webworkify Webpack
launch a web worker at runtime that can require() in the browser with webpack
Stars: ✭ 105 (-6.25%)
Mutual labels:  browser
Aspnetcore.efcore dapper
Projeto ASP.NET Core + Entity Framework Core + Dapper, demonstrando o uso de ambos separadamente e em um cenário híbrido.
Stars: ✭ 105 (-6.25%)
Mutual labels:  aspnetcore
Dotnet Istanbul Microservices Demo
This is the demo application that i created for my talk 'Microservice Architecture & Implementation with Asp.Net Core' at Dotnet İstanbul Meetup Group.
Stars: ✭ 109 (-2.68%)
Mutual labels:  aspnetcore
Dotnet Unpkg
Pure .NET front-end HTML package management using unpkg.com as a source
Stars: ✭ 103 (-8.04%)
Mutual labels:  aspnetcore
Comboost
ComBoost是一个领域驱动的快速开发框架
Stars: ✭ 111 (-0.89%)
Mutual labels:  aspnetcore
Aspnet.security.openid.providers
OpenID 2.0 authentication middleware for ASP.NET Core
Stars: ✭ 107 (-4.46%)
Mutual labels:  aspnetcore
Irodr
RSS reader client like LDR for Inoreader.
Stars: ✭ 110 (-1.79%)
Mutual labels:  browser
Css Handbook
CSS参考手册
Stars: ✭ 1,453 (+1197.32%)
Mutual labels:  browser
Elect
The collection of utilities, best practice and fluent method for .NET Core
Stars: ✭ 107 (-4.46%)
Mutual labels:  aspnetcore
Capture Frame
Capture video screenshot from a `<video>` tag (at the current time)
Stars: ✭ 109 (-2.68%)
Mutual labels:  browser
Web Client
Generic Linked Data browser and UX component framework. Apache license.
Stars: ✭ 105 (-6.25%)
Mutual labels:  browser
Simple Fs
Handles files on indexeddb like you would do in node.js (promise)
Stars: ✭ 111 (-0.89%)
Mutual labels:  browser
Simple aspnet auth
Simple ASP.NET Authorisation boilerplate project. No EF, no database, no IdentityServer4 just a basic logging in system for both cookies and JWT and a controller with a set of examples.
Stars: ✭ 105 (-6.25%)
Mutual labels:  aspnetcore
Leash
Browser Shell
Stars: ✭ 108 (-3.57%)
Mutual labels:  browser
Battery.js
A tiny wrapper for the HTML5 Battery Status API.
Stars: ✭ 111 (-0.89%)
Mutual labels:  browser
Decentraleyes
This repository has a new home: https://git.synz.io/Synzvato/decentraleyes
Stars: ✭ 1,452 (+1196.43%)
Mutual labels:  browser
Aspnetcore Angular Universal
ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
Stars: ✭ 1,455 (+1199.11%)
Mutual labels:  aspnetcore

BrowserInterop

Build Status NuGet Badge

This library provides access to browser API in a Blazor App.

The following criteria are taken into account for choosing if an API must be handled :

  • Is it already doable with Blazor (like XHR, DOM manipulation or already managed event ) ?
  • Is that part of the standard ?
  • Is that implemented by most browsers ? (> 75% in caniuse)

This library aim at providing some added value which are :

  • Better deserialization than default : DomString, Infinity, Array-like map ...
  • Better typing : duration as TimeSpan, string as enum ...
  • Use IAsyncDisposable for method call that must be executed around a code block (like profiling) or event subscription
  • Func for event subscription

I use the following website for discovering API description https://developer.mozilla.org/en-US/docs/Web/API and this one for finding out if it is implemented https://caniuse.com/.

Quick Start

First install the package

dotnet add package BrowserInterop

Reference the needed JS in your index.html after the blazor.webassembly.js (or in your js bundling tool)

    <script src="_framework/blazor.webassembly.js"></script>
    <script src="_content/BrowserInterop/scripts.js"></script>

Then in your template enter the API with the Window() extension method like this :

@using BrowserInterop.Extensions
...
@code {
    protected override async Task OnInitialized()
    {
        var window = await jsRuntime.Window();
        await window.Console.Log("this is a {0}","Log message");
      
    }
}

==> More documentation and information on the wiki

Development

If you wish to improve this library here are a couple of things that might help you

Environment

For working on this project you need the following tools installed on your machine :

  • .NET SDK 3.1.202
  • npm

Projects

This repo is organised in 3 projects :

  • src/BrowserInterop : the C# project for the netsstandard2.0 library
  • sample/SampleApp : a sample app showing how to use BrowserInterop
  • tests/BrowserInterop.E2ETests : the test suite, done with cypressio. All tests are located in cypress/integration folder.

Run the test suite

  • Run the app in sample/SampleApp :
dotnet watch run
  • Open cypress Console in tests/BrowserInterop.E2ETests :
npm install
npm run-script start
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].