Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: chrome/test/data/extensions/api_test/webrequest_permissions/split/background.js

Issue 10831008: Refactor and fix declarative webRequest API permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed license headers Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 chrome.declarativeWebRequest.onRequest.removeRules();
6 var rule = {
7 conditions: [
8 new chrome.declarativeWebRequest.RequestMatcher(
9 {url: {pathContains: '.html'}}),
10 ],
11 actions: [],
12 }
13 if (chrome.extension.inIncognitoContext) {
14 rule.actions = [
15 new chrome.declarativeWebRequest.RedirectRequest(
16 {'redirectUrl': 'data:text/plain,redirected2'})
17 ];
18 } else {
19 rule.actions = [
20 new chrome.declarativeWebRequest.RedirectRequest(
21 {'redirectUrl': 'data:text/plain,redirected1'})
22 ];
23 }
24 function notifyDone() {
25 if (chrome.extension.inIncognitoContext)
26 chrome.test.sendMessage("done_incognito");
27 else
28 chrome.test.sendMessage("done");
29 }
30 chrome.declarativeWebRequest.onRequest.addRules([rule], notifyDone);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698