How to retrieve the DOM data from chrome extension? -
I have code to develop the Chrome extension.
manifest.json
background.js
debugger; Chrome.browserAction.setBadgeText ({text: "maskkkk"}; function doStuffWithDOM (domContent) {Console.log ("I received the following DOM content: \ n" + domContent);} Chrome.browserAction.onClicked.addListener (function (tab) {console.log ('this run will be bg creit jerk'); chrome Tabs.sendMessage (tab.id, {text: "report_back"}, Dustfood Dom);});
script.js
debugger; / * Listen for messages * / console.log ('content script'); Chrome.runtime.onMessage. AddListener (function (msg, sender, transmitted remittance) {/ * if the expected format is in the received message ... * / if (msg.text and (msg.text == "report_back")) {/ * specified callback Call on, web page / content to send / send as spam in the form of arguments (documents all [0] .outerHTML);}});
I clicked on the icon, so I did not see any kind of activity. What is the right procedure to get and manipulate DOM content from open tabs?
Comments
Post a Comment