зеркало из https://github.com/mozilla/gecko-dev.git
Bug 725215 - Add magic shortcut to enable debugging features [r=cjones]
This commit is contained in:
Родитель
1b15734142
Коммит
5247018d2f
|
@ -66,6 +66,8 @@ function addPermissions(urls) {
|
|||
var shell = {
|
||||
// FIXME/bug 678695: this should be a system setting
|
||||
preferredScreenBrightness: 1.0,
|
||||
|
||||
isDebug: false,
|
||||
|
||||
get contentBrowser() {
|
||||
delete this.contentBrowser;
|
||||
|
@ -145,6 +147,7 @@ var shell = {
|
|||
window.controllers.removeController(this);
|
||||
window.removeEventListener('keypress', this);
|
||||
window.removeEventListener('MozApplicationManifest', this);
|
||||
window.removeEventListener('AppCommand', this);
|
||||
},
|
||||
|
||||
supportsCommand: function shell_supportsCommand(cmd) {
|
||||
|
@ -172,6 +175,18 @@ var shell = {
|
|||
}
|
||||
},
|
||||
|
||||
toggleDebug: function shell_toggleDebug() {
|
||||
this.isDebug = !this.isDebug;
|
||||
|
||||
if (this.isDebug) {
|
||||
Services.prefs.setBoolPref("layers.acceleration.draw-fps", true);
|
||||
Services.prefs.setBoolPref("nglayout.debug.paint_flashing", true);
|
||||
} else {
|
||||
Services.prefs.setBoolPref("layers.acceleration.draw-fps", false);
|
||||
Services.prefs.setBoolPref("nglayout.debug.paint_flashing", false);
|
||||
}
|
||||
},
|
||||
|
||||
handleEvent: function shell_handleEvent(evt) {
|
||||
switch (evt.type) {
|
||||
case 'keypress':
|
||||
|
@ -199,6 +214,9 @@ var shell = {
|
|||
case 'Menu':
|
||||
this.sendEvent(content, 'menu');
|
||||
break;
|
||||
case 'Search':
|
||||
this.toggleDebug();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'load':
|
||||
|
|
Загрузка…
Ссылка в новой задаче