Does the -app command line option work properly in Firefox 4? - firefox

I have written some software that makes use of the -app command line option in Firefox to launch XUL applications in Firefox's embedded copy of XULRunner. This all worked fine in Firefox 3.x, however when I try with Firefox 4, Firefox either crashes or does nothing (depending on if it is on Mac or Windows).
I have tried a number of other command line options and many of them seem to be variously broken. (such as -v to print the version information, which crashes on OSX)
Does anyone know if there are already registered bugs about this? Was the removal of -app intentional or was it an oversight? Is there any way to work around this problem?

The -app is maintained in firefox 4 and should work.
I do not know if there is a bug for windows and mac os, but I'm using it on linux for several apps, and it works well (my firefox version is Mozilla Firefox 4.0.1)

Just wanted to bump this - as on Firefox 7, -app does not seem to be there:
$ uname -s -r
Linux 2.6.38-11-generic
$ firefox --version
Mozilla Firefox 7.0.1
$ firefox --help
Usage: firefox [ options ... ] [URL]
where options include:
X11 options
--display=DISPLAY X display to use
--sync Make X calls synchronous
--g-fatal-warnings Make all warnings fatal
Firefox options
-h or -help Print this message.
-v or -version Print Firefox version.
-P <profile> Start with <profile>.
-migration Start with migration wizard.
-ProfileManager Start with ProfileManager.
-no-remote Open new instance, not a new window in running instance.
-UILocale <locale> Start with <locale> resources as UI Locale.
-safe-mode Disables extensions and themes for this session.
-jsconsole Open the Error console.
-browser Open a browser window.
-new-window <url> Open <url> in a new window.
-new-tab <url> Open <url> in a new tab.
-preferences Open Preferences dialog.
-search <term> Search <term> with your default search engine.
-private Enable private browsing mode.
-private-toggle Toggle private browsing mode.
-setDefaultBrowser Set this app as the default browser.
-g or --debug Start within debugger
-d or --debugger Specify debugger to start with (eg, gdb or valgrind)
-a or --debugger-args Specify arguments for debugger
I too would love to know when and why it was removed, but I simply cannot find any info online (see also Single-file app with xulrunner - possible?) ...
PS: Just filed a bug here: Bug #880596 in firefox (Ubuntu): “Option '-app' missing from Firefox above version 3” - I thought it would be automatically copied to mozilla's bugzilla (seeing bugs like Bug #207454), but unfortunately, it wasn't so... - bugzilla bug needs to be copied and added manually, it's there now...

