Re: [polymer-dev] loading polymer app into an iOS WKWebView fails

2016-05-03 Thread jim . trainor
Thanks for reiterating. I will try that suggestion.


On Monday, May 2, 2016 at 5:47:54 PM UTC-4, Eric Bidelman wrote:
>
> Or the other suggestion:
> > The other option is to vulcanize your entire app (vulcanize index.html 
> -o index.v.html) which removes all import requests.
>
> On Mon, May 2, 2016 at 1:00 PM Jim Trainor  > wrote:
>
>> I am not aware of any override on WKWebView that permits file:// access.
>>
>> I’m the second person to have posted this as a bug on the  Apache Cordova 
>> bug tracker. It is not hard to file other reports of people stumbling over 
>> the lack of file:// support in WkWebView.  The embedded web server approach 
>> seems to be the usual solution.  But that doesn’t capture the file:// XHR 
>> requests.
>>
>> … so… hmm…. head scratch… seems to be a blocker at the moment.
>>
>>
>> On Mon, May 2, 2016 at 3:22 PM, Eric Bidelman > > wrote:
>>
>>> On IOS (a polyfilled browser), the web components polyfill loads html 
>>> imports using XHR. This means that from a webview, they're loaded from 
>>> file:///, which is typically blocked by browsers/environments for security 
>>> reasons.
>>>
>>> Unsure if there's an equivalent in ios, but in android webview, you can 
>>> override this setting:
>>>
>>> https://www.polymer-project.org/0.5/articles/webview.html#tweaking-the-webview-settings
>>>
>>> The other option is to vulcanize your entire app (vulcanize index.html 
>>> -o index.v.html) which removes all import requests.
>>>
>>> On Mon, May 2, 2016 at 12:10 PM Jim Trainor >> > wrote:
>>>
  am about to revisit this in depth… but… the last time I dug in there 
 was definitely an XHR load of an html file originating from polymer (from 
 the web component.min.js, actually, as I recall, which I am classifying 
 generically as “polymer”).

 As I recall the XHR request was loading html web components from its 
 host (I think it was loading the entire vulcanized html file). If that 
 host 
 url happens to be file:// then that is what it used for the XHR request.  
 The problem is… WKWebView rejects that access… so no-go for the Polymer 
 app.

 If the page is loaded via an ordinary http request then all is well. 
 The exact same code loading via an Android WebView is fine also.  The 
 problem is limited to security restrictions in WKWebView. See the bug link 
 that I posted for more info.

 On Mon, May 2, 2016 at 12:34 PM, Karl Tiedt  wrote:

