-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
22 lines (20 loc) · 787 Bytes
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
chrome.tabs.query({active: true, currentWindow: true}, tabs => {
chrome.tabs.sendMessage(tabs[0].id, "getCards", ({tradeError, tradeNameByValue, tradeNameByKey}) => {
if (tradeError) {
document.querySelector(".content").textContent = tradeError;
} else {
document.querySelector(".tradeByName").textContent = tradeNameByValue;
document.querySelector(".tradeByOrder").textContent = tradeNameByKey;
new ClipboardJS('.btn-name', {
text: function() {
return tradeNameByValue;
}
});
new ClipboardJS('.btn-key', {
text: function() {
return tradeNameByKey;
}
});
}
});
});