Archive for the ‘firefox’ Category

SecureCode FAIL?

Wednesday, November 12th, 2008

SecureCode® is a program by MasterCard to have another (useless?) number you type in to use your credit card with certain merchants. You may remember when the CVV2 code was the NEW BIG THING that people asked for to make sure you were really the person using the card. (IMHO, each of these is perfectly useless once that bit of information is stolen. It’s an arms race where card ‘acceptors’ keep looking for a new bit of info to ask for, and thieves keep stealing it).

Yesterday, while making a purchase, I was asked for my SecureCode® for a particular credit card. I don’t remember it off the top of my head, and it’s not stored in my normal encrypted file of passwords. On top of that, I use No Script, which can make some JavaScript interactions tricky the first time you do them. You have to choose what domains to allow to run script.

With all that, I couldn’t get the purchase to go through at first because I didn’t have my SecureCode® card number. So I tried to get it from the issuing bank website, and got caught in a round robin of being sent to the mastercard site, my bank, and the merchant site. But somehow, with the various enabling and disabling of scripts, I WAS ABLE TO BUY THE PRODUCT WITHOUT EVER ENTERING THE SECURECODE®. I don’t know how much of a security failure this is, if at all, but it makes me think that SecureCode® is just another useless step that annoys me, and makes sure I won’t buy from that merchant again.

Firebug Video Notes and Timestamps

Tuesday, February 26th, 2008

Joe Hewitt is the author of Firebug, the single greatest web development debugging tool ever created. You can watch a video of the talk he gave to Yahoo on the 1.0 release. It’s about a year old, but if you are not familiar with Firebug, it’s a nice overview. I listened to it and tried to note some timestamps of the topics to make them easier to find. These are from the .mp4 video that you can download, so there’s a chance they don’t match up exactly with the Flash version.

2:15 DOM elements are highlighted in yellow as they change

4:30 Javascript profiler overview

5:00 In the Javascript profiler, time is time spent INSIDE function including other calls. Own Time is spent in the individual statements that don’t recurse.

6:35 You can insert calls in code that limit parts of code measured by profiler. Insert console.profile(’something’), then console.profileEnd(’something’). Let’s you see specific code measurements

8:35 View when a function was called and what was passed. In Script tab, right click and ‘log calls’

10:20 Can log events that are sent to elements. Inspect an element, right click, choose ‘log events’. Will give you a list of EVERY event. Can type in quick search box and it will filter by the name of the event.

11:45 You can click events and see DOM properties of the event.

12:10 Firebug created to monitor XML-HTTP Requests (XHR). In the console you can view full requests - body, response headers, parameters, etc in Firebug.

13:20 Console only shows XHR. Net tab shows ALL traffic. Also see requests that aren’t XHR and see a timeline of those requests and delivery.

14:45 NET tab lets you filter by file type with buttons across the top.

16:00 NET tab shows time to GET the file, not render it.

16:25 CSS. You can edit just about anything by clicking and editing.

17:15 Click the element and choose edit tab. Can edit innerHTML and outerHTML. ESC will revert the code to the original. Can copy and paste back to your text editor.

18:20 You can directly edit a value. Can use arrow keys to edit numeric values up and down once clicked. Also use pageup/pagedown for larger changes to those values.

20:00 Use ‘not’ sign to toggle properties in the CSS right hand pane. Lines that are struck out shows property is overridden.

21:05 The layout tab shows the box model. ruler shows on page.

22:45 Can click the values in layout tab and use arrows/pageup/pagedown trick to change amounts again. ESC cancels.

23:10 Computed style shows all CSS properties

24:30 Inspect images and a src attribute hover will show the image and height/width. Same with colors - shows the colors the code represents.

25:30 If you want to see actual style sheet, the name on the right of the style panel is a hyperlink. You can click and see it. Either edit to click or edit button will let you change entire file.

27:00 JS debugging. Breakpoints - stop script execution at a particular line. Red dot - breakpoint.The Watch tab shows local variables. hover over variables and it will show values in left side.

28:45 Watch expressions - type it in or select item in code and right click ‘add watch’. mini command line with autocomplete. Tab cycles through attributes with tab if nothing tabbed. ESC goes back to previous dot.

30:50 Conditional breakpoints - break only when a js expression is true/false.

32:15 Step over, step into, step out. line by line. Right click menu or middle click will do a ‘run to line’, or ctrl-click the line to run to. (For definitions of step over/into/out, see http://www.mozilla.org/rhino/debugger.html.

33:20 F10, F11 shortcuts from MS Visual Studio debugger

33:40 To jump to a line #, use the search box and type #linenumber

34:10 To search plain text in the firebug panel, Ctrl-shift-k, enter goes to next.

35:10 Can jump to specific files in js tab. Grouped by subirectory, just type and it will filter. Quicksilver users - hit Cmd/Ctrl-shft-space opens that list.

36:15 DOM tab shows window properties. Separates built in vars from one you define. Bolded items are ones you added. Clicking functions moves you to the source

37:30 Command line can expand to a box. You can paste into command line. Ctrl-enter runs the code. Bookmarklets - can use copy to crunch it all together.

39:00 Console log feature. console.log(obj) gives you a log of link to object. console.dir gives you properties that are LIVE

41:30 Console.trace shows who called and functions

43:00 Can doubleclick properties to edit

44:25 ctrl-shift-c should activate the ‘inspect’ feature, although the Web Developer Toolbar may already use this shortcut.

45:00 Can extend firefox to add own tabs

47:00 firebug lite - console logging for other browsers.

How to blow up Firebug 1.5 inside Firefox 2.0.3

Wednesday, May 30th, 2007

Add the following into the page in the style section:
div { margin: 1em; border: solid 1px #ccc; }

Screenshots below.

Screen 1 - using the inspector to look at an element. See how the blue bars now have a border? And it’s off the element?
Firebug 1 - using the inspector

Screen 2 - the margin is applied to every div in the layout display, and so is the border.
Firebug 2 - showing the layout

Firefox and textareas

Friday, April 6th, 2007

Don’t know why I had never noticed this before, but there are serious differences between how FF and other browsers handle textareas.

  1. Whatever number of rows you specify, FF generates one more, seemingly to save space for the horizontal scrollbar - see https://bugzilla.mozilla.org/show_bug.cgi?id=33654
  2. IE automatically wraps the text around when you exceed the number of columns, but FF adds the scrollbar to scroll horizontally.
  3. IE gives a vertical scrollbar (due to the wrapping) but FF never gives one.

Don’t know for sure what behavior is correct, but it’s awfully strange. Currently trying the following to make it display correctly:

<textarea class="_2row" rows="2" cols="20"></textarea>
textarea._2row { height: 2.5em; }

Firefox trick

Friday, January 19th, 2007

If you have multiple tabs open in Firefox, you can navigate to them with Ctrl-1, Ctrl-2, etc. On OS X, use the command key instead of control.