Merge pull request #1902 from lightpanda-io/fix/emulation-set-user-agent-override

Fix/emulation set user agent override
This commit is contained in:
Karl Seguin
2026-03-18 20:05:26 +08:00
committed by GitHub

View File

@@ -17,6 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
const std = @import("std"); const std = @import("std");
const log = @import("../../log.zig");
pub fn processMessage(cmd: anytype) !void { pub fn processMessage(cmd: anytype) !void {
const action = std.meta.stringToEnum(enum { const action = std.meta.stringToEnum(enum {
@@ -24,6 +25,7 @@ pub fn processMessage(cmd: anytype) !void {
setFocusEmulationEnabled, setFocusEmulationEnabled,
setDeviceMetricsOverride, setDeviceMetricsOverride,
setTouchEmulationEnabled, setTouchEmulationEnabled,
setUserAgentOverride,
}, cmd.input.action) orelse return error.UnknownMethod; }, cmd.input.action) orelse return error.UnknownMethod;
switch (action) { switch (action) {
@@ -31,6 +33,7 @@ pub fn processMessage(cmd: anytype) !void {
.setFocusEmulationEnabled => return setFocusEmulationEnabled(cmd), .setFocusEmulationEnabled => return setFocusEmulationEnabled(cmd),
.setDeviceMetricsOverride => return setDeviceMetricsOverride(cmd), .setDeviceMetricsOverride => return setDeviceMetricsOverride(cmd),
.setTouchEmulationEnabled => return setTouchEmulationEnabled(cmd), .setTouchEmulationEnabled => return setTouchEmulationEnabled(cmd),
.setUserAgentOverride => return setUserAgentOverride(cmd),
} }
} }
@@ -64,3 +67,8 @@ fn setDeviceMetricsOverride(cmd: anytype) !void {
fn setTouchEmulationEnabled(cmd: anytype) !void { fn setTouchEmulationEnabled(cmd: anytype) !void {
return cmd.sendResult(null, .{}); return cmd.sendResult(null, .{});
} }
fn setUserAgentOverride(cmd: anytype) !void {
log.info(.app, "setUserAgentOverride ignored", .{});
return cmd.sendResult(null, .{});
}