-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.js
More file actions
25 lines (21 loc) · 746 Bytes
/
popup.js
File metadata and controls
25 lines (21 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function click(e) {
// chrome.tabs.executeScript(null, {file:"test.js"}, function(){
// chrome.tabs.sendRequest(null, {scriptOptions: {currentTabUrl:currentTabUrl}}, function(){
// //all injected
// });
// });
//chrome.tabs.executeScript(null, {code: "var scriptOptions = {param1:'value1',param2:'value2'};"}, function(){
chrome.tabs.executeScript(null, {file:"test.js"});
//});
window.close();
}
currentTabUrl = "";
document.addEventListener('DOMContentLoaded', function () {
var divs = document.querySelectorAll('input');
for (var i = 0; i < divs.length; i++) {
divs[i].addEventListener('click', click);
}
});
chrome.tabs.getSelected(null, function(tab) {
//alert(currentTabUrl);
});