open external links in the browser

This commit is contained in:
Nicolas Constant 2018-08-03 00:12:32 -04:00
parent 9792bcf7a4
commit c4e1006039
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,4 @@
const {app, BrowserWindow} = require('electron')
const {app, BrowserWindow, shell} = require('electron')
const path = require('path')
const url = require('url')
@ -21,6 +21,12 @@ const url = require('url')
// Open the DevTools.
//win.webContents.openDevTools()
//open external links to browser
win.webContents.on('new-window', function(event, url){
event.preventDefault();
shell.openExternal(url);
});
// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store windows

View File

@ -22,6 +22,8 @@ export class RegisterNewAccountComponent implements OnInit {
}
onSubmit(): boolean {
let fullHandle = this.mastodonFullHandle.split('@').filter(x => x != null && x !== '');
console.log(fullHandle[0]);
@ -31,6 +33,17 @@ export class RegisterNewAccountComponent implements OnInit {
//register app
//redirect to oauth
window.location.href = "https://google.com";
//register app
//ask for getting token
// this.authService.getToken(this.mastodonNode, this.email, this.password)
@ -44,6 +57,8 @@ export class RegisterNewAccountComponent implements OnInit {
// this.result = err;
// });
return false;
}
}