Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow changing of auto_events for specific domains. #186

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ashbythorpe
Copy link

Fixes #144
Alternative to #156 that allows more control.

Allows auto_events to be set both dynamically and on a per-domain level in Chromote and ChromoteSession. Does not change any default behaviour except for get_auto_events(), which returns a character vector of domains rather than a boolean.

Examples:

# By default, auto_events depends on the parent Chromote object
session <- ChromoteSession$new()

session$get_auto_events()
#>  [1] "Accessibility"        "Animation"            "Audits"              
#>  [4] "Autofill"             "CSS"                  "Cast"                
#>  [7] "DOM"                  "DOMSnapshot"          "DOMStorage"          
#> [10] "Database"             "HeadlessExperimental" "IndexedDB"           
#> [13] "Inspector"            "LayerTree"            "Log"                 
#> [16] "Network"              "Overlay"              "Page"                
#> [19] "Performance"          "PerformanceTimeline"  "Security"            
#> [22] "ServiceWorker"        "Fetch"                "WebAudio"            
#> [25] "WebAuthn"             "Media"                "DeviceAccess"        
#> [28] "Preload"              "FedCm"                "BluetoothEmulation"  
#> [31] "Console"              "Debugger"             "HeapProfiler"        
#> [34] "Profiler"             "Runtime"

# Disable auto_events for all domains
session$disable_auto_events()

session$get_auto_events()
#> character(0)

# Enable auto_events for just the Network domain
session$enable_auto_events("Network")

session$get_auto_events()
#> [1] "Network"

# Depend on the parent again
session$enable_auto_events(NULL)

session$get_auto_events()
#>  [1] "Accessibility"        "Animation"            "Audits"              
#>  [4] "Autofill"             "CSS"                  "Cast"                
#>  [7] "DOM"                  "DOMSnapshot"          "DOMStorage"          
#> [10] "Database"             "HeadlessExperimental" "IndexedDB"           
#> [13] "Inspector"            "LayerTree"            "Log"                 
#> [16] "Network"              "Overlay"              "Page"                
#> [19] "Performance"          "PerformanceTimeline"  "Security"            
#> [22] "ServiceWorker"        "Fetch"                "WebAudio"            
#> [25] "WebAuthn"             "Media"                "DeviceAccess"        
#> [28] "Preload"              "FedCm"                "BluetoothEmulation"  
#> [31] "Console"              "Debugger"             "HeapProfiler"        
#> [34] "Profiler"             "Runtime"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow enable() methods to be called manually
1 participant