Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <script src="loldogs.js"></script> | |
| 2 <script> | |
| 3 // Simple extension to replace lolcat images from | |
| 4 // http://icanhascheezburger.com/ with loldog images instead. | |
| 5 | |
| 6 chrome.experimental.webRequest.onBeforeRequest.addListener( | |
| 7 function(info) { | |
| 8 console.log("Cat intercepted: " + info.url); | |
| 9 // Redirect the lolcal request to a random loldog URL. | |
| 10 var i = Math.round(Math.random() * loldogs.length); | |
| 11 return {redirectUrl: loldogs[i]}; | |
| 12 }, | |
| 13 // filters | |
| 14 { | |
| 15 urls: [ | |
| 16 "http://icanhascheezburger.files.wordpress.com/*", | |
| 17 "http://chzmemebase.files.wordpress.com/*", | |
| 18 ], | |
| 19 types: ["image"] | |
| 20 }, | |
| 21 // extraInfoSpec | |
| 22 ["blocking"]); | |
| 23 </script> | |
|
Boris Smus
2011/08/19 19:12:35
Since this is a public sample, can we make this pa
Matt Perry
2011/08/19 20:04:51
I don't think we should try to assert that backgro
| |
| OLD | NEW |