9 lines
347 B
JavaScript
9 lines
347 B
JavaScript
// Called when the user clicks on the browser action
|
|
chrome.browserAction.onClicked.addListener(function(tab) {
|
|
// Send a message to the active tab
|
|
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
|
|
var activeTab = tabs[0];
|
|
chrome.tabs.sendMessage(activeTab.id, { message: 'clicked_browser_action' });
|
|
});
|
|
});
|