From 9c37fab8cdd518b0d4ace5ecfca78164739df1e7 Mon Sep 17 00:00:00 2001 From: Ezequiel Date: Thu, 12 Sep 2024 11:21:32 +1000 Subject: [PATCH 1/2] Fix firefox visibilitychange -> hidden when changing tabs --- src/caller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/caller.ts b/src/caller.ts index ffd2d55..b7b6c73 100644 --- a/src/caller.ts +++ b/src/caller.ts @@ -67,7 +67,11 @@ export class TabsManagerWorkerCaller extends EventEmitter { if (!this.workerInstance) return; window.addEventListener('focus', this.setActiveTab); - document.addEventListener('visibilitychange', this.setActiveTab); + document.addEventListener('visibilitychange', () => { + if (document.visibilityState !== 'hidden') { + this.setActiveTab(); + } + }); window.addEventListener('unload', this.closeWindow); if (document.visibilityState === 'visible') { From 1593b490335d3b9ccb4c48deaaa964182d37d9b0 Mon Sep 17 00:00:00 2001 From: Ezequiel Date: Thu, 12 Sep 2024 11:22:00 +1000 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 14021a7..d465162 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tabs-manager", - "version": "1.0.3", + "version": "1.0.4", "description": "Definition one active tab on multiple tabs scenarios. ", "main": "./lib/index.js", "scripts": {