Git Product home page Git Product logo

firefox-profile-js's People

Contributors

cadorn avatar dependabot[bot] avatar erikvold avatar esrefdurna avatar foxhind avatar fregante avatar generalov avatar gusted avatar happylynx avatar hbenl avatar jochen-testingbot avatar jsantell avatar lutostag avatar marcbachmann avatar pdehaan avatar photonios avatar rpl avatar saadtazi avatar tamil777selvan avatar willdurand avatar zglagola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

firefox-profile-js's Issues

Implement ProfilesIni() similar to Selenium Java Library

Hi, It would be great firefox-profile-js for implement ProfilesIni to get the directory of profiles based on name from default firefox profiles path (example: C:\Users\User\AppData\Roaming\Mozilla\Firefox\profiles.ini)

Use cases: Tweak few testing profiles while on manual testing and use it on automated testing.

Selenium Java example

// Choose the browser, version, and platform to test
DesiredCapabilities capabilities = DesiredCapabilities.firefox();

capabilities.setCapability("platform", Platform.XP);
FirefoxProfile profile = new ProfilesIni().getProfile("UsernameProfiles");      
//profile.setPreference("browser.cache.disk.enable", false);  

capabilities.setCapability(FirefoxDriver.PROFILE, profile);

this.driver = new RemoteWebDriver(
            new URL("http://localhost:4444/wd/hub"),
            capabilities);

Your connection is not secure

profile.setAssumeUntrustedCertIssuer(false);
profile.setAcceptUntrustedCerts(true);

Even after setting these options, I get the following error:

Your connection is not secure

The owner has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website.

Update adm-zip to secure version

Downstream projects from this one are receiving security vulnerability notifications from GitHub: Known high severity security vulnerability detected in adm-zip < 0.4.11 defined

It looks like this project already has "adm-zip": "~0.4.x" in the package.json so a fresh npm install and release to npm should fix this?

Error importing firefox profile

Hi,

I'm automating some tests that require a base64 firefoxProfile to be imported (see mozilla/geckodriver#755). I've used the CLI to create it, like this:

node_modules/.bin/firefox-profile -c firefoxProfile -b

However when running the tests the following Error is thrown:
ERROR: Last unit does not have enough valid bits

I'm running selenium-standalone both in node and hub, more info:

Versions: Selenium standalone : 3.4.0
Geckodriver : 0.16.1
Firefox (Windows) : 53.0.3

I'm importing the profile in the config of webdriver.io:

  maxInstances: 5,
  browserName: 'firefox',
  marionette: true,
  acceptInsecureCerts: true,
  log: {
    level: 'trace'
  },
  'moz:firefoxOptions': {
    profile: 'profileBase64'
  }
};

I've generated the firefoxProfile forlder following the steps specified in:
https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles#w_creating-a-profile

I'm running selenium-standalone hub on Mac OS X 10.11 and the node on Windows10, I've tried to create the profile on both systems and run the tests on the same machine that is running the hub.

the config is imported, since I get the following on the node log:

