<?php
require_once('./vendor/autoload.php');
use Nesk\Puphpeteer\Puppeteer;
use Nesk\Rialto\Data\JsFunction;
$puppeteer=new Puppeteer;
$browser=$puppeteer->launch(['headless=false','args'=>['--no-sandbox','--user-agent='.$user_agent]]);
$page=$browser->newPage();
$page->evaluateOnNewDocument('Object.defineProperty(navigator, "languages", {
get: function() {
return ["de-DE", "de"];
}
});');
$page->goto('https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html');
$content=$page->content();
echo $content;
$browser->close();
"$dir.$file_name"
Ну и возможно нужен полный путь до папки с файлом.