Chrome瀏覽器將阻止網站劫持回上一頁按鈕

發佈於: 點閱數:4956

許多用戶發現有些網站頁面會使瀏覽器的「回上一頁」按鈕失效,瀏覽器目前的分頁會一直卡在這個網站上,此時用戶按下「回上一頁」按鈕是不會有任何效果的,這是利用「回上一頁」按鈕在瀏覽器中的工作方式,並使用重新導向或歷史操作。

Google對此已有回應,這些網站頁面使用戶很難或不可能通過瀏覽器「回上一頁」按鈕返回原先的頁面。這是通過重新導向或操控瀏覽器歷史記錄來達成的,並導致濫用和惱人的用戶體驗。Google將通過阻止任何不涉及用戶輸入的行為來解決這個問題,這意味著按下後退按鈕將獲得預期的結果,並且不允許複雜的代碼進行干預。瀏覽器「回上一頁」按鈕的新行為將會跳過新增歷史記錄條目或重新導向用戶頁面,但是同時又不會影響到history.back/forward API。

目前此功能在開發中。


PSA: History Manipulation Intervention - Google 網上論壇


Summary

Some pages makes it difficult or impossible for the user to go back to the page they came from via the browser back button. This is accomplished by redirects or by manipulating the browser history and results in an abusive/annoying user experience.

The new behavior of the browser’s back button will be to skip over pages that added history entries or redirected the user without ever getting a user gesture. Note that the intervention only impacts the browser back/forward button UI and not the history.back/forward APIs.

Here’s an example:

User is on a.com and clicks to go to b.com

b.com adds a history entry using pushState or navigates the user to another page (c.com) without ever getting a user gesture. 

b.com will then be skipped if the user presses back and user will directly be navigated to a.com.

Given the above, developers should be aware that if they want the browser’s back button to land on a page that redirected after loading, then that page should have had a user gesture before redirecting. Developers should also be aware that if a history entry is added but there is no user gesture by the time the user hits back, the page adding the history entry will be skipped and the popstate event will not fire.

This feature will be supported on all six Blink platforms (Windows, Mac, Linux,Chrome OS, Android, and Android WebView).


加入我們

高雄網路行銷多年經驗的丹媞網路媒體公司,專業的SEO全站優化與響應式網頁設計架站,能有效提升網站排名,多種網路行銷解決方案,量身打造網路行銷規劃,建立品牌識別,讓品牌昇華商品價值。

LINE@官網