IEEE加宽纯净版
// ==UserScript==
// @name IEEE加宽纯净版
// @namespace http://tampermonkey.net/
// @version 1.0
// @description IEEE去除目录、More like this,正文加宽显示
// @author 撒拉
// @match https://ieeexplore.ieee.org/document/*
// @grant GM_log
// @grant GM_addStyle
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
function DeleteThem(){
//令右侧More Like This不显示
document.getElementsByClassName("document-sidebar global-right-rail top-spacing")[0].style.display = 'none'
//删除左侧目录
document.getElementsByClassName("document-main-left-trail col-5-24")[0].style.display = 'none'
//删除正文右侧空白
document.getElementsByClassName("col-3-24 u-pr-1 u-pl-1 col-buttons stats-document-container-rh u-printing-invisible-ie u-printing-invisible-ff")[0].style.display = 'none'
//删除右下角Feedback
document.getElementsByClassName("usabilla_live_button_container")[0].style.display = 'none'
}
function changeWidth(){
//修改正文部分宽度
document.getElementsByClassName("position-relative col col-text stats-document-container-fullTextSection u-printing-display-inline-ie u-printing-display-inline-ff")[0].style.maxWidth = '100%'
document.getElementsByClassName("position-relative col col-text stats-document-container-fullTextSection u-printing-display-inline-ie u-printing-display-inline-ff")[0].style.flex = '0 0 100%'
document.getElementsByClassName("document-main-content-container col-19-24")[0].style.flex = '0 0 100%'
document.getElementsByClassName("document-main-content-container col-19-24")[0].style.maxWidth = '100%'
//使文章部分填满右侧More Like This留下的空白
document.getElementsByClassName("document-main global-content-width-w-rr")[0].style.width = '100%'
document.getElementsByClassName("document-main global-content-width-w-rr")[0].style.flex = '0 0 100%'
//将文章部分宽度从px修改到100%
document.getElementsByClassName("global-ng-wrapper")[0].style.maxWidth = '100%'
}
//添加内容
const menus = `
<div style="position:fixed; top:100; right:0; z-index:100">
<button id='lv-button1'>老公我不要这些</button>
<button id='lv-button2'>老公粗一点</button>
</div>
`
const mybody = document.getElementsByTagName('body')
mybody[0].insertAdjacentHTML('afterbegin', menus)
//添加样式
GM_addStyle(`
#lv-button1, #lv-button2 {
border: 2px solid;
}
`)
// 添加监听
document.getElementById('lv-button1').addEventListener('click', () => DeleteThem());
document.getElementById('lv-button2').addEventListener('click', () => changeWidth());
})();