-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
46 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
const handleShortcuts = () => { | ||
// console.info('Handling shortcuts'); | ||
console.info('Handling shortcuts'); | ||
chrome.commands.onCommand.addListener(async command => { | ||
console.log(`Command: ${command}`); | ||
switch (command) { | ||
case 'Open Shortcuts': { | ||
console.log('Opening shortcuts'); | ||
// await chrome.action.openPop up(); | ||
// await chrome.sidePanel.setOptions({ path: 'sidepanel/index.html', enabled: true }); | ||
// await chrome.sidePanel.open({ windowId: tab.windowId }); | ||
// await chrome.action.openPopup() | ||
// Assuming you have a popup.html file in the root of your extension | ||
// const url = chrome.runtime.getURL('popup.html'); | ||
// await chrome.windows.create({ url, type: 'popup', width: 400, height: 600 }); | ||
chrome.windows.create({ | ||
url: chrome.runtime.getURL('popup/index.html#/shortcuts?popup=true'), | ||
type: 'popup', | ||
width: 800, | ||
height: 600, | ||
}, (window) => { | ||
if (window) { | ||
chrome.storage.local.set({ popupWindowId: window.id }); | ||
} | ||
}); | ||
} | ||
} | ||
}); | ||
// console.log('Shortcuts handled'); | ||
console.log('Shortcuts handled'); | ||
}; | ||
|
||
export default handleShortcuts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters