{"id":13647449,"url":"https://github.com/WebReflection/url-search-params","last_synced_at":"2025-04-22T02:31:46.544Z","repository":{"id":32840022,"uuid":"36433438","full_name":"WebReflection/url-search-params","owner":"WebReflection","description":"Simple polyfill for URLSearchParams standard","archived":true,"fork":false,"pushed_at":"2018-11-26T09:49:26.000Z","size":92,"stargazers_count":764,"open_issues_count":0,"forks_count":91,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-05-22T20:32:25.185Z","etag":null,"topics":["polyfill","urlsearchparams"],"latest_commit_sha":null,"homepage":null,"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/WebReflection.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-28T11:16:46.000Z","updated_at":"2024-02-08T19:51:15.000Z","dependencies_parsed_at":"2022-08-30T18:22:09.206Z","dependency_job_id":null,"html_url":"https://github.com/WebReflection/url-search-params","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Furl-search-params","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Furl-search-params/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Furl-search-params/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Furl-search-params/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/url-search-params/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223887609,"owners_count":17219960,"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":["polyfill","urlsearchparams"],"created_at":"2024-08-02T01:03:34.025Z","updated_at":"2024-11-09T21:30:40.745Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","readme":"url-search-params\n=================\n\n[![build status](https://secure.travis-ci.org/WebReflection/url-search-params.svg)](http://travis-ci.org/WebReflection/url-search-params) [![CDNJS version](https://img.shields.io/cdnjs/v/url-search-params.svg)](https://cdnjs.com/libraries/url-search-params) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000\u0026style=flat)](https://github.com/WebReflection/donate)\n\n# Deprecated\n\nThis polyfill has been improved, better tested, and moved under the [ungap](https://ungap.github.io) umbrella.\n\nThe new version is available as [@ungap/url-search-params](https://github.com/ungap/url-search-params).\n\n- - -\n\nThis is a polyfill for the [URLSearchParams API](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams).\n\nIt is possible to simply include [build/url-search-params.js](build/url-search-params.js) or grab it via npm.\n\n```\nnpm install url-search-params\n```\n\nThe function is exported directly.\n```js\nvar URLSearchParams = require('url-search-params');\n```\n\nMIT Style License\n\n### iOS 10 + other platforms bug\n\nIn case you'd like to replace the broken global native constructor, you can check some well known issue before including this polyfill on your project/page.\n\n```html\n\u003cscript\u003e\ntry { if (new URLSearchParams('q=%2B').get('q') !== '+') throw {}; }\ncatch (error) {\n  window.URLSearchParams = void 0;\n  document.write('\u003cscript src=\"/js/url-search-params.js\"\u003e\u003c'+'/script\u003e');\n}\n\u003c/script\u003e\n```\n\n#### About HTMLAnchorElement.prototype.searchParams\nThis property is already implemented in Firefox and polyfilled here only for browsers that exposes getters and setters\nthrough the `HTMLAnchorElement.prototype`.\n\nIn order to know if such property is supported, you **must** do the check as such:\n```\nif ('searchParams' in HTMLAnchorElement.prototype) {\n  // polyfill for \u003ca\u003e links supported\n}\n```\nIf you do this check instead:\n```js\nif (HTMLAnchorElement.prototype.searchParams) {\n  // throws a TypeError\n}\n```\nthis polyfill will reflect native behavior, throwing a type error due access to a property in a non instance of `HTMLAnchorElement`.\n\nNothing new to learn here, [just a reminder](http://webreflection.blogspot.co.uk/2011/08/please-stop-reassigning-for-no-reason.html).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWebReflection%2Furl-search-params","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWebReflection%2Furl-search-params","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWebReflection%2Furl-search-params/lists"}