webview.request access to requests initiated by the service worker

断了今生、忘了曾经 提交于 2019-12-25 01:40:51

问题


In a Chrome App I am able to access requests made by the <webview> and I am able to redirect if needed.

The problem is the web app rendered inside the <webview> tag registers a service worker and lots of requests are handled by the service worker.

Based on my tests the onBeforeRequest won't be notified. It works if I unregister the service worker, though.

webview.request.onBeforeRequest.addListener(
      this.handleRequest,
      {urls: [pattern], types: ["image"]},
      ["blocking"]
    );

So, is this a bug? or intentional?

ref: https://developers.chrome.com/apps/tags/webview#property-request

来源:https://stackoverflow.com/questions/56434246/webview-request-access-to-requests-initiated-by-the-service-worker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!