Socket
Socket
Sign inDemoInstall

clipboard-img

Package Overview
Dependencies
3
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    clipboard-img

一个用来复制图片的工具包


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

clipboard

a tool for copying images

install

npm i clipboard-img -S

use

import {copy} from 'clipboard-img'

support

copy('可以是一个图片链接').then()
copy('可以是一个图片Dom元素(img标签)').then()
copy('可以是一个包含多个dom的dom元素').then()
copy('可以是一个base64编码的图片').then()

Simple example

<div id="con">
    <img src="" />
    <h1>复制复制</h1>
</div>

// 脚本中
copy(document.getElementById('con')).then()

compatibility

[浏览器兼容]https://caniuse.com/?search=%20Navigator%20API%3Aclipboard

Keywords

FAQs

Last updated on 08 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc