{"id":20285800,"url":"https://github.com/tpkn/pptr-spoofer","last_synced_at":"2026-05-20T07:33:45.151Z","repository":{"id":57329251,"uuid":"159231112","full_name":"tpkn/pptr-spoofer","owner":"tpkn","description":"Replace page requests in Puppeteer","archived":false,"fork":false,"pushed_at":"2019-07-16T13:43:57.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T22:10:03.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpkn.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}},"created_at":"2018-11-26T20:51:35.000Z","updated_at":"2022-01-17T12:46:41.000Z","dependencies_parsed_at":"2022-09-11T08:50:33.788Z","dependency_job_id":null,"html_url":"https://github.com/tpkn/pptr-spoofer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tpkn/pptr-spoofer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fpptr-spoofer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fpptr-spoofer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fpptr-spoofer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fpptr-spoofer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpkn","download_url":"https://codeload.github.com/tpkn/pptr-spoofer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fpptr-spoofer/sbom","scorecard":{"id":896110,"data":{"date":"2025-08-11","repo":{"name":"github.com/tpkn/pptr-spoofer","commit":"0979df7d558fbadaf959b8629992c212f4398131"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T13:46:53.926Z","repository_id":57329251,"created_at":"2025-08-24T13:46:53.926Z","updated_at":"2025-08-24T13:46:53.926Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33250371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T04:48:54.280Z","status":"ssl_error","status_checked_at":"2026-05-20T04:48:10.851Z","response_time":356,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-14T14:29:02.980Z","updated_at":"2026-05-20T07:33:45.107Z","avatar_url":"https://github.com/tpkn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Puppeteer Spoofer [![npm Package](https://img.shields.io/npm/v/pptr-spoofer.svg)](https://www.npmjs.org/package/pptr-spoofer)\nReplace page requests in Puppeteer\n\n\nLet's say you are testing some page. And that page loads tons of heavy libs from slow remote server each time. Tedious process, huh? With this module you can respond with content of that libraries, loaded from your local drive. \n\nIn case you have the CORS error, disable web security (at your own risk):\n```javascript\npuppeteer.launch({ args: [ '--disable-web-security' ] });\n```\n\n\n## Installation\n```bash\nnpm install pptr-spoofer\n```\n\n\n\n## API\n\n### PptrSpoofer(req, rules)\n\n### req   \n**Type**: _Object_   \nPage `request` object\n\n\n\n### rules   \n**Type**: _Array_   \n```\n[\n   {\n      rule: '',\n      body: '',\n      status: 200,\n      contentType: 'text/plane'\n   }\n]\n```\n- `rule` _String_ or _RegExp_ of the request url that should be replaced\n- `body` _String_ or _Buffer_ of the response body content, **Default:** `''`\n- `status` _Number_, **Default:** `200`\n- `contentType` _String_, **Default:** `'text/plane'`\n\n\n\n\n\n## Usage\n```javascript\nconst puppeteer = require('puppeteer');\nconst spoofer = require('pptr-spoofer');\n\nlet browser = await puppeteer.launch({ headless: 0, devtools: 1, args: ['--disable-web-security'] });\nlet pages = await browser.pages();\nlet page = pages[0];\n\nawait page.setRequestInterception(true);\nawait page.bringToFront();\n\npage.on('request', req =\u003e {\n   spoofer(req, [\n      {\n         rule: 'https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.8.2/pixi.js', \n         body: fs.readFileSync('./libs/pixi.js'),\n         status: 200,\n         contentType: 'text/plain'\n      }\n   ]);\n});\n\nawait page.goto('http://localhost:12345/test', { waitUntil: 'networkidle2', timeout: 45000 });\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fpptr-spoofer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpkn%2Fpptr-spoofer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fpptr-spoofer/lists"}