summaryrefslogtreecommitdiff
path: root/buttonList.js
diff options
context:
space:
mode:
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