Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/replay/backend/models/AppView.ts
1030 views
1
import Window from './Window';
2
import ViewBackend from './ViewBackend';
3
import IWindowLocation, { InternalLocations } from '~shared/interfaces/IWindowLocation';
4
import Application from '~backend/Application';
5
6
export default class AppView extends ViewBackend {
7
public location: InternalLocations;
8
9
public constructor(window: Window) {
10
super(window, {
11
nodeIntegration: true,
12
enableRemoteModule: true,
13
});
14
}
15
16
public async load(location: IWindowLocation = InternalLocations.Dashboard) {
17
this.attach();
18
this.location = InternalLocations[location];
19
20
const page = location.toLowerCase();
21
22
const url = Application.instance.getPageUrl(page);
23
console.log('Loading app page', url);
24
25
await this.webContents.loadURL(url);
26
this.webContents.focus();
27
}
28
}
29
30