mirror of
https://github.com/obsqrbtz/goose-highlighter.git
synced 2026-04-08 20:19:06 +03:00
open list manager in new tab
This commit is contained in:
@@ -8,8 +8,7 @@
|
|||||||
"contextMenus",
|
"contextMenus",
|
||||||
"scripting",
|
"scripting",
|
||||||
"storage",
|
"storage",
|
||||||
"tabs",
|
"tabs"
|
||||||
"windows"
|
|
||||||
],
|
],
|
||||||
"host_permissions": [
|
"host_permissions": [
|
||||||
"<all_urls>"
|
"<all_urls>"
|
||||||
@@ -26,4 +25,4 @@
|
|||||||
"48": "icons/icon48.png",
|
"48": "icons/icon48.png",
|
||||||
"128": "icons/icon128.png"
|
"128": "icons/icon128.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,22 +41,13 @@ class BackgroundService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private setupContextMenu(): void {
|
private setupContextMenu(): void {
|
||||||
chrome.contextMenus.onClicked.addListener((info) => {
|
chrome.contextMenus.onClicked.addListener(async (info) => {
|
||||||
if (info.menuItemId === 'manage-lists') {
|
if (info.menuItemId === 'manage-lists') {
|
||||||
this.openListManagerWindow();
|
await chrome.tabs.create({ url: chrome.runtime.getURL('list-manager/list-manager.html') });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private openListManagerWindow(): void {
|
|
||||||
chrome.windows.create({
|
|
||||||
url: chrome.runtime.getURL('list-manager/list-manager.html'),
|
|
||||||
type: 'popup',
|
|
||||||
width: 1280,
|
|
||||||
height: 700,
|
|
||||||
focused: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new BackgroundService();
|
new BackgroundService();
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ export class PopupController {
|
|||||||
|
|
||||||
// Manage lists
|
// Manage lists
|
||||||
document.getElementById('manageListsBtn')?.addEventListener('click', () => {
|
document.getElementById('manageListsBtn')?.addEventListener('click', () => {
|
||||||
this.openListManagerWindow();
|
void this.openListManager();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Color picker text inputs sync
|
// Color picker text inputs sync
|
||||||
@@ -941,14 +941,8 @@ export class PopupController {
|
|||||||
MessageService.sendToAllTabs({ type: 'WORD_LIST_UPDATED' });
|
MessageService.sendToAllTabs({ type: 'WORD_LIST_UPDATED' });
|
||||||
}
|
}
|
||||||
|
|
||||||
private openListManagerWindow(): void {
|
private async openListManager(): Promise<void> {
|
||||||
chrome.windows.create({
|
await chrome.tabs.create({ url: chrome.runtime.getURL('list-manager/list-manager.html') });
|
||||||
url: chrome.runtime.getURL('list-manager/list-manager.html'),
|
|
||||||
type: 'popup',
|
|
||||||
width: 1280,
|
|
||||||
height: 700,
|
|
||||||
focused: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private setupStorageSync(): void {
|
private setupStorageSync(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user