|
131 | 131 | } |
132 | 132 | } |
133 | 133 |
|
134 | | - function openInChatGPT() { |
135 | | - fetch(getCurrentPlaintextUrl()) |
136 | | - .then((response) => response.text()) |
137 | | - .then((text) => { |
138 | | - const encodedText = encodeURIComponent(text); |
139 | | - const chatGPTUrl = `https://chat.openai.com/?q=${encodedText}`; |
140 | | - window.open(chatGPTUrl, "_blank"); |
141 | | - }) |
142 | | - .catch((err) => { |
143 | | - console.error("Error opening in ChatGPT:", err); |
144 | | - }); |
145 | | - } |
146 | | - |
147 | | - function openInClaude() { |
148 | | - fetch(getCurrentPlaintextUrl()) |
149 | | - .then((response) => response.text()) |
150 | | - .then((text) => { |
151 | | - const encodedText = encodeURIComponent(text); |
152 | | - const claudeUrl = `https://claude.ai/new?q=${encodedText}`;https://claude.ai/new?q=%22hey%22 |
153 | | - window.open(claudeUrl, '_blank'); |
154 | | - }) |
155 | | - .catch((err) => { |
156 | | - console.error("Error opening in Claude:", err); |
157 | | - }); |
158 | | - } |
| 134 | + function openInChatGPT() { |
| 135 | + const markdownUrl = getCurrentPlaintextUrl(); |
| 136 | + const prompt = `Read ${markdownUrl} so I can ask questions about it.`; |
| 137 | + const encodedText = encodeURIComponent(prompt); |
| 138 | + const chatGPTUrl = `https://chat.openai.com/?q=${encodedText}`; |
| 139 | + window.open(chatGPTUrl, "_blank"); |
| 140 | +} |
| 141 | + |
| 142 | +function openInClaude() { |
| 143 | + const markdownUrl = getCurrentPlaintextUrl(); |
| 144 | + const prompt = `Read ${markdownUrl} so I can ask questions about it.`; |
| 145 | + const encodedText = encodeURIComponent(prompt); |
| 146 | + const claudeUrl = `https://claude.ai/new?q=${encodedText}`; |
| 147 | + window.open(claudeUrl, '_blank'); |
| 148 | +} |
159 | 149 |
|
160 | 150 | document.addEventListener("click", function (event) { |
161 | 151 | const dropdown = document.getElementById("markdownDropdown"); |
|
0 commit comments