提问人:Udhav Sarvaiya 提问时间:8/5/2023 更新时间:8/5/2023 访问量:99
如何在chromedriver中禁用内置PDF查看器?
How to disable built-in PDF viewer in chromedriver?
问:
当我单击 PDF 下载链接时,下载应该开始,但目前,pdf 在新选项卡中打开并且有一个下载选项
目前我的配置:
$chromeOption->addArguments([
"--disable-gpu"
]);
$prefs = [
"download.default_directory" => 'I set the download path here',
"savefile.default_directory" => 'I set the download path here',
"download.prompt_for_download" => false,
"download.directory_upgrade" => true,
"download.always_open_pdf_externally"=> true,
"plugins.always_open_pdf_externally" => true,
"savefile.type"=> 1,
"plugins.plugins_disabled" => ["Chrome PDF Viewer"]
];
我的 ChromeDriver 版本 114.0.5735.90
如附图所示,当我单击“打开”按钮时,下载开始,但是当我单击PDF链接时,我需要自动下载,并且此附加的图片不应出现
答: 暂无答案
评论
"pdfjs.disabled" => true
"pdfjs.disabled" => true