Dec 6 2008

Passwords Viewer

by Elijah Grey

Less than a year ago, I made a passwords viewer written in XHTML and JavaScript to view exported xml files from the Password Exporter Firefox addon. It was made to make human-readable (I know XML is readable but the exported XML can be much harder to read than tables and if you have it Base64 encoded you would have to decode all of the Base64 encoded attributes, one by one) text tables with the hosts, usernames, and passwords in the exported xml files for my personal use. The text table dynamically resizes with the longest values and is meant to be stored in a text file encrypted with a master password. I was using my passwords viewer today and thought I would share it with everyone else who uses Password Exporter.

You can download the passwords viewer (XHTML) or try out the online version (also XHTML) displaying a text table of a fake example passwords file. Due to this webapp being meant to help out people who use a certain Firefox addon, I only made it so it works in Firefox. Disregard that, I made it cross-browser* with 1 small tweak. The normal version is made for local use on your computer’s filesystem ONLY and the online version works both online and on your computer’s filesystem but requires you tto type out the filename instead of picking it with a file picker. Appending a query or hash string containing file=FILENAME to the end of the URI will auto-load the passwords file specified.

*Except for IE. I see no reason to waste my time on making something like this work in IE.

› Continue reading


Nov 23 2008

The jData Standard

by Elijah Grey

If jData is ever going to succeed, it needs standards. I have made a list of jData standards and recommendations for the jData Standard version 0.1 (this is an unfinished draft and is subject to change). I will update this soon:

  • jData Website - Currently jdata.eligrey.com
  • The size limit: Browsers will limit how much data can be stored in the jData Website’s localStorage object, so please do not set preferences that use anything near or over 1kb of data. jData is supposed to be a global resource that any website can access. If a website starts storing excessive amounts of data in your jData storage, report it by emailing me or commenting here and I will block the website from using jData on their website.
  • Standard Types: (Case sensitive unless otherwise stated)
    • Boolean: “true”, “false”, “0″, or “1 (0 = false, 1 = true)
    • String: Can be anything in a string.
    • Integer: An integer. Suggested to parse using JavaScript’s parseInt() function.
    • Double: A double. Suggested to parse using JavaScript’s parseFloat() function.
    • Decimal: A decimal (uses periods, not commas). (ECMAScript under 4 can’t parse so use server-side)
    • Preceding “?” in class type: Usually the type but can vary
    • Any: Can be any type.
    • Types are separed from the class by a colon and multiple types can be stated as such: class:type1|type2|type3 (ect…)
  • Standard classes:
    • permit:Boolean - User permit’s item
    • personal:?String - Ask user before setting item(s). Personal information. Usually a string.
    • public:?String - You can give the user a warning but it is not required. Public information. Usually a string.
    • preference:Any - A user’s preference about an item.
    • understand:Boolean - A user understands an item. (eg. understand.javascript => ‘true’ means they understand javascript)

› Continue reading


Nov 23 2008

Snippet: jDataQuery()

by Elijah Grey

This is a JavaScript snippet for making a jData querying function with a callback parameter. I have also uploaded an demo of this function. The code is public domain so modify it as you wish. jData works on all browsers that correctly support localStorage and window.postMessage (IE8 beta 2 has trouble with it so no support currently) so that’s why jDataQuery doesn’t have any code to support IE8.

<script type="application/javascript">
var $tempMessageListener, jDataServer = 'http://jdata.eligrey.com',
jDataEnableHash = false; // Set to true to have hash value of jData frame change to current query
var jDataLoadFlags = jDataEnableHash ? '/?hash':'/';
var jDataFrame = document.createElement('iframe');
jDataFrame.setAttribute('src', jDataServer+jDataLoadFlags);
jDataFrame.setAttribute('style', 'display:none');
document.documentElement.appendChild(jDataFrame);

function jDataQuery(query, callback) {
	if (callback) { $tempMessageListener = function(e){ getNextjDataResponse(e, callback); } }
	else { $tempMessageListener = function(e){ getNextjDataResponse(e); } }
	window.addEventListener("message", $tempMessageListener, false);
	jDataFrame.contentWindow.postMessage(query, '*');
};

function getNextjDataResponse(e, callback) {
	if ( e.origin == jDataServer ) { // Make sure that this is a jData response
		window.removeEventListener("message", $tempMessageListener, false);
		if (callback) { callback((e.data != 'null' && e.data != 'undefined')?e:undefined); }
		$tempMessageListener = undefined;
	}
};
<script>

Syntax: jDataQuery(query:String [, callback:Function])

Example:

A website sets the user’s preferred search engine as JSON in preference.searchEngine:

jDataQuery("setItem('preference.searchEngine',\"{'Google':'http://www.google.com/search?q=%s'}\")")

Then another website wants to check out the JSON in preference.searchEngine if it exists:

jDataQuery("getItem('preference.searchEngine')",function(e){setSearchBox(JSON.parse(e.data))})

Nov 23 2008

jData - Publicly Share Data

by Elijah Grey

jData is a new (extremely tiny) library for sharing data about yourself everywhere without a website needing permission/URIs/ect. It is like having a globally accessible localStorage. It is accessible at jdata.eligrey.com in two different API flavors: postMessage and HTTP queries. It only works in browsers that support window.postMessage (ie. advanced browsers like Firefox 3 and the WebKit nightlies) and sorta works in IE 8 beta 2. I may add Google Gears support someday.

What is jData? - Think of the data stored on jData like cookies with no size limit; cookies that can be accessed by any website on the internet. It’s so lightweight that the postMessage API is exactly 300 bytes.
Why make this? - This would be a good resource for storing info about yourself that you are okay with any website on the internet knowing.

Hypothetical situation: Facebook started storing your name (with your permission) to jData.fullname. Then the people who run MySpace think this is a good idea and implement it too. Then other websites start checking jData and see if jData.fullname has been set already and pre-fill the corresponding input text box with your name on a sign up page.

› Continue reading


Nov 20 2008

This is Fucking Awesome!

by Elijah Grey

Props to This is Fucking Awesome!, for being well, awesome.  It’s sorta like Twitter but you get a user.isfuckingaweso.me (and eventually a user@isfuckingaweso.me) address that you can put links to your various social network accounts and even Skype. I’m going to beta test some stuff (ie the IFA email addresses) for Greg Melton, the owner of IFA. I like being an original beta tester for websites and it normally ends up with me getting some future “premium” thing for free. For example, I was the first beta tester for Podcaster.fm, the iPhone webapp and reported a few bugs and from now on I get Podcaster (the native app) licences for free for any iPhones I need to use it on.