mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-28 13:39:44 +07:00
18 lines
402 B
JavaScript
18 lines
402 B
JavaScript
function log(message) {
|
|
document.getElementById('log').textContent += message + '\n';
|
|
}
|
|
|
|
chrome.contextMenus.onClicked.addListener(function(info) {
|
|
if (!document.hasFocus()) {
|
|
log('Ignoring context menu click that happened in another window');
|
|
return;
|
|
}
|
|
|
|
log('Item selected in A: ' + info.menuItemId);
|
|
});
|
|
|
|
window.addEventListener("load", function(e){
|
|
log('Window A is loaded');
|
|
});
|
|
|