Explore all Progressive Web Application open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Progressive Web Application

ambianic-ui

v2.23.1

create-pwa

Fix current working directory

Mono-PWA

3.4.2 Hotfix 1

frappe_pwa

1.0.2

Popular Libraries in Progressive Web Application

expense-manager-demo

by vaadin doticonhtmldoticon

star image 353 doticonApache-2.0

Progressive Web App (PWA) demo using Vaadin components

jfa-pwa-toolkit

by jfadev doticonjavascriptdoticon

star image 248 doticonMIT

⚡️ PWA Features to Any Website (very Fast & Easy)

zero-btc-screen

by dr-mod doticonpythondoticon

star image 246 doticonMIT

Bitcoin stock price for RPi Zero

pwa-angular

by johnpapa doticontypescriptdoticon

star image 209 doticon

PWA Example

pwa-tutorial

by IncredibleWeb doticonjavascriptdoticon

star image 183 doticonMIT

A demo application that serves as a tutorial for Progressive Web Applications

learning-pwa

by alienzhou doticonjavascriptdoticon

star image 167 doticon

📱some samples and blogs about how to start with your first PWA

react-weather-app

by iondrimba doticonjavascriptdoticon

star image 143 doticonMIT

⛅️ PWA Weather App made with ReactJS

pwa-book

by lavas-project doticonjavascriptdoticon

star image 122 doticonGPL-3.0

这是一本 PWA 相关的书籍

pwa-music-player

by iondrimba doticonjavascriptdoticon

star image 112 doticonMIT

:radio: PWA Music Player made with Reactjs

Trending New libraries in Progressive Web Application

zero-btc-screen

by dr-mod doticonpythondoticon

star image 246 doticonMIT

Bitcoin stock price for RPi Zero

pwa-inking

by pwa-builder doticontypescriptdoticon

star image 33 doticonMIT

A web component that adds a 2D inking canvas (and optional toolbar) to your PWA 🎨 ✨

ProgressiveNewsApp

by vinitshahdeo doticonjavascriptdoticon

star image 29 doticonMIT

A simple Progressive Web App that brought news from a variety of sources using News API.

jupiter-web-exercises

by CodeupClassroom doticonhtmldoticon

star image 22 doticon

This is a repository for Jupiter's exercises at Codeup

prog-web-news

by webmaxru doticontypescriptdoticon

star image 14 doticon

A demo application for "Automating a service worker with Workbox 6" tech talk

frappe_pwa

by Monogramm doticonpythondoticon

star image 12 doticonNOASSERTION

:snake: :alembic: PWA setup for Frappe website.

pwa-workshop-codelab

by GoogleChromeLabs doticonjavascriptdoticon

star image 11 doticonApache-2.0

PWA-template

by devpato doticonjavascriptdoticon

star image 7 doticonApache-2.0

PWA-Book

by lecepin doticonhtmldoticon

star image 7 doticon

《PWA 入门与实践》图书代码

Top Authors in Progressive Web Application

1

raihan-muhammad

4 Libraries

star icon11

2

jfadev

2 Libraries

star icon250

3

devpato

2 Libraries

star icon12

4

iondrimba

2 Libraries

star icon255

5

CaptainJojo

1 Libraries

star icon4

6

ChangoMan

1 Libraries

star icon2

7

SirPepe

1 Libraries

star icon12

8

adrianmoya

1 Libraries

star icon2

9

altrusl

1 Libraries

star icon2

10

delapuente

1 Libraries

star icon2

1

4 Libraries

star icon11

2

2 Libraries

star icon250

3

2 Libraries

star icon12

4

2 Libraries

star icon255

5

1 Libraries

star icon4

6

1 Libraries

star icon2

7

1 Libraries

star icon12

8

1 Libraries

star icon2

9

1 Libraries

star icon2

10

1 Libraries

star icon2

Trending Kits in Progressive Web Application

The use of Java PWA libraries is recommended because it is a very powerful tool to make your website look and perform better than any other website. It allows you to add all the features that you need on a single page without having to install another app or another browser. It also gives you a great opportunity to learn about how data is stored on your device and how it can be used to improve the performance of your website. The best thing about using these tools is that they are free, so there's no need to worry about spending money on them. Capacitor library provides a set of custom components to make your web application more secure, fast and easy to develop. It also helps in building a native look & feel for your application. CodenameOne library has multiple features like data binding, offline support, authentication etc. which makes it easier to develop responsive web apps with no coding involved. Android SmartWebView is an open source project created by Google that allows developers to utilize their own custom UI components in their mobile apps without having them be compiled into a binary format or making them available as part of the APK file itself. This Open Source project was renamed as Android-SmartWebView in 2019 for better clarity. Android-PWA-Wrapper is another library that helps to create your PWA in a very easy way. It comes with a simple to use builder that allows you to integrate the app with any third party app.

Trending Discussions on Progressive Web Application

django pwa error = cannot import name 'url' from 'django.conf.urls

Minimum Chrome version for TWA - options?

Blazor WASM 6.0.0-preview.7.21378.6, Visual Studio 2022 preview 3.1

Dotnet React Template - is it possible to use /index.html

Blazor WASM Project Referencing Error (BLAZORSDK1001)

Unable to hit breakpoints in Blazor WASM

Does a service worker need to cache manifest icons that are not used by the core of the PWA?

How do I change the "Authorising..." message that appears when a Blazor PWA application is being refreshed?

Migrating Chrome USB App API to Web USB API

No Manifest Detected on a PHP Progressive Web Application

QUESTION

django pwa error = cannot import name 'url' from 'django.conf.urls

Asked 2022-Apr-02 at 01:49

Hello I am using Django 4.0.3 and I try to use django-pwa in my project but when i runserver i get the below error.

I followed this tutorial geeksforgeeks:make-pwa-of-a-django-project for including progressive web application feature in my project.

I think url from django.conf.urls is deprecated.

I am sure that must exist some solutions...

Help me please.

Error

1File "C:\Users\Republic Of Computer\Desktop\Master cours et TD\python\tberra3lipy\venv\lib\site-packages\pwa\urls.py", line 1, in <module>
2    from django.conf.urls import url
3ImportError: cannot import name 'url' from 'django.conf.urls' (C:\Users\Republic Of Computer\Desktop\Master cours et TD\python\tberra3lipy\venv\lib\site-packages\django\conf\urls\__init__.py)
4

urls.py

1File "C:\Users\Republic Of Computer\Desktop\Master cours et TD\python\tberra3lipy\venv\lib\site-packages\pwa\urls.py", line 1, in <module>
2    from django.conf.urls import url
3ImportError: cannot import name 'url' from 'django.conf.urls' (C:\Users\Republic Of Computer\Desktop\Master cours et TD\python\tberra3lipy\venv\lib\site-packages\django\conf\urls\__init__.py)
4from django.contrib import admin
5from django.conf.urls.static import static
6from django.urls import path,include
7from django.conf import settings
8
9urlpatterns = [
10    path('admin/', admin.site.urls),
11    path('donation/',include('donation.urls',namespace='donation')),
12    path('',include('pwa.urls')),
13]+static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
14

