Category Archives: liner

Build extension for Google Chrome with GWT

From time-to-time I’m coming back to do some coding to provide Chrome Extension with helping to translate and remember words.

From this repository now you can download the source code of the extension, however it is in the pre-pre-alpha state. But the main reason of this post is to tell about implemented abilities to write ContentScript using GWT.

Initial code of the GWT linker for Chrome Extension was pulled from SpeedTracer extension, after that I’ve provide some enhancements to support additional features.

  • GWT Linker for Chrome Extension was extracted into separate subproject;
  • ComponentGenerator was refactored and provided with initial pack of tests;
  • ExtensionScript artifact was added – which provides you abilities to define external JavaScript file to be injected into the BackgroundPage and loaded on extension initialization. This is useful for example when you are working with Google Language API or another required JavaScript library which you cannot include as a static content;
  • ContentScript now support all_frames attribute;
  • GwtContentScript artifact was introduced – which provides you abilities to implement ContentScript code with GWT and include it as a static ContentScript into your extension. Example of this you can find in my extension. But there is an issue – I’m not able to resolve path to extracted war to copy generated JavaScript file from GWTContentScript module into extension module, but there is workaround for this – you need to define own launcher (for Eclipse) to build extension. Example launcher can be downloaded here

That’s it for now, have a nice week.