diff options
author | vnugent <public@vaughnnugent.com> | 2023-11-22 02:21:53 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-11-22 02:21:53 -0500 |
commit | 2ba94602a87c87b47f566745bdab40ce75e0e879 (patch) | |
tree | 396cb9c6d73d6bfb4e4b2d4fb440d7656fe493e0 /extension/src/webext-bridge/internal/endpoint.ts | |
parent | 43429314c0989b423e116be3e9f222eba5b636c3 (diff) |
latest patches, remove webext-bridge, lastest vnlib.browser
Diffstat (limited to 'extension/src/webext-bridge/internal/endpoint.ts')
-rw-r--r-- | extension/src/webext-bridge/internal/endpoint.ts | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/extension/src/webext-bridge/internal/endpoint.ts b/extension/src/webext-bridge/internal/endpoint.ts deleted file mode 100644 index 0c271f2..0000000 --- a/extension/src/webext-bridge/internal/endpoint.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Endpoint, RuntimeContext } from '../types' - -const ENDPOINT_RE = /^((?:background$)|devtools|popup|options|content-script|window)(?:@(\d+)(?:\.(\d+))?)?$/ - -export const parseEndpoint = (endpoint: string): Endpoint => { - const [, context, tabId, frameId] = endpoint.match(ENDPOINT_RE) || [] - - return { - context: context as RuntimeContext, - tabId: +tabId, - frameId: frameId ? +frameId : undefined, - } -} - -export const formatEndpoint = ({ context, tabId, frameId }: Endpoint): string => { - if (['background', 'popup', 'options'].includes(context)) - return context - - return `${context}@${tabId}${frameId ? `.${frameId}` : ''}` -} |