{"id":17114642,"url":"https://github.com/llllvvuu/dl-webapp-sources","last_synced_at":"2025-04-13T04:09:00.828Z","repository":{"id":192384771,"uuid":"686990027","full_name":"llllvvuu/dl-webapp-sources","owner":"llllvvuu","description":"download original source code from JavaScript bundle/chunk URLs","archived":false,"fork":false,"pushed_at":"2023-09-06T12:44:41.000Z","size":78,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T05:34:30.344Z","etag":null,"topics":["javascript","react","reactjs","reverse-engineering","sourcemaps","typescript","web","webapp"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@llllvvuu/dl-webapp-sources","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/llllvvuu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-04T11:28:44.000Z","updated_at":"2025-03-01T00:39:29.000Z","dependencies_parsed_at":"2024-10-23T01:02:36.492Z","dependency_job_id":null,"html_url":"https://github.com/llllvvuu/dl-webapp-sources","commit_stats":null,"previous_names":["llllvvuu/dl-webapp-sources","llllvvuu/download-webapp-sources"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllvvuu%2Fdl-webapp-sources","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllvvuu%2Fdl-webapp-sources/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllvvuu%2Fdl-webapp-sources/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llllvvuu%2Fdl-webapp-sources/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llllvvuu","download_url":"https://codeload.github.com/llllvvuu/dl-webapp-sources/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501865,"owners_count":21114683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","react","reactjs","reverse-engineering","sourcemaps","typescript","web","webapp"],"created_at":"2024-10-14T17:19:35.698Z","updated_at":"2025-04-13T04:09:00.788Z","avatar_url":"https://github.com/llllvvuu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Download original source code from public sourcemaps\n\nGet original JavaScript/TypeScript files/project layout:\n```sh\ndl-webapp-sources -o my-react-app \\\n  https://app.com/chunk1.js https://app.com/chunk2.js.map localChunk.js localMap.js.map ...\n```\n\n- [x] sanitize output paths / pad relative parents\n- [x] .js arguments\n- [x] .js.map arguments\n- [x] URL arguments\n- [x] filename arguments\n- [x] `sourceMappingURL=data:...`\n- [x] `sourceMappingURL=file:...`\n- [x] `sourceMappingURL=http...`\n- [x] `sourceMappingURL=\u003crelativepath\u003e`\n- [x] guess `sourceMappingURL` by adding `.map` (find sources that Chrome misses)\n- [x] lookup from `sourcesContent`\n- [x] lookup from `sources` paths\n\n## Installation\n\n```sh\nnpm install -g @llllvvuu/dl-webapp-sources\n```\n\n## CLI Usage\n\nAutomated crawler may not pass auth, and it may also miss asynchronously loaded JS. But, you can get a list of loaded JS files by manually logging in.\n\nAfter logging in, paste into the console:\n\n```javascript\nperformance\n  .getEntriesByType(\"resource\")\n  .map(resource =\u003e resource.name)\n  .filter(name =\u003e name.endsWith(\".js\"))\n  .map(name =\u003e `\"${name}\"`)\n  .join(\" \")\n```\n\nThis gives you the CLI args for:\n\n```sh\ndl-webapp-sources ${JS_URLS} -o ${OUTPUT_DIRECTORY}\n```\n\nIf you got anything interesting, go back and click around the app to load all of the chunks (if it's a SPA), and repeat.\n\nNow you can try to add some `create-react-app` or `create-next-app` boilerplate to try to get the app to build.\n\n\u003e ⚠️  Sometimes `axios` gets 403; I will try to fix this if I have time, but in the meantime you can get around this by manually downloading .js.map from the browser and passing the local filepath into the CLI.\n\n\u003e ⚠️  Some sites clear the performance timeline, so the performance API won't list all of the JS files. If this happens you can try another method to get the list of JS files.\n\n## Library Usage\n\nSee the API reference at [markdown/dl-webapp-sources.md](./markdown/dl-webapp-sources.md).\n\n## Motivation\n\nI created this solution since neither [denands/sourcemapper](https://github.com/denandz/sourcemapper), [tehryanx/sourcemapper](https://github.com/tehryanx/sourcemapper), nor [paazmaya/shuji](https://github.com/paazmaya/shuji) accept a list of multiple JS files, which is quite common with chunked webapps.\n\n[jonluca/source-map-cloner](https://github.com/jonluca/source-map-cloner) is a solution for crawling an HTML page.\n\n`dl-webapp-sources` leaves auth/crawling to the user. It accepts a list of .js or .js.map.\n\nSometimes it can find sources that Google Chrome misses.\n\n## Credits\n\n- [denands/sourcemapper](https://github.com/denandz/sourcemapper)\n- [tehryanx/sourcemapper](https://github.com/tehryanx/sourcemapper)\n- [jonluca/source-map-cloner](https://github.com/jonluca/source-map-cloner)\n- [paazmaya/shuji](https://github.com/paazmaya/shuji)\n- [webpack-contrib/source-map-loader](https://github.com/webpack-contrib/source-map-loader)\n- [User Pingolin on StackOverflow](https://stackoverflow.com/a/62640158/5938726)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllllvvuu%2Fdl-webapp-sources","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllllvvuu%2Fdl-webapp-sources","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllllvvuu%2Fdl-webapp-sources/lists"}