Closed Bug 822909 Opened 12 years ago Closed 7 years ago

Use mozbrowser type iframe for addon frames

Categories

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

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: irakli, Unassigned)

References

Details

At the moment SDK makes use of xul frames in the hiddenWindow to obtain a content type document with `top` null. But since only OSX has a hidden window with a xul document it's not possible (or is it ?) to create xul iframes there. To workaround this fact we do something more complicated, we create an html iframe in the hidden window, load xul document "chrome://global/content/mozilla.xhtml" into it:

https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/frame/hidden-frame.js#L56-L78

Once xul document is loaded, we create another a **xul** iframe that has content type and use then we use it to loads add-on related content:

https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/frame/hidden-frame.js#L130-L142

I suspect there is a better way to do this, it also seems to me that firefox OS run into same problems that's why HTML iframes there have mozapp, mozbrowser and remote attributes:
https://developer.mozilla.org/en-US/docs/HTML/Element/iframe
It looks like only thing stopping us from using html frame is that swapFrameLoaders is not implemented for them:

http://dxr.mozilla.org/mozilla-central/content/html/content/src/nsGenericHTMLFrameElement.cpp.html#l146

Fixing that would allow us to use html iframes.
This is basically what I end up with, but swapping frame loaders fails presumably because of the line in the previous comment:

https://gist.github.com/4342219
Is this still needed?
Flags: needinfo?(rFobic)
Yes we still need this.
Flags: needinfo?(rFobic)
The second issue is that, I think that mozbrowser iframe are only enabled on b2g.
This setting dom.mozBrowserFramesEnabled is only set on b2g and enable the whole mozbrowser API: 
http://mxr.mozilla.org/mozilla-central/source/dom/browser-element/BrowserElementParent.js#55
Eddy would you be interested looking into this ?
Flags: needinfo?(ejpbruel)
I have enough on my plate right now.

Since this is labeled as P1, please talk to Dave if you still think this is a priority and I should work on this instead of my other stuff.
Flags: needinfo?(ejpbruel)
QA Contact: ejpbruel
Assignee: nobody → ejpbruel
QA Contact: ejpbruel
(In reply to Irakli Gozilalishvili [:irakli] [:gozala] [@gozala] from comment #1)
> It looks like only thing stopping us from using html frame is that
> swapFrameLoaders is not implemented for them:
> 
> http://dxr.mozilla.org/mozilla-central/content/html/content/src/
> nsGenericHTMLFrameElement.cpp.html#l146
> 
> Fixing that would allow us to use html iframes.

As I mentioned earlier that is not fixing something. This is implementing something very complex. Expect a lot of uncertainties in this project and estimate it as very big task, with a possible negative outcome.
Avoiding using swapFrameLoaders in the SDK however, is a desirable goal imo that owuld solve this problem.
Assignee: ejpbruel → nobody
Priority: P1 → --
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.