File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 22 "manifest_version" : 3 ,
33 "name" : " LeetCode Helper" ,
44 "version" : " 1.0" ,
5- "description" : " Get AI-powered help while solving LeetCode problems." ,
6- "permissions" : [],
5+ "description" : " Get AI-powered help while solving LeetCode problems" ,
6+ "permissions" : [" activeTab" , " scripting" , " tabs" ],
7+ "host_permissions" : [" https://leetcode.com/*" ],
78 "action" : {
89 "default_popup" : " popup.html" ,
910 "default_icon" : {
Original file line number Diff line number Diff line change 1- document . getElementById ( "getHelp" ) . addEventListener ( "click" , ( ) => {
2- alert ( "This will soon talk to your Django backend!" ) ;
1+ document . getElementById ( "getHelp" ) . addEventListener ( "click" , async ( ) => {
2+ chrome . tabs . query ( { active : true , currentWindow : true } , async ( tabs ) => {
3+ const tab = tabs [ 0 ] ;
4+ const url = tab . url ;
5+ const title = tab . title ;
6+
7+ console . log ( "LeetCode URL:" , url ) ;
8+ console . log ( "Problem Title:" , title ) ;
9+
10+ // For tomorrow: send to Django here
11+ // fetch("http://127.0.0.1:8000/api/...", { method: "POST", body: ... })
12+ } ) ;
313} ) ;
You can’t perform that action at this time.
0 commit comments