1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 chrome.declarativeWebRequest.onRequest.removeRules();
8 new chrome.declarativeWebRequest.RequestMatcher(
9 {url: {pathContains: '.html'}}),
13 if (chrome.extension.inIncognitoContext) {
15 new chrome.declarativeWebRequest.RedirectRequest(
16 {'redirectUrl': 'data:text/plain,redirected2'})
20 new chrome.declarativeWebRequest.RedirectRequest(
21 {'redirectUrl': 'data:text/plain,redirected1'})
24 function notifyDone() {
25 if (chrome.extension.inIncognitoContext)
26 chrome.test.sendMessage("done_incognito");
28 chrome.test.sendMessage("done");
30 chrome.declarativeWebRequest.onRequest.addRules([rule], notifyDone);