[Greasemonkey] xmlhttp and overrideMimeType to solve non UTF-8 trouble

Johan Sundström oyasumi at gmail.com
Tue Jun 27 18:53:49 EDT 2006


> Way back there was a discussion on this list about sending (and
> getting) non UTF-8 encoded character strings from Firefox'
> XmlHTTPRequest transport.
>
> I was bitten by the same problem/bug (depending how you're looking at
> it), but found a workaround in Bugzilla (bug 337434).
>
> It boils down to a method, overrideMimeType, which lets you hard-code
> the character encoding for the request.
>
> IMHO, it would be very useful if this method could be exposed from
> GM_xmlhttpRequest we well. Any opinions from the GM devs on this one?

While I technically don't quite qualify as a GM dev, I'm very much in
agreement. Exposing that would be the pragmatic approach "on our end"
to enabling cross-site GM scripts that run into this problem to work
at all, prior to a proper fix for the underlying Mozilla bug (which
might remain for any amount of time, by the record so far -- and yes,
I'm aware anybody of us who care could probably step up and help them
fix it).

Thanks for the solution reminder, though; I have a few scripts to
rewrite from using GM_xmlhttpRequest to using plain XMLHttpRequest
(where possible), due to this very bug.

-- 
 / Johan Sundström, http://ecmanaut.blogspot.com/


More information about the Greasemonkey mailing list