OW-Electron APIs
The Overwolf APIs are used to access the features that OW-Electron provides.
Methods Reference
Events Reference
Types Reference
- pendingUpdateResult Object
- PackageInfo Object
Methods
disableAdsFPD()
Version added: 31.4.0
Disables the use of First Party Data (email hashes).
Example
- main.ts
- preload.ts
- renderer.ts
main.ts snippet
import { app as electronApp, ipcMain} from 'electron';
import { overwolf } from '@overwolf/ow-electron';
const owElectronApp = electronApp as overwolf.OverwolfApp;
...
ipcMain.handle('disable-ads-fpd', () => {
owElectronApp.overwolf.disableAdsFPD();
});
preload.ts snippet
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('app', {
...
disableAdsFPD: () => {
return ipcRenderer.invoke('disable-ads-fpd');
},
});
renderer.ts snippet
const disableAdsFPDButton = document.getElementById(
'disableAdsFPD'
) as HTMLButtonElement;
disableAdsFPDButton.addEventListener('click', async () => {
try {
// @ts-ignore
await window.app.disableAdsFPD();
} catch (error) {
addMessageToTerminal('disableAdsFPD error');
alert('disableAdsFPD error' + error);
}
});
packages.hasPendingUpdates()
Version added: 31.4.0
Returns pendingUpdateResult object.
Example
main.ts snippet
import { app as electronApp, ipcMain} from 'electron';
import { overwolf } from '@overwolf/ow-electron';
const owElectronApp = electronApp as overwolf.OverwolfApp;
...
owElectronApp.overwolf.packages.on('package-update-pending', () => {
const pendingUpdateResult =
owElectronApp.overwolf.packages.hasPendingUpdates();
this.printLogMessage('*** update pending ***', pendingUpdateResult);
});
Types
pendingUpdateResult Object
Parameter | Type | Description |
---|---|---|
hasPendingUpdate | boolean | |
details | PackageInfo[] | Package name and version. false returns empty array. |
Example data: true
{"hasPendingUpdate":true,"details":[{"name":"overlay","version":"1.3.2"}]}
PackageInfo Object
Parameter | Type | Description |
---|---|---|
name | string | Package name. |
version | string | Package version. |