Bug 1361473 - Implemented new 'transferred-larger-than' filter; r=Honza

MozReview-Commit-ID: FBGj1YnMaJt

--HG--
extra : rebase_source : 440fea57f325de4a67e374bce3540a5c15882227
This commit is contained in:
Matt R 2017-05-07 01:05:20 +01:00
Родитель a8fdf57db1
Коммит 848f9b688d
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -43,6 +43,7 @@ const FILTER_FLAGS = [
"set-cookie-value",
"mime-type",
"larger-than",
"transferred-larger-than",
"is",
"has-response-header",
"regexp",
@ -98,6 +99,7 @@ function processFlagFilter(type, value) {
case "size":
case "transferred":
case "larger-than":
case "transferred-larger-than":
let multiplier = 1;
if (value.endsWith("k")) {
multiplier = 1024;
@ -165,6 +167,13 @@ function isFlagFilterMatch(item, { type, value, negative }) {
case "larger-than":
match = item.contentSize > value;
break;
case "transferred-larger-than":
if (item.fromCache) {
match = false;
} else {
match = item.transferredSize > value;
}
break;
case "mime-type":
match = item.mimeType.includes(value);
break;