百度第三方登入

把不能使用第三方登入的都改成能使用的

  1. // ==UserScript==
  2. // @name 百度第三方登入
  3. // @namespace https://blog.maple3142.net/
  4. // @version 0.1
  5. // @description 把不能使用第三方登入的都改成能使用的
  6. // @author maple3142
  7. // @match *://*.baidu.com/*
  8. // @grant none
  9. // @compatible firefox >=52
  10. // @compatible chrome >=55
  11. // ==/UserScript==
  12.  
  13. ;(function() {
  14. 'use strict'
  15. const $ = s => document.querySelector(s)
  16. const $el = (tag, after) => {
  17. const el = document.createElement(tag)
  18. if (typeof after === 'function') after(el)
  19. return el
  20. }
  21. const clearChild = el => {
  22. while (el.firstChild) el.removeChild(el.firstChild)
  23. }
  24. if (top === window) {
  25. // normal page login
  26. const lif = $el('iframe', lif => {
  27. lif.src = 'https://passport.baidu.com/v2/login'
  28. lif.style.height = '430px'
  29. lif.style.width = '100%'
  30. lif.style.overflow = 'hidden'
  31. lif.scrolling = 'no'
  32. lif.frameBorder = '0'
  33. })
  34. const id = setInterval(() => {
  35. const lg = $('#passport-login-pop-dialog')
  36. if (!lg) return
  37. if (lg.contains(lif)) return
  38. clearChild(lg)
  39. lg.appendChild(lif)
  40. }, 100)
  41. }
  42. if (location.href === 'https://passport.baidu.com/v2/login' && top !== window) {
  43. // login page in iframe
  44. const it = setInterval(() => {
  45. const lf = $('.login-form')
  46. if (!lf) return
  47. clearInterval(it)
  48. const els = document.body.children
  49. for (const el of els) {
  50. el.style.display = 'none'
  51. }
  52. document.body.appendChild(lf)
  53. lf.style.float = 'none'
  54. lf.style.border = 'none'
  55. lf.style.paddingTop = '0'
  56. $el('h1', h1 => {
  57. h1.textContent = '登入成功後請手動重整'
  58. h1.style.textAlign = 'center'
  59. h1.style.paddingTop = '5px'
  60. document.body.appendChild(h1)
  61. })
  62. }, 100)
  63. }
  64. })()

QingJ © 2025

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