Embedding Gecko

Mark Finkle

Mozilla Corporation

Why Embed Gecko?

How do You Embed Gecko?

Embedding APIs

Problems with Embedding

Refactoring Embedding

Design Thoughts - Host/Gecko Interaction

Design Thoughts - Event Callbacks




void SomeFunc(nsIDOMEvent* aEvent) {...}

pHost->AddEventListener("element-id", "click", SomeFunc);
		

Design Thoughts - Inject C++ Objects

class MyObject : MagicBase {
public:
  void addData(string) {...}
};

MyObject* pObj = new MyObject;
pHost->AddObject("special", pObj);

//---------------------------------------

<input type="text" onblur="blurHandler(event);"/>

function blurHandler(aEvent) {
  window.special.addData(aEvent.target.value);
}
		

Frameworks Built on the New API

Roadmap

Resources

Questions?