From d695031f59dc3e66d053bca3d1680edf28f73a9e Mon Sep 17 00:00:00 2001 From: benjadahl Date: Fri, 21 Oct 2022 14:25:42 +0200 Subject: [PATCH] Fixed https://github.com/zikaari/webext-bridge/issues/42 - by reconnecting onpagesshow event --- src/internal/persistent-port.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/internal/persistent-port.ts b/src/internal/persistent-port.ts index 2281c68..5dfa72b 100644 --- a/src/internal/persistent-port.ts +++ b/src/internal/persistent-port.ts @@ -107,6 +107,10 @@ export const createPersistentPort = (name = '') => { }) } + window.onpageshow = (event) => { + if (event.persisted) connect() + } + connect() return {