mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Merge branch 'preview-fixes' into master-cdn
This commit is contained in:
commit
91e80d9c55
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -16,6 +16,7 @@
|
|||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"afterbegin",
|
"afterbegin",
|
||||||
"afterend",
|
"afterend",
|
||||||
|
"BALH",
|
||||||
"Bangumi",
|
"Bangumi",
|
||||||
"bevo",
|
"bevo",
|
||||||
"bili",
|
"bili",
|
||||||
|
|||||||
@ -34,12 +34,16 @@ export const init = async () => {
|
|||||||
compatibilityPatch()
|
compatibilityPatch()
|
||||||
})
|
})
|
||||||
|
|
||||||
if (unsafeWindow.bangumi_area_limit_hack) {
|
const { coreApis, externalApis } = await import('@/core/core-apis')
|
||||||
|
if (
|
||||||
|
unsafeWindow.bangumi_area_limit_hack &&
|
||||||
|
coreApis.settings.getComponentSettings<{ disableOnBalh: boolean }>('compatibilities').options
|
||||||
|
.disableOnBalh
|
||||||
|
) {
|
||||||
console.log('BALH detected, Bilibili Evolved is disabled.')
|
console.log('BALH detected, Bilibili Evolved is disabled.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const { coreApis, externalApis } = await import('@/core/core-apis')
|
|
||||||
unsafeWindow.bilibiliEvolved = externalApis
|
unsafeWindow.bilibiliEvolved = externalApis
|
||||||
/** sand-boxed window, safe to use original name */
|
/** sand-boxed window, safe to use original name */
|
||||||
window.coreApis = coreApis
|
window.coreApis = coreApis
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { component as LaunchBar } from './launch-bar'
|
|||||||
import { component as I18n } from './i18n'
|
import { component as I18n } from './i18n'
|
||||||
import { component as AutoUpdate } from './auto-update'
|
import { component as AutoUpdate } from './auto-update'
|
||||||
import { component as NotifyNewVersion } from './notify-new-version'
|
import { component as NotifyNewVersion } from './notify-new-version'
|
||||||
|
import { component as Compatibilities } from './compatibilities'
|
||||||
|
|
||||||
export const getBuiltInComponents = (): ComponentMetadata[] => [
|
export const getBuiltInComponents = (): ComponentMetadata[] => [
|
||||||
SettingsPanel,
|
SettingsPanel,
|
||||||
@ -11,6 +12,7 @@ export const getBuiltInComponents = (): ComponentMetadata[] => [
|
|||||||
I18n,
|
I18n,
|
||||||
AutoUpdate,
|
AutoUpdate,
|
||||||
NotifyNewVersion,
|
NotifyNewVersion,
|
||||||
|
Compatibilities,
|
||||||
]
|
]
|
||||||
|
|
||||||
export const isBuiltInComponent = (name: string) =>
|
export const isBuiltInComponent = (name: string) =>
|
||||||
|
|||||||
1
src/components/compatibilities/index.md
Normal file
1
src/components/compatibilities/index.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
- `与 "解除 B 站区域限制" 互斥`: 若打开此选项, 在检测到 "解除 B 站区域限制" 脚本时, 将停止此脚本的加载以避免布局错乱.
|
||||||
18
src/components/compatibilities/index.ts
Normal file
18
src/components/compatibilities/index.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// import { addComponentListener } from '@/core/settings'
|
||||||
|
import { componentsTags } from '@/components/types'
|
||||||
|
import { none } from '@/core/utils'
|
||||||
|
import { defineComponentMetadata } from '../define'
|
||||||
|
|
||||||
|
export const component = defineComponentMetadata({
|
||||||
|
name: 'compatibilities',
|
||||||
|
displayName: '兼容性选项',
|
||||||
|
configurable: false,
|
||||||
|
tags: [componentsTags.general],
|
||||||
|
options: {
|
||||||
|
disableOnBalh: {
|
||||||
|
defaultValue: false,
|
||||||
|
displayName: '与 "解除 B 站区域限制" 互斥',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
entry: none,
|
||||||
|
})
|
||||||
Loading…
Reference in New Issue
Block a user