
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.
mock-browser-timezone
Advanced tools
A Javascript library to mock the browser's timezone using ECMAScript Internationalization API.
A Javascript library to mock the browser's timezone using ECMAScript Internationalization API.
Many modern browsers use the Intl API to get the desired IANA timezone string which depicts the current browser timezone.
This library is specifically designed to mock the browser timezone, assisting to test the relevant code which uses the Intl
API.
npm install mock-browser-timezone --save-dev
yarn add mock-browser-timezone -D
For a better implementation of mock-browser-timezone
, have a look at mock-browser-timezone.js
file.
const {
registerTimezone,
registerAbbreviatedTimezone,
reset,
} = require('mock-browser-timezone');
// Mocking the timezone using IANA timezone string.
registerTimezone('Europe/Paris');
reset(); // Default back to the orginal value.
new Intl.DateTimeFormat().resolvedOptions().timeZone; // Europe/Paris
registerAbbreviatedTimezone('CET');
new Intl.DateTimeFormat([], {
timeZoneName: 'short',
})
.formatToParts(date)
.find((locale) => locale.type === 'timeZoneName').value; // CET
reset(); // Default back to the orginal abbreviated timezone value.
A list of supported IANA formatted timezones as well as abbreviated timezones can be found at timezones.json
.
FAQs
A Javascript library to mock the browser's timezone using ECMAScript Internationalization API.
The npm package mock-browser-timezone receives a total of 52 weekly downloads. As such, mock-browser-timezone popularity was classified as not popular.
We found that mock-browser-timezone 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.