learningequality / kolibri-app

Kolibri app for Mac and Windows
MIT License
1 stars 10 forks source link

Download resource buttons are visible in the Windows app #68

Open dylanmccall opened 3 years ago

dylanmccall commented 3 years ago

Using the Kolibri Windows app built from this repository, the "Download resource" button is visible when viewing content such as videos. This link doesn't work because we need to implement some more WebKit things, but it also shouldn't be visible in this context.

Download resource

Kolibri hides this button based on a user agent check, which works as expected with the Mac app because of how WebKit sets its user agent. Perhaps the user agent in the Windows app is set to something unexpected:

kollivier commented 3 years ago

@dylanmccall Actually, it's just that I forgot to add logic specific to Windows for that check. I'm actually thinking that since we now have the app plugin in Kolibri and the appContext stuff, we can rely on that rather than the user agent checks.

The only thing about that is that I realized that the GNOME app probably has isEmbeddedWebView set to false, and so download buttons are visible there. (Which makes sense as you have download support.) Would the best short-term fix be to do a check like (isWin || isMac || isAndroid) && isAppContext?

dylanmccall commented 3 years ago

Yeah, I think that would be perfect :)