Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to load a crx extension file? #1120

Open
jj0e opened this issue Oct 8, 2024 · 2 comments
Open

Is it possible to load a crx extension file? #1120

jj0e opened this issue Oct 8, 2024 · 2 comments
Labels
question Questions related to rod

Comments

@jj0e
Copy link

jj0e commented Oct 8, 2024

I would like to load a crx extension file that is dynamically served from an api. I tried this example:

rod/examples_test.go

Lines 569 to 589 in 252b329

func Example_load_extension() {
extPath, _ := filepath.Abs("fixtures/chrome-extension")
u := launcher.New().
// Must use abs path for an extension
Set("load-extension", extPath).
// Headless mode doesn't support extension yet.
// Reason: https://bugs.chromium.org/p/chromium/issues/detail?id=706008#c5
// You can use XVFB to get rid of it: https://github.com/go-rod/rod/blob/master/lib/examples/launch-managed/main.go
Headless(false).
MustLaunch()
page := rod.New().ControlURL(u).MustConnect().MustPage("http://mdn.dev")
page.MustWait(`() => document.title === 'test-extension'`)
fmt.Println("ok")
// Skip
// Output: ok
}

but it appears to not work for crx. I get:
Screenshot 2024-10-08 at 5 35 35 PM

Is it possible to somehow use crx file?

@jj0e jj0e added the question Questions related to rod label Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

Please add a valid Rod Version: v0.0.0 to your issue. Current version is v0.116.2

generated by check-issue

@ysmood
Copy link
Member

ysmood commented Oct 9, 2024

This might help, seems like a chromium policy issue:

https://stackoverflow.com/questions/16800696/how-install-crx-chrome-extension-via-command-line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions related to rod
Projects
None yet
Development

No branches or pull requests

2 participants