Closed Bug 1037975 Opened 10 years ago Closed 10 years ago

loading sdk/addon/window from sdk/addon/runner causes an error and add-ons to fail to load

Categories

(Add-on SDK Graveyard :: General, defect, P1)

All
Windows 8
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1042239

People

(Reporter: evold, Assigned: evold)

References

Details

Attachments

(1 file)

Run the `npm test` on jpn on a windows pc, the add-ons will fail to load with this error:

https://gist.github.com/erikvold/34cdfb50e3b603764223
Blocks: jpm
The change I mention in bug 1037970 comment 1 may resolve this issue, but I'd rather find a solution that we can count on.
Flags: needinfo?(rFobic)
Flags: needinfo?(dtownsend+bugmail)
To be clear, I think this error is occurring because `appShellService.hiddenDOMWindow` is not totally ready to be used when 'final-ui-startup' https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/addon/runner.js#L31 is fired
Not sure what that error is but sdk/addon/runner already waits for the hidden window to be fully loaded before proceeding: https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/addon/runner.js#L99
Flags: needinfo?(dtownsend+bugmail)
(In reply to Dave Townsend [:mossop] from comment #3)
> Not sure what that error is but sdk/addon/runner already waits for the
> hidden window to be fully loaded before proceeding:
> https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/addon/runner.js#L99

So that code is the part that is throwing the error I mention in comment 1.

It throws because `appShellService.hiddenDOMWindow` is not ready to be used in the way that `sdk/addon/window` tries to use it (to add an iframe to it and wait for that frame to be ready).

I realize now that this is happening because we only wait for `appShellService.hiddenDOMWindow` to initialize if the add-on loadReason is "startup" and the loadReason appears to be "install" when we are using jpm.  I'm not sure why there is a difference at the moment.
Really I'd prefer we switch to using hidden docshells than relying on the hidden window for all this. What is blocking us from doing that Irakli?
(In reply to Erik Vold [:erikvold] [:ztatic] from comment #4)
> I realize now that this is happening because we only wait for
> `appShellService.hiddenDOMWindow` to initialize if the add-on loadReason is
> "startup" and the loadReason appears to be "install" when we are using jpm. 
> I'm not sure why there is a difference at the moment.

the startup reason is "install" for both cfx and jpm, which is fine because we should be waiting for the app to finish starting up if trying to access the `appShellService.hiddenDOMWindow` fails regardless.

I need to look into this more by hacking sdk/addon/runner on windows, which I'm working on.
(In reply to Dave Townsend [:mossop] from comment #5)
> Really I'd prefer we switch to using hidden docshells than relying on the
> hidden window for all this. What is blocking us from doing that Irakli?

I would very much prefer to switch as well, but implementation still had bugs that prevented us from switching (see Bug 946015) & I believe gabor had more important tasks to work on instead.
Flags: needinfo?(rFobic)
(In reply to Erik Vold [:erikvold] [:ztatic] from comment #4)
> (In reply to Dave Townsend [:mossop] from comment #3)
> > Not sure what that error is but sdk/addon/runner already waits for the
> > hidden window to be fully loaded before proceeding:
> > https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/addon/runner.js#L99
> 
> So that code is the part that is throwing the error I mention in comment 1.
> 
> It throws because `appShellService.hiddenDOMWindow` is not ready to be used
> in the way that `sdk/addon/window` tries to use it (to add an iframe to it
> and wait for that frame to be ready).
> 
> I realize now that this is happening because we only wait for
> `appShellService.hiddenDOMWindow` to initialize if the add-on loadReason is
> "startup" and the loadReason appears to be "install" when we are using jpm. 
> I'm not sure why there is a difference at the moment.

I guess one thing we could do is first wait for hiddenDOMWindow to load first, and then do all the steps we do now.
Assignee: nobody → evold
Would it be possible for this to get into Aurora as well? This is a major hold up for using jpm
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #10)
> Would it be possible for this to get into Aurora as well? This is a major
> hold up for using jpm

we can do this change on the bootstrap side too
Priority: -- → P1
Depends on: 1042239
Comment on attachment 8457674 [details] [review]
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1554

Seems like we're waiting on bug 1042239 for this to be updated before it can be reviewed.
Attachment #8457674 - Flags: review?(dtownsend+bugmail)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: