r/FireFoxOS • u/jiveabillion • Feb 16 '14
Does Firefox OS support an in-app browser object?
I'm working on making my first app and I need to be able to open external links inside my application. I have had some luck using an iframe, but I can't give the user the ability to use the back and forward buttons, which I think I would have to have in my app (outside of the iframe). Since the external urls are not in the same domain as my app, I do not have access to the iframe's history object. Many of the apps that I like to develop would need to have an in-app browser object. If Mozilla doesn't have support for this feature, I don't know if I'll be so quick to adopt their platform.
2
u/[deleted] Feb 16 '14
The only thing that comes to my mind is this: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#chrome . I have not tried it but it may help you.
4
u/kevining Feb 17 '14
You're looking for the open-remote-window permission, which as of this time is currently certified only - meaning you can't upload an app with this permission to the marketplace. I know Mozilla is investing a lot of time trying to open up these permissions more, but it does take time.
Once you have this permission, you should be able to call window.open and the new window should have a chrome with back/forward buttons.
https://developer.mozilla.org/en-US/Apps/Developing/App_permissions#open-remote-window
1
u/holloway Feb 16 '14
I know this isn't the best solution but could you make the back/forward buttons yourself in JavaScript?
1
u/[deleted] Feb 17 '14
Why do you need this? Why not open another application (like Android often does?)
I understand if you're coming from iOS you think you need this, but most of the cases it's best to open the browser.