// ==UserScript== // @name 涵创知产辅助脚本 // @namespace http://tampermonkey.net/ // @version 2024-07-31 // @description 本脚本简化了知产日常业务的某些繁琐步骤,如删除了商标首页的5秒协议、专利办理系统首页的常用模块补充、专利电子发文电子客户端自动查询、河南政务服务网的密码输入框可被粘贴内容等; // @author HeNanHanChuang // @match https://cponline.cnipa.gov.cn/* // @match https://wssq.sbj.cnipa.gov.cn:9443/tmsve/wssqsy_getCayzDl.xhtml // @match https://interactive.cponline.cnipa.gov.cn/public-app-zxsq-guojia/chaxuntjmk/chaxun/dianzifwcx // @match https://login.hnzwfw.gov.cn/tacs-uc/login/index?refer=cp&backUrl=http://id.hnkjt.gov.cn/puias/login?to=http://qyyf.hnkjt.gov.cn/czbt//cz/ssologin // @icon https://i.postimg.cc/hG1CpFfb/LOGO.png // @grant none // @license MIT Festival Variant // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 获取当前页面的URL const url = window.location.href; // 专利首页的脚本代码 if (/https:\/\/cponline\.cnipa\.gov\.cn\/.*/.test(url)) { // 添加新的 span 元素的函数 function addLinks() { const headerMenu = document.querySelector('.bl-header-menu'); if (headerMenu && !headerMenu.dataset.linksAdded) { headerMenu.dataset.linksAdded = 'true'; const links = [ { href: "https://interactive.cponline.cnipa.gov.cn/public-app-zxsq-guojia/chaxuntjmk/chaxun/dianzifwcx", text: "电子发文查询" }, { href: "https://cpquery.cponline.cnipa.gov.cn/chinesepatent/index", text: "专利费用查询" }, { href: "https://interactive.cponline.cnipa.gov.cn/public-app-zlswfw/feijianbeian/feijianbaggcx", text: "费减备案" } ]; links.forEach(link => { const newSpan = document.createElement('span'); newSpan.classList.add('custom-link'); // 添加自定义类名 const newAnchor = document.createElement('a'); newAnchor.href = link.href; newAnchor.textContent = link.text; newSpan.appendChild(newAnchor); headerMenu.appendChild(newSpan); }); } } // 添加 CSS 样式以确保元素不会换行并具有适当的间距 function addStyles() { const style = document.createElement('style'); style.textContent = ` .bl-header-menu { display: flex; flex-wrap: nowrap; align-items: center; } .bl-header-menu span { margin-right: 15px; /* 根据需要调整间距 */ font-size: 150%; font-weight: bold; align-items: center; font-family: 'LiSu', sans-serif; /* 设置字体为仿宋 */ } .bl-header-menu span:last-child { margin-right: 0; /* 去除最后一个 span 的右边距 */ } `; document.head.appendChild(style); } // 初始化脚本 function init() { addStyles(); setTimeout(addLinks, 0); } window.onload = init; } //商标主页屏蔽协议的脚本代码 else if (url.includes("https://wssq.sbj.cnipa.gov.cn:9443/tmsve/wssqsy_getCayzDl.xhtml")) { // 定义一个函数,用于删除指定类名的元素 function removeElementsByClass(className) { const elements = document.getElementsByClassName(className); while(elements.length > 0) { elements[0].parentNode.removeChild(elements[0]); } } // 等待页面完全加载后执行 window.onload = function() { removeElementsByClass('bgPop'); // 删除类名为"bgPop"的元素 removeElementsByClass("pop"); // 删除类名为"pop"的元素 }; } //专利电子发文自动查询 else if (window.location.href.includes("https://interactive.cponline.cnipa.gov.cn/public-app-zxsq-guojia/chaxuntjmk/chaxun/dianzifwcx")) { // 定义一个函数,用于检查目标元素是否存在并点击 function checkForTargetElement() { // 查找所有包含指定文本的标签 var spans = document.querySelectorAll('span'); for (var span of spans) { // 检查的文本内容 if (span.textContent.trim() === '电子申请客户端') { // 获取该标签的父元素
  • var li = span.closest('li'); if (li) { // 触发
  • 的点击事件 li.click(); // 定义一个函数,用于检查查询按钮 function checkForSearchButton() { // 查找所有包含指定文本的标签 var buttonSpans = document.querySelectorAll('span'); for (var buttonSpan of buttonSpans) { // 检查的文本内容 if (buttonSpan.textContent.trim() === '查询') { // 获取该标签的父元素