From 6c7f1aceceab21bd5db888d2e1c2604084f0c0ae Mon Sep 17 00:00:00 2001 From: mrjvs Date: Thu, 11 Jan 2024 19:16:22 +0100 Subject: [PATCH] Remove requestDomain --- src/backend/extension/messaging.ts | 18 +++--------------- src/backend/extension/plasmo.ts | 4 +--- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/backend/extension/messaging.ts b/src/backend/extension/messaging.ts index 4594fb23..6d1f32fd 100644 --- a/src/backend/extension/messaging.ts +++ b/src/backend/extension/messaging.ts @@ -36,31 +36,19 @@ function sendMessage( export async function sendExtensionRequest( ops: Omit, ): Promise | null> { - return sendMessage("makeRequest", { - requestDomain: window.location.origin, // TODO unsafe - ...ops, - }); + return sendMessage("makeRequest", ops); } export async function setDomainRule( ops: Omit, ): Promise { - return sendMessage("prepareStream", { - requestDomain: window.location.origin, - ...ops, - }); + return sendMessage("prepareStream", ops); } export async function extensionInfo(): Promise< MessagesMetadata["hello"]["res"] | null > { - const message = await sendMessage( - "hello", - { - requestDomain: window.location.origin, - }, - 300, - ); + const message = await sendMessage("hello", {}, 300); if (!message?.success) return null; if (!message.allowed) return null; return message; diff --git a/src/backend/extension/plasmo.ts b/src/backend/extension/plasmo.ts index e142ef6a..12222b22 100644 --- a/src/backend/extension/plasmo.ts +++ b/src/backend/extension/plasmo.ts @@ -1,6 +1,4 @@ -export interface ExtensionBaseRequest { - requestDomain: string; -} +export interface ExtensionBaseRequest {} export type ExtensionBaseResponse = | ({