Has Facebook sharer.php changed to no longer accept detailed parameters?

前端 未结 5 912
醉话见心
醉话见心 2020-11-27 09:59

We have been opening a sharing popup (via window.open) with the URL like

https://www.facebook.com/sharer/sharer.php?s=100&p[title]=EXAMPLE&p[summary]         


        
5条回答
  •  Happy的楠姐
    2020-11-27 10:48

    Starting from July 18, 2017 Facebook has decided to disregard custom parameters set by users. This choice blocks many of the possibilities offered by this answer and it also breaks buttons used on several websites.

    The quote and hashtag parameters work as of Dec 2018.


    Does anyone know if there have been recent changes which could have suddenly stopped this from working?

    The parameters have changed. The currently accepted answer states:

    Facebook no longer supports custom parameters in sharer.php

    But this is not entirely correct. Well, maybe they do not support or endorse them, but custom parameters can be used if you know the correct names. These include:

    • URL (of course) → u
    • custom image → picture
    • custom title → title
    • custom quote → quote
    • custom description → description
    • caption (aka website name) → caption

    For instance, you can share this very question with the following URL:

    https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fstackoverflow.com%2Fq%2F20956229%2F1101509&picture=http%3A%2F%2Fwww.applezein.net%2Fwordpress%2Fwp-content%2Fuploads%2F2015%2F03%2Ffacebook-logo.jpg&title=A+nice+question+about+Facebook"e=Does+anyone+know+if+there+have+been+recent+changes+which+could+have+suddenly+stopped+this+from+working%3F&description=Apparently%2C+the+accepted+answer+is+not+correct.
    

    Try it!

    I've built a tool which makes it easier to share URLs on Facebook with custom parameters. You can use it to generate your sharer.php link, just press the button and copy the URL from the tab that opens.

提交回复
热议问题