parent
e72f77db3d
commit
a168da802a
@ -0,0 +1,44 @@ |
||||
// ==UserScript==
|
||||
// @name VirtualBlinders
|
||||
// @namespace Utopiah
|
||||
// @description Stay focus, damnit!
|
||||
// @include *facebook.com*
|
||||
// ==/UserScript==
|
||||
|
||||
serviceName="Facebook"; |
||||
serviceAlternatives="http://diaspora.com"; |
||||
wikiUrl="http://self/devpim/" |
||||
|
||||
GM_xmlhttpRequest({ |
||||
method: "GET", |
||||
url: wikiUrl+"pub/tos_status", |
||||
onload: function(response) { |
||||
task = response.responseText; |
||||
responseCheck(tos); |
||||
} |
||||
}); |
||||
|
||||
function responseCheck(tos) { |
||||
if (tos == 'ok\n' ){ |
||||
tos_rendering = '<font color="green">TOS ok :)</font>'; |
||||
} |
||||
if (tos == 'meh\n'){ |
||||
tos_rendering = '<font color="orange">Warning</font> (consider those settings)'; |
||||
} |
||||
if (tos == 'bad\n'){ |
||||
tos_rendering = '<font color="red">BAD TOS!</font> (try '+serviceAlternatives+'instead)'; |
||||
} |
||||
} |
||||
|
||||
var myDiv = document.createElement('div'); |
||||
myDiv.id = "GM_PIM_Window"; |
||||
myDiv.innerHTML += "<p class=\"tos_render\">"+tosRendering+"<ul>" |
||||
+"<li>Tune your settings<li/>" |
||||
+"<li>Contribute to <a href=\""+wikiUrl+serviceName+"\">the ToS wiki page for this service</a>.</li>" |
||||
+"</ul></p>"; |
||||
boxcss = 'position:fixed; right:5px; top:50px; background-color:white; z-index:1; opacity:0.9;'; |
||||
boxcss += 'padding:2px; margin:1px;'; |
||||
boxcss += 'color:blue; font-size:10px; text-align:right;'; |
||||
boxcss += 'border-width:3px; border-color:gray; border-style:solid;'; |
||||
myDiv.style.cssText = boxcss; |
||||
document.body.appendChild(myDiv); |
Loading…
Reference in new issue