{"id":14960556,"url":"https://github.com/kongregate/unity-webgl-utilities","last_synced_at":"2025-10-24T01:35:28.212Z","repository":{"id":144874148,"uuid":"88798227","full_name":"kongregate/Unity-WebGL-Utilities","owner":"kongregate","description":"Some helpful utilities for Unity WebGL games","archived":false,"fork":false,"pushed_at":"2019-08-27T14:39:51.000Z","size":14,"stargazers_count":92,"open_issues_count":3,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-07T02:06:07.184Z","etag":null,"topics":["unity","unity3d","unity3d-plugin","webgl"],"latest_commit_sha":null,"homepage":null,"language":"C#","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/kongregate.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":"2017-04-19T22:59:27.000Z","updated_at":"2025-03-11T10:54:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c2a279a-420c-41cf-8ba5-8b31c2612b8f","html_url":"https://github.com/kongregate/Unity-WebGL-Utilities","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"42a90a2b95034dd5fe1ebdf94a4913cf6b0c4ab2"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kongregate%2FUnity-WebGL-Utilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kongregate%2FUnity-WebGL-Utilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kongregate%2FUnity-WebGL-Utilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kongregate%2FUnity-WebGL-Utilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kongregate","download_url":"https://codeload.github.com/kongregate/Unity-WebGL-Utilities/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252038187,"owners_count":21684645,"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":["unity","unity3d","unity3d-plugin","webgl"],"created_at":"2024-09-24T13:22:31.424Z","updated_at":"2025-10-24T01:35:28.143Z","avatar_url":"https://github.com/kongregate.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity-WebGL-Utilities\nSome helpful utilities for Unity WebGL games based on and inspired by the Unity team's blog posts and WebGL essentials asset packages.\n\n## Installing\nGrab the [latest release](https://github.com/kongregate/Unity-WebGL-Utilities/releases) and import the `unitypackage` into your project.\n\n## WebGLMemoryStats\n\nThis is a simple behavior that you can add to a persistent game object. It will periodically log WebGL memory statistics to the browser console to help you tune your WebGL memory size:\n\n![](http://kong.dreamhosters.com/grabs/Default_unity_-_mtx-unity_-_WebGL__Personal___OpenGL_4_1__1E96A487.png)\n\n![](http://kong.dreamhosters.com/grabs/Play_webgl-test__a_free_online_game_on_Kongregate_1E96A97A.png)\n\n## Updated CachedXMLHttpRequest\n\nThe original version of CachedXMLHttpRequest unfortunately has a few bugs. This package includes an updated drop-in replacement that resolves the following issues:\n\n* An error dialog is displayed in Firefox private browsing mode\n* When used with Safari and content in an iframe the plugin is non-functional\n* Synchronous XHR requests are used to revalidate resources\n\nThe updated version also adds some functionality to give you finer control over the XHR cache:\n\n * `Module.CachedXMLHttpRequestBlacklist` can be set to an array of `RegExp` or string objects to disable caching for matching URLs (useful to prevent caching of API endpoints, etc)\n* `Module.CachedXMLHttpRequestRevalidateBlacklist` can be set to an array of `RegExp` or string objects to disable re-validation for matching URLs (helpful if you use explicit versioning on your asset bundles)\n\nFor example, the following configuration will never cache files containing `.xml`, `.php`, or `xhr_nocache`, and requests with `.unity3d` in them will not be re-validated when being loaded:\n\n```js\nvar Module = {\n  TOTAL_MEMORY: 268435456,\n  CachedXMLHttpRequestCacheBlacklist: [/\\.xml/, /\\.php/, 'xhr_nocache'],\n  CachedXMLHttpRequestRevalidateBlacklist: [/\\.unity3d/]\n};\n```\n\n## CachedXHRExtensions\n\nThis package also provides extensions to the `CachedXMLHttpRequest` addon which allow you to clear and query for the existence of items in the cache. This can be useful if you pre-fetch your asset bundles on startup to avoid doing so multiple times. The classes used below are in the `Kongregate` namespace.\n\n**Clear the cache:**\n```csharp\nCachedXHRExtensions.CleanCache();\n```\n\n**Query the cache:**\n```csharp\nIEnumerator CheckIfAssetExists() {\n  var query = new CacheEntryQuery(\"https://whatever.io/file.xml\");\n  yield return query;\n  if (query.IsCached) {\n    Debug.Log(\"Asset exists in cache!\");\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkongregate%2Funity-webgl-utilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkongregate%2Funity-webgl-utilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkongregate%2Funity-webgl-utilities/lists"}