csdn auto jump

auto jump link for csdn

  1. // ==UserScript==
  2. // @name csdn auto jump
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description auto jump link for csdn
  6. // @author You
  7. // @match https://link.csdn.net/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=csdn.net
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. const ref = setInterval(function(){
  16. let link = '';
  17. try{
  18. link = document.querySelector('.loading-topic').getElementsByTagName('a')[0].innerText;
  19. }catch{}
  20. if(link){
  21. ref && clearInterval(ref)
  22. window.location.href = link;
  23. }
  24. }, 100)
  25. // Your code here...
  26. })();