Answers for "can chrome extension access Page DOM"

0

can chrome extension access Page DOM

// Listen for messages
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
    // If the received message has the expected format...
    if (msg.text === 'report_back') {
        // Call the specified callback, passing
        // the web-page's DOM content as argument
        sendResponse(document.all[0].outerHTML);
    }
});
Posted by: Guest on September-03-2021

Browse Popular Code Answers by Language