PageMod attaching worker to same URL multiple times

后端 未结 2 1495
心在旅途
心在旅途 2020-12-19 03:50

CLEAN SOLUTION FOUND

I found a very clean solution which really renders this whole question pointless, and I am certain it existed when I asked this

2条回答
  •  孤城傲影
    2020-12-19 04:08

    In the contentScript or whatever is running in the web site (i dont know much about sdk), check if (window.frameElement == true) if its true than its a frame then you want to cancel the attach.

    edit: maybe window.frameElement wont work from within the frame. if it doesnt work do this if (window.top != window) then its a frame

提交回复
热议问题