зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1466640 - [1.1] Keep desktop mode observer function around for its removal. r=jchen
This commit is contained in:
Родитель
22b02b1134
Коммит
a20145e49c
|
@ -89,11 +89,13 @@ class GeckoViewSettings extends GeckoViewModule {
|
|||
return;
|
||||
}
|
||||
if (aUse) {
|
||||
Services.obs.addObserver(this.onUserAgentRequest.bind(this),
|
||||
this._userAgentObserver = this.onUserAgentRequest.bind(this);
|
||||
Services.obs.addObserver(this._userAgentObserver,
|
||||
"http-on-useragent-request");
|
||||
} else {
|
||||
Services.obs.removeObserver(this.onUserAgentRequest.bind(this),
|
||||
} else if (this._userAgentObserver) {
|
||||
Services.obs.removeObserver(this._userAgentObserver,
|
||||
"http-on-useragent-request");
|
||||
this._userAgentObserver = undefined;
|
||||
}
|
||||
this._useDesktopMode = aUse;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче