NTUT Portal Force Desktop Version

強制北科大入口網站使用桌面版

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         NTUT Portal Force Desktop Version
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  強制北科大入口網站使用桌面版
// @author       zre
// @match        https://nportal.ntut.edu.tw/index.do*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    
    // 檢查當前 URL 是否包含 forceMobile 參數
    if (!window.location.href.includes('forceMobile=pc')) {
        let currentUrl = new URL(window.location.href);
        let params = currentUrl.searchParams;
        
        // 設置 forceMobile 參數為 pc
        params.append('forceMobile', 'pc');
        
        // 重新導向到新的 URL
        window.location.href = currentUrl.toString();
    }
})();