mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 19:17:09 +03:00
Enabling usage or @electron/remote in main window
This commit is contained in:
parent
846c91ecc0
commit
c8ed2ee703
@ -86,6 +86,7 @@ module.exports = class AtomWindow extends EventEmitter {
|
||||
const BrowserWindowConstructor =
|
||||
settings.browserWindowConstructor || BrowserWindow;
|
||||
this.browserWindow = new BrowserWindowConstructor(options);
|
||||
electronRemote.enable(this.browserWindow.webContents)
|
||||
|
||||
Object.defineProperty(this.browserWindow, 'loadSettingsJSON', {
|
||||
get: () =>
|
||||
|
@ -4,6 +4,7 @@
|
||||
const startWindowTime = Date.now();
|
||||
|
||||
const electron = require('electron');
|
||||
const remote = require('@electron/remote');
|
||||
const path = require('path');
|
||||
const Module = require('module');
|
||||
const getWindowLoadSettings = require('../src/get-window-load-settings');
|
||||
@ -12,7 +13,7 @@
|
||||
const entryPointDirPath = __dirname;
|
||||
let blobStore = null;
|
||||
|
||||
const startupMarkers = electron.remote.getCurrentWindow().startupMarkers;
|
||||
const startupMarkers = remote.getCurrentWindow().startupMarkers;
|
||||
|
||||
if (startupMarkers) {
|
||||
StartupTime.importData(startupMarkers);
|
||||
@ -78,7 +79,7 @@
|
||||
}
|
||||
|
||||
function handleSetupError(error) {
|
||||
const currentWindow = electron.remote.getCurrentWindow();
|
||||
const currentWindow = remote.getCurrentWindow();
|
||||
currentWindow.setSize(800, 600);
|
||||
currentWindow.center();
|
||||
currentWindow.show();
|
||||
@ -139,7 +140,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
const webContents = electron.remote.getCurrentWindow().webContents;
|
||||
const webContents = remote.getCurrentWindow().webContents;
|
||||
if (webContents.devToolsWebContents) {
|
||||
profile();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user