Skip to content

Commit

Permalink
Closes #198 - Switch from removed 'sdk/deprecated/observer-service' to
Browse files Browse the repository at this point in the history
'sdk/system/events' to fix missing module error.

(cherry picked from commit 49b2a5332454bf04a272250872dff5fce1b427ad)
  • Loading branch information
supahgreg committed Jan 26, 2014
1 parent 77d53ec commit 015aaa4
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions extension/modules/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lazyUtil(this, "windowEventTracker");
lazyUtil(this, "windowUnloader");

const { Class } = jetpack('sdk/core/heritage');
const { add } = jetpack('sdk/deprecated/observer-service');
const { on } = jetpack('sdk/system/events');
const { getInnerId } = jetpack('sdk/window/utils');

const windowsTracked = Object.create(null);
Expand All @@ -26,19 +26,17 @@ const Scriptish_manager = Class({
initialize: function() {
const self = this;

add("document-element-inserted", function(aDocument) {
let win = aDocument.defaultView;
if (!win) {
return;
}
self.docReady_start(win);
});
on("document-element-inserted", function(aEvent) {
let win = aEvent.subject.defaultView;
if (!win) return;
self.docReady_start.call(self, {subject: win});
}, true);

add("content-document-global-created", self.docReady_start.bind(self));
add("chrome-document-global-created", self.docReady_start.bind(self));
on("content-document-global-created", self.docReady_start.bind(self), true);
on("chrome-document-global-created", self.docReady_start.bind(self), true);
},

docReady_start: function(safeWin) {
docReady_start: function({subject: safeWin}) {
// TODO: disable observer that calls this when Scriptish is disabled
if (!Scriptish.enabled)
return;
Expand Down

0 comments on commit 015aaa4

Please sign in to comment.