chrome.tabs.executeScript(tabId, {file:"domScriptFile.js"});
//this code always works
document.addEventListener("click", function(event){
alert('i always work');
});
// The below code doesn't work
function listenToClicks(){
document.addEventListener("click", function(event){
alert('click is fired');
});
}
// even The below code doesn't work
function stopListenToClicks(){
document.removeEventListener("click", function(event){
alert('click is fired');
});
}
chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) {
console.log("a request to start listending for click events");
if(msg.command == "listen")listenToClicks();elseif(msg.command == "stoplisten")stopListenToClicks();
sendResponse({msg: "click events are now fired"});return true; });
--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/257b280e-fee7-4cdf-aa97-53c259135dd9%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
Sorry for the late.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/257b280e-fee7-4cdf-aa97-53c259135dd9%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/ee0b8f41-86b1-4985-a27f-d55a009f71a5%40chromium.org.