Rixstep
 About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Home » Industry Watch » The Technological

Sanity Check at Microsoft: The Code

The product the DHS called a national security risk gets only better.


Get It

Try It
HTTP/1.1 200 OK
Server: Apache
Last-Modified: Thu, 14 Dec 2006 15:40:19 GMT
Accept-Ranges: bytes
Content-Length: 987
Connection: close
Content-Type: application/x-javascript

if (window.clipboardData)
{
    refresh();
    window.setInterval(refresh, 100);
}
else
{
    var e = document.getElementById('clipboard');
    e.style.background = '#8f8';
    e.style.fontSize = '18px';
    var t = document.createTextNode('Relax, your browser isn\'t vulnerable!');
    e.appendChild(t);
}

function refresh()
{
    var e = document.getElementById('clipboard');
    var text = window.clipboardData.getData('text');
    if (e.text == text)
    	return;
    if (!text) text = "";
    e.text = text;

    var contents = document.createDocumentFragment();
    var div = document.createElement('div');
    contents.appendChild(div);

    var i, p, matches = text.match(/.*\n?/g);

    for (i = 0; i < matches.length; i++)
    {
    	p = document.createElement('p');
    	p.appendChild(document.createTextNode(matches[i]));
    	div.appendChild(p);
    }

    if (e.firstChild)
    	e.firstChild.replaceNode(contents);
    else
    	e.appendChild(contents);
}
About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Copyright © Rixstep. All rights reserved.