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) {
|
if (!oldComponent) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const code: string = await coreApis.ajax.monkey({ url })
|
const code: string = await monkey({ url })
|
||||||
const { installFeatureFromCode } = await import(
|
const { installFeatureFromCode } = await import(
|
||||||
'@/core/install-feature'
|
'@/core/install-feature'
|
||||||
)
|
)
|
||||||
|
|||||||
@ -151,6 +151,7 @@ export const postJsonWithCredentials = (url: string, json: any) => send<string>(
|
|||||||
export const monkey = <T = any>(details: MonkeyXhrBasicDetails) => (
|
export const monkey = <T = any>(details: MonkeyXhrBasicDetails) => (
|
||||||
new Promise<T>((resolve, reject) => {
|
new Promise<T>((resolve, reject) => {
|
||||||
const fullDetails: MonkeyXhrDetails = {
|
const fullDetails: MonkeyXhrDetails = {
|
||||||
|
nocache: true,
|
||||||
...details,
|
...details,
|
||||||
onload: (r: MonkeyXhrResponse) => resolve(r.response),
|
onload: (r: MonkeyXhrResponse) => resolve(r.response),
|
||||||
onerror: (r: MonkeyXhrResponse) => {
|
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'
|
method?: 'GET' | 'POST' | 'HEAD'
|
||||||
headers?: { [name: string]: string },
|
headers?: { [name: string]: string },
|
||||||
data?: string
|
data?: string
|
||||||
|
cookie?: string
|
||||||
binary?: boolean
|
binary?: boolean
|
||||||
|
nocache?: boolean
|
||||||
|
revalidate?: boolean
|
||||||
timeout?: number
|
timeout?: number
|
||||||
context?: any
|
context?: any
|
||||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'
|
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'
|
||||||
overrideMimeType?: string
|
overrideMimeType?: string
|
||||||
anonymous?: boolean
|
anonymous?: boolean
|
||||||
fetch?: boolean
|
fetch?: boolean
|
||||||
username?: string
|
user?: string
|
||||||
password?: string
|
password?: string
|
||||||
}
|
}
|
||||||
interface MonkeyXhrDetails extends MonkeyXhrBasicDetails {
|
interface MonkeyXhrDetails extends MonkeyXhrBasicDetails {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user