summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 07:39:06 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 07:39:06 +0000
commita17778305fbccf854628476181c94f07c9e806b0 (patch)
tree7d6c82fb0da91ec3019e1825251e446021b536ef /chrome
parentcb0f5fe8e78a47e5c74a9091b4a09a7c8b79e001 (diff)
downloadchromium_src-a17778305fbccf854628476181c94f07c9e806b0.zip
chromium_src-a17778305fbccf854628476181c94f07c9e806b0.tar.gz
chromium_src-a17778305fbccf854628476181c94f07c9e806b0.tar.bz2
Merge 32622 - fix url handling to only allow http and https URLs
BUG=none TEST=none Review URL: http://codereview.chromium.org/418011 TBR=erikkay@chromium.org Review URL: http://codereview.chromium.org/503024 git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@34667 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/extensions/docs/examples/extensions/news/feed.html13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/common/extensions/docs/examples/extensions/news/feed.html b/chrome/common/extensions/docs/examples/extensions/news/feed.html
index 001219b..6592a87 100644
--- a/chrome/common/extensions/docs/examples/extensions/news/feed.html
+++ b/chrome/common/extensions/docs/examples/extensions/news/feed.html
@@ -241,8 +241,17 @@ function buildPreview(doc) {
}
}
+// Show |url| in a new tab.
+function showUrl(url) {
+ // Only allow http and https URLs.
+ if (url.indexOf("http:") != 0 && url.indexOf("https:") != 0) {
+ return;
+ }
+ chrome.tabs.create({url: url});
+}
+
function moreStories(event) {
- chrome.tabs.create({url: moreStoriesUrl});
+ showUrl(moreStoriesUrl);
}
function showDesc(event) {
@@ -283,7 +292,7 @@ function iframeMessageHandler(e) {
url = url.substring(0, index);
}
}
- chrome.tabs.create({url:url});
+ showUrl(url);
}
}
return;