open external links in the browser
This commit is contained in:
parent
9792bcf7a4
commit
c4e1006039
8
main.js
8
main.js
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue