User:Gabriele Nunzio Tornetta/monobook.js

// My scripts. /* addOnloadHook(   function  {         mw.util.addPortletLink('p-coll-print_export', "javascript:doTeXify", "TeXify", "coll-texify", "Produces a LaTeX document out of the current article");    } );

function doTeXify { var client = new XMLHttpRequest; client.open('GET', 'https://en.wikipedia.org/w/index.php?title=' + document.getElementById("firstHeading").innerHTML + '&action=edit', false); client.setRequestHeader("User-Agent", navigator.userAgent); client.send;

var edt = client.responseText patt = new RegExp('(?:^|\s)(.*) (?:\s|$)', "g") var match = patt.exec(edt) alert(match[1]); win = document.open; win.write(match[1]); win.close; }