servo/components/script_bindings/webidls/ServoInternals.webidl
Josh Matthews 6565d982bd
servoshell: Support runtime preference manipulation (#38159)
These changes add a custom servo:preferences URL that allows modifying
selected preferences at runtime. The goal of this work is to make it
easy to test pages while toggling experimental web platform features,
and support quickly changing the User-Agent header.

Testing: Manually verified that spacex.com loads correctly after
changing the user agent, and that https://polygon.io/ displays grid
elements correctly and no console errors with the experimental prefs
enabled.
Fixes: #35862

<img width="1136" height="880" alt="Screenshot 2025-07-18 at 1 06 23 AM"
src="https://github.com/user-attachments/assets/2d27c321-6ca0-43c3-a347-7bc4b55272df"
/>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-30 16:51:58 +00:00

26 lines
1,013 B
Text

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// Private interfaces that are only used for internal Servo usage
// like about: pages.
// This interface is entirely internal to Servo, and should not be accessible to
// web pages.
[Exposed=Window,
Func="ServoInternals::is_servo_internal"]
interface ServoInternals {
Promise<object> reportMemory();
[Throws] USVString getStringPreference(USVString name);
[Throws] long long getIntPreference(USVString name);
[Throws] boolean getBoolPreference(USVString name);
undefined setStringPreference(USVString name, USVString value);
undefined setIntPreference(USVString name, long long value);
undefined setBoolPreference(USVString name, boolean value);
};
partial interface Navigator {
[Func="ServoInternals::is_servo_internal"]
readonly attribute ServoInternals servo;
};