mardi 2 mai 2017

How to send data from popup.html to content_script without clicking popup

I see this questions many times but i dont understand . i have a data give me true and false (checkbox input) in popup.html i want when i reload webPage give me that data true or false . I read documentation message passing but when clicked popup then run script i dont want this .

popup.js:

chrome.runtime.sendMessage({request: "checkStatus"});

background.js:

   chrome.runtime.onMessage.addListener(function(message,sender,sendResponse) {
    if (message.request == "checkStatus") {
     console.log(message.request)
     }
    });

that code give me "message.request" but when i clicked poup .




Aucun commentaire:

Enregistrer un commentaire