有没有办法检查 FetchEvent 是否来自 iframe src?

is there a way to check if a FetchEvent comes from an iframe src?

我的 serviceworker 正在监听 fetch,对于所有带导航模式的 FetchEvent 请求,我想做一些事情,但不包括来自 iframes src 的请求。

我已经检查了事件和请求对象,但没有找到检查它的方法,有可能知道吗?

不,该信息未在 FetchEvent 中公开。

此外,在确定 ClientType 值时,整页客户端和 iframe 客户端之间没有区别。两者都以 windowClientType 返回。