WebView Error

72 views
Skip to first unread message

Oarabile Koore

unread,
Jul 27, 2023, 4:41:06 AM7/27/23
to DroidScript
Using cfg.Fast on my browser app, the error Cannot read property indexOf of null is returned, the code that brings that error is
function getDomainName() {
    let url = web.GetUrl()
    var  domain;
    //find & remove protocol (http, ftp, etc.) and get domain
    if (url.indexOf("://") > -1) {
        domain = url.split('/')[2];
    } else {
        domain = url.split('/')[0];
    }
    //find & remove port number
    domain = domain.split(':')[0];
    //find & remove www subdomain
    domain = domain.replace(/^www\./i, '');
    //find & remove query string
    domain = domain.split('?')[0];
    return domain;
}

please help me fix that error:

Steve Garman

unread,
Jul 27, 2023, 5:56:44 AM7/27/23
to DroidScript
cfg.Fast makes use of the J2V8 engine which increases the apps execution speed but does not have all the same facilities as the regular engine

That is why cfg.Fast is not the default

If your code does not work with cfg.Fast you will probably need to remove cfg.Fast from your code
Commenting it out will not work

If you need to test with and without cfg.Fast frequentl I suggest temporarily changing it to
cfg.xFast

More about cfg.Fast in the
  Docs > Introduction > Coding features
or at
https://symdstools.github.io/Docs/docs/intro/04CodingFeatures.htm
Reply all
Reply to author
Forward
0 new messages