Re: Minutes from Oct 17 Mobile Tech Leads meeting

2018-10-21 Thread Ryan Kelly
On Fri, 19 Oct 2018 at 14:25, Nicholas Alexander 
wrote:

>
>1. WebChannels
>
> 
>in GeckoView-consuming browser-like Apps.  WebChannels are a
>Firefox-specific chome-only feature that allows the browser chrome to
>communicate via message-passing with trusted Web Content; they are used to
>integrate Firefox with accounts.firefox.com and addons.mozilla.org.
>We need something that provides this functionality in the Reference Browser
>to support a first-class Firefox Accounts experience.  Privileged Web
>Extensions are ideologically pure but don't have a concrete date on the
>GeckoView roadmap.  Suggestions gratefully accepted!
>
>
FYI I've also filed a bug to track this work and its ongoing discussion:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1500828


  Cheers,

 Ryan
___
Dev-fxacct mailing list
Dev-fxacct@mozilla.org
https://mail.mozilla.org/listinfo/dev-fxacct


Re: Minutes from Oct 17 Mobile Tech Leads meeting

2018-10-21 Thread Ryan Kelly
On Sat, 20 Oct 2018 at 04:34, Nicholas Alexander 
wrote:
On Fri, Oct 19, 2018 at 7:43 AM Stefan Arentz  wrote:

>
>
>
>>
>>1.
>>2. WebChannels
>>
>> 
>>in GeckoView-consuming browser-like Apps.  WebChannels are a
>>Firefox-specific chome-only feature that allows the browser chrome to
>>communicate via message-passing with trusted Web Content; they are used to
>>integrate Firefox with accounts.firefox.com and addons.mozilla.org.
>>We need something that provides this functionality in the Reference 
>> Browser
>>to support a first-class Firefox Accounts experience.  Privileged Web
>>Extensions are ideologically pure but don't have a concrete date on the
>>GeckoView roadmap.  Suggestions gratefully accepted!
>>
>>
> Can we learn anything from how this was implemented on iOS? If I remember
> correctly, we inject a helper user script into the webview, which then sets
> up the right glue to do messages between the native application and the FxA
> page loaded in the webview.
>

This is a good point, because IIRC Firefox for iOS doesn't actually support
WebChannel messages in the same way that Desktop and Android do.

On Desktop and Android, any tab that loads web content from
https://accounts.firefox.com gets some special message listeners hooked up,
and the web content can send privileged messages to the browser.  This is
why, for example, you can just browse to this page on Desktop, punch in
your account credentials, and get your browser connected to Sync:

  https://www.mozilla.org/en-US/firefox/accounts/

On Firefox for iOS, the message listeners get hooked up when viewing
https://accounts.firefox.com in a special webview through the "settings"
menu, but they won't get hooked up if you just open a tab and browse to
https://accounts.firefox.com on the web.

(That's my recollection anyway; if I'm wrong please correct me!)

One note, and please correct me if I am wrong: but the web based FxA login
> flow can not depend on GeckoView - it has to work in both the system
> webview and geckoview. It is not practical for non-browser applications to
> pull in a giant dependency on GeckoView if all they need is a place to show
> a web based login flow. Whatever we do here needs to work in both the
> system webview and geckoview.
>

This is 100% correct.  The use of this special message-passing stuff is for
a very specific use-case - browser-like apps that want to be able to host
account management UI by opening up https://accounts.firefox.com.
Non-browser applications will only want the existing OAuth signin flow, not
all the extra account-management stuff, so should work fine with either
GeckoView or the system browser.

  Cheers,

Ryan
___
Dev-fxacct mailing list
Dev-fxacct@mozilla.org
https://mail.mozilla.org/listinfo/dev-fxacct


Re: Minutes from Oct 17 Mobile Tech Leads meeting

2018-10-19 Thread Nicholas Alexander
On Fri, Oct 19, 2018 at 7:43 AM Stefan Arentz  wrote:

>
>
>
>>
>>1.
>>2. WebChannels
>>
>> 
>>in GeckoView-consuming browser-like Apps.  WebChannels are a
>>Firefox-specific chome-only feature that allows the browser chrome to
>>communicate via message-passing with trusted Web Content; they are used to
>>integrate Firefox with accounts.firefox.com and addons.mozilla.org.
>>We need something that provides this functionality in the Reference 
>> Browser
>>to support a first-class Firefox Accounts experience.  Privileged Web
>>Extensions are ideologically pure but don't have a concrete date on the
>>GeckoView roadmap.  Suggestions gratefully accepted!
>>
>>
> Can we learn anything from how this was implemented on iOS? If I remember
> correctly, we inject a helper user script into the webview, which then sets
> up the right glue to do messages between the native application and the FxA
> page loaded in the webview.
>
> One note, and please correct me if I am wrong: but the web based FxA login
> flow can not depend on GeckoView - it has to work in both the system
> webview and geckoview. It is not practical for non-browser applications to
> pull in a giant dependency on GeckoView if all they need is a place to show
> a web based login flow. Whatever we do here needs to work in both the
> system webview and geckoview.
>

Yes, we can learn from iOS, and I believe your memory is correct.  The
WebView way to wire up messages from Web Content is
https://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)
IIRC.

If WebExtensions are not our radar now, maybe we could see if a
> userscripts-like API is easier to implement?
>

 It's my belief that the GV team is explicitly trying to avoid adding such
an API.  I'll let snorp and others say more, but the desire is to have
_one_ API for talking to Web Content rather than building a
content-interfacing API/platform parallel to Web Extensions.  I do not have
much context here, though, so -- snorp?  Others?  Links to tickets tracking
the viewpoints would be helpful.

Nick
___
Dev-fxacct mailing list
Dev-fxacct@mozilla.org
https://mail.mozilla.org/listinfo/dev-fxacct


Re: Minutes from Oct 17 Mobile Tech Leads meeting

2018-10-19 Thread Stefan Arentz
>
>1.
>2. WebChannels
>
> 
>in GeckoView-consuming browser-like Apps.  WebChannels are a
>Firefox-specific chome-only feature that allows the browser chrome to
>communicate via message-passing with trusted Web Content; they are used to
>integrate Firefox with accounts.firefox.com and addons.mozilla.org.
>We need something that provides this functionality in the Reference Browser
>to support a first-class Firefox Accounts experience.  Privileged Web
>Extensions are ideologically pure but don't have a concrete date on the
>GeckoView roadmap.  Suggestions gratefully accepted!
>
>
Can we learn anything from how this was implemented on iOS? If I remember
correctly, we inject a helper user script into the webview, which then sets
up the right glue to do messages between the native application and the FxA
page loaded in the webview.

If WebExtensions are not our radar now, maybe we could see if a
userscripts-like API is easier to implement?

One note, and please correct me if I am wrong: but the web based FxA login
flow can not depend on GeckoView - it has to work in both the system
webview and geckoview. It is not practical for non-browser applications to
pull in a giant dependency on GeckoView if all they need is a place to show
a web based login flow. Whatever we do here needs to work in both the
system webview and geckoview.

 S.
___
Dev-fxacct mailing list
Dev-fxacct@mozilla.org
https://mail.mozilla.org/listinfo/dev-fxacct