Loading browser/locales/en-US/browser/webrtcIndicator.ftl +1 −1 Original line number Diff line number Diff line Loading @@ -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 = Loading browser/modules/webrtcUI.sys.mjs +25 −4 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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); Loading @@ -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) { Loading Loading
browser/locales/en-US/browser/webrtcIndicator.ftl +1 −1 Original line number Diff line number Diff line Loading @@ -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 = Loading
browser/modules/webrtcUI.sys.mjs +25 −4 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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); Loading @@ -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) { Loading