Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/public/wasm/compiler-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@
* Handle incoming messages from the main thread.
*/
self.onmessage = async function (event) {
// Only accept messages from the same origin (or the dedicated-worker
// empty-string origin) to prevent cross-origin attacks.
if (event.origin && event.origin !== self.location.origin) {
return;
}

var msg = event.data;

if (msg.type !== 'compile') {
Expand Down
Loading