globaleaks / whistleblowing-software

GlobaLeaks is free, open-source whistleblowing software enabling anyone to easily set up and maintain a secure reporting platform.
https://www.globaleaks.org
Other
1.23k stars 269 forks source link

Facebook sharing preview is terrible #2799

Open agajdosi opened 4 years ago

agajdosi commented 4 years ago

Current behavior

Facebook's crawler does not support JS, so when one is sharing a link to Globaleaks instance on Facebook (and possibly other platforms), the link preview is just wrong. It shows the native message for the browser with disabled JS.

Warnings That Should Be Fixed

    Inferred Property
    The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.
    Missing Properties
    The following required properties are missing: og:url, og:type, og:title, og:image, og:description, fb:app_id

Expected behavior

Globaleaks should detect a robot browser and show a simplified HTML of the page which the robot tried to load. For example, when robot loads index page, it should show logo as og:image and TitleBox as og:title etc.

Steps to reproduce the problem or feature illustration

Try the link to Globaleaks instance at: https://developers.facebook.com/tools/debug/

What is the motivation or use case for changing the behavior?

One wants to raise awareness about the instance of Globaleaks so the people know about it and then will use it. One cool way is to let the people to spread the word through social networks.

GlobaLeaks version:

v4.0.6

Browser:

Firefox 74.0

Server Operating System and Version (if applicable):

Debian 10.3 **Client Operating System and Version (if applicable):**

Fedora 31

evilaliv3 commented 4 years ago

Thank you for this feedback @agajdosi

We have currently not altered the way we answer to crawlers because we are concerned of the effects on SEO results; for example Google would not like to receive different content from the one served to users.

What would you recommend in this case?

Are you able yourself to provide a patch of supporting this functionality?

agajdosi commented 4 years ago

Hi @evilaliv3, thank you for the reply. I am not a SEO expert, but it seems to me that when GL serves the page for non-JS browsers, it is basically serving a different content from the one served to users. GL does not need to focus on lying to crawlews, but just to show more information to non-JS browser.

What might be a solution is to make this non-JS version more informative: for sure GL needs to show a message about how the browser does not support JS, but that could be only part of the page - alerting div window or something like that - and it should not be the only info you get there.

The crawlers look for og:image, og:title and something like that. Let them to have it. They maybe would use a title, H1, let them to have it. Users need an info that without JS it is not usable. Let them have it, but no as the only thing.

As a user with JS disabled, it would not harm me to see the correct title of the page I am trying to access. Root, submission or something similar. At least the user will be motivated to turn the JS on.

fpietrosanti commented 4 years ago

Wordpress plugins naturally enable to provide different preview depending on the source requesting it (google, twitter, facebook). It would be nice to do something similar for GlobaLeaks as a specific call to action feature for FB, as an image?

flosincapite commented 4 years ago

I'd like to take this on!

flosincapite commented 4 years ago

Hi, all, I'm trying to work on this but I don't think I'm able to pull up the client properly. Please see PR for details.

evilaliv3 commented 4 years ago

@flosincapite: Thank you, ive answered you on the pull request!