Skip to content

Commit

Permalink
DFE-38: Update 'require' for Electron
Browse files Browse the repository at this point in the history
  • Loading branch information
mackode committed Nov 27, 2023
1 parent af9d3d4 commit 2e42358
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/app-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* app.on('ready', createWindow);
*/

const electronApp = window.require('electron').app;
const electronApp = window.require("electron").app;
const path = window.require('path');
let settings = {
downloadingThreadsRules: {
Expand Down
4 changes: 2 additions & 2 deletions api/downstream-electron-be.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ DownstreamElectronBE.prototype._apiMethods = function (methodName, promiseId, ar
* @returns {void}
*/
DownstreamElectronBE.prototype._attachEvents = function () {
const ipcMain = require('electron').ipcMain;
const ipcMain = window.require("electron").ipcMain;
ipcMain.on("downstreamElectronBE", this._onApiRequest);
};

Expand Down Expand Up @@ -211,7 +211,7 @@ DownstreamElectronBE.prototype._onApiRequest = function (evt, data, target) {
*/
DownstreamElectronBE.prototype._send = function (response, target) {
try {
const windows = require('electron').BrowserWindow.getAllWindows();
const windows = window.require("electron").BrowserWindow.getAllWindows();
for (let i = 0, j = windows.length; i < j; i++) {
if (windows[i].id === target) {
windows[i].webContents.send('downstreamElectronFE', response);
Expand Down
2 changes: 1 addition & 1 deletion api/downstream-electron-fe.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ DownstreamElectronFE.prototype._apiCall = function (method, args, originalMethod
* @returns {void}
*/
DownstreamElectronFE.prototype._attachEvents = function () {
const ipcRenderer = window.require('electron').ipcRenderer;
const ipcRenderer = window.require("electron").ipcRenderer;
ipcRenderer.on('downstreamElectronFE', this._processApi);
this._window.addEventListener('beforeunload', this._beforeUnload);
};
Expand Down
2 changes: 1 addition & 1 deletion integrations/typescript/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class FakePersistentPlugin {

}

// const downstreamInstance = downstreamElectron.init(window, new FakePersistentPlugin());
const downstreamInstance = downstreamElectron.init(window, new FakePersistentPlugin());

/*
downstreamElectron.downloads.create('https://storage.googleapis.com/shaka-demo-assets/sintel-widevine/dash.mpd', '').then(function (result: any) {
Expand Down

0 comments on commit 2e42358

Please sign in to comment.