Hi all,
I'm just writing to let everyone know I got this working. I was initially
worried that Extesions/WebApps would not have access to the GWT DevMode
plugin, but since Flash is supported I realized that this should work.
It turns out there's just a few gotchas in making it work. The default
loader script of the IFrame linker computes an absolute url for
referencing the content source url. This happens to cause problems since the
base url of a chrome extension/webapp is "chrome-extension://<unique
hash>/..." and chrome rejects any absolute url that is not "http" or "https"
or "file" and provided in the manifest.
Luckily there is a meta override:
<meta name="baseUrl" content="/module/">
Which forces the injected IFrame source to become /module/hosted.html?module
The second issue was the temporary source URL assigned to the IFrame before
the content source is injected. It's initially set to "javascript:", which
violates the same constraint mentioned above. Patching the function
"maybeInjectFrame()" to assign "#" to iframe.src makes it all work.
My manifest.json looks like this:
{
"name": "GWT DevMode Host page",
"description": "Connect to GWT DevMode instance for Chrome Extension
development",
"version": "1",
"app": {
"launch": {
"local_path": "index.html?gwt.codesvr=127.0.0.1:9997"
}
},
...other stuff...
}
Perhaps this might be better addressed in a custom linker... I don't know
when I might have time to hack something together, but hopefully this info
helps others.
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors