.forEach(tab => {
 // Fake a newly created document
   let window = getTabContentWindow(tab);
   if (has(this.attachTo, "top"))
     this._onContent(window);
   if (has(this.attachTo, "frame"))
     getFrames(window).forEach(this._onContent);
 });
Exemplo n.º 2
0
	getEventWindow : function getEventWindow(window) {

		var _URL = Tabs.activeTab.url;

		if (window.document.URL === _URL)
			return window;

		const window_utils = require("sdk/window/utils");
		var frames = window_utils.getFrames(window);

		for (var i in frames) {
			if (frames[i].document.URL === _URL && frames[i].document.querySelector("[formtranslateid=true]"))
				return frames[i];
		}

		return null;
	},
Exemplo n.º 3
0
  makeEmptyBrowserWindow({ private: true }).then(function(window) {
    myPrivateWindowId = getInnerId(window);

    assert.ok(trackedWindowIds.indexOf(myPrivateWindowId) >= 0, 'private window was tracked');
    assert.equal(isPrivate(window), isWindowPBSupported, 'private window isPrivate');
    assert.equal(isWindowPrivate(window), isWindowPBSupported);
    assert.ok(getFrames(window).length > 1, 'there are frames for private window');
    assert.equal(getWindowTitle(window), window.document.title,
                 'getWindowTitle works');

    return close(window).then(function() {
      assert.pass('private window was closed');

      return makeEmptyBrowserWindow().then(function(window) {
        myNonPrivateWindowId = getInnerId(window);
        assert.notEqual(myPrivateWindowId, myNonPrivateWindowId, 'non private window was opened');
        return close(window);
      });
    });
  }).then(null, assert.fail);