Bookmarklet for @SlyDnet

Test description

by pioul

HTML

<a href="javascript:var escapeHTML = function(unsafe){return unsafe.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/'/g, '&#039;');};var url = escapeHTML(window.location.href);var title = escapeHTML(document.title);var description = '';var metas = document.getElementsByTagName('meta');for(var x=0; x<metas.length; x++){if(metas[x].name.toLowerCase() == 'description'){description = escapeHTML(metas[x].content);}}var popup = window.open('','name','height=300,width=400');popup.document.write('<style>div{height:60px;border-bottom:1px solid #999;}</style>');popup.document.write('<div><input type=\'text\' value=\''+ url +'\'/></div>');popup.document.write('<div><input type=\'text\' value=\''+ title +'\'/></div>');popup.document.write('<div><input type=\'text\' value=\''+ description +'\'/></div>');">Click me!</a>

JavaScript

/* JavaScript, juste là pour être modifié plus facilement

var escapeHTML = function(unsafe) {
    return unsafe
        .replace(/&/g, "&amp;")
        .replace(/</g, "&lt;")
        .replace(/>/g, "&gt;")
        .replace(/"/g, "&quot;")
        .replace(/'/g, "&#039;");
};
var url = escapeHTML(window.location.href);
var title = escapeHTML(document.title);
var description = '';
var metas = document.getElementsByTagName('meta');
for(var x=0; x<metas.length; x++){
    if(metas[x].name.toLowerCase() == "description"){
        description = escapeHTML(metas[x].content);
    }
}
var popup = window.open('','name','height=300,width=400');
popup.document.write('<style>div{height:60px;border-bottom:1px solid #999;}</style>');
popup.document.write('<div><input type="text" value="'+ url +'"/></div>');
popup.document.write('<div><input type="text" value="'+ title +'"/></div>');
popup.document.write('<div><input type="text" value="'+ description +'"/></div>');

*/