{"id":18323928,"url":"https://github.com/frehner/apphistory","last_synced_at":"2025-04-05T23:31:45.670Z","repository":{"id":45331504,"uuid":"338455446","full_name":"frehner/appHistory","owner":"frehner","description":"A polyfill for the AppHistory proposal","archived":false,"fork":false,"pushed_at":"2021-12-20T20:13:40.000Z","size":372,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-17T22:59:40.946Z","etag":null,"topics":["apphistory","javascript","polyfill"],"latest_commit_sha":null,"homepage":"","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/frehner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-02-12T23:14:19.000Z","updated_at":"2023-11-14T13:12:25.000Z","dependencies_parsed_at":"2022-07-18T09:09:15.691Z","dependency_job_id":null,"html_url":"https://github.com/frehner/appHistory","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frehner%2FappHistory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frehner%2FappHistory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frehner%2FappHistory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frehner%2FappHistory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frehner","download_url":"https://codeload.github.com/frehner/appHistory/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415783,"owners_count":20935383,"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":["apphistory","javascript","polyfill"],"created_at":"2024-11-05T18:30:12.176Z","updated_at":"2025-04-05T23:31:40.659Z","avatar_url":"https://github.com/frehner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# appHistory polyfill\n\n![Tests](https://github.com/frehner/appHistory/workflows/Tests/badge.svg)\n\n⚠️ Not for production. Use at your own risk; there will be breaking changes because the spec is not yet finalized ⚠️\n\nA work-in-progress polyfill for the [appHistory proposal](https://github.com/WICG/app-history).\n\n## Usage\n\nThis polyfill must run in a browser-like environment (e.g. an env that has `window.location` and `window.history`). If there's time, and demand for it, I think it would be interesting to have a discussion about how this polyfill could work in other environments.\n\nTo setup the polyfill so that it will automatically listen for anchor tag clicks, do the following:\n\n```js\nimport { useBrowerPolyfill } from \"@frehner/apphistory\";\nuserBrowserPolyfill();\n\n// appHistory is now on the window\nwindow.appHistory.navigate();\n```\n\nAlternatively, you can create your own instance of AppHistory:\n\n```js\nimport { AppHistory } from \"@frehner/apphistory\";\nconst appHistory = new AppHistory();\n\n// use your own instance of appHistory, without any events from things like anchor tags\nappHistory.navigate();\n```\n\nYou can also get a ready-to-go ESM version from\n\n- JSDelivr https://cdn.jsdelivr.net/npm/@frehner/apphistory/build/esm/appHistory.min.js\n- unpkg https://unpkg.com/@frehner/apphistory/build/esm/appHistory.min.js\n\n## Differences\n\n- The events for an `AppHistoryEntry` use `event.detail.target` instead of `event.target` to get access to the AppHistoryEntry that fired the event.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrehner%2Fapphistory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrehner%2Fapphistory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrehner%2Fapphistory/lists"}