javascript - calling parent page function through content script in extension -


my webpage follows:

    <body>     <div class="row">                            <button type="button" class="btn btn-primary" id="manual-dial" onclick="dial()";>dial</button>     </div>     </body>    /* dial() function written in js of parent web page */ 

content.js follows:

    var phone=document.getelementbyid("manual-dial");     phone.addeventlistener("click",dial, false);/*want call dial function of webpage*/    chrome.runtime.sendmessage(/*send response dial() background.js*/); 

background.js

  chrome.runtime.onmessage.addlistener(function(response,sender,sendresponse)   { alert(response); }); 

i want call dial() function of web page extension. how can ?


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -