FKAMP-7: Remove AMP pages from browser history



Issue Information

Issue Type: New Feature
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: Anti-AMP Scripts (FKAMP)
Resolution: Done (2019-06-12 15:29:14)
Target version: v1.4.3,

Created: 2019-06-12 12:12:45
Time Spent Working


Description
Currently, AMP pages remain in the browser history, so if we imagine the following request flow:

- Google Search
- El Reg AMP page
- El Reg HTML page

When the user is on El Reg HTML Page they may press back in order to go back to the search results.

What'll actually happen though is their browser will go back to the AMP page, which will trigger the redirect and then put them back onto the HTML page.

Rather than setting window.location.href when triggering a redirect, we should use window.location.replace() so that the current (i.e. AMP) page isn't written into the browser's history.

That way, a back on the El Reg HTML page would take you back to the Google search results


Toggle State Changes

Activity



Repo: RemoveAMP
Commit: 10a2696473beed5e71fda44d4298f6ef8c518433
Author: Ben Tasker <btasker@<Domain Hidden>>

Date: Wed Jun 12 12:28:55 2019 +0100
Commit Message: FKAMP-7 Switch to using window.location.replace so that AMP pages are purged from history



Modified (-)(+)
-------
anti-amp.js
greasemonkey_hook_googlesearch.user.js




Webhook User-Agent

GitHub-Hookshot/d408d22


View Commit

Tested on Google News in Firefox using user-agent switcher, and works just fine.
btasker changed status from 'Open' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'