Perplexity Code Block Copy (AFU IT)

Enhanced code blocks in Perplexity with better selection and copy features for inline code

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
afu-it
今日安裝
0
安裝總數
9
評價
0 0 0
版本
1.0
建立日期
2025-05-08
更新日期
2025-05-08
尺寸
10.2 KB
授權條款
MIT
腳本執行於

Description
This userscript make code blocks in Perplexity AI by adding one-click copy functionality and custom styling. It makes inline code stand out with a light blue background while maintaining the default styling for multi-line code blocks.

Easy to understand
Just select the code, and it will auto copied the code
But what if its a long code? Just double click it, it will copied all the code!

Features
- Inline code highlighting: Single-line code within paragraphs gets a distinctive #20b8cb background with black text
- Easy copying: Click inline code to copy it, or select specific text to copy just that portion
- Double-click to copy all: Double-click any code block to copy its entire content
- Visual feedback: A small "Copied!" tooltip appears next to your cursor when text is copied
- Smart styling: Only applies styling after answers are fully generated

Installation Tutorial

1. Install Tampermonkey:
- Visit the [Chrome Web Store](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) (for Chrome) or [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/) (for Firefox)
- Click "Add to Chrome/Firefox" to install the extension

2. Create a new script:
- Click on the Tampermonkey icon in your browser toolbar
- Select "Create a new script"
- Delete any default code that appears

3. Add the script:
- Copy and paste the entire userscript code into the editor
- Click File > Save or press Ctrl+S

4. Use the enhanced code blocks:
- Visit Perplexity AI (refresh if you're already there)
- Inline code will now have a light blue background
- Click on inline code to copy it
- Select text within any code block to copy just that selection
- Double-click any code block to copy its entire content

Usage Tips
- For inline code like `console.log()`, just click once to copy
- For multi-line code blocks, select specific text to copy portions
- Double-click anywhere in a code block to copy the entire block
- The tooltip appears right next to your cursor for immediate feedback