File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,15 @@ function ChatGPTIcon({ className }: { className?: string }) {
4747 )
4848}
4949
50+ // Cursor icon
51+ function CursorIcon ( { className } : { className ?: string } ) {
52+ return (
53+ < svg viewBox = "0 0 24 24" fill = "currentColor" className = { className } >
54+ < path d = "M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z" > </ path >
55+ </ svg >
56+ )
57+ }
58+
5059// Cache for fetched markdown content
5160const markdownCache = new Map < string , string > ( )
5261
@@ -153,6 +162,17 @@ export function CopyPageDropdown({
153162 window . open ( `https://chatgpt.com/?q=${ prompt } ` , '_blank' )
154163 }
155164
165+ const handleOpenInCursor = ( ) => {
166+ const pageUrl = window . location . href
167+ const prompt = `Read from this URL:\n${ pageUrl } \nand explain it to me`
168+ window . open (
169+ `cursor://anysphere.cursor-deeplink/prompt?text=${ encodeURIComponent (
170+ prompt ,
171+ ) } `,
172+ '_blank' ,
173+ )
174+ }
175+
156176 const menuItems = [
157177 {
158178 icon : MarkdownIcon ,
@@ -172,6 +192,12 @@ export function CopyPageDropdown({
172192 description : 'Ask questions about this page' ,
173193 onSelect : handleOpenInChatGPT ,
174194 } ,
195+ {
196+ icon : CursorIcon ,
197+ label : 'Open in Cursor' ,
198+ description : 'Ask questions about this page' ,
199+ onSelect : handleOpenInCursor ,
200+ } ,
175201 ]
176202
177203 return (
You can’t perform that action at this time.
0 commit comments