Google Scholar BibTeX Auto Copy and Navigate

Automatically copy the BibTeX citation from Google Scholar to clipboard and navigate back or close the page

  1. // ==UserScript==
  2. // @name Google Scholar BibTeX Auto Copy and Navigate
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Automatically copy the BibTeX citation from Google Scholar to clipboard and navigate back or close the page
  6. // @author rsic
  7. // @match https://scholar.googleusercontent.com/scholar.bib*
  8. // @grant GM_setClipboard
  9. // @grant GM_notification
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // 获取页面内容
  17. const bibtexContent = document.body.innerText;
  18.  
  19. // 将内容复制到剪切板
  20. GM_setClipboard(bibtexContent);
  21.  
  22. // 显示通知
  23. GM_notification({
  24. text: 'BibTeX citation copied to clipboard!',
  25. title: 'Success',
  26. timeout: 2000
  27. });
  28.  
  29. // 判断是否可以返回上一页
  30. if (window.history.length > 1) {
  31. // 如果历史记录有上一页,返回上一页
  32. window.history.back();
  33. } else {
  34. // 如果没有上一页,关闭当前页面
  35. window.close();
  36. }
  37. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址