How to access the DOM of a BrowserWindow using Electron and Angular (v2 +)

-2

Hello, I'm creating an application in Electron where, at some point I have to open a new screen with the login page of an API. This API will do your authorization process and in the end will present me an access token inside the body, like this:

@Component({
  selector: 'app-form',
  templateUrl: './app-form.component.html',
})
export class AppFormComponent {

  form: FormGroup;
  input_api: new FormControl('');

  constructor(
    private builder: FormBuilder,
  ){
    this.form = this.builder.group({
      api: this.input_api
    })
  }

  requestAuth() {

    try {

      let url = '${new URL(this.input_api.value).origin}/auth.php?response_type=code'
      let conf = {
        width: null, height: null, maxHeight: null, maxWidth: null,
        minHeight: null, minWidth: null, frame: true, center: true,
        resizable: true, maximizable: true
      }
      let remote = window.require('electron').remote;

      let win = new remote.BrowserWindow(conf);
      win.setMenu(null);
      win.setIcon(null);
      win.loadURL(url);

    } catch(e) {
      alert('url inválida')
    }

  }

}

The problem is that nowhere in the doc documentation did I find any information on how to access the DOM of a new BrowserWindow from a RenderedWindow

What do I need to do to get the body of a BrowserWindow to (by querySelector ) get the information that pertains to the access data of this API?

    
asked by anonymous 26.12.2018 / 18:24

0 answers