From ba13bd8c2daa3c6afeb89178aec2d99dccd6135f Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 22 May 2021 09:57:44 +0200 Subject: [PATCH] [XFA] Send `URL`s as strings, rather than objects (issue 1773) Given that `URL`s aren't supported by the structured clone algorithm, see https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm, the document in issue 1773 will cause the browser to throw `DataCloneError: The object could not be cloned.`-errors and nothing will render. To fix this, we'll instead simply send the stringified version of the `URL` to prevent these errors from occuring. --- src/core/xfa/template.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/xfa/template.js b/src/core/xfa/template.js index e147cd5b8..cf1095093 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; }