Closed
Bug 810431
Opened 12 years ago
Closed 7 years ago
Browser API: frame launched with window.open does not come with setVisible() method
Categories
(Firefox OS Graveyard :: General, defect)
Firefox OS Graveyard
General
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: timdream, Unassigned)
References
Details
When working on bug 808227, error thrown when attempting to setVisible() on wrapper frames (i.e. frame launch with window.open() in home screen app and created in mozbrowseropenwindow event). [JavaScript Error: "TypeError: openFrame.setVisible is not a function" {file: "app://system.gaiamobile.org/js/window_manager.js" line: 627}] Justin said this should be a bug. Taking, I would to find out what happened in browserElementChild.js first.
Reporter | ||
Comment 1•12 years ago
|
||
Justin, I enabled the debug() in BrowserElementParent.js and add some code in the openWindow() method in the window_manager.js, this is what I found: I/GeckoDump( 1809): WindowManager - setVisible not exists I/Gecko ( 1809): BrowserElementParent - Remote browser frame shown [xpconnect wrapped nsIFrameLoader] I/Gecko ( 1809): BrowserElementParent - Creating new BrowserElementParent object for [xpconnect wrapped nsIFrameLoader] I/Gecko ( 1809): BrowserElementParent - Creating new BrowserElementParent object done I/GeckoDump( 1809): WindowManager - setVisible exists It looks like mozbrowser is not initialized at the time frameElement is passed to the web content.
Assignee: timdream+bugs → nobody
Flags: needinfo?(justin.lebar+bug)
Updated•12 years ago
|
Blocks: browser-api
Comment 2•12 years ago
|
||
> I enabled the debug() in BrowserElementParent.js and add some code in the openWindow()
> method in the window_manager.js, this is what I found:
Do you still have your patch sitting around so I can test this locally?
Flags: needinfo?(justin.lebar+bug)
Reporter | ||
Comment 3•12 years ago
|
||
(In reply to Justin Lebar [:jlebar] from comment #2) > > I enabled the debug() in BrowserElementParent.js and add some code in the openWindow() > > method in the window_manager.js, this is what I found: > > Do you still have your patch sitting around so I can test this locally? I don't have it anymore, but I can redo it if that would save you some time.
Comment 4•12 years ago
|
||
Oh, I think I know what's happening. Under normal circumstances, BEP and BEC (BrowserElementParent/Child) don't get loaded until the iframe is inserted into the DOM. window.open() is a little bit funky -- we force the BEC to load earlier than it would otherwise, since the opener synchronously gets a copy of the opened window -- but we don't do anything to force BEP to get loaded earlier, afaict. You have to insert the frame into the DOM and spin the event loop if you want setVisible() (and the other methods). I agree this is a bug, but can you work around it, e.g. with a setTimeout(0)? I'm becoming convinced that the right solution is to have a separate element (e.g. <webview>) which always has these methods.
Reporter | ||
Comment 5•12 years ago
|
||
(In reply to Justin Lebar [:jlebar] from comment #4) > I agree this is a bug, but can you work around it, e.g. with a > setTimeout(0)? I'm becoming convinced that the right solution is to have a > separate element (e.g. <webview>) which always has these methods. Yes, this bug is workaround-able. That's why it didn't receive a bb? nomination.
Comment 6•10 years ago
|
||
I think we are now cache the browser API method in gecko even we don't have them yet so any call to browser iframe is safe, shall we close this bug?
Flags: needinfo?(timdream)
Reporter | ||
Comment 7•10 years ago
|
||
Yes, I think so. Although I am not sure which bug actually fix this.
Flags: needinfo?(timdream)
Comment 9•10 years ago
|
||
Patrick could you confirm bug 960641 fixed this one as well? Thanks.
Flags: needinfo?(kk1fff)
Comment 10•10 years ago
|
||
Bug 960641 attaches browser APIs onto an iframe element synchronously, no matter the new content process has been created or not, it should fix bugs like this.
Flags: needinfo?(kk1fff)
Comment 11•7 years ago
|
||
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•