firestone
A collection of Firefox automation and programmatic management scripts in Ruby
Platforms
Profile and Addon management works on Windows, Linux and Mac OSX. The Installer is only implemented for OSX at this time.
Installation
Add this line to your application's Gemfile:
gem 'firestone', :require => 'firefox'
And then execute:
$ bundle
Or install it yourself as:
$ gem install firestone
Usage
Install Firefox from a ruby script
require 'firefox'
Firefox.install!
or
require 'firefox'
installer = Firefox::Installer.new(:osx)
installer.install!
This currently only works on OSX.
Manage Firefox profiles
Profile Creation:
require 'firefox'
p = Firefox::Profile.create('./newprofile')
p.prefs = {
'browser.rights.3.shown' => true,
'browser.shell.checkDefaultBrowser' => false,
'toolkit.telemetry.prompted' => 2,
'toolkit.telemetry.rejected' => true
}
p.save!
This will create a new firefox profile in ./newprofile
. It will populate the new profile's preferences with the values provided.
If the given folder does not exist it will create it.
Profile Deletion:
require 'firefox'
Firefox::Profile.destroy('./newprofile')
# returns true if profile found and deleted, otherwise returns fase
This will delete all profile data and de-register the profile. This is a non-reversible, destructive operation
Suggestions, comments, bugs, whatever
Feel free to use Issues to submit bugs, suggestions or feature requests.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request