Weibo Classic

Back to Weibo V5 (恢复新浪微博V5)

  1. // ==UserScript==
  2. // @name Weibo Classic
  3. // @namespace https://github.com/adelabs
  4. // @description Back to Weibo V5 (恢复新浪微博V5)
  5. // @version 2.4.1
  6. // @license GPL version 3
  7. // @include *://weibo.com/*/home*
  8. // @include *://.weibo.com/*
  9. // @grant none
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. // http://www.w3schools.com/js/js_cookies.asp
  14. function setCookie(cname, cvalue, exdays) {
  15. var d = new Date();
  16. d.setTime(d.getTime() + (exdays*24*60*60*1000));
  17. var expires = "expires="+d.toUTCString();
  18. document.cookie = cname + "=" + cvalue + "; " + expires + "; domain=.weibo.com; path=/";
  19. }
  20. function getCookie(cname) {
  21. var name = cname + "=";
  22. var ca = document.cookie.split(';');
  23. for(var i=0; i<ca.length; i++) {
  24. var c = ca[i];
  25. while (c.charAt(0)==' ') c = c.substring(1);
  26. if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
  27. }
  28. return "";
  29. }
  30.  
  31. setCookie('wvr6', '0', -1);
  32. setCookie('wvr6', '0', 999);
  33. console.log('wvr6=' + getCookie('wvr6'));
  34.  
  35. console.log(window.location.toString());
  36. if (window.location.pathname.match(/\/home$/) &&
  37. window.location.search.match('wvr=5')) {
  38. var new_href = (window.location.protocal || 'http:') + '//' + window.location.host + window.location.pathname + '?upfrom=v5';
  39. console.log(new_href);
  40. location.href = new_href;
  41. }

QingJ © 2025

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