From 4512f5d4d86bc109f1e5975623decbef38fbdfef Mon Sep 17 00:00:00 2001 From: benoit74 Date: Mon, 1 Jul 2024 07:46:56 +0000 Subject: [PATCH] Add zimit noMobileDevice setting --- .../backend/src/common/schemas/offliners/zimit.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dispatcher/backend/src/common/schemas/offliners/zimit.py b/dispatcher/backend/src/common/schemas/offliners/zimit.py index de1bcbf1..fa723a89 100644 --- a/dispatcher/backend/src/common/schemas/offliners/zimit.py +++ b/dispatcher/backend/src/common/schemas/offliners/zimit.py @@ -1,11 +1,10 @@ -from marshmallow import fields, validate - from common.schemas import SerializableSchema, String, StringEnum from common.schemas.fields import ( validate_output, validate_zim_description, validate_zim_filename, ) +from marshmallow import fields, validate # https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts # https://github.com/puppeteer/puppeteer/blob/ @@ -334,6 +333,18 @@ class Meta: validate=validate_devicelist, ) + no_mobile_device = fields.Boolean( + truthy=[True], + falsy=[False], + metadata={ + "label": "No device", + "description": "Do not emulate a device (use at your own risk, behavior is " + "uncertain ; if set, 'As device' setting is ignored)", + }, + data_key="noMobileDevice", + required=False, + ) + user_agent = String( metadata={ "label": "User Agent",