mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
add electron webFrame API to preloadJS
This commit is contained in:
parent
b2322bae02
commit
7a0f2c9ce3
1 changed files with 13 additions and 3 deletions
16
preload.js
16
preload.js
|
@ -2,6 +2,7 @@
|
|||
/* global window: false */
|
||||
const path = require('path');
|
||||
const electron = require('electron');
|
||||
const {webFrame} = electron;
|
||||
const semver = require('semver');
|
||||
|
||||
const { deferredToPromise } = require('./js/modules/deferred_to_promise');
|
||||
|
@ -69,6 +70,7 @@ window.CONSTANTS = {
|
|||
MAX_CONNECTION_DURATION: 5000,
|
||||
};
|
||||
|
||||
|
||||
window.versionInfo = {
|
||||
environment: window.getEnvironment(),
|
||||
version: window.getVersion(),
|
||||
|
@ -82,10 +84,15 @@ const ipc = electron.ipcRenderer;
|
|||
const localeMessages = ipc.sendSync('locale-data');
|
||||
|
||||
|
||||
Window.updateScaling = (number) => {
|
||||
ipc.s
|
||||
window.setScaling = (number) => {
|
||||
return webFrame.setZoomFactor(number);
|
||||
}
|
||||
|
||||
window.getScaling = () => {
|
||||
return webFrame.getZoomFactor();
|
||||
}
|
||||
|
||||
|
||||
window.setBadgeCount = count => ipc.send('set-badge-count', count);
|
||||
|
||||
// Set the password for the database
|
||||
|
@ -185,7 +192,7 @@ ipc.on('set-up-as-standalone', () => {
|
|||
|
||||
// Settings-related events
|
||||
|
||||
console.log(window.getSettingValue('zoom-factor-setting'), 'from preloadJS and get the setting value');
|
||||
|
||||
|
||||
|
||||
window.showSettings = () => ipc.send('show-settings');
|
||||
|
@ -229,6 +236,9 @@ window.setSettingValue = (settingID, value) => {
|
|||
window.storage.put(settingID, value);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
installGetter('device-name', 'getDeviceName');
|
||||
|
||||
installGetter('theme-setting', 'getThemeSetting');
|
||||
|
|
Loading…
Reference in a new issue