Method: Playwright::BrowserType#launch
- Defined in:
- lib/playwright_api/browser_type.rb
#launch(args: nil, channel: nil, chromiumSandbox: nil, devtools: nil, downloadsPath: nil, env: nil, executablePath: nil, firefoxUserPrefs: nil, handleSIGHUP: nil, handleSIGINT: nil, handleSIGTERM: nil, headless: nil, ignoreDefaultArgs: nil, proxy: nil, slowMo: nil, timeout: nil, tracesDir: nil, &block) ⇒ Object
Returns the browser instance.
Usage
You can use ‘ignoreDefaultArgs` to filter out `–mute-audio` from default arguments:
“‘python sync browser = playwright.chromium.launch( # or “firefox” or “webkit”.
ignore_default_args=["--mute-audio"]
) “‘
> Chromium-only Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works best with the version of Chromium it is bundled with. There is no guarantee it will work with any other version. Use ‘executablePath` option with extreme caution.
>
> If Google Chrome (rather than Chromium) is preferred, a [Chrome Canary](www.google.com/chrome/browser/canary.html) or [Dev Channel](www.chromium.org/getting-involved/dev-channel) build is suggested.
>
> Stock browsers like Google Chrome and Microsoft Edge are suitable for tests that require proprietary media codecs for video playback. See [this article](www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for other differences between Chromium and Chrome. [This article](chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/playwright_api/browser_type.rb', line 89 def launch( args: nil, channel: nil, chromiumSandbox: nil, devtools: nil, downloadsPath: nil, env: nil, executablePath: nil, firefoxUserPrefs: nil, handleSIGHUP: nil, handleSIGINT: nil, handleSIGTERM: nil, headless: nil, ignoreDefaultArgs: nil, proxy: nil, slowMo: nil, timeout: nil, tracesDir: nil, &block) wrap_impl(@impl.launch(args: unwrap_impl(args), channel: unwrap_impl(channel), chromiumSandbox: unwrap_impl(chromiumSandbox), devtools: unwrap_impl(devtools), downloadsPath: unwrap_impl(downloadsPath), env: unwrap_impl(env), executablePath: unwrap_impl(executablePath), firefoxUserPrefs: unwrap_impl(firefoxUserPrefs), handleSIGHUP: unwrap_impl(handleSIGHUP), handleSIGINT: unwrap_impl(handleSIGINT), handleSIGTERM: unwrap_impl(handleSIGTERM), headless: unwrap_impl(headless), ignoreDefaultArgs: unwrap_impl(ignoreDefaultArgs), proxy: unwrap_impl(proxy), slowMo: unwrap_impl(slowMo), timeout: unwrap_impl(timeout), tracesDir: unwrap_impl(tracesDir), &wrap_block_call(block))) end |