- Fix (Embedded editor): (Though embedding cross-origin iframes apparently

only working now in Chrome if same origin or if https?--at least not
  localhost of different ports), PDF export has been fixed (we download the
  PDF to workaround data URI limitations in Chrome)
- Fix (Embedded editor): Avoid using same origin shortcut if there is no
  global available to use (e.g., if using the modular editor)
- Fix (Embedded editor): Add events only after load is complete and
  svgCanvas is available; also log blocked error objects
- Enhancement: For PDF export, switch Chrome by default to "save" `outputType`
- Docs (JSdoc): Denote optional arguments
This commit is contained in:
Brett Zamir
2018-10-23 22:24:09 +08:00
parent 5b4dae0d30
commit a714c122d3
13 changed files with 68 additions and 41 deletions

View File

@@ -357,12 +357,13 @@ class EmbeddedSVGEdit {
* made compatile with all API functionality
*/
// We accept and post strings for the sake of IE9 support
let sameOrigin = false;
let sameOriginWithGlobal = false;
try {
sameOrigin = window.location.origin === t.frame.contentWindow.location.origin;
sameOriginWithGlobal = window.location.origin === t.frame.contentWindow.location.origin &&
t.frame.contentWindow.svgEditor.canvas;
} catch (err) {}
if (sameOrigin) {
if (sameOriginWithGlobal) {
// Although we do not really need this API if we are working same
// domain, it could allow us to write in a way that would work
// cross-domain as well, assuming we stick to the argument limitations