toolium
toolium copied to clipboard
feat: support different browsers at playwright starts
Implements the method to start different browser types with these options.
New options sections can be defined in the properties.cfg:
[PlaywrightBrowserOptions] >> Playwright options for the Browser instance (check here: https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch). ChromeArguments can be defined in the property "args" or in the old section. In this case, ChromeArguments replaces the defined arguments in args. The same with FirefoxArguments. FirefoxPreferences works in the same way but the property used is firefox_user_prefs. ChromeExtensions are added as arguments. Firefox Extensions are not supported in playwright.
[PlaywrightContextOptions] >> Playwright options for the Context instance (check here: https://playwright.dev/python/docs/api/class-browser#browser-new-context)
[PlawrightPageOptions] >> Playwright options for the Page instance (check here: https://playwright.dev/python/docs/api/class-browser#browser-new-page)
It's possible to execute a browser in persistent mode passing the property user_data_dir in PlaywrightContextOptions. In these case, the session will be persisted and used by all the pages. In this case PlawrightBrowserOptions are omitted, only context options are available (check options here: https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch-persistent-context)