Glider
"In het verleden behaalde resultaten bieden geen garanties voor de toekomst"

Current filter: »Firefox« (Click tag to remove it or click and/or to switch it.)

About this blog

These are the ramblings of Matthijs Kooijman, concerning the software he hacks on, hobbies he has and occasionally his personal life.

Most content on this site is licensed under the WTFPL, version 2 (details).

October
Sun Mon Tue Wed Thu Fri Sat
     
23 24 25
26 27 28 29 30 31  
Powered by Blosxom &Perl onion
(With plugins: config, extensionless, hide, tagging, Markdown, macros, breadcrumbs, calendar, directorybrowse, entries_index, feedback, flavourdir, include, interpolate_fancy, listplugins, menu, pagetype, preview, seemore, storynum, storytitle, writeback_recent, moreentries)
Valid XHTML 1.0 Strict & CSS
XDebug javascript snippet for Firefox (and whitespace fix for vim)

I've been toying around with XDebug this week, which allows me to debug php scripts interactively, by setting breakpoints, watching variables and stepping through the code from within Vim (it's a bit rudimentary, but it works). Marijn tipped me about this and I used his useful howto to set it up.

I'm still battling with python and vim to properly support spaces in filenames, I'll post my solution once I found it (I found it, see below). If you want to toy around with XDebug and Vim, you should definately check out this comment about other (non-space) special characters in urls.

Anyway, I started out this post because I made something pretty and wanted to share it. To use the XDebug extension, you need to pass XDEBUG_SESSION_START=id with the request you want to debug. Because I kept forgetting how this parameter was called exactly and because it is annoying to insert it at the end of some long url, especially when the url also uses # to jump to an anchor, I created a nifty bookmark.

Screenshot

var loc, tmp, anchor, url, args;

tmp = document.location.href.split('#');
if(tmp[1]) 
    anchor = "#" + tmp[1];
else 
    anchor = "";
tmp = tmp[0].split('?');
url = tmp[0];
if (tmp[1]) 
    args = "?" + tmp[1] + "&";
else 
    args = "?";
args += "XDEBUG_SESSION_START=id";
document.location.href = url + args + anchor;

This script splits the current location in url, args and anchors, adds the argument, and puts the location back together. Simple as that. You can create a bookmark from this script by right-clicking this link and pick "Bookmark this link..." or whatever your browser calls it. You can also use the link to test the script (watch the address bar).

I've tested this script on Firefox, but it should work on most browsers, for it doesn't do anything really complex.

Update: I've managed to convince the XDebug vim script to handle spaces in filenames properly. I've put up a fixed version and a diff with the fixes. Both include the above mentioned special characters fix.

 
0 comments -:- permalink -:- 16:21
Firefox extension Mozex: Vim in my firefox!

While I was editing some wiki pages just now, I kept being annoyed by the stupid little poor-excuse-for-an-editor text-area in Firefox. But using my favourite editor, vim, would mean copypasting all the text into vim and back again, which is rather clumsy since vim runs in an xterm.

At these moments, you suddenly realise that you cannot be the only one that is being annoyed by something like this. A quick search for "vim" at the Firefox extensions page gives no useful results, though. Searching a little further, I come across Mozex, an extension that supports not only editing textareas in an external program, but also intersepts mailto links, ssh links, news links, etc.

So, whenever I wanna edit something in vim now, I just press Meta+V and get my trusty editor in an xterm :-D

 
1 comment -:- permalink -:- 22:32
Copyright by Matthijs Kooijman