// ==UserScript==
// @name Deepseek Chat 实时网页检索对话工具版
// @namespace Monika_host
// @version 3.0.6
// @description 支持流式响应、历史记录、参数设置和全面的网页内容检索
// @author Monika_host
// @match *://*/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant GM_registerMenuCommand
// @grant GM_addStyle
// @connect *
// @license MIT
// @resource icon https://img.alicdn.com/imgextra/i2/O1CN01bYc1m81RrcSAyOjMu_!!6000000002165-54-tps-60-60.apng
// @grant GM_getResourceURL
// @icon https://deepseek.com/favicon.ico
// ==/UserScript==
(function() {
'use strict';
// 添加Markdown渲染功能
function renderMarkdown(content) {
// 增强Markdown渲染,支持带行号的代码块
return content
.replace(/&/g, '&')
.replace(//g, '>')
.replace(/\*\*(.*?)\*\*/g, '$1')
.replace(/\*(.*?)\*/g, '$1')
.replace(/`(.*?)`/g, '$1
')
.replace(/\[(.*?)\]\((.*?)\)/g, '$1')
.replace(/\n/g, '
')
// 处理带行号的代码块
.replace(/```(\w+)?\s*([\s\S]*?)```/g, (match, lang, code) => {
const lines = code.split('\n');
let html = `
${line}