within a function of my code I am trying to open a new tab with pdf. I precisely want the pdf to be shown in the browser, vs it being downloaded, but the browser are instead downloading. I have disabled my browsers settings to download pdf files vs showing them, so that can't be the issue.
The relevant part of the code is simple:
if (isMobile) {
newTab.location = redirectUrl;
} else {
window.location = redirectUrl;
}
It works for mobile, but downloads it on desktop. The url is a pdf that is stored on a AWS S3 cloud.
Is there a way to ensure the pdf is opened in the browser, vs downloading it?