fix: Add proper html skeleton to preview iframe

This will prevent Quircks compatibility CSS rules from beeing applied, which leads to differences in preview/print-view
This commit is contained in:
maheini 2025-06-15 01:57:56 +02:00
parent 7d8e70e1ad
commit e6d9966514
No known key found for this signature in database
GPG key ID: BA903CC6A2987331

View file

@ -50,6 +50,19 @@ frappe.ui.form.PrintView = class {
`
);
const htmlSkeleton = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
</body>
</html>
`;
document.querySelector("iframe.print-format-container").srcdoc = htmlSkeleton;
this.print_settings = frappe.model.get_doc(":Print Settings", "Print Settings");
this.setup_menu();
this.setup_toolbar();