更新逻辑

This commit is contained in:
Tw93
2022-11-15 19:54:11 +08:00
parent b6d71531b3
commit 6be202bbc7
2 changed files with 14 additions and 2 deletions

11
dist/twitter.css vendored
View File

@@ -93,7 +93,18 @@ a[href='/i/bookmarks'] {
header[role='banner'] nav[role='navigation']:hover > * > div {
backdrop-filter: blur(12px) !important;
}
header[role='banner'] nav[role='navigation'] > a {
position: relative;
}
header[role='banner'] nav[role='navigation'] > a::before {
content: '';
position: absolute;
top: 0px;
right: -40px;
bottom: 0px;
left: 0px;
}
/* Align account button with floating tweet button */
[data-testid='SideNav_AccountSwitcher_Button'] {
bottom: 18px !important;

View File

@@ -128,10 +128,11 @@ window.addEventListener('DOMContentLoaded', (_event) => {
document.addEventListener('click', (e) => {
const origin = e.target.closest('a');
const href = origin.href;
if (href) {
if (origin && origin.href) {
origin.target = '_self';
//额外处理下 twitter 的外跳,对于其他需要外跳的可以改这里成对应域名
const href = origin.href;
if(location.host === "twitter.com" && href.indexOf("twitter.com")===-1){
e.preventDefault();
window.ipc.postMessage(`open_browser:${href}`);