diff --git a/src/core/xfa/template.js b/src/core/xfa/template.js index 60d462dd5..2a7ed07a0 100644 --- a/src/core/xfa/template.js +++ b/src/core/xfa/template.js @@ -2257,7 +2257,7 @@ class Image extends StringObject { }; if (this.href) { - html.attributes.src = new URL(this.href); + html.attributes.src = new URL(this.href).href; return html; } diff --git a/src/display/api.js b/src/display/api.js index 062c474b5..ce7bac9d1 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1800,7 +1800,10 @@ class LoopbackPort { } return result; } - result = Array.isArray(value) ? [] : {}; + if (value instanceof URL) { + throw new Error(`LoopbackPort.postMessage - cannot clone: ${value}`); + } + result = Array.isArray(value) ? [] : Object.create(null); cloned.set(value, result); // Adding to cache now for cyclic references. // Cloning all value and object properties, however ignoring properties // defined via getter.