您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Listen for postMessage from parent and log to console
当前为
- // ==UserScript==
- // @name Minimal ChatGPT Message Logger
- // @description Listen for postMessage from parent and log to console
- // @match https://chatgpt.com/*
- // @version 0.0.1.20250512162640
- // @namespace https://greasyfork.org/users/1435046
- // ==/UserScript==
- (function () {
- 'use strict';
- // ‘window’ is the global object representing the page’s JavaScript environment.
- // addEventListener: attach (“add”) a function to run when a named event (“message”) occurs.
- window.addEventListener('message', function (event) {
- // When postMessage is used, this handler fires.
- // console.log: print to the browser’s developer console.
- console.log('Received message from parent window:', event.data);
- });
- })();