R6900和NPS管理界面添加互相跳转链接(自用)

// ==UserScript==
// @name         R6900和NPS管理界面添加互相跳转链接(自用)
// @namespace    https://www.cnblogs.com/nihaorz/
// @version      1.0
// @description  try to take over the world!
// @author       Nihaorz
// @include      *://wangrui027.asuscomm.com:44000/*
// @include      *://wangrui027.asuscomm.com:45000/*
// @include      *://192.168.50.1/*
// @include      *://192.168.50.1:44000/*
// @include      *://192.168.50.1:45000/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let port = location.port;
    if (port == 44000 || port == "") {
        // 当前是路由器管理界面
        let url = location.protocol + "//" + location.hostname + ":45000";
        let html = '<a href="' + url + '"><div style="margin-top:13px;margin-left:0px;min-width: unset;" class="titlebtn" align="center"><span style="width: 114px;">NPS</span></div></a>';
        $(".navigation").before(html);
    } else if (port == 45000) {
        // 当前是NPC管理界面
        let url = location.protocol + "//" + location.hostname + ":44000";
        $(".welcome-message").append('<a href="' + url + '">R69000</a>');
    }

})();

 

posted @ 2021-02-05 14:42  Nihaorz  阅读(91)  评论(0编辑  收藏  举报