Prevent browser from prompting for file download when opening CSS file in iFrame?
问题 I have a web app which loads an arbitrary page or file into an iFrame. Under some browsers, when pointing the iFrame's src to a css file, instead of displaying the css text, a "download/open file" prompt appears. Is there any way to prevent this? I understand the valid security reasons for not downloading or opening a non-text file by default, but a css file or any text/* filetype should be safe enough (safer than HTML in fact!) The css file's response header looks like the following: Content