Skip to content

Possible to connect into an Electron compiled app instead of a Chromium based browser? #440

Answered by ysmood
Bolado asked this question in Q&A
Discussion options

You must be logged in to vote

According to here: https://www.electronjs.org/docs/api/command-line-switches#--remote-debugging-portport

const { app } = require('electron')
app.commandLine.appendSwitch('remote-debugging-port', '8315')

app.whenReady().then(() => {
  // Your code here
})

Use rod to connect to the port:

u := launcher.MustResolveURL("8315")
browser := rod.New().ControlURL(u).MustConnect()

For more info: https://github.com/go-rod/rod/blob/master/lib/examples/connect-browser/main.go

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by infalmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Questions related to rod
2 participants
Converted from issue

This discussion was converted from issue #423 on June 12, 2021 21:53.