Hello,
I am trying to write an extension to offer an alternative in the download
dialog "view in browser".
For instance, apache returns the mime type "text/x-python" for python
scripts, which triggers the download dialog.
It would be useful in this case to be able to display them in browser
(instead of browsing for an editor and open them separately).
For this to work, I was trying to override the returned mime type by
setting it to text/plain. I tried to call
setResponseHeader("Content-Type", "text/plain", false) on the request I
intercepted with the "http-on-examine-merged-response" observer, but I am
getting chrome errors (I guess it is not allowed to change the content
type from that place).
The other working alternative would be to fetch the target file with
XMLHttpRequest and display it from "responseText". But this would not
display the content asynchronously and is problematic for large files.
Do you have an idea how to solve this problem ?
Thanks,
Ricky
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network