mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
chore: remove useless code
This commit is contained in:
@@ -47,7 +47,14 @@ export async function getManifest() {
|
||||
],
|
||||
content_scripts: [
|
||||
{
|
||||
matches: ['*://www.bilibili.com/*', '*://search.bilibili.com/*', '*://t.bilibili.com/*', '*://space.bilibili.com/*', '*://message.bilibili.com/*'],
|
||||
matches: [
|
||||
'*://www.bilibili.com/*',
|
||||
'*://search.bilibili.com/*',
|
||||
'*://t.bilibili.com/*',
|
||||
'*://space.bilibili.com/*',
|
||||
'*://message.bilibili.com/*',
|
||||
'*://www.hdslb.com/*',
|
||||
],
|
||||
js: ['./dist/contentScripts/index.global.js'],
|
||||
css: ['./dist/contentScripts/style.css'],
|
||||
run_at: 'document_start',
|
||||
|
||||
@@ -7,68 +7,6 @@ export function revokeAccessKey() {
|
||||
accessKey.value = null
|
||||
}
|
||||
|
||||
/**
|
||||
* 感謝這份專案給出的獲取accessKey的方法
|
||||
* https://github.com/indefined/UserScripts/blob/42e20281d2e4d7bce16b5c8033b67ccb6ad312e9/bilibiliHome/bilibiliHome.user.js#L1149
|
||||
*/
|
||||
// /**
|
||||
// * @deprecated
|
||||
// * @param t
|
||||
// * @param element
|
||||
// */
|
||||
// export function grantAccessKey(t: any, element: HTMLButtonElement): void {
|
||||
// const originalInnerHTML = element.innerHTML
|
||||
// element.innerHTML = `
|
||||
// <span class="animate-pulse">Loading...</span>
|
||||
// `
|
||||
// element.style.pointerEvents = 'none'
|
||||
// element.disabled = true
|
||||
|
||||
// const tip = t('auth.err_tip')
|
||||
// fetch(
|
||||
// 'https://passport.bilibili.com/login/app/third?appkey=5fd5a7d8bfd9b0e6'
|
||||
// + '&api=https%3A%2F%2Fwww.mcbbs.net%2Ftemplate%2Fmcbbs%2Fimage%2Fspecial_photo_bg.png&sign=04224646d1fea004e79606d3b038c84a',
|
||||
// {
|
||||
// method: 'GET',
|
||||
// credentials: 'include',
|
||||
// },
|
||||
// )
|
||||
// .then(res => res.json())
|
||||
// .then((data) => {
|
||||
// if (data.code || !data.data)
|
||||
// throw { tip, msg: data.msg || data.message || data.code, data }
|
||||
// else if (!data.data.has_login)
|
||||
// throw { tip, msg: t('auth.plz_login_first'), data }
|
||||
// else if (!data.data.confirm_uri)
|
||||
// throw { tip, msg: t('auth.receive_verified_url_err'), data }
|
||||
// else return data.data.confirm_uri
|
||||
// })
|
||||
// .then(
|
||||
// url =>
|
||||
// browser.runtime
|
||||
// .sendMessage({
|
||||
// contentScriptQuery: 'getAccessKey',
|
||||
// confirmUri: url,
|
||||
// })
|
||||
// .then((res: { accessKey: string }) => {
|
||||
// accessKey.value = res.accessKey
|
||||
// return Promise.resolve()
|
||||
// })
|
||||
// .catch((err: any) => {
|
||||
// // eslint-disable-next-line prefer-promise-reject-errors
|
||||
// return Promise.reject({ tip, msg: t('auth.failed_to_get_accesskey'), data: err })
|
||||
// }),
|
||||
// )
|
||||
// .catch((error) => {
|
||||
// element.innerHTML = originalInnerHTML
|
||||
// element.style.pointerEvents = 'auto'
|
||||
// element.disabled = false
|
||||
|
||||
// alert(`${error.tip}: ${error.msg}`)
|
||||
// console.error(`${error.msg}: `, error.data)
|
||||
// })
|
||||
// }
|
||||
|
||||
// https://socialsisteryi.github.io/bilibili-API-collect/docs/misc/sign/APPKey.html#appkey
|
||||
export const TVAppKey = {
|
||||
appkey: '4409e2ce8ffd12b8',
|
||||
|
||||
Reference in New Issue
Block a user