-
Notifications
You must be signed in to change notification settings - Fork 2
/
caseSearch.js
29 lines (27 loc) · 866 Bytes
/
caseSearch.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
29
chrome.tabs.onActivated.addListener(function (activeInfo) {
chrome.tabs.executeScript(activeInfo.tabId, {
"file": "connection.js"
}, function(){
console.log("onActivated Executed");
});
});
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
chrome.tabs.executeScript(tab.id, {
"file": "connection.js"
}, function(){
console.log("onUpdated Executed");
});
});
chrome.browserAction.onClicked.addListener(function (tab) {
if (tab.url.indexOf(".salesforce.com/") != -1 || tab.url.indexOf(".visual.force.com/") != -1 ) {
chrome.tabs.executeScript({
file: "connection.js"
}, function(){
chrome.tabs.executeScript({
file: "contentscript.js"
});
});
} else {
alert(chrome.i18n.getMessage("wrongTab"));
}
});