How to recognize Facebook User-Agent

后端 未结 11 1353
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 15:35

When sharing one of my pages on FB, I want to display something different. Problem is, I prefer not to use the og: elements, but to recognize FB user-agent.

What is

11条回答
  •  [愿得一人]
    2020-11-27 15:58

    You already have the answer for Facebook above, but one way to get any user agent is to place a script on your site that will mail you when there is a visit to it. For example, create this file on your domain at, say, https://example.com/user-agent.php :

    Then, visit Facebook, and type the link to the script there, and hit space bar. You don't actually have to share anything, just typing the link in and a space will cause Facebook to fetch a preview. You should then get an email with Facebook's user agent.


提交回复
热议问题