Month: May 2011

Enable the Debug Menu in Safari

I find the new debugging tools in Safari almost as useful as Firebug. There’s a Web Inspector that lets you see exactly how the HTML is formed, a Javascript console that lets you see errors and debugging messages written into the code and much more.

But to use them you must enable the Debug menu in Safari. Open Safari preferences in the Safari Menu, click Advanced, and select Show Develop menu in menu bar.

Continue reading

How to override the !important CSS style attribute using Javascript

I’ve worked on a few projects where a CSS style on some page element has been specified as “!important” and it interferes with the way the page functions. Ordinarily, I would just change the original style, but sometimes I don’t have control over the stylesheet or script that is generating the style. One example is a recent project where an embedded Captivate player is written to a custom HTML wrapper at by the javascript SWFObject.js. SWFObject writes style attributes to the page dynamically to hide the Captivate player as required until it is fully loaded:

object, embed {
              visibility:hidden !important;
}
Continue reading