marcelreppi / moodle-buddy

Moodle Buddy is a browser plugin that offers mass download and notification functionality to the Moodle learning management platform
https://moodlebuddy.com
GNU Affero General Public License v3.0
40 stars 3 forks source link

.php file is downloaded instead of .pdf #12

Closed itsfarseen closed 3 years ago

itsfarseen commented 3 years ago

When I download any pdf file using moodle buddy, it downloads the source code of login page instead of the actual file.

itsfarseen commented 3 years ago

image

itsfarseen commented 3 years ago

image

liutiming commented 3 years ago

I have the same problem for some course pages but not others.

One manual solution I have found is to go to the deepest possible topic page and often pdf will be downloaded, but I think it will be much easier if it can also work on top page

marcelreppi commented 3 years ago

Thank you very much for reporting this!

This is the most common issue I hear about and it's very difficult to debug for me because I don't have any login credentials to the Moodle platforms where this occurs. I have not faced this issue myself yet.

When I detect a Moodle resource I fetch it to retrieve the actual download link and then I use the browser.downloads API to download the file. I could imagine that during the fetch call there is maybe some missing authentication. On all the sites I have tested my plugin it worked fine.

If you have the time and knowledge to look into it I would very much appreciate the help! I have some development instructions in the README.

I really wish I could help some more with this issue 😕

itsfarseen commented 3 years ago

@marcelreppi I found the problem. I was putting all my uni websites in a container tab. I tried without container tabs and it works as expected :tada:

marcelreppi commented 3 years ago

@happycoder97 I am glad you found the problem! 😄 🎉 I'll close this for now but feel free to reopen if you encounter the issue again.