-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
25 lines (22 loc) · 832 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
23
24
document.addEventListener('DOMContentLoaded', function(){
var submitButton = document.getElementById('button_submit');
submitButton.addEventListener('click',function() {
// alert(document.outerHTML);
let params={
active: true,
currentWindow: true
}
// console.log(params)
chrome.tabs.query(params, gotTabs);
function gotTabs(tabs) {
var selected=document.getElementById("select_image");
// console.log("popup.js");
var selectedImage =selected.options[selected.selectedIndex].value;
let message={
txt: "Hello",
selectedImage: selectedImage,
}
chrome.tabs.sendMessage(tabs[0].id , message);
}
});
});