How does facebook detect when a link as been PASTED

前端 未结 8 1546
轮回少年
轮回少年 2020-12-16 04:45

Facebook\'s status update input (well, contenteditable div) detects links.

When typing a link it waits until the spacebar is pressed before fetching the URL.

相关标签:
8条回答
  • 2020-12-16 05:31

    I am actually going to suggest it listens to every keyup because it has multiple uses, if you type @ it will suggest friends, etc.

    It probably scans the text and finds links and makes them, well linkable, and then crawls the page so you can post it as "Sharing" the page.

    0 讨论(0)
  • 2020-12-16 05:34

    Check the field at half-second increments. If you detect a large change in the amount of text, it has probably been pasted.

    0 讨论(0)
提交回复
热议问题