Revisiones de Header Editor
Header Editor por 泷涯, 道滿
Revisado por SkySkimmer
Se valoró con 4 de 5
por SkySkimmer, hace 7 añosthuerrsch said
>Here I set up a single, simple rule to "Modify the response header", match type "All", execute type "normal", to always set the "Content-Disposition" header type to a value of "inline". That's it, two minutes to set up the whole thing, and it works beautifully!
This is also what I wanted to use this extension for, but this simple solution will remove the filename information which may be passed in that header. Instead I used the following custom function which mostly works. Note that the "tobytes" call is necessary otherwise on unicode strings firefox complains about too-high charcodes.
function tobytes (str) {
let res = "";
for (let i = 0; i < str.length; ++i) {
let code = str.charCodeAt(i);
if (code > 255) {
res += encodeURI(str[i]);
}
else {
res += str[i];
}
}
return res;
}
for (let a in val) {
if (val[a].name.toLowerCase() === 'content-disposition') {
let orig = val[a].val
console.log("orig: " + val[a].value);
let res = val[a].value.replace(/^attachment/iu, "inline");
res = tobytes(res);
console.log("res: " + res);
val[a].value = res;
}
}
>Here I set up a single, simple rule to "Modify the response header", match type "All", execute type "normal", to always set the "Content-Disposition" header type to a value of "inline". That's it, two minutes to set up the whole thing, and it works beautifully!
This is also what I wanted to use this extension for, but this simple solution will remove the filename information which may be passed in that header. Instead I used the following custom function which mostly works. Note that the "tobytes" call is necessary otherwise on unicode strings firefox complains about too-high charcodes.
function tobytes (str) {
let res = "";
for (let i = 0; i < str.length; ++i) {
let code = str.charCodeAt(i);
if (code > 255) {
res += encodeURI(str[i]);
}
else {
res += str[i];
}
}
return res;
}
for (let a in val) {
if (val[a].name.toLowerCase() === 'content-disposition') {
let orig = val[a].val
console.log("orig: " + val[a].value);
let res = val[a].value.replace(/^attachment/iu, "inline");
res = tobytes(res);
console.log("res: " + res);
val[a].value = res;
}
}
180 revisiones
- Se valoró con 5 de 5por Usuario de Firefox 14492264, hace un mes
- Se valoró con 5 de 5por Usuario de Firefox 16874451, hace un mes
- Se valoró con 5 de 5por Poligraf Poligrafovich Bouboulov, hace 3 meses
- Se valoró con 5 de 5por igorlogius, hace 4 meses
- Se valoró con 5 de 5por Tempdirz, hace 6 meses
- Se valoró con 1 de 5por Naz, hace 8 mesesYou have 1 job - add a header. Why are you substituting my header to lowercase without me wanting to do so?
- Se valoró con 5 de 5por 墨水, hace 8 meses
- Se valoró con 5 de 5por mijni, hace un año
- Se valoró con 5 de 5por Remains, hace un año
- Se valoró con 5 de 5por 38咿, hace un año
- Se valoró con 5 de 5por lundbelt, hace un año
- Se valoró con 5 de 5por 野锡侧, hace un año
- Se valoró con 5 de 5por Usuario de Firefox 17968901, hace un año
- Se valoró con 5 de 5por tyt199, hace un año
- Se valoró con 5 de 5por Jessica45Jim, hace un año
- Se valoró con 5 de 5por Jesse, hace 2 años
- Se valoró con 5 de 5por Footmen, hace 2 añosIt's great but please update a new version and enable Android support, it's completely compatible with Android.
- Se valoró con 5 de 5por Usuario de Firefox 18084131, hace 2 años
- Se valoró con 5 de 5por Usuario de Firefox 18032280, hace 2 años
- Se valoró con 5 de 5por Vani, hace 2 años