@inertiajs/core 2.3.21 → 2.3.22

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.
package/dist/index.esm.js CHANGED
@@ -1793,6 +1793,7 @@ var modal_default = {
1793
1793
  iframe.style.borderRadius = "5px";
1794
1794
  iframe.style.width = "100%";
1795
1795
  iframe.style.height = "100%";
1796
+ iframe.setAttribute("sandbox", "allow-scripts");
1796
1797
  return { iframe, page: page2 };
1797
1798
  },
1798
1799
  show(html) {
@@ -1809,12 +1810,7 @@ var modal_default = {
1809
1810
  this.modal.appendChild(iframe);
1810
1811
  document.body.prepend(this.modal);
1811
1812
  document.body.style.overflow = "hidden";
1812
- if (!iframe.contentWindow) {
1813
- throw new Error("iframe not yet ready.");
1814
- }
1815
- iframe.contentWindow.document.open();
1816
- iframe.contentWindow.document.write(page2.outerHTML);
1817
- iframe.contentWindow.document.close();
1813
+ iframe.srcdoc = page2.outerHTML;
1818
1814
  this.listener = this.hideOnEscape.bind(this);
1819
1815
  document.addEventListener("keydown", this.listener);
1820
1816
  },
@@ -1871,12 +1867,7 @@ var dialog_default = {
1871
1867
  document.body.prepend(dialog);
1872
1868
  dialog.showModal();
1873
1869
  dialog.focus();
1874
- if (!iframe.contentWindow) {
1875
- throw new Error("iframe not yet ready.");
1876
- }
1877
- iframe.contentWindow.document.open();
1878
- iframe.contentWindow.document.write(page2.outerHTML);
1879
- iframe.contentWindow.document.close();
1870
+ iframe.srcdoc = page2.outerHTML;
1880
1871
  }
1881
1872
  };
1882
1873
 
@@ -3036,7 +3027,7 @@ function createHeadManager(isServer3, titleCallback, onUpdate) {
3036
3027
  return carry;
3037
3028
  }
3038
3029
  if (element.indexOf("<title ") === 0) {
3039
- const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/);
3030
+ const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/s);
3040
3031
  carry.title = title2 ? `${title2[1]}${titleCallback(title2[2])}${title2[3]}` : element;
3041
3032
  return carry;
3042
3033
  }