Reviews for Header Editor
Header Editor by 泷涯, 道滿
Review by SkySkimmer
Rated 4 out of 5
by SkySkimmer, 7 years agothuerrsch 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;
}
}
177 reviews
- Rated 5 out of 5by Tempdirz, 2 months ago
- Rated 1 out of 5by Naz, 4 months agoYou have 1 job - add a header. Why are you substituting my header to lowercase without me wanting to do so?
- Rated 5 out of 5by 墨水, 4 months ago
- Rated 5 out of 5by mijni, 8 months ago
- Rated 5 out of 5by Remains, 8 months ago
- Rated 5 out of 5by 38咿, 9 months ago
- Rated 5 out of 5by lundbelt, 10 months ago
- Rated 5 out of 5by 野锡侧, a year ago
- Rated 5 out of 5by Firefox user 17968901, a year ago
- Rated 5 out of 5by tyt199, a year ago
- Rated 5 out of 5by Jessica45Jim, a year ago
- Rated 5 out of 5by Jesse, a year ago
- Rated 5 out of 5by Footmen, a year agoIt's great but please update a new version and enable Android support, it's completely compatible with Android.
- Rated 5 out of 5by Firefox user 18084131, a year ago
- Rated 5 out of 5by Firefox user 18032280, a year ago
- Rated 5 out of 5by Vani, a year ago
- Rated 4 out of 5by Seth Falco, 2 years ago
- Rated 3 out of 5by icejay, 2 years ago开启这个插件后会导致部分网站出现问题,例如Bing无法登录,Cloudflare的安全检测会无限循环。而且这个扩展已经3年没更新了!
- Rated 5 out of 5by Firefox user 9795528, 2 years ago
- Rated 5 out of 5by 唯尔青山., 2 years ago