(Hidden by Administrator)
Bug 1880909 Comment 4 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Thanks Gijs, I've made most of the changes I think, and when running `./mach run`, I'm currently getting a ReferenceError that `gBrowserInit` is not defined. I'll walk through what I've done so far, and hopefully you can catch where I'm missing something.
I first moved the entire definition of `gBrowserInit`, as well as the declarations of `_resolveDelayedStartup` and `delayedStartupPromise` to teh file `browser-init.js`, and removed them from `browser.js`. Like you mentioned, the linter was not happy about the global variable not being defined there, so I removed those three from the `browser.js.globals` file. I then added `Services.scriptloader.loadSubScript("chrome://browser/content/browser-init.js", this);` as the first line within `<script>`, assuming our init file should be the first file loaded, since there are dependencies requiring it. I also added to `jar.mn` this line: `content/browser/browser-init.js (content/browser-init.js)` between `browser-gestureSupport.js` and `browser-pageActions.js`.
The one thing I see that you have, that I haven't done yet, is 'the content window paint bit' that you mentioned should also be moved, however I'm not sure what exactly I'm moving here. In `browser.js`, `"_firstContentWindowPaintDeferred"` is just a string argument to `ChromeUtils.defineLazyGetter()`, which seems to be its own separate thing. Within `browser-init.js`, I see a function `_setupFirstContentWindowPaintPromise()` with some event listeners and resolving the promise of `this._firstContentWindowPaintDeferred`, but I'm really not sure if I should be doing something with this or not.
Please let me know when you have time if I've missed something here, thank you!