<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 19, 2018 at 7:43 AM Stefan Arentz <<a href="mailto:sarentz@mozilla.com">sarentz@mozilla.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br> <div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><ol><li><br></li><li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/WebChannel.jsm" target="_blank">WebChannels</a> 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 <a href="http://accounts.firefox.com" target="_blank">accounts.firefox.com</a> and <a href="http://addons.mozilla.org" target="_blank">addons.mozilla.org</a>.  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!</li></ol></div></div></div></blockquote><div><br></div>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.</div><div class="gmail_quote"><br></div><div class="gmail_quote">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.<br></div></div></blockquote><div><br></div><div>Yes, we can learn from iOS, and I believe your memory is correct.  The WebView way to wire up messages from Web Content is <a href="https://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)">https://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)</a> IIRC.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>If WebExtensions are not our radar now, maybe we could see if a userscripts-like API is easier to implement?</div></blockquote><div><br></div><div> 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.<br></div><div><br></div><div>Nick<br></div></div></div></div>