aboutsummaryrefslogtreecommitdiff
path: root/extension/src/webext-bridge/internal/endpoint.ts
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src/webext-bridge/internal/endpoint.ts')
-rw-r--r--extension/src/webext-bridge/internal/endpoint.ts20
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}` : ''}`
-}