зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1361473 - Implemented new 'transferred-larger-than' filter; r=Honza
MozReview-Commit-ID: FBGj1YnMaJt --HG-- extra : rebase_source : 440fea57f325de4a67e374bce3540a5c15882227
This commit is contained in:
Родитель
a8fdf57db1
Коммит
848f9b688d
|
@ -43,6 +43,7 @@ const FILTER_FLAGS = [
|
||||||
"set-cookie-value",
|
"set-cookie-value",
|
||||||
"mime-type",
|
"mime-type",
|
||||||
"larger-than",
|
"larger-than",
|
||||||
|
"transferred-larger-than",
|
||||||
"is",
|
"is",
|
||||||
"has-response-header",
|
"has-response-header",
|
||||||
"regexp",
|
"regexp",
|
||||||
|
@ -98,6 +99,7 @@ function processFlagFilter(type, value) {
|
||||||
case "size":
|
case "size":
|
||||||
case "transferred":
|
case "transferred":
|
||||||
case "larger-than":
|
case "larger-than":
|
||||||
|
case "transferred-larger-than":
|
||||||
let multiplier = 1;
|
let multiplier = 1;
|
||||||
if (value.endsWith("k")) {
|
if (value.endsWith("k")) {
|
||||||
multiplier = 1024;
|
multiplier = 1024;
|
||||||
|
@ -165,6 +167,13 @@ function isFlagFilterMatch(item, { type, value, negative }) {
|
||||||
case "larger-than":
|
case "larger-than":
|
||||||
match = item.contentSize > value;
|
match = item.contentSize > value;
|
||||||
break;
|
break;
|
||||||
|
case "transferred-larger-than":
|
||||||
|
if (item.fromCache) {
|
||||||
|
match = false;
|
||||||
|
} else {
|
||||||
|
match = item.transferredSize > value;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "mime-type":
|
case "mime-type":
|
||||||
match = item.mimeType.includes(value);
|
match = item.mimeType.includes(value);
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче