Bug 800905 - Load script in to every new tab. r=davidb

This commit is contained in:
Eitan Isaacson 2012-10-16 11:07:16 -07:00
Родитель 40f937b977
Коммит 1578e3ed94
1 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -99,6 +99,7 @@ var AccessFu = {
Services.obs.addObserver(this, 'Accessibility:NextObject', false);
Services.obs.addObserver(this, 'Accessibility:PreviousObject', false);
Services.obs.addObserver(this, 'Accessibility:CurrentObject', false);
this.chromeWin.addEventListener('TabOpen', this);
},
/**
@ -118,6 +119,8 @@ var AccessFu = {
Input.detach();
this.chromeWin.removeEventListener('TabOpen', this);
Services.obs.removeObserver(this, 'remote-browser-frame-shown');
Services.obs.removeObserver(this, 'Accessibility:NextObject');
Services.obs.removeObserver(this, 'Accessibility:PreviousObject');
@ -205,10 +208,20 @@ var AccessFu = {
},
handleEvent: function handleEvent(aEvent) {
if (aEvent.type == 'mozContentEvent' &&
aEvent.detail.type == 'accessibility-screenreader') {
this._systemPref = aEvent.detail.enabled;
this._enableOrDisable();
switch (aEvent.type) {
case 'mozContentEvent':
{
if (aEvent.detail.type == 'accessibility-screenreader') {
this._systemPref = aEvent.detail.enabled;
this._enableOrDisable();
}
break;
}
case 'TabOpen':
{
this._loadFrameScript(Utils.getMessageManager(aEvent.target));
break;
}
}
},