I'm trying to open a link to a pdf in a cordova app, whether it be in the cordova app or in the native browser, to allow the customer download it.
The app is a website loaded in the cordova app :
cordova index.html :
<html>
...
<script>window.location.href="https://www.website.url";</script>
<script src="cordova.js"></script>
</html>
The link to the pdf is in a website, I don't have access to the cordova.js script in the website.
In android, when I click the link (<a href="document url" target="_blank"></a>
), nothing happens. I also tried to open a window (window.open(url)
). Nothing happens either.
The reason of this redirection is because we did several apps of the same website for several clients, and we don't wan't to embed the sources in the app to not have to update each app every time we resolve a bug or add a feature.