Is there a way to get the current page’s content/mime type from the DOM?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Firefox (or any other Gecko based web browser) has the
document.contentTypeattribute.To do it in a standards-based way you’d have to check the headers and see if there is a meta tag with attribute
http-equiv="content-type"and interpret its content. Otherwise you’re out of luck.