Chromium Code Reviews| Index: chrome/common/extensions/docs/examples/extensions/catblock/background.html |
| diff --git a/chrome/common/extensions/docs/examples/extensions/catblock/background.html b/chrome/common/extensions/docs/examples/extensions/catblock/background.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..33ded68b2202075337ceb3e3c99b88473d0d15d9 |
| --- /dev/null |
| +++ b/chrome/common/extensions/docs/examples/extensions/catblock/background.html |
| @@ -0,0 +1,23 @@ |
| +<script src="loldogs.js"></script> |
| +<script> |
| +// Simple extension to replace lolcat images from |
| +// http://icanhascheezburger.com/ with loldog images instead. |
| + |
| +chrome.experimental.webRequest.onBeforeRequest.addListener( |
| + function(info) { |
| + console.log("Cat intercepted: " + info.url); |
| + // Redirect the lolcal request to a random loldog URL. |
| + var i = Math.round(Math.random() * loldogs.length); |
| + return {redirectUrl: loldogs[i]}; |
| + }, |
| + // filters |
| + { |
| + urls: [ |
| + "http://icanhascheezburger.files.wordpress.com/*", |
| + "http://chzmemebase.files.wordpress.com/*", |
| + ], |
| + types: ["image"] |
| + }, |
| + // extraInfoSpec |
| + ["blocking"]); |
| +</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
|