// ==UserScript== // @name MISC29Test // @namespace http // @description Hooks in the AMP removal javascript to attempt to direct to a proper page // @include *://*/* // @run-at document-end // @grant none // @version 1.4.1b // // // // Author: B Tasker // ==/UserScript== (function() { 'use strict'; function fuckOffAMP(){ // Check whether it's AMP html var h = document.getElementsByTagName('html'); var i = document.getElementsByTagName('iframe'); var iframenasty = false; var src; for (var a=0;a < i.length; a++){ src = i[a].getAttribute('src'); if (src.includes('cdn.ampproject.org/')){ console.log("iFrames.... Fantastic modernisation there google...."); iframenasty = true; break; } } if (iframenasty || h[0].getAttribute('amp') != null || h[0].getAttribute('⚡') != null || document.location.href.substr(0,29).toLowerCase() == 'https://www.google.com/amp/s/'){ console.log("eww vile... trying to redirect"); // Try and find a canonical link eles = document.getElementsByTagName('link'); for (var i=0; i