{"id":18096523,"url":"https://github.com/bredele/requirejs-plugin-iframe","last_synced_at":"2025-04-06T03:26:34.640Z","repository":{"id":6429441,"uuid":"7668067","full_name":"bredele/requirejs-plugin-iframe","owner":"bredele","description":"This is a simple requirejs plugin to execute application scripts in different web origins ","archived":false,"fork":false,"pushed_at":"2013-01-19T12:21:54.000Z","size":124,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T09:49:06.506Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bredele.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-17T14:56:50.000Z","updated_at":"2017-07-06T01:28:23.000Z","dependencies_parsed_at":"2022-09-04T14:41:31.751Z","dependency_job_id":null,"html_url":"https://github.com/bredele/requirejs-plugin-iframe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Frequirejs-plugin-iframe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Frequirejs-plugin-iframe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Frequirejs-plugin-iframe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Frequirejs-plugin-iframe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bredele","download_url":"https://codeload.github.com/bredele/requirejs-plugin-iframe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247429919,"owners_count":20937772,"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":[],"created_at":"2024-10-31T19:14:28.288Z","updated_at":"2025-04-06T03:26:34.621Z","avatar_url":"https://github.com/bredele.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"requirejs-plugin-iframe\n=======================\n\nThis is a simple requirejs plugin to execute application scripts in different web origins.\n\nPrivilege separation allows you to create large scale applications with second line of defense. It often comes with a price \nbecause of the SOP (Same Origin Policy) that mandates to use separate origins for each component of the application .\n\nThis plugin use the approach described in this paper: \nhttp://www.cs.berkeley.edu/~devdatta/LeastPrivileges.pdf\n\n\n## Documentation\n\ncheck the `examples` folder. All the info you probably need will be inside\ncomments or on the example code itself.\n\nNote : Cross origin requests are only supported for HTTP, so put examples into a web server in order to test them.\n\n\n## Basic usage\n\nLet's assume you put the plugins inside the `baseUrl` folder or create an alias to the plugin location:\n\nThe iframe plugin use the requirejs-text plugin to load your iframe HTML content.\n\n```js\nrequire.config({\n    paths : {\n        iframe: 'lib/requirejs-plugin-iframe/iframe',\n        //paths allows you to put your plugins wherever you want\n        text: 'lib/requirejs-plugin-iframe/lib/text'\n    }\n});\n\n//use plugins as if they were at baseUrl\ndefine([\n        'iframe!examples/iframe.html'\n    ], function(iframe){\n        //use the iframe object to place your sandboxed iframe.\n    }\n);\n```\n\n## Notes about the iframe plugin\n\nThe iframe plugin can be configured through requirejs config:\n   - policy key is the content policy security (see http://www.w3.org/TR/CSP/)\n   - sandbox key is the iframe restrictions (http://www.w3schools.com/html5/att_iframe_sandbox.asp)\n   - baseUrl is your application origin\n\nExample build settings:\n\n```js\n({\n    baseUrl : './',\n    config : {\n        iframe : {\n        \t//content-security-policy\n        \tpolicy : \"\",\n        \t// iframe sandbox attribute\n        \tsandbox : \"allow-scripts\",\n        \t//the base origin\n        \tbaseUrl : \".\"\n    \t}\n    },\n    paths : {\n        iframe : 'lib/requirejs-plugin-iframe/iframe',\n        text : 'lib/requirejs-plugin-iframe/text',\n    },\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbredele%2Frequirejs-plugin-iframe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbredele%2Frequirejs-plugin-iframe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbredele%2Frequirejs-plugin-iframe/lists"}