Files
amysteamdev 6f2e616494 [SidePanel API] Add sidePanel.open() cookbook (#983)
* Init commit

* Add sidepanel open cookbook

* Add minimum chrome version

* Add 116 on readme

* Add extension page
Add content script

* Tweak

* Tweak 2

* ¯\_(ツ)_/¯

* Update readme

* Update readme

* Change sample name in Readme

* Bold Chrome 116 for emphasis

* Typo fix
2023-07-18 10:36:40 -06:00

9 lines
275 B
JavaScript

const button = new DOMParser().parseFromString(
'<button>Click to open side panel</button>',
'text/html'
).body.firstElementChild;
button.addEventListener('click', function () {
chrome.runtime.sendMessage({ type: 'open_side_panel' });
});
document.body.append(button);