Microsoft Edge has been around for a while, but IE 11 is not dead! There are people in the real world who still use IE 11, so the development process especially JavaScript implementation has to account for it.
While there are many Github projects and NPM packages providing Polyfill for URLSearchParams, the easiest way to use it is using a CDN link to one of the Polyfill implementations. Here is one from:
https://cdnjs.com/libraries/url-search-params
Then link from your code like this:
<script src="https://cdnjs.cloudflare.com/ajax/libs/url-search-params/1.1.0/url-search-params.js"></script>