From 12390f7052440d25061583935a7a6a44e6819cf0 Mon Sep 17 00:00:00 2001 From: Ilana Segall Date: Tue, 23 Apr 2013 12:50:28 -0700 Subject: [PATCH] split out window events into window/tab and chrome --- lib/chrome-events.js | 2 ++ lib/main.js | 4 +++- lib/window-tab-events.js | 51 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 lib/chrome-events.js create mode 100644 lib/window-tab-events.js diff --git a/lib/chrome-events.js b/lib/chrome-events.js new file mode 100644 index 0000000..18cbb1c --- /dev/null +++ b/lib/chrome-events.js @@ -0,0 +1,2 @@ +"use strict"; +//chrome events \ No newline at end of file diff --git a/lib/main.js b/lib/main.js index bda453c..736fc25 100644 --- a/lib/main.js +++ b/lib/main.js @@ -14,8 +14,10 @@ let study; // useful to have it in main scope let {instrumentOptions} = require("instrument-options"); //include scripts that will emit heatmap messages +//runs by side-effect require("global-state-events"); -require("window-events"); +require("window-tab-events"); +require("chrome-events"); require("in-content-events"); //normally add search events, but ignore for st diff --git a/lib/window-tab-events.js b/lib/window-tab-events.js new file mode 100644 index 0000000..c80617d --- /dev/null +++ b/lib/window-tab-events.js @@ -0,0 +1,51 @@ +"use strict"; + +//open/activate +//chrome events; event handlers +//in content? + +const {emit} = require("./utils"); + +var newWinFun = { + onTrack: function (window) { + emit("Tracking a window: " + window.location, + ", " + window.id); + }, + onUntrack: function (window) { + emit("Untracking a window: " + window.location); + } +}; + +var tabs = require("sdk/tabs"); + +tabs.on('open', function onOpen(tab) { + emit("Tab opened: " + tab.id) +}); +//all tabs events + +//note actions that are being pushed directly + + + +let chromeEvents = function(){ + +} + +let windowEventTracker = function(){ + var winUtils = require("window-utils"); + var tracker = new winUtils.WindowTracker(newWinFun); +}(); + +let tabEventTracker = function(){ + + +}(); + +//isbrowser()? --> jetpack + + +//pump out onto a channel and recording into instrument options +//require unload; remove contextMenuTracker etc + + + +//window vs chrome \ No newline at end of file