mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Merge branch 'the1812:preview-fixes' into preview-fixes
This commit is contained in:
commit
40532b688a
2
.github/workflows/pull-request-check.yml
vendored
2
.github/workflows/pull-request-check.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
run: yarn type
|
||||
|
||||
- name: ESLint check
|
||||
run: yarn lint
|
||||
run: yarn lint-check
|
||||
|
||||
- name: Build core
|
||||
run: yarn build-core
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
"build-core": "webpack --config ./webpack/webpack.prod.js --bail",
|
||||
"build-features": "webpack --config ./registry/webpack/all.js --bail",
|
||||
"lint": "eslint --config ./.eslintrc.js --quiet --fix \"src/**/*.@(js|ts|vue)\" \"registry/lib/**/*.@(js|ts|vue)\"",
|
||||
"lint-check": "eslint --config ./.eslintrc.js \"src/**/*.@(js|ts|vue)\" \"registry/lib/**/*.@(js|ts|vue)\"",
|
||||
"type": "tsc -p tsconfig.type-check.json --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -13,7 +13,7 @@ const entry = styledComponentEntry(() => import('./charge-list.scss'), async ()
|
||||
if (document.body.classList.contains(SkipChargeListDisabledClass)) {
|
||||
return
|
||||
}
|
||||
//选择2.X或3.X的跳过按钮
|
||||
// 选择2.X或3.X的跳过按钮
|
||||
const jumpButton = await select('.bilibili-player-electric-panel-jump,.bpx-player-electric-jump') as HTMLElement
|
||||
jumpButton?.click()
|
||||
})
|
||||
|
||||
@ -90,13 +90,17 @@ const loadFeatureCode = async <X extends FeatureBase>(
|
||||
): Promise<LoadFeatureCodeResult<X>> => {
|
||||
// 收集代码导出值
|
||||
const exports = {}
|
||||
let result: X
|
||||
try {
|
||||
eval(code)
|
||||
result = eval(code)
|
||||
} catch (thrown) {
|
||||
return codeThrewResult(thrown)
|
||||
}
|
||||
const values = Object.values(exports)
|
||||
if (values.length === 0) {
|
||||
if (typeof result === 'object') {
|
||||
return okResult(result)
|
||||
}
|
||||
return noExportResult
|
||||
}
|
||||
return okResult(values[0] as X)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user