[MM-52879] Fixed calls popout URL checking (#2725)
This commit is contained in:
@@ -78,7 +78,7 @@ export class WebContentsEventManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CallsWidgetWindow.isCallsWidget(webContentsId)) {
|
if (CallsWidgetWindow.isCallsWidget(webContentsId)) {
|
||||||
return CallsWidgetWindow.getURL();
|
return CallsWidgetWindow.getViewURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ViewManager.getViewByWebContentsId(webContentsId)?.view.server.url;
|
return ViewManager.getViewByWebContentsId(webContentsId)?.view.server.url;
|
||||||
|
@@ -438,15 +438,16 @@ describe('main/windows/callsWidgetWindow', () => {
|
|||||||
expect(callsWidgetWindow.popOut).not.toBeDefined();
|
expect(callsWidgetWindow.popOut).not.toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getURL', () => {
|
it('getViewURL', () => {
|
||||||
const callsWidgetWindow = new CallsWidgetWindow();
|
const callsWidgetWindow = new CallsWidgetWindow();
|
||||||
callsWidgetWindow.win = {
|
callsWidgetWindow.mainView = {
|
||||||
webContents: {
|
view: {
|
||||||
getURL: () => 'http://localhost:8065/',
|
server: {
|
||||||
|
url: new URL('http://localhost:8065/'),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
urlUtils.parseURL.mockImplementation((url) => new URL(url));
|
expect(callsWidgetWindow.getViewURL().toString()).toBe('http://localhost:8065/');
|
||||||
expect(callsWidgetWindow.getURL().toString()).toBe('http://localhost:8065/');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('isAllowedEvent', () => {
|
describe('isAllowedEvent', () => {
|
||||||
|
@@ -94,8 +94,8 @@ export class CallsWidgetWindow {
|
|||||||
* Helper functions
|
* Helper functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
getURL = () => {
|
getViewURL = () => {
|
||||||
return this.win && parseURL(this.win?.webContents.getURL());
|
return this.mainView?.view.server.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
isCallsWidget = (webContentsId: number) => {
|
isCallsWidget = (webContentsId: number) => {
|
||||||
|
@@ -7,8 +7,6 @@ import {SHOW_SETTINGS_WINDOW} from 'common/communication';
|
|||||||
import Config from 'common/config';
|
import Config from 'common/config';
|
||||||
import {Logger} from 'common/log';
|
import {Logger} from 'common/log';
|
||||||
|
|
||||||
import ViewManager from 'main/views/viewManager';
|
|
||||||
|
|
||||||
import ContextMenu from '../contextMenu';
|
import ContextMenu from '../contextMenu';
|
||||||
import {getLocalPreload, getLocalURLString} from '../utils';
|
import {getLocalPreload, getLocalURLString} from '../utils';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user