Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-Browser: Commit

packages/apps/Browser


Commit MetaInfo

Révision7b6955578d914557eea7ff3cbcec70e953970092 (tree)
l'heure2011-06-25 03:19:02
AuteurJohn Reck <jreck@goog...>
Commiterandroid-merger

Message de Log

DO NOT MERGE Prevent loading javascript: uris in existing tabs

Bug: 4770356

Change-Id: I436d97f0c41fedec16891c92bf283654354b0a29

Change Summary

Modification

--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -467,6 +467,12 @@ public class BrowserActivity extends Activity
467467
468468 final String appId = intent
469469 .getStringExtra(Browser.EXTRA_APPLICATION_ID);
470+ if (!TextUtils.isEmpty(urlData.mUrl) &&
471+ urlData.mUrl.startsWith("javascript:")) {
472+ // Always open javascript: URIs in new tabs
473+ openTabAndShow(urlData, true, appId);
474+ return;
475+ }
470476 if ((Intent.ACTION_VIEW.equals(action)
471477 // If a voice search has no appId, it means that it came
472478 // from the browser. In that case, reuse the current tab.
@@ -2656,8 +2662,9 @@ public class BrowserActivity extends Activity
26562662 }
26572663
26582664 // The "about:" schemes are internal to the browser; don't want these to
2659- // be dispatched to other apps.
2660- if (url.startsWith("about:")) {
2665+ // be dispatched to other apps. Similarly, javascript: schemas are private
2666+ // to the page
2667+ if (url.startsWith("about:") || url.startsWith("javascript:")) {
26612668 return false;
26622669 }
26632670
Afficher sur ancien navigateur de dépôt.