settings.py

1File "C:\Users\Republic Of Computer\Desktop\Master cours et TD\python\tberra3lipy\venv\lib\site-packages\pwa\urls.py", line 1, in <module>
2    from django.conf.urls import url
3ImportError: cannot import name 'url' from 'django.conf.urls' (C:\Users\Republic Of Computer\Desktop\Master cours et TD\python\tberra3lipy\venv\lib\site-packages\django\conf\urls\__init__.py)
4from django.contrib import admin
5from django.conf.urls.static import static
6from django.urls import path,include
7from django.conf import settings
8
9urlpatterns = [
10    path('admin/', admin.site.urls),
11    path('donation/',include('donation.urls',namespace='donation')),
12    path('',include('pwa.urls')),
13]+static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
14from pathlib import Path
15import os
16
17INSTALLED_APPS = [
18    'django.contrib.admin',
19    'django.contrib.auth',
20    'django.contrib.contenttypes',
21    'django.contrib.sessions',
22    'django.contrib.messages',
23    'django.contrib.staticfiles',
24    'pwa',
25    'accounts',
26    'donation',
27    
28]
29
30ROOT_URLCONF = 'src.urls' 
31# Static files (CSS, JavaScript, Images)
32# https://docs.djangoproject.com/en/3.2/howto/static-files/
33
34STATIC_URL = '/static/'
35#pwa
36PWA_SERVICE_WORKER_PATH = os.path.join(BASE_DIR, 'static/js', 'serviceworker.js')
37PWA_APP_NAME = 'tberra3li'
38PWA_APP_DESCRIPTION = "app for blood donors"
39PWA_APP_THEME_COLOR = '#000000'
40PWA_APP_BACKGROUND_COLOR = '#ffffff'
41PWA_APP_DISPLAY = 'standalone'
42PWA_APP_SCOPE = '/'
43PWA_APP_ORIENTATION = 'any'
44PWA_APP_START_URL = '/'
45PWA_APP_STATUS_BAR_COLOR = 'default'
46PWA_APP_ICONS = [
47    {
48        'src': 'static/assets/img/icon-160x160.png',
49        'sizes': '160x160'
50    }
51]
52PWA_APP_ICONS_APPLE = [
53    {
54        'src': 'static/assets/img/icon-160x160.png',
55        'sizes': '160x160'
56    }
57]
58PWA_APP_SPLASH_SCREEN = [
59    {
60        'src': 'static/assets/img/icon.png',
61        'media': '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)'
62    }
63]
64PWA_APP_DIR = 'ltr'
65PWA_APP_LANG = 'en-US'
66

ANSWER

Answered 2022-Apr-02 at 01:45

django.conf.urls is deprecated in Django 4, so you cannot use django-pwa with your version of Django, you need to use Django 3. Otherwise you could fork/edit django-pwa to replace django.conf.urls.url (that is used in this file) with django.urls.path, see this pull request.

Source https://stackoverflow.com/questions/71713923

QUESTION

Minimum Chrome version for TWA - options?

Asked 2021-Oct-21 at 08:44

I have a Trusted Web Activity app that is displaying a Progressive Web Application by using the Android Browser Helper. The documentation and code indicates that the mobile app only runs properly when the Chrome Browser is 72 or above. The address bar is visible when the Chrome Browser is outdated. I believe I have the option of a Webview-fallback but I prefer not to use Webview as some of the app's functionality is incompatible with Webview.

While testing, when the Chrome Browser is updated on the same device, the trusted web activity runs without any issues.

What options do I have where the address bar isn't visible?

Is the min SDK the only way to set the minimum browser requirements or can I explicitly set a min Chrome Browser version in the Play Console for the app before the user downloads it? (which prompts the user to update the browser before installation)

Thanks in advance!

ANSWER

Answered 2021-Oct-21 at 08:44

It's not possible to set a browser version requirement on the Play Console.

Besides falling back to a WebView, or showing the application with the URL bar, the other solution would to block the application from loading and ask the user to update / install a browser that supports Trusted Web Activity.

Source https://stackoverflow.com/questions/69094410

QUESTION

Blazor WASM 6.0.0-preview.7.21378.6, Visual Studio 2022 preview 3.1

Asked 2021-Aug-29 at 11:24

I created a standard Blazor WASM project from the template with individual user accounts, ASP.NET Hosted, and Configured for Https, Progressive Web Application checked.

Running the project, I get this in the Dev Tools:

`crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Could not load settings from '_configuration/Wtf.Client' createUserManager@https://localhost:44344/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:2:288346

Microsoft.JSInterop.JSException: Could not load settings from '_configuration/Wtf.Client' createUserManager@https://localhost:44344/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:2:288346

at Microsoft.JSInterop.JSRuntime.d__161[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in Microsoft.JSInterop.dll:token 0x60000b3+0x156 at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args) in Microsoft.JSInterop.dll:token 0x6000049+0x84 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.d__27[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000122+0x95 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.<GetAuthenticatedUser>d__26[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000120+0x7d at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.d__25[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x600011e+0xa7 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService`3.d__17[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000110+0x63 at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.OnParametersSetAsync() in Microsoft.AspNetCore.Components.Authorization.dll:token 0x6000043+0xfd at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) in Microsoft.AspNetCore.Components.dll:token 0x60000a5+0x7e at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() in Microsoft.AspNetCore.Components.dll:token 0x60000a3+0x113 at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) in Microsoft.AspNetCore.Components.dll:token 0x6000285+0x65 blazor.webassembly.js:1:30848 Cookie “PHPSESSID” will be soon treated as cross-site cookie against “https://localhost:44344/css/open-iconic/font/fonts/open-iconic.woff” because the scheme does not match. open-iconic.woff crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Could not load settings from '_configuration/Wtf.Client' createUserManager@https://localhost:44344/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:2:288346

Microsoft.JSInterop.JSException: Could not load settings from '_configuration/Wtf.Client' createUserManager@https://localhost:44344/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:2:288346

