pixiebrix / webext-messenger

Browser Extension component messaging framework
MIT License
12 stars 2 forks source link

Support messaging with the offscreen page #273

Open fungairino opened 5 days ago

fungairino commented 5 days ago

Notes: See change that was reverted due to this bug: https://github.com/pixiebrix/pixiebrix-extension/commit/2021198cba9b4497afeb2db17d741cbf641a8326

Action item from: https://www.notion.so/pixiebrix/Postmortem-Release-2-1-6-13543b21a253809bab4cd2aace909433?pvs=4

grahamlangford commented 4 days ago

Related: https://github.com/fregante/webext-detect/pull/32

fregante commented 4 days ago

I added support for offscreen document detection to webext-detect:

As mentioned in an email to Todd, the messenger was likely failing because the offscreen document was not being properly detected. Also this line needs isBackground() || isOffscreenDocument()

https://github.com/pixiebrix/webext-messenger/blob/94cc22cbac09b53d2b123f8be36fe78485c6a9ea/source/thisTarget.ts#L58