Archive for the ‘Firefox/Mozilla’ Category

Annoying Failure to Auto-Complete

Sunday, June 21st, 2009

I’ve not bothered much with the adobe groups website… Partly because I don’t use adobe products, but also because Adobe is using the autocomplete=”off” attribute on the password input field… This means due to my already decreased interest in actually using the website this makes it even more of a pain to do things that *should* be very very *simple* like saying “Yes, I do want to go to <CFLunch/>”.

Considering all I do with my adobe groups account is RSVP for these & considering I only sign up for them on *my* computer… Does adobe really need to go to this annoying extent to chase me away?

Yay for greasemonkey.

I found a dreadfully simple greasemonkey script to do the trick, but it wouldn’t really handle a range of forms and didn’t have any validation checks (does the form really exist? does that form element really let you set an attribute?).

The way greasemonkey for firefox is set up it only works on the sites you specify anyways… So if you do want it on certain other sites (like your banking site), don’t add the URL to the list…

Please note that this will go through all forms on the given page & check to see if either the form or any of the form elements have the autocomplete attribute set - if so it should turn the attribute back on.

The name I gave this was Enable Login Forms.

The namespace http://blog.whitelionsoft.com/.

And currently the only page to include this script on is https://www.adobe.com/cfusion/entitlement/index.cfm?e=ca&returnUrl=http://groups.adobe.com/groups/4b06154553/summary.


for ( var i in document.forms ) {
	var frm = document.forms[i];
	if ( frm.autocomplete && frm.setAttribute ) {
		frm.setAttribute( 'autocomplete', 'on' );
	}
	for ( var j in frm.elements ) {
		var ele = frm.elements[j];
		if ( ele.autocomplete && ele.setAttribute ) {
			ele.setAttribute( 'autocomplete', 'on' );
		}
	}
}
  • Share/Save/Bookmark

One of these things is not like the other…

Tuesday, April 3rd, 2007

Welcome to another edition of “What can go wrong in web design”… or “My Little Opera Rant”.

I dislike table layouts… I’ve said that before right? I didn’t set up the initial page layout on this current project I’m on… I’ve been trying to work around the table design until I can get around to fixing it with something that will work across the board… Somebody designed a great tab system that utilizes nested divs, javascript, & css that displays only certain information at a time - hiding & showing portions of the page depending upon which tab is clicked therefore limiting the scrolling on the page… & it works great… most of the time.

Today I’ve been working on a page that requires both the left column to show up & uses the tab system. Currently I only have information for the form that appears on the first tab so the next 2 tabs simply have a short dummy set. According to “The Style Guide”, the left column (the menu) is supposed to be 130px wide which it is… at least as long as the initial tab is selected. As soon as I click the 2nd or 3rd tabs *in Opera* & only on this particular page so far does it decide that the “width: 130px !important” rule on the left column no longer applies.

The left column suddenly snaps to 222px wide… WTH? The weird thing is this only happens in Opera. I tested Firefox, IE, Opera, & Swift. Oddly enough - Firefox, IE, & Swift all have the same behaviour - the left column stays at 130px no matter which tab I click on… Grrr… WTH is up with Opera?

Initial build I tried this on was Opera v 9.10 build 8679 for WinXP. It’s been bugging me about there being a new version available so I figured I’d download it & see if it fixed this issue… Hmm… now I have Opera v 9.00 build 8502 for WinXP… Does Opera go backwards in it’s build numbers?? Out of curiousity I start typing “opera.com” into opera to see if opera had a url for new downloads - sure enough, browser history had “http://www.opera.com/download/” so I headed there & it says Opera 9.10 is the newest version - um, shouldn’t this say the same as the front page?? So I clicked the download button, install this “new” version of Opera, go to Help->About Opera & guess what version I have! Opera v 9.10 build 8679 for WinXP…. *sigh*

