From bb62408e8154e9c666d27bd048fd4b0c370d4a27 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Feb 2025 10:25:43 +0100 Subject: [PATCH] Update browser stack tests --- client/e2e/wdio.browserstack.conf.ts | 6 +++--- client/src/standalone/videos/embed.html | 8 ++++++++ client/src/standalone/videos/vite.config.mjs | 14 +++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/client/e2e/wdio.browserstack.conf.ts b/client/e2e/wdio.browserstack.conf.ts index b3e18cad4..a88c31d56 100644 --- a/client/e2e/wdio.browserstack.conf.ts +++ b/client/e2e/wdio.browserstack.conf.ts @@ -71,7 +71,7 @@ module.exports = { }, { browserName: 'Firefox', - browserVersion: '78', // Very old ESR + browserVersion: '79', // Oldest supported version ...buildBStackDesktopOptions({ sessionName: 'Firefox ESR Desktop', resolution: '1280x1024', os: 'Windows', osVersion: '8' }) }, @@ -100,13 +100,13 @@ module.exports = { { browserName: 'Safari', - ...buildBStackMobileOptions({ sessionName: 'Safari iPhone', deviceName: 'iPhone 11', osVersion: '13' }) + ...buildBStackMobileOptions({ sessionName: 'Safari iPhone', deviceName: 'iPhone 11', osVersion: '14' }) }, { browserName: 'Safari', - ...buildBStackMobileOptions({ sessionName: 'Safari iPad', deviceName: 'iPad Pro 11 2020', osVersion: '13' }) + ...buildBStackMobileOptions({ sessionName: 'Safari iPad', deviceName: 'iPad Pro 11 2020', osVersion: '14' }) } ], diff --git a/client/src/standalone/videos/embed.html b/client/src/standalone/videos/embed.html index a5051ae7d..8220b7b99 100644 --- a/client/src/standalone/videos/embed.html +++ b/client/src/standalone/videos/embed.html @@ -123,6 +123,14 @@ if (/MSIE|Trident/.test(window.navigator.userAgent) ) { window.displayIncompatibleBrowser() } + + try { + BigInt(9007199254740991) + } catch (err) { + console.error('BigInt is not supported on this web browser') + + window.displayIncompatibleBrowser() + } diff --git a/client/src/standalone/videos/vite.config.mjs b/client/src/standalone/videos/vite.config.mjs index f74230128..e9860608e 100644 --- a/client/src/standalone/videos/vite.config.mjs +++ b/client/src/standalone/videos/vite.config.mjs @@ -7,6 +7,12 @@ import checker from 'vite-plugin-checker' import { getCSSConfig, getAliasConfig } from '../build-tools/vite-utils.js' +const nodeConfig = process.env.NODE_CONFIG + ? JSON.parse(process.env.NODE_CONFIG) + : undefined + +const hostname = nodeConfig?.webserver?.hostname || 'localhost' + const __dirname = dirname(fileURLToPath(import.meta.url)) const root = resolve(__dirname, '../../../') @@ -19,9 +25,11 @@ export default defineConfig(({ mode }) => { root: resolve(root, 'src', 'standalone', 'videos'), server: { + host: hostname, + proxy: { '^/(videos|video-playlists)/(test-)?embed/[^\/\.]+$': { - target: 'http://localhost:5173', + target: 'http://' + hostname + ':5173', rewrite: (path) => { return path.replace('/videos/embed/', 'embed.html?videoId=') .replace('/videos/test-embed/', 'test-embed.html?') @@ -30,13 +38,13 @@ export default defineConfig(({ mode }) => { } }, '^/(videos|video-playlists)/(test-)?embed/.*': { - target: 'http://localhost:5173', + target: 'http://' + hostname + ':5173', rewrite: (path) => { return path.replace(/\/(videos|video-playlists)\/(test-)?embed\//, '') } }, '^/lazy-static': { - target: 'http://localhost:9000' + target: 'http://' + hostname + ':9000' } } },