Compare commits

...

2 Commits

Author SHA1 Message Date
Bauke 9f414731b9
Move initialization to the bottom of the file. 2022-11-16 12:15:04 +01:00
Bauke a0a11e3647
Remove IDs from input and select elements. 2022-11-15 23:37:03 +01:00
2 changed files with 7 additions and 11 deletions

View File

@ -12,13 +12,6 @@ async function browserActionClicked() {
await browser.runtime.openOptionsPage(); await browser.runtime.openOptionsPage();
} }
if (import.meta.env.VITE_BROWSER === 'chromium') {
browser.action.onClicked.addListener(browserActionClicked);
} else {
browser.browserAction.onClicked.addListener(browserActionClicked);
void initializeContextMenus();
}
browser.runtime.onInstalled.addListener(async () => { browser.runtime.onInstalled.addListener(async () => {
await initializeContextMenus(); await initializeContextMenus();
await updateBadge(); await updateBadge();
@ -94,3 +87,10 @@ browser.contextMenus.onClicked.addListener(async (info, tab) => {
await contextClicked(contextMenuIds, info, tab); await contextClicked(contextMenuIds, info, tab);
}); });
if (import.meta.env.VITE_BROWSER === 'chromium') {
browser.action.onClicked.addListener(browserActionClicked);
} else {
browser.browserAction.onClicked.addListener(browserActionClicked);
void initializeContextMenus();
}

View File

@ -145,7 +145,6 @@ export default class Editor extends Component<Props, State> {
<div class="editor ${hasBeenEdited ? 'has-been-edited' : ''}"> <div class="editor ${hasBeenEdited ? 'has-been-edited' : ''}">
<select <select
class="select" class="select"
id="matcher-type"
title="Matcher Type" title="Matcher Type"
value=${matcherType} value=${matcherType}
onChange=${this.onMatcherTypeChange} onChange=${this.onMatcherTypeChange}
@ -155,7 +154,6 @@ export default class Editor extends Component<Props, State> {
<input <input
class="input" class="input"
id="matcher-value"
onInput=${this.onMatcherInput} onInput=${this.onMatcherInput}
placeholder="Matcher Value" placeholder="Matcher Value"
title="Matcher Value" title="Matcher Value"
@ -166,7 +164,6 @@ export default class Editor extends Component<Props, State> {
<select <select
class="select" class="select"
id="redirect-type"
title="Redirect Type" title="Redirect Type"
value=${redirectType} value=${redirectType}
onChange=${this.onRedirectTypeChange} onChange=${this.onRedirectTypeChange}
@ -176,7 +173,6 @@ export default class Editor extends Component<Props, State> {
<input <input
class="input" class="input"
id="redirect-value"
onInput=${this.onRedirectInput} onInput=${this.onRedirectInput}
placeholder="Redirect Value" placeholder="Redirect Value"
title="Redirect Value" title="Redirect Value"