We're cooked. <skull emoji> - Added options page for YAML palette editing, live color preview, and diagnostics. - Implemented theme engine to parse Gogh YAML palettes and derive semantic themes. - Configured TypeScript and Vite for building the extension. - Created new tab and popup HTML pages with corresponding scripts and styles. - Established storage management for user configurations in Chrome storage. - Added icons for the extension and updated manifest for MV3 compatibility.
22 lines
888 B
JavaScript
22 lines
888 B
JavaScript
chrome.runtime.onInstalled.addListener(function (object) {
|
|
if (object.reason === chrome.runtime.OnInstalledReason.INSTALL) {
|
|
chrome.tabs.create({ url: "https://clydedsouza.net" });
|
|
}
|
|
});
|
|
|
|
chrome.commands.onCommand.addListener((command) => {
|
|
if(command === 'turn-on') {
|
|
chrome.action.setBadgeText({ text: 'ON' });
|
|
chrome.action.setBadgeBackgroundColor({ color: 'green' });
|
|
}
|
|
if(command === 'turn-off') {
|
|
chrome.action.setBadgeText({ text: 'OFF' });
|
|
chrome.action.setBadgeBackgroundColor({ color: 'red' });
|
|
}
|
|
});
|
|
|
|
chrome.omnibox.onInputEntered.addListener((text) => {
|
|
chrome.tabs.create({ url: 'https://facebook.com/' + encodeURIComponent(text) });
|
|
chrome.tabs.create({ url: 'https://twitter.com/' + encodeURIComponent(text) });
|
|
chrome.tabs.create({ url: 'https://instagram.com/' + encodeURIComponent(text) });
|
|
}); |