-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
It seems that the method set_boolean_preference doesn't get the job done since the pdf viewer is still active.
If i change 'pdfjs.disabled' through 'about:config' in the Firefox controlled by Selenium, it works fine.
This is the code i'm working with:
#!/bin/perl
use warnings;
use strict;
use Selenium::Firefox;
use Selenium::Firefox::Profile;
my $profile = Selenium::Firefox::Profile->new();
$profile->set_preference(
"browser.download.folderList" => 2,
"browser.download.dir" => "/home/",
"browser.helperApps.neverAsk.saveToDisk" => "application/pdf",
);
$profile->set_boolean_preference(
"pdfjs.disabled" => 1 # <---------- doesnt seem to work
);
my $driver = Selenium::Firefox->new( firefox_profile => $profile ) or die $!;
print $profile->get_preference("pdfjs.disabled")."\n";
eval
{
$driver->get("https://www.orimi.com/pdf-test.pdf");
};
sleep 5;
if ($@)
{
print "$@\n";
}
$driver->shutdown_binary;
Maybe i'm missing something but as far as i can tell, it should work.
Thanks in advance !
Metadata
Metadata
Assignees
Labels
No labels