I have tried a variety of things to get an observer: Services.obs.addObserver(warmup, "browser-delayed-startup-finished", false); to work, all attempts are unsuccessful. Maybe this needs to be in an addon or something? the warmup (getinfo.html) is a raw html page, should I create an addon for this? Any other guidance would be appreciated.
(In reply to Joel Maher (:jmaher) from comment #1) > I have tried a variety of things to get an observer: > Services.obs.addObserver(warmup, "browser-delayed-startup-finished", false); > > to work, all attempts are unsuccessful. Maybe this needs to be in an addon > or something? the warmup (getinfo.html) is a raw html page, should I create > an addon for this? > > Any other guidance would be appreciated. Delayed startup would require chrome privileges to wait for. Are you able to access Services.jsm from the html page at all? That would somewhat surprise me, but I don't know where to find getinfo.html... I'm a little worried that adding an add-on would alter startup timings etc. Do we already have an add-on in profiles used for tpaint/ts_paint and friends? I kind of assumed so, seeing as other things like sessionstore and chrome-level paint events would already require chrome privileges...
here is the code for getinfo: http://hg.mozilla.org/build/talos/file/tip/talos/getInfo.html we set some preferences to help out, specifically: http://hg.mozilla.org/build/talos/file/tip/talos/PerfConfigurator.py#l286 This allows us to log and quit: log: http://hg.mozilla.org/build/talos/file/85d4f8ef4810/talos/scripts/MozillaFileLogger.js quit: http://hg.mozilla.org/build/talos/file/85d4f8ef4810/talos/page_load_test/quit.js (uses observers) quite possibly we can make it work. Regarding an addon- this could affect times. I had experimented with adding special powers, but the numbers were too noisy after adding it. I suspect a real simple addon might do the trick though. If you have other thoughts, let me know!
Ah, those files have UniversalXPConnect privileges... that should do the trick, though |Services| won't exist without you importing it (Components.utils.import("resource://gre/modules/Services.jsm")) - alternatively, use CC and Ci directly to just grab a hold of the observer service.
despite all my hacking I am not able to figure this out. I verified that Services.obs.addObserver is a native code function and accessible, but my observer never gets called. I am thinking of marking this as wontfix, but would gladly accept a patch.