This commit is contained in:
Lamp 2023-10-27 13:53:46 -07:00
parent 2b3b0cecaf
commit e0e6cb70c4
3 changed files with 32 additions and 1 deletions

@ -30,5 +30,8 @@
"service_worker": "background.js",
"type": "module"
},
"options_page": "manage.html"
"options_page": "manage.html",
"action": {
"default_popup": "popup.html"
}
}

16
popup.html Normal file

@ -0,0 +1,16 @@
<!DOCTYPE html><html><head>
<style>
body {
white-space: nowrap;
text-align: center;
}
body div {
margin: 2px;
}
</style>
</head><body>
<h2>VRChat Emoji Manager</h2>
<div><button id="btn1">Launch in new tab</button></div>
<div><button id="btn2">Launch in pop up window</button></div>
<script src="popup.js"></script>
</body></html>

12
popup.js Normal file

@ -0,0 +1,12 @@
btn1.onclick = () => open("manage.html");
btn2.onclick = () => {
chrome.windows.create({
url: "manage.html",
focused: true,
type: "popup"
});
};
var width = Math.max(btn1.clientWidth, btn2.clientWidth);
btn1.style.width = width + "px";
btn2.style.width = width + "px";