Cenzic 232 Patent
Paid Advertising
sla.ckers.org is
ha.ckers sla.cking
Sla.ckers.org
For any nonsense or banter that doesn't fit anywhere else. LoL! omg! ROFL! 
Go to Topic: PreviousNext
Go to: Forum ListMessage ListNew TopicSearchLog In
Input Locator Fun
Posted by: dev0
Date: May 19, 2010 04:20PM

Hi there,

i got some free time today and decided to have some fun with Greasemonkey.

I wrote a little Script to show me all inputs on a site and color them based on their type. Nothing special but very interesting to see!

Here's a little screenshot:
http://img6.imageshack.us/img6/4254/inputlocator.jpg

And here's the little Script:
// @namespace *.*
// @description Input locator
// @include *.*
// ==/UserScript==

// Get all Input Elements
var e = new Array();
e = document.getElementsByTagName("input");

// Color them and fill in their informations
for(var i=0;i<e.length;i++)
{
if(e.type=="text" || e.type=="password")
{
e.style.backgroundColor = "#CCFF00"; // Green
e.value = "Name: " + e.name + " ID: " + e.id;
}else{
e.style.backgroundColor = "#FF9933"; // Orange
e.value = "Name: " + e.name + " ID: " + e.id;
}

if(e.type=="hidden")
{
e.type="text";
e.style.backgroundColor = "#E50000"; // Red
e.value = "Name: " + e.name + " ID: " + e.id;
}
}

Have fun.

Options: ReplyQuote
Re: Input Locator Fun
Posted by: Skyphire
Date: May 21, 2010 11:21AM

Greasemonkey sucks big time, they should support BeforeScript, and not after the DOM already has loaded. I'm working on an alternative version which injects script before the page renders.

Options: ReplyQuote
Re: Input Locator Fun
Posted by: sirdarckcat
Date: May 21, 2010 10:26PM

> they should support BeforeScript
NoScript's surrogate scripts do that (quite nicely), and on Chrome content scripts can be configured to do that..

--------------------------------
http://sirdarckcat.blogspot.com/ http://www.sirdarckcat.net/ http://foro.elhacker.net/ http://twitter.com/sirdarckcat

Options: ReplyQuote
Re: Input Locator Fun
Posted by: Skyphire
Date: May 22, 2010 08:49AM

As far as I can tell, NoScript launches a whole new sandbox, bit overhead for simply injecting new scripts. It can be done with about 50-70 lines of JS. And I like small code. (;

Options: ReplyQuote


Sorry, only registered users may post in this forum.