RT,Microsoft365 的 copilot 大部分情况下都是大幅度降智的,见我的上个帖子
经过研究,Microsoft365 其实可以用上满血 GPT 5.2 Thinking,经过对比和官网智力没有区别,而且基本不会触发降智,用过官网的都知道官网经常降智。
好像还可以用 5.1,能用 5.2 应该没人会去用 5.1 吧,所以就没加到脚本里。
此外,如果账号本来就有切换模型的权限,请本脚本设置默认模型,并使用官方功能切换模型,可以用本脚本去除无关的数据源,以提升模型能力。
使用链接 https://m365.cloud.microsoft/
油猴脚本如下,为了能活的久一点,没有上传到 github 并给帖子设了权限,所以不建议转发该帖子内容
// ==UserScript==
// @name M365 GPT 优化工具
// @namespace https://linux.do/u/fatekey/summary
// @version 1.3
// @description Modify M365 chat websocket messages
// @author fatekey
// @match https://m365.cloud.microsoft/*
// @grant GM_addStyle
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
// ================= 配置与状态管理 =================
const STORAGE_KEY = 'm365_mod_config_v2';
const DEFAULT_CONFIG = {
mode: 'default', // default, reasoning, chat
cleanData: false
};
function getConfig() {
try {
const saved = localStorage.getItem(STORAGE_KEY);
return saved ? JSON.parse(saved) : DEFAULT_CONFIG;
} catch (e) {
return DEFAULT_CONFIG;
}
}
function saveConfig(config) {
localStorage.setItem(STORAGE_KEY, JSON.stringify(config));
}
let currentConfig = getConfig();
// ================= WebSocket 拦截逻辑 =================
const originalSend = WebSocket.prototype.send;
WebSocket.prototype.send = function(data) {
let modifiedData = data;
if (typeof data === 'string') {
// 1. 处理模式替换
if (currentConfig.mode !== 'default') {
const target = '"isSbsSupported":true';
let replacement = target;
if (currentConfig.mode === 'reasoning') {
replacement = '"isSbsSupported":true,"tone":"Gpt_5_2_Reasoning"';
} else if (currentConfig.mode === 'chat') {
replacement = '"isSbsSupported":true,"tone":"Gpt_5_2_Chat"';
}
if (data.includes(target)) {
modifiedData = modifiedData.replace(target, replacement);
}
}
// 2. 处理数据净化
if (currentConfig.cleanData) {
const keywordsPattern = '"People","File","Event","Email","TeamsMessage"';
modifiedData = modifiedData.replace(keywordsPattern, '');
}
}
return originalSend.apply(this, [modifiedData]);
};
// ================= UI 界面逻辑 =================
const css = `
#m365-mod-btn {
position: fixed;
top: 12px;
right: 160px;
z-index: 99999;
background: #252525;
color: #fff;
border: 1px solid #444;
border-radius: 4px;
padding: 6px 12px;
font-family: 'Segoe UI', sans-serif;
font-size: 12px;
cursor: pointer;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
transition: background 0.2s;
user-select: none;
}
#m365-mod-btn:hover {
background: #3a3a3a;
}
#m365-mod-modal-overlay {
display: none;
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0,0,0,0.5);
z-index: 100000;
justify-content: center;
align-items: center;
backdrop-filter: blur(2px);
}
#m365-mod-modal {
background: #1e1e1e;
color: #fff;
padding: 20px;
border-radius: 8px;
width: 300px;
box-shadow: 0 10px 25px rgba(0,0,0,0.5);
border: 1px solid #444;
font-family: 'Segoe UI', sans-serif;
}
.mod-row { margin-bottom: 15px; }
.mod-title { font-size: 16px; font-weight: bold; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; }
.mod-close { cursor: pointer; color: #aaa; font-size: 24px; line-height: 20px; padding: 0 5px; }
.mod-close:hover { color: #fff; }
.mod-select { width: 100%; padding: 6px; background: #333; color: white; border: 1px solid #555; border-radius: 4px; outline: none; }
.mod-label { display: block; margin-bottom: 5px; font-size: 13px; color: #ccc; }
.mod-checkbox-container { display: flex; align-items: center; cursor: pointer; user-select: none; }
.mod-checkbox { margin-right: 10px; transform: scale(1.2); }
.mod-status { font-size: 12px; color: #88ff88; min-height: 18px; margin-top: 10px; text-align: right;}
`;
if (typeof GM_addStyle !== 'undefined') {
GM_addStyle(css);
} else {
const style = document.createElement('style');
style.innerText = css;
document.head.appendChild(style);
}
function createUI() {
// 1. 创建触发按钮
const btn = document.createElement('div');
btn.id = 'm365-mod-btn';
btn.innerText = '⚙️ 设置模型';
// 直接绑定 JS 函数,而非 innerHTML 字符串
btn.onclick = openModal;
document.body.appendChild(btn);
// 2. 创建模态框容器
const overlay = document.createElement('div');
overlay.id = 'm365-mod-modal-overlay';
// 点击遮罩层关闭
overlay.onclick = (e) => {
if (e.target === overlay) closeModal();
};
const modal = document.createElement('div');
modal.id = 'm365-mod-modal';
// --- 标题栏 ---
const header = document.createElement('div');
header.className = 'mod-title';
const titleText = document.createElement('span');
titleText.innerText = 'M365 GPT 优化工具';
const closeBtn = document.createElement('span');
closeBtn.className = 'mod-close';
closeBtn.innerHTML = '×';
// 修复点:使用 onclick 属性直接绑定函数,避开 CSP 限制
closeBtn.onclick = closeModal;
header.appendChild(titleText);
header.appendChild(closeBtn);
modal.appendChild(header);
// --- 选项 1: 模式 ---
const row1 = document.createElement('div');
row1.className = 'mod-row';
row1.innerHTML = `<label class="mod-label">AI 模型</label>`;
const select = document.createElement('select');
select.className = 'mod-select';
const modes = [
{ val: 'default', text: '默认' },
{ val: 'reasoning', text: 'GPT 5.2 Thinking' },
{ val: 'chat', text: 'GPT 5.2 Quick' }
];
modes.forEach(m => {
const opt = document.createElement('option');
opt.value = m.val;
opt.innerText = m.text;
if (currentConfig.mode === m.val) opt.selected = true;
select.appendChild(opt);
});
select.onchange = (e) => {
currentConfig.mode = e.target.value;
saveConfig(currentConfig);
showStatus('修改生效');
};
row1.appendChild(select);
modal.appendChild(row1);
// --- 选项 2: 清理数据 ---
const row2 = document.createElement('div');
row2.className = 'mod-row';
const labelClean = document.createElement('label');
labelClean.className = 'mod-checkbox-container';
const check = document.createElement('input');
check.type = 'checkbox';
check.className = 'mod-checkbox';
check.checked = currentConfig.cleanData;
check.onchange = (e) => {
currentConfig.cleanData = e.target.checked;
saveConfig(currentConfig);
showStatus('Clean Setting Saved');
};
labelClean.appendChild(check);
labelClean.appendChild(document.createTextNode('移除无关数据源(邮件、联系人、云文档等)'));
row2.appendChild(labelClean);
modal.appendChild(row2);
// --- 状态栏 ---
const status = document.createElement('div');
status.id = 'mod-status-text';
status.className = 'mod-status';
modal.appendChild(status);
overlay.appendChild(modal);
document.body.appendChild(overlay);
}
// 打开弹窗函数
function openModal() {
const overlay = document.getElementById('m365-mod-modal-overlay');
if (overlay) overlay.style.display = 'flex';
}
// 关闭弹窗函数
function closeModal() {
const overlay = document.getElementById('m365-mod-modal-overlay');
if (overlay) overlay.style.display = 'none';
}
function showStatus(msg) {
const el = document.getElementById('mod-status-text');
if (el) {
el.innerText = msg;
setTimeout(() => { el.innerText = ''; }, 2000);
}
}
// 延迟加载确保不被框架覆盖
const waitLoad = setInterval(() => {
if (document.body) {
clearInterval(waitLoad);
createUI();
}
}, 500);
})();
📌 转载信息
原作者:
fatekey
转载时间:
2026/1/20 19:19:50