Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@uni/clipboard
Advanced tools
[![npm](https://img.shields.io/npm/v/@uni/clipboard.svg)](https://www.npmjs.com/package/@uni/clipboard)
$ npm install @uni/clipboard --save
or
$ npm install @uni/apis --save
import { getClipboard } from '@uni/clipboard';
getClipboard({
success (res){
console.log(res.text);
}
});
// promise
getClipboard().then(res => {
console.log(res.text);
});
getClipboard()
获取系统剪贴板的内容
h5 暂不支持此方法
成员 | 类型 | 描述 | 必选 | 默认值 |
---|---|---|---|---|
options | object | ✔️ | - | |
options.success | Function | 成功的回调 | ✘ | - |
options.fail | Function | 失败的回调 | ✘ | - |
options.complete | Function | 结束的回调 (调用成功、失败都会执行) | ✘ | - |
成员 | 类型 | 描述 |
---|---|---|
res | object | |
res.text | string | 剪贴板的内容 |
设置系统剪贴板的内容。
import { setClipboard } from '@uni/clipboard';
setClipboard({
text: 'text',
success (res){
console.log(res);
}
});
// promise
setClipboard({
text: 'text'
}).then(res => {
console.log(res);
});
成员 | 类型 | 描述 | 必选 | 默认值 |
---|---|---|---|---|
options | object | ✔️ | - | |
options.text | string | 剪切板数据 | ✔️ | - |
options.success | Function | 成功的回调 | ✘ | - |
options.fail | Function | 失败的回调 | ✘ | - |
options.complete | Function | 结束的回调 (调用成功、失败都会执行) | ✘ | - |
FAQs
[![npm](https://img.shields.io/npm/v/@uni/clipboard.svg)](https://www.npmjs.com/package/@uni/clipboard)
The npm package @uni/clipboard receives a total of 566 weekly downloads. As such, @uni/clipboard popularity was classified as not popular.
We found that @uni/clipboard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.