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
Post a Comment