fix random characters showing on screenshot (#3238) devkennyy

* hide nocss and noscript elements when taking screenshot

* remove hidden class from elements
This commit is contained in:
smunky 2022-06-26 22:24:13 +10:00 committed by GitHub
parent 94bfd02e49
commit 4092d45887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -250,6 +250,8 @@ export async function screenshot(): Promise<void> {
$(".pageTest .ssWatermark").addClass("hidden");
$(".pageTest .ssWatermark").text("monkeytype.com");
$(".pageTest .buttons").removeClass("hidden");
$("noscript").removeClass("hidden");
$("#nocss").removeClass("hidden");
if (revertCookie) $("#cookiePopupWrapper").removeClass("hidden");
if (revealReplay) $("#resultReplay").removeClass("hidden");
if (Auth.currentUser == null) {
@ -288,6 +290,8 @@ export async function screenshot(): Promise<void> {
$("#notificationCenter").addClass("hidden");
$("#commandLineMobileButton").addClass("hidden");
$(".pageTest .loginTip").addClass("hidden");
$("noscript").addClass("hidden");
$("#nocss").addClass("hidden");
if (revertCookie) $("#cookiePopupWrapper").addClass("hidden");
try {
const paddingX = 50;