Skip to content

Instantly share code, notes, and snippets.

@jsantell
Created May 14, 2013 17:56
Show Gist options
  • Save jsantell/5578037 to your computer and use it in GitHub Desktop.
Save jsantell/5578037 to your computer and use it in GitHub Desktop.
let { events } = require('sdk/content/events');
let { on, emit, off, setListeners } = require('sdk/event/core');
let { filter, pipe, map } = require('sdk/event/utils');
let { create } = require('sdk/frame/utils');
let { window } = require('sdk/addon/window');
let view = create(window.document, {
nodeName: 'iframe',
type: 'content',
uri: 'http://mozilla.org',
allowJavascript: true,
allowPlugins: true,
allowAuth: true
});
let readyEvents = filter(events, function ({type}) {
return ~['DOMContentLoaded', 'load', 'document-element-inserted'].indexOf(type);
});
on(readyEvents, 'data', function({type, target, data}) {
console.log('type: ', type, 'target: ', target, 'data: ', data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment