主页源代码获取

获取个人主页源代码

当前为 2023-06-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name 主页源代码获取
  3. // @namespace https://www.luogu.com.cn/user/486799/
  4. // @description 获取个人主页源代码
  5. // @author BlackPanda
  6. // @license MIT
  7. // @version 0.2
  8. // @match https://www.luogu.com.cn/user/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. async function user_detail(){
  15. var button = document.createElement('button');
  16. button.textContent = 'Copy';
  17. button.classList.add('red-button', 'button-size');
  18. button.addEventListener('click', async function() {
  19. var introduction = _feInstance.currentData.user.introduction;
  20. await navigator.clipboard.writeText(introduction);
  21. alert('复制成功');
  22. });
  23. var tmp = document.getElementsByClassName('card padding-default');
  24. var pos = tmp[0];
  25. pos.appendChild(button);
  26. };
  27. var style = document.createElement('style');
  28. style.textContent = `
  29. .red-button {
  30. background-color: #6495ed;
  31. color: #fff;
  32. border-radius: 6px;
  33. }
  34. .button-size {
  35. width: 75px;
  36. height: 25px;
  37. }
  38. * {
  39. margin: 0;
  40. padding: 0;
  41. border: none;
  42. }
  43. `;
  44. document.head.appendChild(style);
  45. window.addEventListener('load', user_detail);
  46. })();

QingJ © 2025

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