Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Profile Choice Functionality To The Module #47

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@ customLaunchers: {
}
}
```
### Starting a specific FF profile by its name

When adding "customProfile" to the "customLauncher" Firefox will launch said profile. The profiles list is shown when you execute "firefox.exe -p".
Example:

```js
browsers: ['FirefoxWithMyExtension'],

customLaunchers: {
FirefoxWithMyExtension: {
base: 'Firefox',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use consistent indentation of two spaces

customProfile: 'Karma',
extensions: [
path.resolve(__dirname, '../[email protected]'),
]
}
}
```

This will upload the "karma" firefox i've setup beforehand using "firefox.exe -p", in it, my configs, such as imported certs.

**Please note**: the extension name must exactly match the 'id' of the extension. You can discover the 'id' of your
extension by extracting the .xpi (i.e. `unzip XXX.xpi`) and opening the install.RDF file with a text editor, then look
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ var FirefoxBrowser = function(id, baseBrowserDecorator, args, logger) {
var command = this._getCommand();
var profilePath = args.profile || self._tempDir;
var flags = args.flags || [];
var customProfile = args.customProfile || '';
var extensionsDir;

if (Array.isArray(args.extensions)) {
Expand All @@ -95,7 +96,7 @@ var FirefoxBrowser = function(id, baseBrowserDecorator, args, logger) {
fs.writeFileSync(profilePath + '/prefs.js', this._getPrefs(args.prefs));
self._execCommand(
command,
[url, '-profile', profilePath, '-no-remote'].concat(flags)
[url, (customProfile !== '') ? ' -p ' + customProfile : '-profile ' + profilePath + ' -no-remote'].concat(flags)
);
};
};
Expand Down