From 9911b0a667ce71c39df5565065edeb02c10ad4ae Mon Sep 17 00:00:00 2001 From: Chris Ho <68166971+chostudio@users.noreply.github.com> Date: Thu, 5 Jun 2025 02:05:41 -1000 Subject: [PATCH] on installation open up the sidepanel for users (#1483) * on installation open up the sidepanel for users * ran 'npm run lint:fix' --- functional-samples/ai.gemini-on-device/background.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/functional-samples/ai.gemini-on-device/background.js b/functional-samples/ai.gemini-on-device/background.js index d7262b80..ee39baf3 100644 --- a/functional-samples/ai.gemini-on-device/background.js +++ b/functional-samples/ai.gemini-on-device/background.js @@ -1,3 +1,7 @@ -chrome.sidePanel - .setPanelBehavior({ openPanelOnActionClick: true }) - .catch((error) => console.error(error)); +chrome.runtime.onInstalled.addListener(({ reason }) => { + if (reason === 'install') { + chrome.sidePanel + .setPanelBehavior({ openPanelOnActionClick: true }) + .catch((error) => console.error(error)); + } +});