mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-10 17:32:15 +01:00
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
This commit is contained in:
@@ -37,8 +37,14 @@
|
||||
|
||||
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
|
||||
delay(2000).then(() => {
|
||||
document.getElementById("wait").style.display = "contents";
|
||||
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>
|
||||
|
||||
|
||||
@@ -46,8 +46,14 @@
|
||||
|
||||
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
|
||||
delay(2000).then(() => {
|
||||
document.getElementById("wait").style.display = "contents";
|
||||
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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user