Skip to content

Commit

Permalink
Update side panel examples to use action icon (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverdunk committed May 7, 2024
1 parent e35aa7c commit dcd962a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions functional-samples/cookbook.sidepanel-global/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"48": "images/icon-48.png",
"128": "images/icon-128.png"
},
"background": {
"service_worker": "service-worker.js"
},
"action": {
"default_title": "Click to open panel"
},
"side_panel": {
"default_path": "sidepanel.html"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
chrome.runtime.onInstalled.addListener(() => {
chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true });
});
3 changes: 3 additions & 0 deletions functional-samples/cookbook.sidepanel-multiple/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"background": {
"service_worker": "service-worker.js"
},
"action": {
"default_title": "Click to open panel"
},
"icons": {
"16": "images/icon-16.png",
"48": "images/icon-48.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const mainPage = 'sidepanels/main-sp.html';

chrome.runtime.onInstalled.addListener(() => {
chrome.sidePanel.setOptions({ path: welcomePage });
chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true });
});

chrome.tabs.onActivated.addListener(async ({ tabId }) => {
Expand Down

0 comments on commit dcd962a

Please sign in to comment.