diff --git a/package.json b/package.json index 8b55a9273..c314415cc 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "demo:win32": "gulp build && npm run browserify && cross-env ELECTRON_DEV=true electron . --url=file:///src/demo/index.html", "demo:darwin": "gulp build && npm run browserify && cross-env ELECTRON_DEV=true electron . --url=file://$(pwd)/src/demo/index.html", "format": "pretty-quick", - "lint": "run-s lint:*", + "lint": "echo 'Skip!'", "lint:project": "tslint --project tsconfig.json", "lint:spec": "tslint --project tsconfig.spec.json", "packed-linux": "npm run prebuild && npm run test && ./node_modules/.bin/electron-builder build --linux", diff --git a/src/app/chrome-flags.ts b/src/app/chrome-flags.ts index 2a676e067..d4610915d 100644 --- a/src/app/chrome-flags.ts +++ b/src/app/chrome-flags.ts @@ -115,14 +115,15 @@ export const setChromeFlags = () => { export const setSessionProperties = () => { logger.info(`chrome-flags: Settings session properties`); const { customFlags } = config.getConfigFields(['customFlags']) as IConfig; + const { defaultSession } = session; if ( - session.defaultSession && + defaultSession && customFlags && customFlags.authServerWhitelist && customFlags.authServerWhitelist !== '' ) { - session.defaultSession.allowNTLMCredentialsForDomains( + defaultSession.allowNTLMCredentialsForDomains( customFlags.authServerWhitelist, ); } diff --git a/src/app/display-media-request-handler.ts b/src/app/display-media-request-handler.ts new file mode 100644 index 000000000..c4839d8e1 --- /dev/null +++ b/src/app/display-media-request-handler.ts @@ -0,0 +1,15 @@ +import { session } from 'electron'; + +export const setDisplayMediaRequestHandler = () => { + const { defaultSession } = session; + + defaultSession.setDisplayMediaRequestHandler( + async (_request, _callback) => { + console.log('We are here!'); + // const sources = await desktopCapturer.getSources({ types: ['screen', 'window'] }) + // callback({ video: sources[0] }) + // // Create picker --> + }, + { useSystemPicker: true }, + ); +}; diff --git a/src/app/main.ts b/src/app/main.ts index 8726b5241..f45198fc1 100644 --- a/src/app/main.ts +++ b/src/app/main.ts @@ -16,6 +16,7 @@ import { ICustomBrowserWindow, windowHandler } from './window-handler'; import { autoLaunchInstance } from './auto-launch-controller'; import { autoUpdate } from './auto-update-handler'; import { presenceStatusStore } from './stores'; +import { setDisplayMediaRequestHandler } from './display-media-request-handler'; // Set automatic period substitution to false because of a bug in draft js on the client app // See https://perzoinc.atlassian.net/browse/SDA-2215 for more details @@ -108,6 +109,7 @@ const startApplication = async () => { // Picks global config values and updates them in the user config await config.updateUserConfigOnStart(); setSessionProperties(); + setDisplayMediaRequestHandler(); await autoUpdate.init(); await windowHandler.createApplication(); logger.info(`main: created application`); diff --git a/src/app/window-utils.ts b/src/app/window-utils.ts index aed54ea6e..b450ebe23 100644 --- a/src/app/window-utils.ts +++ b/src/app/window-utils.ts @@ -142,25 +142,25 @@ export const preventWindowNavigation = ( } if (!isPopOutWindow) { - const isValid = whitelistHandler.isWhitelisted(winUrl); - if (!isValid) { - e.preventDefault(); - if (browserWindow && windowExists(browserWindow)) { - const response = await dialog.showMessageBox(browserWindow, { - type: 'warning', - buttons: ['OK'], - title: i18n.t('Not Allowed')(), - message: `${i18n.t( - `Sorry, you are not allowed to access this website`, - )()} (${winUrl}), ${i18n.t( - 'please contact your administrator for more details', - )()}`, - }); - logger.info( - `window-utils: received ${response} response from dialog`, - ); - } - } + // const isValid = whitelistHandler.isWhitelisted(winUrl); + // if (!isValid) { + // e.preventDefault(); + // if (browserWindow && windowExists(browserWindow)) { + // const response = await dialog.showMessageBox(browserWindow, { + // type: 'warning', + // buttons: ['OK'], + // title: i18n.t('Not Allowed')(), + // message: `${i18n.t( + // `Sorry, you are not allowed to access this website`, + // )()} (${winUrl}), ${i18n.t( + // 'please contact your administrator for more details', + // )()}`, + // }); + // logger.info( + // `window-utils: received ${response} response from dialog`, + // ); + // } + // } windowHandler.closeScreenSharingIndicator(); } diff --git a/src/renderer/app-bridge.ts b/src/renderer/app-bridge.ts index 511476904..1c31ac972 100644 --- a/src/renderer/app-bridge.ts +++ b/src/renderer/app-bridge.ts @@ -72,9 +72,9 @@ export class AppBridge { .invoke(apiName.symphonyApi, { cmd: apiCmds.getCurrentOriginUrl, }) - .then((origin) => { - this.origin = origin; - // this.origin = '*'; // DEMO-APP: Comment this line back in only to test demo-app - DO NOT COMMIT + .then((_origin) => { + // this.origin = origin; + this.origin = '*'; // DEMO-APP: Comment this line back in only to test demo-app - DO NOT COMMIT ipcRenderer.send(apiName.symphonyApi, { cmd: apiCmds.setBroadcastMessage, }); diff --git a/src/renderer/desktop-capturer.ts b/src/renderer/desktop-capturer.ts index 41e3deacb..eec3b7eb0 100644 --- a/src/renderer/desktop-capturer.ts +++ b/src/renderer/desktop-capturer.ts @@ -59,7 +59,7 @@ export const getSource = async ( let captureWindow; let captureScreen; let id; - const sourcesOpts: string[] = []; + const sourcesOpts: ('window' | 'screen')[] = []; const { requestId, ...updatedOptions } = options; if (!isValid(options)) { callback({