devinrhode2/kiss-include — pull request #2 by jmileham (2012-12-19 20:08:41+00:00)
Title: Ssl redux

Alternative for Pull Request [#1]

So this is kind of an overhaul of the whole lib that I think does some nice things and has proven functional in my app. Using this version requires removal of any `kissInclude` calls from popups or content scripts. I could swap in a no-op kissInclude method for those to maintain backward compatability. Let me know what you think.

* no need to explicitly setup kiss-include at all from content scripts or popups -- just source JS code
* only configure KM behavior in one place - background.js
* only source KM-hosted javascript once - in background.js
* defaults to SSL for all KM events (using the onload technique you suggested instead of polling)
* suppresses the initial 'Visited Site' event when loading the background page by default
* respects existing KM_SKIP_VISITED_SITE value if it is set
* kissInclude takes an opts object as an optional second argument, supporting the following:
* `ssl: false` to override the default SSL behavior
* `skip_visited_site: false` to override suppressing the 'Visited Site' event
* still supports async style. kissInclude options can be provided in `window._kmOpts`
* allows renaming of the `event` helper if that conflicts with the developer's app.