mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
chore(screenshotter): Improve screenshotter for Safari (#3015)
* Fix when Docker returns IPv4 and IPv6 addresses * Ensure images load before screenshotting * Fix bugs from review * Update test/screenshotter/test.html Co-authored-by: ylemkimon <y@ylem.kim>
This commit is contained in:
@@ -172,7 +172,8 @@ if (!seleniumURL && opts.container) {
|
||||
guessDockerIPs();
|
||||
}
|
||||
seleniumPort = cmd("docker", "port", opts.container, seleniumPort);
|
||||
seleniumPort = seleniumPort.replace(/^.*:/, "");
|
||||
// Docker can output two lines, such as "0.0.0.0:49156\n:::49156"
|
||||
seleniumPort = seleniumPort.replace(/[^]*:([0-9]+)[^]*/, "$1");
|
||||
}
|
||||
if (!seleniumURL && seleniumIP) {
|
||||
seleniumURL = "http://" + seleniumIP + ":" + seleniumPort + "/wd/hub";
|
||||
@@ -493,7 +494,7 @@ function takeScreenshot(key) {
|
||||
function loadFonts() {
|
||||
driver.executeAsyncScript(
|
||||
"var callback = arguments[arguments.length - 1]; " +
|
||||
"load_fonts(callback);")
|
||||
"load_fonts_and_images(callback);")
|
||||
.then(waitThenScreenshot);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user