⚡ THN Weekly Recap: Top Cybersecurity Threats, Tools and Tips [6 Jan]
Every tap, click, and swipe we make online shapes our digital lives, but it also opens doors—some w
Understand bot traffic and which bots you may want to protect from. While some bot traffic is beneficial, learn about bot attacks and how you can protect your website's security.
The post What is Bot Traffic? How to Protect Your Website Against Unwanted Bot Traffic appeared first on Security Boulevard.
當你想在網頁上向 server 發送一些 tracking 相關的資訊時,比起直接用 fetch 送出請求,有另一個通常會被推薦的選擇:navigator.sendBeacon。
為什麼會推薦這個呢?
因為如果是用一般送出請求的方法,在使用者把頁面關掉或是跳轉的時候可能會有問題,例如說剛好在關掉頁面時發送請求,這個請求可能就送不出去,隨著頁面關閉一起被取消了。
雖然說可以利用一些方法嘗試強制送出請求,但這些方法通常都會傷害使用者體驗,例如說強制讓頁面晚一點關閉,或是送出一個同步的請求之類的。
而 navigator.sendBeacon 就是為了解決這個問題而生的。