Skip to content

Commit

Permalink
Deprecate Ajax Hook API (the1812#4117)
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed Apr 8, 2023
1 parent 315d830 commit f22105f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/ajax-hook/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/* ⚠ Ajax Hook API 已废弃, 请勿使用 */

import { PluginMetadata } from '../plugin'

// https://github.com/the1812/Bilibili-Evolved/issues/84
let ajaxHooked = false
const handlerMap: Map<string, ((...args: any[]) => void)[]> = new Map()

/** @deprecated ⚠ Ajax Hook API 已废弃, 请勿使用 */
export const getHandlers = (name: string) => {
const lowercase = name.toLowerCase()
let handlers = handlerMap.get(lowercase)
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/ajax-hook/listeners.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* ⚠ Ajax Hook API 已废弃, 请勿使用 */

import { getHandlers } from '.'

type AjaxListenerType =
Expand All @@ -12,6 +14,7 @@ type AjaxListenerType =

/**
* 添加Ajax监听器
* @deprecated ⚠ Ajax Hook API 已废弃, 请勿使用
* @param type 事件类型
* @param listener 监听器函数
*/
Expand All @@ -20,6 +23,7 @@ export const addAjaxListener = (type: AjaxListenerType, listener: (...args: any[
}
/**
* 移除Ajax监听器
* @deprecated ⚠ Ajax Hook API 已废弃, 请勿使用
* @param type 事件类型
* @param listener 监听器函数
*/
Expand Down

0 comments on commit f22105f

Please sign in to comment.