Skip to content

Commit

Permalink
Merge pull request #13 from jaulz/docs/improve-readme
Browse files Browse the repository at this point in the history
docs: improve readme with hint to demo
  • Loading branch information
jaulz authored Jan 24, 2020
2 parents 24d3b9b + 0e03603 commit e637d0d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# Badgin

The [Badging API](https://web.dev/badging-api/) is a new web platform API that allows installed web apps to set an application-wide badge, shown in an operating-system-specific place associated with the application (such as the shelf or home screen). Starting in Chrome 73, the Badging API is available as an origin trial for Windows (7+) and macOS. If you want to know how origin trials work, please check the[documentation](https://web.dev/badging-api/#ot). Since this API is not available everywhere, `badgin` safely falls back to alternatives.

## via badge

Currently, the native badge is only displayed if you install the web application to your home screen (view [prerequisites](https://developers.google.com/web/fundamentals/app-install-banners)). The screenshot shows the application in the dock of macOS.

![](https://github.com/jaulz/badgin/raw/master/assets/screenshots/standalone_osx.png)

The [Badging API](https://developers.google.com/web/updates/2018/12/badging-api) is a new web platform API that allows installed web apps to set an application-wide badge, shown in an operating-system-specific place associated with the application (such as the shelf or home screen). Starting in Chrome 73, the Badging API is available as an origin trial for Windows (7+) and macOS. If you want to know how origin trials work, please check [Google's documentation](https://developers.google.com/web/updates/2018/12/badging-api#use). Since this API is not available everywhere, `badgin` safely falls back to alternatives:
## via favicon

### via Favicon
If the native badge is not available, the favicon will be used and a small badge will be added.

![](https://github.com/jaulz/badgin/raw/master/assets/screenshots/favicon.png)

### via Title
## via title

If the favicon is not available, the badge will be added as a prefix to the title.

![](https://github.com/jaulz/badgin/raw/master/assets/screenshots/title.png)

## Demo

You can find a demo at https://jaulz.github.io/badgin/ where you can see the different options. If you want to see the native badge, you need to install the app to your home screen (check out the plus icon in the address bar).

## Installation

The module can be installed by running:
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<link rel="icon" href="./assets/favicon.ico" />
<title>badgin Demo</title>
<!-- Renew at https://developers.chrome.com/origintrials/#/trials/my latest by 5 Feb 2020 -->
<!-- Renew at https://developers.chrome.com/origintrials/#/trials/my latest by 6 Mar 2020 -->
<meta
http-equiv="origin-trial"
content="AuIqzaeJsa2y1R0UYb0m4CetRftNCmG7Wl40RbnZqEPFuQbJz6CVpA483GQjn6ckqNVDabo9g0SXB2ZFHzA53A4AAABQeyJvcmlnaW4iOiJodHRwczovL2phdWx6LmdpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiQmFkZ2luZyIsImV4cGlyeSI6MTU4MDg2MDc5OX0="
content="Av8KY0iiQXJoEA3x2B7PReZwNKE5CJcGZGMrK3xL99w8lUOtnPd9Ols0IA0fClmRMvqZAqkx3bjaUwMYszfeswcAAABSeyJvcmlnaW4iOiJodHRwczovL2phdWx6LmdpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiQmFkZ2luZ1YyIiwiZXhwaXJ5IjoxNTgzNDg5MjE0fQ==="
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="manifest" href="./assets/manifest.json" />
Expand Down

0 comments on commit e637d0d

Please sign in to comment.