-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpopup.js
More file actions
17 lines (15 loc) · 686 Bytes
/
popup.js
File metadata and controls
17 lines (15 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
document.addEventListener("DOMContentLoaded", function () {
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
chrome.tabs.sendMessage(tabs[0].id, { action: "getTables" }, function (response) {
const tablesList = document.getElementById("tables-list")
response.tables.forEach(function (table, index) {
const button = document.createElement("button")
button.textContent = "Download Table " + (index + 1)
button.addEventListener("click", function () {
chrome.tabs.sendMessage(tabs[0].id, { action: "downloadTable", tableIndex: index })
})
tablesList.appendChild(button)
})
})
})
})