diff --git a/css/webviews.css b/css/webviews.css index 16b52e61c..128193b86 100644 --- a/css/webviews.css +++ b/css/webviews.css @@ -3,12 +3,6 @@ position: relative; } -/* Webpages assume the page background will always be white, but the Electron API to set this is broken on Windows and Linux (https://github.com/electron/electron/issues/20447) - there, the view will always be transparent. -Therefore, the webview background should always be white, except on the new tab page. */ -body:not(.is-ntp) #webviews { - background-color: white; -} - .arrow-indicator { width: 140px; height: 140px; diff --git a/main/viewManager.js b/main/viewManager.js index db40c8c9a..90248c917 100644 --- a/main/viewManager.js +++ b/main/viewManager.js @@ -321,7 +321,10 @@ ipc.on('loadURLInView', function (e, args) { // wait until the first URL is loaded to set the background color so that new tabs can use a custom background if (!viewStateMap[args.id].loadedInitialURL) { - viewMap[args.id].setBackgroundColor('#fff') + // Give the site a chance to display something before setting the background, in case it has its own dark theme + viewMap[args.id].webContents.once('dom-ready', function() { + viewMap[args.id].setBackgroundColor('#fff') + }) // If the view has no URL, it won't be attached yet if (args.id === windows.getState(win).selectedView) { win.setBrowserView(viewMap[args.id])