Greasy Fork

Greasy Fork is available in English.

newsmth top

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

当前为 2023-05-15 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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');
})();