Skip to content

Commit 312a26f

Browse files
authored
Silence console warnings (#160)
1 parent 5489d8d commit 312a26f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

source/extension.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<script>
2+
// Silence warnings https://github.com/sveltejs/svelte/issues/4652#issuecomment-1666893821
3+
// eslint-disable-next-line no-unused-expressions
4+
$$restProps;
5+
26
import openInTab from './lib/open-in-tab.js';
37
import trimName from './lib/trim-name.js';
48
@@ -8,9 +12,9 @@
812
export let enabled;
913
export let installType;
1014
export let homepageUrl;
11-
export let updateUrl;
15+
export let updateUrl; // Optional
1216
export let optionsUrl;
13-
export let icons;
17+
export let icons; // Optional
1418
export let showExtras;
1519
export let undoStack;
1620
@@ -26,7 +30,7 @@
2630
return homepageUrl;
2731
}
2832
29-
return updateUrl.startsWith('https://edge.microsoft.com')
33+
return updateUrl?.startsWith('https://edge.microsoft.com')
3034
? edgeWebStoreUrl
3135
: chromeWebStoreUrl;
3236
}

source/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ if (autoFit) {
1111
fitWindow();
1212
}
1313

14-
chrome.runtime.sendMessage('thisTownIsTooSmallForTheTwoOfUs');
14+
chrome.runtime.sendMessage('thisTownIsTooSmallForTheTwoOfUs').catch(() => {
15+
// No other windows open, good!
16+
});
1517
chrome.runtime.onMessage.addListener(message => {
1618
if (message === 'thisTownIsTooSmallForTheTwoOfUs') {
1719
window.close();

0 commit comments

Comments
 (0)