at Microsoft.JSInterop.JSRuntime.d__161[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in Microsoft.JSInterop.dll:token 0x60000b3+0x156 at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args) in Microsoft.JSInterop.dll:token 0x6000049+0x84 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.d__27[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000122+0x95 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.<GetAuthenticatedUser>d__26[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000120+0x7d at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.d__25[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x600011e+0xa7 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService`3.d__17[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000110+0x63 at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.OnParametersSetAsync() in Microsoft.AspNetCore.Components.Authorization.dll:token 0x6000043+0xfd at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) in Microsoft.AspNetCore.Components.dll:token 0x60000a5+0x7e at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) in Microsoft.AspNetCore.Components.dll:token 0x6000285+0x65 blazor.webassembly.js:1:30848 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Could not load settings from '_configuration/Wtf.Client' createUserManager@https://localhost:44344/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:2:288346

Microsoft.JSInterop.JSException: Could not load settings from '_configuration/Wtf.Client' createUserManager@https://localhost:44344/_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js:2:288346

at Microsoft.JSInterop.JSRuntime.d__161[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() in Microsoft.JSInterop.dll:token 0x60000b3+0x156 at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args) in Microsoft.JSInterop.dll:token 0x6000049+0x84 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.d__27[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000122+0x95 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.<GetAuthenticatedUser>d__26[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000120+0x7d at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.d__25[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x600011e+0xa7 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3.<GetAuthenticationStateAsync>d__17[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.ApiAuthorizationProviderOptions, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() in Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:token 0x6000110+0x63 at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.OnParametersSetAsync() in Microsoft.AspNetCore.Components.Authorization.dll:token 0x6000043+0xfd at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) in Microsoft.AspNetCore.Components.dll:token 0x60000a5+0x7e at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() in Microsoft.AspNetCore.Components.dll:token 0x60000a3+0x113 at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) in Microsoft.AspNetCore.Components.dll:token 0x6000285+0x65

Anyone know what's happening here? I did install "The Essentials" extension by Mads Kristensen, if that matters.

ANSWER

Answered 2021-Aug-29 at 11:24

When you create a Hosted Wasm project in VS2020 preview the default start project is set to the Client. That kind-of works for a simple app (no Auth) but it probably is a litle bug.

The simple fix is to right-click on the Server project and select "Set as Startup Project".

Source https://stackoverflow.com/questions/68955870

QUESTION

Dotnet React Template - is it possible to use /index.html

Asked 2021-Jul-18 at 01:44

If I use pure Create React Application (without dotnet), then I can open the react application in two ways (after yarn start):

  • https://localhost:3000/
  • https://localhost:3000/index.html

enter image description here enter image description here

But if I use Dotnet React Template, then there is only one way I can open the application (when I add index.html, I only see the dotnet part of the app, but not react) after dotnet run:

  • https://localhost:5001/
  • https://localhost:5001/index.html

enter image description here enter image description here

I would like to find a way to use index.html here as well.

Why am I asking. I recently tried adding my site as a Bookmark to iPhone's Home Screen.

It turned out that this doesn't just work as a link, but iOS now interprets those sites as Progressive Web Application. That is, additional requirements are imposed on the site. And one of them is having a working index.html.

This is why I would like my Dotnet React application to work properly with /index.html

ANSWER

Answered 2021-Jul-17 at 19:32

Go get ClientApp/src/App.js and change the first route to below.

1&lt;Route exact path={['/', '/index.html']} component={Home} /&gt;
2

Source https://stackoverflow.com/questions/68423584

QUESTION

Blazor WASM Project Referencing Error (BLAZORSDK1001)

Asked 2021-May-25 at 04:53

I have one Server project and now trying to convert it into Progressive Web Application. When I reference the API, Model, and UI projects to it then the following error comes out:

1&lt;Target Name=&quot;_FailIfReferencingAspNetCoreApp&quot; BeforeTargets=&quot;ResolveRuntimePackAssets&quot;&gt;
2    &lt;Error
3      Code=&quot;BLAZORSDK1001&quot;
4      Text=&quot;The project references the ASP.NET Core shared framework, which is not supported by Blazor WebAssembly apps. Remove the framework reference if directly referenced, or the package reference that adds the framework reference.&quot;
5      Condition=&quot;'@(FrameworkReference-&gt;WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')-&gt;Count())' != '0'&quot; /&gt;
6&lt;/Target&gt;
7

The following code is the .csproj of the project, is there something I'm missing?

1&lt;Target Name=&quot;_FailIfReferencingAspNetCoreApp&quot; BeforeTargets=&quot;ResolveRuntimePackAssets&quot;&gt;
2    &lt;Error
3      Code=&quot;BLAZORSDK1001&quot;
4      Text=&quot;The project references the ASP.NET Core shared framework, which is not supported by Blazor WebAssembly apps. Remove the framework reference if directly referenced, or the package reference that adds the framework reference.&quot;
5      Condition=&quot;'@(FrameworkReference-&gt;WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')-&gt;Count())' != '0'&quot; /&gt;
6&lt;/Target&gt;
7&lt;Project Sdk=&quot;Microsoft.NET.Sdk.BlazorWebAssembly&quot;&gt;
8
9    &lt;PropertyGroup&gt;
10        &lt;TargetFramework&gt;net5.0&lt;/TargetFramework&gt;
11        &lt;ServiceWorkerAssetsManifest&gt;service-worker-assets.js&lt;/ServiceWorkerAssetsManifest&gt;
12    &lt;/PropertyGroup&gt;
13
14    &lt;ItemGroup&gt;
15        &lt;Content Remove=&quot;wwwroot\service-worker.js&quot; /&gt;
16    &lt;/ItemGroup&gt;
17
18    &lt;ItemGroup&gt;
19        &lt;PackageReference Include=&quot;Blazored.Toast&quot; Version=&quot;3.1.2&quot; /&gt;
20        &lt;PackageReference Include=&quot;BlazorInputFile&quot; Version=&quot;0.2.0&quot; /&gt;
21        &lt;PackageReference Include=&quot;DevExpress.Blazor&quot; Version=&quot;20.1.7&quot; /&gt;
22        &lt;PackageReference Include=&quot;Hangfire.AspNetCore&quot; Version=&quot;1.7.11&quot; /&gt;
23        &lt;PackageReference Include=&quot;Hangfire.Core&quot; Version=&quot;1.7.11&quot; /&gt;
24        &lt;PackageReference Include=&quot;Hangfire.SqlServer&quot; Version=&quot;1.7.11&quot; /&gt;
25        &lt;PackageReference Include=&quot;LiquidTechnologies.Blazor.ModalDialog&quot; Version=&quot;0.9.7&quot; /&gt;
26        &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Blazor.HttpClient&quot; Version=&quot;3.2.0-preview3.20168.3&quot; /&gt;
27        &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly&quot; Version=&quot;5.0.4&quot; /&gt;
28        &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly.DevServer&quot; Version=&quot;5.0.4&quot; PrivateAssets=&quot;all&quot; /&gt;
29        &lt;PackageReference Include=&quot;System.Net.Http.Json&quot; Version=&quot;5.0.0&quot; /&gt;
30        &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore&quot; Version=&quot;3.1.3&quot; /&gt;
31        &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Identity.EntityFrameworkCore&quot; Version=&quot;3.1.3&quot; /&gt;
32        &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Identity.UI&quot; Version=&quot;3.1.3&quot; /&gt;
33        &lt;PackageReference Include=&quot;Microsoft.AspNetCore.SignalR.Client&quot; Version=&quot;5.0.5&quot; /&gt;
34        &lt;PackageReference Include=&quot;Microsoft.AspNetCore.SignalR.Client.Core&quot; Version=&quot;5.0.5&quot; /&gt;
35        &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.SqlServer&quot; Version=&quot;3.1.3&quot; /&gt;
36        &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Tools&quot; Version=&quot;3.1.3&quot;&gt;
37            &lt;PrivateAssets&gt;all&lt;/PrivateAssets&gt;
38            &lt;IncludeAssets&gt;runtime; build; native; contentfiles; analyzers; buildtransitive&lt;/IncludeAssets&gt;
39        &lt;/PackageReference&gt;
40        &lt;PackageReference Include=&quot;Microsoft.VisualStudio.Web.CodeGeneration.Design&quot; Version=&quot;3.1.4&quot; /&gt;
41        &lt;PackageReference Include=&quot;Newtonsoft.Json&quot; Version=&quot;13.0.1&quot; /&gt;
42        &lt;PackageReference Include=&quot;QRCoder&quot; Version=&quot;1.4.1&quot; /&gt;
43        &lt;PackageReference Include=&quot;Serilog.AspNetCore&quot; Version=&quot;3.2.0&quot; /&gt;
44        &lt;PackageReference Include=&quot;Serilog.Settings.Configuration&quot; Version=&quot;3.1.0&quot; /&gt;
45        &lt;PackageReference Include=&quot;Serilog.Sinks.Elasticsearch&quot; Version=&quot;8.0.1&quot; /&gt;
46        &lt;PackageReference Include=&quot;Serilog.Sinks.MSSqlServer&quot; Version=&quot;5.3.0&quot; /&gt;
47        &lt;PackageReference Include=&quot;Tewr.Blazor.FileReader&quot; Version=&quot;2.0.0.20200&quot; /&gt;
48    &lt;/ItemGroup&gt;
49
50    &lt;ItemGroup&gt;
51        &lt;ProjectReference Include=&quot;..\DataAccess\DataAccess.csproj&quot; /&gt;
52        &lt;ProjectReference Include=&quot;..\UI\UI.csproj&quot; /&gt;
53        &lt;ProjectReference Include=&quot;..\API\API.csproj&quot; /&gt;
54        &lt;ProjectReference Include=&quot;..\Model\Model.csproj&quot; /&gt;
55    &lt;/ItemGroup&gt;
56&lt;/Project&gt;
57

Are there any suggestions on solving this issue?

ANSWER

Answered 2021-May-25 at 04:53

"I have one Server project" is a little unclear since we can only see <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">. I assume you want ot convert form a Blazor Server App to a WebAssembly app?

The project type is now WebAssembly but you are including, amongst others, <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3" />

You can't access a database from a browser app directly. It's not supported and it wouldn't be safe (all clients would have access to the connection string).

This project needs to be split into a Client and a Server (API) part.

Your best course is to create a project (in a temp folder) from the full Blazor Wasm + Asp.Net Hosted + Individual Accounts template. It'll give you a complete reference for what goes where.

Source https://stackoverflow.com/questions/67666574

QUESTION

Unable to hit breakpoints in Blazor WASM

Asked 2021-Apr-23 at 11:43

I am trying to debug a Blazor WebAssembly app but get the following message when trying to set breakpoints:

The breakpoint will not currently be hit. Unbound breakpoint

If I do the action that would hit the breakpoint, visual studio instead opens a new tab that says Unable to retrieve source content (Unable to retrieve source content). I have the same issue in a separate blazor server app, as well as the sample template that is provided when first creating a blazor project (counter.razor and fetchdata.razor).

Here is the info on the app: Target Framework: .NET 5.0 (Current) Authentication Type: None Configure for HTTPS: True ASP.NET Core hosted: False Progressive Web Application: True

I am using Visual Studio 2019 version 16.9.4.

My .csproj file is:

1&lt;Project Sdk=&quot;Microsoft.NET.Sdk.BlazorWebAssembly&quot;&gt;
2
3  &lt;PropertyGroup&gt;
4    &lt;TargetFramework&gt;net5.0&lt;/TargetFramework&gt;
5    &lt;ServiceWorkerAssetsManifest&gt;service-worker-assets.js&lt;/ServiceWorkerAssetsManifest&gt;
6  &lt;/PropertyGroup&gt;
7
8  &lt;ItemGroup&gt;
9    &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly&quot; Version=&quot;5.0.5&quot; /&gt;
10    &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly.DevServer&quot; Version=&quot;5.0.5&quot; PrivateAssets=&quot;all&quot; /&gt;
11    &lt;PackageReference Include=&quot;System.Net.Http.Json&quot; Version=&quot;5.0.0&quot; /&gt;
12  &lt;/ItemGroup&gt;
13
14  &lt;ItemGroup&gt;
15    &lt;ServiceWorker Include=&quot;wwwroot\service-worker.js&quot; PublishedContent=&quot;wwwroot\service-worker.published.js&quot; /&gt;
16  &lt;/ItemGroup&gt;
17
18&lt;/Project&gt;
19

My launchSettings.json file is:

1&lt;Project Sdk=&quot;Microsoft.NET.Sdk.BlazorWebAssembly&quot;&gt;
2
3  &lt;PropertyGroup&gt;
4    &lt;TargetFramework&gt;net5.0&lt;/TargetFramework&gt;
5    &lt;ServiceWorkerAssetsManifest&gt;service-worker-assets.js&lt;/ServiceWorkerAssetsManifest&gt;
6  &lt;/PropertyGroup&gt;
7
8  &lt;ItemGroup&gt;
9    &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly&quot; Version=&quot;5.0.5&quot; /&gt;
10    &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Components.WebAssembly.DevServer&quot; Version=&quot;5.0.5&quot; PrivateAssets=&quot;all&quot; /&gt;
11    &lt;PackageReference Include=&quot;System.Net.Http.Json&quot; Version=&quot;5.0.0&quot; /&gt;
12  &lt;/ItemGroup&gt;
13
14  &lt;ItemGroup&gt;
15    &lt;ServiceWorker Include=&quot;wwwroot\service-worker.js&quot; PublishedContent=&quot;wwwroot\service-worker.published.js&quot; /&gt;
16  &lt;/ItemGroup&gt;
17
18&lt;/Project&gt;
19{
20  &quot;iisSettings&quot;: {
21    &quot;windowsAuthentication&quot;: false,
22    &quot;anonymousAuthentication&quot;: true,
23    &quot;iisExpress&quot;: {
24      &quot;applicationUrl&quot;: &quot;http://localhost:59417&quot;,
25      &quot;sslPort&quot;: 44389
26    }
27  },
28  &quot;profiles&quot;: {
29    &quot;IIS Express&quot;: {
30      &quot;commandName&quot;: &quot;IISExpress&quot;,
31      &quot;launchBrowser&quot;: true,
32      &quot;inspectUri&quot;: &quot;{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}&quot;,
33      &quot;environmentVariables&quot;: {
34        &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
35      }
36    },
37    &quot;Test&quot;: {
38      &quot;commandName&quot;: &quot;Project&quot;,
39      &quot;dotnetRunMessages&quot;: &quot;true&quot;,
40      &quot;launchBrowser&quot;: true,
41      &quot;inspectUri&quot;: &quot;{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}&quot;,
42      &quot;applicationUrl&quot;: &quot;https://localhost:5001;http://localhost:5000&quot;,
43      &quot;environmentVariables&quot;: {
44        &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
45      }
46    }
47  }
48}
49

I have tried the solutions given here and here. I also checked https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-3-release-now-available/, even though it is a year old. I restarted Visual studio multiple times, deleted the .vs file, restarted my comp, but the same issue.

ANSWER

Answered 2021-Apr-23 at 11:43

The reason for the error was that my solution path had a "#' in a folder name. This error was discussed https://github.com/dotnet/aspnetcore/issues/22036 which apparently was never resolved if you follow the thread.

Source https://stackoverflow.com/questions/67229121

QUESTION

Does a service worker need to cache manifest icons that are not used by the core of the PWA?

Asked 2021-Apr-13 at 09:42

This question may seem quite essential. However, I could not find an answer in any of the official Progressive Web Application (PWA) documentation.

The manifest.json of my PWA contains quite a bit of icons and even a fairly large screenshot.png that are not essential to the core of the PWA.

1        {
2            &quot;src&quot;: &quot;./assets/static/images/android-chrome-512x512.png&quot;,
3            &quot;sizes&quot;: &quot;512x512&quot;,
4            &quot;type&quot;: &quot;image/png&quot;
5        },
6        {
7            &quot;src&quot;: &quot;./assets/static/images/android-chrome-192x192.png&quot;,
8            &quot;sizes&quot;: &quot;192x192&quot;,
9            &quot;type&quot;: &quot;image/png&quot;
10        },
11        {
12            &quot;src&quot;: &quot;./assets/static/images/android-chrome-512x512.maskable.png&quot;,
13            &quot;sizes&quot;: &quot;512x512&quot;,
14            &quot;type&quot;: &quot;image/png&quot;,
15            &quot;purpose&quot;: &quot;maskable&quot;
16        },
17        {
18            &quot;src&quot;: &quot;./assets/static/images/android-chrome-192x192.maskable.png&quot;,
19            &quot;sizes&quot;: &quot;192x192&quot;,
20            &quot;type&quot;: &quot;image/png&quot;,
21            &quot;purpose&quot;: &quot;maskable&quot;
22        },
23        {
24            &quot;src&quot;: &quot;./assets/static/images/apple-touch-icon.png&quot;,
25            &quot;sizes&quot;: &quot;180x180&quot;,
26            &quot;type&quot;: &quot;image/png&quot;,
27            &quot;purpose&quot;: &quot;maskable&quot;
28        }
29    ],
30    &quot;screenshots&quot;: [
31        {
32            &quot;src&quot;: &quot;./assets/static/images/screenshot.png&quot;,
33            &quot;sizes&quot;: &quot;1080x2220&quot;,
34            &quot;type&quot;: &quot;image/png&quot;
35        }
36    ]
37

Only one of the above icons is referred by the index.html of my single page PWA:

1        {
2            &quot;src&quot;: &quot;./assets/static/images/android-chrome-512x512.png&quot;,
3            &quot;sizes&quot;: &quot;512x512&quot;,
4            &quot;type&quot;: &quot;image/png&quot;
5        },
6        {
7            &quot;src&quot;: &quot;./assets/static/images/android-chrome-192x192.png&quot;,
8            &quot;sizes&quot;: &quot;192x192&quot;,
9            &quot;type&quot;: &quot;image/png&quot;
10        },
11        {
12            &quot;src&quot;: &quot;./assets/static/images/android-chrome-512x512.maskable.png&quot;,
13            &quot;sizes&quot;: &quot;512x512&quot;,
14            &quot;type&quot;: &quot;image/png&quot;,
15            &quot;purpose&quot;: &quot;maskable&quot;
16        },
17        {
18            &quot;src&quot;: &quot;./assets/static/images/android-chrome-192x192.maskable.png&quot;,
19            &quot;sizes&quot;: &quot;192x192&quot;,
20            &quot;type&quot;: &quot;image/png&quot;,
21            &quot;purpose&quot;: &quot;maskable&quot;
22        },
23        {
24            &quot;src&quot;: &quot;./assets/static/images/apple-touch-icon.png&quot;,
25            &quot;sizes&quot;: &quot;180x180&quot;,
26            &quot;type&quot;: &quot;image/png&quot;,
27            &quot;purpose&quot;: &quot;maskable&quot;
28        }
29    ],
30    &quot;screenshots&quot;: [
31        {
32            &quot;src&quot;: &quot;./assets/static/images/screenshot.png&quot;,
33            &quot;sizes&quot;: &quot;1080x2220&quot;,
34            &quot;type&quot;: &quot;image/png&quot;
35        }
36    ]
37    &lt;link rel=&quot;apple-touch-icon&quot; sizes=&quot;180x180&quot; href=&quot;./assets/static/images/apple-touch-icon.png&quot;/&gt;
38

But there are even a whole lot more icons mainly for Microsoft Windows and the Apple Safari browser that are even not referred by the manifest.json. The Microsoft Windows icons are listed only in the browserconfig.xml file:

1        {
2            &quot;src&quot;: &quot;./assets/static/images/android-chrome-512x512.png&quot;,
3            &quot;sizes&quot;: &quot;512x512&quot;,
4            &quot;type&quot;: &quot;image/png&quot;
5        },
6        {
7            &quot;src&quot;: &quot;./assets/static/images/android-chrome-192x192.png&quot;,
8            &quot;sizes&quot;: &quot;192x192&quot;,
9            &quot;type&quot;: &quot;image/png&quot;
10        },
11        {
12            &quot;src&quot;: &quot;./assets/static/images/android-chrome-512x512.maskable.png&quot;,
13            &quot;sizes&quot;: &quot;512x512&quot;,
14            &quot;type&quot;: &quot;image/png&quot;,
15            &quot;purpose&quot;: &quot;maskable&quot;
16        },
17        {
18            &quot;src&quot;: &quot;./assets/static/images/android-chrome-192x192.maskable.png&quot;,
19            &quot;sizes&quot;: &quot;192x192&quot;,
20            &quot;type&quot;: &quot;image/png&quot;,
21            &quot;purpose&quot;: &quot;maskable&quot;
22        },
23        {
24            &quot;src&quot;: &quot;./assets/static/images/apple-touch-icon.png&quot;,
25            &quot;sizes&quot;: &quot;180x180&quot;,
26            &quot;type&quot;: &quot;image/png&quot;,
27            &quot;purpose&quot;: &quot;maskable&quot;
28        }
29    ],
30    &quot;screenshots&quot;: [
31        {
32            &quot;src&quot;: &quot;./assets/static/images/screenshot.png&quot;,
33            &quot;sizes&quot;: &quot;1080x2220&quot;,
34            &quot;type&quot;: &quot;image/png&quot;
35        }
36    ]
37    &lt;link rel=&quot;apple-touch-icon&quot; sizes=&quot;180x180&quot; href=&quot;./assets/static/images/apple-touch-icon.png&quot;/&gt;
38    &lt;link rel=&quot;shortcut icon&quot; href=&quot;./assets/static/images/favicon.ico&quot;/&gt;
39    &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; sizes=&quot;32x32&quot; href=&quot;./assets/static/images/favicon-32x32.png&quot;/&gt;
40    &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; sizes=&quot;16x16&quot; href=&quot;./assets/static/images/favicon-16x16.png&quot;/&gt;
41    &lt;link rel=&quot;mask-icon&quot; href=&quot;./assets/static/images/safari-pinned-tab.svg&quot; color=&quot;#379&quot;/&gt;
42    &lt;meta name=&quot;msapplication-config&quot; content=&quot;./assets/static/images/browserconfig.xml&quot;/&gt;
43

On the other hand, my PWA has its own set of application icons that are not listed in the manifest.json but of course are cached by the service-worker.js; no problem there.

The targets of my PWA are mobile Android & iOS, with occasionally some Internet-connected desktop computers.

My question refers mainly to the first-mentioned set of icons: Do these Android and iOS icons and the screenshot need to be cached by the service-worker.js even if the core of the PWA does not require these to function well?

Which would be equivalent to asking: Do the respective operating systems save the installation icons even when these are not cached by the service-worker.js?

ANSWER

Answered 2021-Apr-13 at 09:42

The brief answer is "no," none of the (fav)icons or screenshots should be cached by the service-worker.js if the PWA will not use these.

Moreover, manifest.json should only refer to icons targeting the Android and/or Chrome browser. Hence, apple-touch-icon.png should not be mentioned in the manifest.json.

For iOS, it suffices to place the apple-touch-icon.png in the root folder of the scope of your application. The same holds true for favicon.ico.

There are some more rules for Windows and Mac OS X user agents. These can easily be checked by following the guidelines of this favicon generator or by proving your PWA URL to its favicon checker.

For example, it told me that the following line is best best kept out of index.html:

1        {
2            &quot;src&quot;: &quot;./assets/static/images/android-chrome-512x512.png&quot;,
3            &quot;sizes&quot;: &quot;512x512&quot;,
4            &quot;type&quot;: &quot;image/png&quot;
5        },
6        {
7            &quot;src&quot;: &quot;./assets/static/images/android-chrome-192x192.png&quot;,
8            &quot;sizes&quot;: &quot;192x192&quot;,
9            &quot;type&quot;: &quot;image/png&quot;
10        },
11        {
12            &quot;src&quot;: &quot;./assets/static/images/android-chrome-512x512.maskable.png&quot;,
13            &quot;sizes&quot;: &quot;512x512&quot;,
14            &quot;type&quot;: &quot;image/png&quot;,
15            &quot;purpose&quot;: &quot;maskable&quot;
16        },
17        {
18            &quot;src&quot;: &quot;./assets/static/images/android-chrome-192x192.maskable.png&quot;,
19            &quot;sizes&quot;: &quot;192x192&quot;,
20            &quot;type&quot;: &quot;image/png&quot;,
21            &quot;purpose&quot;: &quot;maskable&quot;
22        },
23        {
24            &quot;src&quot;: &quot;./assets/static/images/apple-touch-icon.png&quot;,
25            &quot;sizes&quot;: &quot;180x180&quot;,
26            &quot;type&quot;: &quot;image/png&quot;,
27            &quot;purpose&quot;: &quot;maskable&quot;
28        }
29    ],
30    &quot;screenshots&quot;: [
31        {
32            &quot;src&quot;: &quot;./assets/static/images/screenshot.png&quot;,
33            &quot;sizes&quot;: &quot;1080x2220&quot;,
34            &quot;type&quot;: &quot;image/png&quot;
35        }
36    ]
37    &lt;link rel=&quot;apple-touch-icon&quot; sizes=&quot;180x180&quot; href=&quot;./assets/static/images/apple-touch-icon.png&quot;/&gt;
38    &lt;link rel=&quot;shortcut icon&quot; href=&quot;./assets/static/images/favicon.ico&quot;/&gt;
39    &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; sizes=&quot;32x32&quot; href=&quot;./assets/static/images/favicon-32x32.png&quot;/&gt;
40    &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; sizes=&quot;16x16&quot; href=&quot;./assets/static/images/favicon-16x16.png&quot;/&gt;
41    &lt;link rel=&quot;mask-icon&quot; href=&quot;./assets/static/images/safari-pinned-tab.svg&quot; color=&quot;#379&quot;/&gt;
42    &lt;meta name=&quot;msapplication-config&quot; content=&quot;./assets/static/images/browserconfig.xml&quot;/&gt;
43&lt;link rel=&quot;shortcut icon&quot; href=&quot;./favicon.ico&quot;/&gt;
44

The only exception to this are the favicon-32x32.png and favicon-16x16.png icons that are referred to in index.html. These two icons should be cached, as desktop browser will fetch these as tab icons.

Furthermore, the service-worker.js should also not cache itself.

Finally, significant icon size reductions can be achieved by converting the images from RGB colour space to an indexed colour palette of for example 24 colours. This can be done using the free image editor GIMP. When exporting the images with GIMP, deselect metadata and thumbnail generation.

Source https://stackoverflow.com/questions/66971402

QUESTION

How do I change the &quot;Authorising...&quot; message that appears when a Blazor PWA application is being refreshed?

Asked 2021-Feb-22 at 06:46

When an asp net hosted BLAZOR Progressive Web Application is refreshed using browser refresh, PWA application performs an authentication roundtrip. During this time span, main content div displays the text: "Authorising...". Where does this message originate from? My objective is to display a spinner-border along with this message so that the user experience an animation. Here is what I know:

  • Initial "Loading..." message appears from the index page in wwwroot.
  • For every AutherizeView, Authorizing section can be used to show custom message.

But I'm unable to locate the source of default "Authorising..." message.

ANSWER

Answered 2021-Feb-22 at 06:46

There are two places that need your intention.

First is in your App.razor. The AuthorizeRouteView has a property called Authorizing, where you can add any RenderFragement you want to display during authorizing. Here is the line where the Authorizing... is set.

1&lt;CascadingAuthenticationState&gt;
2    &lt;Router AppAssembly=&quot;@typeof(Program).Assembly&quot; PreferExactMatches=&quot;@true&quot;&gt;
3        &lt;Found Context=&quot;routeData&quot;&gt;
4            &lt;AuthorizeRouteView RouteData=&quot;@routeData&quot; DefaultLayout=&quot;@typeof(MainLayout)&quot;&gt;
5                &lt;Authorizing&gt;
6                    &lt;span&gt;Your spinner goes here&lt;/span&gt;
7                &lt;/Authorizing&gt;
8                &lt;NotAuthorized&gt;
9                    @if (!context.User.Identity.IsAuthenticated)
10                    {
11                        &lt;RedirectToLogin /&gt;
12                    }
13                    else
14                    {
15                        &lt;p&gt;You are not authorized to access this resource.&lt;/p&gt;
16                    }
17                &lt;/NotAuthorized&gt;
18            &lt;/AuthorizeRouteView&gt;
19        &lt;/Found&gt;
20        &lt;NotFound&gt;
21            &lt;LayoutView Layout=&quot;@typeof(MainLayout)&quot;&gt;
22                &lt;p&gt;Sorry, there's nothing at this address.&lt;/p&gt;
23            &lt;/LayoutView&gt;
24        &lt;/NotFound&gt;
25    &lt;/Router&gt;
26&lt;/CascadingAuthenticationState&gt;
27
28

If you have created the app using the default template, you should see an AuthenticationPage. This page has the route @page "/authentication/{action}".

This page content looks like

1&lt;CascadingAuthenticationState&gt;
2    &lt;Router AppAssembly=&quot;@typeof(Program).Assembly&quot; PreferExactMatches=&quot;@true&quot;&gt;
3        &lt;Found Context=&quot;routeData&quot;&gt;
4            &lt;AuthorizeRouteView RouteData=&quot;@routeData&quot; DefaultLayout=&quot;@typeof(MainLayout)&quot;&gt;
5                &lt;Authorizing&gt;
6                    &lt;span&gt;Your spinner goes here&lt;/span&gt;
7                &lt;/Authorizing&gt;
8                &lt;NotAuthorized&gt;
9                    @if (!context.User.Identity.IsAuthenticated)
10                    {
11                        &lt;RedirectToLogin /&gt;
12                    }
13                    else
14                    {
15                        &lt;p&gt;You are not authorized to access this resource.&lt;/p&gt;
16                    }
17                &lt;/NotAuthorized&gt;
18            &lt;/AuthorizeRouteView&gt;
19        &lt;/Found&gt;
20        &lt;NotFound&gt;
21            &lt;LayoutView Layout=&quot;@typeof(MainLayout)&quot;&gt;
22                &lt;p&gt;Sorry, there's nothing at this address.&lt;/p&gt;
23            &lt;/LayoutView&gt;
24        &lt;/NotFound&gt;
25    &lt;/Router&gt;
26&lt;/CascadingAuthenticationState&gt;
27
28@page &quot;/authentication/{action}&quot;
29@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
30&lt;RemoteAuthenticatorView Action=&quot;@Action&quot; /&gt;
31
32@code{
33    [Parameter] public string Action { get; set; }
34}
35

You can change the entire template by adding the corresponding RenderFragments which can be found here

Here is an example where every fragment has a non-default value

1&lt;CascadingAuthenticationState&gt;
2    &lt;Router AppAssembly=&quot;@typeof(Program).Assembly&quot; PreferExactMatches=&quot;@true&quot;&gt;
3        &lt;Found Context=&quot;routeData&quot;&gt;
4            &lt;AuthorizeRouteView RouteData=&quot;@routeData&quot; DefaultLayout=&quot;@typeof(MainLayout)&quot;&gt;
5                &lt;Authorizing&gt;
6                    &lt;span&gt;Your spinner goes here&lt;/span&gt;
7                &lt;/Authorizing&gt;
8                &lt;NotAuthorized&gt;
9                    @if (!context.User.Identity.IsAuthenticated)
10                    {
11                        &lt;RedirectToLogin /&gt;
12                    }
13                    else
14                    {
15                        &lt;p&gt;You are not authorized to access this resource.&lt;/p&gt;
16                    }
17                &lt;/NotAuthorized&gt;
18            &lt;/AuthorizeRouteView&gt;
19        &lt;/Found&gt;
20        &lt;NotFound&gt;
21            &lt;LayoutView Layout=&quot;@typeof(MainLayout)&quot;&gt;
22                &lt;p&gt;Sorry, there's nothing at this address.&lt;/p&gt;
23            &lt;/LayoutView&gt;
24        &lt;/NotFound&gt;
25    &lt;/Router&gt;
26&lt;/CascadingAuthenticationState&gt;
27
28@page &quot;/authentication/{action}&quot;
29@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
30&lt;RemoteAuthenticatorView Action=&quot;@Action&quot; /&gt;
31
32@code{
33    [Parameter] public string Action { get; set; }
34}
35@page &quot;/authentication/{action}&quot;
36@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
37&lt;RemoteAuthenticatorView Action=&quot;@Action&quot;&gt;
38    &lt;LoggingIn&gt;
39        &lt;span&gt;LoggingIn&lt;/span&gt;
40    &lt;/LoggingIn&gt;
41    &lt;Registering&gt;
42        &lt;span&gt;Registering&lt;/span&gt;
43    &lt;/Registering&gt;
44    &lt;Registering&gt;
45        &lt;span&gt;LoggingIn&lt;/span&gt;
46    &lt;/Registering&gt;
47    &lt;UserProfile&gt;
48        &lt;span&gt;UserProfile is loaded....&lt;/span&gt;
49    &lt;/UserProfile&gt;
50    &lt;CompletingLoggingIn&gt;
51        &lt;span&gt;CompletingLoggingIn&lt;/span&gt;
52    &lt;/CompletingLoggingIn&gt;
53    &lt;LogInFailed&gt;
54        &lt;span&gt;Login failed. Reason: @context&lt;/span&gt;
55    &lt;/LogInFailed&gt;
56    &lt;LogOut&gt;
57        &lt;span&gt;Logout from the application&lt;/span&gt;
58    &lt;/LogOut&gt;
59    &lt;LogOut&gt;
60        &lt;span&gt;CompletingLogOut&lt;/span&gt;
61    &lt;/LogOut&gt;
62    &lt;LogOutFailed&gt;
63        &lt;span&gt;Logout failed. Reason: @context&lt;/span&gt;
64    &lt;/LogOutFailed&gt;
65    &lt;LogOut&gt;
66        &lt;span&gt;LogOutSucceeded&lt;/span&gt;
67    &lt;/LogOut&gt;
68&lt;/RemoteAuthenticatorView&gt;
69
70@code{
71    [Parameter] public string Action { get; set; }
72}
73

Source https://stackoverflow.com/questions/66310829

QUESTION

Migrating Chrome USB App API to Web USB API

Asked 2021-Feb-09 at 01:10

I currently have source code for a Chrome App, but as the platform is being deprecated I need to migrate my API to a Progressive Web Application.

As I still want support for USB in my web platform application, it was suggested that I use the Web USB API to retain functionality, but I can't seem to figure out the equivalent's for the following and how to implement them:

1chrome.usb.releaseInterface()
2chrome.usb.closeDevice()
3chrome.usb.claimInterface()
4chrome.usb.findDevices()
5chrome.usb.bulkTransfer()
6

(Also, I also found there is a USB Library for Node.JS that works similarly also; is this a good alternative too?)

ANSWER

Answered 2021-Feb-09 at 01:10

The WebUSB API provides a USBDevice interface which is returned by navigator.usb.getDevices() and navigator.usb.requestDevice(). This interface has methods equivalent to all but one of those listed above:

1chrome.usb.releaseInterface()
2chrome.usb.closeDevice()
3chrome.usb.claimInterface()
4chrome.usb.findDevices()
5chrome.usb.bulkTransfer()
6chrome.usb.releaseInterface() -&gt; releaseInterface()
7chrome.usb.closeDevice()      -&gt; close()
8chrome.usb.claimInterface()   -&gt; claimInterface()
9chrome.usb.bulkTransfer()     -&gt; transferIn() or transferOut().
10

chrome.usb.findDevices() is more complex to replace and first requires explaining the differences between the permission model for the WebUSB API and the chrome.usb API. The WebUSB API does not provide an install-time permission to access USB devices. A site must call navigator.usb.requestDevice() to ask the user for permission to access new USB devices. For devices with serial numbers permissions are remembered and so you can call navigator.usb.getDevices() to get a list of currently connected devices a site previously got permission to access. This is the same model as the chrome.usb.getUserSelectedDevices() function. The chrome.usb.findDevices() function also implicitly opened the devices in the process of returning them to the application. There is no equivalent to this behavior. The site must explicitly call open() on the USBDevice interfaces returned by these methods.

Note, that if this application is being deployed into a managed environment the WebUsbAllowDevicesForUrls policy can be used to mimic the Chrome Apps permission model. Devices allowed by policy will be returned by navigator.usb.getDevices() without the need to call navigator.usb.requestDevice() and prompt the user first.

Source https://stackoverflow.com/questions/66110272

QUESTION

No Manifest Detected on a PHP Progressive Web Application

Asked 2021-Feb-06 at 21:24

I'm trying to make my PHP web application into a Progressive Web Application, but when I open Chrome DevTools into the application tab, it tells me there is 'No Manifest Detected' when I have put the manifest.json at the root but my ServiceWorker.js is successfully running.

1&lt;!DOCTYPE html&gt;
2&lt;html lang="en"&gt;
3
4&lt;?php
5//php code
6?&gt;
7
8&lt;head&gt;
9    &lt;title&gt;php&lt;/title&gt;
10    &lt;meta charset="UTF-8"&gt;
11    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
12  &lt;link rel="manifest" href="/manifest.json"&gt;
13    &lt;link rel="stylesheet" type="text/css" href="css/util.css"&gt;
14    &lt;link rel="stylesheet" type="text/css" href="css/main.css"&gt;
15
16&lt;/head&gt;
17
18&lt;body&gt;
19//body code
20&lt;/body&gt;
21
22&lt;/html&gt;
1&lt;!DOCTYPE html&gt;
2&lt;html lang="en"&gt;
3
4&lt;?php
5//php code
6?&gt;
7
8&lt;head&gt;
9    &lt;title&gt;php&lt;/title&gt;
10    &lt;meta charset="UTF-8"&gt;
11    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
12  &lt;link rel="manifest" href="/manifest.json"&gt;
13    &lt;link rel="stylesheet" type="text/css" href="css/util.css"&gt;
14    &lt;link rel="stylesheet" type="text/css" href="css/main.css"&gt;
15
16&lt;/head&gt;
17
18&lt;body&gt;
19//body code
20&lt;/body&gt;
21
22&lt;/html&gt;{
23&quot;name&quot;: &quot;php&quot;,
24&quot;version&quot;: &quot;1.0&quot;,
25&quot;short_name&quot;: &quot;php&quot;,
26&quot;start_url&quot;: &quot;./index.php&quot;,
27&quot;background_color&quot;: &quot;#000000&quot;,
28&quot;display&quot;: &quot;standalone&quot;,
29&quot;orientation&quot;: &quot;any&quot;,
30
31&quot;default_locale&quot;: &quot;en&quot;,
32&quot;description&quot;: &quot;example&quot;,
33&quot;icons&quot;: [
34
35    {
36        &quot;src&quot;: &quot;512x512.png&quot;,
37        &quot;sizes&quot;: &quot;512x512&quot;,
38        &quot;type&quot;: &quot;image/png&quot;
39    },
40
41    {
42        &quot;src&quot;: &quot;192x192.png&quot;,
43        &quot;sizes&quot;: &quot;192x192&quot;,
44        &quot;type&quot;: &quot;image/png&quot;
45    }
46
47]}
48

I have validated the manifest.json file here and it works in a test HTML file; it's just trying to put it into a PHP file is where I don't see anything happening.

Applications ChromeDevTools

ANSWER

Answered 2021-Feb-06 at 21:24

Move your <head></head> block directly below the opening <html> tag, so that your <?php //php code ?> is below it. The manifest won't be detected, if there is any output before the document head.

1&lt;!DOCTYPE html&gt;
2&lt;html lang="en"&gt;
3
4&lt;?php
5//php code
6?&gt;
7
8&lt;head&gt;
9    &lt;title&gt;php&lt;/title&gt;
10    &lt;meta charset="UTF-8"&gt;
11    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
12  &lt;link rel="manifest" href="/manifest.json"&gt;
13    &lt;link rel="stylesheet" type="text/css" href="css/util.css"&gt;
14    &lt;link rel="stylesheet" type="text/css" href="css/main.css"&gt;
15
16&lt;/head&gt;
17
18&lt;body&gt;
19//body code
20&lt;/body&gt;
21
22&lt;/html&gt;{
23&quot;name&quot;: &quot;php&quot;,
24&quot;version&quot;: &quot;1.0&quot;,
25&quot;short_name&quot;: &quot;php&quot;,
26&quot;start_url&quot;: &quot;./index.php&quot;,
27&quot;background_color&quot;: &quot;#000000&quot;,
28&quot;display&quot;: &quot;standalone&quot;,
29&quot;orientation&quot;: &quot;any&quot;,
30
31&quot;default_locale&quot;: &quot;en&quot;,
32&quot;description&quot;: &quot;example&quot;,
33&quot;icons&quot;: [
34
35    {
36        &quot;src&quot;: &quot;512x512.png&quot;,
37        &quot;sizes&quot;: &quot;512x512&quot;,
38        &quot;type&quot;: &quot;image/png&quot;
39    },
40
41    {
42        &quot;src&quot;: &quot;192x192.png&quot;,
43        &quot;sizes&quot;: &quot;192x192&quot;,
44        &quot;type&quot;: &quot;image/png&quot;
45    }
46
47]}
48&lt;!DOCTYPE html&gt;
49&lt;html lang="en"&gt;
50
51&lt;head&gt;
52    &lt;title&gt;php&lt;/title&gt;
53    &lt;meta charset="UTF-8"&gt;
54    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
55    &lt;link rel="manifest" href="/manifest.json"&gt;
56    &lt;link rel="stylesheet" type="text/css" href="css/util.css"&gt;
57    &lt;link rel="stylesheet" type="text/css" href="css/main.css"&gt;
58&lt;/head&gt;
59
60&lt;?php
61  //php code
62?&gt;
63
64&lt;body&gt;
65  //body code
66&lt;/body&gt;
67
68&lt;/html&gt;

Source https://stackoverflow.com/questions/66072473

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Progressive Web Application

Tutorials and Learning Resources are not available at this moment for Progressive Web Application

Share this Page

share link

Get latest updates on Progressive Web Application