Skip to content

Commit 6cdd16b

Browse files
committed
Un-modulized components/icons.mjs for simplicity ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js-chrome-starter]
1 parent 623676f commit 6cdd16b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

starters/chrome/extension/components/icons.mjs renamed to starters/chrome/extension/components/icons.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Requires lib/dom.js
22

3-
const icons = {
3+
window.icons = {
44

55
create({ name, size = 16, width, height, ...additionalAttrs }) {
66
const iconData = icons[name],
@@ -24,6 +24,4 @@ const icons = {
2424
type: 'png',
2525
get src() { return `${icons.appProps.urls.assetHost}@b5551ac/images/icons/question-mark/icon16.png` }
2626
}
27-
}
28-
29-
export { icons }
27+
};

starters/chrome/extension/popup/controller.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
const site = /([^.]+)\.[^.]+$/.exec(new URL((await chrome.tabs.query(
44
{ active: true, currentWindow: true }))[0].url).hostname)?.[1]
55

6-
// Import LIBS
6+
// Import JS resources
7+
await import(chrome.runtime.getURL('components/icons.js'))
78
await import(chrome.runtime.getURL('lib/dom.js'))
89
await import(chrome.runtime.getURL('lib/settings.js'))
910

1011
// Import APP data
1112
const { app } = await chrome.storage.sync.get('app')
12-
13-
// Import ICONS
14-
const { icons } = await import(chrome.runtime.getURL('components/icons.mjs'))
1513
icons.appProps = app // for src's using urls.assetHost
1614

1715
// Define FUNCTIONS

0 commit comments

Comments
 (0)