The anti-amp scripts (from MISC-25) are served from the same dir, so add them
The anti-amp scripts (from MISC-25) are served from the same dir, so add them

Probably makes sense to track them anyway, though in an ideal world I'd have stuck them in a different directory

file:b/anti-amp/v1.1.js (new)
--- /dev/null
+++ b/anti-amp/v1.1.js
@@ -1,1 +1,43 @@
+function fuckOffAMP(){
+    // Check whether it's AMP html
+    var h = document.getElementsByTagName('html');
+    if (h[0].getAttribute('amp') != null || h[0].getAttribute('⚡') != null){
+        console.log("eww vile... trying to redirect");
 
+        
+        // Try and find a canonical link
+        eles = document.getElementsByTagName('link');
+        for (var i=0; i<eles.length;i++){
+            if (eles[i].getAttribute('rel') == 'canonical' && eles[i].getAttribute('rel') != window.location.href.split('#')[0]){
+                window.location.href = eles[i].getAttribute('href');
+                console.log("Redirecting you");
+                return;
+            }
+        }
+
+        // If we got this far, there's no canonical :(
+        console.log("Sorry, but you're stuck with the sucky version of this page. Maybe search for the proper version?");
+
+        // Build a link to search DuckDuckGo for the page title (to hopefully find the proper version)
+        t = document.getElementsByTagName('title')[0];
+        qs = encodeURIComponent(t.innerHTML);
+        searchurl = 'https://duckduckgo.com/?t=hg&ia=web&q='+qs
+
+        altlink = document.createElement('a');
+        altlink.href = searchurl;
+        altlink.title = 'Try and find a proper verison of this page';
+        altlink.innerHTML = 'Search for a non-AMP version of this page';
+        
+        // Drop the link in at the top
+        document.body.insertBefore(altlink, document.body.firstChild);
+    }else{
+        console.log("Doesn't appear to be AMP'd");
+    }
+
+}
+
+// Wait for the DOM to load otherwise various checks will fail
+console.log('Anti-AMP loaded')
+fuckOffAMP();
+
+

file:b/anti-amp/v1.3.js (new)
--- /dev/null
+++ b/anti-amp/v1.3.js
@@ -1,1 +1,39 @@
+function fuckOffAMP(){
+    // Check whether it's AMP html
+    var h = document.getElementsByTagName('html');
+    if (h[0].getAttribute('amp') != null || h[0].getAttribute('⚡') != null){
+        console.log("eww vile... trying to redirect");
 
+        
+        // Try and find a canonical link
+        eles = document.getElementsByTagName('link');
+        for (var i=0; i<eles.length;i++){
+            if (eles[i].getAttribute('rel') == 'canonical' && eles[i].getAttribute('rel') != window.location.href.split('#')[0]){
+                window.location.href = eles[i].getAttribute('href');
+                console.log("Redirecting you");
+                return;
+            }
+        }
+
+        // If we got this far, there's no canonical :(
+        console.log("Sorry, but you're stuck with the sucky version of this page. Maybe search for the proper version?");
+
+        // Build a link to search DuckDuckGo for the page title (to hopefully find the proper version)
+        t = document.getElementsByTagName('title')[0];
+        qs = encodeURIComponent(t.innerHTML);
+        searchurl = 'https://duckduckgo.com/?t=hg&ia=web&q='+qs
+
+        altlink = document.createElement('a');
+        altlink.href = searchurl;
+        altlink.title = 'Try and find a proper verison of this page';
+        altlink.innerHTML = 'Search for a non-AMP version of this page';
+        
+        // Drop the link in at the top
+        document.body.insertBefore(altlink, document.body.firstChild);
+    }else{
+        console.log("Doesn't appear to be AMP'd");
+    }
+
+}
+
+

file:b/anti-amp/v1.js (new)
--- /dev/null
+++ b/anti-amp/v1.js
@@ -1,1 +1,44 @@
 
+
+function fuckOffAMP(){
+    // Check whether it's AMP html
+    var h = document.getElementsByTagName('html');
+    if (h[0].getAttribute('amp') != null || h[0].getAttribute('⚡') != null){
+        console.log("eww vile... trying to redirect");
+
+        
+        // Try and find a canonical link
+        eles = document.getElementsByTagName('link');
+        for (var i=0; i<eles.length;i++){
+            if (eles[i].getAttribute('rel') == 'canonical' && eles[i].getAttribute('rel') != window.location.href.split('#')[0]){
+                window.location.href = eles[i].getAttribute('href');
+            }
+        }
+
+        // If we got this far, there's no canonical :(
+        console.log("Sorry, but you're stuck with the sucky version of this page. Maybe search for the proper version?");
+
+        // Build a link to search DuckDuckGo for the page title (to hopefully find the proper version)
+        t = document.getElementsByTagName('title')[0];
+        qs = encodeURIComponent(t.innerHTML);
+        searchurl = 'https://duckduckgo.com/?t=hg&ia=web&q='+qs
+
+        altlink = document.createElement('a');
+        altlink.href = searchurl;
+        altlink.title = 'Try and find a proper verison of this page';
+        altlink.innerHTML = 'Search for a non-AMP version of this page';
+        
+        // Drop the link in at the top
+        document.body.insertBefore(altlink, document.body.firstChild);
+    }else{
+        console.log("Doesn't appear to be AMP'd");
+    }
+
+}
+
+// Wait for the DOM to load otherwise various checks will fail
+console.log('Anti-AMP v1 loaded')
+fuckOffAMP();
+
+
+