1.1.0 • Published 6 years ago

url-search-params v1.1.0

Weekly downloads
90,263
License
MIT
Repository
github
Last release
6 years ago

url-search-params

build status CDNJS version donate

This is a polyfill for the URLSearchParams API.

It is possible to simply include build/url-search-params.js or grab it via npm.

npm install url-search-params

The function is exported directly.

var URLSearchParams = require('url-search-params');

MIT Style License

iOS 10 + other platforms bug

In 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.

<script>
try { if (new URLSearchParams('q=%2B').get('q') !== '+') throw {}; }
catch (error) {
  window.URLSearchParams = void 0;
  document.write('<script src="/js/url-search-params.js"><'+'/script>');
}
</script>

About HTMLAnchorElement.prototype.searchParams

This property is already implemented in Firefox and polyfilled here only for browsers that exposes getters and setters through the HTMLAnchorElement.prototype.

In order to know if such property is supported, you must do the check as such:

if ('searchParams' in HTMLAnchorElement.prototype) {
  // polyfill for <a> links supported
}

If you do this check instead:

if (HTMLAnchorElement.prototype.searchParams) {
  // throws a TypeError
}

this polyfill will reflect native behavior, throwing a type error due access to a property in a non instance of HTMLAnchorElement.

Nothing new to learn here, just a reminder.

@flyteorg/console@flyteoss/consoletarnet-jumbo-reactk2.n3oflowbuilder-testvulcan-cra-starter@apemesh/ceamsprogram_leader_portal_pyapplication-deals@everything-registry/sub-chunk-3023driver-libdriver-vendorservices-componentsservice-worker-mockshipment-service-uisinooa-redux-crudstampydiva.jsrap2h-reactivesearchrep-webreactivesearch-kfetch-fixrfuicoreehome-appcspace-apireact-native-twitterslack-emoji-uploadercareship_trackingbuildapi@beisen/beisencloud-mobile@beisen/chaos-ui@beisen-cmps/platform-user-selector@beisen/talent-core-build@beisen/talent-ui-helper@beisen/tita-feed@beisen/upaas-metadata-core@beisen-platform/platform-base@beisen-platform/platform-runtime-helpers@beisen-platform/platform-user-selector@beisen/BeisenCloudMobile@beisen/ChaosUI@beisen/ChaosUI-V1@beisen/TitaFeed@beisen-cmps/platform-base@beisen/platform-base@beisen/platform-fetchcoordination-clicot-lib@blossa/service-worker-mockcra-template-vulcan@crud/react-nativeau-base@atlassian/pubsub@appbaseio/reactivebase@docomodigital/js-fetcherreact-codeartdawa-kortdawa-utilreact-custom-pdf-highlighter@dotdev/reactivesearchreact-application-core@allmywallets/providersbase-rfront@aitianyu.cn/server-base@alicloud/console-components-utilsthe-oceanthe-ocean-x@salus-hz/framework@shopgate/pwa-commonak-mentionak-emojiace2-3d-viewer@valos/core@whinc/web-console@theocean/client@steere/node-curb@talentui/biz-helperai-iaics-image-viewer-appaxios-yet-another-proxy-fixaux-shepherdforest-reactfeeles-idetarnet-uifarofftfl-clientsw-mockswsuifunctional-ts-reactfunctional-ts-restgenomelink-nodevue-questionnairegitee-pages-buildgithub-status-api-guitm-apitsp-utiltsp-componentuberflip-image-uploadergrommet-swaggerurl-search-params-updateusd-boiler-plate
1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.10.2

6 years ago

0.10.1

6 years ago

0.10.0

7 years ago

0.7.1

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago