@profullstack/x402-gateway 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/edge.js +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profullstack/x402-gateway",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "description": "Sell crawl access to AI training crawlers by the day over x402, settled by CoinPay. One middleware: 402 with an offer, a sales page with CLI instructions, signed passes, Profullstack Power Keys honoured as a pass, and a robots.txt that keeps search crawlers welcome.",
6
6
  "keywords": [
package/src/edge.js CHANGED
@@ -143,6 +143,8 @@ const TERMINAL_CHROME = [
143
143
  { major: 138, os: /Macintosh/ }, // macOS 11
144
144
  ];
145
145
  const FIREFOX_ESR = [115, 128, 140, 153];
146
+ const EMBEDDED =
147
+ /Mobile|Android|iPhone|iPad|CrOS|CrKey|SMART-TV|SmartTV|Tizen|Web0S|WebOS|NetCast|BRAVIA|HbbTV|Roku|AFT[A-Z]|PlayStation|Xbox|Nintendo|OculusBrowser|Quest/;
146
148
 
147
149
  /**
148
150
  * A desktop browser string far older than anything that auto-updates.
@@ -163,8 +165,11 @@ const FIREFOX_ESR = [115, 128, 140, 153];
163
165
  */
164
166
  export function isStaleBrowser(ua, now = Date.now(), maxMajorsBehind = 24) {
165
167
  const s = String(ua ?? '');
166
- if (!/Windows NT|Macintosh|X11; (?:Linux|Ubuntu|Fedora)/.test(s)) return false;
167
- if (/Mobile|Android|iPhone|iPad|CrOS/.test(s)) return false;
168
+ if (!/Windows NT|Macintosh|X11; (?:Linux|Ubuntu|Fedora) x86_64/.test(s)) return false;
169
+ // Phones, TVs, cast sticks, consoles and headsets: an embedded browser is
170
+ // frozen at whatever its firmware shipped. A Chromecast says "X11; Linux
171
+ // armv7l ... Chrome/80 ... CrKey" for years, and it is somebody's living room.
172
+ if (EMBEDDED.test(s)) return false;
168
173
  if (DECLARES_ITSELF.test(s)) return false;
169
174
 
170
175
  const ff = /\bFirefox\/(\d+)/.exec(s);