-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
28 lines (25 loc) · 867 Bytes
/
background.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
25
26
27
28
chrome.runtime.onInstalled.addListener(function () {
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
chrome.declarativeContent.onPageChanged.addRules([{
conditions: [new chrome.declarativeContent.PageStateMatcher({
pageUrl: { urlPrefix: 'https://www.youtube.com/' },
})
],
actions: [new chrome.declarativeContent.ShowPageAction()]
}]);
});
});
chrome.extension.onMessage.addListener(gotMessage);
function gotMessage(message, sender, sendResponse) {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
if(message.todo == "naveenvvverrma")
{
chrome.tabs.sendMessage(tabs[0].id,{m:{todo: "nvnvnvnnv",key:tabs[0].id}}, function(response) {
});
}
});
setTimeout(function() {
sendResponse({status: true});
}, 1);
return true;
}