I am using webview 2 in an app right now and just came across this.
I have to do a bit of web dev then test it in the mobile app, In my first run of testing on a mobile device I had to test basic functionality and interface functionality. I have to say I expected issues, things such as interface format, sizing issues, some code not working, etc. I HAD NONE OF THAT! So thank you for doing such a wonderful job on this object.
I did realize that some of my links were not working in the mobile app which lead to a test. I have 6 of them in this test...
1. Download a pdf file using the download attribute in the link
2. Load a PDF file in the browser window.
3. Load a PDF file in a new window, using target="_blank".
4. Download a HTML file using the download attribute in the link.
5. Load a HTML file in the browser window.
6. Load a HTML file in a new window, using target="_blank".
They all work in a web browser just as they are described (chrome/edge).
In Webview, running the frame in windows.
All the pdf links download the file.
The HTML Links
Link 4 loads the page rather than downloads it.
Link 5 & 6 load the page as expected.
In Webview, running as a mobile app
All the pdf links do nothing
The HTML Links
Link 5 loads the page as it should
Link 6 loads the page in the same window
I am sure this is my ignorance but...
I expected a web browser window to open when target="_blank" was used regardless of the file type.
I did not know what to expect trying to load a pdf file but did at least expect the chance to download on mobile.
I did not expect using the download attribute would prevent the download from working as it's an HTML 5 standard.
I have added the MFA file for a mobile app that loads a web page with all 6 links.
Please help me understand what is happening here and how I can get a PDF file to download through clicking a link.