09:45:31.206 INFO - Creating a new session for Capabilities [{rotatable=true, marionette=true, log={level=trace}, acceptInsecureCerts=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@6448c9d7, locationContextEnabled=true, browserName=firefox, javascriptEnabled=true, handlesAlerts=true, moz:firefoxOptions={profile=profileBase64}, maxInstances=5, requestOrigins={name=webdriverio, version=4.6.2, url=http://webdriver.io}}]

Not sure what I' doing wrong should I be passing any other option when running the CLI on terminal?

Thanks.

NPM checksum error

When trying to install via NPM I get this error:

npm ERR! Error: shasum check failed for /tmp/npm-25686/1388231893389-0.8770524868741632/tmp.tgz
npm ERR! Expected: 0f7f8d6b5bcf9ead36d10634e6a77a51bb3bdf88
npm ERR! Actual: 7d216a4edad3dc75cd912061d0a13c1ac91c3799
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/sha.js:29:20
npm ERR! at ReadStream. (/usr/local/lib/node_modules/npm/lib/utils/sha.js:49:5)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:883:14
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:

setProxy() does not work on Firefox 27.0.1

Attempt to set a proxy using following syntax

myProfile.setProxy({proxyType: 'manual', httpProxy: '127.0.0.1:8080'});

does not work for latest Firefox 27.0.1. The reason for this is that Firefox expects an integer value for network.proxy.http_port and in your code you try to set it to string value:

this.setPreference('network.proxy.' + key + '_port', hostDetails[1]);

The easiest fix is to convert string to integer using parseInt function:

this.setPreference('network.proxy.' + key + '_port', parseInt(hostDetails[1], 10));

Pull request will follow soon.

Error: profile.getTemplateDir is not a function when set firefox profile in Protractor

I try to use this code with directConnect: true:

var makeFirefoxProfile = function (preferenceMap) {
  var deferred = q.defer();
  var firefoxProfile = new FirefoxProfile();

  for (var key in preferenceMap) {
    firefoxProfile.setPreference(key, preferenceMap[key]);
  }

  firefoxProfile.encoded(function (encodedProfile) {
    var capabilities = {
      browserName: "firefox",
      firefox_profile: encodedProfile
    };

    deferred.resolve(capabilities);
  });
  return deferred.promise;
};

  getMultiCapabilities: function () {
    return q.all([
      makeFirefoxProfile(
        {
          "browser.download.folderList": 2,
          "browser.download.dir": "D:/Automation",
          "browser.helperApps.alwaysAsk.force": false
        }
      )
    ]);
  },

But it show error when start server:

Error: TypeError: profile.getTemplateDir is not a function

at createGeckoDriver (node_modules\protractor\node_modules\selenium-webdriver\firefox\index.js:479:17)
at Function.createSession (node_modules\protractor\node_modules\selenium-webdriver\firefox\index.js:631:14)

I have wonder that profile = caps.get(Capability.PROFILE) return string, and getTemplateDir() {return this.template_;} is function in class Profile at node_modules\protractor\node_modules\selenium-webdriver\firefox\index.js
I don't know how to fix it.
More info:

  • Gecko driver: 0.14
  • Firefox-profile: 0.48
  • Selenium-webdriver: 3.0.1
  • Protractor: 5.1.1
  • Firefox version: 51

fs-extra doesn't seem to be exporting an rmSync method as native nodejs fs module does

While running web-ext unit tests locally I did notice the following error being logged when mocha did run all tests and it is exiting:

[firefox-profile] cannot delete profileDir on exit /tmp/firefox-profile2Tntmz/ TypeError: fs.rmSync is not a function
    at FirefoxProfile._cleanOnExit (/.../web-ext/node_modules/firefox-profile/lib/firefox_profile.js:288:10)
    at process.FirefoxProfile.onExit (/.../web-ext/node_modules/firefox-profile/lib/firefox_profile.js:170:12)
    at process.emit (events.js:326:22)
    at process.EventEmitter.emit (domain.js:483:12)
    at process.emit (/.../web-ext/node_modules/addons-linter/node_modules/source-map-support/source-map-support.js:516:21)
    at process.emit (/.../web-ext/node_modules/source-map-support/source-map-support.js:516:21)
    at process.topLevelDomainCallback (domain.js:138:15)
    at process.callbackTrampoline (internal/async_hooks.js:124:14)

As the stack trace shows the error seems to be related to the changes introduced in #126 and released on npm as part of [email protected].

Based on a very quick look I think that the exception is actually expected, because fs is actually set to the "fs-extra" here:

and rmSync doesn't seem to be part of the API exposed by "fs-extra" npm package (where it seems that only removeSync is actually available), unlike the native nodejs "fs" module which does actually have an rmSync method with that signature.

Looking more closely to the fs-extra removeSync function (which was also what that method used to call before #126), it seems that it should be already calling fs.rmSync internally on nodejs version where it is actually available:

And so it seems that rolling back to the previous implementation (the one already being calling fs-extra removeSync) may be actually a reasonable fix for this issue and should still remove that directory as the new version was meant to ensure.

Uncaught Error: amdefine with no module ID cannot be called more than once per file.

On node 0.10.25
Using firefox-profile version 0.2.7

var FirefoxProfile = require('firefox-profile')
        var profile = new FirefoxProfile()
        profile.setPreference('network.http.prompt-temp-redirect', false)
        profile.setPreference('app.update.silent', true)
        profile.encoded(function(profile) {
            var capabilities = Webdriver.Capabilities.firefox()
            capabilities['firefox_profile'] = profile
            var browser = new Webdriver.Builder()
                .usingServer(server.address())
                .withCapabilities(capabilities)
                .build()
            callback(browser)
        })

The error is on the instantiation of FirefoxProfile. Any idea what is going on?

Here's a gist of what I get from terminal: https://gist.github.com/lloydwatkin/9931047

Fail to set the firefox profile

Tried to show the default homepage on firefox.
But it didn't show the home page and it seems the options is not set. Any idea?

Env:
FIREFOX_VERSION=55.0.3
GECKODRIVER_VERSION=0.18.0
selenium 3.5.3-astatine
using this docker image https://hub.docker.com/r/selenium/node-firefox/

import wd from 'wd';
import FirefoxProfile from 'firefox-profile';

const serverConfig = {
  host: 'localhost',
  port: 7101,
};

const capabilities = {
  browserName: 'firefox',
  platform: 'ANY',
  version: ''
};

const fp = new FirefoxProfile();
fp.setPreference('browser.startup.homepage', 'http://google.com');
fp.updatePreferences();

fp.encoded((err, zippedProfile) => {
    if (err) {
        console.error('oops, an error occured:', err);
        return;
    }
    capabilities.firefox_profile = zippedProfile;
    const driver = wd.promiseChainRemote(serverConfig);
    driver.init(capabilities);
});

Bad profile.zip created?

Hi,

I'm on Mac os, I've tried recreating the example from the readme, there are no errors, and the browser starts, but the proxy settings I tried to add didn't catch (when I open the network settings they're set to system proxy instead of the one I tried to set.

I've looked in the temp directory and found a bunch of directories with files called profile.zip (sized 22 bytes).

Any advice for me? This is the code I'm using:

var fp = new FirefoxProfile();
fp.encoded(function(encodedProfile)
{
    browserCapabilities.set('firefox_profile', encodedProfile);

    // you can set firefox preferences
    fp.setPreference('browser.newtab.url', 'about:blank');
    fp.setPreference('browser.tabs.drawInTitlebar', false);
    fp.setPreference('browser.urlbar.trimURLs', false);

    fp.setPreference("network.proxy.type", 1);
    fp.setPreference("network.proxy.http", proxyServer);
    fp.setPreference("network.proxy.http_port", o.proxy.port);

    fp.updatePreferences();
    var driver = new webdriver.Builder().
       usingServer(serverAddress).
       withCapabilities(browserCapabilities).build();
});

Fails to parse Firebug's install.rdf

    var description = doc[rdf + ':RDF'][rdf + ':Description'];
                                       ^
TypeError: Cannot read property 'xmlns:Description' of undefined

It is failing because Firebug's install RDF does not namespace RDF or Description nodes.

Cannot set browser.download.dir

I am unable to set the browser.download.dir preference. I'm not sure if this is a Firefox issue or not.

If I call setPreference("browser.download.dir", "C:\Temp"), the download directory gets set to C:Temp. It strips out the backslashes no matter what I do and ends up using the default downloads directory.

Mozilla Iceweasel 31.0 isn't using profile from firefox-profile

For headless e2e testing, I am using Debian's Firefox fork called iceweasel. firefox-profile doesn't seem to effect iceweasel at all. I am using this pluging to click on a download link an download automatically with settings in profile. It works on a Mac Firefox, but not debian. Any suggestions, please?

root@jenkins-agent-nodejs-001:~# firefox --version
Mozilla Iceweasel 31.0

selenium-webdriver for Firefox wants to encode profile object which is encoded

Hi.... thanks for creating firefox-profile. It's been helpful. I ran into one issue that I figured I'd let you and your users know about. Maybe I'm just doing something wrong, but when I pass the "capabilities" object into selenium-webdriver, /selenium-webdriver/firefox/index.js eventually attempts to encode your module's profile object, which is already encoded before being passed in.

I'm using selenium-webdriver v3.0.0-beta-2

On line 486 of the firefox/index.js file, there is this set:
caps.set(Capability.PROFILE, profile.encode());

Your profile object doesn't have an encode() function, so an error is thrown. In your examples, you have us call .encoded() on the profile and then set the encoded object that we get back in the callback as the 'firefox_profile' of the capabilities object. It's already encoded by the time selenium's code tries to encode it with a function that doesn't exist on your object.

To get around this, I had to patch line 486 in the selenium driver file to:
caps.set(Capability.PROFILE, profile);

Obviously, that's a bad workaround since it breaks updates of selenium and I guess violates their idea of what functions a profile object should have. It would probably be much better if you added a synchronous function called "encode()" that does exactly what "encoded()" does asynchronously. If a synchronous function would be bad for some reason (sorry, I haven't read all of your code) maybe you could hack it with "encoded()" setting a flag on the object, and "encode()" just returning the profile object itself if the flag is set?

Thanks again for your work, and if there is some option I don't know about to get around this issue correctly, I'd appreciate hearing about it.

Best,
Dan

Temporary files not deleted even when using "shouldDeleteOnExit(true)"

I see that when running firefox using protractor, several directories with the name pattern /tmp/tmp-<random> are created in addition to the profile directory (which is returned by FirefoxDriver.prototype.path).

When using shouldDeleteOnExit(true) to create the profile, I see that the profile directory gets deleted. However the tmp-* files do not get cleaned up. I think that should also get deleted when this flag is enabled.

Support WebExtensions

Hello Saad! I have issue loading an extension built with the new WebExtensions format

STR

    fxaProfile.addExtension(__dirname + '/../node_modules/fxa-dev-extension/dist/fxa-dev.xpi', function() {
      fxaProfile.encoded(cb);
    })

Expected

Should load the extension

Actual


Error: Cannot find module '/var/folders/_z/8gy7l13n7yx4mdtmz4_xz_j00000gn/T/b3340956-4d68-4847-9558-6241120cd320fxa-dev.xpi/package.json'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at FirefoxProfile._addonDetails (/Users/vladikoff/mozilla/fxa-local-dev/node_modules/firefox-profile/lib/firefox_profile.js:633:20)
    at FirefoxProfile._installExtension (/Users/vladikoff/mozilla/fxa-local-dev/node_modules/firefox-profile/lib/firefox_profile.js:549:8)
    at FirefoxProfile.addExtension (/Users/vladikoff/mozilla/fxa-local-dev/node_modules/firefox-profile/lib/firefox_profile.js:319:8)
    at module.exports (/Users/vladikoff/mozilla/fxa-local-dev/_scripts/profile.js:109:16)
    at /Users/vladikoff/mozilla/fxa-local-dev/_scripts/start.js:36:5
    at started (/Users/vladikoff/mozilla/fxa-local-dev/node_modules/selenium-standalone/lib/start.js:81:7)

Details

This code here looks for package.json:

https://github.com/saadtazi/firefox-profile-js/blob/master/lib/firefox_profile.js#L633

AFAIK package.json is not used anymore

  // Attempt to parse the `install.rdf` inside the extension
  var doc;
  try {
    doc = fs.readFileSync(path.join(addonPath, 'install.rdf'));
  }
  // If not found, this is probably a jetpack style addon, so parse
  // the `package.json` file for addon details
  catch (e) {
    var manifest = require(path.join(addonPath, 'package.json'));
    // Jetpack addons are packed by default
    details.unpack = false;
    details.isNative = true;
    Object.keys(details).forEach(function (prop) {
      if (manifest[prop] !== undefined) {
        details[prop] = manifest[prop];
      }
    });

    cb && cb(details);
    return;
  }

I don't have time to investigate this further, but I might in a few days.

Usage with Protractor

This library can actually be used together with Protractor (which uses selenium-webdriver). And since I did not find out how to use the functionality from selenium-webdriver to achieve the same result, I would say it is easier.

I made an example of using it with Protractor in this issue.
The important part is to set the encoded profile on .moz:firefoxOptions.profile instead of on .firefox_profile.

Generates invalid zip file

When passing the encoded profile to Selenium, I am receiving the error UnknownError: oversubscribed dynamic bit lengths tree. This appears to be a problem with with adm-zip module.

Thunderbird options?

Hi, I'm thinking about porting this to work with Thunderbird as well, as it'd aid some extension development I'm doing.

Is this something you'd be interested in including in this repository? If not, I'll happily fork this into a separate project.

Setting environment variables?

Hi,

Is there a way to set an environment variable for the firefox process? Please see this question for details.

I want to pass the DISPLAY environment variable like in the linked question.

Is that in the scope of this plugin? Technically possible?

Thanks!

fp.updatePreferences() has to be called explicitly even if setPreference() is called before encoded()

seems to be related with firefox version: a travis build on the same git hash passed when ff version was < 30 (~2 months ago), now (the test uses saucelabs latest version of ff).

    fp.setPreference('extensions.firebug.defaultPanelName', 'console');
    fp.setPreference('saadt.coucou', 'console');
    // if the following line is not there, the preferences are not in about:config after the browser starts
    // fp.updatePreferences();
    // you can install multiple extensions at the same time
    fp.addExtensions(['./test/extensions/firebug-2.0.1-fx.xpi'], function() {
        fp.encoded(function(zippedProfile) {

setPreference() is not applied.

When I try to apply a user pref, the preference end up in the user.js file, but is not applied. Where is an example (similar code with python selenium works well):

var webdriver = require('selenium-webdriver');
var fp = require('./spec/test/utils/firefox_profile');
var f = new fp();
f.addExtension('./spec/extensions/firefox/test-autoupdate.xpi', function() {
    // create and add profile to capa
    f.setPreference('browser.newtab.url', 'http://www.google.com');
    f.updatePreferences();
    var capa = webdriver.Capabilities.firefox();
    //capa.set('firefox_profile', f.encoded());
    var wd = new webdriver.Builder().
              withCapabilities(capa).
              build();
    wd.get('http://saadtazi.com');
});

jetpack-id usage

I noticed that jetpack-id is deprecated, can this be replaced with something else? It's getID below:

this._addonDetails(addon, function (addonDetails) {
var addonId = getID(addonDetails);
var unpack = addonDetails.unpack === undefined ? true : addonDetails.unpack;
if (!addonId) {
cb(new Error('FirefoxProfile: the addon id could not be found!'));
}

If it's still the only/correct way to do it, should jetpack-id be un-deprecated? It looks to me that it still makes sense for WebExtensions https://github.com/mozilla-jetpack/jetpack-id/blob/master/index.js

cc @rpl because he mentioned it in mozilla/web-ext#2047 (comment)

No error-handling required?

Very curious to see if you know why no error-handling would be required here:

  let driverPromise = new Promise(function(resolve){

    var capabilities = webdriver.Capabilities.firefox();

    fp.encoded(function(encodedProfile) {
      capabilities.set('firefox_profile', encodedProfile);

      var wd = new webdriver.Builder().
      withCapabilities(capabilities).
      build();

      resolve(wd);
    });

  });

surely an error could be raised somewhere here, how could I handle it?

The reason I bring the issue up here, is so that your Readme could be updated accordingly (or examples, whatever).

thanks!

Empty profile creation doesn't behave as expected

./node_modules/.bin/firefox-profile -v   -o `pwd`/A

I claim:

  • should create a profile at A, with the default user.js

Why this doesn't? cli.js does this instead

  cb(null, new FirefoxProfile({
    destinationDirectory: destinationDirectory
  }));

Which never actually makes any files, unless it is copying from an existing profile.

Ideas for solving this welcome :)

Use case: I need blank, portable profiles for re-using during test-runs of addons.

Getting an error - getTemplateDir() is not a function

I have this:

   fp.encoded(function (encodedProfile) {
      capabilities.set('firefox_profile', encodedProfile);
      var wd = new webdriver.Builder().withCapabilities(capabilities).build();  /// errors here
      resolve(wd);
    });

I get an error:

 TypeError: profile.getTemplateDir is not a function
       at createGeckoDriver (/Users/alexamil/WebstormProjects/cisco/cdt-now/node_modules/selenium-webdriver/firefox/index.js:506:17)
       at Function.createSession (/Users/alexamil/WebstormProjects/cisco/cdt-now/node_modules/selenium-webdriver/firefox/index.js:658:14)
       at createDriver (/Users/alexamil/WebstormProjects/cisco/cdt-now/node_modules/selenium-webdriver/index.js:167:33)
       at /Users/alexamil/WebstormProjects/cisco/cdt-now/test/e2e/all/export.test.js:40:71

here is the broader context if it helps:

  const {By, until, promise} = webdriver;
  promise.USE_PROMISE_MANAGER = true;

  let fp = new FirefoxProfile();
  fp.setPreference('browser.download.folderList', 2);
  fp.setPreference('browser.download.manager.showWhenStarting', false);
  fp.setPreference('browser.download.dir', process.env.HOME + '/cdt_test_data_dir');
  fp.setPreference('browser.helperApps.neverAsk.saveToDisk', 'application/x-gzip');
  fp.updatePreferences();

  let driverPromise = new Promise(function (resolve) {

    let capabilities = webdriver.Capabilities.firefox();
    fp.encoded(function (encodedProfile) {
      capabilities.set('firefox_profile', encodedProfile);
      let wd = new webdriver.Builder().withCapabilities(capabilities).build();
      resolve(wd);
    });
    
  });

profile.encode not a function

I have firefox installed on ubuntu, and I get the following error,

TypeError: profile.encode is not a function
    at Driver (/usr/src/app/selenium_wd_tests/node_modules/selenium-webdriver/firefox/index.js:486:46)
    at Builder.build (/usr/src/app/selenium_wd_tests/node_modules/selenium-webdriver/index.js:549:16)
    at /usr/src/app/selenium_wd_tests/basic.js:30:23
    at /usr/src/app/selenium_wd_tests/node_modules/firefox-profile/lib/firefox_profile.js:427:7
    at /usr/src/app/selenium_wd_tests/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)

Simple test case below

 /******************************************************************
     * with selenium webdriverJs
     * installs firebug 
     * and make http://saadtazi.com the url that is opened on new tabs
    /******************************************************************/
    var webdriver = require('selenium-webdriver');

    // create profile 
    var FirefoxProfile = require('firefox-profile');
    var myProfile = new FirefoxProfile();

    // you can add an extension by specifying the path to the xpi file  
    // or to the unzipped extension directory 
   // myProfile.addExtension('test/extensions/firebug-1.12.4-fx.xpi', function() {

        var capabilities = webdriver.Capabilities.firefox();

        // you can set firefox preferences BEFORE calling encoded() 
        myProfile.setPreference('browser.newtab.url', 'http://saadtazi.com');

        // attach your newly created profile 

        myProfile.encoded(function(encodedProfile) {
            capabilities.set('firefox_profile', encodedProfile);


            // start the browser 
            var wd = new webdriver.Builder().
                      withCapabilities(capabilities).
                      build();

            // woot! 
            wd.get('http://en.wikipedia.org');
        });
   // });

Add a command line tool

It would be nice if I were able to create a fx profile like so with terminal firefox-profile ./temp/

Did you experience quirk when cloning profile?

I just discovered this repo and am going to dig into it, but before I did I wanted to mention/ask something.

In the past year I worked on a clone profile method.

What I did was:

  1. I copy the profile folder, and paste it with a new name in the firefox profiles folder: "C:\Users\Vayeate\AppData\Roaming\Mozilla\Firefox\Profiles\new name here", I do this regardless ofIsRelativ=1`, meaning even if it was absolute path, the clone profile, is a relative.
  2. I duplicate the entry in profiles.ini and set IsRelative to =1.

Then on startup of this clone profile, sometimes it starts as if its a brand new fresh profile. It should respect and be same as that old profile. Did you witness this?

Add user prefs support in CLI

thoughts

I can see 2.333... options, one that allows to specify a file path, one that allows to specify userprefs directly in command line:

  1. --userprefs path/to/json/file: adds an extra step for the user (create a file)
  2. (2.1)--userprefs:key value. Note that the key and the value could contain a space if you use quotes: --'useprefs:a key with a space' 'a value with spaces'
  3. (2.2)--userprefs key:value: the key cannot contain a : (or any separator that we might choose) because we would have to split on the first :. Note that --userprefs could be used multiple times.
  4. (2.3) any param that we don't know about. Spaces in key or value are supported if you use quotes: `--userprefs 'a key with space:a value with space'. It might lead to errors if we add more params

We can implement 1 and 2.1 at the same time.

Install temporary addon

Firefox only allows signed addons to be installed permanently so I wonder if there's any way for this module to install addons. The source mentions possible installs from a directory (not just an xpi) but I think it only works for Firefox Developer

if (addon.slice(-4) === '.xpi') {

// or to the unzipped extension directory

web-ext seems to be installing the extension after opening the browser:

https://github.com/mozilla/web-ext/blob/8bd0d13f425bbaed6cfc2f8127883c5c43010f1d/src/firefox/remote.js#L139-L143

Is there any other way for unsigned/local/unpacked addons?

Why overriding browser.link.open_newwindow?

'browser.link.open_newwindow': '2',

Changes the behavior of target="_blank" links. This is problematic for two reasons:

If there's a good reason to change default behavior like that, it'd be good to state why in a comment at least? :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.