2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-06 06:20:47 +00:00

Fix linting errors

This commit is contained in:
Goh Jia Hao 2016-05-26 18:01:33 +08:00
parent c12006ebea
commit 537dc01fd1

View File

@ -129,23 +129,23 @@ function createMainWindow(options, onAppQuit, setDockBadge) {
mainWindow.webContents.setUserAgent(options.userAgent);
}
const injectCss = () => {
mainWindow.webContents.insertCSS(getCssToInject());
};
mainWindow.webContents.on('did-finish-load', () => {
mainWindow.webContents.send('params', JSON.stringify(options));
// remove the injection of css the moment the page is loaded
mainWindow.webContents.removeListener('did-get-response-details', injectCss);
});
const injectCss = () => {
mainWindow.webContents.insertCSS(getCssToInject());
}
// on every page navigation inject the css
mainWindow.webContents.on('did-start-loading', () => {
// we have to inject the css in did-get-response-details to prevent the fouc
// will run multiple times
mainWindow.webContents.on('did-get-response-details', injectCss);
});
if (options.counter) {
mainWindow.on('page-title-updated', () => {
if (mainWindow.isFocused()) {