Closed qq1053831109 closed 2 years ago
used. I use it
please share how you do it ?
please share how you do it ?
I just did these two actions
const webPreference: WebPreferences = (process.env.NODE_ENV === 'development' ||
process.env.E2E_BUILD === 'true') &&
process.env.ERB_SECURE !== 'true'
? {
nodeIntegration: true,
enableRemoteModule: true,
}
: {
preload: path.join(__dirname, 'dist/renderer.prod.js'),
enableRemoteModule: true,
};
mainWindow = new BrowserWindow({
show: false,
width: 1024,
height: 728,
icon: getAssetPath('icon.png'),
frame: false,
webPreferences: webPreference,
titleBarStyle: 'hidden'
});
<script>
const path = require('path');
const url = require('url');
const customTitlebar = require('custom-electron-titlebar');
window.addEventListener('DOMContentLoaded', () => {
const titlebar = new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#16354e'),
icon: url.format(path.join(__dirname, '/assets', '/48x48_light.png')),
shadow: true
});
const replaceText = (selector, text) => {
const element = document.getElementById(selector)
if (element) element.innerText = text
}
for (const type of['chrome', 'node', 'electron']) {
replaceText(`${type}-version`, process.versions[type])
}
})
</script>
this lib cant use in electron-react-boilerplate?