Namespace: DownstreamElectronBE

DownstreamElectronBE

During initialization you can configure your app, click here
Properties:
Name Type Description
init DownstreamElectronBE.init initialize api in main process

Example

//somewhere in the main process
const { BrowserWindow, app } = require('electron');
const downstreamElectron = require('downstream-electron');

const userSettings = {
  "appDir": "/Users/admin/myApp",
  "settingsName": "settings",
  "publicName": "public",
  "downloadsName": "movies"
};

let downstreamInstance;
function createWindow() {
  downstreamInstance = downstreamElectron.init(userSettings);
  const win = new BrowserWindow({
    width: 1200,
    height: 700,
    resizable: true,
    webPreferences: {
      plugins: true
    }
  });
  win.loadURL('file://index.html');
  win.webContents.openDevTools();
}

function onWillQuit() {
 downstreamInstance.stop();
}

app.on('ready', createWindow);
app.on('will-quit', onWillQuit);
app.on('window-all-closed', function () {
 console.log("window-all-closed");
 app.quit();
});

Namespaces

configuration

Methods

getOfflinePath(manifestId) → {string}

Parameters:
Name Type Description
manifestId string manifest identifier
Returns:
- offline path
Type
string

processSubscriber(subscriberId, err, result, target, subscriberFinished) → {void}

Parameters:
Name Type Description
subscriberId string subscriber identifier
err object error
result object result
target number window target id
subscriberFinished boolean download finished
Returns:
Type
void