GWT devmode bookmarklet

I've been doing a lot of GWT work, and I find the Development Mode to be particularly productive. Unfortunately I frequently seem to lose the "?gwt.codesvr=127.0.0.1:9997" URL suffix that makes dev mode work.

My buddy Jeremy came up with a simple fix: a bookmarklet that adds the URL suffix to the current URL. Drag this bookmarklet to your GWT-devmode-enabled browser's toolbar:

devmode

Next time your devmode isn't working, just click the bookmarklet!

5 comments:

Jeremy said...

Next step, write a browser extension that automatically adorns any relative links on the page with the "?gwt.codesrc..." when it sees that you're already using it. ;)

Jeremy said...

Quickie greasemonkey script so localhost on port 8888 always has the trailer:

// ==UserScript==
// @name Automatic devmode
// @namespace jsharpe
// @description Automatically adds devmode trailer
// @include http://localhost:8888/*
// @include http://127.0.0.1:8888/*
// ==/UserScript==

var is_in_iframe = function() {
return (window.location != window.parent.location);
}

var enable_devmode =
function() {
if (!is_in_iframe() && window.location.href.indexOf("?gwt.codesvr=127.0.0.1:9997") == -1) {
window.location.replace(window.location + "?gwt.codesvr=127.0.0.1:9997");
}
};

enable_devmode();

Andres N. Kievsky said...

How do you put up with the slow code-compile-run-debug cycle GWT gives you? It was a total deal breaker for me, I ended up coding the same thing in Javascript - and it took me a fraction of the time...

swankjesse said...

@Andres: with GWT's dev mode, the edit-run-debug cycle is very fast. Have you tried it lately?

Andres N. Kievsky said...

@Andres: with GWT's dev mode, the edit-run-debug cycle is very fast. Have you tried it lately?

Thanks for that information! I haven't tried it in about 18 months.