mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix bugs
This commit is contained in:
parent
252857d6c7
commit
343f305f03
88
@types/global/index.d.ts
vendored
88
@types/global/index.d.ts
vendored
@ -329,93 +329,5 @@ declare global {
|
||||
const ascendingSort: <T>(itemProp: (item: T) => number) => (a: T, b: T) => number
|
||||
const descendingSort: <T>(itemProp: (item: T) => number) => (a: T, b: T) => number
|
||||
const getDpiSourceSet: (src: string, baseSize: number | string | { width?: number | string, height?: number | string }, extension?: string) => string
|
||||
|
||||
interface CookieAttributes {
|
||||
/**
|
||||
* Define when the cookie will be removed. Value can be a Number
|
||||
* which will be interpreted as days from time of creation or a
|
||||
* Date instance. If omitted, the cookie becomes a session cookie.
|
||||
*/
|
||||
expires?: number | Date;
|
||||
|
||||
/**
|
||||
* Define the path where the cookie is available. Defaults to '/'
|
||||
*/
|
||||
path?: string;
|
||||
|
||||
/**
|
||||
* Define the domain where the cookie is available. Defaults to
|
||||
* the domain of the page where the cookie was created.
|
||||
*/
|
||||
domain?: string;
|
||||
|
||||
/**
|
||||
* A Boolean indicating if the cookie transmission requires a
|
||||
* secure protocol (https). Defaults to false.
|
||||
*/
|
||||
secure?: boolean;
|
||||
}
|
||||
|
||||
interface CookiesStatic<T extends object = object> {
|
||||
/**
|
||||
* Allows default cookie attributes to be accessed, changed, or reset
|
||||
*/
|
||||
defaults: CookieAttributes;
|
||||
|
||||
/**
|
||||
* Create a cookie
|
||||
*/
|
||||
set(name: string, value: string | T, options?: CookieAttributes): void;
|
||||
|
||||
/**
|
||||
* Read cookie
|
||||
*/
|
||||
get(name: string): string | undefined;
|
||||
|
||||
/**
|
||||
* Read all available cookies
|
||||
*/
|
||||
get(): { [key: string]: string };
|
||||
|
||||
/**
|
||||
* Returns the parsed representation of the string
|
||||
* stored in the cookie according to JSON.parse
|
||||
*/
|
||||
getJSON(name: string): any;
|
||||
|
||||
/**
|
||||
* Returns the parsed representation of
|
||||
* all cookies according to JSON.parse
|
||||
*/
|
||||
getJSON(): { [key: string]: any };
|
||||
|
||||
/**
|
||||
* Delete cookie
|
||||
*/
|
||||
remove(name: string, options?: CookieAttributes): void;
|
||||
|
||||
/**
|
||||
* If there is any danger of a conflict with the namespace Cookies,
|
||||
* the noConflict method will allow you to define a new namespace
|
||||
* and preserve the original one. This is especially useful when
|
||||
* running the script on third party sites e.g. as part of a widget
|
||||
* or SDK. Note: The noConflict method is not necessary when using
|
||||
* AMD or CommonJS, thus it is not exposed in those environments.
|
||||
*/
|
||||
noConflict?(): CookiesStatic<T>;
|
||||
|
||||
/**
|
||||
* Create a new instance of the api that overrides the default
|
||||
* decoding implementation. All methods that rely in a proper
|
||||
* decoding to work, such as Cookies.remove() and Cookies.get(),
|
||||
* will run the converter first for each cookie. The returned
|
||||
* string will be used as the cookie value.
|
||||
*/
|
||||
withConverter<TConv extends object>(converter: CookieReadConverter | { write?: CookieWriteConverter<TConv>; read?: CookieReadConverter; }): CookiesStatic<TConv>;
|
||||
}
|
||||
|
||||
type CookieWriteConverter<T extends object> = (value: string | T, name: string) => string;
|
||||
type CookieReadConverter = (value: string, name: string) => string;
|
||||
const Cookies: CookiesStatic;
|
||||
}
|
||||
export { };
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -20,7 +20,6 @@
|
||||
// @require https://code.jquery.com/jquery-3.4.0.min.js
|
||||
// @require https://cdn.bootcss.com/jszip/3.1.5/jszip.min.js
|
||||
// @require https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js
|
||||
// @require https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
|
||||
// @icon https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/logo-small.png
|
||||
// @icon64 https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/logo.png
|
||||
// ==/UserScript==
|
||||
@ -2387,15 +2386,8 @@ try {
|
||||
debugger
|
||||
}
|
||||
},
|
||||
get newHomePage () {
|
||||
return Cookies.get('INTVER') === '1' ? true : false
|
||||
},
|
||||
set newHomePage (value) {
|
||||
if (value === true) {
|
||||
Cookies.set('INTVER', '1', { expires: 365, path: '/', domain: '.bilibili.com' })
|
||||
} else {
|
||||
Cookies.remove('INTVER')
|
||||
}
|
||||
newHomePage: () => {
|
||||
document.cookie = 'INTVER=1; domain=.bilibili.com; path=/; expires=Fri, 21 Aug 2020 02:13:04 GMT'
|
||||
},
|
||||
monkeyInfo: GM_info,
|
||||
monkeyApis: {
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
// @require https://code.jquery.com/jquery-3.4.0.min.js
|
||||
// @require https://cdn.bootcss.com/jszip/3.1.5/jszip.min.js
|
||||
// @require https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js
|
||||
// @require https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
|
||||
// @icon https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/images/logo-small.png
|
||||
// @icon64 https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/images/logo.png
|
||||
// ==/UserScript==
|
||||
@ -2387,15 +2386,8 @@ try {
|
||||
debugger
|
||||
}
|
||||
},
|
||||
get newHomePage () {
|
||||
return Cookies.get('INTVER') === '1' ? true : false
|
||||
},
|
||||
set newHomePage (value) {
|
||||
if (value === true) {
|
||||
Cookies.set('INTVER', '1', { expires: 365, path: '/', domain: '.bilibili.com' })
|
||||
} else {
|
||||
Cookies.remove('INTVER')
|
||||
}
|
||||
newHomePage: () => {
|
||||
document.cookie = 'INTVER=1; domain=.bilibili.com; path=/; expires=Fri, 21 Aug 2020 02:13:04 GMT'
|
||||
},
|
||||
monkeyInfo: GM_info,
|
||||
monkeyApis: {
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
// @require https://code.jquery.com/jquery-3.4.0.min.js
|
||||
// @require https://cdn.bootcss.com/jszip/3.1.5/jszip.min.js
|
||||
// @require https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js
|
||||
// @require https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
|
||||
// @icon https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/logo-small.png
|
||||
// @icon64 https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/images/logo.png
|
||||
// ==/UserScript==
|
||||
@ -126,15 +125,8 @@ try {
|
||||
debugger
|
||||
}
|
||||
},
|
||||
get newHomePage () {
|
||||
return Cookies.get('INTVER') === '1' ? true : false
|
||||
},
|
||||
set newHomePage (value) {
|
||||
if (value === true) {
|
||||
Cookies.set('INTVER', '1', { expires: 365, path: '/', domain: '.bilibili.com' })
|
||||
} else {
|
||||
Cookies.remove('INTVER')
|
||||
}
|
||||
newHomePage: () => {
|
||||
document.cookie = 'INTVER=1; domain=.bilibili.com; path=/; expires=Fri, 21 Aug 2020 02:13:04 GMT'
|
||||
},
|
||||
monkeyInfo: GM_info,
|
||||
monkeyApis: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user