Skip to content

Commit

Permalink
- Fix page open after login
Browse files Browse the repository at this point in the history
- Better system-wide dark mode support on macOS
  • Loading branch information
exentrich committed Nov 6, 2019
1 parent 19f9b74 commit 812fc92
Show file tree
Hide file tree
Showing 3 changed files with 690 additions and 107 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"@electron-forge/maker-squirrel": "^6.0.0-beta.45",
"@electron-forge/maker-zip": "6.0.0-beta.45",
"@electron-forge/publisher-github": "^6.0.0-beta.45",
"electron": "6.0.x"
"electron": "7.1.x"
}
}
15 changes: 7 additions & 8 deletions src/window.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { BrowserWindow, shell } = require('electron')
const { BrowserWindow, shell, systemPreferences } = require('electron')
const isDev = require('electron-is-dev')
const windowStateKeeper = require('electron-window-state')
const contextMenu = require('electron-context-menu')
Expand Down Expand Up @@ -30,10 +30,9 @@ module.exports = {
center: true,
acceptFirstMouse: true,
titleBarStyle: "hiddenInset",
vibrancy: "sidebar",//ultra-dark
plugins: true,
autoHideMenuBar: true,
backgroundColor: '#f6f6f6',
backgroundColor: systemPreferences.isDarkMode() ? '#303030' : '#f6f6f6',

webPreferences: {
webviewTag: true,
Expand All @@ -49,13 +48,13 @@ module.exports = {
window: this.window
})

if (isDev)
/*if (isDev)
this.window.loadURL('http://dev.raindrop.io')
else
else*/
this.window.loadURL('https://app.raindrop.io/legacy/4')

if (isDev)
this.window.webContents.openDevTools();
/*if (isDev)
this.window.webContents.openDevTools();*/

this.window.webContents.on('will-navigate', this.handleURLChange);
this.window.webContents.on('new-window', function(e,url){
Expand Down Expand Up @@ -104,7 +103,7 @@ module.exports = {
},

handleURLChange: function(e,url) {
const acceptedURLS = [/\/\/(dev\.|)raindrop\.io/];
const acceptedURLS = [/\/\/(app\.|dev\.|)raindrop\.io/];

var canNavigate = false;
for(var i in acceptedURLS)
Expand Down
Loading

0 comments on commit 812fc92

Please sign in to comment.