mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-26 13:19:49 +07:00
Move to side panel
This commit is contained in:
3
functional-samples/tutorial.tabs-manager/background.js
Normal file
3
functional-samples/tutorial.tabs-manager/background.js
Normal file
@@ -0,0 +1,3 @@
|
||||
chrome.runtime.onInstalled.addListener(() => {
|
||||
chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true });
|
||||
});
|
||||
@@ -8,9 +8,13 @@
|
||||
"48": "images/icon-48.png",
|
||||
"128": "images/icon-128.png"
|
||||
},
|
||||
"action": {
|
||||
"default_popup": "popup.html"
|
||||
"background": {
|
||||
"service_worker": "background.js"
|
||||
},
|
||||
"action": {},
|
||||
"side_panel": {
|
||||
"default_path": "sidepanel.html"
|
||||
},
|
||||
"host_permissions": ["https://developer.chrome.com/*"],
|
||||
"permissions": ["tabGroups"]
|
||||
"permissions": ["tabGroups", "sidePanel"]
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="./popup.css" />
|
||||
<link rel="stylesheet" href="./sidepanel.css" />
|
||||
</head>
|
||||
<body>
|
||||
<template id="li_template">
|
||||
@@ -20,6 +20,6 @@
|
||||
<button>Group Tabs</button>
|
||||
<ul></ul>
|
||||
|
||||
<script src="./popup.js" type="module"></script>
|
||||
<script src="./sidepanel.js" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user