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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -