Compare commits

..

2 Commits

Author SHA1 Message Date
6adaa29ff1 Merge branch 'main' of gitea.moe:lamp/vrchat-emoji-manager 2023-10-27 13:53:59 -07:00
e0e6cb70c4 '' 2023-10-27 13:53:46 -07:00
3 changed files with 32 additions and 1 deletions

View File

@ -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
View 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
View 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";