Skip to content

Commit

Permalink
remove unused code and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ziv committed Mar 19, 2013
1 parent 23ac0fc commit 318a0e0
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/haaretz.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


// Add a listener to any Haaretz request
chrome.webRequest.onBeforeSendHeaders.addListener(
function(info) {

Expand All @@ -10,27 +10,19 @@ chrome.webRequest.onBeforeSendHeaders.addListener(
break;
}
}
//console.log(info.requestHeaders);

// choose referer url
// TODO: add more URLs that Haaretz support
// TODO: Do we need those URLs or can we stick with one only?
// var list = ["http://www.facebook.com/", "http://www.twitter.com/", "http://www.google.com"];
// var url = list[ Math.round(Math.random() * 2) ];

var url = "http://www.facebook.com/";

// add referer
// add referer (facebook in this case, but can be any social network or search engine that Haaretz suports)
info.requestHeaders.push({
name : "Referer",
value : url
value : "http://www.facebook.com/"
});
//console.log(info.requestHeaders);

return { requestHeaders: info.requestHeaders };
},
{
// permisions
urls: ["*://*.haaretz.co.il/*"],
types: ["main_frame"]
},
["blocking", "requestHeaders"]);
// this is a blocking function, to change the request
["blocking", "requestHeaders"]);

0 comments on commit 318a0e0

Please sign in to comment.