JavaScript APIs / oro:protocol-handlers

oro:protocol-handlers

oro:protocol-handlers exposes runtime helpers for custom protocol and service-worker routing.

Examples#

Ask the runtime which service worker is currently handling a custom scheme:

import { getServiceWorker } from 'oro:protocol-handlers'

const worker = await getServiceWorker({ scheme: 'npm' })

console.log(worker)

API reference#

Module specifiers#

oro:protocol-handlers

TypeScript declarations#

These declarations are generated from the runtime's published TypeScript surface.

oro:protocol-handlers#

declare module "oro:protocol-handlers" {
    /**
     * @typedef {{ scheme: string }} GetServiceWorkerOptions

    /**
     * @param {GetServiceWorkerOptions} options
     * @return {Promise<ServiceWorker|null>
     */
    export function getServiceWorker(options: GetServiceWorkerOptions): Promise<ServiceWorker | null>;
    namespace _default {
        export { getServiceWorker };
    }
    export default _default;
    /**
     * /**
     */
    export type GetServiceWorkerOptions = {
        scheme: string;
    };
}

See also#

Source repository · Edit this page · View Markdown