// ==UserScript== // @name 百度文库下载器 // @version 1.0.0 // @namespace https://github.com/doc-toolbar // @description 百度文库下载助手,直观易用,全部原格式! // @author ToolbarHelper // @match *://wenku.baidu.com/view/* // @match *://wenku.baidu.com/tfview/* // @match *://wenku.baidu.com/link?url* // @match *://wenku.baidu.com/share/* // @icon data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjE4IiBoZWlnaHQ9IjIiIHJ4PSIxIiBmaWxsPSIjMkU3Q0MzIi8+CjxyZWN0IHg9IjMiIHk9IjciIHdpZHRoPSIxOCIgaGVpZ2h0PSIyIiByeD0iMSIgZmlsbD0iIzJFN0NDMyIvPgo8cmVjdCB4PSIzIiB5PSIxMSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjIiIHJ4PSIxIiBmaWxsPSIjMkU3Q0MzIi8+CjxyZWN0IHg9IjMiIHk9IjE1IiB3aWR0aD0iMTQiIGhlaWdodD0iMiIgcng9IjEiIGZpbGw9IiMyRTdDQzMiLz4KPHJlY3QgeD0iMyIgeT0iMTkiIHdpZHRoPSIxMCIgaGVpZ2h0PSIyIiByeD0iMSIgZmlsbD0iIzJFN0NDMyIvPgo8L3N2Zz4= // @grant none // ==/UserScript== (function() { 'use strict'; const style = ` .doc-helper-toolbar { position: fixed; top: 0; left: 0; right: 0; background: linear-gradient(135deg, #27ae60, #2ecc71); color: white; padding: 12px 20px; z-index: 10000; box-shadow: 0 2px 10px rgba(39, 174, 96, 0.3); display: flex; justify-content: space-between; align-items: center; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; } .toolbar-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; } .toolbar-btn { background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.3); color: white; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.3s ease; display: flex; align-items: center; gap: 6px; } .toolbar-btn:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-1px); } .toolbar-info { font-size: 12px; opacity: 0.9; } `; document.head.insertAdjacentHTML('beforeend', ``); const toolbar = document.createElement('div'); toolbar.className = 'doc-helper-toolbar'; const title = document.createElement('div'); title.className = 'toolbar-title'; title.innerHTML = '📋 文库下载助手'; const info = document.createElement('div'); info.className = 'toolbar-info'; info.textContent = '一键下载当前文档'; const button = document.createElement('button'); button.className = 'toolbar-btn'; button.innerHTML = '⬇️ 立即下载'; button.addEventListener('click', function() { const currentUrl = window.location.href; window.open(`https://www.ziliaoku.xyz/?url=${encodeURIComponent(currentUrl)}`, '_blank'); }); const leftSection = document.createElement('div'); leftSection.style.display = 'flex'; leftSection.style.alignItems = 'center'; leftSection.style.gap = '15px'; leftSection.appendChild(title); leftSection.appendChild(info); toolbar.appendChild(leftSection); toolbar.appendChild(button); document.body.appendChild(toolbar); document.body.style.paddingTop = '60px'; })();