{"id":18084870,"url":"https://github.com/coderofsalvation/aframe-verse-component-scripts","last_synced_at":"2025-04-06T00:13:03.806Z","repository":{"id":146964957,"uuid":"561398730","full_name":"coderofsalvation/aframe-verse-component-scripts","owner":"coderofsalvation","description":"allow certain (external) aframe to load scripts during immersive navigation #aframe-verse","archived":false,"fork":false,"pushed_at":"2023-05-22T08:08:00.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T06:21:39.084Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderofsalvation.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":"2022-11-03T15:52:16.000Z","updated_at":"2023-05-28T01:56:35.000Z","dependencies_parsed_at":"2025-02-12T17:01:26.443Z","dependency_job_id":null,"html_url":"https://github.com/coderofsalvation/aframe-verse-component-scripts","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/coderofsalvation%2Faframe-verse-component-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Faframe-verse-component-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Faframe-verse-component-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Faframe-verse-component-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderofsalvation","download_url":"https://codeload.github.com/coderofsalvation/aframe-verse-component-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415976,"owners_count":20935387,"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-31T15:08:28.351Z","updated_at":"2025-04-06T00:13:03.800Z","avatar_url":"https://github.com/coderofsalvation.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://github.com/coderofsalvation/aframe-verse/raw/main/.img/demo.gif)\n\nAn extension for the [aframe-verse component](https://github.com/coderofsalvation/aframe-verse) which allows specific aframe experiences to load (trusted) scripts.\n\n# Usage \n\nAllow certain urls in [aframe-verse.json](https://github.com/coderofsalvation/aframe-verse/aframe-verse.json) to load scripts by adding `scripts:true`:\n\n```json\n{\n  destinations:[\n    ...\n    {url:\"./app3.html\", scripts:true},\n    {url:\"https://trustedfriend.com/game.html\", scripts:true},\n  ]\n}\n```\n\n\u003e Advice: don't trust things you should'nt trust :heart:\n\n\nJust add the `scripts` attribute to your cluster-client ([index.html](https://github.com/coderofsalvation/aframe-verse/blob/main/apps/index.html)):\n\n```\n\u003ca-entity aframe-verse=\"......\" scripts\u003e\n```\n\nThen `game.html` or `app3.html` will have to include their scripts inside the `aframe-verse`-block:\n\n```html\n\u003cscript src=\".....\"\u003e\u003c/script\u003e                     \u003c!-- will not be loaded\n\n\u003ca-entity aframe-verse=\"______\"\u003e\n\n   \u003cscript src=\"./component/foo.js\"/\u003e            \u003c!-- will be loaded (inside aframe-verse block)\n   \u003cscript src=\"./component/bar.js\"/\u003e            \u003c!-- \n\n\u003c/a-entity\u003e\n```\n\n\u003e Profit! Now `foo.js` and `bar.js` will be loaded, but not `.....`\n\nThis way scripts are cherrypicked, so you don't have to worry about accidentally loading global scripts too (2 versions of `aframe.min.js` e.g.).\n\n## Conditional loading\n\nFor aframe-verse-only scripts, you don't have to use `\u003cscript\u003e`-tags, but you can use the `aframe-verse-script`-classname in your `game.html` or `app3.html`:\n\n```html\n\u003ctemplate class=\"aframe-verse-script\" src=\"component/x.js\"/\u003e \n```\n\n\u003e Profit! now the component will only get loaded when viewed thru **aframe-verse**, and not in standalone mode.\n\nStill, in some cases, you'd want to add an `aframe-verse.js`-stub, to kick off your app:\n\n```html\n\u003ctemplate class=\"aframe-verse-script\" src=\"aframe-verse.js\"/\u003e \n```\n\naframe-verse.js\n```js\n// our 'domready' event\n$('[aframe-verse]').addEventListener(\"loaded\", () =\u003e {            \n\n  let promise = e.detail.promise()  // dont fadein experience yet\n\n  myexperience = new Experience()                                                 \n  myexperience.start()\n\n  promise.resolve()                 // now we can fadein \n})\n```\n\n\u003e Profit!\n\n## Scope of this component\n\nFurther privacy/Security-stuff is out of scope (see the `navigate` custom-component example in the [aframe-verse README.md](https://github.com/coderofsalvation/aframe-verse) in the `Customizing (with code) \u003e Customizing navigation further` section.\n\n\u003e Please publish any useful components under reponame `aframe-verse-component-mycomponent` for discoverability.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Faframe-verse-component-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderofsalvation%2Faframe-verse-component-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Faframe-verse-component-scripts/lists"}