diff --git a/content/install-hook-userstylesworld.js b/content/install-hook-userstylesworld.js index 4552f75c..66801e12 100644 --- a/content/install-hook-userstylesworld.js +++ b/content/install-hook-userstylesworld.js @@ -29,9 +29,9 @@ }, }); - window.addEventListener('message', ({data, source}) => { - // Accepting events only from this page. - if (data && source === window) { + window.addEventListener('message', ({data, source, origin}) => { + // Some browser don't reveal `source` to extensions e.g. Firefox + if (data && (source ? source === window : origin === ORIGIN)) { const fn = HANDLERS[data.type]; if (fn) fn(data); }