Đánh giá cho Header Editor
Header Editor bởi 泷涯, 道滿
Đánh giá bởi SkySkimmer
Xếp hạng 4 trong số 5
bởi SkySkimmer, 8 năm trướcthuerrsch 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;
}
}
182 đánh giá
- Xếp hạng 5 trong số 5bởi 肉肉, 8 tháng trước
- Xếp hạng 5 trong số 5bởi Người dùng Firefox 14492264, 9 tháng trước
- Xếp hạng 5 trong số 5bởi Người dùng Firefox 16874451, 9 tháng trước
- Xếp hạng 5 trong số 5bởi Poligraf Poligrafovich Bouboulov, một năm trước
- Xếp hạng 5 trong số 5bởi Tempdirz, một năm trước
- Xếp hạng 5 trong số 5bởi 墨水, một năm trước
- Xếp hạng 5 trong số 5bởi mijni, 2 năm trước
- Xếp hạng 5 trong số 5bởi Remains, 2 năm trước
- Xếp hạng 5 trong số 5bởi 38咿, 2 năm trước
- Xếp hạng 5 trong số 5bởi lundbelt, 2 năm trước
- Xếp hạng 5 trong số 5bởi 野锡侧, 2 năm trước
- Xếp hạng 5 trong số 5bởi Người dùng Firefox 17968901, 2 năm trước
- Xếp hạng 5 trong số 5bởi tyt199, 2 năm trước
- Xếp hạng 5 trong số 5bởi Jessica45Jim, 2 năm trước
- Xếp hạng 5 trong số 5bởi Jesse, 2 năm trước
- Xếp hạng 5 trong số 5bởi Footmen, 2 năm trướcIt's great but please update a new version and enable Android support, it's completely compatible with Android.
- Xếp hạng 5 trong số 5bởi Người dùng Firefox 18084131, 2 năm trước