Initial Commit
This commit is contained in:
parent
950050ea38
commit
eb02c6f3bd
13 changed files with 718 additions and 0 deletions
14
options/options.js
Normal file
14
options/options.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
let { endpoint = 'http://127.0.0.1:5000/v1/classify' } = await browser.storage.local.get(['endpoint']);
|
||||
document.getElementById('endpoint').value = endpoint;
|
||||
});
|
||||
|
||||
document.getElementById('save').addEventListener('click', async () => {
|
||||
const endpoint = document.getElementById('endpoint').value;
|
||||
await browser.storage.local.set({ endpoint });
|
||||
try {
|
||||
await browser.aiFilter.initConfig({ endpoint });
|
||||
} catch (e) {
|
||||
console.error('[ai-filter][options] failed to apply config', e);
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue