Skip to content

Commit 912a5e5

Browse files
author
DGuerra
committed
Added possibility to set RDF file
1 parent 1a8d108 commit 912a5e5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/Firefox/FirefoxProfile.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ class FirefoxProfile {
3333
*/
3434
private $extensions = array();
3535

36+
/**
37+
* @var string
38+
*/
39+
private $rdfFile;
40+
3641
/**
3742
* @param string $extension The path to the xpi extension.
3843
* @return FirefoxProfile
@@ -42,6 +47,19 @@ public function addExtension($extension) {
4247
return $this;
4348
}
4449

50+
/**
51+
* @param string $rdfFile The path to the rdf file
52+
* @return FirefoxProfile
53+
*/
54+
public function setRdfFile($rdfFile) {
55+
if(!is_file($rdfFile)) {
56+
return;
57+
}
58+
59+
$this->rdfFile = $rdfFile;
60+
return $this;
61+
}
62+
4563
/**
4664
* @param string $key
4765
* @param string|bool|int $value
@@ -69,6 +87,10 @@ public function setPreference($key, $value) {
6987
public function encode() {
7088
$temp_dir = $this->createTempDirectory('WebDriverFirefoxProfile');
7189

90+
if(isset($this->rdfFile)) {
91+
copy($this->rdfFile, $temp_dir . DIRECTORY_SEPARATOR . "mimeTypes.rdf");
92+
}
93+
7294
foreach ($this->extensions as $extension) {
7395
$this->installExtension($extension, $temp_dir);
7496
}

0 commit comments

Comments
 (0)