From e321534fbea9f09b139d440584f6b84ad0afb80f Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sat, 25 Dec 2021 00:01:18 +0100 Subject: refactor: Simplify script injection Inject CSS and main world scripts synchronously to avoid race conditions with page loading. Don't try to miming userAgentData for now, since it won't bypass google's checks. However, simply omitting chrome from the user agent does bypass them, at least for now. --- packages/service-shared/src/index.ts | 2 ++ packages/service-shared/src/schemas.ts | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'packages/service-shared') diff --git a/packages/service-shared/src/index.ts b/packages/service-shared/src/index.ts index c517959..564ebe8 100644 --- a/packages/service-shared/src/index.ts +++ b/packages/service-shared/src/index.ts @@ -22,7 +22,9 @@ export { ServiceToMainIpcMessage } from './ipc'; export type { UnreadCount, + WebSource, } from './schemas'; export { unreadCount, + webSource, } from './schemas'; diff --git a/packages/service-shared/src/schemas.ts b/packages/service-shared/src/schemas.ts index 1513e43..586750c 100644 --- a/packages/service-shared/src/schemas.ts +++ b/packages/service-shared/src/schemas.ts @@ -26,3 +26,10 @@ export const unreadCount = z.object({ }); export type UnreadCount = z.infer; + +export const webSource = z.object({ + code: z.string(), + url: z.string().nonempty(), +}); + +export type WebSource = z.infer; -- cgit v1.2.3-54-g00ecf