Vurdering for Header Editor
Header Editor av 泷涯, 道滿
Vurdering av SkySkimmer
Vurdering: 4 av 5
av SkySkimmer, 7 år sidanthuerrsch 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 vurderingar
- Vurdering: 5 av 5av Firefox user 14492264, 24 dagar sidan
- Vurdering: 5 av 5av Firefox user 16874451, 25 dagar sidan
- Vurdering: 5 av 5av Poligraf Poligrafovich Bouboulov, 3 månader sidan
- Vurdering: 5 av 5av igorlogius, 4 månader sidan
- Vurdering: 5 av 5av Tempdirz, 5 månader sidan
- Vurdering: 1 av 5av Naz, 8 månader sidanYou have 1 job - add a header. Why are you substituting my header to lowercase without me wanting to do so?
- Vurdering: 5 av 5av 墨水, 8 månader sidan
- Vurdering: 5 av 5av mijni, eit år sidan
- Vurdering: 5 av 5av Remains, eit år sidan
- Vurdering: 5 av 5av 38咿, eit år sidan
- Vurdering: 5 av 5av lundbelt, eit år sidan
- Vurdering: 5 av 5av 野锡侧, eit år sidan
- Vurdering: 5 av 5av Firefox user 17968901, eit år sidan
- Vurdering: 5 av 5av tyt199, eit år sidan
- Vurdering: 5 av 5av Jessica45Jim, eit år sidan
- Vurdering: 5 av 5av Jesse, 2 år sidan
- Vurdering: 5 av 5av Footmen, 2 år sidanIt's great but please update a new version and enable Android support, it's completely compatible with Android.
- Vurdering: 5 av 5av Firefox user 18084131, 2 år sidan
- Vurdering: 5 av 5av Firefox user 18032280, 2 år sidan
- Vurdering: 5 av 5av Vani, 2 år sidan