ma1 pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / 
Applications / Tor Browser


Commits:
2cb4c1cb by Emma Zuehlcke at 2025-09-15T18:45:34+02:00
Bug 1665334, r=mconley,fluent-reviewers,bolsson

Differential Revision: https://phabricator.services.mozilla.com/D257293

- - - - -
61800199 by Makoto Kato at 2025-09-15T19:20:12+02:00
Bug 1974025 - Check scheme into Intent data. 
r=geckoview-reviewers,tcampbell,nalexander a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D256952

- - - - -


3 changed files:

- browser/locales/en-US/browser/webrtcIndicator.ftl
- browser/modules/webrtcUI.sys.mjs
- mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IntentUtils.java


Changes:

=====================================
browser/locales/en-US/browser/webrtcIndicator.ftl
=====================================
@@ -60,7 +60,7 @@ webrtc-screen-system-menu =
 ## These strings are only used on Mac for menus attached to icons
 ## near the clock on the mac menubar.
 ## Variables:
-##   $streamTitle (String): the title of the tab using the share.
+##   $streamTitle (String): the host of the tab using the share.
 ##   $tabCount (Number): the title of the tab using the share.
 
 webrtc-indicator-menuitem-control-sharing =


=====================================
browser/modules/webrtcUI.sys.mjs
=====================================
@@ -983,8 +983,10 @@ export function showStreamSharingMenu(win, event, 
inclWindow = false) {
     let stream = activeStreams[0];
 
     const sharingItem = doc.createXULElement("menuitem");
-    const streamTitle = stream.browser.contentTitle || stream.uri;
-    doc.l10n.setAttributes(sharingItem, l10nIds[0], { streamTitle });
+    const displayHost = getDisplayHostForStream(stream);
+    doc.l10n.setAttributes(sharingItem, l10nIds[0], {
+      streamTitle: displayHost,
+    });
     sharingItem.setAttribute("disabled", "true");
     menu.appendChild(sharingItem);
 
@@ -1008,11 +1010,11 @@ export function showStreamSharingMenu(win, event, 
inclWindow = false) {
 
     for (let stream of activeStreams) {
       const controlItem = doc.createXULElement("menuitem");
-      const streamTitle = stream.browser.contentTitle || stream.uri;
+      const displayHost = getDisplayHostForStream(stream);
       doc.l10n.setAttributes(
         controlItem,
         "webrtc-indicator-menuitem-control-sharing-on",
-        { streamTitle }
+        { streamTitle: displayHost }
       );
       controlItem.stream = stream;
       controlItem.addEventListener("command", this);
@@ -1021,6 +1023,25 @@ export function showStreamSharingMenu(win, event, 
inclWindow = false) {
   }
 }
 
+function getDisplayHostForStream(stream) {
+  let uri = Services.io.newURI(stream.uri);
+
+  let displayHost;
+
+  try {
+    displayHost = uri.displayHost;
+  } catch (ex) {
+    displayHost = null;
+  }
+
+  // Host getter threw or returned "". Fall back to spec.
+  if (displayHost == null || displayHost == "") {
+    displayHost = uri.displaySpec;
+  }
+
+  return displayHost;
+}
+
 function onTabSharingMenuPopupShowing(e) {
   const streams = webrtcUI.getActiveStreams(true, true, true, true);
   for (let streamInfo of streams) {


=====================================
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IntentUtils.java
=====================================
@@ -89,7 +89,7 @@ public class IntentUtils {
     }
 
     if (("intent".equals(scheme) || "android-app".equals(scheme))) {
-      // Bug 1356893 - Rject intents with file data schemes.
+      // Bug 1356893 - Reject intents with file data schemes.
       return getSafeIntent(aUri) != null;
     }
 
@@ -115,8 +115,11 @@ public class IntentUtils {
     }
 
     final Uri data = intent.getData();
-    if (data != null && "file".equals(normalizeUriScheme(data).getScheme())) {
-      return null;
+    if (data != null) {
+      final String scheme = normalizeUriScheme(data).getScheme();
+      if ("file".equals(scheme) || "fido".equals(scheme)) {
+        return null;
+      }
     }
 
     // Only open applications which can accept arbitrary data from a browser.



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/e0d93da74a35a8da948a6e5bbd0295258a1373aa...61800199de241874f83ffb10bbe922015939e1b5

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/e0d93da74a35a8da948a6e5bbd0295258a1373aa...61800199de241874f83ffb10bbe922015939e1b5
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to