Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chrome.webRequest.onCompleted.addListener(
- function(details) {
- //if (details.url.substring(0, 23) == "https://www.google.com/") // I know I do not need this
- //{
- console.info("URL :" + details.url);
- FindData("http://www.altavista.com");
- //}
- },
- // filters
- {
- urls: [
- "http://*.google.com/*",
- "https://*.google.com/*",
- ],
- types: ["image"]
- },
- ["responseHeaders"]);
- function FindData(strURL) {
- var req = new XMLHttpRequest();
- req.open("GET", strURL, true);
- req.onreadystatechange=function() {
- if (req.readyState==4) {
- if (req.status==200)
- {
- console.info("Sucess!");
- console.info("Data: " + req.responseText);
- }
- else if (req.status==404) console.info("URL doesn't exist!")
- else console.info("Error: Status is " + req.status)
- }
- }
- req.send();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement