Utils

The Utils class gives access to various helper methods.

Utils

class firefox_puppeteer.api.utils.Utils(*args, **kwargs)

Low-level access to utility actions.

compare_version(a, b)

Compare two version strings.

Parameters:
  • a – The first version.
  • b – The second version.
Returns:

-1 if a is smaller than b, 0 if equal, and 1 if larger.

permissions

Handling of various permissions for hosts.

Returns:Instance of the Permissions class.
sanitize(data_type)

Sanitize user data, including cache, cookies, offlineApps, history, formdata, downloads, passwords, sessions, siteSettings.

Usage: sanitize(): Clears all user data. sanitize({ “sessions”: True }): Clears only session user data.

more: https://dxr.mozilla.org/mozilla-central/source/browser/base/content/sanitize.js

Parameters:data_type – optional, Information specifying data to be sanitized