mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Remove deprecated live iframe (#5055)
This commit is contained in:
parent
81ef584251
commit
7e61d3f283
@ -4,10 +4,10 @@ import { ranking } from './ranking/ranking'
|
|||||||
import { userInfo } from './user-info/user-info'
|
import { userInfo } from './user-info/user-info'
|
||||||
import { logo } from './logo/logo'
|
import { logo } from './logo/logo'
|
||||||
import { home } from './home/home'
|
import { home } from './home/home'
|
||||||
import { livesIframe, mangaIframe } from './iframe/iframe'
|
import { mangaIframe } from './iframe/iframe'
|
||||||
import { games } from './games/games'
|
import { games } from './games/games'
|
||||||
import { blanks } from './flexible-blank/flexible-blank'
|
import { blanks } from './flexible-blank/flexible-blank'
|
||||||
import { bangumi, music, shop, match, creations } from './simple-links/simple-links'
|
import { bangumi, music, shop, match, creations, lives } from './simple-links/simple-links'
|
||||||
import { upload } from './upload/upload'
|
import { upload } from './upload/upload'
|
||||||
import { search } from './search/search'
|
import { search } from './search/search'
|
||||||
import { feeds } from './feeds/feeds'
|
import { feeds } from './feeds/feeds'
|
||||||
@ -25,7 +25,7 @@ export const getBuiltInItems = (): CustomNavbarItemInit[] => [
|
|||||||
ranking,
|
ranking,
|
||||||
music,
|
music,
|
||||||
games,
|
games,
|
||||||
livesIframe,
|
lives,
|
||||||
shop,
|
shop,
|
||||||
match,
|
match,
|
||||||
mangaIframe,
|
mangaIframe,
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { addComponentListener } from '@/core/settings'
|
|||||||
import { isIframe, isNotHtml, matchUrlPattern, mountVueComponent } from '@/core/utils'
|
import { isIframe, isNotHtml, matchUrlPattern, mountVueComponent } from '@/core/utils'
|
||||||
import { setupNotifyStyle } from './notify-style'
|
import { setupNotifyStyle } from './notify-style'
|
||||||
import { setupLinkPopupContentAlignStyle } from './link-popup-content-align-style'
|
import { setupLinkPopupContentAlignStyle } from './link-popup-content-align-style'
|
||||||
|
import { migrateOrders } from './orders-migration'
|
||||||
|
|
||||||
export const entry: ComponentEntry = async ({ metadata: { name } }) => {
|
export const entry: ComponentEntry = async ({ metadata: { name } }) => {
|
||||||
// const url = document.URL.replace(location.search, '')
|
// const url = document.URL.replace(location.search, '')
|
||||||
@ -50,6 +51,7 @@ export const entry: ComponentEntry = async ({ metadata: { name } }) => {
|
|||||||
if (matchUrlPattern('https://www.bilibili.com/account/history')) {
|
if (matchUrlPattern('https://www.bilibili.com/account/history')) {
|
||||||
document.body.classList.add('history-page')
|
document.body.classList.add('history-page')
|
||||||
}
|
}
|
||||||
|
migrateOrders()
|
||||||
const CustomNavbar = await import('./CustomNavbar.vue')
|
const CustomNavbar = await import('./CustomNavbar.vue')
|
||||||
const customNavbar: Vue & {
|
const customNavbar: Vue & {
|
||||||
styles: string[]
|
styles: string[]
|
||||||
|
|||||||
@ -21,15 +21,6 @@ const getIframeItem = (config: NavbarIframeConfig): CustomNavbarItemInit & Navba
|
|||||||
noPopupPadding: true,
|
noPopupPadding: true,
|
||||||
transparentPopup: true,
|
transparentPopup: true,
|
||||||
})
|
})
|
||||||
export const livesIframe = getIframeItem({
|
|
||||||
src: 'https://live.bilibili.com/blackboard/dropdown-menu.html',
|
|
||||||
href: 'https://live.bilibili.com',
|
|
||||||
width: 528,
|
|
||||||
height: 266,
|
|
||||||
lazy: true,
|
|
||||||
displayName: '直播',
|
|
||||||
iframeName: 'lives',
|
|
||||||
})
|
|
||||||
export const mangaIframe = getIframeItem({
|
export const mangaIframe = getIframeItem({
|
||||||
src: 'https://manga.bilibili.com/eden/bilibili-nav-panel.html',
|
src: 'https://manga.bilibili.com/eden/bilibili-nav-panel.html',
|
||||||
href: 'https://manga.bilibili.com',
|
href: 'https://manga.bilibili.com',
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
import { getComponentSettings } from '@/core/settings'
|
||||||
|
import type { CustomNavbarOptions } from '.'
|
||||||
|
|
||||||
|
export const migrateOrders = () => {
|
||||||
|
const migrations = [
|
||||||
|
['gamesIframe', 'games'],
|
||||||
|
['livesIframe', 'lives'],
|
||||||
|
]
|
||||||
|
|
||||||
|
const { options } = getComponentSettings<CustomNavbarOptions>('customNavbar')
|
||||||
|
migrations.forEach(([from, to]) => {
|
||||||
|
const oldOrder = options.order[from]
|
||||||
|
if (oldOrder !== undefined) {
|
||||||
|
options.order[to] = oldOrder
|
||||||
|
delete options.order[from]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -42,3 +42,8 @@ export const creations = getSimpleLinkItem({
|
|||||||
displayName: '创作中心',
|
displayName: '创作中心',
|
||||||
href: 'https://member.bilibili.com/platform/home',
|
href: 'https://member.bilibili.com/platform/home',
|
||||||
})
|
})
|
||||||
|
export const lives = getSimpleLinkItem({
|
||||||
|
name: 'lives',
|
||||||
|
displayName: '直播',
|
||||||
|
href: 'https://live.bilibili.com',
|
||||||
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user