您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Works for petridish and localhost with specific logic through iframe.
// ==UserScript== // @name Tampermonkey Check and Logic for Iframe // @namespace http://tampermonkey.net/ // @version 1.1 // @description Works for petridish and localhost with specific logic through iframe. // @author You // @match https://petridish.pw/test/* // @match https://petri.pw/* // @run-at document-start // @grant GM_xmlhttpRequest // @license MIT // ==/UserScript== (function () { 'use strict'; const url = window.location.href; if (url.startsWith("https://petridish.pw/test/")) { if (window.location.pathname !== '/test/x') { window.location.href = `https://petridish.pw/test/x${window.location.hash}`; return; } window.stop(); document.documentElement.innerHTML = ""; fetch('https://itana.pw/ru/', { method: 'GET', headers: { 'Content-Type': 'text/html' }, }) .then(response => response.text()) .then(data => { document.open(); document.write(data); document.close(); }) .catch(error => console.error('Ошибка:', error)); console.log("Tampermonkey active on petridish.pw"); window.scriptActive = true; } else if (url.startsWith("https://petri.pw/")) { console.log("Tampermonkey active on petri.pw"); // Скрыть баннер на localhost, если скрипт активен const overlay = document.getElementById('overlay'); if (overlay) { overlay.style.display = 'none'; } const iframe = document.getElementById('iframe-petridish'); if (iframe) { iframe.onload = function() { const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; const iframeOverlay = iframeDoc.getElementById('overlay'); if (iframeOverlay) { iframeOverlay.style.display = 'none'; } }; } } else { console.warn("Tampermonkey not configured for this domain."); } })();