New Userscript

try to take over the world!

  1. // ==UserScript==
  2. // @name New Userscript
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @include http*://www.sayhuahuo.com/forum.php?mod=post&action=edit*
  8. // @include http*://www.sayhuahuo.com/*thread*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. if(location.href.includes('edit')){
  15. document.querySelector('#typeoption_gameLink').onblur=function(){
  16. document.querySelector('#typeoption_gamePassword').value=this.value.match(/链接:([\d\D]*) 提取码:([\d\w]*)/)[2];
  17. this.value=this.value.match(/链接:([\d\D]*) 提取码:([\d\w]*)/)[1];
  18. }
  19. }
  20. if(location.href.includes('thread')){
  21. document.querySelector('tbody > tr:nth-child(1) > td.plc > div.pct > div > div.typeoption > table > tbody > tr:nth-child(7)> td').onmouseenter=function(){
  22. document.onselectstart= function(){};
  23. document.documentElement.style.userSelect='auto';
  24. }
  25. document.querySelector('tbody > tr:nth-child(1) > td.plc > div.pct > div > div.typeoption > table > tbody > tr:nth-child(7) > td').onmouseleave=function(){
  26. document.onselectstart= function(e){e.preventDefault();};
  27. document.documentElement.style.userSelect='none';
  28. }
  29. }
  30. // Your code here...
  31. })();