Skip to content

Instantly share code, notes, and snippets.

@MegaApuTurkUltra
Last active December 29, 2015 06:06
Show Gist options
  • Save MegaApuTurkUltra/6b06c36fe8a295ee9846 to your computer and use it in GitHub Desktop.
Save MegaApuTurkUltra/6b06c36fe8a295ee9846 to your computer and use it in GitHub Desktop.
Detects NFE projects and AE studios on Scratch
// ==UserScript==
// @name NFE / AE Userscript
// @namespace http://aputurk.tk
// @version 0.2
// @description Detect NFE and AE
// @author You
// @match https://scratch.mit.edu/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
'use strict';
function mark(){
console.warn("GOT NFE/AE");
var tag;
if(location.href.indexOf("projects") > -1){
tag = "[NFE] ";
} else if(location.href.indexOf("studios") > -1){
tag = "[AE] ";
} else {
tag = "[NO INDEX]";
}
document.title = tag + document.title;
document.body.style.background = "url(http://i68.tinypic.com/20zwtpc.png)";
document.getElementsByTagName("html")[0].style.background = "url(http://i68.tinypic.com/20zwtpc.png)";
}
var interval = setInterval(function(){
var metas = document.getElementsByTagName("meta");
if(metas.length > 0){
console.info("GOT METAS");
clearInterval(interval);
for(var i = 0; i < metas.length; i++){
console.info(metas[i], metas[i].name, metas[i].content);
if(metas[i].name == "robots" && metas[i].content.indexOf("noindex") > -1){
mark();
return;
}
}
}
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment