
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
browserslist-config-sfgov
Advanced tools
A shareable list of the browsers supported by San Francisco Digital Services
This is a shareable list of the browsers supported by the San Francisco Digital Services, for use with tools that support browserslist, such as autoprefixer, postcss-preset-env, Babel, and eslint-plugin-compat.
This list is automatically generated from analytics data, and is tailored to support 99% of browsers used within the last year by visitors to sf.gov.
To use this config, first install browserslist-config-sfgov
as a development
dependency:
npm install --save-dev browserslist-config-sfgov
Then, in the browserslist
field of your package.json
, your
.browserslistrc
, or any of the other supported browserslist config
locations, use:
extends browserslist-config-sfgov
For example, in your package.json
:
+ "browserslist": ["extends browserslist-config-sfgov"]
You can add entries to the list if you'd like to support specific browsers. You may exclude
specific browsers from your own config with the not
prefix, e.g. to exclude
Internet Explorer entirely in your .browserslistrc
:
extends browserslist-config-sfgov
not ie
This package uses browserslist-ga-export to convert a CSV export from
Google Analytics into browserslist-stats.json
,
which is read when browserslist encounters the in my stats
identifier from
index.js
. The update process is manual:
Install the dev dependencies with npm install
Follow the CSV export instructions from browserslist-ga-export
Copy your CSV export to the data
directory, e.g. as data/stats.csv
Run browserslist-ga-export
on the CSV file:
npx browserslist-ga-export --reportPath=data/stats.csv
You should see a success message in your terminal and a diff in
browserslist-stats.json
. Add the CSV export
and your changes, commit them, then file a pull
request.
You can automate the updating of the stats, but it's complicated because Google Analytics doesn't provide a way to export custom reports via the API. (Aaaaarrrgh Google, why?) Here's the workaround:
Create a new Google Sheet
Add the Google Analytics add-on
Create a new report from the Sheets menu bar: Add-ons
→ Google Analytics
→ Create new report
. This will create a new worksheet that houses your report's configuration (not the report data itself).
Set the following options in your report:
Option | Value |
---|---|
Report Name | "Browser stats" (for instance) |
Start Date | 30daysAgo (or use a different period) |
End Date | yesterday |
Metrics | :pageviews |
Dimensions | ga:operatingSystem,ga:operatingSystemVersion,ga:browser,ga:browserVersion,ga:deviceCategory |
Order | -ga:pageviews |
Limit | 1000 (or go lower for less coverage) |
Run your report from the Sheets menu bar: Add-ons
→ Google Analytics
→ Run reports
Set up the report to run periodically: Add-ons
→ Google Analytics
→ Schedule reports
Set up a Google service account to access the Google Sheets API
Share the Sheet with the email address of your new service account
In your environment (.env
locally), set up the following variables:
GOOGLE_SHEET_ID
: your sheet's ID (in the URL between /sheets/d/
and /edit#...
)GOOGLE_CREDS_JSON
: your Google service account credentials JSON, on a single lineTest the export script with script/export-browser-stats
Test the whole update process with npm run update
Figure out where to run this in the cloud
😅
FAQs
A shareable list of the browsers supported by San Francisco Digital Services
We found that browserslist-config-sfgov 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
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.