您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add a console to "Stack Snippets" executable code on StackExchange
当前为
StackExchange, the network of Q&A sites behind StackOverflow, recently added "Stack Snippets" -- running JavaScript, CSS, and HTML code snippets. These are great, except for one problem.
I made a request for a console to be added, so that we don't have to manually open the browser console. It got some upvotes, but no official responses.
Never fear, the console is here!
Just install the script, and it'll enable simple console.log()
calls from within Stack Snippets.
It uses the Web Messaging API to make the page and the snippet frame communicate. The script runs on both pages, setting up messaging between the two. Any console.log
calls from the snippet are caught, and forwarded to the outer page. Don't worry, they're also logged to the regular console.