BigQuery UDFs don't support certain browser APIs
like URL due to their restricted JavaScript runtime environment.
BigQuery UDFs can't call external APIs, it won't be able to run and perform additional API calls. As mentioned by @Mikhhali can try with the BigQuery NET functions .
As of now BigQuery UDFs do not support browser-specific APIs like URL .If you want that feature you can open a new Feature request
as per your requirements on the public issue tracker describing your issue and vote [+1] and Eng team will look on the feature for future implementation