Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/module/util.ts>getObjectURL

A JavaScript extension package for building strong and modern applications.
Latest
function getObjectURL
import { getObjectURL } from "https://deno.land/x/ayonli_jsext@v0.9.72/module/util.ts";

This function is primarily used to bypass the same-origin policy for Web Workers in the browser, it downloads the script from the given URL and converts it to an object URL which can be used by the Worker constructor.

This function can also be used in other scenarios as it also corrects the content-type of the response to ensure the script can be loaded properly.

NOTE: This function is primarily designed for the browser, it has very little use on the server side.

Parameters

src: string
optional
mimeType: string = [UNSUPPORTED]

Returns

Promise<string>