OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <script src="loldogs.js"></script> |
| 3 <script> |
| 4 // Simple extension to replace lolcat images from |
| 5 // http://icanhascheezburger.com/ with loldog images instead. |
| 6 |
| 7 chrome.experimental.webRequest.onBeforeRequest.addListener( |
| 8 function(info) { |
| 9 console.log("Cat intercepted: " + info.url); |
| 10 // Redirect the lolcal request to a random loldog URL. |
| 11 var i = Math.round(Math.random() * loldogs.length); |
| 12 return {redirectUrl: loldogs[i]}; |
| 13 }, |
| 14 // filters |
| 15 { |
| 16 urls: [ |
| 17 "http://icanhascheezburger.files.wordpress.com/*", |
| 18 "http://chzmemebase.files.wordpress.com/*", |
| 19 ], |
| 20 types: ["image"] |
| 21 }, |
| 22 // extraInfoSpec |
| 23 ["blocking"]); |
| 24 </script> |
OLD | NEW |