Отключение фильтра SD WebUI для коллаба ⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39// ==UserScript== // @name SD Colab Filter Bypass // @version 2023-06-08-2 // @description Отключение фильтра Google Colab для StableDiffuison WebUI // @namespace https://2ch.hk/ai/ // @match https://colab.research.google.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com // @grant GM_xmlhttpRequest // @run-at document-start // ==/UserScript== const filterRegexp = /(?<=\[).*"stable-diffusion-webui".*(?=\])/; const scriptNameRegexp = /external_polymer_binary.*\.js/; window.addEventListener('beforescriptexecute', function(e) { const src = e.target.src; if (!scriptNameRegexp.test(src)) { return; } e.preventDefault(); e.stopPropagation(); GM_xmlhttpRequest({ method: "GET", url: e.target.src, onload: function(response) { const text = response.responseText.replace(filterRegexp, ''); const newScript = document.createElement('script'); newScript.type = "text/javascript"; newScript.textContent = text; const head = document.getElementsByTagName('head')[0]; head.appendChild(newScript); } }); });