yoannchb-pro/MoodleGPT

Console logs not working

Closed this issue · 7 comments

I did everything according to the instructions and even saw other issues, but I still didn’t understand what my problem was!
My openai api key is fully working, but the extension shows no signs of life, help me understand what the problem is please! Ask any questions you want

I tried using extention on your test Moodle page*

Could you send the console by pressing f12 and then console. Also active title injection option and check the injection is working because sometimes the extension don’t have access to local files

Sure! I running fake page on local server, but still dont see a notification about injection:
Screenshot 2024-01-08 at 12 10 03

Yes it’s because the path is not registered into the manifest. You can add it manually

YES!!!! I made it and now all is alright, thank you!!!!

manifest.json:

"matches": ["*://*/**/mod/quiz/*", "*://*/mod/quiz/*", "file:///*", "http://127.0.0.1:5500/*"],
Screenshot 2024-01-08 at 17 47 02

Hy, I'm sorry to have to comment on a closed issue, but I do not understand how to modify the manifest. How do I do it?

Thanks.

Hi! It's easy, just open a /extention/manifest.json in your code editor and add this string "http://127.0.0.1:5500/*" in matches array:

{
  ...other things

  "content_scripts": [
    {
      "matches": ["*://*/**/mod/quiz/*", "*://*/mod/quiz/*", "file:///*"], // <<< MAKE CHANGES HERE
      "js": ["MoodleGPT.js"],
      "run_at": "document_end"
    }
  ]
}

So complete file should be like that:

{
  "manifest_version": 3,
  "name": "MoodleGPT",
  "version": "1.0.3",
  "description": "Hidden chat-gpt for your moodle quiz",
  "permissions": ["storage"],
  "action": {
    "default_icon": "icon.png",
    "default_popup": "./popup/index.html"
  },

  "icons": {
    "16": "icon.png",
    "32": "icon.png",
    "48": "icon.png",
    "128": "icon.png"
  },

  "content_scripts": [
    {
      "matches": ["*://*/**/mod/quiz/*", "*://*/mod/quiz/*", "file:///*", "http://127.0.0.1:5500/*"],
      "js": ["MoodleGPT.js"],
      "run_at": "document_end"
    }
  ]
}

And yeah, if you want modify manifest.json just to try an extention, remember to use a correct URL (so I used a LiveServer in Visual Studio Code, URL is http://127.0.0.1:5500)