// ==UserScript==// @name Ark's Wiki Search - version 3.1b// @namespace http://ro.wikipedia.org/wiki/User:Ark25// @description A basic example of Greasemonkey that causes an alert when a certain string is found.// @include https://*.wikipedia.org/*// ==/UserScript==varManifest=" This program is in the Public Domain. You can use it as you wish. ";varManual="First install GreaseMonkey addon for Firefox";varManual="Then save this text into a file named 'WikiSearch.user.js' on your disk and then browse with Firefox to file:///C:/MyFolder/WikiSearch.user.js";varVersion_Log="v1 (2014-03-15) - simple search";varVersion_Log="v2 (2014-03-15) - multiple word search";varVersion_Log="v3 (2014-03-16) - search only when editing, search for commas not followed by spaces";// Set Warn_Me_Only_When_Editing to 1 - if you want the script to warn you only when you edit Wikipedia pages (i.e. it won't warn you when you just read Wikipedia pages)varWarn_Me_Only_When_Editing=1;// set Case_Insensitive to 1 - if you want the search to be case insensitivevarCase_Insensitive=0;varMy_Search_Strings=["{{def","nascut","născut"];varu=document.URL;vard=content.document.body.innerHTML;if(Warn_Me_Only_When_Editing)if(!(u.match(/action=edit/)))thrownewError();vard=d.replace(/[\n\r]/g,"");// Keep only what's inside the edit window (if you edit the page)vard=d.replace(/.*wpTextbox1/,"");vard=d.replace(/<\/textarea>.*/,"");// Keep only what's inside the edit window (if you are just viewing the page)vard=d.replace(/.*<!-- start content -->/,"");vard=d.replace(/<!-- end content -->.*/,"");if(Case_Insensitive){vard=d.toLowerCase();for(i=0;i<My_Search_Strings.length;i++)My_Search_Strings[i]=My_Search_Strings[i].toLowerCase();}for(i=0;i<My_Search_Strings.length;i++)if(d.indexOf(My_Search_Strings[i])>=0)alert("Page contains "+My_Search_Strings[i]+" !!");// Uncomment the next lines to search for a COMMA that is not followed by SPACEvard=d.replace(/, /g,"");vard=d.replace(/[0-9],[0-9]/g,"");if(d.indexOf(",")>=0){varn=d.indexOf(",")vars=d.substr(n,20);alert("Page contains COMMA that is not followed by SPACE !! "+" — "+s);}