On 2013-10-02 08:26, Gauri Spears wrote:
Some sites send .webm video with wrong Content-Type|(text/plain
|instead of |video/webm|). As a result, HTML5 webm video isn't played.
I want to write script, which does the following:
1. listen to HTTP requests for .webm files from current page;
2. intercept HTTP response;
3. change Content-Type _before_ browser understands that it is incorrect.
Is it possible to do it with Greasemonkey?
Greasemonkey can only modify the HTML page (DOM tree), it does not
intercept the browser-server communication and cannot modify it. You
could use Greasemonkey to rewrite video links to go through a proxy
server (potentially one running on localhost) that does the rewriting,
but if you go down that path it's probably easier to just let the proxy
server handle all requests and take care of the header rewriting.
--
Klaus Johannes Rusch
[email protected]
http://klausrusch.atmedia.net/
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/groups/opt_out.