Skip to content

Commit

Permalink
chore: make Meet open on browser by default (#2677)
Browse files Browse the repository at this point in the history
* fix: Google Meet cant share screen on Electron, then it will open on the browser

* add disclaimer about meet on the setting
  • Loading branch information
jeanfbrito authored Jun 7, 2023
1 parent db55f04 commit 51402fa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
},
"internalVideoChatWindow": {
"title": "Open Video Chat using Application Window",
"description": "When set Video Chat will be opened using an application's window, otherwise the default browser will be used.",
"description": "When set Video Chat will be opened using an application's window, otherwise the default browser will be used. <strong>Google Meet</strong> share screen is not supported in Electron applications, so this configuration don't change Meet calls behavior, that will open on browser.",
"masDescription": "This option is disabled when installed from the Mac App Store, for security reasons it will open Video Chat using the browser by default."
},
"minimizeOnClose": {
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
},
"internalVideoChatWindow": {
"title": "Abrir chat em video em uma janela da aplicação",
"description": "Quando ativo o chat em video será aberto em uma janela da aplicação, caso contrário será aberto em uma nova janela do navegador.",
"description": "Quando ativado, o Video Chat será aberto usando a janela do aplicativo, caso contrário, o navegador padrão será usado. O compartilhamento de tela do <strong>Google Meet</strong> não é suportado em aplicativos Electron, portanto, essa configuração não altera o comportamento das chamadas no Meet, que serão abertas no navegador.",
"masDescription": "Esta opção esta desativada quando for instalado através da Mac App Store, por motivos de segurança o chat em video sera aberto usando o navegador por padrão."
},
"minimizeOnClose": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ToggleSwitch, Field } from '@rocket.chat/fuselage';
import React, { ChangeEvent, Dispatch, FC, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';

import { RootAction } from '../../../../store/actions';
Expand Down Expand Up @@ -48,7 +48,16 @@ export const InternalVideoChatWindow: FC<Props> = (props) => {
</Field.Hint>
) : (
<Field.Hint>
{t('settings.options.internalVideoChatWindow.description')}
<Trans
i18nKey='settings.options.internalVideoChatWindow.description'
t={t}
>
When set Video Chat will be opened using an application's window,
otherwise the default browser will be used.
<strong>Google Meet</strong> share screen is not supported in
Electron applications, so this configuration don't change Meet
calls behavior, that will open on browser.
</Trans>
</Field.Hint>
)}
</Field.Row>
Expand Down
7 changes: 6 additions & 1 deletion src/videoCallWindow/ipc.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import path from 'path';

import type { WebContents } from 'electron';
import {
app,
BrowserWindow,
desktopCapturer,
ipcMain,
WebContents,
screen,
systemPreferences,
shell,
} from 'electron';

import { packageJsonInformation } from '../app/main/app';
Expand All @@ -32,6 +33,10 @@ export const startVideoCallWindowHandler = (): void => {
handle('video-call-window/open-window', async (_event, url) => {
const validUrl = new URL(url);
const allowedProtocols = ['http:', 'https:'];
if (validUrl.hostname.match(/(\.)?g\.co$/)) {
shell.openExternal(validUrl.toString());
return;
}
if (allowedProtocols.includes(validUrl.protocol)) {
const mainWindow = await getRootWindow();
const winBounds = await mainWindow.getNormalBounds();
Expand Down

0 comments on commit 51402fa

Please sign in to comment.