Skip to content

Commit

Permalink
Add snippet about feature detection
Browse files Browse the repository at this point in the history
  • Loading branch information
andypaicu authored Nov 20, 2024
1 parent 5be99e9 commit e14d1ae
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ Use a version of Chrome that is version 121.0.6136 or higher. This might mean yo

To enable the PEPC feature you need to start Chrome with the command line flag: `--enable-features=PermissionElement`. You need to make sure the Chrome app is fully closed; simply starting a new instance while one is already open will not work on certain Operating Systems. You can verify the flag is active by visiting `chrome://version`.

## Feature Detection
You can use code such as the following example to determine if PEPC is supported:

```JS
let el = document.createElement("permission");
if (el instanceof HTMLUnknownElement) {
// PEPC not supported
...
} else {
// PEPC supported
...
}
```

More advanced feature detection (such as per-type) is not currently supported.

## Using PEPC
You can visit https://permission.site/pepc for a quick example and test.

Expand Down

0 comments on commit e14d1ae

Please sign in to comment.