Skip to content

Commit

Permalink
feat: support bookmark redirect for youtube
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Mar 7, 2023
1 parent 7991a52 commit c00bb64
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ export default function Header({
<Tooltip>
<TooltipTrigger>
<a
href="javascript:(function(){if(!window.location.hostname
.includes('bilibili.com')){alert('🔖请进入B站视频页面再点击书签哦!')};location.href=location.href.replace('bilibili.com','bilibili.jimmylv.cn')}())"
href="javascript:(function(){if (window.location.hostname.includes('bilibili.com') || window.location.hostname.includes('youtube.com')) {window.open(location.href.replace('.com', '.jimmylv.cn'), '_blank');} else {alert('🔖请进入B站或YouTube视频页面,再来点击书签哦!');}}())"
rel="noreferrer noopener"
target="_blank"
className="flex hidden items-center space-x-2 sm:block"
aria-label="书签版"
onClick={() =>
alert("🔖请拖至书签栏,进入B站视频页面再点击书签哦!")
alert("🔖请拖至书签栏,进入B站或YouTube视频页面,再来点击书签哦!")
}
>
🔖
Expand Down

1 comment on commit c00bb64

@vercel
Copy link

@vercel vercel bot commented on c00bb64 Mar 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.