Udhav Sarvaiya
Udhav Sarvaiya

Reputation: 10061

How to disable built-in PDF viewer in chromedriver?

Download should start when I click on the PDF download link but currently, pdf is open in a new tab and there is a download option enter image description here

currently my config:

$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"]
];

My ChromeDriver Version 114.0.5735.90

As shown in the attached picture, when I click on the Open button download starts but I need the download automatically when I click on the PDF link and this attached picture should not appear

Upvotes: 0

Views: 531

Answers (0)

Related Questions