Android Question Webview with Gitbook

lip

Active Member
Licensed User
Longtime User
I got someone to spend the 2020 lockdown documenting my system in Gitbook, then added a Webview in my B4A App to allow users to see it. This is a great way to include professional live documentation in the App. It worked brilliantly for a while then a few months ago it stopped. The webview just whirls without ever loading, but I did not get any error logs. I've now started getting some logs which look like they might help but I don't understand them.

The code is pretty simple

App code:
    Dim WebViewExtras1 As WebViewExtras
        WebViewExtras1.addJavascriptInterface(wv_HelpPopup, "B4A")
        WebViewExtras1.addWebChromeClient(wv_HelpPopup, "")
    
    Private wv_HelpPopup As WebView
    wv_HelpPopup.LoadUrl(GitbookURL)


The new logs (on loading the App) are as follows:

Logs:
Load URL: https://help.liteip.com/liteip-documentation/-MZHzbCzgiXb-jxxPGYZ
It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.
For the module builds, these are available in the following manner
(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):
CommonJS Modules:
const firebase = require('firebase/app');
require('firebase/<PACKAGE>');
ES Modules:
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
Typescript:
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
 in https://gstatic.gitbook.com/js/326.f9997185.js (Line: 1)
Timer 5s: wv_HelpPopup.url = https://app.gitbook.com/@liteip/s/liteip-documentation/
Uncaught (in promise) Error: The current environment does not support the specified persistence type. in https://gstatic.gitbook.com/js/326.f9997185.js (Line: 1)
PageFinished: wv_HelpPopup.url = https://app.gitbook.com/@liteip/s/liteip-documentation/
url = https://app.gitbook.com/@liteip/s/liteip-documentation/
Application ready in https://gstatic.gitbook.com/js/326.f9997185.js (Line: 1)
LogRocket: Session quota exceeded. Please upgrade your plan. Disabling ... in https://gstatic.gitbook.com/js/326.f9997185.js (Line: 1)
 

lip

Active Member
Licensed User
Longtime User
LogRocket? Any idea what this is?

I'm guessing something to do with WebView Exttras, which is what I guess is giving me the logs?

The problem I'm having is not with getting logs now, it's with the webview not showing the page (which shows perfectly in Chrome on the same tablet).

The error that looks interesting to me is "The current environment does not support the specified persistence type. in https://gstatic.gitbook.com/js/326.f9997185.js"?
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
when you load https://help.liteip.com/liteip-documentation/-MZHzbCzgiXb-jxxPGYZ,
a massive .js file is downloaded (https://gstatic.gitbook.com/js/326.f9997185.js)
if you load that url in your desktop browser and have the afternoon free, you can
see all the messages you saw in your app's log (thanks to webviewextras).

logrocket is some kind of online service specializing in log entries...

i think liteip.com may be the one who needs to upgrade its status with logrocket.
it also looks (to me) like liteip.com may have changed something which used to work
to something that now doesn't. they wouldn't be the first.

if you look at the liteip.com page source, you'll see a reference to firebase. that
reference is noticed by the .js file when it runs, and it sees something it doesn't
like about it. hence the log message you see in your app.

unfortunately, you have no control over any of this. an app with a webview that loads
a url is not responsible for errors on the other side of the network (unless the app's
author also wrote the webpage and the .js file, which - i'm guessing - is not you).

do you know how to use chrome's developer tools (on the desktop)? i would start
there by loading the original url and go from there. unless you're doing something in the
app that you haven't told us about, there is nothing you can do about the situation except
tell the authorities about the messages you're getting. it's difficult to say for sure who
those authorities might be, but my guess is liteip.com holds the key. i could only get as
far as the login page, so i can't follow the trail. if you had to document the error messages,
it might be more productive to capture them from chrome's developer's tab. you might
only be getting a portion of the picture from your app's log.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…