diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/plugin_scripts_js/InterceptAjaxRequestJS.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/plugin_scripts_js/InterceptAjaxRequestJS.java index 2ec2e0178..6e4d729d4 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/plugin_scripts_js/InterceptAjaxRequestJS.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/plugin_scripts_js/InterceptAjaxRequestJS.java @@ -53,7 +53,7 @@ public static PluginScript createInterceptOnlyAsyncAjaxRequestsPluginScript(bool " reader.addEventListener('loadend', function() { " + " callback(new Uint8Array(reader.result));" + " });" + - " reader.readAsArrayBuffer(blob);" + + " reader.readAsArrayBuffer(request.response);" + " return;" + " case 'document':" + " callback(request.response.documentElement.outerHTML);" + diff --git a/flutter_inappwebview_ios/ios/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift b/flutter_inappwebview_ios/ios/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift index 28ebb58b3..8fbe6a3e6 100644 --- a/flutter_inappwebview_ios/ios/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift +++ b/flutter_inappwebview_ios/ios/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift @@ -55,7 +55,7 @@ let INTERCEPT_AJAX_REQUEST_JS_SOURCE = """ reader.addEventListener('loadend', function() { callback(new Uint8Array(reader.result)); }); - reader.readAsArrayBuffer(blob); + reader.readAsArrayBuffer(request.response); return; case 'document': callback(request.response.documentElement.outerHTML); diff --git a/flutter_inappwebview_macos/macos/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift b/flutter_inappwebview_macos/macos/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift index 4a68e9b6b..dc5cd82ed 100644 --- a/flutter_inappwebview_macos/macos/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift +++ b/flutter_inappwebview_macos/macos/Classes/PluginScriptsJS/InterceptAjaxRequestJS.swift @@ -56,7 +56,7 @@ let INTERCEPT_AJAX_REQUEST_JS_SOURCE = """ reader.addEventListener('loadend', function() { callback(new Uint8Array(reader.result)); }); - reader.readAsArrayBuffer(blob); + reader.readAsArrayBuffer(request.response); return; case 'document': callback(request.response.documentElement.outerHTML);