I'm just starting out with extension development and I believe I've read a good portion of the documentation, but I think I'm missing something very obvious.
To start, I am trying to pull the source code for any site, so I'm using browser action. Eventually I want to pull the image URLs from the source code, but I need to figure out how to get the source first!
Please help! Thanks.
So far I have in manifest.json:
and popup.html consists ofCode:"browser_action": { "default_icon": "icon.png", "popup": "popup.html" }
Code:<html> <head> <script> chrome.browserAction.onClicked.addListener(function(tab) { // We can only inject scripts to find the title on pages loaded with http // and https so for all other pages, we don't ask for the title. if (tab.url.indexOf("http:") != 0 && tab.url.indexOf("https:") != 0) { //executeMailto(tab.id, "", tab.url, ""); document.write(tab.url); } else { chrome.tabs.executeScript(null, {file: "content_script.js"}); } }); </script> </head> <body></body> </html>


LinkBack URL
About LinkBacks



Reply With Quote