@capawesome/capacitor-screenshot

中文文档
8.0.3发布于 2026/09/11MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 7715

Capacitor plugin for taking screenshots on Android, iOS, and Web.

原始使用文档
文档目录18 节
  1. Features
  2. Use Cases
  3. Compatibility
  4. Installation
  5. Usage
  6. Take a screenshot
  7. API
  8. take()
  9. Interfaces
  10. FAQ
  11. What does the take method return on each platform?
  12. Why do I need to install html2canvas?
  13. Can I prevent screenshots of my app?
  14. Can I use this plugin with Ionic, React, Vue or Angular?
  15. Related Plugins
  16. Newsletter
  17. Changelog
  18. License

Capacitor Screenshot Plugin

Capacitor plugin for taking screenshots.

Features

The Capacitor Screenshot plugin is one of the most capable screen capture solutions for Capacitor apps. Here are some of the key features:

  • 🖥️ Cross-platform: Supports Android, iOS, and Web.
  • 📸 Easy screenshots: Simple one-method API for taking screenshots.
  • 🌐 Web support: Uses html2canvas for web platform screenshot capture.
  • 📱 Native capture: High-quality native screenshot capture on mobile.
  • 🤝 Compatibility: Works alongside the File Opener, Photo Editor and Privacy Screen plugins.
  • 🔁 Up-to-date: Always supports the latest Capacitor version.

Missing a feature? Just open an issue and we'll take a look!

Use Cases

The Screenshot plugin is typically used whenever an app needs to capture its own screen, for example:

  • Bug reporting and feedback: Attach a screenshot of the current screen to bug reports or feedback forms.
  • Sharing app content: Capture achievements, results, or other screens so users can share them.
  • Support tickets: Capture the current state of the app to help your support team reproduce issues.

Compatibility

Plugin VersionCapacitor VersionStatus
8.x.x>=8.x.xActive support

Installation

You can use our AI-Assisted Setup to install the plugin. Add the Capawesome Skills to your AI tool using the following command:

npx skills add capawesome-team/skills --skill capacitor-plugins

Then use the following prompt:

 Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-screenshot` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands:

npm install @capawesome/capacitor-screenshot html2canvas
npx cap sync

Usage

The following example shows how to take a screenshot of the current screen.

Take a screenshot

Take a screenshot of the current screen. The result contains the file path of the screenshot on Android and iOS, or a data URI on the Web:

import { Screenshot } from '@capawesome/capacitor-screenshot';

const take = async () => {
  const { uri } = await Screenshot.take();
  console.log('Screenshot saved at:', uri);
};

API

take()

take() => Promise<TakeResult>

Take a screenshot.

Returns: Promise<TakeResult>

Since: 6.0.0


Interfaces

TakeResult

PropTypeDescriptionSince
uristringThe file path (Android and iOS) or data URI (Web) of the screenshot.6.0.0

FAQ

What does the take method return on each platform?

On Android and iOS, the take() method returns the file path of the captured screenshot. On the Web, it returns a data URI instead, since the screenshot is rendered with html2canvas in the browser.

Why do I need to install html2canvas?

The html2canvas package is only required if you use the plugin on the Web platform, where it is used to render the screenshot. On Android and iOS, the screenshot is captured natively and html2canvas is not needed. See the Installation section for details.

Can I prevent screenshots of my app?

No, this plugin only takes screenshots. If you want to block screenshots, hide sensitive app content in the app switcher, or detect when a screenshot is taken, use the Privacy Screen plugin instead.

Can I use this plugin with Ionic, React, Vue or Angular?

Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.

  • File Opener: Open a file with the default application.
  • Photo Editor: Let the user edit a photo, for example a captured screenshot.
  • Privacy Screen: Hide sensitive app content in the app switcher, block screenshots, and detect when a screenshot is taken.

Newsletter

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our Capawesome Newsletter.

Changelog

See CHANGELOG.md.

License

See LICENSE.

版本与发布记录

@capawesome/capacitor-screenshot 共发布 8 个版本,首次发布于 2025/01/08;过去 12 个月发布了 5 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
8.0.3latest2026/09/111 个月前
8.0.22026/09/022 个月前
8.0.12026/02/198 个月前
8.0.02025/12/1710 个月前
7.0.0-dev.1765885034dev2025/12/1610 个月前
7.0.12025/02/011.8 年前

关于 @capawesome/capacitor-screenshot 的常见问题

@capawesome/capacitor-screenshot 是什么?

Capacitor plugin for taking screenshots on Android, iOS, and Web.

如何安装 @capawesome/capacitor-screenshot?

在项目目录运行 npm install @capawesome/capacitor-screenshot,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@capacitor/core(>=8.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@capawesome/capacitor-screenshot 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@capawesome/capacitor-screenshot 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@capawesome/capacitor-screenshot 可以商用吗?

@capawesome/capacitor-screenshot 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@capawesome/capacitor-screenshot 的下载量有多少?

根据 npm 官方下载统计,@capawesome/capacitor-screenshot 在 2026/10/09 – 2026/11/07 这 30 天内被下载 7,715 次,日均约 257 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@capawesome/capacitor-screenshot 还在维护吗?

最新版本 8.0.3 发布于 2026/09/11(1 个月前);至今共发布 8 个版本,其中过去 12 个月发布了 5 个;首次发布于 2025/01/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。