{"id":18976886,"url":"https://github.com/a11ywatch/node-iframe","last_synced_at":"2025-04-19T17:18:36.843Z","repository":{"id":47376036,"uuid":"238581231","full_name":"a11ywatch/node-iframe","owner":"a11ywatch","description":"Reverse engineer website to iframe","archived":false,"fork":false,"pushed_at":"2024-02-09T17:51:46.000Z","size":877,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T10:43:41.566Z","etag":null,"topics":["a11ywatch","domain-fronting","iframe","reverse-engineering"],"latest_commit_sha":null,"homepage":"https://a11ywatch.com/testout","language":"TypeScript","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/a11ywatch.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},"funding":{"github":["a11ywatch"]}},"created_at":"2020-02-06T01:09:12.000Z","updated_at":"2024-02-14T12:49:19.000Z","dependencies_parsed_at":"2024-06-18T22:46:13.720Z","dependency_job_id":"855e10c7-f774-4c31-90f1-be0fd3efca90","html_url":"https://github.com/a11ywatch/node-iframe","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":0.4117647058823529,"last_synced_commit":"ae922a6a2cd95d9690f62315ba1210ced5682e0b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a11ywatch%2Fnode-iframe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a11ywatch%2Fnode-iframe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a11ywatch%2Fnode-iframe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a11ywatch%2Fnode-iframe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a11ywatch","download_url":"https://codeload.github.com/a11ywatch/node-iframe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249228271,"owners_count":21233852,"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":["a11ywatch","domain-fronting","iframe","reverse-engineering"],"created_at":"2024-11-08T15:26:41.939Z","updated_at":"2025-04-16T10:31:57.472Z","avatar_url":"https://github.com/a11ywatch.png","language":"TypeScript","funding_links":["https://github.com/sponsors/a11ywatch"],"categories":[],"sub_categories":[],"readme":"# node-iframe\n\ncreate iframes to bypass security issues on your server with node.js can also be used in a browser\n\n## Installation\n\n`npm install node-iframe`\n\n## How to use\n\nas express middleware\n\n```typescript\nimport createIframe from \"node-iframe\";\n\napp.use(createIframe);\n\napp.get(\"/iframe\", (req, res) =\u003e {\n  res.createIframe({\n    url: req.query.url,\n    baseHref: req.query.baseHref, // optional: determine how to control link redirects,\n    config: { cors: { script: true } }, // optional: determine element cors or inlining #shape src/iframe.ts#L34\n  });\n});\n```\n\nOn the client use directly in your iframe if your api is on the same server set the url below like this or if your using a framework like gatsby, nextjs, etc or non-express apps\n\n```html\n\u003ciframe src=\"/iframe/?url=https://www.etsy.com\" /\u003e\n```\n\nYou can even fetch the iframe directly by importing `fetchFrame` on the client or server.\nSet `safeMode=true` in conjunction with inline scripts to add error handling.\n \n```typescript\nimport { fetchFrame } from \"node-iframe\";\n\nasync function fetchIframe() {\n  return await fetchFrame({ url: \"https://www.etsy.com\", safeMode: false });\n}\n```\n\nConfigure how to handle resources for all request\n\n```typescript\nconst { configureResourceControl, configureTemplates } = require(\"node-iframe\");\n\n// optional: configure if elements should be inlined, cors, etc, this combines with the `config` param\nconfigureResourceControl({\n  inline: { script: true, link: false },\n  cors: { script: true },\n});\n// optional: configure error-pages - check src/templates for more info\n// 0: error, 1: not-found, 2: all templates - check src/templates/config for options\nconfigureTemplates(\"\u003cdiv\u003eNo Fish found\u003c/div\u003e\", 1);\n```\n\n[Example](https://a11ywatch.com/testout)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa11ywatch%2Fnode-iframe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa11ywatch%2Fnode-iframe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa11ywatch%2Fnode-iframe/lists"}