From 43986ee86f9370d3f893a9f3209e87ada2855e33 Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Wed, 8 Jan 2025 21:52:19 -0800 Subject: [PATCH 01/50] No pointer events on loading indicator --- components/system/Desktop/StyledDesktop.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/components/system/Desktop/StyledDesktop.ts b/components/system/Desktop/StyledDesktop.ts index 21599c4814..82698abcba 100644 --- a/components/system/Desktop/StyledDesktop.ts +++ b/components/system/Desktop/StyledDesktop.ts @@ -19,6 +19,7 @@ const StyledDesktop = styled.main` font-weight: 600; left: 50%; padding: 12px 15px; + pointer-events: none; position: absolute; top: 50%; transform: translate(-50%, -50%); From 74fc1036e60275d6111371074c66d1c360eb0afc Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Thu, 9 Jan 2025 22:28:50 -0800 Subject: [PATCH 02/50] Ipfs URL/gateway fixes --- utils/ipfs.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/utils/ipfs.ts b/utils/ipfs.ts index 8ee7c797e9..8e033fa4e7 100644 --- a/utils/ipfs.ts +++ b/utils/ipfs.ts @@ -7,9 +7,7 @@ import { let IPFS_GATEWAY_URL = ""; export const IPFS_GATEWAY_URLS = [ - "https://.ipfs.cf-ipfs.com/", "https://.ipfs.dweb.link/", - "https://cloudflare-ipfs.com/ipfs//", "https://gateway.ipfs.io/ipfs//", ]; @@ -65,11 +63,12 @@ export const getIpfsGatewayUrl = async ( if (!IPFS_GATEWAY_URL) return ""; } - const { pathname, protocol, search } = new URL(ipfsUrl); + const { hostname, pathname, protocol, search } = new URL(ipfsUrl); if (protocol !== "ipfs:") return ""; - const [cid = "", ...path] = pathname.split("/").filter(Boolean); + const fullPath = `${hostname}${pathname}`; + const [cid = "", ...path] = fullPath.split("/").filter(Boolean); const { CID } = await import("multiformats"); return `${IPFS_GATEWAY_URL.replace( @@ -82,17 +81,16 @@ export const getIpfsFileName = async ( ipfsUrl: string, ipfsData: Buffer ): Promise => { - const { pathname, searchParams } = new URL(ipfsUrl); + const { hostname, pathname, searchParams } = new URL(ipfsUrl); const fileName = searchParams.get("filename"); if (fileName) return fileName; const { fileTypeFromBuffer } = await import("file-type"); const { ext = "" } = (await fileTypeFromBuffer(ipfsData)) || {}; + const fullPath = `${hostname}${pathname}`; - return `${pathname.split("/").filter(Boolean).join("_")}${ - ext ? `.${ext}` : "" - }`; + return `${fullPath.split("/").filter(Boolean).join("_")}${ext ? `.${ext}` : ""}`; }; export const getIpfsResource = async (ipfsUrl: string): Promise => { From 1f696bcea2dea730a0d0307f32889d396ccd567c Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Sat, 11 Jan 2025 13:46:04 -0800 Subject: [PATCH 03/50] Pkg upgrade --- package.json | 26 ++--- yarn.lock | 308 ++++++++++++++++++++++++++------------------------- 2 files changed, 172 insertions(+), 162 deletions(-) diff --git a/package.json b/package.json index 6dd1d18098..8f7518b00f 100644 --- a/package.json +++ b/package.json @@ -59,14 +59,14 @@ "gif.js": "^0.2.0", "idb": "^8.0.1", "ini": "^5.0.0", - "isomorphic-git": "^1.27.2", + "isomorphic-git": "^1.29.0", "libheif-js": "^1.18.2", "mediainfo.js": "^0.3.4", "minimist": "^1.2.8", "motion": "12.0.0-alpha.2", "multiformats": "^13.3.1", "music-metadata-browser": "^2.5.11", - "next": "^15.1.3", + "next": "^15.1.4", "nostr-tools": "^1.17.0", "opentype.js": "^1.3.4", "playlist-parser": "^0.0.12", @@ -78,15 +78,15 @@ "react-rnd": "10.4.14", "resedit": "^2.0.3", "rtf.js": "^3.0.9", - "styled-components": "^6.1.13", + "styled-components": "^6.1.14", "utif": "https://github.com/photopea/UTIF.js", "wasi-js": "^1.7.3" }, "devDependencies": { "7z-wasm": "^1.1.0", "@axe-core/playwright": "^4.10.1", - "@next/bundle-analyzer": "^15.1.3", - "@next/eslint-plugin-next": "^15.1.3", + "@next/bundle-analyzer": "^15.1.4", + "@next/eslint-plugin-next": "^15.1.4", "@playwright/test": "1.49.1", "@types/canvas-confetti": "^1.9.0", "@types/dom-chromium-ai": "^0.0.4", @@ -96,28 +96,28 @@ "@types/jest": "^29.5.14", "@types/lunr": "^2.3.7", "@types/minimist": "^1.2.5", - "@types/node": "^22.10.2", + "@types/node": "^22.10.5", "@types/offscreencanvas": "^2019.7.3", "@types/opentype.js": "^1.3.8", - "@types/react": "^19.0.2", + "@types/react": "^19.0.4", "@types/react-dom": "^19.0.2", "@types/ua-parser-js": "^0.7.39", "@types/video.js": "^7.3.58", "@types/wicg-file-system-access": "^2023.10.5", - "@typescript-eslint/eslint-plugin": "^8.19.0", - "@typescript-eslint/parser": "^8.19.0", + "@typescript-eslint/eslint-plugin": "^8.19.1", + "@typescript-eslint/parser": "^8.19.1", "emulators": "^8.3.3", "emulators-ui": "^0.73.9", "eruda": "^3.4.1", "eslint": "^8.57.0", "eslint-config-airbnb": "^19.0.4", - "eslint-config-next": "^15.1.3", + "eslint-config-next": "^15.1.4", "eslint-config-prettier": "^9.1.0", "eslint-plugin-deprecation": "^3.0.0", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.10.0", "eslint-plugin-jsx-a11y": "^6.10.2", - "eslint-plugin-no-relative-import-paths": "^1.5.5", + "eslint-plugin-no-relative-import-paths": "^1.6.1", "eslint-plugin-playwright": "^2.1.0", "eslint-plugin-promise": "^7.2.1", "eslint-plugin-react": "^7.37.3", @@ -137,7 +137,7 @@ "lint-staged": "^15.3.0", "lunr": "^2.3.9", "monaco-editor": "^0.52.2", - "pdfjs-dist": "^4.9.155", + "pdfjs-dist": "^4.10.38", "playwright-core": "1.49.1", "postcss": "^8.4.49", "postcss-styled-syntax": "^0.7.0", @@ -149,7 +149,7 @@ "terser": "^5.37.0", "tinymce": "^6.8.3", "ts-prune": "^0.10.3", - "typescript": "^5.7.2", + "typescript": "^5.7.3", "webamp": "^1.5.0", "xlsx": "^0.18.5", "xterm": "^5.3.0" diff --git a/yarn.lock b/yarn.lock index adf08250af..f815937a85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1785,7 +1785,7 @@ resolved "https://registry.yarnpkg.com/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.65.tgz#86b9209267a20df2c0044b650feb9abc8c85be3d" integrity sha512-RZQX3luWnlNWgdMnLMQ1hyfQraeAn9lnxWWVCHuUM4tAWEV8UDdeb7cMwmJW7eyt8kAosmjeHt3cylQMHOxGFg== -"@napi-rs/canvas@^0.1.64": +"@napi-rs/canvas@^0.1.65": version "0.1.65" resolved "https://registry.yarnpkg.com/@napi-rs/canvas/-/canvas-0.1.65.tgz#ef97a41b83aa03ae37862e789d124ec80eaf5b33" integrity sha512-YcFhXQcp+b2d38zFOJNbpyPHnIL7KAEkhJQ+UeeKI5IpE9B8Cpf/M6RiHPQXSsSqnYbrfFylnW49dyh2oeSblQ== @@ -1801,64 +1801,64 @@ "@napi-rs/canvas-linux-x64-musl" "0.1.65" "@napi-rs/canvas-win32-x64-msvc" "0.1.65" -"@next/bundle-analyzer@^15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-15.1.3.tgz#901a6efa3fcf7676062d0dcff180f87a20ea1d49" - integrity sha512-dh5i2KBONWVhQzJnL10sv9+ImsKgGtOHHeA1dWp/H3MXphWBt1uGjXCwPCcitwimvNncHBmxaOyTm2FwfOLRSA== +"@next/bundle-analyzer@^15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-15.1.4.tgz#17f000db3a16492180270b4d23a77ca78facacfa" + integrity sha512-W8X96jOW0U5VjLVAkFr1P37kH2f/Ma9zzwgX2o3Omft92pI0XHpFG8Xa9YUT3NlhRJCe4ZKznr1VxhSrFNA+BA== dependencies: webpack-bundle-analyzer "4.10.1" -"@next/env@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/env/-/env-15.1.3.tgz#bc747e041cd105170d4cae07cc802e20b4a0c153" - integrity sha512-Q1tXwQCGWyA3ehMph3VO+E6xFPHDKdHFYosadt0F78EObYxPio0S09H9UGYznDe6Wc8eLKLG89GqcFJJDiK5xw== +"@next/env@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/env/-/env-15.1.4.tgz#f727cc4f46527a5223ae894f9476466db9132e21" + integrity sha512-2fZ5YZjedi5AGaeoaC0B20zGntEHRhi2SdWcu61i48BllODcAmmtj8n7YarSPt4DaTsJaBFdxQAVEVzgmx2Zpw== -"@next/eslint-plugin-next@15.1.3", "@next/eslint-plugin-next@^15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-15.1.3.tgz#32777736af151577df52d83f25c0c22bc9f3cb5e" - integrity sha512-oeP1vnc5Cq9UoOb8SYHAEPbCXMzOgG70l+Zfd+Ie00R25FOm+CCVNrcIubJvB1tvBgakXE37MmqSycksXVPRqg== +"@next/eslint-plugin-next@15.1.4", "@next/eslint-plugin-next@^15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-15.1.4.tgz#65421067692e3e5f988c3ae6099f5117f2c5d991" + integrity sha512-HwlEXwCK3sr6zmVGEvWBjW9tBFs1Oe6hTmTLoFQtpm4As5HCdu8jfSE0XJOp7uhfEGLniIx8yrGxEWwNnY0fmQ== dependencies: fast-glob "3.3.1" -"@next/swc-darwin-arm64@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.3.tgz#cac0dc4a1086a33767cc5fb8d11c97391216ca7c" - integrity sha512-aZtmIh8jU89DZahXQt1La0f2EMPt/i7W+rG1sLtYJERsP7GRnNFghsciFpQcKHcGh4dUiyTB5C1X3Dde/Gw8gg== - -"@next/swc-darwin-x64@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.3.tgz#7ebfe9abd7db5abbd28e699d234517f63259ff53" - integrity sha512-aw8901rjkVBK5mbq5oV32IqkJg+CQa6aULNlN8zyCWSsePzEG3kpDkAFkkTOh3eJ0p95KbkLyWBzslQKamXsLA== - -"@next/swc-linux-arm64-gnu@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.3.tgz#a6773ea8df2838e8aea1d638176f40849af1ed06" - integrity sha512-YbdaYjyHa4fPK4GR4k2XgXV0p8vbU1SZh7vv6El4bl9N+ZSiMfbmqCuCuNU1Z4ebJMumafaz6UCC2zaJCsdzjw== - -"@next/swc-linux-arm64-musl@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.3.tgz#309f60d4218511d152876e7f6cc624b7e6a44f6c" - integrity sha512-qgH/aRj2xcr4BouwKG3XdqNu33SDadqbkqB6KaZZkozar857upxKakbRllpqZgWl/NDeSCBYPmUAZPBHZpbA0w== - -"@next/swc-linux-x64-gnu@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.1.3.tgz#c9ac936eee265da738cde4758d95af4562bbd38b" - integrity sha512-uzafnTFwZCPN499fNVnS2xFME8WLC9y7PLRs/yqz5lz1X/ySoxfaK2Hbz74zYUdEg+iDZPd8KlsWaw9HKkLEVw== - -"@next/swc-linux-x64-musl@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.1.3.tgz#2fe0c262b379f3c5b39cab2fa0ba3d9108c8e440" - integrity sha512-el6GUFi4SiDYnMTTlJJFMU+GHvw0UIFnffP1qhurrN1qJV3BqaSRUjkDUgVV44T6zpw1Lc6u+yn0puDKHs+Sbw== - -"@next/swc-win32-arm64-msvc@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.3.tgz#67252289babfa38712497af646744ffc758aa3dc" - integrity sha512-6RxKjvnvVMM89giYGI1qye9ODsBQpHSHVo8vqA8xGhmRPZHDQUE4jcDbhBwK0GnFMqBnu+XMg3nYukNkmLOLWw== - -"@next/swc-win32-x64-msvc@15.1.3": - version "15.1.3" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.1.3.tgz#99f8e4cc2b6c469155e75c4e8fdeb5d08254b27c" - integrity sha512-VId/f5blObG7IodwC5Grf+aYP0O8Saz1/aeU3YcWqNdIUAmFQY3VEPKPaIzfv32F/clvanOb2K2BR5DtDs6XyQ== +"@next/swc-darwin-arm64@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.4.tgz#49faf320d44d1a813e09501abfd952b0315385c9" + integrity sha512-wBEMBs+np+R5ozN1F8Y8d/Dycns2COhRnkxRc+rvnbXke5uZBHkUGFgWxfTXn5rx7OLijuUhyfB+gC/ap58dDw== + +"@next/swc-darwin-x64@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.4.tgz#3c234986481e7db8957562b8dfeab2d44fe4c0a7" + integrity sha512-7sgf5rM7Z81V9w48F02Zz6DgEJulavC0jadab4ZsJ+K2sxMNK0/BtF8J8J3CxnsJN3DGcIdC260wEKssKTukUw== + +"@next/swc-linux-arm64-gnu@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.4.tgz#d71c5a55106327b50ff194dd40e11c3ca7f744a7" + integrity sha512-JaZlIMNaJenfd55kjaLWMfok+vWBlcRxqnRoZrhFQrhM1uAehP3R0+Aoe+bZOogqlZvAz53nY/k3ZyuKDtT2zQ== + +"@next/swc-linux-arm64-musl@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.4.tgz#c6b4cef0f5b943d6308fdb429ecb43be79afce31" + integrity sha512-7EBBjNoyTO2ipMDgCiORpwwOf5tIueFntKjcN3NK+GAQD7OzFJe84p7a2eQUeWdpzZvhVXuAtIen8QcH71ZCOQ== + +"@next/swc-linux-x64-gnu@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.1.4.tgz#2b15f959ac6653800c0df8247489d54982926786" + integrity sha512-9TGEgOycqZFuADyFqwmK/9g6S0FYZ3tphR4ebcmCwhL8Y12FW8pIBKJvSwV+UBjMkokstGNH+9F8F031JZKpHw== + +"@next/swc-linux-x64-musl@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.1.4.tgz#2b9d3ca3c3f506e3515b13c00e19d3031535bb44" + integrity sha512-0578bLRVDJOh+LdIoKvgNDz77+Bd85c5JrFgnlbI1SM3WmEQvsjxTA8ATu9Z9FCiIS/AliVAW2DV/BDwpXbtiQ== + +"@next/swc-win32-arm64-msvc@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.4.tgz#74928a6e824b258a071d30872c00417ee79d4ee7" + integrity sha512-JgFCiV4libQavwII+kncMCl30st0JVxpPOtzWcAI2jtum4HjYaclobKhj+JsRu5tFqMtA5CJIa0MvYyuu9xjjQ== + +"@next/swc-win32-x64-msvc@15.1.4": + version "15.1.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.1.4.tgz#188bce4c231f5ab0e7eaca55170764f7e8229db2" + integrity sha512-xxsJy9wzq7FR5SqPCUqdgSXiNXrMuidgckBa8nH9HtjjxsilgcN6VgXF6tZ3uEWuVEadotQJI8/9EQ6guTC4Yw== "@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": version "5.1.1-v1" @@ -2172,10 +2172,10 @@ dependencies: undici-types "~6.19.2" -"@types/node@^22.10.2": - version "22.10.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.2.tgz#a485426e6d1fdafc7b0d4c7b24e2c78182ddabb9" - integrity sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ== +"@types/node@^22.10.5": + version "22.10.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b" + integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ== dependencies: undici-types "~6.20.0" @@ -2227,10 +2227,10 @@ "@types/prop-types" "*" csstype "^3.0.2" -"@types/react@^19.0.2": - version "19.0.2" - resolved "https://registry.yarnpkg.com/@types/react/-/react-19.0.2.tgz#9363e6b3ef898c471cb182dd269decc4afc1b4f6" - integrity sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg== +"@types/react@^19.0.4": + version "19.0.4" + resolved "https://registry.yarnpkg.com/@types/react/-/react-19.0.4.tgz#ad1270e090118ac3c5f0928a29fe0ddf164881df" + integrity sha512-3O4QisJDYr1uTUMZHA2YswiQZRq+Pd8D+GdVFYikTutYsTz+QZgWkAPnP7rx9txoI6EXKcPiluMqWPFV3tT9Wg== dependencies: csstype "^3.0.2" @@ -2301,20 +2301,20 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/eslint-plugin@^8.19.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.19.0.tgz#2b1e1b791e21d5fc27ddc93884db066444f597b5" - integrity sha512-NggSaEZCdSrFddbctrVjkVZvFC6KGfKfNK0CU7mNK/iKHGKbzT4Wmgm08dKpcZECBu9f5FypndoMyRHkdqfT1Q== +"@typescript-eslint/eslint-plugin@^8.19.1": + version "8.19.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.19.1.tgz#5f26c0a833b27bcb1aa402b82e76d3b8dda0b247" + integrity sha512-tJzcVyvvb9h/PB96g30MpxACd9IrunT7GF9wfA9/0TJ1LxGOJx1TdPzSbBBnNED7K9Ka8ybJsnEpiXPktolTLg== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.19.0" - "@typescript-eslint/type-utils" "8.19.0" - "@typescript-eslint/utils" "8.19.0" - "@typescript-eslint/visitor-keys" "8.19.0" + "@typescript-eslint/scope-manager" "8.19.1" + "@typescript-eslint/type-utils" "8.19.1" + "@typescript-eslint/utils" "8.19.1" + "@typescript-eslint/visitor-keys" "8.19.1" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" - ts-api-utils "^1.3.0" + ts-api-utils "^2.0.0" "@typescript-eslint/experimental-utils@^5.0.0": version "5.62.0" @@ -2334,15 +2334,15 @@ "@typescript-eslint/visitor-keys" "8.6.0" debug "^4.3.4" -"@typescript-eslint/parser@^8.19.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.19.0.tgz#f1512e6e5c491b03aabb2718b95becde22b15292" - integrity sha512-6M8taKyOETY1TKHp0x8ndycipTVgmp4xtg5QpEZzXxDhNvvHOJi5rLRkLr8SK3jTgD5l4fTlvBiRdfsuWydxBw== +"@typescript-eslint/parser@^8.19.1": + version "8.19.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.19.1.tgz#b836fcfe7a704c8c65f5a50e5b0ff8acfca5c21b" + integrity sha512-67gbfv8rAwawjYx3fYArwldTQKoYfezNUT4D5ioWetr/xCrxXxvleo3uuiFuKfejipvq+og7mjz3b0G2bVyUCw== dependencies: - "@typescript-eslint/scope-manager" "8.19.0" - "@typescript-eslint/types" "8.19.0" - "@typescript-eslint/typescript-estree" "8.19.0" - "@typescript-eslint/visitor-keys" "8.19.0" + "@typescript-eslint/scope-manager" "8.19.1" + "@typescript-eslint/types" "8.19.1" + "@typescript-eslint/typescript-estree" "8.19.1" + "@typescript-eslint/visitor-keys" "8.19.1" debug "^4.3.4" "@typescript-eslint/scope-manager@5.62.0": @@ -2361,13 +2361,13 @@ "@typescript-eslint/types" "7.18.0" "@typescript-eslint/visitor-keys" "7.18.0" -"@typescript-eslint/scope-manager@8.19.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.19.0.tgz#28fa413a334f70e8b506a968531e0a7c9c3076dc" - integrity sha512-hkoJiKQS3GQ13TSMEiuNmSCvhz7ujyqD1x3ShbaETATHrck+9RaDdUbt+osXaUuns9OFwrDTTrjtwsU8gJyyRA== +"@typescript-eslint/scope-manager@8.19.1": + version "8.19.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.19.1.tgz#794cfc8add4f373b9cd6fa32e367e7565a0e231b" + integrity sha512-60L9KIuN/xgmsINzonOcMDSB8p82h95hoBfSBtXuO4jlR1R9L1xSkmVZKgCPVfavDlXihh4ARNjXhh1gGnLC7Q== dependencies: - "@typescript-eslint/types" "8.19.0" - "@typescript-eslint/visitor-keys" "8.19.0" + "@typescript-eslint/types" "8.19.1" + "@typescript-eslint/visitor-keys" "8.19.1" "@typescript-eslint/scope-manager@8.2.0": version "8.2.0" @@ -2385,15 +2385,15 @@ "@typescript-eslint/types" "8.6.0" "@typescript-eslint/visitor-keys" "8.6.0" -"@typescript-eslint/type-utils@8.19.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.19.0.tgz#41abd7d2e4cf93b6854b1fe6cbf416fab5abf89f" - integrity sha512-TZs0I0OSbd5Aza4qAMpp1cdCYVnER94IziudE3JU328YUHgWu9gwiwhag+fuLeJ2LkWLXI+F/182TbG+JaBdTg== +"@typescript-eslint/type-utils@8.19.1": + version "8.19.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.19.1.tgz#23710ab52643c19f74601b3f4a076c98f4e159aa" + integrity sha512-Rp7k9lhDKBMRJB/nM9Ksp1zs4796wVNyihG9/TU9R6KCJDNkQbc2EOKjrBtLYh3396ZdpXLtr/MkaSEmNMtykw== dependencies: - "@typescript-eslint/typescript-estree" "8.19.0" - "@typescript-eslint/utils" "8.19.0" + "@typescript-eslint/typescript-estree" "8.19.1" + "@typescript-eslint/utils" "8.19.1" debug "^4.3.4" - ts-api-utils "^1.3.0" + ts-api-utils "^2.0.0" "@typescript-eslint/type-utils@8.6.0": version "8.6.0" @@ -2415,10 +2415,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.18.0.tgz#b90a57ccdea71797ffffa0321e744f379ec838c9" integrity sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ== -"@typescript-eslint/types@8.19.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.19.0.tgz#a190a25c5484a42b81eaad06989579fdeb478cbb" - integrity sha512-8XQ4Ss7G9WX8oaYvD4OOLCjIQYgRQxO+qCiR2V2s2GxI9AUpo7riNwo6jDhKtTcaJjT8PY54j2Yb33kWtSJsmA== +"@typescript-eslint/types@8.19.1": + version "8.19.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.19.1.tgz#015a991281754ed986f2e549263a1188d6ed0a8c" + integrity sha512-JBVHMLj7B1K1v1051ZaMMgLW4Q/jre5qGK0Ew6UgXz1Rqh+/xPzV1aW581OM00X6iOfyr1be+QyW8LOUf19BbA== "@typescript-eslint/types@8.2.0": version "8.2.0" @@ -2457,19 +2457,19 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/typescript-estree@8.19.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.0.tgz#6b4f48f98ffad6597379951b115710f4d68c9ccb" - integrity sha512-WW9PpDaLIFW9LCbucMSdYUuGeFUz1OkWYS/5fwZwTA+l2RwlWFdJvReQqMUMBw4yJWJOfqd7An9uwut2Oj8sLw== +"@typescript-eslint/typescript-estree@8.19.1": + version "8.19.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.1.tgz#c1094bb00bc251ac76cf215569ca27236435036b" + integrity sha512-jk/TZwSMJlxlNnqhy0Eod1PNEvCkpY6MXOXE/WLlblZ6ibb32i2We4uByoKPv1d0OD2xebDv4hbs3fm11SMw8Q== dependencies: - "@typescript-eslint/types" "8.19.0" - "@typescript-eslint/visitor-keys" "8.19.0" + "@typescript-eslint/types" "8.19.1" + "@typescript-eslint/visitor-keys" "8.19.1" debug "^4.3.4" fast-glob "^3.3.2" is-glob "^4.0.3" minimatch "^9.0.4" semver "^7.6.0" - ts-api-utils "^1.3.0" + ts-api-utils "^2.0.0" "@typescript-eslint/typescript-estree@8.2.0": version "8.2.0" @@ -2513,15 +2513,15 @@ eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/utils@8.19.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.19.0.tgz#33824310e1fccc17f27fbd1030fd8bbd9a674684" - integrity sha512-PTBG+0oEMPH9jCZlfg07LCB2nYI0I317yyvXGfxnvGvw4SHIOuRnQ3kadyyXY6tGdChusIHIbM5zfIbp4M6tCg== +"@typescript-eslint/utils@8.19.1": + version "8.19.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.19.1.tgz#dd8eabd46b92bf61e573286e1c0ba6bd243a185b" + integrity sha512-IxG5gLO0Ne+KaUc8iW1A+XuKLd63o4wlbI1Zp692n1xojCl/THvgIKXJXBZixTh5dd5+yTJ/VXH7GJaaw21qXA== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "8.19.0" - "@typescript-eslint/types" "8.19.0" - "@typescript-eslint/typescript-estree" "8.19.0" + "@typescript-eslint/scope-manager" "8.19.1" + "@typescript-eslint/types" "8.19.1" + "@typescript-eslint/typescript-estree" "8.19.1" "@typescript-eslint/utils@8.6.0": version "8.6.0" @@ -2569,12 +2569,12 @@ "@typescript-eslint/types" "7.18.0" eslint-visitor-keys "^3.4.3" -"@typescript-eslint/visitor-keys@8.19.0": - version "8.19.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.0.tgz#dc313f735e64c4979c9073f51ffcefb6d9be5c77" - integrity sha512-mCFtBbFBJDCNCWUl5y6sZSCHXw1DEFEk3c/M3nRK2a4XUB8StGFtmcEMizdjKuBzB6e/smJAAWYug3VrdLMr1w== +"@typescript-eslint/visitor-keys@8.19.1": + version "8.19.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.1.tgz#fce54d7cfa5351a92387d6c0c5be598caee072e0" + integrity sha512-fzmjU8CHK853V/avYZAvuVut3ZTfwN5YtMaoi+X9Y9MA9keaWNHC3zEQ9zvyX/7Hj+5JkNyK1l7TOR2hevHB6Q== dependencies: - "@typescript-eslint/types" "8.19.0" + "@typescript-eslint/types" "8.19.1" eslint-visitor-keys "^4.2.0" "@typescript-eslint/visitor-keys@8.2.0": @@ -4447,12 +4447,12 @@ eslint-config-airbnb@^19.0.4: object.assign "^4.1.2" object.entries "^1.1.5" -eslint-config-next@^15.1.3: - version "15.1.3" - resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-15.1.3.tgz#7656b47591745bcdbd60d396282924d89f82eea6" - integrity sha512-wGYlNuWnh4ujuKtZvH+7B2Z2vy9nONZE6ztd+DKF7hAsIabkrxmD4TzYHzASHENo42lmz2tnT2B+zN2sOHvpJg== +eslint-config-next@^15.1.4: + version "15.1.4" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-15.1.4.tgz#715b03043e7a8924c0228772ff6f8110469d77da" + integrity sha512-u9+7lFmfhKNgGjhQ9tBeyCFsPJyq0SvGioMJBngPC7HXUpR0U+ckEwQR48s7TrRNHra1REm6evGL2ie38agALg== dependencies: - "@next/eslint-plugin-next" "15.1.3" + "@next/eslint-plugin-next" "15.1.4" "@rushstack/eslint-patch" "^1.10.3" "@typescript-eslint/eslint-plugin" "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" "@typescript-eslint/parser" "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0" @@ -4588,10 +4588,10 @@ eslint-plugin-jsx-a11y@^6.10.2: safe-regex-test "^1.0.3" string.prototype.includes "^2.0.1" -eslint-plugin-no-relative-import-paths@^1.5.5: - version "1.5.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-no-relative-import-paths/-/eslint-plugin-no-relative-import-paths-1.5.5.tgz#c1cf7fed05943b1ec038e29086b190f14f42ed6e" - integrity sha512-UjudFFdBbv93v0CsVdEKcMLbBzRIjeK2PubTctX57tgnHxZcMj1Jm8lDBWoETnPxk0S5g5QLSltEM+511yL4+w== +eslint-plugin-no-relative-import-paths@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-relative-import-paths/-/eslint-plugin-no-relative-import-paths-1.6.1.tgz#7d1e8f34694016d6d390c28063bedfa7203e7771" + integrity sha512-YZNeOnsOrJcwhFw0X29MXjIzu2P/f5X2BZDPWw1R3VUYBRFxNIh77lyoL/XrMU9ewZNQPcEvAgL/cBOT1P330A== eslint-plugin-playwright@^2.1.0: version "2.1.0" @@ -6053,10 +6053,10 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isomorphic-git@^1.27.2: - version "1.27.2" - resolved "https://registry.yarnpkg.com/isomorphic-git/-/isomorphic-git-1.27.2.tgz#969727adf4e81ec313974e9ebe2d1d0982b25c7f" - integrity sha512-nCiz+ieOkWb5kDJSSckDTiMjTcgkxqH2xuiQmw1Y6O/spwx4d6TKYSfGCd4f71HGvUYcRSUGqJEI+3uN6UQlOw== +isomorphic-git@^1.29.0: + version "1.29.0" + resolved "https://registry.yarnpkg.com/isomorphic-git/-/isomorphic-git-1.29.0.tgz#f1450ebd8391e5f5a12c5dc320cd9b1ff8c1fa61" + integrity sha512-zWGqk8901cicvVEhVpN76AwKrS/TzHak2NQCtNXIAavpMIy/yqh+d/JtC9A8AUKZAauUdOyEWKI29tuCLAL+Zg== dependencies: async-lock "^1.4.1" clean-git-ref "^2.0.1" @@ -7120,12 +7120,12 @@ negotiator@0.6.3: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== -next@^15.1.3: - version "15.1.3" - resolved "https://registry.yarnpkg.com/next/-/next-15.1.3.tgz#49c45f884660dfaf07f53e70585d109a3283100e" - integrity sha512-5igmb8N8AEhWDYzogcJvtcRDU6n4cMGtBklxKD4biYv4LXN8+awc/bbQ2IM2NQHdVPgJ6XumYXfo3hBtErg1DA== +next@^15.1.4: + version "15.1.4" + resolved "https://registry.yarnpkg.com/next/-/next-15.1.4.tgz#cb2aee3fbb772e20b98ccc2f0806249c09f780a2" + integrity sha512-mTaq9dwaSuwwOrcu3ebjDYObekkxRnXpuVL21zotM8qE2W0HBOdVIdg2Li9QjMEZrj73LN96LcWcz62V19FjAg== dependencies: - "@next/env" "15.1.3" + "@next/env" "15.1.4" "@swc/counter" "0.1.3" "@swc/helpers" "0.5.15" busboy "1.6.0" @@ -7133,14 +7133,14 @@ next@^15.1.3: postcss "8.4.31" styled-jsx "5.1.6" optionalDependencies: - "@next/swc-darwin-arm64" "15.1.3" - "@next/swc-darwin-x64" "15.1.3" - "@next/swc-linux-arm64-gnu" "15.1.3" - "@next/swc-linux-arm64-musl" "15.1.3" - "@next/swc-linux-x64-gnu" "15.1.3" - "@next/swc-linux-x64-musl" "15.1.3" - "@next/swc-win32-arm64-msvc" "15.1.3" - "@next/swc-win32-x64-msvc" "15.1.3" + "@next/swc-darwin-arm64" "15.1.4" + "@next/swc-darwin-x64" "15.1.4" + "@next/swc-linux-arm64-gnu" "15.1.4" + "@next/swc-linux-arm64-musl" "15.1.4" + "@next/swc-linux-x64-gnu" "15.1.4" + "@next/swc-linux-x64-musl" "15.1.4" + "@next/swc-win32-arm64-msvc" "15.1.4" + "@next/swc-win32-x64-msvc" "15.1.4" sharp "^0.33.5" no-case@^3.0.4: @@ -7485,12 +7485,12 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pdfjs-dist@^4.9.155: - version "4.9.155" - resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-4.9.155.tgz#80c9fc7f5411a4cf00751cdea242ffd8b0f23a96" - integrity sha512-epRZn6DQQKCOEqbmFsxkiMBm1MHaNrnr6T4VBNP0bsDvdJdmrWcZbS5cgJXW68P0d3uJTlFhF6Wms2tlSgPYig== +pdfjs-dist@^4.10.38: + version "4.10.38" + resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz#3ee698003790dc266cc8b55c0e662ccb9ae18f53" + integrity sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ== optionalDependencies: - "@napi-rs/canvas" "^0.1.64" + "@napi-rs/canvas" "^0.1.65" pe-library@^1.0.1: version "1.0.1" @@ -8915,10 +8915,10 @@ strtok3@^9.0.1: "@tokenizer/token" "^0.3.0" peek-readable "^5.3.1" -styled-components@^6.1.13: - version "6.1.13" - resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-6.1.13.tgz#2d777750b773b31469bd79df754a32479e9f475e" - integrity sha512-M0+N2xSnAtwcVAQeFEsGWFFxXDftHUD7XrKla06QbpUMmbmtFBMMTcKWvFXtWxuD5qQkB8iU5gk6QASlx2ZRMw== +styled-components@^6.1.14: + version "6.1.14" + resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-6.1.14.tgz#addd3b645f400f8aad84c992afec58804ad1d217" + integrity sha512-KtfwhU5jw7UoxdM0g6XU9VZQFV4do+KrM8idiVCH5h4v49W+3p3yMe0icYwJgZQZepa5DbH04Qv8P0/RdcLcgg== dependencies: "@emotion/is-prop-valid" "1.2.2" "@emotion/unitless" "0.8.1" @@ -9211,6 +9211,11 @@ ts-api-utils@^1.3.0: resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== +ts-api-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.0.0.tgz#b9d7d5f7ec9f736f4d0f09758b8607979044a900" + integrity sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ== + ts-morph@^13.0.1: version "13.0.3" resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-13.0.3.tgz#c0c51d1273ae2edb46d76f65161eb9d763444c1d" @@ -9418,7 +9423,7 @@ typedarray.prototype.slice@^1.0.3: typed-array-buffer "^1.0.2" typed-array-byte-offset "^1.0.2" -typescript@^5, typescript@^5.7.2: +typescript@^5: version "5.7.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6" integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg== @@ -9428,6 +9433,11 @@ typescript@^5.6.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== +typescript@^5.7.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e" + integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw== + uint8array-extras@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/uint8array-extras/-/uint8array-extras-1.4.0.tgz#e42a678a6dd335ec2d21661333ed42f44ae7cc74" From ae13d0da6b3eb78336af3cdb09a6ecb54246bd14 Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Sun, 12 Jan 2025 11:09:19 -0800 Subject: [PATCH 04/50] Add "proxy" to browser --- components/apps/Browser/NavigationIcons.tsx | 6 +++ components/apps/Browser/StyledBrowser.ts | 10 +++++ components/apps/Browser/config.ts | 14 ++++++ components/apps/Browser/index.tsx | 47 ++++++++++++++++++++- components/apps/Browser/useProxyMenu.ts | 41 ++++++++++++++++++ public/CREDITS.md | 2 + 6 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 components/apps/Browser/useProxyMenu.ts diff --git a/components/apps/Browser/NavigationIcons.tsx b/components/apps/Browser/NavigationIcons.tsx index d374ccd141..9923b34028 100644 --- a/components/apps/Browser/NavigationIcons.tsx +++ b/components/apps/Browser/NavigationIcons.tsx @@ -28,3 +28,9 @@ export const Stop = memo(() => ( )); + +export const Network = memo(() => ( + + + +)); diff --git a/components/apps/Browser/StyledBrowser.ts b/components/apps/Browser/StyledBrowser.ts index 639b7e6344..9714bf655a 100644 --- a/components/apps/Browser/StyledBrowser.ts +++ b/components/apps/Browser/StyledBrowser.ts @@ -43,6 +43,16 @@ const StyledBrowser = styled.div` width: 20px; } + &.proxy { + margin: 0 10px 0 4px; + width: 40px; + + svg { + height: 15px; + width: 15px; + } + } + &:hover { background-color: rgb(103, 103, 103); } diff --git a/components/apps/Browser/config.ts b/components/apps/Browser/config.ts index e2e7c4a622..56b86236b8 100644 --- a/components/apps/Browser/config.ts +++ b/components/apps/Browser/config.ts @@ -7,6 +7,10 @@ type Bookmark = { url: string; }; +export type WaybackUrlInfo = { + archived_snapshots: { closest: { url: string } }; +}; + export const DINO_GAME = { icon: "/System/Icons/Favicons/dino.webp", name: "T-Rex Chrome Dino Game", @@ -59,3 +63,13 @@ export const LOCAL_HOST = new Set(["127.0.0.1", "localhost"]); export const NOT_FOUND = '404 Not Found

Not Found

The requested URL was not found on this server.

'; + +export const OLD_NET_PROXY = + "https://theoldnet.com/get?scripts=true&decode=true&year=&url="; + +export const OLD_NET_SUPPORTED_YEARS = [ + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010, 2011, 2012, +]; + +export const WAYBACK_URL_INFO = "https://archive.org/wayback/available?url="; diff --git a/components/apps/Browser/index.tsx b/components/apps/Browser/index.tsx index 968063e3fa..425ef638e6 100644 --- a/components/apps/Browser/index.tsx +++ b/components/apps/Browser/index.tsx @@ -1,5 +1,8 @@ import { basename, join, resolve } from "path"; import { useCallback, useEffect, useRef, useState } from "react"; +import useProxyMenu, { + type ProxyState, +} from "components/apps/Browser/useProxyMenu"; import { ADDRESS_INPUT_PROPS } from "components/apps/FileExplorer/AddressBar"; import useHistoryMenu from "components/apps/Browser/useHistoryMenu"; import useBookmarkMenu from "components/apps/Browser/useBookmarkMenu"; @@ -7,13 +10,21 @@ import { createDirectoryIndex, type DirectoryEntries, } from "components/apps/Browser/directoryIndex"; -import { Arrow, Refresh, Stop } from "components/apps/Browser/NavigationIcons"; +import { + Arrow, + Network, + Refresh, + Stop, +} from "components/apps/Browser/NavigationIcons"; import StyledBrowser from "components/apps/Browser/StyledBrowser"; import { DINO_GAME, HOME_PAGE, LOCAL_HOST, NOT_FOUND, + OLD_NET_PROXY, + WAYBACK_URL_INFO, + type WaybackUrlInfo, bookmarks, } from "components/apps/Browser/config"; import { type ComponentProcessProps } from "components/system/Apps/RenderComponent"; @@ -102,6 +113,8 @@ const Browser: FC = ({ id }) => { position, moveHistory ); + const [proxyState, setProxyState] = useState("CORS"); + const proxyMenu = useProxyMenu(proxyState, setProxyState); const bookmarkMenu = useBookmarkMenu(); const setUrl = useCallback( async (addressInput: string): Promise => { @@ -302,7 +315,28 @@ const Browser: FC = ({ id }) => { setSrcDoc(newSrcDoc); prependFileToTitle(newTitle); } else { - const addressUrl = processedUrl.href; + let addressUrl = processedUrl.href; + + if (proxyState === "WAYBACK_MACHINE") { + try { + const urlInfoResponse = await fetch( + `${WAYBACK_URL_INFO}${addressUrl}` + ); + const { archived_snapshots } = + (await urlInfoResponse.json()) as WaybackUrlInfo; + + if (archived_snapshots.closest.url) { + addressUrl = archived_snapshots.closest.url; + } + } catch { + // Ignore failure to fetch url + } + } else if (proxyState.startsWith("OLD_NET_")) { + const year = proxyState.replace("OLD_NET_", ""); + const proxyUrl = OLD_NET_PROXY.replace("", year); + + addressUrl = `${proxyUrl}${processedUrl.href}`; + } changeIframeWindowLocation(addressUrl, contentWindow); @@ -357,6 +391,7 @@ const Browser: FC = ({ id }) => { initialTitle, open, prependFileToTitle, + proxyState, readFile, readdir, setIcon, @@ -423,6 +458,14 @@ const Browser: FC = ({ id }) => { }} {...ADDRESS_INPUT_PROPS} /> +