簡體   English   中英

使用 Web Share Target 發送數據后如何退出我的 PWA?

[英]How to exit my PWA after sending data with Web Share Target?

如果我將 Google 照片中的圖片分享到我的 PWA(在 Android 上安裝 Chrome 並使用此代碼https://web.dev/web-share-target/ ),我會到達我的 PWA 頁面。 如何將 go 自動返回到 Google Photo?
如果這很重要,后端位於 PHP 中。
謝謝!

我沒有對此進行測試,但是您是否嘗試過從服務工作者的fetch事件處理程序重定向到立即使用此技術關閉自身的 HTML 頁面?

就像是:

self.addEventListener('fetch', (event) => {
  // ...process the incoming event.request body here...

  // Once you're done, respond with a redirect:
  event.respondWith(Response.redirect('/self-closing-page.html', 303));
});

然后您的/self-closing-page.html web 頁面將自行關閉。 那會(也許?)讓你回到原來的 Android 應用程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM