Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 47d6ece

Browse files
fix: specify driver directory (#14)
* fix: specify playwright-go driver directory * fix: README
1 parent 112befb commit 47d6ece

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
# Instruction
44

5-
To use this base image, please specify followng arguments of `BrowserTypeLaunchOptions`.
5+
To use this base image, please specify followng arguments of `RunOptions` and `BrowserTypeLaunchOptions`.
66

77
```go
8-
pw, _ := playwright.Run()
8+
pw, err := playwright.Run(&playwright.RunOptions{
9+
DriverDirectory: "/root/.cache",
10+
SkipInstallBrowsers: true,
11+
})
912

1013
browser, _ := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
1114
Args: []string{

testdata/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import (
99
const url = "https://playwright.dev/"
1010

1111
func main() {
12-
pw, err := playwright.Run()
12+
pw, err := playwright.Run(&playwright.RunOptions{
13+
DriverDirectory: "/root/.cache",
14+
SkipInstallBrowsers: true,
15+
})
1316
if err != nil {
1417
panic(err)
1518
}

0 commit comments

Comments
 (0)