
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
usescreenshot-react
Advanced tools
React hook allows you to take screenshots of webpages or parts of it
Supply Chain Security
Vulnerability
Quality
Maintenance
License
React hook allows you to take screenshots of webpages or parts of it
Using npm
npm install --save usescreenshot-react
import {useScreenshot, createFileName} from "usescreenshot-react";
See example folder
import React, {useRef} from "react";
import {useScreenshot} from 'usescreenshot-react';
const Example = () => {
const {image, takeScreenshot, isLoading, isError} = useScreenshot();
const ref = useRef<HTMLDivElement>(null);
const getImage = () => {
if (!ref.current) {
return
}
takeScreenshot(ref.current, {
backgroundColor: null,
logging: false,
}).catch(console.log);
}
return isLoading ? (
<div>Loading...</div>
) : (
<div>
{isError && <p>Error</p>}
<div ref={ref}/>
<h1>Capture Me</h1>
{image && <img src={image} alt={'Screenshot'}/>}
<button onClick={getImage}>Take screenshot</button>
</div>
);
}
createFileName(extension: string, name?: string): string
- return file name. If the name is not specified, then the current date is returned
useScreenshot(type?: string, quality?: number)
type
- String indicating the image format. The default format type is image/pngquality
- A number between 0 and 1The use useScreenshot
hook returns an object containing the following properties:
image: string | undefined
- Screenshot in base64 formattakeScreenshot = (captureRef: HTMLElement, options?: Options) => Promise<string>
- Function for creating screenshot from html node and return image stringisLoading: boolean
- Indicates if the screenshot is loadingisError: boolean
- Indicates whether an error occurred during screenshot loadingclear = (): void
- Clear screenshot stringtakeScreenshot(captureRef: HTMLElement, options?: Options)
captureRef
- Ref to the HTMLElement for which to for which the screenshot should be takenoptions
- configuration html2canvas options to take a screenshotMIT © n0mver
FAQs
React hook allows you to take screenshots of webpages or parts of it
The npm package usescreenshot-react receives a total of 12 weekly downloads. As such, usescreenshot-react popularity was classified as not popular.
We found that usescreenshot-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.