Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Listen for user screenshot events.
my.onUserCaptureScreen(() => { console.log('User took a screenshot'); });
Page({ onLoad() { my.onUserCaptureScreen(() => { my.confirm({ title: 'Screenshot Captured', content: 'Would you like to share this screenshot?', confirmButtonText: 'Share', cancelButtonText: 'Cancel', success: (res) => { if (res.confirm) { my.showSharePanel(); } } }); }); }, onUnload() { my.offUserCaptureScreen(); } });
App({ onLaunch() { my.onUserCaptureScreen(() => { // Log screenshot event for analytics this.logEvent('screenshot_taken', { page: getCurrentPages().pop()?.route, timestamp: Date.now() }); }); }, logEvent(name, data) { my.request({ url: 'https://api.example.com/analytics', method: 'POST', data: { event: name, ...data } }); } });
Page({ onLoad() { if (this.data.containsSensitiveInfo) { my.onUserCaptureScreen(() => { my.alert({ title: 'Privacy Notice', content: 'This page contains sensitive information. Please be careful when sharing screenshots.' }); }); } }, onUnload() { my.offUserCaptureScreen(); } });