Commit 7b695557 authored by John Reck's avatar John Reck Committed by android-merger
Browse files

DO NOT MERGE Prevent loading javascript: uris in existing tabs

 Bug: 4770356

Change-Id: I436d97f0c41fedec16891c92bf283654354b0a29
parent bd961141
......@@ -467,6 +467,12 @@ public class BrowserActivity extends Activity
final String appId = intent
.getStringExtra(Browser.EXTRA_APPLICATION_ID);
if (!TextUtils.isEmpty(urlData.mUrl) &&
urlData.mUrl.startsWith("javascript:")) {
// Always open javascript: URIs in new tabs
openTabAndShow(urlData, true, appId);
return;
}
if ((Intent.ACTION_VIEW.equals(action)
// If a voice search has no appId, it means that it came
// from the browser. In that case, reuse the current tab.
......@@ -2656,8 +2662,9 @@ public class BrowserActivity extends Activity
}
// The "about:" schemes are internal to the browser; don't want these to
// be dispatched to other apps.
if (url.startsWith("about:")) {
// be dispatched to other apps. Similarly, javascript: schemas are private
// to the page
if (url.startsWith("about:") || url.startsWith("javascript:")) {
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment