am 27535d19: DO NOT MERGE Prevent loading javascript: uris in existing tabs
* commit '27535d194a894ee0f828aef63bbf0e99ccab84ac':
DO NOT MERGE Prevent loading javascript: uris in existing tabs
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/browser/IntentHandler.java
index b556638..e0486e6 100644
--- a/src/com/android/browser/IntentHandler.java
+++ b/src/com/android/browser/IntentHandler.java
@@ -139,6 +139,12 @@
}
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
+ mController.openTabAndShow(null, 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.
diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/browser/UrlHandler.java
index b23dc7d..b5b69ba 100644
--- a/src/com/android/browser/UrlHandler.java
+++ b/src/com/android/browser/UrlHandler.java
@@ -87,8 +87,9 @@
}
// 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;
}