Skip to content

Instantly share code, notes, and snippets.

@hu9o
hu9o / url-api-polyfill.js
Last active February 11, 2025 16:25 — forked from ryangoree/url-api-polyfill.js
URL Polyfill
(function() {
if (typeof URL != 'function') {
rewriteURL();
} else if (!('searchParams' in new URL(window.location))) {
rewriteURL();
}
function rewriteURL() {
// Overwrite URL if no searchParams property exists.