Flash Collector Script

Flash Collector 用户脚本,用于解除 4399.com 的源站播放 Referer 限制、增加源站播放标题

  1. // ==UserScript==
  2. // @name Flash Collector Script
  3. // @namespace Flash Collector Scripts
  4. // @match *://*.4399.com/*
  5. // @match *://*.7k7k.com/*
  6. // @match *://*.game773.com/*
  7. // @grant none
  8. // @license MPL-2.0
  9. // @version 1.3
  10. // @author Cnotech
  11. // @description Flash Collector 用户脚本,用于解除 4399.com 的源站播放 Referer 限制、增加源站播放标题
  12. // ==/UserScript==
  13.  
  14. function enlargeNativeFlash() {
  15. document.getElementsByTagName("embed")[0].setAttribute("height", `${document.documentElement.scrollHeight}px`)
  16. }
  17.  
  18. function query(key) {
  19. let m = window.location.href.match(new RegExp(`[?|&]${key}=[^&]*`))
  20.  
  21. if (m == null) return null
  22. else return m[0].split("=")[1]
  23. }
  24.  
  25. function setTitle() {
  26. let t = query("title")
  27. if (t != null) {
  28. const title = decodeURI(t)
  29. let titleTags = document.getElementsByTagName('title')
  30. if (titleTags.length === 0) {
  31. let tag = document.createElement("title")
  32. tag.innerText = title
  33. document.getElementsByTagName('body')[0].appendChild(tag)
  34. } else {
  35. titleTags[0].innerText = title
  36. }
  37. document.title = title
  38. }
  39. }
  40.  
  41. function com4399() {
  42. //判断状态
  43. const url = document.location.href
  44. if (url.indexOf("#flash-collector-0") !== -1) {
  45. //重载页面
  46. document.location.href = url.replace("#flash-collector-0", "")
  47. } else {
  48. //配置标题
  49. setTitle()
  50. }
  51. }
  52.  
  53. function com7k7k() {
  54. //配置标题
  55. setTitle()
  56. }
  57.  
  58. function main() {
  59. const url = window.location.href
  60. if (url.indexOf("4399.com") > -1) {
  61. com4399()
  62. } else if (url.indexOf("7k7k.com") > -1) {
  63. com7k7k()
  64. }
  65. //撑大原始flash
  66. let u = new URL(url)
  67. if (u.pathname.endsWith(".swf")) {
  68. enlargeNativeFlash()
  69. }
  70. }
  71.  
  72. main()

QingJ © 2025

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