| Index: lib/devtools.js |
| =================================================================== |
| --- a/lib/devtools.js |
| +++ b/lib/devtools.js |
| @@ -270,37 +270,37 @@ |
| // If an added filter matches a request shown in the devtools panel, |
| // update that record to show the new filter. Ignore filters that aren't |
| // associated with any sub-resource request. There is no record for these |
| // if they don't already match. In particular, in case of element hiding |
| // filters, we also wouldn't know if any new element matches. |
| if (added) |
| { |
| - if (nonRequestTypes.indexOf(record.request.type) != -1) |
| + if (nonRequestTypes.includes(record.request.type)) |
| continue; |
| let filter = matchRequest(record.request); |
| - if (filters.indexOf(filter) == -1) |
| + if (!filters.includes(filter)) |
| continue; |
| record.filter = filter; |
| } |
| // If a filter shown in the devtools panel got removed, update that |
| // record to show the filter that matches now, or none, instead. |
| // For filters that aren't associated with any sub-resource request, |
| // just remove the record. We wouldn't know whether another filter |
| // matches instead until the page is reloaded. |
| else |
| { |
| - if (filters.indexOf(record.filter) == -1) |
| + if (!filters.includes(record.filter)) |
| continue; |
| - if (nonRequestTypes.indexOf(record.request.type) != -1) |
| + if (nonRequestTypes.includes(record.request.type)) |
| { |
| panel.port.postMessage({ |
| type: "remove-record", |
| index: i |
| }); |
| panel.records.splice(i--, 1); |
| continue; |
| } |