diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-23 03:28:51 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-23 03:28:51 +0000 |
commit | c931db6d8adbf334c86e31714e2897bc2e9db08a (patch) | |
tree | cf83d11e8e00e45a4733ad62c1a38f0925d8dd8c /chrome/test | |
parent | d146b8311c38186872d2be3764e2c2d66827107f (diff) | |
download | chromium_src-c931db6d8adbf334c86e31714e2897bc2e9db08a.zip chromium_src-c931db6d8adbf334c86e31714e2897bc2e9db08a.tar.gz chromium_src-c931db6d8adbf334c86e31714e2897bc2e9db08a.tar.bz2 |
Don't inject content scripts into incognito browsers.
This patch prevents content scripts from being injected into incognito profile tabs by only injecting into the same profile in which the extension is running.
BUG=21392
TEST=Load chrome/test/data/extensions/api/incognito_no_script and open any url in incognito browser. No page titles should be modified to "modified".
Review URL: http://codereview.chromium.org/502079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35203 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rwxr-xr-x | chrome/test/data/extensions/api_test/incognito_no_script/change_page_title.js | 5 | ||||
-rwxr-xr-x | chrome/test/data/extensions/api_test/incognito_no_script/manifest.json | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/api_test/incognito_no_script/change_page_title.js b/chrome/test/data/extensions/api_test/incognito_no_script/change_page_title.js new file mode 100755 index 0000000..ed4cfd2 --- /dev/null +++ b/chrome/test/data/extensions/api_test/incognito_no_script/change_page_title.js @@ -0,0 +1,5 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +document.title = "modified"; diff --git a/chrome/test/data/extensions/api_test/incognito_no_script/manifest.json b/chrome/test/data/extensions/api_test/incognito_no_script/manifest.json new file mode 100755 index 0000000..7c6156e --- /dev/null +++ b/chrome/test/data/extensions/api_test/incognito_no_script/manifest.json @@ -0,0 +1,13 @@ +{ + "name": "incognito no script", + "version": "0.1", + "description": "Checks that content scripts do not inject js into incognito browsers.", + "permissions": ["http://*/*", "https://*/*"], + "content_scripts": [ + { + "matches": ["http://*/*", "https://*/*"], + "js": ["change_page_title.js"], + "run_at": "document_start" + } + ] +} |