评课社区反屏蔽

绕过评课社区不文明用语的屏蔽 (仅在本地生效)

  1. // ==UserScript==
  2. // @name Icourse Anti Filtering
  3. // @name:zh-CN 评课社区反屏蔽
  4. // @license gpl-3.0
  5. // @namespace http://tampermonkey.net/
  6. // @version 0.1.0
  7. // @description Stop the filtering of bad words in icourse.club (only takes effect on the client side)
  8. // @description:zh-CN 绕过评课社区不文明用语的屏蔽 (仅在本地生效)
  9. // @author PRO
  10. // @icon https://icourse.club/static/image/favicon.ico
  11. // @match https://icourse.club/*
  12. // @run-at document-start
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. const log = console.log.bind(console, "[Icourse Anti Filtering]");
  17. // `beforescriptexecute` polyfill from: https://gist.github.com/x0a/a78f6cebe3356c35a44e88b371f3a03a
  18. if ("onbeforescriptexecute" in document) return; // Already natively supported
  19. const scriptWatcher = new MutationObserver(mutations => {
  20. for (const mutation of mutations) {
  21. for (const node of mutation.addedNodes) {
  22. if (node.tagName === "SCRIPT") {
  23. const evt = new CustomEvent("beforescriptexecute", {
  24. detail: node,
  25. cancelable: true
  26. });
  27. // .dispatchEvent will execute the event synchrously, and return false if .preventDefault() is called
  28. if (!document.dispatchEvent(evt)) {
  29. node.remove();
  30. }
  31. }
  32. }
  33. }
  34. });
  35. scriptWatcher.observe(document, {
  36. childList: true,
  37. subtree: true
  38. });
  39. document.addEventListener("beforescriptexecute", (e) => {
  40. const script = e.detail;
  41. // Prevent the `filter_bad_words` function from being executed
  42. if (script.text.includes("function filter_bad_words(index)")) {
  43. log("Prevented `filter_bad_words` script:", script.text);
  44. e.preventDefault();
  45. return;
  46. }
  47. // Remove manual filtering
  48. const regex = /\$\('\.review-filter-rule'\)\.each\(function \(index\) {[\s\S]*?}\)/;
  49. script.text = script.text.replace(regex, "// Removed by Icourse Anti Filtering");
  50. });
  51. log("Successfully loaded! 🎉");
  52. })();

QingJ © 2025

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