KartikTalwar/gmail.js — pull request #118 by brentkelly (2014-12-10 03:25:33+00:00)
Title: Support for custom DOM observers, bugfix for view_thread in certain scenarios, docs

Firstly, fixed the bug where `view_thread` doesn't fire in certain Gmail configurations thanks to a recent Gmail tweak. (#115, #116)

Also added the ability to register custom observers to meet an applications specific needs. Over time people will want to interact with the DOM in all sorts of different ways. Ideally I'm not sure we want to have to support everything anyone might want to do in the core Gmail.js as this could have some major implications for maintenance? One point of view is add them all in and maintain centrally, but this could lead to major code bloat, and a huge amount of functionality that is used 1% of the time but needs to be maintained 100% of the time. So my thinking instead has been to add the ability to tie your own DOM observers into the existing observers by registering them with the new api.observe.register method.

I've added an example into the docs how this can fix #113.

The commit is unfortunately a bit confusing as I have moved the predefined DOM observer config into a separate method to improve code readability (changes the indentation & thus every line)