pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.32k stars 1.64k forks source link

Popup downloadable url sometimes not loading #364

Closed pmrajani closed 4 years ago

pmrajani commented 4 years ago

I am using this plugins latest version to load my report website. after few page loading completed i can comes to http://domain.com/5446oaidww0e/myreport.pdf url and this can be some time .doc file or .exl file. If i install fresh app in phone first time i can detect this url in onLoadStart

But if i try to go back to homescreen and again come to my webpage and generate report this is not load on onLoadStart

Browser works correct every time it's download my report file.

I am using same example code from repo, just replaced url with mine.

Here is flutter doctor

[√] Flutter (Channel stable, v1.17.1, on Microsoft Windows [Version 10.0.18363.836], locale en-IN)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.44.2)
[√] Connected device (1 available)

• No issues found!
pichillilorenzo commented 4 years ago

Have you tried the onDownloadStart event to intercept your file (in that case, you need to enable it: useOnDownloadStart: true)??

pmrajani commented 4 years ago

i am using latest plugins flutter_inappwebview: ^3.2.0

seems like there is no option for enable useOnDownloadStart: true

@pichillilorenzo

pichillilorenzo commented 4 years ago

Yes, there is:

initialOptions: InAppWebViewGroupOptions(
    crossPlatform: InAppWebViewOptions(
      debuggingEnabled: true,
      useOnDownloadStart: true
    ),
),

Then, you can listen the onDownloadStart event:

onDownloadStart: (controller, url) {
  print(url);
}
pmrajani commented 4 years ago

thanks it's works @pichillilorenzo

I was finding downloadable url on OnPageStartmethod. But it's always retrieved on onDownloadStart

github-actions[bot] commented 1 month ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.