diff --git a/toolkit/components/extensions/parent/ext-browserSettings.js b/toolkit/components/extensions/parent/ext-browserSettings.js index 30a2c35b687e..4387fdfb2990 100644 --- a/toolkit/components/extensions/parent/ext-browserSettings.js +++ b/toolkit/components/extensions/parent/ext-browserSettings.js @@ -86,6 +86,18 @@ ExtensionPreferencesManager.addSetting("colorManagement.useNativeSRGB", { }, }); +ExtensionPreferencesManager.addSetting( + "colorManagement.useWebRenderCompositor", + { + permission: "browserSettings", + prefNames: ["gfx.webrender.compositor"], + + setCallback(value) { + return { [this.prefNames[0]]: value }; + }, + } +); + ExtensionPreferencesManager.addSetting("contextMenuShowEvent", { permission: "browserSettings", prefNames: ["ui.context_menus.after_mouseup"], @@ -488,6 +500,13 @@ this.browserSettings = class extends ExtensionAPI { ); }, }), + useWebRenderCompositor: getSettingsAPI({ + context, + name: "colorManagement.useWebRenderCompositor", + callback() { + return Services.prefs.getBoolPref("gfx.webrender.compositor"); + }, + }), }, }, }; diff --git a/toolkit/components/extensions/schemas/browser_settings.json b/toolkit/components/extensions/schemas/browser_settings.json index a773826b50f8..a5eff60aeecf 100644 --- a/toolkit/components/extensions/schemas/browser_settings.json +++ b/toolkit/components/extensions/schemas/browser_settings.json @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. + // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -127,6 +127,10 @@ "useNativeSRGB": { "$ref": "types.Setting", "description": "This boolean setting controls whether or not native sRGB color management is used." + }, + "useWebRenderCompositor": { + "$ref": "types.Setting", + "description": "This boolean setting controls whether or not the WebRender compositor is used." } } } diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js b/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js index e951e92d9ba8..cd7971a7d732 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js @@ -309,6 +309,13 @@ add_task(async function test_browser_settings() { "gfx.color_management.native_srgb": true, }); + await testSetting("colorManagement.useWebRenderCompositor", false, { + "gfx.webrender.compositor": false, + }); + await testSetting("colorManagement.useWebRenderCompositor", true, { + "gfx.webrender.compositor": true, + }); + await extension.unload(); await promiseShutdownManager(); });