Skip to content

Commit 737fb6f

Browse files
committed
Updated Chrome msg handlers to work w/ new popup sender ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js-chrome-starter]
1 parent 9468f2b commit 737fb6f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

starters/chrome/extension/content.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212

1313
// Add CHROME MSG listener
1414
chrome.runtime.onMessage.addListener(req => {
15-
if (req.action == 'notify') notify(req.msg, req.pos)
16-
else if (req.action == 'alert') siteAlert(req.title, req.msg, req.btns)
17-
else if (req.action == 'syncConfigToUI') syncConfigToUI()
15+
if (req.action == 'notify')
16+
notify(...['msg', 'pos', 'notifDuration', 'shadow'].map(arg => req.options[arg]))
17+
else if (req.action == 'alert')
18+
siteAlert(...['title', 'msg', 'btns', 'checkbox', 'width'].map(arg => req.options[arg]))
19+
else if (req.action == 'syncConfigToUI') syncConfigToUI(req.options)
1820
})
1921

2022
// Init CONFIG

0 commit comments

Comments
 (0)