Here is an example that redirects URLs containing `"someString"` to localhost, but it will resolve DNS for the URL before `redirectUrl` or `cancel`, this will leak some data, it is very unsafe.

And, while using proxy extensions, it will resolve DNS remotely every time! How to fix this problem?

```
chrome.webRequest.onBeforeRequest.addListener(function(details) {
    if (details.url.indexOf("someString") > 0) {
        console.log(details.url);

        /* test redirect */
        return {
            redirectUrl : "http://127.0.0.1/",
        };

        /* test cancel */
        // return {
            // cancel : true,
        // };
    }
}, {
    urls : ["http://*/*", "https://*/*"],
}, ["blocking"]);

```