@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.js CHANGED
@@ -1851,6 +1851,7 @@ var modal_default = {
1851
1851
  iframe.style.borderRadius = "5px";
1852
1852
  iframe.style.width = "100%";
1853
1853
  iframe.style.height = "100%";
1854
+ iframe.setAttribute("sandbox", "allow-scripts");
1854
1855
  return { iframe, page: page2 };
1855
1856
  },
1856
1857
  show(html) {
@@ -1867,12 +1868,7 @@ var modal_default = {
1867
1868
  this.modal.appendChild(iframe);
1868
1869
  document.body.prepend(this.modal);
1869
1870
  document.body.style.overflow = "hidden";
1870
- if (!iframe.contentWindow) {
1871
- throw new Error("iframe not yet ready.");
1872
- }
1873
- iframe.contentWindow.document.open();
1874
- iframe.contentWindow.document.write(page2.outerHTML);
1875
- iframe.contentWindow.document.close();
1871
+ iframe.srcdoc = page2.outerHTML;
1876
1872
  this.listener = this.hideOnEscape.bind(this);
1877
1873
  document.addEventListener("keydown", this.listener);
1878
1874
  },
@@ -1929,12 +1925,7 @@ var dialog_default = {
1929
1925
  document.body.prepend(dialog);
1930
1926
  dialog.showModal();
1931
1927
  dialog.focus();
1932
- if (!iframe.contentWindow) {
1933
- throw new Error("iframe not yet ready.");
1934
- }
1935
- iframe.contentWindow.document.open();
1936
- iframe.contentWindow.document.write(page2.outerHTML);
1937
- iframe.contentWindow.document.close();
1928
+ iframe.srcdoc = page2.outerHTML;
1938
1929
  }
1939
1930
  };
1940
1931
 
@@ -3094,7 +3085,7 @@ function createHeadManager(isServer3, titleCallback, onUpdate) {
3094
3085
  return carry;
3095
3086
  }
3096
3087
  if (element.indexOf("<title ") === 0) {
3097
- const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/);
3088
+ const title2 = element.match(/(<title [^>]+>)(.*?)(<\/title>)/s);
3098
3089
  carry.title = title2 ? `${title2[1]}${titleCallback(title2[2])}${title2[3]}` : element;
3099
3090
  return carry;
3100
3091
  }