From 66fdd6c428e57c1c21c9673b985220d2d7d2436c Mon Sep 17 00:00:00 2001 From: Krzysztof Date: Sat, 2 Oct 2021 19:09:17 +0100 Subject: [PATCH] feat: Add basic support for Web Share Target API (#714) --- frontend/public/manifest.json | 12 ++++++++++-- frontend/src/components/UI/TheRecipeFab.vue | 10 ++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json index dad08e0e4b88..19dd9af6d472 100644 --- a/frontend/public/manifest.json +++ b/frontend/public/manifest.json @@ -78,5 +78,13 @@ "start_url": ".", "display": "standalone", "background_color": "#FFFFFF", - "theme_color": "#E58325" -} \ No newline at end of file + "theme_color": "#E58325", + "share_target": { + "action": "/", + "method": "GET", + "params": { + "title": "title", + "text": "recipe_import_url" + } + } +} diff --git a/frontend/src/components/UI/TheRecipeFab.vue b/frontend/src/components/UI/TheRecipeFab.vue index e9e6cb46d14e..626d271d74ff 100644 --- a/frontend/src/components/UI/TheRecipeFab.vue +++ b/frontend/src/components/UI/TheRecipeFab.vue @@ -166,10 +166,12 @@ export default { }, mounted() { - if (this.$route.query.recipe_import_url) { - this.addRecipe = true; - this.createRecipe(); - } + this.$router.onReady(() => { + if (this.$route.query.recipe_import_url) { + this.addRecipe = true; + this.createRecipe(); + } + }); }, computed: {