TemperMonkey-Script/JournalViewer

40 lines
1.6 KiB
Plaintext
Raw Normal View History

2024-08-16 13:40:47 +08:00
// ==UserScript==
// @name Journal Viewer
// @namespace https://foolishfox.cn
2024-11-21 12:06:39 +08:00
// @version 1.1.1
2024-08-16 13:40:47 +08:00
// @description Optimize the online reading experience of journal articles
// @author YiHui-Liu (foolishfox)
// @match https://journals.aps.org/*
// @match https://www.sciencedirect.com/science/article/pii/*
// @match https://www.nature.com/articles/*
// @icon https://asset.foolishfox.cn/2024/08/16/66bedd73836f7.png
// @grant none
// @license GPL-3.0
// ==/UserScript==
(function () {
'use strict';
2024-11-21 12:00:56 +08:00
// Old APS
2024-08-16 13:40:47 +08:00
let aps_sidebar = document.getElementById("article-sidebar");
2024-11-21 12:00:56 +08:00
if (aps_sidebar) { aps_sidebar.remove(); }
2024-08-16 13:40:47 +08:00
let aps_content = document.getElementById("article-content");
2024-11-21 12:00:56 +08:00
if (aps_content) { aps_content.style.width = "100%"; }
// New APS
let aps_sidebar_n = document.getElementById("sidebar-wrapper");
2024-11-21 12:06:39 +08:00
if (aps_sidebar_n) { aps_sidebar_n.remove(); }
2024-08-16 13:40:47 +08:00
// Science Direct
let sd_sidebar = document.getElementsByClassName("u-display-block-from-md col-lg-6 col-md-8 pad-right u-padding-s-top")[0];
2024-11-21 12:00:56 +08:00
if (sd_sidebar) { sd_sidebar.remove(); }
2024-08-16 13:40:47 +08:00
let sd_content = document.getElementsByClassName("col-lg-12 col-md-16 pad-left pad-right u-padding-s-top")[0];
2024-11-21 12:00:56 +08:00
if (sd_content) { sd_content.style.width = "75%"; }
2024-08-16 13:40:47 +08:00
// Nature
let nature_sidebar = document.getElementsByClassName("c-article-extras u-hide-print")[0];
2024-11-21 12:00:56 +08:00
if (nature_sidebar) { nature_sidebar.remove(); }
2024-08-16 13:40:47 +08:00
let nature_content = document.getElementsByClassName("c-article-main-column u-float-left js-main-column")[0];
2024-11-21 12:00:56 +08:00
if (nature_content) { nature_content.style.width = "100%"; }
2024-08-16 13:40:47 +08:00
})();