mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 12:44:43 +00:00
Merge pull request #1902 from lightpanda-io/fix/emulation-set-user-agent-override
Fix/emulation set user agent override
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
const std = @import("std");
|
||||
const log = @import("../../log.zig");
|
||||
|
||||
pub fn processMessage(cmd: anytype) !void {
|
||||
const action = std.meta.stringToEnum(enum {
|
||||
@@ -24,6 +25,7 @@ pub fn processMessage(cmd: anytype) !void {
|
||||
setFocusEmulationEnabled,
|
||||
setDeviceMetricsOverride,
|
||||
setTouchEmulationEnabled,
|
||||
setUserAgentOverride,
|
||||
}, cmd.input.action) orelse return error.UnknownMethod;
|
||||
|
||||
switch (action) {
|
||||
@@ -31,6 +33,7 @@ pub fn processMessage(cmd: anytype) !void {
|
||||
.setFocusEmulationEnabled => return setFocusEmulationEnabled(cmd),
|
||||
.setDeviceMetricsOverride => return setDeviceMetricsOverride(cmd),
|
||||
.setTouchEmulationEnabled => return setTouchEmulationEnabled(cmd),
|
||||
.setUserAgentOverride => return setUserAgentOverride(cmd),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,3 +67,8 @@ fn setDeviceMetricsOverride(cmd: anytype) !void {
|
||||
fn setTouchEmulationEnabled(cmd: anytype) !void {
|
||||
return cmd.sendResult(null, .{});
|
||||
}
|
||||
|
||||
fn setUserAgentOverride(cmd: anytype) !void {
|
||||
log.info(.app, "setUserAgentOverride ignored", .{});
|
||||
return cmd.sendResult(null, .{});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user