When using the Microsoft Edge browser, by default when you open a PDF it will open the PDF in a new tab using the built-in PDF viewer. To avoid this, you can adjust the browser's settings: Toggle on the "Always open PDF files externally" option. This works great. However, it presents a separate issue. Our internal applications use embedded PDFs in iframes. When the external toggle is set to on, these PDFs will not show in the iframes. This doesn't happen in Chrome. Has anyone else experienced this and know a work around?
I've tried removing the type="application/pdf" from the iframe tag to no avail. I can't find anything else online.
It looks like an expected result because you have enabled the option Always open PDF files externally.
So MS Edge browser is giving you an option to download the PDF file and open it using the desired app.
You said this doesn't happen in Chrome browser.
If you enabled the Download PDF files instead of automatically opening them in Chrome option then you will notice the same result in the Chrome browser.
Output in the Chrome browser:
If you click on the Open button then it will download the PDF file.
I did not get any solution or a workaround for this issue.
If you think that there should be an option to load the file in an iframe if Always open PDF files externally option is enabled then I suggest you click on the Send Feedback button in the MS Edge browser and try to provide your feedback about it to the Microsoft.
I posted feedback suggesting that an exclusion/inclusion list be in included but the simplest way would be to treat the frame as part of the session. But this is not Microsoft it is the Chrome projects issue.
There are some HTML files (no pattern that I've figured out) that I can't open via the terminal, GUI or right clicking Open in Browser via Sublime Text 3.
The default browser to open the file is definitely set to Chrome. When I say to open the file in the browser it takes me to the Chrome window, but doesn't actually open the file I want.
I can open these files in Chrome itself via command + O and in Firefox or Safari by right clicking on the file and selecting them in the GUI.
It'd be great if Chrome would open files when I expect it to. I'd appreciate any help.
I had the same problem. Fixed it by running this in the terminal after closing Chrome:
open /Applications/Google\ Chrome.app --args --allow-file-access-from-files
The command line args can be viewed in Chrome by visiting chrome://version/
Chrome didn't load local files for me before running this command, but for some reason Chrome Canary did.
On your mac, right click the file and choose 'Open with' and then choose 'other'. Change the default to 'Safari' and then check the 'Always Open With' box. Click open. This should launch the file in Safari. Close the file in the browser and verify that double-clicking it will open it in Safari. Now do the same thing again except change the default back to Chrome.
You may have some security issue if you downloaded the *.html file from somewhere else.
None of the previous answers worked for me, but this one did:
On your Mac, choose Apple menu >> System Preferences >> click Security & Privacy >> click Privacy.
Select Files and Folders.
Please select the checkbox below the Nicepage application to access files and folders in that location.
Source: https://nicepage.com/doc/84207/access-denied-for-documents-folder-macos
Good luck, lads
it's a problem of extend attributes. If you use ls -l to see the attributes of your file, you will see some weird # .
ls -l xxxx.html
-rwxr-xr-x#
the solution is to use xattr.
xattr -c filename
xattr -rc directory
The solution provided by Xiaoou Wang works.
Explanation
I would like to extend this answer and provide below a different solution, which was not given yet.
Chrome (Mac) indeed does not open .html files that have the extended attribute com.apple.quarantine. This attribute is automatically applied on files that are downloaded from the web and are not Apple-authorized applications.
From the terminal, by typing
xattr 'your .html file name'
you can verify whether your .html file has the quarantine attribute set.
With xattr -c command you will remove all attributes, in case there are others set. If you want to only remove the quarantine attribute, type instead
xattr -d com.apple.quarantine 'your .html file name'
Alternative solution
This alternative solution might be even simpler for some people. With my Chrome (mac) I can open .html files by simply dragging the file from finder onto an already opened Chrome window, in spite of their com.apple.quarantine attribute. Important: It does not work if you drag the file onto Chrome's icon in the dock.
There might be an issue with your permissions settings. I tried everything and this is worked for me:
Open your Google Chrome Browser:
click Chrome,
open Preferences,
click Privacy and Security,
click Advanced (at the bottom),
scroll down to "Downloads",
under Location click the Change button.
Then choose where the file you are attempting to open is saved.
you can open this html file and try "command + option + I" to see the file content in the console window, if it's real html file there will be source code reveal. i don't think it can be the chrome's problem.
I have a HTML file on my server with a link to it from outlook.
Is there a way in HTML or Javascript to force the page to always open in Chrome. I know the systems have Chrome installed by default.
Double clicking your file will automatically open it in your default browser. If you'd like it to open in Google Chrome you need to set Chrome as your default browser.
I don't know of a way in HTML/Javascript.
well holding the shift key down and clicking on the link may do the trick assuming chrome is your default browser
i have a .zip file sitting on an IIS 6 webserver.
i have an html file with a link to that zip file like this:
Download File
When you open the page and click the link in firefox or chrome, you get the Open or Save dialog box as expected.
When you do the same in Internet Explorer 8, you navigate to a new page that displays the "contents" of the zip file as text (unreadable characters). This happens on at least 3 machines that were tested.
Any idea why this would be happening in IE or what i need to do to fix it?
Changing IE settings is not an option since we do not control the settings of who goes to our site. Changing the HTML or javascript on the page with link is an option.
Thanks for the help!
You may need to set the MIME type of the file. To do so, go to IIS6 Manager for the website. Go to Properties for the site (right-click on the website name for Properties in the menu). Click the HTTP Headers tab. Click the MIME Types... button.
From there, you should be able to add .zip as an extension. I'm not entirely sure which MIME type will work best, but application/zip and application/x-zip are two options to try.
I'm trying to link a pdf document from a static html file.
What I'm using is:
My pdf File
the open/save dialog comes up in firefox but not in IE7 or IE8.
I believe I have to change the MIME type but I don't know where to change it...
Since it works in Firefox I assume the file is actually there and accessible. In that case it depends on the browser settings how the download is handled. It might be that the download happens in the background because you setup that it should automatically download everything into a predefined folder (e.g. My Downloads/).
Check the IE settings to see where it puts downloads and check the folder to see if downloaded the file.