On 2/12/2014 1:20 PM, Ben Francis wrote:
On Wed, Feb 12, 2014 at 3:55 PM, Benjamin Smedberg <[email protected]>wrote:

The root of this problem is that on the "browser web" you just open a new
window using target="_blank" or window.open("_blank"). For apps this could
either mean "open another window of my app" or "open another window in the
default browser".

I think the current behaviour in Firefox OS is that target=_blank should
open a browser window, window.open should open up to one additional
overlayed app window (useful for authentication use cases for example).
When we implement the full "sheets" model after 1.4 we will probably allow
apps to have multiple windows.
If nothing else, it should be part of some webapp spec exactly how this ought to behave. Which spec is that?

I don't think it makes much sense for window.open and <a target> to have such different default behavior. From basically every other perspective they are the same call; one is declarative and one is scripted.


  Additionally, I'm suggesting
navigating to a URL that corresponds to the origin of an installed app from
inside a browser window should open the URL in the app.
I would strongly object to this in Firefox desktop at least. Installing an app should not by itself alter the behavior of normal browsing activities.

But I also wonder what "open the URL in the app" means. Does that happen via intents, or by just forcing a new window into an existing app with that URL?

For the web inside of apps, I strongly feel we should do two things:

* it should be possible for the app either kind (a new app window or a
browser window) of window for any URL. So something like <a rel="external"
target="_blank"> would open a browser window while <a rel="internal"
target="_blank" would open a new app window. For window.open we might be
able to use the window features to achieve the same thing

window.open(url, "_blank", "external")
window.open(url, "_blank", "internal");

There have been discussions about something similar for "sheets" after 1.4
but I don't think this is necessary yet, if ever.
Currently you seem to be saying that in Firefox OS, there is no way for an app to call window.open which will open a browser window (instead of an overlayed window). This seems like a fundamental flaw. If you are converting an existing website to behave as an app, it's likely that code is going to open links in new browser tabs by calling window.open(url, "_blank") and they need a way for this to continue working.

Have you considered how this will interoperate on Android? AIUI Android apps can currently register themselves as handlers of certain URL patterns. Since we're going to be focusing some significant effort in getting webapps on Android, perhaps we should use that system as a model. It does require apps to declare which URL patterns they want to handle.

--BDS

_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps

Reply via email to