For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/js-api/device/screen/onUserCaptureScreen.md.

onUserCaptureScreen

监听用户主动截屏事件。

扫码预览

扫码预览 onUserCaptureScreen

支持版本

前端库版本不低于 0.0.26。

支持平台

平台支持情况
Android支持
iOS支持
PC不支持
HarmonyOS不支持

支持场景

场景支持情况
页面支持
卡片不支持

使用说明

  • 事件不携带截图内容,仅通知发生了截屏

调用方式

事件监听 API

onUserCaptureScreen(callback: (event: UserCaptureScreenEvent) => void): () => void

入参

无。

调用示例

import { onUserCaptureScreen } from '@doubao-dev/framework/api';

const off = onUserCaptureScreen(() => {
  console.log('用户截屏了');
});

off();

回调参数

无。

返回值

无返回字段。

回调示例

{}