Search code examples
javascriptfirefoxconfiguration

How does user.js work in firefox in detail


I am wondering how much power the user.js preferences file gives to a user and how it works in greater detail I tried to google search for that information but I couldnt find anything very descriptive.

From what I can see is that user.js is a javascript file that gets executed once when the browser starts and overrides all the preferences that were set prior.

What I am interested in is if you can use any logic that you could use in other javascript files.

Will simple if-else statements get executed when placed in this file? Is it able to use javascript functions that are available when executed in the browser (like setTimeout)? Can you use construction like in other js files; by that I mean writting your own functions and variables etc.

Or is the name js deceitful with no js functionality whatsoever?


Solution

  • It just looks like a JavaScript file. Once upon a time in Netscape 3 and maybe 4 it actually was, but now it's just a file with a .js extension and a very restricted syntax that's parsed by a separate (non-JS) parser and not executed in any way.