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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -