From 26ee0a64973a16584f8d51686ab357acfd526ee9 Mon Sep 17 00:00:00 2001 From: Dominic DiTaranto Date: Fri, 23 Aug 2024 23:32:26 -0400 Subject: init commit --- buttonList.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 buttonList.js (limited to 'buttonList.js') diff --git a/buttonList.js b/buttonList.js new file mode 100644 index 0000000..2b80165 --- /dev/null +++ b/buttonList.js @@ -0,0 +1,30 @@ +function createStickyButtons() { + var supportedColors = [ + "Cornsilk", + "LightPink", + "LightCyan", + "MintCream", + "Gainsboro", + "HoneyDew", + "LightCoral", + "LightSalmon", + "Plum" + ] + + var buttonList = document.getElementById('buttonList') + + for (let i = 0; i < supportedColors.length; i++){ + var btn = document.createElement('button') + btn.classList.add('new-sticky-button') + btn.onclick = function() { + chrome.tabs.query({active: true, currentWindow: true}, tabs => { + chrome.tabs.sendMessage(tabs[0].id, {color: supportedColors[i]}, response => {}); + }); + } + + btn.style.backgroundColor = supportedColors[i]; + buttonList.appendChild(btn) + } +} + +createStickyButtons() \ No newline at end of file -- cgit v1.2.3-70-g09d2