uø ÌmayIÅURLðwèµÄæX·éuserContent.jsXNvgvðGreasemonkeyÅன·ï¿½}ƪūܵ½B
data URI scheme¾ÆNXhCÌâèÍÈ©Á½ÌÅAæð ç©ï¿½ï¿½ßbase64ɵÄ�N¯ÎGreasemonkeyÅாë¤ÆvÁÄ
img.src = input.value.substr(0, 5) === "data:" ? input.value : input.value + "?" + (new Date()).getTime();
̪ð
if (input.value.substr(0, 5) === "data:") {
img.src = input.value;
} else if (typeof GM_xmlhttpRequest === "function") {
GM_xmlhttpRequest({
method: "GET",
url: input.value,
overrideMimeType: "text/plain",
onload: function(response) { img.src = "data:image/png;base64," + btoa(response.responseText); }
});
} else {
img.src = input.value + "?" + (new Date()).getTime();
}
Ƶ½ç¡xÍbtoa()
Å"String contains an invalid character"Æ��¤G[ªoܵ½B
iFirefoxÌjbtoa()
ÍÜÁ½ï¿½ï¿½µ©Ï·Å«È��çµï¿½ï¿½Å·BJavascriptÅæt@Càbase64ÉÏ··éÉÍ
ÈÇÌXNvgª 黤ŷªAGreasemonkeyÅÌg��ûªí©èܹñŵ½B¯ï¿½ï¿½æ¤ÉJavascriptÅæt@Càbase64ÉÏ·µÄ��é
- XMLHttpRequestÅt@CðDataSchemeÅæ¾·éÀ�} »Ì3 (Kanasansoft Web Lab.)
- oCiæðDataURIÉÏ· - prog*sig
ÌÏ·ªð»ÌÜÜ^µÄ
if (input.value.substr(0, 5) === "data:") {
img.src = input.value;
} else if (typeof GM_xmlhttpRequest === "function") {
GM_xmlhttpRequest({
method: "GET",
url: input.value,
overrideMimeType: "text/plain; charset=x-user-defined",
onload: function(response) { img.src = "data:image/png;base64," + btoa(response.responseText.replace(/[\u0100-\uffff]/g, function(c) { return String.fromCharCode(c.charCodeAt(0)&0xff); })); }
});
} else {
img.src = input.value + "?" + (new Date()).getTime();
}
Ƶ½ç®«Üµ½B
btoa()
ÅÍεÄ��È����ðu«·¦éÙ©ÉAoverrideMimeType
Å"text/plain"
��áÈ"text/plain; charset=x-user-defined"
ÆwèµÈ��Æ��¯È��æ¤Å·B
- Windows XP SP3AFirefox 3.6AGreasemonkey 0.8.20100408.6AÅmFµÜµ½B
- Windows XP SP3AFirefox 3.6AuserChromeJS 1.1ATuXNvg[_ȵAuserContent.js 1.3 mod6AuserContent.pl.jsȵAGM_modoki.jslȵAÅmFµÜµ½B