summaryrefslogtreecommitdiff
path: root/buttonList.js
diff options
context:
space:
mode:
authorDominic DiTaranto <domdit@gmail.com>2024-08-23 23:32:26 -0400
committerDominic DiTaranto <domdit@gmail.com>2024-08-23 23:32:26 -0400
commit26ee0a64973a16584f8d51686ab357acfd526ee9 (patch)
tree38401cbf5e8d6fd05e879782b64189d9368edc1d /buttonList.js
init commitHEADmaster
Diffstat (limited to 'buttonList.js')
-rw-r--r--buttonList.js30
1 files changed, 30 insertions, 0 deletions
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