catlab-remote-client 5.4.2 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,11 @@
17
17
  <script src="scripts/worker-env.js"></script>
18
18
  <script>
19
19
  (function () {
20
- var post = function (m) { window.parent.postMessage(m, '*'); };
20
+ // Raw boot records (loading, require errors, fatal) go to this page's
21
+ // own origin only, like every message on the pool port (#89); a file://
22
+ // page has origin "null" and can only use '*'.
23
+ var origin = window.location.origin && window.location.origin !== 'null' ? window.location.origin : '*';
24
+ var post = function (m) { window.parent.postMessage(m, origin); };
21
25
  // vendor is resolved by RequireJS RELATIVE TO baseUrl, so from
22
26
  // scripts/ the vendor tree next to it is '../vendor/' — 'vendor/'
23
27
  // would ask for dist/scripts/vendor/... and 404 (Ruling P2-15).