Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
mark scripts as shareable cross-origin #25380
This fixes an issue in Electron where errors were being incorrectly sanitized on their way to
process.nextTick(() => throw new Error('hi')) window.onerror = e => console.log(e)
was printing "Script error" instead of "Uncaught Error: hi"
This is due to origin-checking logic in Blink: https://chromium.googlesource.com/chromium/src/+/71.0.3578.123/third_party/blink/renderer/core/execution_context/execution_context.cc#114
cc @joyeecheung who is
To clarify, I'm not 100% sure this is the right approach (perhaps Electron should somehow be injecting a correct origin for these scripts?) but it does fix the issue and I'm not aware of the context for deciding to mark scripts as non-cross-origin-shareable in node (if any—it seems not relevant to most non-Electron node.js use cases)
Yes, I think so.