Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Where is the Android Firefox user.js stored?

1,653 views
Skip to first unread message

Chris Morris

unread,
Aug 7, 2016, 9:43:03 PM8/7/16
to
Where is the Android Firefox user.js stored?

I would like to use this hardened user.js file on non rooted Android
https://github.com/pyllyukko/user.js/blob/master/user.js

This help section tries to explain how to install this user.js file
https://github.com/pyllyukko/user.js/#android

But, looking with ES File Explorer, I don't have either of the two
directories described using Firefox 47.0 on Android.

Fennec =
/data/data/org.mozilla.firefox/files/mozilla/XXXXXXXX.your_profile_name

Alien Dalvik =
/opt/alien/data/data/org.mozilla.firefox/files/mozilla/XXXXXXXX.your_profile_name

Where is the Android Firefox 47.0 user.js stored?

Ralph Fox

unread,
Aug 8, 2016, 3:59:12 AM8/8/16
to
My prefs.js file is at
/data/data/org.mozilla.firefox/files/mozilla/xxxxxxxx.default/prefs.js
where the "xxxxxxxx" is actually a random string of letters and
numbers. My understanding is that your user.js would go in this
same directory as prefs.js.

You can see this directory in Firefox (Fennec) itself: start by
entering this URL into Firefox's URL bar...
file:///data/data/org.mozilla.firefox/files/mozilla/

ES File Explorer will not be able to see this location unless ES File
Explorer itself first has root access.

If you don't have root access, only Firefox can see this location.
In that case, try using Firefox to save your file to this location.


--
Kind regards
Ralph

Chris Morris

unread,
Aug 8, 2016, 2:57:43 PM8/8/16
to
On Mon, 08 Aug 2016 19:59:15 +1200, Ralph Fox wrote:

> If you don't have root access, only Firefox can see this location.
> In that case, try using Firefox to save your file to this location.

I didn't know this, so thank you for the wonderful hint!

I pointed Firefox 48.0 to file:/// and then walked down the hierarchy.

There was no /opt, so I went to /data instead.

I got the error:
file:///data and file:///data/
Access to the file was denied.
The file at /data/ is not readable.

The same thing happened at file:///data/data/ & file:///data/data.
But things started working again at file:///data/data/org.mozilla.firefox/.

I saw "Index of file:///data/data/org.mozilla.firefox/"
In "files" there was both a mozilla and a .mozilla so I went to mozilla
where there was a XXXXXXXX.default directory which contained the prefs.js
file.

I copied that location to the clipboard
file:///data/data/org.mozilla.firefox/XXXXXXXX.default/prefs.js

And then I went to the user.js file on the Internet
https://github.com/pyllyukko/user.js

I pressed "Jump to file"
https://github.com/pyllyukko/user.js/find/master?q=

And then I tapped on the "user.js" link
https://github.com/pyllyukko/user.js/blob/master/user.js

This brought up the user.js file but didn't allow me to download it
so I long pressed instead on the "user.js" link which brought up a menu
which had an option for
a. Share Link
b. Open Link in New Tab
c. Open Link in Private Tab
d. Copy Link
e. Bookmark Link

I was hoping to find a "Save As" but there wasn't any option for that.
I was hoping to figure out how to set the "Downloads Dir" but I couldn't do
that either.

I mailed the file to myself, but what good will that do if I can't save it
into /data/data/org.mozilla.firefox/XXXXXXXX.default/user.js

Now that we know _where_ the user.js file is supposed to be stored, how do
we store that file where it belongs?

Chris Morris

unread,
Aug 8, 2016, 3:43:54 PM8/8/16
to
On Tue, 9 Aug 2016 01:55:06 +0700, Chris Morris wrote:

> Now that we know _where_ the user.js file is supposed to be stored, how do
> we store that file where it belongs?

Since I couldn't change the Firefox downloads directory,
I installed ES File Explorer and then long pressed on the web page at
https://github.com/pyllyukko/user.js/blob/master/user.js

A new "ES Save to..." option came up when I pressed the "Share" icon.

So I pressed "ES Save to..." which had me go through the motions to choose
a directory to save the file to, but "ES Save to..." wouldn't save the
user.js file anywhere (not even in the Firefox Downloads directory!).

I don't know what that "ES Save to..." button does but it didn't work.

Can anyone figure out how to save this user.js file into the Mozilla
profiles directory?

FILE: https://github.com/pyllyukko/user.js/blob/master/user.js
SAVE: /data/data/org.mozilla.firefox/XXXXXXXX.default/user.js

Ralph Fox

unread,
Aug 9, 2016, 5:08:04 AM8/9/16
to
On Tue, 9 Aug 2016 02:41:15 +0700, Chris Morris wrote:

> On Tue, 9 Aug 2016 01:55:06 +0700, Chris Morris wrote:
>
> > Now that we know _where_ the user.js file is supposed to be stored, how do
> > we store that file where it belongs?
>
> Since I couldn't change the Firefox downloads directory,
> I installed ES File Explorer and then long pressed on the web page at
> https://github.com/pyllyukko/user.js/blob/master/user.js
>
> A new "ES Save to..." option came up when I pressed the "Share" icon.
>
> So I pressed "ES Save to..." which had me go through the motions to choose
> a directory to save the file to, but "ES Save to..." wouldn't save the
> user.js file anywhere (not even in the Firefox Downloads directory!).
>
> I don't know what that "ES Save to..." button does but it didn't work.


On Android, only Firefox and root can get to the location where
Firefox's user.js file is supposed to be stored.

Before ES File Explorer can get there, you need to give root access
to ES File Explorer. This requires two things:

1) First: your device needs to be rooted

[When you root your device, you should only ever allow root
access to apps which you can trust.]

2) Then: In ES File Explorer's settings, turn on "Root Explorer
(only for rooted devices)"

Where to find this ES File Explorer setting seems to depend on
your version of ES File Explorer.

(a) Here is one guy's instructions
https://seo-michael.co.uk/enable-root-browsing-on-es-file-explorer/

(b) In my version of ES File Explorer, this ES File Explorer
setting is in a different location:
(menu) >> Settings >> Root Settings >> Root Explorer


> Can anyone figure out how to save this user.js file into the Mozilla
> profiles directory?
>
> FILE: https://github.com/pyllyukko/user.js/blob/master/user.js
> SAVE: /data/data/org.mozilla.firefox/XXXXXXXX.default/user.js


--
Kind regards
Ralph

Chris Morris

unread,
Aug 16, 2016, 6:22:45 PM8/16/16
to
On Tue, 09 Aug 2016 21:08:08 +1200, Ralph Fox wrote:

> On Android, only Firefox and root can get to the location where
> Firefox's user.js file is supposed to be stored.

Firefox can certainly save the prefs.js through about:config, but is there
a way for me to *write* with Firefox to a user.js file?
0 new messages