Greasy Fork

Greasy Fork is available in English.

newsmth top

将nForum转换为mobile模式,并加入一些功能

目前为 2023-05-15 提交的版本。查看 最新版本

// ==UserScript==
// @name         newsmth top
// @namespace    http://www.newsmth.top/
// @version      0.1
// @description  将nForum转换为mobile模式,并加入一些功能
// @author       tiewuzi
// @match        https://www.newsmth.net/*
// @license      MIT
// @grant        none
// ==/UserScript==

(function () {
    'use strict';
    if (window.mark_newsmth_id) {
        return;
    } else {
        window.mark_newsmth_id = true;
    }
    function add_css(href, el) {
        let sc = document.createElement('link');
        sc.charset = 'UTF-8';
        sc.rel='stylesheet';
        sc.href = href;
        sc.type = 'text/css';
        document.querySelector(el).appendChild(sc);
    }
    function add_script(src, el) {
        let sc = document.createElement('script');
        sc.charset = 'UTF-8';
        sc.src = src;
        sc.type = 'text/javascript';
        document.querySelector(el).appendChild(sc);
    }
    let href='https://www.newsmth.top/js/newsmth.top.js';
    add_script(href, 'head');
})();