wongjiahau / ttap-web

This is repo for storing codes of TTAP(UTAR)-Web version
https://get-ttap.surge.sh
MIT License
6 stars 9 forks source link

Reason for redirecting user to use Electron app #207

Closed mangkoran closed 1 year ago

mangkoran commented 1 year ago

First of all, thank you for creating this application! My friend couldn't be happier to easily arrange their timetables.

However, I have a question. When running the web app directly (npm run start), I noticed that I was "redirected" to use the compiled Electron app instead. And after looking into the source code, I found that there are several user agent checking (1) (2).

Allowing user to use the web app will make it easy to containerize and deploy the application.

Edit: It seems the issue is with login page. It will always return 33 Invalid Code image It returned invalidSecurity image

wongjiahau commented 1 year ago

Hey @mangkoran, thanks for using TTAP!

Unfortunately, it cannot be just a web app due to CORS.

TTAP works by scrapping the iframe pointing to the unitreg website.

Browsers, by default, disallow scrapping iframe from another domain for security reasons, such as keylogging.

Therefore, I have to either package the app in Electron (with default security disabled) or host a web server to run the scrape (which is expensive and far buggier).

Does this answer your question?

mangkoran commented 1 year ago

I see. It was CORS then.

Thank you!