Pass custom parameters to chrome headless - how?



  • Hi, I'm investigation ways to debug the headless chrome process whilst its generating the pdf and I notice you may be able to do it by using the --remote-debugging-port parameter you can pass to chrome.

    I've tried to find the location where I could edit the source code to test this, but I can't find it.

    What would I need to change to test this?

    source: https://stackoverflow.com/questions/46017982/debugging-with-headless-browser



  • Maybe this jsreport config will work

    "extensions": {
      "chrome-pdf": {      
        "launchOptions": {
            "args": ["--remote-debugging-port=9222"]
        }
      }
    }
    

    But I never tried it. I instead debug the result of the HTML recipe.



  • Thanks, yeah I would normally, but I need to see the environment whilst its being run to see what javascript can see, if you know what I mean.

    I've added that to the config, is there a way to log the command line that jsReport runs, so I can see if its having an effect?



  • Thanks, yeah I would normally, but I need to see the environment whilst its being run to see what javascript can see, if you know what I mean.

    I get you to want to get closest as possible. But the setup is likely too complicated and you get almost the same when you open the HTML with normal desktop chrome and do the debug.

    I've added that to the config, is there a way to log the command line that jsReport runs, so I can see if its having an effect?

    It's somewhere here https://github.com/puppeteer/puppeteer, but don't know exactly.
    You better check the running chrome process through the OS tools and check what args it has.



  • hey @jan_blaha - I've actually managed to set this up (I'm pretty shocked I managed it, tbh!). I've got jsReports running on the VM in the datacenter, connected via a VPN and I'm able to step through the javascript on my desktop whilst chrome is being run by puppeteer. Its a reasonably straight forward setup, I'll make a video of the process to set it up if you think it would be of benefit to others?

    Regards

    Steve.



  • Excellent! Yes sure, if you have time, please share a video.





  • Excellent, thank you.

    I linked your video in the docs. I hope you don't mind...
    https://jsreport.net/learn/chrome-pdf#debugging



  • No problem, hope it helps someone else :)


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.