Html Component Error

Hi everyone !!!
I am using the html function window.print() . But when I do as directed there, I am getting an error in the console…

Here’s the code of html →

<!DOCTYPE html>
<html>
<body>

<button onclick="window.print()">Print this page</button>

</body>
</html>

The error I am getting is →
html:5 Ignored call to ‘print()’. The document is sandboxed, and the ‘allow-modals’ keyword is not set.

Thanks !!!

The message explains exactly what the problem is. Scripts in the HtmlComponent are sandboxed and certain functionality (e.g. print) is restricted .

Thanks Yisrael !!
So is there any other way to take a screenshot or a print function

Is there any function usable ???

@ajithkrr What do you mean by “any” function. A lot can be done in an HtmlComponent, but it is sandboxed and restricted .

A screenshot is not possible since an HtmlComponent can’t access the page. Print is not allowed.

@yisrael-wix I was asking if there is any npm or 3rd party services for the function…

@ajithkrr For print? Well, the problem is that Wix sites pretty much block access to the “machine” that the browser is running on. And, an NPM library that runs in the frontend has the same limitations as Corvid, and code embedded in an HtmlComponent.

You can make a feature request on the Wishlist Page .

@yisrael-wix Sure I will !