2023-12-16 16:49:26 +00:00
|
|
|
const { contextBridge } = require('electron');
|
2023-04-24 19:42:49 +00:00
|
|
|
|
|
|
|
|
// dev uses http://localhost, prod uses file://...index.html
|
2023-12-16 16:49:26 +00:00
|
|
|
const isDev = window.location.protocol === 'http:';
|
2023-04-24 19:42:49 +00:00
|
|
|
|
|
|
|
|
const defaultPlebbitOptions = {
|
2023-12-16 16:49:26 +00:00
|
|
|
plebbitRpcClientsOptions: ['ws://localhost:9138'],
|
|
|
|
|
};
|
2023-04-24 19:42:49 +00:00
|
|
|
|
2023-12-16 16:49:26 +00:00
|
|
|
contextBridge.exposeInMainWorld('defaultPlebbitOptions', defaultPlebbitOptions);
|
2023-04-24 19:42:49 +00:00
|
|
|
|
2023-12-11 00:49:36 +00:00
|
|
|
// expose a flag to indicate that we are running in electron
|
2023-12-16 16:49:26 +00:00
|
|
|
contextBridge.exposeInMainWorld('electron', { isElectron: true });
|
2023-12-11 00:49:36 +00:00
|
|
|
|
|
|
|
|
// uncomment for logs
|
|
|
|
|
// localStorage.debug = 'plebbit-js:*,plebbit-react-hooks:*,plebchan:*'
|