Bug 1744556 - [devtools] Avoid exception about server sent events when opening the browser toolbox. r=bomsy

Differential Revision: https://phabricator.services.mozilla.com/D132988
This commit is contained in:
Alexandre Poirot 2021-12-13 15:21:57 +00:00
Родитель 9acaa56a22
Коммит 032cb8a737
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -7,6 +7,10 @@
const ResourceCommand = require("devtools/shared/commands/resource/resource-command");
module.exports = async function({ targetFront, onAvailable }) {
if (!targetFront.getTrait("isBrowsingContext")) {
// This resource is only available on browsing-context targets.
return;
}
const eventSourceFront = await targetFront.getFront("eventSource");
eventSourceFront.startListening();