Android Question Javascript doesn't work right for a url

cbanks

Active Member
Licensed User
Longtime User
When I load the following url in a webview it displays a message saying there was an error instead of showing the controls to play the music. Anyone know how to get it to load correctly in a webview?


B4X:
Sub Globals
    Dim WebView1 As WebView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    WebView1.Initialize("WebView1_Click")
    Activity.LoadLayout("WebView")
    WebView1.LoadURL("https://www.churchofjesuschrist.org/media/radio/music-stream?lang=eng")
End Sub
 

drgottjr

Expert
Licensed User
Longtime User
this has nothing to do with javascript.

webview is not a replacement for your default browser.

if you look at the page in the developer tab of your desktop browser, you will see a number of errors. the biggest one has to do with a page that has been loaded using https loading other resources using http. there also appears to be some kind of login required. that one throws an error. while chrome may tend to gloss over such issues, webview (since it is not chrome and not meant to be used as a replacement for chrome) appears not to.

am attaching a screen cap from my desktop browser showing some of the errors.

if you can figure out what the deal is with the login, you might be able to get the thing to work, since that was the only statement which actually appears to throw an error.

unsolicited hint: if you know what you're doing, it might be possible to bypass that whole introduction page and go right to the music (i'm guessing that's what you're after). in many cases, the source of the media can be sitting in plain sight if you're comfortable combing through a webpage's source
 

Attachments

  • 2.png
    32.3 KB · Views: 135
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
here are the errors reported by the webview:
B4X:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Uncaught (in promise) auth not supported in https://www.churchofjesuschrist.org/api/dozr/authentication.js (Line: 7)
page finished
TypeError: window.dozrAuth.getAuth is not a function in https://s.go-mpulse.net/boomerang/9UX54-L57TE-34QD8-DURP5-GFD2R (Line: 10)
ERROR_BOUNDARY_ERROR_DERIVED in https://www.churchofjesuschrist.org/api/dozr/_next/static/chunks/pages/_app-215fdc693fdbfcdd6dc7.js (Line: 1)
page finished
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getItem') in https://siteintercept.qualtrics.com/dxjsmodule/11.94e7d7f0c6a48ca94c06.chunk.js?Q_CLIENTVERSION=1.67.0&Q_CLIENTTYPE=web&Q_BRANDID=www.churchofjesuschrist.org (Line: 1)

they're basically the same as what the desktop browser reports.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…