In this article we are going to show you how to change WebGL Metadata during the creation of your virtual browser profile through the Local API Clients.
Concept
During the CreateProfileRequest
POST /profiles/new
You can pass the CreateProfileRequest object that has a WebglMetaSpoofingType property. This can be used to set up WebGL Metadata. Possible values are:
- Automatic: The vendor and renderer values comes from the base profile
- Manual: Manually set the vendor and renderer values. In this case the unmasked vendor and unmasked renderer must be passed in the WebglMetaSpoofingOptions object
- Off: Turn off the spoofing, use the original settings
We suggest you to use the "Automatic" setting that is included in the set recommended defaults call. To set the WebGL Metadata type, use the setWebglMeta
method in the Local API Clients. Below you can find the examples for Javascript and Python:
Examples
-
const createProfileRequest = BuilderForCreateProfile .forBaseProfile(chromeBaseProfileList[0].id) .setRecommendedDefaults() .setWebglMeta( 'manual', { vendor: 'Google Inc. (AMD)', renderer: 'ANGLE (AMD Radeaon (TM) RX 560 Direct3D11 vs_5_0), }, ) .build(); const profile = await client.createProfile({ body: createProfileRequest });
-
from kameleo.local_api_client.models import WebglMetaSpoofingOptions . . . create_profile_request = BuilderForCreateProfile \ .for_base_profile(base_profiles[0].id) \ .set_recommended_defaults() \ .set_webgl_meta('manual', WebglMetaSpoofingOptions(vendor='Google Inc. (AMD)', renderer='ANGLE (AMD Radeaon (TM) RX 560 Direct3D11 vs_5_0)')) \ .build() profile = client.create_profile(body=create_profile_request)
For your convenience, this functionality is provided by the Python Builder and JavaScript Builder for Profile Creation in the Local API Clients.