您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在清华图书馆搜索豆瓣中的图书
// ==UserScript== // @name Search book in THU lib // @namespace github.com/tandf // @version 0.2 // @description 在清华图书馆搜索豆瓣中的图书 // @author tandf // @match https://book.douban.com/subject/* // @grant none // ==/UserScript== $(document).ready(function(){ var titleSpan = $("[property = 'v:itemreviewed']"); var title = titleSpan.text(); var url = 'https://tsinghua-primo.hosted.exlibrisgroup.com/primo-explore/search?query=any,contains,' + title +'&tab=default_tab&search_scope=default_scope&vid=86THU&lang=zh_CN'; var btn = document.createElement("button"); btn.id = "searchBtn"; titleSpan.after(btn); $("#searchBtn").text("在清华大学图书馆搜索").css({"background-color": "transparent", "padding": "2px 2px", "font-size": "14px", "border": "0px", "color": "#3377aa", "text-align": "center"}); $("#searchBtn").mouseenter(function(){$("#searchBtn").css({"background-color": "#3377aa", "color": "white", "cursor": "pointer"})}); $("#searchBtn").mouseleave(function(){$("#searchBtn").css({"background-color": "transparent", "color": "#3377aa"})}); $("#searchBtn").click(function(){ window.open(url); }) })