5 weeks agoFKAMP-8 Bump version number master
B Tasker []
FKAMP-8 Bump version number

The only purpose of this commit (and release) is to move version numbers to having 2 sets of numbers rather than 3

The reason being that Greasemonkey has been claiming no updates are available (though that's partly because I ballsed up the numbering)

5 weeks agoUpdate version string and point `require` at latest version v1.4.3
Ben Tasker []
Update version string and point `require` at latest version

5 weeks agoFKAMP-6 Detect whether to redirect to HTTPS or HTTP
Ben Tasker []
FKAMP-6 Detect whether to redirect to HTTPS or HTTP

5 weeks agoFKAMP-7 Switch to using window.location.replace so that AMP pages are purged from history
Ben Tasker []
FKAMP-7 Switch to using window.location.replace so that AMP pages are purged from history

5 weeks agoBump version string to 1.4.21 v1.4.21
B Tasker []
Bump version string to 1.4.21

5 weeks agoGoogle News has now been handled in ADBLK-5 so removing from the redirect script
B Tasker []
Google News has now been handled in ADBLK-5 so removing from the redirect script

5 weeks agoFKAMP-5 Split on the fragment rather than the start of the query string
B Tasker []
FKAMP-5 Split on the fragment rather than the start of the query string

5 weeks agoFKAMP-5 Remove need to go to ampproject CDN before being redirected onto the original publisher
B Tasker []
FKAMP-5 Remove need to go to ampproject CDN before being redirected onto the original publisher

This removes one hop from the redirect chain, and subsequent ones are much faster as you _tend_ to speak to the same domain name for a publishers copy of the AMP as you would for the real page, so DNS is already done and there's a connection open already.

This change means that the Anti-AMP functionality still works on Google News with cdn.ampproject.org blocked in my adblocker

5 weeks agoCorrect issue number in comment
B Tasker []
Correct issue number in comment

5 weeks agoFKAMP-5 Update the Googlesearch hook to also work (sort of) with Google News
B Tasker []
FKAMP-5 Update the Googlesearch hook to also work (sort of) with Google News

Introduces logic into {{AMPCheck}} to look for iframe's referencing the AMP project CDN. If found, it updates the page to point to that URL so that the normal anti-AMP scripts can fire.

The downside of this is it means there are a couple of page loads before you eventually land on the full-fat page, so there's definitely some room for improvement

6 weeks agoFKAMP-4 Update README
B Tasker []
FKAMP-4 Update README

6 weeks agoFKAMP-3 Add script to redirect certain sites/domains to non-AMP enforcing alternatives
B Tasker []
FKAMP-3 Add script to redirect certain sites/domains to non-AMP enforcing alternatives

This is primarily for things like Google News where it's non-trivial to un-AMP them.

This current version redirects Google News to Bing News (which isn't something I ever thought I'd find myself willingly doing)

The intention is that this will only ever be used for domains that use AMP but don't declare it, or don't use {{canonical}} properly. Google are currently the only ones I've seen doing that so far

2 months agoMerge pull request #3 from Wowfunhappy/patch-1
Ben Tasker []
Merge pull request #3 from Wowfunhappy/patch-1

Recheck links after "more" button press

2 months agoRecheck links after "more" button press
Jonathan []
Recheck links after "more" button press

Previously, if the user clicked the "more" button to load additional search results, the new results would still be AMP'd. To fix this, we need to recheck all links after the additional results have been added to the page.

Clicking "more" results in many fires of the `DOMNodeInserted` event. This commit re-runs the AMP check after such an event, with a 500ms debounce.

2 months agoBump version number in user-script metadata v1.4.1
Ben Tasker []
Bump version number in user-script metadata

2 months agoRevert "MISC-29 Add slightly snarky and very temporary iframe detection to try and work around AMP detection issues on Safari when hitting Google's cache (see #2)"
Ben Tasker []
Revert "MISC-29 Add slightly snarky and very temporary iframe detection to try and work around AMP detection issues on Safari when hitting Google's cache (see #2)"

This reverts commit 51400177ebdc778364be15fc06f2cc3b6c3629e3.

Further testing has identified the cause of the issues in Safari/Google Search, and this detection won't help with that.

Might be useful in the long run, but as it was thrown together quite quickly I don't feel it's been adequately tested so should be removed for now

2 months agoMISC-29 Hacky hack fix to work around Google's behaviour
Ben Tasker []
MISC-29 Hacky hack fix to work around Google's behaviour

On an AMP compatible device, when the user clicks a link in Google's search results, they'll append {{&ampcf=1}} to the URL (presumably because they expect it to go via their ping page instead of direct).

This makes sure that ends up in the querystring rather than the url path.

Longer term, might be better to rewrite the ping url rather than just overriding href though

2 months agoOops, change the name
Ben Tasker []
Oops, change the name

2 months agoMISC-29 Create new greasemonkey script
Ben Tasker []
MISC-29 Create new greasemonkey script

This basically just dumps the script created in that issue into a greasemonkey script - may very well not work (just easier to transfer to the Mac by putting into the repo).

In *theory* it should prevent Google using their own Amp caches (without a page reload) or even sending the user to an Amp page in the first place. Liable to be a bit fragile though...

2 months agoMISC-29 Add slightly snarky and very temporary iframe detection to try and work around AMP detection issues on Safari when hitting Google's cache (see #2) v1.4.1a
B Tasker []
MISC-29 Add slightly snarky and very temporary iframe detection to try and work around AMP detection issues on Safari when hitting Google's cache (see #2)

This involves doing a scan of the DOM, so might be quite expensive at times. The aim is to try and replace this once I've laid hands on a Mac to be able to repro the issue and troubleshoot it.

2 months agoUpdate Greasemonkey hook to reference v1.4 v1.4
B Tasker []
Update Greasemonkey hook to reference v1.4

Means we should auto-roll out the changes made for MISC-27

2 months agoMISC-29 Search for Canonical and trigger redirect on Google AMP cache pages (see Github #2)
B Tasker []
MISC-29 Search for Canonical and trigger redirect on Google AMP cache pages (see Github #2)

We need to do this because Google's cache doesn't properly declare that the resource is AMP.

17 months agoAdjust README
B Tasker []
Adjust README

17 months agoAdjust script to only run once per page-load v1.3
B Tasker []
Adjust script to only run once per page-load

Without this change, every time there's an AJAX request the script will re-run, which is a tad battery hungry on mobile.

Have also adjusted the payload script to make sure we're only running the check once, as an old call was left in

17 months agoProvide link to test page
B Tasker []
Provide link to test page

17 months agoUpdate README to reflect latest changes. Consider this V1.2 v1.2
B Tasker []
Update README to reflect latest changes. Consider this V1.2

17 months agoMISC-25 Switch to using TM/GM's require directive
B Tasker []
MISC-25 Switch to using TM/GM's require directive

This allows TamperMonkey to run the script even on pages with a strict Content-Security-Policy (as TM supports adding itself into any CSP headers which are present).

It also results in faster trigger times, and means my CDN's logs now won't contain referrer strings showing peoples browsing history (which is a win for both them and me)

17 months agoCreate README v1.1
B Tasker []
Create README

17 months agoEnsure function returns after pushing redirect (MISC-25)
B Tasker []
Ensure function returns after pushing redirect (MISC-25)

Otherwise, if the browser is slow to follow the redirect we'll still write subsequent console.log calls to console. Might make troubleshooting tricky at some point in the future.

17 months agoAdd version information and download URL in
B Tasker []
Add version information and download URL in

17 months agoCreates greasemonkey script for STGNG-7
Ben Tasker []
Creates greasemonkey script for STGNG-7

I had originally planned to load the anti-amp Javascript direct from Github (using raw.) but unfortunately the browser refuses to run it because the content-type is returned as text/plain rather than application/javascript

Instead, we serve it via my CDN.

When adding the script anchor, we include a SubResourceIntegrity (SRI) hash to minimise the chances of a MITM (or compromise of my system) buggering anyone.

17 months agoSee STGNG-7
Ben Tasker []
See STGNG-7

Adjusts the anti-AMP script to write more to console so that we can track whether it's firing.

Also deals with the fact that Google decided rather than just using ASCII attributes, you can also use ⚡ to denotate that something is in AMP format.

Automatic redirect has been re-enabled now that the fallback functionality has been tested

17 months agoDelay triggering of the checks
Ben Tasker []
Delay triggering of the checks

17 months agoImplement initial version of AMP bypasser. See STGNG-7
Ben Tasker []
Implement initial version of AMP bypasser. See STGNG-7

17 months agoInitial commit
Ben Tasker []
Initial commit