Created
          March 8, 2023 01:40 
        
      - 
      
- 
        Save hendrixroa/4a3d9f3b198cf6543c180bd08b549157 to your computer and use it in GitHub Desktop. 
    Initialize browser headless
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | private async initBrowser() { | |
| const browserArgs: PuppeteerLaunchOptions = { | |
| args: [ | |
| '--no-sandbox', | |
| '--disable-setuid-sandbox', | |
| '--headless', | |
| '--disable-gpu', | |
| '--disable-dev-shm-usage', | |
| '--disable-web-security', | |
| '--disable-infobars', | |
| '--window-position=0,0', | |
| '--ignore-certifcate-errors', | |
| '--ignore-certifcate-errors-spki-list', | |
| ], | |
| }; | |
| this.browser = await Puppeteer.launch(browserArgs); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment