From d6e4c7c1ea77af7423369da84e2848f98726bb04 Mon Sep 17 00:00:00 2001 From: Luka Jeran Date: Fri, 15 Oct 2021 05:01:36 +0200 Subject: [PATCH] Ignore messages other than from iframe parent --- mitm.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mitm.html b/mitm.html index 04450a9..f3141dd 100644 --- a/mitm.html +++ b/mitm.html @@ -60,6 +60,11 @@ function onMessage (event) { let { data, ports, origin } = event + // Ignore messages other than from iframe parent (e.g. extensions) + if (event.source !== window.parent) { + return + } + // It's important to have a messageChannel, don't want to interfere // with other simultaneous downloads if (!ports || !ports.length) {