UNPKG

@ayonli/jsext

Version:

A JavaScript extension package for building strong and modern applications.

13 lines (12 loc) 592 B
/** * 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. */ export declare function getObjectURL(src: string, mimeType?: string): Promise<string>;