diff --git a/src/adapter/chrome.ts b/src/adapter/chrome.ts index d7b0104..ebfe409 100644 --- a/src/adapter/chrome.ts +++ b/src/adapter/chrome.ts @@ -105,7 +105,10 @@ export const createChromeHandler = ( } const subscription = result.subscribe({ - next: (data) => sendResponse({ result: { type: 'data', data } }), + next: (data) => { + const serializedData = transformer.output.serialize(data); + sendResponse({ result: { type: 'data', data: serializedData } }); + }, error: handleError, complete: () => sendResponse({ result: { type: 'stopped' } }), }); diff --git a/src/adapter/window.ts b/src/adapter/window.ts index 1e63f8f..7d7c2c3 100644 --- a/src/adapter/window.ts +++ b/src/adapter/window.ts @@ -111,7 +111,11 @@ export const createWindowHandler = ( } const subscription = result.subscribe({ - next: (data) => sendResponse({ result: { type: 'data', data } }), + next: (data) => { + const serializedData = transformer.output.serialize(data); + + sendResponse({ result: { type: 'data', data: serializedData } }); + }, error: handleError, complete: () => sendResponse({ result: { type: 'stopped' } }), });