| 718 | }, |
| 719 | |
| 720 | async filterCompletions(request) { |
| 721 | const completer = completers[request.completerName]; |
| 722 | let response = await completer.filter(request); |
| 723 | |
| 724 | // NOTE(smblott): response contains `relevancyFunction` (function) properties which cause |
| 725 | // postMessage, below, to fail in Firefox. See #2576. We cannot simply delete these methods, |
| 726 | // as they're needed elsewhere. Converting the response to JSON and back is a quick and easy |
| 727 | // way to sanitize the object. |
| 728 | response = JSON.parse(JSON.stringify(response)); |
| 729 | |
| 730 | return response; |
| 731 | }, |
| 732 | |
| 733 | refreshCompletions(request) { |
| 734 | const completer = completers[request.completerName]; |