Files
gotenberg/test/integration/testdata/feature-rich-html-remote/index.html
Daniel Moran 3220ca4140 feat(chromium): add waitForSelector option to Chromium conversions (#1446)
* Add `waitForSelector` option to Chromium conversions

Closes #960

As an alternative to waiting on an expression, this allows users to wait
for a specific node matching a selector to become visible in the HTML /
at the remote URL before converting to PDF.

* Fix style / prettify
2026-01-17 14:57:10 +01:00

71 lines
1.9 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- net::ERR_CONNECTION_REFUSED -->
<link
rel="stylesheet"
type="text/css"
href="http://localhost:100/style.css"
/>
<title>Feature Rich HTML</title>
<style>
@media print {
#screen {
display: none;
}
}
@media screen {
#print {
display: none;
}
}
</style>
</head>
<body>
<p id="wait" style="display: none">
Wait delay > 2 seconds or expression window globalVar === 'ready' returns
true.
</p>
<p id="print">Emulated media type is 'print'.</p>
<p id="screen">Emulated media type is 'screen'.</p>
<p id="javascript" style="display: none">JavaScript is enabled.</p>
<iframe src="file:///etc/passwd"></iframe>
<script type="application/javascript">
var globalVar = "notReady";
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
delay(2000).then(() => {
const waitText = document.getElementById("wait");
waitText.style.display = "contents";
window.globalVar = "ready";
const newText = document.createElement("p");
newText.id = "wait-selector";
newText.textContent = "Wait on selector returns true.";
waitText.parentNode.insertBefore(newText, waitText);
});
</script>
<script type="application/javascript">
document.getElementById("javascript").style.display = "contents";
</script>
<script type="application/javascript">
console.log("a simple message");
console.debug("a debug message");
console.warn("a warning message");
console.error("an error message");
</script>
<script type="application/javascript">
throw new Error("Exception 1");
</script>
<script type="application/javascript">
throw new Error("Exception 2");
</script>
</body>
</html>