cloudfour / cloudfour/pleasantest
Add user.copy/user.paste
- Dominant language
- TypeScript
- Stars
- 175
- Forks
- 2
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
This example is from Puppeteer's docs to copy text:
```js
await browser
.defaultBrowserContext()
.overridePermissions('', ['clipboard-read', 'clipboard-write']);
// The clipboard API does not allow you to copy, unless the tab is focused.
await page.bringToFront();
await page.evaluate(() => {
// Copy the selected content to the clipboard
document.execCommand('copy');
// Obtain the content of the clipboard as a string
return navigator.clipboard.readText();
});
```
Since it is so complicated, maybe we should implement `user.copy()` that does all this automatically. Paste probably is also as complicated, so maybe `user.paste()` too.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.