Skip to content

Commit

Permalink
chore: new stable options
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Oct 1, 2024
1 parent 332b528 commit 41f39bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

*
* New stable options

### Fixed

Expand Down
10 changes: 9 additions & 1 deletion src/weby_pilot/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@

class WebyOptions:
headless: bool = False
stable: bool = True

def __init__(self, headless: bool = False):
def __init__(self, headless: bool = False, stable: bool = True):
self.headless = headless
self.stable = stable


class WebyAPI:
Expand All @@ -46,6 +48,12 @@ def start(self, options: WebyOptions = WebyOptions()):
chrome_options = ChromeOptions()
if options.headless:
chrome_options.arguments.append("--headless=new")
if options.stable:
chrome_options.arguments.append("--no-sandbox")
chrome_options.arguments.append("--disable-dev-shm-usage")
chrome_options.arguments.append("--disable-gpu")
chrome_options.arguments.append("--disable-setuid-sandbox")
chrome_options.arguments.append("--remote-debugging-port=9222")
chrome_options.add_experimental_option(
"prefs",
{
Expand Down

0 comments on commit 41f39bf

Please sign in to comment.