Skip to content

Commit

Permalink
Polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Feb 9, 2025
1 parent 7182695 commit 8036537
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/public/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"buildMajor":1,"buildMinor":125,"buildRevision":288,"buildTag":"dev","buildDate":"Sun Feb 02 2025","build":"1.125.288 dev"}
{"buildMajor":1,"buildMinor":125,"buildRevision":291,"buildTag":"dev","buildDate":"Mon Feb 10 2025","build":"1.125.291 dev"}
15 changes: 15 additions & 0 deletions client/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ import App from './App';
import reportWebVitals from './reportWebVitals';
import { reportVital } from './client/util/vitalreporter';

// polyfill for url canParse
if (!URL.canParse) {
// eslint-disable-next-line no-console
console.log('Polyfilling URL.canParse');
URL.canParse = (url, base) => {
try {
// eslint-disable-next-line no-new
new URL(url, base);
return true;
} catch {
return false;
}
};
}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<App />,
Expand Down
2 changes: 1 addition & 1 deletion client/src/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"buildMajor":1,"buildMinor":125,"buildRevision":288,"buildTag":"dev","buildDate":"Sun Feb 02 2025","build":"1.125.288 dev"}
{"buildMajor":1,"buildMinor":125,"buildRevision":291,"buildTag":"dev","buildDate":"Mon Feb 10 2025","build":"1.125.291 dev"}

0 comments on commit 8036537

Please sign in to comment.