User:Suffusion of Yellow/vpt-mockup.js

// Proof concept only. Not intended for actual use! // $(function {	'use strict';	var info = {		"user-agent": {			dangerous: true,			get: function {				return window.navigator.userAgent;			}		},		"screen-resolution": {			dangerous: true,			get: function {				return window.screen.width + "x" + window.screen.height;			}		},		"skin": {			get: function {				return mw.user.options.values.skin;			}		},		"relevant-pages": {			get: function {				var skin = mw.user.options.values.skin;				var prefix = "User:" + mw.config.get('wgUserName') + "/";

return 'commons.js, ' + 'common.css, ' + '' + skin + '.js, ' + '' + skin + '.css, ' + 'global.js, ' + 'global.css'; }		},		"gadgets": { get: function { var gadgets = [];

for(var opt in mw.user.options.values) { if (opt.indexOf("gadget-") === 0) gadgets.push(opt.slice(7)); }

return gadgets.join(", "); }		}	};

if (mw.config.get('wgPageName') === "Special:BlankPage/TechInfo") { var $content = $('#mw-content-text').html(""); var basic = ""; var dangerous = "";

for(var name in info) if (info.hasOwnProperty(name)) { var result; try { result = info[name].get; } catch(e) { result = "unknown"; }				var line = "* " + name + ": " + result + "\n";

if (info[name].dangerous) dangerous += line; else basic += line; }

$content.append(" Usually safe to share"); var $basic = $(" ", {			rows: 20,			readonly: true		}); $basic.val(basic).appendTo($content);

$content.append(" Possibly unsafe to share "); $content.append(" This information may be used to track you on the web. ");

var $dangerous = $(" ", {			rows: 5,			readonly: true		}); $dangerous.val(dangerous).appendTo($content); } }); //