Skip to content

Commit

Permalink
feat: share domain
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Jan 10, 2025
1 parent 053c9c7 commit 867a538
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 4.1.2

- 新增:播放页 使用短域名分享
- 更新:评论过滤 适配新版空间页,移除旧版适配

## 4.1.1
Expand Down
2 changes: 1 addition & 1 deletion src/components/items/ListComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm"
class="no-scrollbar absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm"
>
<ListboxOption
v-slot="{ active, selected }"
Expand Down
46 changes: 43 additions & 3 deletions src/modules/rules/video/groups/basic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Item } from '@/types/item'
import { BiliCleanerStorage } from '@/utils/storage'
import { matchAvidBvid, matchBvid } from '@/utils/tool'
import URLCleanerInstance from '@/utils/urlCleaner'

Expand Down Expand Up @@ -82,9 +83,11 @@ export const videoBasicItems: Item[] = [
}
// 匹配av号, BV号, 分P号
const avbv = matchAvidBvid(location.href)
let shareText = title
? `${title} \nhttps://www.bilibili.com/video/${avbv}`
: `https://www.bilibili.com/video/${avbv}`
let domain = BiliCleanerStorage.get('video-page-simple-share-domain')
if (!domain || domain === 'disable') {
domain = 'www.bilibili.com/video'
}
let shareText = title ? `${title} \nhttps://${domain}/${avbv}` : `https://${domain}/${avbv}`
const urlObj = new URL(location.href)
const params = new URLSearchParams(urlObj.search)
if (params.has('p')) {
Expand All @@ -100,6 +103,43 @@ export const videoBasicItems: Item[] = [
},
enableFnRunAt: 'document-end',
},
{
type: 'list',
id: 'video-page-simple-share-domain',
name: '使用短域名分享',
defaultValue: 'disable',
disableValue: 'disable',
options: [
{
id: 'disable',
name: '不使用',
},
{
id: 'b23.tv',
name: 'b23.tv',
},
{
id: 'bili22.cn',
name: 'bili22.cn',
},
{
id: 'bili33.cn',
name: 'bili33.cn',
},
{
id: 'bili23.cn',
name: 'bili23.cn',
},
{
id: 'bili2233.cn',
name: 'bili2233.cn',
},
{
id: 'bilibili.com',
name: 'bilibili.com',
},
],
},
{
type: 'switch',
id: 'video-page-hide-fixed-header',
Expand Down

0 comments on commit 867a538

Please sign in to comment.