Skip to content

Commit 77f5be8

Browse files
committed
update docs
1 parent 3f47a17 commit 77f5be8

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed

README.md

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ libraryDependencies += "io.github.thijsbroersen" %% "scala-js-env-playwright" %
1414
```
1515
Add the following line to your `build.sbt`
1616
```scala
17-
Test / jsEnv := new PlaywrightJSEnv(
18-
browserName = "chrome",
17+
Test / jsEnv := new PlaywrightJSEnv.chrome(
1918
headless = true
2019
)
2120
```
2221
## Usage Mill (not yet part of Mill, tested in locally build Mill version)
2322
```scala
24-
override def jsEnvConfig = JsEnvConfig.Playwright(
25-
browserName = "chrome",
23+
override def jsEnvConfig = JsEnvConfig.Playwright.chrome(
2624
headless = true
2725
)
2826
```
@@ -65,8 +63,7 @@ libraryDependencies += "com.google.guava" % "guava" % "33.0.0-jre"
6563

6664
## Default configuration
6765
```scala
68-
jsEnv := new jsenv.playwright.PlaywrightJSEnv(
69-
browserName = "chrome",
66+
jsEnv := new jsenv.playwright.PlaywrightJSEnv.chrome(
7067
headless = true,
7168
showLogs = false,
7269
)
@@ -80,8 +77,7 @@ When not passing launchOptions, default launch options are as follows:
8077

8178
### Chrome/chromium
8279
```scala
83-
jsEnv := new jsenv.playwright.PlaywrightJSEnv(
84-
browserName = "chrome",
80+
jsEnv := new jsenv.playwright.PlaywrightJSEnv.chrome(
8581
launchOptions = List(
8682
"--disable-extensions",
8783
"--disable-web-security",
@@ -95,18 +91,18 @@ jsEnv := new jsenv.playwright.PlaywrightJSEnv(
9591

9692
### Firefox
9793
```scala
98-
jsEnv := new jsenv.playwright.PlaywrightJSEnv(
99-
browserName = "firefox",
100-
launchOptions = List(
101-
"--disable-web-security"
94+
jsEnv := new jsenv.playwright.PlaywrightJSEnv.firefox(
95+
firefoxUserPrefs = Map(
96+
"security.mixed_content.block_active_content" -> false,
97+
"security.mixed_content.upgrade_display_content" -> false,
98+
"security.file_uri.strict_origin_policy" -> false
10299
)
103100
)
104101
```
105102

106103
### Webkit
107104
```scala
108-
jsEnv := new jsenv.playwright.PlaywrightJSEnv(
109-
browserName = "webkit",
105+
jsEnv := new jsenv.playwright.PlaywrightJSEnv.webkit(
110106
launchOptions = List(
111107
"--disable-extensions",
112108
"--disable-web-security",
@@ -124,17 +120,9 @@ As a workaround introducing delay in the test cases may help to keep the browser
124120
## Debugging
125121
debug parameter can be passed to the PlaywrightJSEnv constructor to enable debugging. It will also display the version of the browser which is used.
126122
```scala
127-
Test / jsEnv := new PlaywrightJSEnv(
128-
browserName = "chrome",
123+
Test / jsEnv := new PlaywrightJSEnv.chrome(
129124
headless = true,
130125
showLogs = true,
131126
debug = true
132127
)
133128
```
134-
135-
## Wiki
136-
Watch this space for more details on how to use this library.
137-
138-
## References
139-
* Sample project using this JSEnv: https://github.com/thijsbroersen/scalajs-sbt-vite-laminar-chartjs-example
140-
* Fork of Laminar: https://github.com/thijsbroersen/Laminar

0 commit comments

Comments
 (0)