不更改網(wǎng)站首頁,讓問題詳情只留下問題和答案刺覆。
TamperMonkey
// ==UserScript==
// @name Clear StackOverFlow
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://stackoverflow.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let re = new RegExp('https:\/\/stackoverflow.com\/questions\/[0-9]+\/.*');
if (!window.location.href.match(re)) {
return;
}
function deleteEle (element) {
return element && element.parentNode && element.parentNode.removeChild(element);
}
function $(target) {
if (target[0] === '#') {
return document.getElementById(target.replace('#', ''));
} else if (target[0] === '.') {
return document.getElementsByClassName(target.replace('.', ''))[0];
} else {
return document.getElementsByTagName(target)[0];
}
}
deleteEle($('.so-header'));
deleteEle($('#footer'));
deleteEle($('#sidebar'));
deleteEle($('#post-form'));
deleteEle($('.bottom-notice'));
deleteEle($('.aside-cta'));
deleteEle($('#feed-link'));
})();
or
stylish
- chrome 需要指定 正則表達(dá)式匹配問題詳情的網(wǎng)址
https:\/\/stackoverflow.com\/questions\/[0-9]+\/.*
#feed-link,
#footer,
#sidebar,
#post-form,
.so-header,
.bottom-notice,
.aside-cta,
.everyonelovesstackoverflow {
display: none;
}
- firefox 則不需要
@-moz-document regexp('https:\/\/stackoverflow.com\/questions\/[0-9]+\/.*') {
#feed-link, #footer, #sidebar, #post-form, .bottom-notice, .aside-cta, .so-header, .everyonelovesstackoverflow {
display: none;
}
}