For the complete documentation index, see llms.txt. This page is also available as Markdown.

Screen.setSecure

Functional API setSecureScreenYou can use the same function with this as well.

Feature description

Block screen captures to protect sensitive information from leaking, or allow captures when needed.

enabledis trueIf enabled, block captures, falseif enabled, allow it.

Type

Screen.setSecure(options: SetSecureScreenOptions): Promise<{ enabled: boolean }>;

Params

interface SetSecureScreenOptions {
  enabled: boolean;
}

Response

The applied state { enabled: boolean } is returned in this form.

Example code

import { Screen } from "@apps-in-toss/web-framework";

const secureButton = document.querySelector("#secure-button");

secureButton.addEventListener("click", async () => {
  const result = await Screen.setSecure({ enabled: true });
  console.log(result.enabled); // true
});

Was this helpful?