diff --git a/registry/lib/components/utils/dev-client/client.ts b/registry/lib/components/utils/dev-client/client.ts index 707ccb647..ef42cc5e6 100644 --- a/registry/lib/components/utils/dev-client/client.ts +++ b/registry/lib/components/utils/dev-client/client.ts @@ -143,7 +143,7 @@ export class DevClient extends EventTarget { if (!oldComponent) { return } - const code: string = await coreApis.ajax.monkey({ url }) + const code: string = await monkey({ url }) const { installFeatureFromCode } = await import( '@/core/install-feature' ) diff --git a/src/core/ajax.ts b/src/core/ajax.ts index 400f367d8..fc5bacf6c 100644 --- a/src/core/ajax.ts +++ b/src/core/ajax.ts @@ -151,6 +151,7 @@ export const postJsonWithCredentials = (url: string, json: any) => send( export const monkey = (details: MonkeyXhrBasicDetails) => ( new Promise((resolve, reject) => { const fullDetails: MonkeyXhrDetails = { + nocache: true, ...details, onload: (r: MonkeyXhrResponse) => resolve(r.response), onerror: (r: MonkeyXhrResponse) => { diff --git a/src/global.d.ts b/src/global.d.ts index 4d71650a5..536b695f1 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -51,14 +51,17 @@ declare global { method?: 'GET' | 'POST' | 'HEAD' headers?: { [name: string]: string }, data?: string + cookie?: string binary?: boolean + nocache?: boolean + revalidate?: boolean timeout?: number context?: any responseType?: 'arraybuffer' | 'blob' | 'json' | 'text' overrideMimeType?: string anonymous?: boolean fetch?: boolean - username?: string + user?: string password?: string } interface MonkeyXhrDetails extends MonkeyXhrBasicDetails {