> Nothing in polymer appears to reference file:// anything... this 
> sounds like it may be a Cordova issue?
>
> -Karl Tiedt
>
> On Mon, May 2, 2016 at 9:17 AM, Jim Trainor  > wrote:
>
>> Polymer applications fail to load in an iOS WKWebView, as supported 
>> by Cordova. The root cause of the problem is that WKWebView does not 
>> permit 
>> loading of content via file:.  Cordova's support for WKWebView bypasses 
>> this restriction by implementing a in-app web server to host the static 
>> content. Polymer fails because the polymer code tries to load a local, 
>> static, html file, using a file:// url via an XHR request. The file:// 
>> XHR 
>> request is rejected by WKWebView.
>>
>> This has turned into a blocking issue for publishing Polymer 
>> applications, using Cordova, on iOS.
>>
>> Does this sound familiar to anybody?
>>
>> Is there anyway to cleanly define the URL where Polymer loads 
>> elements (or whatever is loaded via the file:// XHR)?
>>
>> Here is the Apache bug: Allow WKWebView to proxy file:// url loading 
>> in XmlHttpRequest.open 
>> 
>>
>>
>>
>>
>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to polymer-dev...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/polymer-dev/72dda4a2-5447-4dec-a4e7-b075a02927ad%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
 Follow Polymer on Google+: plus.google.com/107187849809354688692
 --- 
 You received this message because you are subscribed to the Google 
 Groups "Polymer" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to polymer-dev...@googlegroups.com .
 To view this discussion on 

Re: [polymer-dev] loading polymer app into an iOS WKWebView fails

2016-05-02 Thread Eric Bidelman
Or the other suggestion:
> The other option is to vulcanize your entire app (vulcanize index.html -o
index.v.html) which removes all import requests.

On Mon, May 2, 2016 at 1:00 PM Jim Trainor 
wrote:

> I am not aware of any override on WKWebView that permits file:// access.
>
> I’m the second person to have posted this as a bug on the  Apache Cordova
> bug tracker. It is not hard to file other reports of people stumbling over
> the lack of file:// support in WkWebView.  The embedded web server approach
> seems to be the usual solution.  But that doesn’t capture the file:// XHR
> requests.
>
> … so… hmm…. head scratch… seems to be a blocker at the moment.
>
>
> On Mon, May 2, 2016 at 3:22 PM, Eric Bidelman  wrote:
>
>> On IOS (a polyfilled browser), the web components polyfill loads html
>> imports using XHR. This means that from a webview, they're loaded from
>> file:///, which is typically blocked by browsers/environments for security
>> reasons.
>>
>> Unsure if there's an equivalent in ios, but in android webview, you can
>> override this setting:
>>
>> https://www.polymer-project.org/0.5/articles/webview.html#tweaking-the-webview-settings
>>
>> The other option is to vulcanize your entire app (vulcanize index.html -o
>> index.v.html) which removes all import requests.
>>
>> On Mon, May 2, 2016 at 12:10 PM Jim Trainor 
>> wrote:
>>
>>>  am about to revisit this in depth… but… the last time I dug in there
>>> was definitely an XHR load of an html file originating from polymer (from
>>> the web component.min.js, actually, as I recall, which I am classifying
>>> generically as “polymer”).
>>>
>>> As I recall the XHR request was loading html web components from its
>>> host (I think it was loading the entire vulcanized html file). If that host
>>> url happens to be file:// then that is what it used for the XHR request.
>>> The problem is… WKWebView rejects that access… so no-go for the Polymer app.
>>>
>>> If the page is loaded via an ordinary http request then all is well. The
>>> exact same code loading via an Android WebView is fine also.  The problem
>>> is limited to security restrictions in WKWebView. See the bug link that I
>>> posted for more info.
>>>
>>> On Mon, May 2, 2016 at 12:34 PM, Karl Tiedt  wrote:
>>>
 Nothing in polymer appears to reference file:// anything... this sounds
 like it may be a Cordova issue?

 -Karl Tiedt

 On Mon, May 2, 2016 at 9:17 AM, Jim Trainor <
 jim.trainor.kan...@gmail.com> wrote:

> Polymer applications fail to load in an iOS WKWebView, as supported by
> Cordova. The root cause of the problem is that WKWebView does not permit
> loading of content via file:.  Cordova's support for WKWebView bypasses
> this restriction by implementing a in-app web server to host the static
> content. Polymer fails because the polymer code tries to load a local,
> static, html file, using a file:// url via an XHR request. The file:// XHR
> request is rejected by WKWebView.
>
> This has turned into a blocking issue for publishing Polymer
> applications, using Cordova, on iOS.
>
> Does this sound familiar to anybody?
>
> Is there anyway to cleanly define the URL where Polymer loads elements
> (or whatever is loaded via the file:// XHR)?
>
> Here is the Apache bug: Allow WKWebView to proxy file:// url loading
> in XmlHttpRequest.open
> 
>
>
>
>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google
> Groups "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to polymer-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/72dda4a2-5447-4dec-a4e7-b075a02927ad%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


>>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Polymer" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to polymer-dev+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/polymer-dev/CACDv4tDu6JrtF1TQcv_KtB1V_W%3Dfouhtbrv_AV6SaMGeLMTH9Q%40mail.gmail.com
>>> 

Re: [polymer-dev] loading polymer app into an iOS WKWebView fails

2016-05-02 Thread Jim Trainor
I am not aware of any override on WKWebView that permits file:// access.

I’m the second person to have posted this as a bug on the  Apache Cordova
bug tracker. It is not hard to file other reports of people stumbling over
the lack of file:// support in WkWebView.  The embedded web server approach
seems to be the usual solution.  But that doesn’t capture the file:// XHR
requests.

… so… hmm…. head scratch… seems to be a blocker at the moment.


On Mon, May 2, 2016 at 3:22 PM, Eric Bidelman  wrote:

> On IOS (a polyfilled browser), the web components polyfill loads html
> imports using XHR. This means that from a webview, they're loaded from
> file:///, which is typically blocked by browsers/environments for security
> reasons.
>
> Unsure if there's an equivalent in ios, but in android webview, you can
> override this setting:
>
> https://www.polymer-project.org/0.5/articles/webview.html#tweaking-the-webview-settings
>
> The other option is to vulcanize your entire app (vulcanize index.html -o
> index.v.html) which removes all import requests.
>
> On Mon, May 2, 2016 at 12:10 PM Jim Trainor 
> wrote:
>
>>  am about to revisit this in depth… but… the last time I dug in there was
>> definitely an XHR load of an html file originating from polymer (from the
>> web component.min.js, actually, as I recall, which I am classifying
>> generically as “polymer”).
>>
>> As I recall the XHR request was loading html web components from its host
>> (I think it was loading the entire vulcanized html file). If that host url
>> happens to be file:// then that is what it used for the XHR request.  The
>> problem is… WKWebView rejects that access… so no-go for the Polymer app.
>>
>> If the page is loaded via an ordinary http request then all is well. The
>> exact same code loading via an Android WebView is fine also.  The problem
>> is limited to security restrictions in WKWebView. See the bug link that I
>> posted for more info.
>>
>> On Mon, May 2, 2016 at 12:34 PM, Karl Tiedt  wrote:
>>
>>> Nothing in polymer appears to reference file:// anything... this sounds
>>> like it may be a Cordova issue?
>>>
>>> -Karl Tiedt
>>>
>>> On Mon, May 2, 2016 at 9:17 AM, Jim Trainor <
>>> jim.trainor.kan...@gmail.com> wrote:
>>>
 Polymer applications fail to load in an iOS WKWebView, as supported by
 Cordova. The root cause of the problem is that WKWebView does not permit
 loading of content via file:.  Cordova's support for WKWebView bypasses
 this restriction by implementing a in-app web server to host the static
 content. Polymer fails because the polymer code tries to load a local,
 static, html file, using a file:// url via an XHR request. The file:// XHR
 request is rejected by WKWebView.

 This has turned into a blocking issue for publishing Polymer
 applications, using Cordova, on iOS.

 Does this sound familiar to anybody?

 Is there anyway to cleanly define the URL where Polymer loads elements
 (or whatever is loaded via the file:// XHR)?

 Here is the Apache bug: Allow WKWebView to proxy file:// url loading
 in XmlHttpRequest.open
 




 Follow Polymer on Google+: plus.google.com/107187849809354688692
 ---
 You received this message because you are subscribed to the Google
 Groups "Polymer" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to polymer-dev+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/polymer-dev/72dda4a2-5447-4dec-a4e7-b075a02927ad%40googlegroups.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to polymer-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/polymer-dev/CACDv4tDu6JrtF1TQcv_KtB1V_W%3Dfouhtbrv_AV6SaMGeLMTH9Q%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: [polymer-dev] loading polymer app into an iOS WKWebView fails

2016-05-02 Thread Eric Bidelman
On IOS (a polyfilled browser), the web components polyfill loads html
imports using XHR. This means that from a webview, they're loaded from
file:///, which is typically blocked by browsers/environments for security
reasons.

Unsure if there's an equivalent in ios, but in android webview, you can
override this setting:
https://www.polymer-project.org/0.5/articles/webview.html#tweaking-the-webview-settings

The other option is to vulcanize your entire app (vulcanize index.html -o
index.v.html) which removes all import requests.

On Mon, May 2, 2016 at 12:10 PM Jim Trainor 
wrote:

>  am about to revisit this in depth… but… the last time I dug in there was
> definitely an XHR load of an html file originating from polymer (from the
> web component.min.js, actually, as I recall, which I am classifying
> generically as “polymer”).
>
> As I recall the XHR request was loading html web components from its host
> (I think it was loading the entire vulcanized html file). If that host url
> happens to be file:// then that is what it used for the XHR request.  The
> problem is… WKWebView rejects that access… so no-go for the Polymer app.
>
> If the page is loaded via an ordinary http request then all is well. The
> exact same code loading via an Android WebView is fine also.  The problem
> is limited to security restrictions in WKWebView. See the bug link that I
> posted for more info.
>
> On Mon, May 2, 2016 at 12:34 PM, Karl Tiedt  wrote:
>
>> Nothing in polymer appears to reference file:// anything... this sounds
>> like it may be a Cordova issue?
>>
>> -Karl Tiedt
>>
>> On Mon, May 2, 2016 at 9:17 AM, Jim Trainor > > wrote:
>>
>>> Polymer applications fail to load in an iOS WKWebView, as supported by
>>> Cordova. The root cause of the problem is that WKWebView does not permit
>>> loading of content via file:.  Cordova's support for WKWebView bypasses
>>> this restriction by implementing a in-app web server to host the static
>>> content. Polymer fails because the polymer code tries to load a local,
>>> static, html file, using a file:// url via an XHR request. The file:// XHR
>>> request is rejected by WKWebView.
>>>
>>> This has turned into a blocking issue for publishing Polymer
>>> applications, using Cordova, on iOS.
>>>
>>> Does this sound familiar to anybody?
>>>
>>> Is there anyway to cleanly define the URL where Polymer loads elements
>>> (or whatever is loaded via the file:// XHR)?
>>>
>>> Here is the Apache bug: Allow WKWebView to proxy file:// url loading in
>>> XmlHttpRequest.open
>>> 
>>>
>>>
>>>
>>>
>>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Polymer" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to polymer-dev+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/polymer-dev/72dda4a2-5447-4dec-a4e7-b075a02927ad%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to polymer-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/CACDv4tDu6JrtF1TQcv_KtB1V_W%3Dfouhtbrv_AV6SaMGeLMTH9Q%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to polymer-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CACGqRCA2v%3DZHoE5ROT_OtgZ%2BvS8Kpt59nK_A-Ry-5R%3Dea8HT%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [polymer-dev] loading polymer app into an iOS WKWebView fails

2016-05-02 Thread Jim Trainor
 am about to revisit this in depth… but… the last time I dug in there was
definitely an XHR load of an html file originating from polymer (from the
web component.min.js, actually, as I recall, which I am classifying
generically as “polymer”).

As I recall the XHR request was loading html web components from its host
(I think it was loading the entire vulcanized html file). If that host url
happens to be file:// then that is what it used for the XHR request.  The
problem is… WKWebView rejects that access… so no-go for the Polymer app.

If the page is loaded via an ordinary http request then all is well. The
exact same code loading via an Android WebView is fine also.  The problem
is limited to security restrictions in WKWebView. See the bug link that I
posted for more info.

On Mon, May 2, 2016 at 12:34 PM, Karl Tiedt  wrote:

> Nothing in polymer appears to reference file:// anything... this sounds
> like it may be a Cordova issue?
>
> -Karl Tiedt
>
> On Mon, May 2, 2016 at 9:17 AM, Jim Trainor 
> wrote:
>
>> Polymer applications fail to load in an iOS WKWebView, as supported by
>> Cordova. The root cause of the problem is that WKWebView does not permit
>> loading of content via file:.  Cordova's support for WKWebView bypasses
>> this restriction by implementing a in-app web server to host the static
>> content. Polymer fails because the polymer code tries to load a local,
>> static, html file, using a file:// url via an XHR request. The file:// XHR
>> request is rejected by WKWebView.
>>
>> This has turned into a blocking issue for publishing Polymer
>> applications, using Cordova, on iOS.
>>
>> Does this sound familiar to anybody?
>>
>> Is there anyway to cleanly define the URL where Polymer loads elements
>> (or whatever is loaded via the file:// XHR)?
>>
>> Here is the Apache bug: Allow WKWebView to proxy file:// url loading in
>> XmlHttpRequest.open
>> 
>>
>>
>>
>>
>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to polymer-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/polymer-dev/72dda4a2-5447-4dec-a4e7-b075a02927ad%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to polymer-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CACDv4tDu6JrtF1TQcv_KtB1V_W%3Dfouhtbrv_AV6SaMGeLMTH9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [polymer-dev] loading polymer app into an iOS WKWebView fails

2016-05-02 Thread Karl Tiedt
Nothing in polymer appears to reference file:// anything... this sounds
like it may be a Cordova issue?

-Karl Tiedt

On Mon, May 2, 2016 at 9:17 AM, Jim Trainor 
wrote:

> Polymer applications fail to load in an iOS WKWebView, as supported by
> Cordova. The root cause of the problem is that WKWebView does not permit
> loading of content via file:.  Cordova's support for WKWebView bypasses
> this restriction by implementing a in-app web server to host the static
> content. Polymer fails because the polymer code tries to load a local,
> static, html file, using a file:// url via an XHR request. The file:// XHR
> request is rejected by WKWebView.
>
> This has turned into a blocking issue for publishing Polymer applications,
> using Cordova, on iOS.
>
> Does this sound familiar to anybody?
>
> Is there anyway to cleanly define the URL where Polymer loads elements (or
> whatever is loaded via the file:// XHR)?
>
> Here is the Apache bug: Allow WKWebView to proxy file:// url loading in
> XmlHttpRequest.open
> 
>
>
>
>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to polymer-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/72dda4a2-5447-4dec-a4e7-b075a02927ad%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to polymer-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CADNgbTFjPPVYEnwdN9K0x0TT1WxgtXhKtwat_mrRaO5-jaUGjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[polymer-dev] loading polymer app into an iOS WKWebView fails

2016-05-02 Thread Jim Trainor
Polymer applications fail to load in an iOS WKWebView, as supported by 
Cordova. The root cause of the problem is that WKWebView does not permit 
loading of content via file:.  Cordova's support for WKWebView bypasses 
this restriction by implementing a in-app web server to host the static 
content. Polymer fails because the polymer code tries to load a local, 
static, html file, using a file:// url via an XHR request. The file:// XHR 
request is rejected by WKWebView.

This has turned into a blocking issue for publishing Polymer applications, 
using Cordova, on iOS.

Does this sound familiar to anybody?

Is there anyway to cleanly define the URL where Polymer loads elements (or 
whatever is loaded via the file:// XHR)?

Here is the Apache bug: Allow WKWebView to proxy file:// url loading in 
XmlHttpRequest.open 





Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to polymer-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/72dda4a2-5447-4dec-a4e7-b075a02927ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.