# frozen_string_literal: true # Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # This file is automatically generated. Any changes will be lost! module Selenium module DevTools module V104 class Storage EVENTS = { cache_storage_content_updated: 'cacheStorageContentUpdated', cache_storage_list_updated: 'cacheStorageListUpdated', indexed_db_content_updated: 'indexedDBContentUpdated', indexed_db_list_updated: 'indexedDBListUpdated', interest_group_accessed: 'interestGroupAccessed', }.freeze def initialize(devtools) @devtools = devtools end def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Storage.#{event}"] << block end def get_storage_key_for_frame(frame_id:) @devtools.send_cmd('Storage.getStorageKeyForFrame', frameId: frame_id) end def clear_data_for_origin(origin:, storage_types:) @devtools.send_cmd('Storage.clearDataForOrigin', origin: origin, storageTypes: storage_types) end def get_cookies(browser_context_id: nil) @devtools.send_cmd('Storage.getCookies', browserContextId: browser_context_id) end def set_cookies(cookies:, browser_context_id: nil) @devtools.send_cmd('Storage.setCookies', cookies: cookies, browserContextId: browser_context_id) end def clear_cookies(browser_context_id: nil) @devtools.send_cmd('Storage.clearCookies', browserContextId: browser_context_id) end def get_usage_and_quota(origin:) @devtools.send_cmd('Storage.getUsageAndQuota', origin: origin) end def override_quota_for_origin(origin:, quota_size: nil) @devtools.send_cmd('Storage.overrideQuotaForOrigin', origin: origin, quotaSize: quota_size) end def track_cache_storage_for_origin(origin:) @devtools.send_cmd('Storage.trackCacheStorageForOrigin', origin: origin) end def track_indexed_db_for_origin(origin:) @devtools.send_cmd('Storage.trackIndexedDBForOrigin', origin: origin) end def untrack_cache_storage_for_origin(origin:) @devtools.send_cmd('Storage.untrackCacheStorageForOrigin', origin: origin) end def untrack_indexed_db_for_origin(origin:) @devtools.send_cmd('Storage.untrackIndexedDBForOrigin', origin: origin) end def get_trust_tokens @devtools.send_cmd('Storage.getTrustTokens') end def clear_trust_tokens(issuer_origin:) @devtools.send_cmd('Storage.clearTrustTokens', issuerOrigin: issuer_origin) end def get_interest_group_details(owner_origin:, name:) @devtools.send_cmd('Storage.getInterestGroupDetails', ownerOrigin: owner_origin, name: name) end def set_interest_group_tracking(enable:) @devtools.send_cmd('Storage.setInterestGroupTracking', enable: enable) end end # Storage end # V104 end # DevTools end # Selenium