Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6131] Android web view issue: Unrecognized Content-Security-Policy directive 'worker-src'.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2019-05-04T05:42:57.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterKai Lu
AssigneeShak Hossain
Created2019-02-08T00:16:46.000+0000
Updated2019-05-04T05:42:57.000+0000

Description

Tested with the latest Ti SDK 7.5.0 Trying to integrate with Quickbooks login via the web view. The login page shows up correctly in the native android browser, iOS web view and in the desktop browser but in the android Ti web view it's a blank page. I can see from the web view's "load" event that the webview.html is loaded/set with the html source. Upon further checking the logs I find the following warnings/errors: [INFO] I/TiWebChromeClient.console: (main) [1704,119314] Unrecognized Content-Security-Policy directive 'worker-src'. [INFO] I/TiWebChromeClient.console: (0:https://pf.intuit.com/fp/tags?js=1&org_id=v60nf4oj&session_id=949264C37CC241B6BDDF0FB0D52820CE) [INFO] I/TiWebChromeClient.console: (main) [1230,120544] {color:red}Unrecognized Content-Security-Policy directive 'worker-src'.{color} [INFO] I/TiWebChromeClient.console: (0:about:blank) [INFO] I/TiWebChromeClient.console: (main) [26,120570] Unrecognized Content-Security-Policy directive 'worker-src'. [INFO] I/TiWebChromeClient.console: (0:about:blank) [INFO] I/TiWebChromeClient.console: (main) [8,120578] Unrecognized Content-Security-Policy directive 'worker-src'. [INFO] I/TiWebChromeClient.console: (0:about:blank) [WARN] chromium: [WARNING:mediasession.cc(376)] Duplicate id found. Reassigning from 101 to 127 [ERROR] eglCodecCommon: **** ERROR unknown type 0x29b45cb5 (glSizeof,80) [WARN] chromium: [WARNING:p2ptransportchannel.cc(487)] Jingle:Port[0xcb77f600:data:1:0:local:Net[any:0.0.0.x/0:Unknown]]: SetOption(5, 0) failed: 0 [WARN] chromium: [WARNING:p2ptransportchannel.cc(487)] Jingle:Port[0xcb77f400:data:1:0:local:Net[any:0:0:0:x:x:x:x:x/0:Unknown]]: SetOption(5, 0) failed: 0 [WARN] chromium: [WARNING:p2ptransportchannel.cc(487)] Jingle:Port[0xcb77f200:data:2:0:local:Net[any:0.0.0.x/0:Unknown]]: SetOption(5, 0) failed: 0 [WARN] chromium: [WARNING:p2ptransportchannel.cc(487)] Jingle:Port[0xcb77f000:data:2:0:local:Net[any:0:0:0:x:x:x:x:x/0:Unknown]]: SetOption(5, 0) failed: 0 [WARN] chromium: [WARNING:stunport.cc(393)] Jingle:Port[0xcb6afc80:data:1:0::Net[any:0:0:0:x:x:x:x:x/0:Unknown]]: StunPort: stun host lookup received error 0 [WARN] chromium: [WARNING:stunport.cc(393)] Jingle:Port[0xcb6afa00:data:2:0::Net[any:0:0:0:x:x:x:x:x/0:Unknown]]: StunPort: stun host lookup received error 0 [WARN] chromium: [WARNING:turnport.cc(666)] Jingle:Port[0xcd47a880:data:1:0:relay:Net[any:0:0:0:x:x:x:x:x/0:Unknown]]: TURN host lookup received error 0 [WARN] chromium: [WARNING:turnport.cc(666)] Jingle:Port[0xcd47a500:data:1:0::Net[any:0:0:0:x:x:x:x:x/0:Unknown]]: TURN host lookup received error 0 [WARN] chromium: [WARNING:turnport.cc(666)] Jingle:Port[0xcd47ba00:data:2:0:relay:Net[any:0:0:0:x:x:x:x:x/0:Unknown]]: TURN host lookup received error 0 [WARN] chromium: [WARNING:turnport.cc(666)] Jingle:Port[0xcd47bd80:data:2:0::Net[any:0:0:0:x:x:x:x:x/0:Unknown]]: TURN host lookup received error 0 [ERROR] chromium: [ERROR:stunport.cc(80)] Binding error response: class=4 number=1 reason='Unauthorized' [ERROR] chromium: [ERROR:stunport.cc(80)] Binding error response: class=4 number=1 reason='Unauthorized'

Attachments

FileDateSize
Screen Shot 2019-02-19 at 9.59.15 pm.jpg2019-02-19T11:01:04.000+0000160538

Comments

  1. Sharif AbuDarda 2019-02-08

    Hello, Please share a sample code for us to test the issue. Thanks.
  2. Kai Lu 2019-02-09

    Hi Sharif, Thanks for looking into this issue. I can share our sample project but due to it's a company project would it possible we share it privately? I can send you the file to your email (sdarda@axway.com) if you like.
  3. Kai Lu 2019-02-12

    Hi @Sharif AbuDarda, Not sure if you saw my last comment. Please let me know your preferred way of sharing my sample project. Thanks, Kai
  4. Rakhi Mitro 2019-02-12

    Hello [~kenjorai], Can you please share your project in Dropbox and share the link here to download.
  5. Kai Lu 2019-02-12

    Just invited Rakhi [rmitro@appcelerator.com] to access the sample code from my dropbox. Not able to share a private link as it's a free account. Please only share the code internally. Let me know if you did not get the invite. I've also sent Sharif an email yesterday with the sample project. Thanks!
  6. Rakhi Mitro 2019-02-18

    [~kenjorai], Yes. Tested the sample project provided by you. Failed to build the project and got the following error on console.
       [ERROR] :  TiExceptionHandler: (main) [11,10096] /app.js:41
       [ERROR] :  TiExceptionHandler:   var len = web.html.length;
       [ERROR] :  TiExceptionHandler:                      ^
       [ERROR] :  TiExceptionHandler: TypeError: Cannot read property 'length' of null
       [ERROR] :  TiExceptionHandler:     at WebView.success (/app.js:41:22)
       [ERROR] :  TiExceptionHandler:     at WebView.value (ti:/events.js:50:21)
       [ERROR] :  TiExceptionHandler:     at WebView.value (ti:/events.js:102:19)
       [ERROR] :  TiExceptionHandler:
       [ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
       [ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63)
       [ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:978)
       [ERROR] :  TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1207)
       [ERROR] :  TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:265)
       [ERROR] :  TiExceptionHandler:     ti.modules.titanium.ui.WebViewProxy.handleMessage(WebViewProxy.java:222)
       [ERROR] :  TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:104)
       [ERROR] :  TiExceptionHandler:     android.os.Looper.loop(Looper.java:166)
       [ERROR] :  TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:7425)
       [ERROR] :  TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
       [ERROR] :  V8Exception: Exception occurred at /app.js:41: Uncaught TypeError: Cannot read property 'length' of null
       
    Is this the correct sample test project?
  7. Kai Lu 2019-02-18

    Hi Rakhi, Yes, it is the correct sample project and it worked fine on my machine. I suppose you have a connection problem to the url due to your proxy or firewall I think. The error also demonstrates that the page cannot be loaded. The difference is mine is a blank page and yours won't even load the blank page. If you run it from iOS simulator it should show you the correct login screen.
  8. Rakhi Mitro 2019-02-19

    Hello [~kenjorai], Tested the project also on an iOS device. And find the following error:
       [ERROR] :  Script Error {
       [ERROR] :      column = 21;
       [ERROR] :      line = 41;
       [ERROR] :      message = "undefined is not an object (evaluating 'web.html.length')";
       [ERROR] :      sourceURL = "file:///var/containers/Bundle/Application/F83F017F-6945-4617-92AF-3BB913E15656/iosTest.app/app.js";
       [ERROR] :      stack = "    at success(/app.js:41:21)";
       [ERROR] :      toJSON = "<KrollCallback: 0x281dcdd00>";
       [ERROR] :  }
       
    Can you please double check your sample code?
  9. Kai Lu 2019-02-19

    Hi Rakhi, Thanks for your testing. That does seem a bit odd to me. I just launched the sample app and it worked just fine. It seems to me that you don't have a proper connection to the web site. If you copy and paste the url to your browser does it open correctly? If not, what's error message? !Screen Shot 2019-02-19 at 9.59.15 pm.jpg|thumbnail!
  10. Sharif AbuDarda 2019-02-19

    Hello [~rmitro]], Share with me the project. I will give it a try. Thanks.
  11. Kai Lu 2019-03-14

    Hi Sharif, How is it going with this issue? If you are having trouble getting the sample project please let me know.
  12. Sharif AbuDarda 2019-03-17

    Hello [~kenjorai], Can you give access to this email "sdarda@axway.com" or "shabudarda@gmail.com"? thanks.
  13. Kai Lu 2019-03-19

    Hi Sharif, Just shared the sample project to both of your emails. Please let me know if you have received it or not.
  14. Kai Lu 2019-05-03

    It appears to be due to some security reason enforced by the quickbooks to not allow the web view to access the login page. Please feel free to close the ticket. Thanks, Kai

JSON Source