首頁私信
![螢幕擷取畫面 2024-06-22 114212.png 螢幕擷取畫面 2024-06-22 114212.png](https://www.bandbbs.cn/data/attachments/26/26875-a6b75a5e77a257bfae4e46b6cb8c83bf.jpg)
连结跳转功能
![螢幕錄製+2024-06-22+114534_out0001.png 螢幕錄製+2024-06-22+114534_out0001.png](https://www.bandbbs.cn/data/attachments/26/26877-fef5fc1bdb58b64c5e21162564d7b507.jpg)
篡改猴 (Tampermonkey)
![螢幕擷取畫面 2024-06-22 114212.png 螢幕擷取畫面 2024-06-22 114212.png](https://www.bandbbs.cn/data/attachments/26/26875-a6b75a5e77a257bfae4e46b6cb8c83bf.jpg)
连结跳转功能
![螢幕錄製+2024-06-22+114534_out0001.png 螢幕錄製+2024-06-22+114534_out0001.png](https://www.bandbbs.cn/data/attachments/26/26877-fef5fc1bdb58b64c5e21162564d7b507.jpg)
篡改猴 (Tampermonkey)
JavaScript:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 2024-06-18
// @description try to take over the world!
// @author You
// @match *://www.bandbbs.cn/
// @match *://www.bandbbs.cn/conversations/?value=temp
// @match *://www.bandbbs.cn/threads/*
// @match *://www.bandbbs.cn/resources/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=bandbbs.cn
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.onload=function() {
var url = window.location.href;
if (url === "http://www.bandbbs.cn/" || url === "https://www.bandbbs.cn/") {
// 創建一個新的style元素並設置其內部CSS
let styleElement = document.createElement('style');
styleElement.innerHTML = `
.block-container2 {
color: #212121;
background: #fff;
border-width: 0;
border-style: solid;
border-top-color: #e0e0e0;
border-right-color: #e0e0e0;
border-bottom-color: #e0e0e0;
border-left-color: #e0e0e0;
border-radius: 8px;
background: 0 0;
border: 1px solid #e0e0e0;
padding: 10px;
height: 630px;
}
.block-container2.block-container2--none {
background: 0 0;
border: none;
color: #212121;
padding: 0;
box-shadow: none
}
@media(min-width: 900px) {
.block-container2:not(.block-container2--noStripRadius)>:first-child,
.block-topRadiusContent,
.block-container2:not(.block-container2--noStripRadius)>.block-body:first-child>.blockLink:first-child {
border-top-left-radius: 7px;
border-top-right-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>:last-child,
.block-bottomRadiusContent,
.block-container2:not(.block-container2--noStripRadius)>.block-body:last-child>.blockLink:last-child,
.block-container2:not(.block-container2--noStripRadius)>.tabPanes:last-child>[role=tabpanel]>:last-child,
.block-container2:not(.block-container2--noStripRadius)>.tabPanes:last-child>[role=tabpanel]>.block-body>:last-child {
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:first-child>.dataList:first-child tbody:first-child .dataList-row:first-child>.dataList-cell:first-child,
.block-topRadiusContent.dataList tbody:first-child .dataList-row:first-child>.dataList-cell:first-child,
.block-topRadiusContent>.dataList:first-child tbody:first-child .dataList-row:first-child>.dataList-cell:first-child,
.block-container2:not(.block-container2--noStripRadius)>.block-body:first-child>.dataList:first-child thead:first-child .dataList-row:first-child>.dataList-cell:first-child,
.block-topRadiusContent.dataList thead:first-child .dataList-row:first-child>.dataList-cell:first-child,
.block-topRadiusContent>.dataList:first-child thead:first-child .dataList-row:first-child>.dataList-cell:first-child {
border-top-left-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:first-child>.dataList:first-child tbody:first-child .dataList-row:first-child>.dataList-cell:last-child,
.block-topRadiusContent.dataList tbody:first-child .dataList-row:first-child>.dataList-cell:last-child,
.block-topRadiusContent>.dataList:first-child tbody:first-child .dataList-row:first-child>.dataList-cell:last-child,
.block-container2:not(.block-container2--noStripRadius)>.block-body:first-child>.dataList:first-child thead:first-child .dataList-row:first-child>.dataList-cell:last-child,
.block-topRadiusContent.dataList thead:first-child .dataList-row:first-child>.dataList-cell:last-child,
.block-topRadiusContent>.dataList:first-child thead:first-child .dataList-row:first-child>.dataList-cell:last-child {
border-top-right-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:first-child>.formRow:first-child>dt,
.block-topRadiusContent.formRow>dt,
.block-topRadiusContent>.formRow:first-child>dt {
border-top-left-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:first-child>.formRow:first-child>dd,
.block-topRadiusContent.formRow>dd,
.block-topRadiusContent>.formRow:first-child>dd {
border-top-right-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:last-child>.dataList:last-child tbody:last-child .dataList-row:last-child>.dataList-cell:first-child,
.block-bottomRadiusContent.dataList tbody:last-child .dataList-row:last-child>.dataList-cell:first-child,
.block-bottomRadiusContent>.dataList:last-child tbody:last-child .dataList-row:last-child>.dataList-cell:first-child {
border-bottom-left-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:last-child>.dataList:last-child tbody:last-child .dataList-row:last-child>.dataList-cell:last-child,
.block-bottomRadiusContent.dataList tbody:last-child .dataList-row:last-child>.dataList-cell:last-child,
.block-bottomRadiusContent>.dataList:last-child tbody:last-child .dataList-row:last-child>.dataList-cell:last-child {
border-bottom-right-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:last-child>.formRow:last-child>dt,
.block-bottomRadiusContent.formRow>dt,
.block-bottomRadiusContent>.formRow:last-child>dt {
border-bottom-left-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:last-child>.formRow:last-child>dd,
.block-bottomRadiusContent.formRow>dd,
.block-bottomRadiusContent>.formRow:last-child>dd {
border-bottom-right-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:last-child .formSubmitRow:not(.is-sticky)>dt,
.block-container2:not(.block-container2--noStripRadius)>.formSubmitRow:not(.is-sticky):last-child>dt,
.block-bottomRadiusContent>.formSubmitRow:not(.is-sticky)>dt {
border-bottom-left-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:last-child .formSubmitRow:not(.is-sticky)>dd,
.block-container2:not(.block-container2--noStripRadius)>.formSubmitRow:not(.is-sticky):last-child>dd,
.block-bottomRadiusContent>.formSubmitRow:not(.is-sticky)>dd {
border-bottom-right-radius: 7px
}
.block-container2:not(.block-container2--noStripRadius)>.block-body:last-child .formSubmitRow:not(.is-sticky) .formSubmitRow-bar,
.block-container2:not(.block-container2--noStripRadius)>.formSubmitRow:not(.is-sticky):last-child .formSubmitRow-bar,
.block-bottomRadiusContent>.formSubmitRow:not(.is-sticky) .formSubmitRow-bar {
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px
}
}
@media(max-width: 900px) {
.block-container2,
.blockMessage {
margin-left: -10px;
margin-right: -10px;
border-radius: 0;
border-left: none;
border-right: none
}
}
`;
// 將style元素添加到head中
document.head.appendChild(styleElement);
// 創建一個新的div元素
let newElement = document.createElement('div');
newElement.className = 'block-container2';
newElement.innerHTML = `
<h3 class="block-minorHeader">
<a href="https://www.bandbbs.cn/conversations/" importance="low" rel="nofollow">私信</a>
</h3>
<iframe id="iFrame" title="私信" style="overflow:hidden;height:90%;width:100%" height="90%" width="100%"
sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-top-navigation"
src="https://www.bandbbs.cn/conversations/?value=temp">
</iframe>
`;
// 選擇要插入新元素的元素
let targetElement = document.querySelector("#top > div.p-body > div.p-body-inner > div.uix_contentWrapper > div > div.p-body-content > div > div:nth-child(3)");
// 將新元素插入到目標元素的下方
targetElement.parentNode.insertBefore(newElement, targetElement.nextSibling);
} else if (url === "http://www.bandbbs.cn/conversations/?value=temp" || url === "https://www.bandbbs.cn/conversations/?value=temp") {
document.querySelector("#footer").remove();
document.querySelector("#top > div.p-body > div.p-body-inner > div.p-body-header").remove();
document.querySelector("#top > div.p-body > div.p-body-inner > div.breadcrumb.block").remove();
document.querySelector("#top > div.uix_tabBar").remove();
document.querySelector("#top > div.p-navSticky.p-navSticky--all").remove();
document.querySelector("#top > div.p-body > div.p-body-inner > div > div > div.p-body-sidebar").remove();
document.querySelector("#top > div.p-body > div.uix_sidebarNav").remove();
}else if((/https?:\/\/www\.bandbbs\.cn\/resources\/\d+\/.*/).test(url)||(/https?:\/\/www\.bandbbs\.cn\/threads\/\d+\/.*/).test(url)){
var span = document.querySelector("span.label")
var spanClass=span.className
var spantext = span.innerHTML
console.log(spantext)
var link=document.querySelector("div > ul > li:nth-child(4) > a").href
var newtag = document.createElement('span')
span.innerHTML=`<a href=${link} target="_blank" style="color: inherit;">${spantext}</a>`
}
}
})();