Oh well… I did discover that Opera has a new preview release - 9.20b.

  • Share/Save/Bookmark

A Bug in Firefox???

Friday, March 30th, 2007

As great as Firefox is for web development, it still has it’s quirks (just like every other browser). Granted, the few I’ve run into are nowhere near as bad as IE’s quirks, bugs, & bad implimentations. This latest project is proving quite interesting…

My preference for development is to develop in Firefox & then check it in IE - just to make sure it’s still at least readable.

IE is probably the worste thing to do backup testing in, but generally if something is developed in Firefox or Opera (probably even Safari, but I still don’t have a Mac) it will work on the other 99% standards compliant browsers. IE definately has issues, but in trying to make a cross-platform world readable interface one must test in IE… even if it’s simply to make sure stuff is readable & all the elegance & special features are missing.

Anyways, back to my Firefox ‘bug’. I’ve been putting together a table based search preferences page. I hate using tables for this sort of thing, but until IE 5.5 (requirements for this web app) starts implimenting CSS3 I’m kinda stuck with tables to force a specific location on things. So developing this in Firefox wasn’t an issue… The table headers (<th>) were aligned left & everything else worked fine. So I loaded up IE to check & make sure everything looked ok there & the <th>’s were center aligned… hmm…

Ok, standard rendering of a <th> is center aligned… It’s been this way since who knows when. Otoh I do have some CSS somewhere in my style sheets that defines certain <th> characteristics so I figured that’s why the <th>’s had been left aligned. Considering I’m using a bunch of IE hacks to fix certain things (& unfix other things) I thought that I (or somebody else) might have have disabled the left alignment of table headers in IE. Bzzt! wrong answer :(

I really wasn’t even getting around to trying to ‘debug’ this table header issue when I loaded it in Opera, I just wanted to make sure the page looked ok. That’s when I noticed that the <th>’s were centered there as well… whoops! That means my previously defined CSS probably has nothing to do with setting these particular <th>’s.

Going back to Firefox I pop open Firebug, hit [Inspect], click on a <th> & scroll through the CSS pane to see if there’s a bit of CSS stating text-align: left; that Firefox is picking up, but not Opera. Hmm…. There’s absolutely no CSS stating any kind of text-align property for this <th>.

Is this a bug in Firefox ???? I couldn’t believe it! So I decided to check the W3C specifications just to make sure… Here’s what the specs at http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#edef-TH -

Table cells may contain two types of information: header information and data. This distinction enables user agents to render header and data cells distinctly, even in the absence of style sheets. For example, visual user agents may present header cell text with a bold font. Speech synthesizers may render header information with a distinct voice inflection.

Well that doesn’t say anything about horizontal alignment… Let’s see if there’s anything else?

The TH element defines a cell that contains header information. User agents have two pieces of header information available: the contents of the TH element and the value of the abbr attribute.

Ok, that’s more to do with attaching the <th> to the td (somewhat similar to attaching <label>s to <input>s).

The specific issue I was having was in regards to a <th> inside of a <tbody>. I still need to run some more tests, but I think Firefox centers a <th> inside of a <thead> as well as a simply stacked <table> <tr> <th>.

Conclusion: W3C docs do not specify any horizontal positioning for table headers.

For consistent behaviour it’s probably best to force settings you want where you really want them… even if those are the typical defaults… You never know when a browser is going to change how it handles defaults of elements.

  • Share/Save/Bookmark

addEventListener/attachEvent & Function References

Wednesday, September 13th, 2006

Craig Fowler stumped me today until he provided a further sampling of his code. Shortly thereafter I realized what the issue was as I’ve run into the same issue in the past (& hopefully this page will prevent me being stumped in the future).

The code he initially presented me with was

<a onclick="obj1.doSomething();"> ...

and he stated he was having issues with using this.someMethod(); inside of obj1… i.e.

var obj1 = new function() {
    this.name = 'Object 1';
 
    this.doSomething = function() {
        this.someMethod(
            'Hello, my name is ' + this.name
        );
    };
 
    this.someMethod = function( text ) {
        alert( text );
    }
};

Granted, you really wouldn’t write code this bad, but we’re just whipping up a quick example to test the problem.

well, putting <a href="#" onclick="obj1.doSomething();"> works just fine… At which point Craig mentioned that that was the end result he was wanting… what he was using to attach it was this snippet from a function -

if(eventElement.addEventListener)
{
    eventElement.addEventListener("click",       subscribers[currentSubscription].shout, false)
}
else if(eventElement.attachEvent)
{
    eventElement.attachEvent(”onclick”,       subscribers[currentSubscription].shout)
}

I had to laugh as soon as I saw it because I remembered doing the same thing. Javascript variables are not really variables… what you create with var a = 1 + 1; is a reference to a protected variable inside the Javascript engine. There are alot of detailed discussions about this elsewhere so I won’t go that route.

Initially looking at the code you may think that the function you’re giving to addEventListener/attachEvent is going to be the code that goes inside the onclick event… i.e.

element.onclick = function() {
    passedFunction();
}

But in reality what is happening is this -

element.onclick = passedFunction;

I don’t know of any good solutions. The solution I had come up with before was to write a proxy function. Craig did the same thing in writing a proxy method into the parent class. A proxy function would be something like the following -

function proxyFunction( evt ) {
    evt = evt || window.event;
    ...code to determine what function *really* needs to be called...
    if ( realFunction ) {
        realFunction();
    }
}

  • Share/Save/Bookmark

Firefox Inline Autocomplete

Sunday, August 20th, 2006

I switched to Firefox several years ago after having used the Mozilla suite. Considering I’m lazy & that’s why I like computers… I like having the inline autocomplete turned on so I don’t have to type very much of a URL I’ve previously been to. I keep forgetting that Firefox doesn’t yet have this built in as an easy option because I tend to set it & forget.

One of my parents’ computers died last weekend, specifically the one in the family room facing the TV. To provide a temporary replacement we brought the computer from upstairs to the family room. I use that computer from time to time when nobody else is around & I feel like getting some work done & that’s what I was doing today.

I typed “go” hoping to get “google.com/….” to pop up in the URL bar so I could simply press [enter] & I’d be done. Unfortunately nothing else came up in the URL bar, however there was alot of google URLs in the history list. Ok, now what exactly was that particular option called again? I ended up typing out “google.com” & when it came up I ran a search for “firefox autocomlpete”.

  • Frequently Asked Questions
  • Textbox (Firefox Auto Complete)
  • Delete Firefox auto-complete entries - Lifehacker
  • Disabling autocomplete - Firefox - MozillaZine Knowledge Base
  • Firefox’s autocomplete - how to edit the stored data - A Forum …
  • Firefox autocomplete

899,000 results for firefox autocomplete. The first page has absolutely nothing in regards to the URL bar (or location bar in javascript). All of it is about autocompleting form values. You know, like please enter your name, email address, blah, blah, blah… None of this is what I’m looking for & this should be easy… shouldn’t it? I am lazy after all & this is a great browser feature for being lazy!

Ok, so I add another bit to my google search & “firefox url autocomplete” turns up 403,000 for firefox url autocomplete. None of the links on this page can get me directly there, but there is a link to MozillaZine. Using the “search mozillazine by google” I search for “autocomplete” & t’dah! Third item listed is what I’m looking for - Inline autocomplete - MozillaZine Knowledge Base.

The info I’m listing here is repeated so I don’t have to do this blasted searching… yet again. Considering how many times I’ve done this before, all I needed was the browser.urlbar.autoFill portion :)

  1. Type about:config in the Location Bar
  2. Right-click on the page and create a new boolean value
  3. Type browser.urlbar.autoFill
  4. Set the value to true
  • Share/Save/Bookmark