Index: docs/explainer.md |
diff --git a/docs/explainer.md b/docs/explainer.md |
index 6f0167a50c562614058d3411df4d3568023b7b07..fc013d5b9f3566ff923860ab952f2e1889a49966 100644 |
--- a/docs/explainer.md |
+++ b/docs/explainer.md |
@@ -114,8 +114,8 @@ choosing, just attach this JavaScript code to a "share" button. |
```js |
shareButton.addEventListener('click', () => { |
- navigator.actions.performAction('share', {url: window.location.href}) |
- .then(action => console.log(action)); |
+ navigator.share({url: window.location.href}) |
+ .then(console.log('Share successful')); |
}); |
``` |
@@ -142,24 +142,18 @@ any tabs. |
"name": "Includinator", |
"short_name": "Includinator", |
"icons": [...], |
- "actions": [ |
- { |
- "verb": "share" |
- } |
- ] |
+ "supports_share": true |
} |
``` |
#### serviceworker.js |
```js |
-navigator.actions.addEventListener('handle', event => { |
- if (event.options.verb == 'share') { |
- if (event.data.url === undefined) |
- throw new Error('Did not contain URL.'); |
+navigator.actions.addEventListener('share', event => { |
+ if (event.data.url === undefined) |
+ throw new Error('Did not contain URL.'); |
- includinate(event.data.url); |
- } |
+ includinate(event.data.url); |
}); |
``` |