Friday, 21 August 2015

android webview local storage accessing


My webview get this error today:

          I/chromium﹕ [INFO:CONSOLE(1151)] "Uncaught TypeError: Cannot read property 'abc' of null", source: https://xxn/xx.xx.js (1151)

I found line 1151 is:

    window.localStorage.abc

It is going to access local storage, to give this permission, i should do:

webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setDatabaseEnabled(true);

No comments:

Post a comment