From 39fdd72e9faa613545559df8c791f91719f664f2 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 30 Mar 2025 01:24:37 +0100 Subject: [PATCH] Don't propagate bad site data from uwserver to extension popup --- src/ext/UWServer.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ext/UWServer.ts b/src/ext/UWServer.ts index ab138e8..7dc21e6 100644 --- a/src/ext/UWServer.ts +++ b/src/ext/UWServer.ts @@ -276,11 +276,20 @@ export default class UWServer { } async getCurrentSite() { + const site = await this.getVideoTab(); + + // Don't propagate 'INVALID SITE' to the popup. + if (site.host === 'INVALID SITE') { + return; + } + + const tabHostname = await this.getCurrentTabHostname(); + this.eventBus.send( 'set-current-site', { - site: await this.getVideoTab(), - tabHostname: await this.getCurrentTabHostname(), + site, + tabHostname, }, { comms: {