Finally. An IE6 and Firefox IronSudoku autofill script.
After wondering for some time why on earth the IronSudoku autofill scripts would not run under Internet Explorer 6, but were fine in Firefox and IE7, the cause and a solution present themselves at long last.
IE6 Limits
The problem is that IE6 limits the length of bookmarklets to 508 bytes (In IE6 Service Pack 2, the limit is decreased to 488 bytes.) This is peculiar for a couple reasons. IE5.5 and IE7 both support bookmarklets exceeding 2000 bytes, as does Firefox. Since the autofill scripts exceed the IE6 limits, they do not run properly.
An IE6 Solution
The solution is to load an offsite Javascript file from the bookmarklet, inject it into the DOM, then execute functions contained within the loaded script, such as autofill functions. It easily weighs in at less than 200 bytes and the offsite script can support additional functionality.
Just copy the bookmarklet below into the IE6 address field and hit enter. Optionally, change the grautofill() (in bold below) as needed to gautofill() for a green-only autofill or clearnotes() to clear the little numbers.
javascript: void((function() { if(window) { var js=document.createElement("SCRIPT"); js.src="http://www.brittlefish.com/code/isie.js"; document.getElementsByTagName("HEAD")[0].appendChild(js); setTimeout(fn=function() { try { grautofill(); } catch(e) { setTimeout( "fn()", 10 ); } } , 1 ); } } )())
Update: (2007-03-15) Modified the bookmarklet code above to execute the autofill function after a half-second, giving the browser time to settle down after injecting the script object.
Update: (2007-03-17) Modified the bookmarklet code again, for safety. Also works in Firefox.
Notes
- If you get an object expected error, just run it again. Should not happen, but if it does running again usually works.
- Depending on your security settings, you might have to tell IE6 to allow scripts from brittlefish.com.
Functions
grautofill() - this runs the G+r autofill script that is a normal autofill but it uses red numbers for situations where a number can appear either one or two places in the 3×3 block.
gautofill() - this runs the standard Green autofill script.
clearnotes() - this clears the little green and red numbers (but not the solved squares).
rowhint() - this script asks for a row number, then shows a popup with the solution values for that row.
Tags: Free · Online games · Puzzles · Tips

4 responses so far ↓
1 Make IronSudoku Javascript Magic » Brittlefish // Mar 14, 2007 at 8:52 pm
… (3/14/2007) IE6 problems solved. Update: (2/15/2007) Added a note about cheating to the end of the …
2 Twin C // Mar 27, 2007 at 2:19 pm
AWESOME! Thank you! Works like a charm!
3 Play Boggle Online » Brittlefish // May 20, 2007 at 9:21 am
… IronSudoku IE6 Autofill Solved. Read Make IronSudoku Javascript Magic. Read Sudoku …
4 mrooijer // Feb 6, 2008 at 11:44 am
It also works in safari 3.0.4!
Leave a Comment