mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix monkey cache
This commit is contained in:
parent
9e93313b6c
commit
fc78c3ada7
@ -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'
|
||||
)
|
||||
|
||||
@ -151,6 +151,7 @@ export const postJsonWithCredentials = (url: string, json: any) => send<string>(
|
||||
export const monkey = <T = any>(details: MonkeyXhrBasicDetails) => (
|
||||
new Promise<T>((resolve, reject) => {
|
||||
const fullDetails: MonkeyXhrDetails = {
|
||||
nocache: true,
|
||||
...details,
|
||||
onload: (r: MonkeyXhrResponse) => resolve(r.response),
|
||||
onerror: (r: MonkeyXhrResponse) => {
|
||||
|
||||
5
src/global.d.ts
vendored
5
src/global.d.ts
vendored
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user