I also experienced problems using the -app switch. I'm using Firefox 10, but I have an idea this problem goes right back to FF 4.
The firefox binary, when run with the -help option, does not show list the -app option, which caused me much confusion, but I believe its still there.
The problem for me, instead, was to do with this change in Firefox 4, requiring a chrome manifest file in the application root. Since FF 4, only a single (root) chrome manifest is read, so you must create one with the following line, (or lines, if you want to have multiple manifests).
manifest chrome/chrome.manifest
Then launch the application the usual way
firefox -app path/to/application.ini -jsconsole
(For debugging use the -jsconsole option).
Another note, (you didn't mention having tried this, but I did and it was wrong) -- don't use the -no-remote option. I tried this with the intent of starting a new process for my XUL application separate from already running firefox instances. However, the -app option will create a new process for your application even if firefox instances are already running, so there is no need.
See also this question for more info about the chrome manifest issue.

Related

Netbeans Apache 12.2 on macOS Big Sur only runs properly as super user

When running as a normal user, if you click on Netbeans->Preferences the window will open, shake, flash, freeze, and not let you do anything. The same thing happens with the Tools->Plugins. Running as super user it works perfectly. I have cleaned up all NetBeans related files. You can see it in action here.
It's useless as it is.
Ive found a partial workaround for this.
You need to setup the OS not to open new documents as new tab.
Go to the Apple Menu, select System Preferences > General. In the Prefer tabs when opening documents option, select "never".
Then restart Netbeans and try to open Netbeans preferences.
If you don't want a system-wide change, you can set the following setting. It should affect only applications running on JDK, run this in terminal:
defaults write net.java.openjdk.cmd "AppleWindowTabbingMode" never
It turns out that is a problem related to the AppleWindowTabbingMode
settings. I was using "always", since I want that apps like Finder and
other use new tabs rather than new windows.
This settings worked fine with NetBeans since Catalina. So I reset the
behavior to "never" only for NetBeans, with the follow command
defaults write net.java.openjdk.cmd "AppleWindowTabbingMode" never
With this setting NetBeans works finally fine!
Sources: apparently, it's a bug, please see here and corresponding JDK bug.
Also, it's not a problem with NetBeans only. It affects AndroidStudio also see here for example:
If you choose to run it as root, here's what I use:
#!/bin/bash
APP=/Applications/NetBeans/Apache\ NetBeans\ 12.2.app/Contents/MacOS/netbeans
COMPLAINT="Netbeans must run as %U because of bugs in the UI implementation :{"
PROMPT=$(echo -e "${COMPLAINT}\nPlease enter your login password for privilege escalation:")
sudo -p "${PROMPT}" -b -s "${APP}"
This lets me limp by with a recent JDK (15.0.2) which placates the corresponding NetBeans (12.2, as you can see from the code). The -b option tells sudo to run the app in the background, which in this case means simply that the Terminal in which you ran this script will not be polluted with JDK whinging about "illegal reflective access".

Gnome Shell extensions not loading, no error message available

I have two gnome-shell extensions that don't appear to be loading after upgrading to 3.24. In gnome-tweak-tool they have a warning sign icon with "Error loading extension", and nothing else. I tried using looking glass (lg), and it just says "Error", and that the extension "has not reported any errors".
How can I debug the extension to find out why exactly it's not loading?
I found the error in the systemd journal:
$ sudo journalctl /usr/bin/gnome-shell
Just simply run this on terminal:
gnome-extensions-app
and enable it to make the extensions work.
Works perfectly with GNOME 40
As mentioned on the Github page.
A Shell reload is required. Press Alt+F2 r Enter and the extension has to be enabled with gnome-tweak-tool or with dconf.
As mentioned on Dash to Dock's User reviews. Make sure you disable Ubuntu Dock if you are using this in Ubuntu, otherwise you are going to have conflicts.
To disable Ubuntu Dock type the following in terminal:
gnome-extensions disable ubuntu-dock#ubuntu.com
I also experienced the same error. I think I will like to state the procedures that I took to make mine to work, and then you can check to see if you got it wrong somewhere.
Here are the steps
First install the Gnome shell extensions package from the terminal
sudo apt install gnome-shell-extensions
And then reboot your system. After that, start GNOME Tweaks and you’ll find a few extensions installed. You can just toggle the button to start using an installed extension.
Next, go to GNOME Extensions website (GNOME User Themes Extensions) and download the extension with the latest version (Although, I often prefer to download the version next to the latest version, since it may be more stable).
Extract the downloaded file to the ~/.local/share/gnome-shell/extensions (home/.local/share/gnome-shell/extensions) directory. You can press Ctrl + H to show hidden folders. Create the extensions folder if you don't have it yet.
Now restart GNOME Shell. Press Alt+F2 and enter r to restart GNOME Shell.
Restart GNOME Tweaks tool as well. You should see the manually installed GNOME extension in the Tweak tool now. You can configure or enable the newly installed extension here.
That's all
I hope this helps
Loging in without wayland works for me.
My extension was not enabling. I just log out and log in back and ran this command.
gnome-extensions enable example#hammad.example.com
It worked in my case.

Open Firefox with a temporary add-on on startup

Is there a way in which I can open Firefox and force it to load a temporary add-on (webextension) on startup? Normally I have to manually go to about:debugging and select the extension on my hard drive. I'm looking for a flag I can pass when I load Firefox so that this is done automatically.
If this is not possible, is there a recommended extension I can install to simulate that a user opens this URL and adds this extension?
Yes, you can use the command web-ext run from the directory in which the extension exists. This will start Firefox with the WebExtension installed using a temporary profile. web-ext run is intended for testing your WebExtension add-on during development, not for normal use of Firefox. By default, the web-ext run command will watch your WebExtension's files and automatically reload the extension when any of the files are changed. You can disable this feature by using the --no-reload option.
If you are using a Firefox version below 49, you will need to specify the --pre-install option which uses a different method of installing the extension in the profile. However, if you use the --pre-install, your WebExtension will not be operational if you are trying to use a release or beta version of Firefox and the extension is not signed. This basically means that using --pre-install is not useful for Firefox versions below 49 unless you are using a Developer Edition build. Using --pre-install can be useful for Developer Edition versions of Firefox above 49 if you are wanting to test how your extension behaves during Firefox startup. If you do not use the --pre-install option, your extension is installed as a temporary extension and does not need to be signed to be tested in release versions of Firefox.
If you want to use a specific profile, then you need to specify the profile using the --firefox-profile option. MDN says:
When using a custom profile, web-ext first copies the profile. The custom profile will not be altered.
Installing web-ext
You will need to install web-ext. You can do so by following the instructions in Getting started with web-ext. The instructions are to, after you install node/npm, run the following command:
npm install --global web-ext
References
Getting started with web-ext
web-ext command reference

Firefox addon stops working when packed in to xpi

I've made an extension using the addon sdk, and it works as expected when running with cfx run. But when I pack it in to an xpi using cfx xpi and install it - it stops working - no scripts are injected and I'm not even getting any errors :(
Any ideas on how to fix this, or how can I debug this kind of issue?
Found a solution. I'm simply using the .xpi that Firefox packs automatically for testing. In order to use it, run the cfx run with the -p parameter pointing to a profile you've created, like this:
cfx run -p <your path to firefox>\profiles\someprofile
After running, go the that profile's folder, and find in there the extensions folder, it should be something like this:
<your path to firefox>\profiles\someprofile\extensions
In there you'll have your addon with a weird file name and an .xpi file extension. Rename it to anything you want, leaving the .xpi file extension intact.
EDIT:
Apparently the cfx xpi command strips by default what it thinks to be unused modules and .js files. To avoid this you need to run it with a special flag, like this: cfx xpi --no-strip-xpi
try to uninstall and then reinstall the addon you developed
try installing the addon on another firefox build(aurora, nightly, beta)
What I do in such a case:
Disable extension from Addon Manager.
Restart Firefox.
Open Console Window (Ctrl+Shift+J)
Enable extension and watch for errors in Console.
Sometimes startup errors do not appear in Console window unless it is already opened.
Resetting firefox worked for me.
Type about:troubleshooting in your address bar
Click the reset firefox button in the upper-right hand corner of the Troubleshooting page
(source: mozilla.net)
Confirm your action

Open multiple firefox instances with different profiles on Mac OS X

What is the best way to open different firefox instances (firefox 3 to 10) with different profiles (on 10.5, 10.6 and 10.7)?
With versions prior to Firefox-7, modifying the content of the firefox package and adding -no-remote -P {PROFILE} worked.
However, with the latest versions of firefox it's not working.
I've also tried with Automator without success.
Has anyone faced a similar problem and fixed it?
Thanks
For new versions of Firefox use the following command:
/Applications/Firefox.app/Contents/MacOS/firefox-bin -P -no-remote &> /dev/null &
source: http://sonnygill.net/mac/mac-multiple-firefox-profiles/
On page explains how to use Automator to create a shortcut.
#dalvan answer does not work any more (10.15)
Workaround I've found is:
run first firefox instance as normal (profile chooser window opens, select primary profile)
use an Automator.app or run from shell /Applications/Firefox.app/Contents/MacOS/firefox-bin -P & and choose secondary profile
All links transfered from other applications will be opened in primary profile
Ref. https://bugzilla.mozilla.org/show_bug.cgi?id=1653218
This did work for me for several FF/Beta/Aurora version 10+
http://xulforge.com/blog/2011/07/multiple-firefox-instances-mac/
+ https://superuser.com/questions/37811/how-can-i-change-an-application-icon-in-mac-os-x for the icons ;)

Resources