Header Editor のレビュー
Header Editor 作成者: 泷涯、 道滿
SkySkimmer によるレビュー
5 段階中 4 の評価
SkySkimmer によるレビュー (7年前)thuerrsch 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;
}
}
合計レビュー数: 179
- 5 段階中 5 の評価Firefox ユーザー 14492264 によるレビュー (1ヶ月前)
- 5 段階中 5 の評価Firefox ユーザー 16874451 によるレビュー (1ヶ月前)
- 5 段階中 5 の評価Poligraf Poligrafovich Bouboulov によるレビュー (3ヶ月前)
- 5 段階中 5 の評価Firefox ユーザー 17968901 によるレビュー (1年前)
- 5 段階中 5 の評価Jessica45Jim によるレビュー (2年前)
- 5 段階中 5 の評価Firefox ユーザー 18084131 によるレビュー (2年前)
- 5 段階中 5 の評価Firefox ユーザー 18032280 によるレビュー (2年前)
- 5 段階中 4 の評価Seth Falco によるレビュー (2年前)