Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7993455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:51:20+00:00 2026-06-04T13:51:20+00:00

I develop Firefox extension with bundled executable file which should be run on browser

  • 0

I develop Firefox extension with bundled executable file which should be run on browser startup.

To run process I need get nsIFile or nsILocalFile instance which points to executable file.
I know one solution how to get it using directory service:

var file = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile);
file.append("extensions");
file.append("<extension id>");
file.append("<relative path>");

But this solution has two disadvantages:

  1. It doesn’t work in development mode, when instead of installed extension I have only text file with real extension path

  2. I’m not sure that it will work on all Firefox configurations because of hardcoded “extensions” part of the path

So is there any nicer way to run executable file which comes with Firefox extension?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:51:21+00:00Added an answer on June 4, 2026 at 1:51 pm

    You are making way too many assumptions about the directory structure of the Firefox profile – don’t. The Add-on Manager API lets you get the path of a file inside the extension, you should use it:

    Components.utils.import("resource://gre/modules/AddonManager.jsm");
    
    AddonManager.getAddonByID("<extension id>", function(addon)
    {
      var uri = addon.getResourceURI("<relative path>");
      var file = uri.QueryInterface(Components.interfaces.nsIFileURL).file;
      ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm going to develop a Firefox extension which should put a button in the
I'm going to develop a Firefox extension which uses some Java classes. The extension
I use Firefox as default browser in my computer. I need to develop the
I am trying to develop a firefox plugin, which should be executed, whenever a
I'm trying to develop a firefox extension which draws a toolbar at the base
I am trying to develop a plugin/extension for a browser (Firefox or IE or
I'm going to develop a firefox extension which makes an XMLHttpRequest to this WebService.
I want to develop an firefox-extension using javascript&jQuery which extrats the facebook-privacy settings of
What language(s) do I need to know to develop plugins/extensions for Firefox? Also, any
I develop a firefox extension for configuration printer automatically. I want to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.