javascript - Chrome popup to content script -


i trying pass action popup script content script:

popup:

$(document).ready(function(){     $("#start").click(function(){         chrome.tabs.getselected(function(tab){             chrome.tabs.sendrequest(tab.id, {threshold: $("#threshold").val()});         });     }); }); 

content script:

$(document).ready(function(){     console.log("content.js loaded");     chrome.extension.onrequest.addlistener(function(request, sender, sendresponse) {         if(request.threshold){             //stuff         }     }); }); 

the problem //stuff not being executed after #start clicked. doing wrong?

what threshold? may not getting past if(request.threshold) statement. should put console.log before if check true.


Comments

Popular posts from this blog

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -

matplotlib - PYTHON: Annotate boxes disapear dependant on range -