domready icon indicating copy to clipboard operation
domready copied to clipboard

Error on android Webview

Open falltodis opened this issue 8 years ago • 2 comments

DomReady worked before the webview on Android 4.4 ,But not work for Android 5+

falltodis avatar May 05 '16 09:05 falltodis

what is the error you get?

juliangruber avatar May 08 '16 20:05 juliangruber

I guess if (typeof module != 'undefined') module.exports = definition() else if (typeof define == 'function' && typeof define.amd == 'object') define(definition) else this[name] = definition() may make the problem , I can not get error detail and when I replace domready with a sample code bellow

function domready(fn) {
    var readyState = document.readyState;
    if (readyState === 'interactive' || readyState === 'complete') {
        fn(); 
    } else {
        window.addEventListener('DOMContentLoaded', fn); 
    }
};

It will work! Android Webview after 4.4 is based on chromium , I searched for more infos but there is not related message

falltodis avatar May 09 '16 08:05 falltodis