From 6062094e6f0de811b0360ba1d13b5472e57ab567 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 21 Oct 2023 17:41:09 +0200 Subject: [PATCH] Fix crashes in chrome --- src/ext/lib/video-data/VideoData.ts | 2 +- webpack.config.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ext/lib/video-data/VideoData.ts b/src/ext/lib/video-data/VideoData.ts index af3f3de..6df2be2 100644 --- a/src/ext/lib/video-data/VideoData.ts +++ b/src/ext/lib/video-data/VideoData.ts @@ -395,7 +395,7 @@ class VideoData { this.video.classList.remove(this.baseCssName); this.video.classList.remove(this.userCssClassName); - if (!options.fromPlayer) { + if (!options?.fromPlayer) { this.player?.disable(); } } diff --git a/webpack.config.js b/webpack.config.js index aac4c35..6bde41f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,6 +8,9 @@ const { VueLoaderPlugin } = require('vue-loader'); const path = require('path'); const config = { + watchOptions: { + ignored: /node_modules/ + }, mode: process.env.NODE_ENV, devtool: `${process.env.CHANNEL === 'stable' ? undefined : "inline-source-map"}`, context: __dirname + '/src', @@ -176,8 +179,12 @@ const config = { if (process.env.BROWSER !== 'firefox') { jsonContent.version = jsonContent.version.replace(/[a-zA-Z-]/g, ''); - delete jsonContent.options_ui.browser_style; - delete jsonContent.background.scripts; + try { + delete jsonContent.options_ui.browser_style; + } catch (e) { } + try { + delete jsonContent.background.scripts; + } catch (e) {} } else { delete jsonContent.background.service_worker; }