Skip to content

Commit e59869a

Browse files
committed
fixes
1 parent 69a3ef9 commit e59869a

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/modules/webext/webext-background/webext-background.service.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,12 @@ export class WebExtBackgroundService {
193193
// Strip html tags from message
194194
const urlRegex = new RegExp(Globals.URL.ValidUrlRegex, 'i');
195195
const urlInAlert = alert.message.match(urlRegex)?.find(Boolean);
196-
const messageToDisplay = urlInAlert
197-
? new DOMParser().parseFromString(`<span>${alert.message}</span>`, 'text/xml').firstElementChild.textContent
198-
: alert.message;
196+
let messageToDisplay = alert.message;
197+
if (urlInAlert && typeof DOMParser !== 'undefined') {
198+
messageToDisplay =
199+
new DOMParser().parseFromString(`<span>${alert.message}</span>`, 'text/xml').firstElementChild.textContent ??
200+
alert.message;
201+
}
199202
const options: Notifications.CreateNotificationOptions = {
200203
iconUrl: `${Globals.PathToAssets}/notification.svg`,
201204
message: messageToDisplay,

webpack/chromium.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ module.exports = (env, argv) => {
6868
},
6969
output: {
7070
...webExtConfig.output,
71-
path: outputPath
71+
path: outputPath,
72+
clean: false
7273
}
7374
};
7475

webpack/firefox.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ module.exports = (env, argv) => {
7777
},
7878
output: {
7979
...webExtConfig.output,
80-
path: outputPath
80+
path: outputPath,
81+
clean: false
8182
}
8283
};
8384

0 commit comments

Comments
 (0)