Skip to content

Commit

Permalink
open url in browser for desktop version
Browse files Browse the repository at this point in the history
  • Loading branch information
listen1 committed Aug 24, 2020
1 parent 3099730 commit 9745f86
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1535,19 +1535,12 @@ const main = () => {
link(scope, element, attrs) {
element.bind('click', (event) => {
if ((typeof chrome) === 'undefined') {
// normal window for link
const { BrowserWindow } = require('electron').remote;
let win = new BrowserWindow({
width: 1000,
height: 670,
});
win.on('closed', () => {
win = null;
});
win.loadURL(scope.url);
return;
var shell = require('electron').shell;
shell.openExternal(scope.url);
}
else {
$window.open(scope.url, '_blank');
}
$window.open(scope.url, '_blank');
});
},
}),
Expand Down

0 comments on commit 9745f86

Please sign in to comment.