-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbutton.js
20 lines (19 loc) · 1.08 KB
/
button.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var checkPageButton = document.getElementById('removeConversations');
var theTab;
checkPageButton.addEventListener('click', function() {
stepURL=function(){
chrome.windows.create({url: "https://www.messenger.com/t/"});
chrome.tabs.query({ active: true, windowId: chrome.windows.getLastFocused.id},
function (activeTabs) {activeTabs.map(function (tab) {theTab = tab.id;});}
);
setTimeout(stepScript, 4000);
},
stepScript=function(){
chrome.tabs.executeScript(theTab, { file: 'script.js', allFrames: false });
}
stepURL();
}, false);
var checkPageButton2 = document.getElementById('openMessenger');
checkPageButton2.addEventListener('click', function() {
chrome.windows.create({url: "https://www.messenger.com/t/"});
}, false);