# jpillora/xdomain

A pure JavaScript CORS alternative

Repository: https://github.com/jpillora/xdomain
Canonical: https://ross.abutalabs.com/products/xdomain
Homepage: https://jpillora.com/xdomain/
Language: JavaScript
License Family: other
Topics: cross-domain, cors, javascript, xhr
Last push: 2025-09-15T17:12:18+00:00

## Health v2 (maintenance only)
Score: 51/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 42, release rhythm 35, longevity 100
- inputs: {"age_days": 4895, "days_push": 352, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3147, forks 258 (observed 2026-08-28T04:07:46.027588+00:00)

## What it is
XDomain is a pure JavaScript CORS alternative that enables cross-domain XHR by routing requests through a hidden iframe and a small proxy.html on the remote domain. It hooks window.XMLHttpRequest via XHook so it works transparently with libraries like jQuery and Angular.

## Use cases
- make cross-domain ajax requests without server CORS headers
- access S3 or Dropbox file APIs directly from the browser
- support cross-origin XHR in old browsers like IE8/9
- avoid modifying server code for cross-domain API calls
- white-list specific domains and paths for cross-domain access

## When to choose
- you cannot add CORS headers to the remote server
- you need to support legacy browsers lacking full CORS support
- you want drop-in cross-domain XHR with jQuery, Angular, or raw XHR

## When to avoid
- you can simply configure CORS headers on the server
- you need modern fetch API support
- you require a actively developed solution with strong security guarantees

## Facets
- artifact type: library
- maturity: maintenance
- function: http-client, middleware
- domain: web-development, frontend, apis
- platform: browser
- tags: cors-alternative, xhr, cross-domain, proxy-html, ie8-polyfill, javascript

## Member repositories
- jpillora/xdomain (main) score 51

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:46.027588+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:25:56.564632+00:00, confidence not recorded.
  - readme: https://github.com/jpillora/xdomain (fetched 2026-08-28T04:07:46.027588+00:00, sha e915698107d2)
  - homepage: https://jpillora.com/xdomain/ (fetched 2026-08-29T09:40:53.385678+00:00, sha b82c5b507f25)
  - registry_npm: https://registry.npmjs.org/xdomain (fetched 2026-08-29T09:40:53.388217+00:00, sha c87d95c807b1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
