-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #482 from rlaig/contribute/pwa
feat: progressive web app capability
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Progressive Web App | ||
|
||
roBrowser can be setup as a [progressive web app](https://web.dev/articles/what-are-pwas). | ||
|
||
## Setup Application Files | ||
|
||
1. Build roBrowser compiled version `npm run build:all:minify`, wait to complete. | ||
|
||
* must have installed deps first (`npm install`) before running build script. | ||
|
||
2. Copy generated files from `dist/Web/` folder to `pwa/application` folder | ||
|
||
* note: only files `Online.js`, `ThreadEventHandler.js`, `index.html` and folder `src` will be used | ||
|
||
## Configure Client | ||
|
||
1. Open and modify `index.html` to configure your client, can refer to http://www.robrowser.com/getting-started#API | ||
|
||
2. Insert this code on your `index.html` anywhere inside the `<head>` tag | ||
``` | ||
<link rel="manifest" href="robrowser.webmanifest"> | ||
``` | ||
|
||
example: | ||
``` | ||
... | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
<link rel="manifest" href="robrowser.webmanifest"> | ||
... | ||
``` | ||
|
||
## Configure PWA App | ||
|
||
Open and modify `robrowser.webmanifest` and edit according to your preference: | ||
|
||
* `name` : The full name of your web app. | ||
|
||
* `short_name`: Short name to be shown on the home screen. | ||
|
||
* `description`: A sentence or two explaining what your app does. | ||
|
||
* `icons`: Information about the app icons — source URLs, sizes, and types. Be sure to include at least a few, so that one that fits best will be chosen for the user's device. | ||
|
||
* `start_url`: The index document to launch when starting the app. | ||
|
||
* `display`: How the app is displayed; can be `fullscreen`, `standalone`, `minimal-ui`, or `browser`. | ||
|
||
* `theme_color`: A primary color for the UI, used by operating system. | ||
|
||
* `background_color`: A color used as the app's default background, used during install and on the splash screen. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "roBrowser Progressive Web App", | ||
"short_name": "roBrowser", | ||
"description": "Progressive Web App for roBrowser.", | ||
"icons": [ | ||
{ | ||
"src": "/application/icon_16.png", | ||
"sizes": "16x16", | ||
"type": "image/png", | ||
"purpose": "any" | ||
}, | ||
{ | ||
"src": "/application/icon_128.png", | ||
"sizes": "128x128", | ||
"type": "image/png", | ||
"purpose": "any" | ||
} | ||
], | ||
"start_url": "/demo.html?fullscreen=true", | ||
"display": "fullscreen", | ||
"theme_color": "#4e84e9", | ||
"background_color": "#ffffff" | ||
} |