diff --git a/.editorconfig b/.editorconfig index 157cf9c415..92683c27e2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,6 +26,11 @@ charset = utf-8-bom [*.{props,targets,config,nuspec,manifest}] indent_size = 2 +# Javascript Files +[*.js] +curly_bracket_next_line = true +indent_brace_style = Allman + # C++ Files [*.{cpp,h,in}] curly_bracket_next_line = true @@ -105,6 +110,7 @@ dotnet_naming_symbols.private_internal_field_target.applicable_accessibilities = # Code style defaults dotnet_sort_system_directives_first = true csharp_preserve_single_line_blocks = true +csharp_prefer_braces = true csharp_preserve_single_line_statements = false dotnet_style_prefer_auto_properties = true : suggestion @@ -150,3 +156,5 @@ csharp_space_between_square_brackets = # Modifier order csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async : error +# CA2247: Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum +dotnet_diagnostic.CA2247.severity = error diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000..b55aeeadbe --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +#patreon: # Replace with a single Patreon username +#open_collective: # Replace with a single Open Collective username +#ko_fi: # Replace with a single Ko-fi username +#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +#custom: # Replace with a single custom sponsorship URL + +github: amaitland +#patreon: alexmaitland +custom: https://paypal.me/AlexMaitland diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index aa70ab651b..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: Bug report -about: Create a report for a reproducible bug -title: '' -labels: '' -assignees: '' - ---- - -### Please only open an issue if you have a BUG to report, if you simply have a question or require some assistance keep reading for info. If you do have a BUG to report, please use the Bug Report template below. - -So you have a question to ask, where can you look for answers? Read on. Think you've found a bug? Please take the time to fill out the bug report below, provide as much information as you can, make sure you provide information for every heading. Thank you! We'd like to keep issues exclusively for **bug reports**, so please ask your questions on `Gitter` - -- Start by reading the General Usage guide, it answers all the common questions https://github.com/cefsharp/CefSharp/wiki/General-Usage -- Check out the FAQ, lots of useful information there, specially if your having trouble deploying to a different machine : https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions -- GitHub proves a fantastic search feature, it'll search through past issues and code. So check that out (Search box at the top of this page) : https://github.com/cefsharp/CefSharp -- You can see all the `CefSharp` tagged issues on `Stackoverflow`, some useful stuff there : http://stackoverflow.com/questions/tagged/cefsharp -- You can search the `Gitter Chat Channel` for past questions/conversations, you can search through every discussion from the beginning : https://gitter.im/cefsharp/CefSharp - -Still have a question? Great, ask it on `Gitter`. https://gitter.im/cefsharp/CefSharp - -**Note: CefSharp is just a wrapper around the Chromium Embedded Project, it's worth searching http://magpcss.org/ceforum/index.php if your problem involves a low level Chromium error message** - -We ask that you put in a reasonable amount of effort in searching through the resources listed above. The developers have full time jobs, they have lives, families, the time they have available to contribute this project is a precious resource, make sure you use it wisely! Remember the more time we spend answering the same questions over and over again, less time goes into writing code, adding new features, actually fixing bugs! - -Still have a question to ask or unsure where to go next? Start with the Gitter Chat room : https://gitter.im/cefsharp/CefSharp - --- -### Bug Report -Delete this line and everything above, and then fill in the details below. - -- **What version of the product are you using?** - - What version are you using? Nuget? CI Nuget? build from a branch? If so which branch? Please include the exact version number you are using (no ambiguous statements like `Latest from Nuget`) -e.g. 57.0.0 or 63.0.0-pre01 - - Please only create an issue if you can reproduce the problem with the latest version. (If you are using the latest stable release please check to see if there is a newer `-pre` release and test with that also). - -- **What architecture x86 or x64?** - -- **On what operating system?** - - Win7, Win 8, Win10, etc? - -- **Are you using `WinForms`, `WPF` or `OffScreen`?** - -- **What steps will reproduce the problem?** - - Please provide detailed information here, enough for someone else to reprodce your problem. - - Please no binary (zip, etc) links, fork the [MinimalExample](https://github.com/cefsharp/CefSharp.MinimalExample) and push your changes to `GitHub`. (Alternatively use a code sharing service list `Gist` or `Pastebin`). - -- **What is the expected output? What do you see instead?** - -- **Please provide any additional information below.** - - A stack trace if available, any Exception information. - - - Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory) - - - Any other background information that's relevant? Are you doing something out of the ordinary? 3rd party controls? - -- **Does this problem also occur in the `CEF` Sample Application from http://opensource.spotify.com/cefbuilds/index.html?** - - - To compare with WPF run cefclient --multi-threaded-message-loop --off-screen-rendering-enabled --enable-gpu - - To compare with WinForms run cefclient --multi-threaded-message-loop - - If you can reproduce the problem with `cefclient` then you'll need to report the bug on https://bitbucket.org/chromiumembedded/cef/overview there is no point opening an issue here. (Make sure you search before opening an issue) - - Please include the version you tested with e.g. `cef_binary_3.3029.1611.g44e39a8_windows64_client.tar.bz2`. It's important to you test with the same version that `CefSharp` is based on. Check the release notes to determine the version (https://github.com/cefsharp/CefSharp/releases) or load `chrome://version` in the browser. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..61d10684a4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,155 @@ +name: Bug Report +description: Create a report for a reproducible bug +labels: [] +body: + - type: markdown + attributes: + value: | + Please only open an issue if you have a **BUG** to report. for questions/assistance use [Discussions](https://github.com/cefsharp/CefSharp/discussions). If you are new to the project then please review the following: + 1. [General Usage guide](https://github.com/cefsharp/CefSharp/wiki/General-Usage) includes examples and details of many common questions. + 2. [Frequently Asked Questions](https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions), lots of useful information there, specially if your having trouble deploying to a different machine. + 3. GitHub has a fantastic search feature, it'll search through past issues/code. Use the Search box at the top of this page). + 4. You can see all the `CefSharp` tagged issues on [Stackoverflow](http://stackoverflow.com/questions/tagged/cefsharp), lots of questions/answers. + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched both open/closed issues, no issue already exists. + required: true + - type: input + id: cefsharp-version + attributes: + label: CefSharp Version + description: What version are you using? Please only open an issue if you can reproduce the problem with version 145.0.260 or later. + placeholder: 145.0.260 + validations: + required: true + - type: dropdown + id: operating-system + attributes: + label: Operating System + multiple: false + options: + - Windows 10 + - Windows 11 + - Windows Server 2016 + - Windows Server 2019 + - Windows Server 2022 + - Windows Server 2025 + validations: + required: true + - type: dropdown + id: architecture + attributes: + label: Architecture + multiple: false + options: + - x64 + - x86 + - arm64 + - AnyCPU + validations: + required: true + - type: input + id: dotnet-version + attributes: + label: .Net Version + description: | + What .Net version are you using? + placeholder: e.g. .Net 4.8 or .Net 6.0 + validations: + required: true + - type: dropdown + id: cefsharp-implementation + attributes: + label: Implementation + multiple: false + options: + - WinForms + - WPF + - WPF HwndHost + - OffScreen + validations: + required: true + - type: textarea + id: repro-steps + attributes: + label: Reproduction Steps + description: | + Please include minimal steps to reproduce the problem. E.g.: the smallest possible code snippet; or a small example project here on GitHub, with steps to run it. Include text/code as text rather than screenshots (so it shows up in searches and can copy/paste). + Does the problem reproduce using the [MinimalExample](https://github.com/cefsharp/CefSharp.MinimalExample)? You can fork the MinimalExample and use this as a base for your example. + placeholder: Minimal Reproduction + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: | + Provide a description of the expected behavior. + placeholder: Expected behavior + validations: + required: true + - type: textarea + id: actual-behavior + attributes: + label: Actual behavior + description: | + Provide a description of the actual behavior observed. If applicable please include any error messages, exception or stacktraces. + placeholder: Actual behavior + validations: + required: true + - type: textarea + id: regression + attributes: + label: Regression? + description: | + Did this work in a previous build or release of CefSharp? If you can try a previous release or build to find out, that can help us narrow down the problem. If you don't know, that's OK. + placeholder: Regression? + validations: + required: false + - type: textarea + id: known-workarounds + attributes: + label: Known Workarounds + description: | + Please provide a description of any known workarounds. + placeholder: Known Workarounds + validations: + required: false + - type: markdown + attributes: + value: | + To help determine where the problem needs to be fixed please download and test using the `CEF Sample Application(cefclient)`. + 1. Download for [x86](https://cef-builds.spotifycdn.com/cef_binary_146.0.7%2Bga6b143f%2Bchromium-146.0.7680.165_windows32_client.tar.bz2) or [x64](https://cef-builds.spotifycdn.com/cef_binary_146.0.7%2Bga6b143f%2Bchromium-146.0.7680.165_windows64_client.tar.bz2) or [arm64](https://cef-builds.spotifycdn.com/cef_binary_146.0.7%2Bga6b143f%2Bchromium-146.0.7680.165_windowsarm64_client.tar.bz2). + 2. Extract tar.bz2 file + 3. Execute cefclient.exe using the **command line args below**: + + For WPF/OffScreen `cefclient.exe --multi-threaded-message-loop --no-sandbox --off-screen-rendering-enabled --enable-gpu` + For WinForms `cefclient.exe --multi-threaded-message-loop --no-sandbox --use-alloy-style` + - type: dropdown + id: cefclient-testing + attributes: + label: Does this problem also occur in the CEF Sample Application + multiple: false + options: + - 'Yes using WPF/OffScreen command line args' + - 'Yes using WinForms command line args' + - 'No' + - Not Tested + description: | + If you can reproduce the problem with `cefclient` then please report the issue on [CEF Issue Tracker](https://github.com/chromiumembedded/cef/issues) (Make sure you search before opening an issue). If you open an issue here it will most likely be closed as `upstream` as the bug needs to be fixed in `CEF`. + validations: + required: true + - type: textarea + id: other-info + attributes: + label: Other information + description: | + If you are seeing a crash in `libcef.dll` then please download `libcef.dll.pdb` and place it next to `libcef.dll` to obtain a detailed stack trace, see [FAQ](https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#loading-native-symbols-for-easier-diagnosis) for details. + Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory) + Any other background information that's relevant? Are you doing something out of the ordinary? 3rd party controls? + placeholder: Other information + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..800264224b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,9 @@ +# https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser +blank_issues_enabled: false +contact_links: + - name: stackoverflow + url: http://stackoverflow.com/questions/tagged/cefsharp + about: Please ask and answer questions here. + - name: Chromium Embedded Framework(CEF) Forum + url: https://magpcss.org/ceforum/index.php + about: Please ask your non CefSharp specific CEF questions here diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d61..9910de4839 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,31 @@ --- name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' +about: Suggest an idea for this project, please don't use this template to ask questions, thank you. +title: Feature Request - My Feature +labels: feature-request assignees: '' --- -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +Please ask your questions under the Discussions section here on GitHub +- https://github.com/cefsharp/CefSharp/discussions + +--- + +`CefSharp` is a wrapper around the [Chromium Embedded Framework](https://bitbucket.org/chromiumembedded/cef/overview) in a lot of cases a feature must be added to `CEF` first before it can be used in `CefSharp`. `CEF` has its own `Feature Request Forum` at https://magpcss.org/ceforum/viewforum.php?f=7 + +--- **Describe the solution you'd like** -A clear and concise description of what you want to happen. +A clear and concise description of the feature you are proposing **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. + +**Checklist:** +- [ ] I have reviewed the [CEF API](https://magpcss.org/ceforum/apidocs3/index-all.html) and have confirmed the feature I'm requesting is possible. +- [ ] The Feature I'm requesting is an improvement to Async Javascript Binding (No new feature are being added to the Sync Javascript binding) +- [ ] An open `PR` exists on the [CEF Pull Requests](https://bitbucket.org/chromiumembedded/cef/pull-requests/) and I'd like to propose this feature is added to `CefSharp` when/if it's merged. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..c2d7925c5e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,32 @@ +**Fixes:** [issue-number] + + +**Summary:** [summary of the change and which issue is fixed here] + - e.g. I have added a new feature to the Javascript Binding implementation + +**Changes:** [specify the structures changed] + - e.g. I have modified the Javascript Binding Implementation + - Added support for Async binding to return Task + - Added new QUnit Test cases + +**How Has This Been Tested?** + + + + +**Screenshots (if appropriate):** + +**Types of changes** + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) +- [ ] Updated documentation + +**Checklist:** + +- [ ] Tested the code(if applicable) +- [ ] Commented my code +- [ ] Changed the documentation(if applicable) +- [ ] New files have a license disclaimer +- [ ] The formatting is consistent with the project (project supports .editorconfig) diff --git a/.github/support.yml b/.github/support.yml index 702847931f..0ee8bc127f 100644 --- a/.github/support.yml +++ b/.github/support.yml @@ -9,10 +9,13 @@ supportComment: > :wave: @{issue-author}, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project. - - If you have a question, ask it on [Gitter](https://gitter.im/cefsharp/CefSharp), [StackOverflow](http://stackoverflow.com/questions/tagged/cefsharp) or use [ceforum](http://magpcss.org/ceforum/) (for questions specific to `CEF`). - +
+ If you have a question, ask it on [StackOverflow](http://stackoverflow.com/questions/tagged/cefsharp) or use [ceforum](http://magpcss.org/ceforum/) (for questions specific to `CEF`). +
If you are new to `CefSharp` then we suggest you read https://github.com/cefsharp/CefSharp/wiki/General-Usage +
+ If you feel this was closed in error then you **must** edit your original issue and complete the [Bug Report Template](https://github.com/cefsharp/CefSharp/blob/master/.github/ISSUE_TEMPLATE/bug_report.md#bug-report) + then post a comment asking for a review. # Close issues marked as support requests close: true @@ -21,4 +24,4 @@ close: true lock: false # Assign `off-topic` as the reason for locking. Set to `false` to disable -setLockReason: false \ No newline at end of file +setLockReason: false diff --git a/.github/workflows/codeql-analysis.yml.bak b/.github/workflows/codeql-analysis.yml.bak new file mode 100644 index 0000000000..e66bab1453 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml.bak @@ -0,0 +1,62 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 4 * * 5' + +jobs: + analyze: + name: Analyze + runs-on: windows-latest + + strategy: + fail-fast: true + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['csharp'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.gitignore b/.gitignore index 2dd9e157d8..e92d3bb6b8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,9 @@ _ReSharper* bin/ +bin.netcore/ obj/ +obj.netcore/ packages/ Debug/ Release/ @@ -39,3 +41,4 @@ x64/Release Win32/Release .vs/ /Help +/tools diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 0000000000..9c22b175de --- /dev/null +++ b/.vsconfig @@ -0,0 +1,33 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Component.CoreEditor", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.VisualStudio.Component.NuGet", + "Microsoft.Net.Component.4.7.2.TargetingPack", + "Microsoft.VisualStudio.Component.Roslyn.Compiler", + "Microsoft.VisualStudio.Component.Roslyn.LanguageServices", + "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", + "Microsoft.Component.MSBuild", + "Microsoft.VisualStudio.Component.ManagedDesktop.Core", + "Microsoft.Net.Component.4.6.2.TargetingPack", + "Microsoft.VisualStudio.Component.IntelliCode", + "Microsoft.Net.ComponentGroup.TargetingPacks.Common", + "Microsoft.VisualStudio.Component.Debugger.JustInTime", + "Microsoft.VisualStudio.Component.VC.CoreIde", + "Microsoft.VisualStudio.Component.Windows10SDK", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64", + "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", + "Microsoft.ComponentGroup.Blend", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Component.VC.Redist.14.Latest", + "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core", + "Microsoft.VisualStudio.Component.VC.CLI.Support", + "Microsoft.VisualStudio.Component.Windows10SDK.19041", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.NetCore.Component.DevelopmentTools", + "Microsoft.NetCore.Component.Runtime.6.0", + "Microsoft.NetCore.Component.SDK" + ] +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5b05a5f0ad..281ae9dda1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,16 +13,24 @@ Thanks for your interest in contributing to the project! Please follow these sim ### `CefSharp` vs `Chromium Embedded Framework(CEF)` -`CefSharp` simply takes the building blocks provided by `CEF` and attempts to provide a usable '.Net' implementation. +`CefSharp` simply takes the building blocks provided by the [Chromium Embedded Framework(CEF)](https://github.com/chromiumembedded/cef) and provides a usable '.Net' implementation. The upstream [`CEF` forum](http://magpcss.org/ceforum/) is a valuable resource, if your issues seems fairly low level, then please conduct some research before posting. It maybe helpful to run the `cefclient` application and compare output with `CefSharp`. The `WinForms` and `WPF` versions use two different rendering modes, `WPF` uses Offscreen Rendering (`OSR`). `OffScreen` also uses `OSR` mode. -- Download **Sample Application** from http://opensource.spotify.com/cefbuilds/index.html -- To compare with WPF run `cefclient --multi-threaded-message-loop --off-screen-rendering-enabled --enable-gpu` -- To compare with WinForms `cefclient --multi-threaded-message-loop` - -To determine which version of `CEF` your build is running, open `chrome://version` and you'll see a number similar to `3.2987.1597.gffc5773`. Open http://opensource.spotify.com/cefbuilds/index.html and download the `Sample Application` that exactly matches. If your using an older build click `Show More Builds`. + - Download and run the `CEF Sample Application(cefclient)`: + - Download for [x86](https://cef-builds.spotifycdn.com/cef_binary_146.0.7%2Bga6b143f%2Bchromium-146.0.7680.165_windows32_client.tar.bz2) or [x64](https://cef-builds.spotifycdn.com/cef_binary_146.0.7%2Bga6b143f%2Bchromium-146.0.7680.165_windows64_client.tar.bz2) or [arm64](https://cef-builds.spotifycdn.com/cef_binary_146.0.7%2Bga6b143f%2Bchromium-146.0.7680.165_windowsarm64_client.tar.bz2). + - Extract and run cefclient.exe + - If you are using WPF/OffScreen run + ``` + cefclient.exe --multi-threaded-message-loop --no-sandbox --off-screen-rendering-enabled --enable-gpu + ``` + - If you are using WinForms run + ``` + cefclient.exe --multi-threaded-message-loop --no-sandbox --use-alloy-style + ``` + - **MAKE SURE TO TEST WITH THE COMMAND LINE ARGS LISTED ABOVE** + - If you can reproduce the problem with `cefclient` then you'll need to report the bug on https://github.com/chromiumembedded/cef there is no point opening an issue here. (Make sure you search before opening an issue) ### What should I include when creating an `Issue`? @@ -37,12 +45,12 @@ Your bug report should **always follow this template**: - **Are you using `WinForms`, `WPF` or `OffScreen`?** - **What version of the product are you using? On what operating system? x86 or x64?** - What version are you using? Nuget? CI Nuget? build from a branch? If so which branch? - - Win7, Win 8, Win10, etc? + - Win10/11, etc? - **Please provide any additional information below.** - A stack trace if available, any Exception information. - Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory) - Any other background information that's relevant? Are you doing something out of the ordinary? 3rd party controls? -- **Does this problem also occur in the `CEF Sample Application` from http://opensource.spotify.com/cefbuilds/index.html?** +- **Does this problem also occur in the `CEF Sample Application` from https://cef-builds.spotifycdn.com/index.html?** Your bug report should include **what you were doing** in the software when you encountered it, **what you were expecting** to happen and **what happened instead**. diff --git a/CefSharp.AfterBuild.targets b/CefSharp.AfterBuild.targets new file mode 100644 index 0000000000..f26ed0b382 --- /dev/null +++ b/CefSharp.AfterBuild.targets @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + locales\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + + + + + locales\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + + + + + locales\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + + + diff --git a/CefSharp.BrowserSubprocess.Core/Assembly.manifest b/CefSharp.BrowserSubprocess.Core/Assembly.manifest new file mode 100644 index 0000000000..01c92358c2 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/Assembly.manifest @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodCallback.cpp b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodCallback.cpp index 124db6b9c9..b7c6b55967 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodCallback.cpp +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodCallback.cpp @@ -7,7 +7,7 @@ namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Async { diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodCallback.h b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodCallback.h index 46cceae496..27411d722b 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodCallback.h +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodCallback.h @@ -8,7 +8,7 @@ namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Async { @@ -44,4 +44,4 @@ namespace CefSharp }; } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp index 10ee3da576..71628d738f 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp @@ -4,24 +4,25 @@ #include "stdafx.h" #include "JavascriptAsyncMethodHandler.h" -#include "../CefSharp.Core/Internals/Messaging/Messages.h" -#include "../CefSharp.Core/Internals/Serialization/Primitives.h" +#include "../CefSharp.Core.Runtime/Internals/Messaging/Messages.h" +#include "../CefSharp.Core.Runtime/Internals/Serialization/Primitives.h" #include "Serialization/V8Serialization.h" #include "CefAppUnmanagedWrapper.h" using namespace CefSharp::Internals::Messaging; using namespace CefSharp::Internals::Serialization; +using namespace CefSharp::BrowserSubprocess::Serialization; namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Async { bool JavascriptAsyncMethodHandler::Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) { auto context = CefV8Context::GetCurrentContext(); - auto browser = context->GetBrowser(); + auto frame = context->GetFrame(); CefRefPtr promiseData; CefRefPtr promiseException; @@ -37,9 +38,9 @@ namespace CefSharp //when refreshing the browser this is sometimes null, in this case return true and log message //https://github.com/cefsharp/CefSharp/pull/2446 - if (promiseData == NULL) + if (promiseData == nullptr) { - LOG(WARNING) << "JavascriptAsyncMethodHandler::Execute promiseData returned NULL"; + LOG(WARNING) << "JavascriptAsyncMethodHandler::Execute promiseData returned nullptr"; return true; } @@ -54,18 +55,17 @@ namespace CefSharp auto request = CefProcessMessage::Create(kJavascriptAsyncMethodCallRequest); auto argList = request->GetArgumentList(); auto params = CefListValue::Create(); - for (auto i = 0; i < arguments.size(); i++) + for (size_t i = 0; i < arguments.size(); i++) { SerializeV8Object(arguments[i], params, i, _callbackRegistry); } - SetInt64(argList, 0, context->GetFrame()->GetIdentifier()); - SetInt64(argList, 1, _objectId); - SetInt64(argList, 2, callbackId); - argList->SetString(3, name); - argList->SetList(4, params); + SetInt64(argList, 0, _objectId); + SetInt64(argList, 1, callbackId); + argList->SetString(2, name); + argList->SetList(3, params); - browser->SendProcessMessage(CefProcessId::PID_BROWSER, request); + frame->SendProcessMessage(CefProcessId::PID_BROWSER, request); return true; } diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.h b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.h index 5c95020aa3..aa315f69c9 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.h +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.h @@ -10,7 +10,7 @@ namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Async { @@ -18,11 +18,11 @@ namespace CefSharp { private: gcroot _callbackRegistry; - gcroot^> _methodCallbackSave; - int64 _objectId; + gcroot^> _methodCallbackSave; + int64_t _objectId; public: - JavascriptAsyncMethodHandler(int64 objectId, JavascriptCallbackRegistry^ callbackRegistry, Func^ methodCallbackSave) + JavascriptAsyncMethodHandler(int64_t objectId, JavascriptCallbackRegistry^ callbackRegistry, Func^ methodCallbackSave) :_callbackRegistry(callbackRegistry), _objectId(objectId), _methodCallbackSave(methodCallbackSave) { @@ -38,7 +38,7 @@ namespace CefSharp _methodCallbackSave = nullptr; } - IMPLEMENT_REFCOUNTING(JavascriptAsyncMethodHandler); + IMPLEMENT_REFCOUNTINGM(JavascriptAsyncMethodHandler); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodWrapper.cpp b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodWrapper.cpp index faba260a30..9d60fc2cfd 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodWrapper.cpp @@ -8,7 +8,7 @@ namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Async { @@ -21,4 +21,4 @@ namespace CefSharp } } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodWrapper.h b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodWrapper.h index 8bf108f369..876aa52026 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodWrapper.h @@ -9,7 +9,7 @@ namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Async { @@ -19,7 +19,7 @@ namespace CefSharp MCefRefPtr _javascriptMethodHandler; public: - JavascriptAsyncMethodWrapper(int64 ownerId, JavascriptCallbackRegistry^ callbackRegistry, Func^ methodCallbackSave) + JavascriptAsyncMethodWrapper(int64_t ownerId, JavascriptCallbackRegistry^ callbackRegistry, Func^ methodCallbackSave) : _javascriptMethodHandler(new JavascriptAsyncMethodHandler(ownerId, callbackRegistry, methodCallbackSave)) { @@ -29,4 +29,4 @@ namespace CefSharp }; } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncObjectWrapper.cpp b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncObjectWrapper.cpp index 737ea87f9a..401b85a643 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncObjectWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncObjectWrapper.cpp @@ -11,7 +11,7 @@ using namespace System::Linq; namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Async { @@ -32,4 +32,4 @@ namespace CefSharp } } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncObjectWrapper.h b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncObjectWrapper.h index fd449ce8d7..f42ac60e42 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncObjectWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncObjectWrapper.h @@ -10,7 +10,7 @@ namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Async { @@ -18,11 +18,11 @@ namespace CefSharp { private: initonly List^ _wrappedMethods; - Func^ _methodCallbackSave; + Func^ _methodCallbackSave; JavascriptCallbackRegistry^ _callbackRegistry; public: - JavascriptAsyncObjectWrapper(JavascriptCallbackRegistry^ callbackRegistry, Func^ saveMethod) + JavascriptAsyncObjectWrapper(JavascriptCallbackRegistry^ callbackRegistry, Func^ saveMethod) : _wrappedMethods(gcnew List()), _methodCallbackSave(saveMethod), _callbackRegistry(callbackRegistry) { @@ -42,4 +42,4 @@ namespace CefSharp }; } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h b/CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h new file mode 100644 index 0000000000..1a99952071 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h @@ -0,0 +1,317 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "include/cef_v8.h" +#include "RegisterBoundObjectRegistry.h" +#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h" +#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h" + +using namespace System; +using namespace CefSharp::Internals::Messaging; +using namespace CefSharp::Internals::Serialization; +using namespace CefSharp::BrowserSubprocess; + +namespace CefSharp +{ + namespace BrowserSubprocess + { + const CefString kBindObjectAsync = CefString("BindObjectAsync"); + const CefString kBindObjectAsyncCamelCase = CefString("bindObjectAsync"); + + private class BindObjectAsyncHandler : public CefV8Handler + { + private: + gcroot _callbackRegistry; + gcroot^> _javascriptObjects; + gcroot _javascriptRootObjectWrapper; + + public: + BindObjectAsyncHandler(RegisterBoundObjectRegistry^ callbackRegistery, Dictionary^ javascriptObjects, JavascriptRootObjectWrapper^ javascriptRootObjectWrapper) + { + _callbackRegistry = callbackRegistery; + _javascriptObjects = javascriptObjects; + _javascriptRootObjectWrapper = javascriptRootObjectWrapper; + } + + ~BindObjectAsyncHandler() + { + _callbackRegistry = nullptr; + _javascriptObjects = nullptr; + _javascriptRootObjectWrapper = nullptr; + } + + bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) override + { + auto context = CefV8Context::GetCurrentContext(); + + if (context.get() && context->Enter()) + { + try + { + auto params = CefListValue::Create(); + //We need to store a seperate index into our params as + //there are instances we skip over already cached objects + //and end up with empty strings in the list. + //e.g. first object is already bound/cached, we previously + //second object isn't we end up with a list of "", "secondObject" + int paramsIndex = 0; + + auto boundObjectRequired = false; + auto notifyIfAlreadyBound = false; + auto ignoreCache = false; + auto cachedObjects = gcnew List(); + //TODO: Create object to represent this information + auto objectNamesWithBoundStatus = gcnew List^>(); + auto objectCount = 0; + + if (arguments.size() > 0) + { + objectCount = (int)arguments.size(); + + //If first argument is an object, we'll see if it contains config values + if (arguments[0]->IsObject()) + { + //Upper and camelcase options are supported + notifyIfAlreadyBound = GetV8BoolValue(arguments[0], "NotifyIfAlreadyBound", "notifyIfAlreadyBound"); + ignoreCache = GetV8BoolValue(arguments[0], "IgnoreCache", "ignoreCache"); + + //If we have a config object then we remove that from the count + objectCount = objectCount - 1; + } + + auto global = context->GetGlobal(); + + //Loop through all arguments and ignore anything that's not a string + for (size_t i = 0; i < arguments.size(); i++) + { + //Validate arg as being a string + if (arguments[i]->IsString()) + { + auto objectName = arguments[i]->GetStringValue(); + auto managedObjectName = StringUtils::ToClr(objectName); + auto alreadyBound = global->HasValue(objectName); + auto cached = false; + + //Check if the object has already been bound + if (alreadyBound) + { + cached = _javascriptObjects->ContainsKey(managedObjectName); + } + else + { + //If no matching object found then we'll add the object name to the list + boundObjectRequired = true; + params->SetString(paramsIndex++, objectName); + + JavascriptObject^ obj; + if (_javascriptObjects->TryGetValue(managedObjectName, obj)) + { + cachedObjects->Add(obj); + + cached = true; + } + } + + objectNamesWithBoundStatus->Add(Tuple::Create(managedObjectName, alreadyBound, cached)); + } + } + } + else + { + //No objects names were specified so we default to makeing the request + boundObjectRequired = true; + } + + auto frame = context->GetFrame(); + + if (frame.get() && frame->IsValid()) + { + if (boundObjectRequired || ignoreCache) + { + //If the number of cached objects matches the number of args + //(we have a cached copy of all requested objects) + //then we'll immediately bind the cached objects + //If objectCount and cachedObject count are both 0 then we'll + //send the kJavascriptRootObjectRequest message + //https://github.com/cefsharp/CefSharp/issues/3470 + if (objectCount > 0 && cachedObjects->Count == objectCount && ignoreCache == false) + { + if (Object::ReferenceEquals(_javascriptRootObjectWrapper, nullptr)) + { + exception = "BindObjectAsyncHandler::Execute - _javascriptRootObjectWrapper null, unable to bind objects"; + + return true; + } + + auto browser = context->GetBrowser(); + + JavascriptRootObjectWrapper^ rootObject = _javascriptRootObjectWrapper; + + //Cached objects only contains a list of objects not already bound + rootObject->Bind(cachedObjects, context->GetGlobal()); + + //Objects already bound or ignore cache + CefRefPtr promiseResolve; + CefRefPtr promiseException; + + auto promiseResolveScript = StringUtils::ToNative("Promise.resolve({Success:true, Count:" + cachedObjects->Count + ", Message:'OK'});"); + + if (context->Eval(promiseResolveScript, CefString(), 0, promiseResolve, promiseException)) + { + retval = promiseResolve; + } + else + { + exception = promiseException->GetMessage(); + + return true; + } + + NotifyObjectBound(frame, objectNamesWithBoundStatus); + } + else + { + CefRefPtr promiseData; + CefRefPtr promiseException; + //this will create a promise and give us the reject/resolve functions {p: Promise, res: resolve(), rej: reject()} + if (!context->Eval(CefAppUnmanagedWrapper::kPromiseCreatorScript, CefString(), 0, promiseData, promiseException)) + { + exception = promiseException->GetMessage(); + + return true; + } + + //when refreshing the browser this is sometimes null, in this case return true and log message + //https://github.com/cefsharp/CefSharp/pull/2446 + if (promiseData == nullptr) + { + LOG(WARNING) << "BindObjectAsyncHandler::Execute promiseData returned nullptr"; + + return true; + } + + //return the promose + retval = promiseData->GetValue("p"); + + //References to the promise resolve and reject methods + auto resolve = promiseData->GetValue("res"); + auto reject = promiseData->GetValue("rej"); + + auto callback = gcnew JavascriptAsyncMethodCallback(context, resolve, reject); + + auto request = CefProcessMessage::Create(kJavascriptRootObjectRequest); + auto argList = request->GetArgumentList(); + + //Obtain a callbackId then send off the Request for objects + auto callbackId = _callbackRegistry->SaveMethodCallback(callback); + + SetInt64(argList, 0, callbackId); + argList->SetList(1, params); + + frame->SendProcessMessage(CefProcessId::PID_BROWSER, request); + } + } + else + { + //Objects already bound or ignore cache + CefRefPtr promiseResolve; + CefRefPtr promiseException; + + auto promiseResolveScript = CefString("Promise.resolve({Success:false, Count:0, Message:'Object(s) already bound'});"); + + if (context->Eval(promiseResolveScript, CefString(), 0, promiseResolve, promiseException)) + { + retval = promiseResolve; + + if (notifyIfAlreadyBound) + { + NotifyObjectBound(frame, objectNamesWithBoundStatus); + } + } + else + { + exception = promiseException->GetMessage(); + } + } + } + else + { + exception = "BindObjectAsyncHandler::Execute - Frame is invalid."; + } + } + finally + { + context->Exit(); + } + } + else + { + exception = "BindObjectAsyncHandler::Execute - Unable to Get or Enter Context"; + } + + + return true; + } + + private: + void NotifyObjectBound(const CefRefPtr frame, List^>^ objectNamesWithBoundStatus) + { + //Send message notifying Browser Process of which objects were bound + //We do this after the objects have been created in the V8Context to gurantee + //they are accessible. + auto msg = CefProcessMessage::Create(kJavascriptObjectsBoundInJavascript); + auto args = msg->GetArgumentList(); + + auto boundObjects = CefListValue::Create(); + auto index = 0; + + for each (auto obj in objectNamesWithBoundStatus) + { + auto dict = CefDictionaryValue::Create(); + + auto name = obj->Item1; + auto alreadyBound = obj->Item2; + auto isCached = obj->Item3; + dict->SetString("Name", StringUtils::ToNative(name)); + dict->SetBool("IsCached", isCached); + dict->SetBool("AlreadyBound", alreadyBound); + + boundObjects->SetDictionary(index++, dict); + } + + args->SetList(0, boundObjects); + + frame->SendProcessMessage(CefProcessId::PID_BROWSER, msg); + } + + bool GetV8BoolValue(const CefRefPtr val, const CefString key, const CefString camelCaseKey) + { + if (val->HasValue(key)) + { + auto obj = val->GetValue(key); + if (obj->IsBool()) + { + return obj->GetBoolValue(); + } + } + + if (val->HasValue(camelCaseKey)) + { + auto obj = val->GetValue(camelCaseKey); + if (obj->IsBool()) + { + return obj->GetBoolValue(); + } + } + + return false; + } + + IMPLEMENT_REFCOUNTINGM(BindObjectAsyncHandler); + }; + } +} + diff --git a/CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h b/CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h new file mode 100644 index 0000000000..f4f9ca45be --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h @@ -0,0 +1,165 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "SubProcess.h" + +using namespace System; +using namespace CefSharp::Internals; + +namespace CefSharp +{ + namespace BrowserSubprocess + { + /// + /// BrowserSubprocessExecutable provides the fundimental browser process handling for + /// CefSharp.BrowserSubprocess.exe and can be used to self host the BrowserSubProcess in your + /// existing application (preferred approach for .Net Core). + /// + public ref class BrowserSubprocessExecutable + { + public: + BrowserSubprocessExecutable() + { + + } + +#ifdef NETCOREAPP + /// + /// This function should be called from the application entry point function (typically Program.Main) + /// to execute a secondary process e.g. gpu, renderer, utility + /// This overload is specifically used for .Net Core. For hosting your own BrowserSubProcess + /// it's preferable to use the Main method provided by this class. + /// + /// + /// If called for the browser process (identified by no "type" command-line value) it will return immediately + /// with a value of -1. If called for a recognized secondary process it will block until the process should exit + /// and then return the process exit code. + /// ^ args) + { + auto subProcess = gcnew BrowserSubprocessExecutable(); + return subProcess->Main(args, nullptr); + } +#endif + + /// + /// This function should be called from the application entry point function (typically Program.Main) + /// to execute a secondary process e.g. gpu, renderer, utility + /// This overload is specifically used for .Net Core. For hosting your own BrowserSubProcess + /// it's preferable to use the Main method provided by this class. + /// - Obtains the command line args via a call to Environment::GetCommandLineArgs + /// + /// + /// If called for the browser process (identified by no "type" command-line value) it will return immediately + /// with a value of -1. If called for a recognized secondary process it will block until the process should exit + /// and then return the process exit code. + /// Main(args, nullptr); + } + + /// + /// This function should be called from the application entry point function (typically Program.Main) + /// to execute a secondary process e.g. gpu, renderer, utility + /// It can be used to run secondary processes (BrowserSubProcess) from your main applications executable + /// or from a separate executable specified by the CefSettings.BrowserSubprocessPath value. + /// CefSharp defaults to using the latter approach, a default implementation (CefSharp.BrowserSubProcess.exe) is + /// supplied, see https://github.com/cefsharp/CefSharp/wiki/General-Usage#processes for more details. + /// + /// command line args + /// + /// If called for the browser process (identified by no "type" command-line value) it will return immediately + /// with a value of -1. If called for a recognized secondary process it will block until the process should exit + /// and then return the process exit code. + /// ^ args) + { + return Main(args, nullptr); + } + + /// + /// This function should be called from the application entry point function (typically Program.Main) + /// to execute a secondary process e.g. gpu, renderer, utility + /// It can be used to run secondary processes (BrowserSubProcess) from your main applications executable + /// or from a separate executable specified by the CefSettings.BrowserSubprocessPath value. + /// CefSharp defaults to using the latter approach, a default implementation (CefSharp.BrowserSubProcess.exe) is + /// supplied, see https://github.com/cefsharp/CefSharp/wiki/General-Usage#processes for more details. + /// + /// command line args + /// An option IRenderProcessHandler implementation, use null if no handler is required + /// + /// If called for the browser process (identified by no "type" command-line value) it will return immediately + /// with a value of -1. If called for a recognized secondary process it will block until the process should exit + /// and then return the process exit code. + /// + int Main(IEnumerable^ args, IRenderProcessHandler^ handler) + { + auto type = CommandLineArgsParser::GetArgumentValue(args, CefSharpArguments::SubProcessTypeArgument); + + if (String::IsNullOrEmpty(type)) + { + //If --type param missing from command line CEF/Chromium assums + //this is the main process (as all subprocesses must have a type param). + //Return -1 to indicate this behaviour. + return -1; + } + + auto parentProcessId = -1; + + // The Crashpad Handler doesn't have any HostProcessIdArgument, so we must not try to + // parse it lest we want an ArgumentNullException. + if (type == "crashpad-handler") + { + //Lower the shutdown priority so the browser process is shutdown first (Issue #3155) + //The system terminates the process without displaying a retry dialog box for the user. + //Crashpad is lower than other sub processes so it can still monitor process exit crashes. + SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY); + } + else + { + //Lower the shutdown priority so the browser process is shutdown first (Issue #3155) + //The system terminates the process without displaying a retry dialog box for the user. + SetProcessShutdownParameters(0x200, SHUTDOWN_NORETRY); + + parentProcessId = int::Parse(CommandLineArgsParser::GetArgumentValue(args, CefSharpArguments::HostProcessIdArgument)); + if (CommandLineArgsParser::HasArgument(args, CefSharpArguments::ExitIfParentProcessClosed)) + { + ParentProcessMonitor::StartMonitorTask(parentProcessId); + } + } + + // Use our custom subProcess provides features like EvaluateJavascript + if (type == "renderer") + { + auto subProcess = GetSubprocess(args, parentProcessId, handler); + + try + { + return subProcess->Run(); + } + finally + { + delete subProcess; + } + } + + return SubProcess::ExecuteProcess(args); + } + + protected: + virtual SubProcess^ GetSubprocess(IEnumerable^ args, int parentProcessId, IRenderProcessHandler^ handler) + { + return gcnew SubProcess(handler, args); + } + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/Cef.h b/CefSharp.BrowserSubprocess.Core/Cef.h new file mode 100644 index 0000000000..61187e8762 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/Cef.h @@ -0,0 +1,34 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include\cef_v8.h" + +namespace CefSharp +{ + namespace BrowserSubprocess + { + /// + /// Global CEF methods are exposed through this class. e.g. CefRegisterExtension maps to Cef.RegisterExtension + /// Only methods relevant to the Render Process are included in this class. + /// CEF API Doc https://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html + /// This class cannot be inherited. + /// + public ref class Cef sealed + { + public: + /// + /// Register a new V8 extension with the specified JavaScript extension code. + /// + /// name + /// JavaScript code + static void RegisterExtension(String^ name, String^ javascriptCode) + { + CefRegisterExtension(StringUtils::ToNative(name), StringUtils::ToNative(javascriptCode), nullptr); + } + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp index 32f80c93e7..91b45bf450 100644 --- a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp @@ -9,532 +9,672 @@ #include "CefBrowserWrapper.h" #include "CefAppUnmanagedWrapper.h" #include "RegisterBoundObjectHandler.h" +#include "BindObjectAsyncHandler.h" +#include "JavascriptPostMessageHandler.h" #include "JavascriptRootObjectWrapper.h" +#include "JavascriptPromiseHandler.h" +#include "JavascriptPromiseResolverCatch.h" +#include "JavascriptPromiseResolverThen.h" #include "Async\JavascriptAsyncMethodCallback.h" #include "Serialization\V8Serialization.h" #include "Serialization\JsObjectsSerialization.h" #include "Wrapper\V8Context.h" #include "Wrapper\Frame.h" #include "Wrapper\Browser.h" -#include "..\CefSharp.Core\Internals\Messaging\Messages.h" -#include "..\CefSharp.Core\Internals\Serialization\Primitives.h" +#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h" +#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h" +#include using namespace System; using namespace System::Diagnostics; using namespace System::Collections::Generic; -using namespace CefSharp::BrowserSubprocess; +using namespace CefSharp::BrowserSubprocess::Serialization; using namespace CefSharp::Internals::Messaging; using namespace CefSharp::Internals::Serialization; namespace CefSharp { - const CefString CefAppUnmanagedWrapper::kPromiseCreatorScript = "" - "(function()" - "{" - " var result = {};" - " var promise = new Promise(function(resolve, reject) {" - " result.res = resolve; result.rej = reject;" - " });" - " result.p = promise;" - " return result;" - "})();"; - - CefRefPtr CefAppUnmanagedWrapper::GetRenderProcessHandler() + namespace BrowserSubprocess { - return this; - }; - - // CefRenderProcessHandler - void CefAppUnmanagedWrapper::OnBrowserCreated(CefRefPtr browser) - { - auto wrapper = gcnew CefBrowserWrapper(browser); - _onBrowserCreated->Invoke(wrapper); - - //Multiple CefBrowserWrappers created when opening popups - _browserWrappers->TryAdd(browser->GetIdentifier(), wrapper); - } - - void CefAppUnmanagedWrapper::OnBrowserDestroyed(CefRefPtr browser) - { - CefBrowserWrapper^ wrapper; - if (_browserWrappers->TryRemove(browser->GetIdentifier(), wrapper)) + const CefString CefAppUnmanagedWrapper::kPromiseCreatorScript = "" + "(function()" + "{" + " var result = {};" + " var promise = new Promise(function(resolve, reject) {" + " result.res = resolve; result.rej = reject;" + " });" + " result.p = promise;" + " return result;" + "})();"; + + const CefString kRenderProcessId = CefString("RenderProcessId"); + const CefString kRenderProcessIdCamelCase = CefString("renderProcessId"); + + CefRefPtr CefAppUnmanagedWrapper::GetRenderProcessHandler() { - _onBrowserDestroyed->Invoke(wrapper); - delete wrapper; - } - }; + return this; + }; - void CefAppUnmanagedWrapper::OnContextCreated(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) - { - if (!Object::ReferenceEquals(_handler, nullptr)) + // CefRenderProcessHandler + void CefAppUnmanagedWrapper::OnBrowserCreated(CefRefPtr browser, CefRefPtr extraInfo) { - Browser browserWrapper(browser); - Frame frameWrapper(frame); - V8Context contextWrapper(context); + auto wrapper = gcnew CefBrowserWrapper(browser); + _onBrowserCreated->Invoke(wrapper); - _handler->OnContextCreated(%browserWrapper, %frameWrapper, %contextWrapper); - } + //Multiple CefBrowserWrappers created when opening popups + auto browserId = browser->GetIdentifier(); + _browserWrappers->TryAdd(browserId, wrapper); - if (_legacyBindingEnabled) - { - if (_javascriptObjects->Count > 0) + auto javascriptBindingSettings = gcnew JavascriptBindingSettings(); + _browserJavascriptBindingSettings->TryAdd(browserId, javascriptBindingSettings); + + if (!extraInfo.get()) { - auto rootObject = GetJsRootObjectWrapper(browser->GetIdentifier(), frame->GetIdentifier()); - if (rootObject != nullptr) - { - rootObject->Bind(_javascriptObjects->Values, context->GetGlobal()); - } + return; } - } - //TODO: Look at adding some sort of javascript mapping layer to reduce the code duplication - auto global = context->GetGlobal(); - auto browserWrapper = FindBrowserWrapper(browser->GetIdentifier()); + //For the main browser only we check LegacyBindingEnabled and + //load the objects. Popups don't send this information and checking + //will override the _legacyBindingEnabled field + if (!browser->IsPopup()) + { + _legacyBindingEnabled = extraInfo->GetBool("LegacyBindingEnabled"); - auto cefSharpObj = CefV8Value::CreateObject(NULL, NULL); - global->SetValue("CefSharp", cefSharpObj, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); + if (_legacyBindingEnabled) + { + auto objects = extraInfo->GetList("LegacyBindingObjects"); + if (objects.get() && objects->IsValid()) + { + auto javascriptObjects = DeserializeJsObjects(objects, 0); - //We'll support both CefSharp and cefSharp, for those who prefer the JS style - auto cefSharpObjCamelCase = CefV8Value::CreateObject(NULL, NULL); - global->SetValue("cefSharp", cefSharpObjCamelCase, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); + for each (JavascriptObject ^ obj in Enumerable::OfType(javascriptObjects)) + { + //Using LegacyBinding with multiple ChromiumWebBrowser instances that share the same + //render process and using LegacyBinding will cause problems for the limited caching implementation + //that exists at the moment, for now we'll remove an object if already exists, same behaviour + //as the new binding method. + //TODO: This should be removed when https://github.com/cefsharp/CefSharp/issues/2306 + //Is complete as objects will be stored at the browser level + if (_javascriptObjects->ContainsKey(obj->JavascriptName)) + { + _javascriptObjects->Remove(obj->JavascriptName); + } + _javascriptObjects->Add(obj->JavascriptName, obj); + } + } + } + } - //TODO: JSB: Split functions into their own classes - //Browser wrapper is only used for BindObjectAsync - auto bindObjAsyncFunction = CefV8Value::CreateFunction(kBindObjectAsync, new RegisterBoundObjectHandler(_registerBoundObjectRegistry, _javascriptObjects, browserWrapper)); - auto unBindObjFunction = CefV8Value::CreateFunction(kDeleteBoundObject, new RegisterBoundObjectHandler(_registerBoundObjectRegistry, _javascriptObjects, nullptr)); - auto removeObjectFromCacheFunction = CefV8Value::CreateFunction(kRemoveObjectFromCache, new RegisterBoundObjectHandler(_registerBoundObjectRegistry, _javascriptObjects, nullptr)); - auto isObjectCachedFunction = CefV8Value::CreateFunction(kIsObjectCached, new RegisterBoundObjectHandler(_registerBoundObjectRegistry, _javascriptObjects, nullptr)); + if (extraInfo->HasKey("JavascriptBindingApiEnabled")) + { + javascriptBindingSettings->JavascriptBindingApiEnabled = extraInfo->GetBool("JavascriptBindingApiEnabled"); + } - cefSharpObj->SetValue(kBindObjectAsync, bindObjAsyncFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); - cefSharpObj->SetValue(kDeleteBoundObject, unBindObjFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); - cefSharpObj->SetValue(kRemoveObjectFromCache, removeObjectFromCacheFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); - cefSharpObj->SetValue(kIsObjectCached, isObjectCachedFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + if (extraInfo->HasKey("JavascriptBindingApiHasAllowOrigins")) + { + javascriptBindingSettings->JavascriptBindingApiHasAllowOrigins = extraInfo->GetBool("JavascriptBindingApiHasAllowOrigins"); - cefSharpObjCamelCase->SetValue(kBindObjectAsyncCamelCase, bindObjAsyncFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); - cefSharpObjCamelCase->SetValue(kDeleteBoundObjectCamelCase, unBindObjFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); - cefSharpObjCamelCase->SetValue(kRemoveObjectFromCacheCamelCase, removeObjectFromCacheFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); - cefSharpObjCamelCase->SetValue(kIsObjectCachedCamelCase, isObjectCachedFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + if (javascriptBindingSettings->JavascriptBindingApiHasAllowOrigins) + { + auto allowOrigins = extraInfo->GetList("JavascriptBindingApiAllowOrigins"); + if (allowOrigins.get() && allowOrigins->IsValid()) + { + javascriptBindingSettings->JavascriptBindingApiAllowOrigins = allowOrigins->Copy(); + } + } + } - //Send a message to the browser processing signaling that OnContextCreated has been called - //only param is the FrameId. Previous sent only for main frame, now sent for all frames - //Message sent after legacy objects have been bound and the CefSharp bind async helper methods - //have been created - auto contextCreatedMessage = CefProcessMessage::Create(kOnContextCreatedRequest); + if (extraInfo->HasKey("JsBindingPropertyName") || extraInfo->HasKey("JsBindingPropertyNameCamelCase")) + { + //TODO: Create constant for these and legacy binding strings above + _jsBindingPropertyName = extraInfo->GetString("JsBindingPropertyName"); + _jsBindingPropertyNameCamelCase = extraInfo->GetString("JsBindingPropertyNameCamelCase"); + } + } - SetInt64(contextCreatedMessage->GetArgumentList(), 0, frame->GetIdentifier()); + void CefAppUnmanagedWrapper::OnBrowserDestroyed(CefRefPtr browser) + { + CefBrowserWrapper^ wrapper; + if (_browserWrappers->TryRemove(browser->GetIdentifier(), wrapper)) + { + _onBrowserDestroyed->Invoke(wrapper); + delete wrapper; + } - browser->SendProcessMessage(CefProcessId::PID_BROWSER, contextCreatedMessage); - }; + // Don't remove javascript settings because cef is unreliable in calling OnBrowserCreated/OnBrowserDestroyed consistently: + // https://github.com/cefsharp/CefSharp/issues/5228 + }; - void CefAppUnmanagedWrapper::OnContextReleased(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) - { - if (!Object::ReferenceEquals(_handler, nullptr)) + void CefAppUnmanagedWrapper::OnContextCreated(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) { - Browser browserWrapper(browser); - Frame frameWrapper(frame); - V8Context contextWrapper(context); + if (!Object::ReferenceEquals(_handler, nullptr)) + { + Browser browserWrapper(browser); + Frame frameWrapper(frame); + V8Context contextWrapper(context); - _handler->OnContextReleased(%browserWrapper, %frameWrapper, %contextWrapper); - } + _handler->OnContextCreated(% browserWrapper, % frameWrapper, % contextWrapper); + } - auto contextReleasedMessage = CefProcessMessage::Create(kOnContextReleasedRequest); + //Skip additional contexts (DevTools, extensions) to avoid + //double binding and duplicate calls to IRenderProcessMessageHandler.OnContextCreated + //https://github.com/chromiumembedded/cef/issues/3867 + bool isSameContext = frame->GetV8Context()->IsSame(context); + if (!isSameContext) + return; + auto rootObject = GetJsRootObjectWrapper(browser->GetIdentifier(), frame->GetIdentifier()); - SetInt64(contextReleasedMessage->GetArgumentList(), 0, frame->GetIdentifier()); + if (_legacyBindingEnabled) + { + if (_javascriptObjects->Count > 0 && rootObject != nullptr) + { + rootObject->Bind(_javascriptObjects->Values, context->GetGlobal()); + } + } - browser->SendProcessMessage(CefProcessId::PID_BROWSER, contextReleasedMessage); + JavascriptBindingSettings^ javascriptBindingSettings = nullptr; + _browserJavascriptBindingSettings->TryGetValue(browser->GetIdentifier(), javascriptBindingSettings); - auto browserWrapper = FindBrowserWrapper(browser->GetIdentifier()); + if (IsJavascriptBindingApiAllowed(javascriptBindingSettings, frame)) + { + //TODO: Look at adding some sort of javascript mapping layer to reduce the code duplication + auto global = context->GetGlobal(); + auto processId = System::Diagnostics::Process::GetCurrentProcess()->Id; + + //TODO: JSB: Split functions into their own classes + //Browser wrapper is only used for BindObjectAsync + auto bindObjAsyncFunction = CefV8Value::CreateFunction(kBindObjectAsync, new BindObjectAsyncHandler(_registerBoundObjectRegistry, _javascriptObjects, rootObject)); + auto unBindObjFunction = CefV8Value::CreateFunction(kDeleteBoundObject, new RegisterBoundObjectHandler(_javascriptObjects)); + auto removeObjectFromCacheFunction = CefV8Value::CreateFunction(kRemoveObjectFromCache, new RegisterBoundObjectHandler(_javascriptObjects)); + auto isObjectCachedFunction = CefV8Value::CreateFunction(kIsObjectCached, new RegisterBoundObjectHandler(_javascriptObjects)); + auto postMessageFunction = CefV8Value::CreateFunction(kPostMessage, new JavascriptPostMessageHandler(rootObject == nullptr ? nullptr : rootObject->CallbackRegistry)); + auto promiseHandlerFunction = CefV8Value::CreateFunction(kSendEvalScriptResponse, new JavascriptPromiseHandler()); + + //By default We'll support both CefSharp and cefSharp, for those who prefer the JS style + auto createCefSharpObj = !_jsBindingPropertyName.empty(); + auto createCefSharpObjCamelCase = !_jsBindingPropertyNameCamelCase.empty(); + + if (createCefSharpObj) + { + auto cefSharpObj = CefV8Value::CreateObject(nullptr, nullptr); + cefSharpObj->SetValue(kBindObjectAsync, bindObjAsyncFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObj->SetValue(kDeleteBoundObject, unBindObjFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObj->SetValue(kRemoveObjectFromCache, removeObjectFromCacheFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObj->SetValue(kIsObjectCached, isObjectCachedFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObj->SetValue(kPostMessage, postMessageFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObj->SetValue(kSendEvalScriptResponse, promiseHandlerFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObj->SetValue(kRenderProcessId, CefV8Value::CreateInt(processId), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + + global->SetValue(_jsBindingPropertyName, cefSharpObj, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); + } - //If we no longer have a browser wrapper reference then there's nothing we can do - if (browserWrapper == nullptr) - { - return; - } + if (createCefSharpObjCamelCase) + { + auto cefSharpObjCamelCase = CefV8Value::CreateObject(nullptr, nullptr); + cefSharpObjCamelCase->SetValue(kBindObjectAsyncCamelCase, bindObjAsyncFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObjCamelCase->SetValue(kDeleteBoundObjectCamelCase, unBindObjFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObjCamelCase->SetValue(kRemoveObjectFromCacheCamelCase, removeObjectFromCacheFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObjCamelCase->SetValue(kIsObjectCachedCamelCase, isObjectCachedFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObjCamelCase->SetValue(kPostMessageCamelCase, postMessageFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObjCamelCase->SetValue(kSendEvalScriptResponseCamelCase, promiseHandlerFunction, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefSharpObjCamelCase->SetValue(kRenderProcessIdCamelCase, CefV8Value::CreateInt(processId), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + + global->SetValue(_jsBindingPropertyNameCamelCase, cefSharpObjCamelCase, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); + } + } - auto rootObjectWrappers = browserWrapper->JavascriptRootObjectWrappers; + //Send a message to the browser processing signaling that OnContextCreated has been called + //only param is the FrameId. Previous sent only for main frame, now sent for all frames + //Message sent after legacy objects have been bound and the CefSharp bind async helper methods + //have been created + auto contextCreatedMessage = CefProcessMessage::Create(kOnContextCreatedRequest); - JavascriptRootObjectWrapper^ wrapper; - if (rootObjectWrappers->TryRemove(frame->GetIdentifier(), wrapper)) - { - delete wrapper; - } - }; + frame->SendProcessMessage(CefProcessId::PID_BROWSER, contextCreatedMessage); + }; - void CefAppUnmanagedWrapper::OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) - { - if (!_focusedNodeChangedEnabled) + void CefAppUnmanagedWrapper::OnContextReleased(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) { - return; - } + if (!Object::ReferenceEquals(_handler, nullptr)) + { + Browser browserWrapper(browser); + Frame frameWrapper(frame); + V8Context contextWrapper(context); - auto focusedNodeChangedMessage = CefProcessMessage::Create(kOnFocusedNodeChanged); - auto list = focusedNodeChangedMessage->GetArgumentList(); + _handler->OnContextReleased(% browserWrapper, % frameWrapper, % contextWrapper); + } - // Needed in the browser process to get the frame. - SetInt64(list, 0, frame->GetIdentifier()); + auto contextReleasedMessage = CefProcessMessage::Create(kOnContextReleasedRequest); - // The node will be empty if an element loses focus but another one - // doesn't gain focus. Only transfer information if the node is an - // element. - if (node != nullptr && node->IsElement()) - { - // True when a node exists, false if it doesn't. - list->SetBool(1, true); + frame->SendProcessMessage(CefProcessId::PID_BROWSER, contextReleasedMessage); - // Store the tag name. - list->SetString(2, node->GetElementTagName()); + auto rootObjectWrappers = _jsRootObjectWrappersByFrameId; - // Transfer the attributes in a Dictionary. - auto attributes = CefDictionaryValue::Create(); - CefDOMNode::AttributeMap attributeMap; - node->GetElementAttributes(attributeMap); - for (auto iter : attributeMap) + //If we no longer have a _jsRootObjectWrappersByFrameId reference then there's nothing we can do + if (Object::ReferenceEquals(rootObjectWrappers, nullptr)) { - attributes->SetString(iter.first, iter.second); + return; } - list->SetDictionary(3, attributes); - } - else + JavascriptRootObjectWrapper^ wrapper; + if (rootObjectWrappers->TryRemove(StringUtils::ToClr(frame->GetIdentifier()), wrapper)) + { + delete wrapper; + } + }; + + void CefAppUnmanagedWrapper::OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) { - list->SetBool(1, false); - } + if (!_focusedNodeChangedEnabled) + { + return; + } - browser->SendProcessMessage(CefProcessId::PID_BROWSER, focusedNodeChangedMessage); - } + auto focusedNodeChangedMessage = CefProcessMessage::Create(kOnFocusedNodeChanged); + auto list = focusedNodeChangedMessage->GetArgumentList(); - void CefAppUnmanagedWrapper::OnUncaughtException(CefRefPtr browser, CefRefPtr frame, CefRefPtr context, CefRefPtr exception, CefRefPtr stackTrace) - { - auto uncaughtExceptionMessage = CefProcessMessage::Create(kOnUncaughtException); - auto list = uncaughtExceptionMessage->GetArgumentList(); + // The node will be empty if an element loses focus but another one + // doesn't gain focus. Only transfer information if the node is an + // element. + if (node != nullptr && node->IsElement()) + { + // True when a node exists, false if it doesn't. + list->SetBool(0, true); - // Needed in the browser process to get the frame. - SetInt64(list, 0, frame->GetIdentifier()); - list->SetString(1, exception->GetMessage()); + // Store the tag name. + list->SetString(1, node->GetElementTagName()); - auto frames = CefListValue::Create(); - for (auto i = 0; i < stackTrace->GetFrameCount(); i++) - { - auto frame = CefListValue::Create(); - auto frameArg = stackTrace->GetFrame(i); + // Transfer the attributes in a Dictionary. + auto attributes = CefDictionaryValue::Create(); + CefDOMNode::AttributeMap attributeMap; + node->GetElementAttributes(attributeMap); + for (auto iter : attributeMap) + { + attributes->SetString(iter.first, iter.second); + } - frame->SetString(0, frameArg->GetFunctionName()); - frame->SetInt(1, frameArg->GetLineNumber()); - frame->SetInt(2, frameArg->GetColumn()); - frame->SetString(3, frameArg->GetScriptNameOrSourceURL()); + list->SetDictionary(2, attributes); + } + else + { + list->SetBool(0, false); + } - frames->SetList(i, frame); + frame->SendProcessMessage(CefProcessId::PID_BROWSER, focusedNodeChangedMessage); } - list->SetList(2, frames); + void CefAppUnmanagedWrapper::OnUncaughtException(CefRefPtr browser, CefRefPtr frame, CefRefPtr context, CefRefPtr exception, CefRefPtr stackTrace) + { + auto uncaughtExceptionMessage = CefProcessMessage::Create(kOnUncaughtException); + auto list = uncaughtExceptionMessage->GetArgumentList(); - browser->SendProcessMessage(CefProcessId::PID_BROWSER, uncaughtExceptionMessage); - } + list->SetString(0, exception->GetMessage()); - JavascriptRootObjectWrapper^ CefAppUnmanagedWrapper::GetJsRootObjectWrapper(int browserId, int64 frameId) - { - auto browserWrapper = FindBrowserWrapper(browserId); + auto frames = CefListValue::Create(); + for (auto i = 0; i < stackTrace->GetFrameCount(); i++) + { + auto stackTraceFrame = CefListValue::Create(); + auto frameArg = stackTrace->GetFrame(i); - if (browserWrapper == nullptr) - { - return nullptr; - } + stackTraceFrame->SetString(0, frameArg->GetFunctionName()); + stackTraceFrame->SetInt(1, frameArg->GetLineNumber()); + stackTraceFrame->SetInt(2, frameArg->GetColumn()); + stackTraceFrame->SetString(3, frameArg->GetScriptNameOrSourceURL()); - auto rootObjectWrappers = browserWrapper->JavascriptRootObjectWrappers; + frames->SetList(i, stackTraceFrame); + } - JavascriptRootObjectWrapper^ rootObject; - if (!rootObjectWrappers->TryGetValue(frameId, rootObject)) - { - rootObject = gcnew JavascriptRootObjectWrapper(browserId, browserWrapper->BrowserProcess); - rootObjectWrappers->TryAdd(frameId, rootObject); - } + list->SetList(1, frames); - return rootObject; - } + frame->SendProcessMessage(CefProcessId::PID_BROWSER, uncaughtExceptionMessage); + } - CefBrowserWrapper^ CefAppUnmanagedWrapper::FindBrowserWrapper(int browserId) - { - CefBrowserWrapper^ wrapper = nullptr; + JavascriptRootObjectWrapper^ CefAppUnmanagedWrapper::GetJsRootObjectWrapper(int browserId, const CefString& frameId) + { + auto rootObjectWrappers = _jsRootObjectWrappersByFrameId; - _browserWrappers->TryGetValue(browserId, wrapper); + if (Object::ReferenceEquals(rootObjectWrappers, nullptr)) + { + return nullptr; + } - if (wrapper == nullptr) - { - //TODO: Find the syntax for delcaring the native string directly - LOG(ERROR) << StringUtils::ToNative("Failed to identify BrowserWrapper in OnContextCreated BrowserId:" + browserId).ToString(); - } + auto frameIdClr = StringUtils::ToClr(frameId); - return wrapper; - } + JavascriptRootObjectWrapper^ rootObject; + if (!rootObjectWrappers->TryGetValue(frameIdClr, rootObject)) + { +#ifdef NETCOREAPP + rootObject = gcnew JavascriptRootObjectWrapper(); +#else + auto browserWrapper = FindBrowserWrapper(browserId); + + rootObject = gcnew JavascriptRootObjectWrapper(browserWrapper == nullptr ? nullptr : browserWrapper->BrowserProcess); +#endif + rootObjectWrappers->TryAdd(frameIdClr, rootObject); + } - bool CefAppUnmanagedWrapper::OnProcessMessageReceived(CefRefPtr browser, CefProcessId sourceProcessId, CefRefPtr message) - { - auto handled = false; - auto name = message->GetName(); - auto argList = message->GetArgumentList(); + return rootObject; + } - auto browserWrapper = FindBrowserWrapper(browser->GetIdentifier()); - //Error handling for missing/closed browser - if (browserWrapper == nullptr) + bool CefAppUnmanagedWrapper::IsJavascriptBindingApiAllowed(JavascriptBindingSettings^ javascriptBindingSettings, CefRefPtr frame) { - if (name == kJavascriptCallbackDestroyRequest || - name == kJavascriptRootObjectResponse || - name == kJavascriptAsyncMethodCallResponse) + if (javascriptBindingSettings == nullptr) { - //If we can't find the browser wrapper then we'll just - //ignore this as it's likely already been disposed of - return true; + return false; } - CefString responseName; - if (name == kEvaluateJavascriptRequest) + if (!javascriptBindingSettings->JavascriptBindingApiEnabled) { - responseName = kEvaluateJavascriptResponse; + return false; } - else if (name == kJavascriptCallbackRequest) + + if (!javascriptBindingSettings->JavascriptBindingApiHasAllowOrigins) { - responseName = kJavascriptCallbackResponse; + return true; } - else + + auto allowOrigins = javascriptBindingSettings->JavascriptBindingApiAllowOrigins; + if (!allowOrigins.get()) { - //TODO: Should be throw an exception here? It's likely that only a CefSharp developer would see this - // when they added a new message and haven't yet implemented the render process functionality. - throw gcnew Exception("Unsupported message type"); + return false; } - auto callbackId = GetInt64(argList, 1); - auto response = CefProcessMessage::Create(responseName); - auto responseArgList = response->GetArgumentList(); - auto errorMessage = String::Format("Request BrowserId : {0} not found it's likely the browser is already closed", browser->GetIdentifier()); + auto frameUrl = frame->GetURL(); + + CefURLParts frameUrlParts; + + if (CefParseURL(frameUrl, frameUrlParts)) + { + auto originStr = frameUrlParts.origin.str; + auto originLen = frameUrlParts.origin.length; + + if (originLen > 0 && originStr[originLen - 1] == L'/') + { + originLen--; + } + + auto frameUrlOrigin = CefString(originStr, originLen); + + auto size = static_cast(allowOrigins->GetSize()); + + for (int i = 0; i < size; i++) + { + auto origin = allowOrigins->GetString(i); - //success: false - responseArgList->SetBool(0, false); - SetInt64(responseArgList, 1, callbackId); - responseArgList->SetString(2, StringUtils::ToNative(errorMessage)); - browser->SendProcessMessage(sourceProcessId, response); + if (_wcsicmp(frameUrlOrigin.ToWString().c_str(), origin.ToWString().c_str()) == 0) + { + return true; + } + } + } - return true; + return false; } - //these messages are roughly handled the same way - if (name == kEvaluateJavascriptRequest || name == kJavascriptCallbackRequest) + CefBrowserWrapper^ CefAppUnmanagedWrapper::FindBrowserWrapper(int browserId) { - bool success = false; - CefRefPtr result; - CefString errorMessage; - CefRefPtr response; + CefBrowserWrapper^ wrapper = nullptr; - if (name == kEvaluateJavascriptRequest) - { - response = CefProcessMessage::Create(kEvaluateJavascriptResponse); - } - else + _browserWrappers->TryGetValue(browserId, wrapper); + + if (wrapper == nullptr) { - response = CefProcessMessage::Create(kJavascriptCallbackResponse); + //TODO: Find the syntax for delcaring the native string directly + LOG(ERROR) << StringUtils::ToNative("Failed to identify BrowserWrapper in OnContextCreated BrowserId:" + browserId).ToString(); } - //both messages have the frameId stored at 0 and callbackId stored at index 1 - auto frameId = GetInt64(argList, 0); - int64 callbackId = GetInt64(argList, 1); + return wrapper; + } - if (name == kEvaluateJavascriptRequest) + bool CefAppUnmanagedWrapper::OnProcessMessageReceived(CefRefPtr browser, CefRefPtr frame, CefProcessId sourceProcessId, CefRefPtr message) + { + auto handled = false; + auto name = message->GetName(); + auto argList = message->GetArgumentList(); + + //these messages are roughly handled the same way + if (name == kEvaluateJavascriptRequest || name == kJavascriptCallbackRequest) { + bool sendResponse = true; + bool success = false; + CefRefPtr result; + CefString errorMessage; + CefRefPtr response; - JavascriptRootObjectWrapper^ rootObjectWrapper; - browserWrapper->JavascriptRootObjectWrappers->TryGetValue(frameId, rootObjectWrapper); + if (name == kEvaluateJavascriptRequest) + { + response = CefProcessMessage::Create(kEvaluateJavascriptResponse); + } + else + { + response = CefProcessMessage::Create(kJavascriptCallbackResponse); + } + + //both messages have callbackId stored at index 0 + auto frameId = StringUtils::ToClr(frame->GetIdentifier()); + int64_t callbackId = GetInt64(argList, 0); //NOTE: In the rare case when when OnContextCreated hasn't been called we need to manually create the rootObjectWrapper //It appears that OnContextCreated is only called for pages that have javascript on them, which makes sense //as without javascript there is no need for a context. - if (rootObjectWrapper == nullptr) + JavascriptRootObjectWrapper^ rootObjectWrapper = GetJsRootObjectWrapper(browser->GetIdentifier(), frame->GetIdentifier()); + + if (name == kEvaluateJavascriptRequest) { - rootObjectWrapper = gcnew JavascriptRootObjectWrapper(browser->GetIdentifier(), browserWrapper->BrowserProcess); + auto script = argList->GetString(1); + auto scriptUrl = argList->GetString(2); + auto startLine = argList->GetInt(3); - browserWrapper->JavascriptRootObjectWrappers->TryAdd(frameId, rootObjectWrapper); - } + if (frame.get() && frame->IsValid()) + { + auto context = frame->GetV8Context(); - auto callbackRegistry = rootObjectWrapper->CallbackRegistry; + if (context.get() && context->Enter()) + { + try + { + CefRefPtr exception; + success = context->Eval(script, scriptUrl, startLine, result, exception); - auto script = argList->GetString(2); - auto scriptUrl = argList->GetString(3); - auto startLine = argList->GetInt(4); + //we need to do this here to be able to store the v8context + if (success) + { + //If the response is a string of CefSharpDefEvalScriptRes then + //we don't send the response, we'll let that happen when the promise has completed. + if (result->IsString() && result->GetStringValue() == "CefSharpDefEvalScriptRes") + { + sendResponse = false; + } + else if (result->IsPromise()) + { + sendResponse = false; - auto frame = browser->GetFrame(frameId); - if (frame.get()) - { - auto context = frame->GetV8Context(); + auto promiseThen = result->GetValue("then"); + auto promiseCatch = result->GetValue("catch"); - if (context.get() && context->Enter()) - { - try - { - CefRefPtr exception; - success = context->Eval(script, scriptUrl, startLine, result, exception); + auto promiseThenFunc = CefV8Value::CreateFunction("promiseResolverThen", new JavascriptPromiseResolverThen(callbackId, false)); + auto promiseCatchFunc = CefV8Value::CreateFunction("promiseResolverCatch", new JavascriptPromiseResolverCatch(callbackId, false)); - //we need to do this here to be able to store the v8context - if (success) - { - auto responseArgList = response->GetArgumentList(); - SerializeV8Object(result, responseArgList, 2, callbackRegistry); + CefV8ValueList promiseThenArgs; + promiseThenArgs.push_back(promiseThenFunc); + promiseThen->ExecuteFunction(result, promiseThenArgs); + + CefV8ValueList promiseCatchArgs; + promiseCatchArgs.push_back(promiseCatchFunc); + promiseCatch->ExecuteFunction(result, promiseCatchArgs); + } + else + { + auto callbackRegistry = rootObjectWrapper == nullptr ? nullptr : rootObjectWrapper->CallbackRegistry; + + if (callbackRegistry == nullptr) + { + errorMessage = StringUtils::ToNative("The callback registry for Frame " + frameId + " is no longer available."); + } + else + { + auto responseArgList = response->GetArgumentList(); + SerializeV8Object(result, responseArgList, 2, callbackRegistry); + } + } + } + else + { + errorMessage = StringUtils::CreateExceptionString(exception); + } } - else + finally { - errorMessage = StringUtils::CreateExceptionString(exception); + context->Exit(); } } - finally + else { - context->Exit(); + errorMessage = "Unable to Enter Context"; } } else { - errorMessage = "Unable to Enter Context"; + errorMessage = StringUtils::ToNative("Frame " + frameId + " is no longer available, most likely the Frame has been Disposed or Removed."); } } else { - errorMessage = StringUtils::ToNative("Frame " + frameId + " is no longer available, most likely the Frame has been Disposed or Removed."); - } - } - else - { - JavascriptRootObjectWrapper^ rootObjectWrapper; - browserWrapper->JavascriptRootObjectWrappers->TryGetValue(frameId, rootObjectWrapper); - auto callbackRegistry = rootObjectWrapper == nullptr ? nullptr : rootObjectWrapper->CallbackRegistry; - if (callbackRegistry == nullptr) - { - errorMessage = StringUtils::ToNative("The callback registry for Frame " + frameId + " is no longer available, most likely the Frame has been Disposed."); - } - else - { - auto jsCallbackId = GetInt64(argList, 2); - - auto callbackWrapper = callbackRegistry->FindWrapper(jsCallbackId); - if (callbackWrapper == nullptr) + auto callbackRegistry = rootObjectWrapper == nullptr ? nullptr : rootObjectWrapper->CallbackRegistry; + if (callbackRegistry == nullptr) { - errorMessage = StringUtils::ToNative("Unable to find JavascriptCallback with Id " + jsCallbackId + " for Frame " + frameId); + errorMessage = StringUtils::ToNative("The callback registry for Frame " + frameId + " is no longer available, most likely the Frame has been Disposed."); } else { - auto context = callbackWrapper->GetContext(); - auto value = callbackWrapper->GetValue(); + auto jsCallbackId = GetInt64(argList, 1); - if (context.get() && context->Enter()) + auto callbackWrapper = callbackRegistry->FindWrapper(jsCallbackId); + if (callbackWrapper == nullptr) { - try - { - auto parameterList = argList->GetList(3); - CefV8ValueList params; + errorMessage = StringUtils::ToNative("Unable to find JavascriptCallback with Id " + jsCallbackId + " for Frame " + frameId); + } + else + { + auto context = callbackWrapper->GetContext(); + auto value = callbackWrapper->GetValue(); - //Needs to be called within the context as for Dictionary (mapped to struct) - //a V8Object will be created - for (CefV8ValueList::size_type i = 0; i < parameterList->GetSize(); i++) + if (context.get() && context->Enter()) + { + try { - params.push_back(DeserializeV8Object(parameterList, static_cast(i))); - } + auto parameterList = argList->GetList(2); + CefV8ValueList params; + + //Needs to be called within the context as for Dictionary (mapped to struct) + //a V8Object will be created + for (CefV8ValueList::size_type i = 0; i < parameterList->GetSize(); i++) + { + params.push_back(DeserializeV8Object(parameterList, static_cast(i))); + } - result = value->ExecuteFunction(nullptr, params); - success = result.get() != nullptr; + result = value->ExecuteFunction(nullptr, params); + success = result.get() != nullptr; - //we need to do this here to be able to store the v8context - if (success) - { - auto responseArgList = response->GetArgumentList(); - SerializeV8Object(result, responseArgList, 2, callbackRegistry); + //we need to do this here to be able to store the v8context + if (success) + { + //If the response is a string of CefSharpDefEvalScriptRes then + //we don't send the response, we'll let that happen when the promise has completed. + if (result->IsString() && result->GetStringValue() == "CefSharpDefEvalScriptRes") + { + sendResponse = false; + } + else if (result->IsPromise()) + { + sendResponse = false; + + auto promiseThen = result->GetValue("then"); + auto promiseCatch = result->GetValue("catch"); + + auto promiseThenFunc = CefV8Value::CreateFunction("promiseResolverThen", new JavascriptPromiseResolverThen(callbackId, true)); + auto promiseCatchFunc = CefV8Value::CreateFunction("promiseResolverCatch", new JavascriptPromiseResolverCatch(callbackId, true)); + + CefV8ValueList promiseThenArgs; + promiseThenArgs.push_back(promiseThenFunc); + promiseThen->ExecuteFunction(result, promiseThenArgs); + + CefV8ValueList promiseCatchArgs; + promiseCatchArgs.push_back(promiseCatchFunc); + promiseCatch->ExecuteFunction(result, promiseCatchArgs); + } + else + { + auto responseArgList = response->GetArgumentList(); + SerializeV8Object(result, responseArgList, 2, callbackRegistry); + } + } + else + { + auto exception = value->GetException(); + errorMessage = StringUtils::CreateExceptionString(exception); + } } - else + finally { - auto exception = value->GetException(); - errorMessage = StringUtils::CreateExceptionString(exception); + context->Exit(); } } - finally + else { - context->Exit(); + errorMessage = "Unable to Enter Context"; } } - else - { - errorMessage = "Unable to Enter Context"; - } } } - } - auto responseArgList = response->GetArgumentList(); - responseArgList->SetBool(0, success); - SetInt64(responseArgList, 1, callbackId); - if (!success) - { - responseArgList->SetString(2, errorMessage); - } - browser->SendProcessMessage(sourceProcessId, response); + if (sendResponse) + { + auto responseArgList = response->GetArgumentList(); + responseArgList->SetBool(0, success); + SetInt64(responseArgList, 1, callbackId); + if (!success) + { + responseArgList->SetString(2, errorMessage); + } + frame->SendProcessMessage(sourceProcessId, response); + } - handled = true; - } - else if (name == kJavascriptCallbackDestroyRequest) - { - auto jsCallbackId = GetInt64(argList, 0); - auto frameId = GetInt64(argList, 1); - JavascriptRootObjectWrapper^ rootObjectWrapper; - browserWrapper->JavascriptRootObjectWrappers->TryGetValue(frameId, rootObjectWrapper); - if (rootObjectWrapper != nullptr && rootObjectWrapper->CallbackRegistry != nullptr) - { - rootObjectWrapper->CallbackRegistry->Deregister(jsCallbackId); + handled = true; } - - handled = true; - } - else if (name == kJavascriptRootObjectResponse) - { - auto useLegacyBehaviour = argList->GetBool(0); - - //For the old legacy behaviour we add the objects - //to the cache - if (useLegacyBehaviour) + else if (name == kJavascriptCallbackDestroyRequest) { - _legacyBindingEnabled = true; - - auto javascriptObjects = DeserializeJsObjects(argList, 4); - - for each (JavascriptObject^ obj in Enumerable::OfType(javascriptObjects)) + if (frame.get() && frame->IsValid()) { - //Using LegacyBinding with multiple ChromiumWebBrowser instances that share the same - //render process and using LegacyBinding will cause problems for the limited caching implementation - //that exists at the moment, for now we'll remove an object if already exists, same behaviour - //as the new binding method. - //TODO: This should be removed when https://github.com/cefsharp/CefSharp/issues/2306 - //Is complete as objects will be stored at the browser level - if (_javascriptObjects->ContainsKey(obj->JavascriptName)) + auto jsCallbackId = GetInt64(argList, 0); + JavascriptRootObjectWrapper^ rootObjectWrapper; + _jsRootObjectWrappersByFrameId->TryGetValue(StringUtils::ToClr(frame->GetIdentifier()), rootObjectWrapper); + if (rootObjectWrapper != nullptr && rootObjectWrapper->CallbackRegistry != nullptr) { - _javascriptObjects->Remove(obj->JavascriptName); + rootObjectWrapper->CallbackRegistry->Deregister(jsCallbackId); } - _javascriptObjects->Add(obj->JavascriptName, obj); } + + handled = true; } - else + else if (name == kJavascriptRootObjectResponse) { - auto browserId = argList->GetInt(1); - auto frameId = GetInt64(argList, 2); - auto callbackId = GetInt64(argList, 3); - auto javascriptObjects = DeserializeJsObjects(argList, 4); - - //Caching of JavascriptObjects - //TODO: JSB Should caching be configurable? On a per object basis? - for each (JavascriptObject^ obj in Enumerable::OfType(javascriptObjects)) + if (browser.get() && frame.get() && frame->IsValid()) { - if (_javascriptObjects->ContainsKey(obj->JavascriptName)) + auto callbackId = GetInt64(argList, 0); + auto javascriptObjects = DeserializeJsObjects(argList, 1); + + //Caching of JavascriptObjects + //TODO: JSB Should caching be configurable? On a per object basis? + for each (JavascriptObject ^ obj in Enumerable::OfType(javascriptObjects)) { - _javascriptObjects->Remove(obj->JavascriptName); + if (_javascriptObjects->ContainsKey(obj->JavascriptName)) + { + _javascriptObjects->Remove(obj->JavascriptName); + } + _javascriptObjects->Add(obj->JavascriptName, obj); } - _javascriptObjects->Add(obj->JavascriptName, obj); - } - auto frame = browser->GetFrame(frameId); - if (frame.get()) - { - auto rootObject = GetJsRootObjectWrapper(browser->GetIdentifier(), frameId); + auto rootObject = GetJsRootObjectWrapper(browser->GetIdentifier(), frame->GetIdentifier()); if (rootObject == nullptr) { @@ -545,15 +685,16 @@ namespace CefSharp if (context.get() && context->Enter()) { + JavascriptAsyncMethodCallback^ callback; + try { rootObject->Bind(javascriptObjects, context->GetGlobal()); - JavascriptAsyncMethodCallback^ callback; if (_registerBoundObjectRegistry->TryGetAndRemoveMethodCallback(callbackId, callback)) { //Response object has no Accessor or Interceptor - auto response = CefV8Value::CreateObject(NULL, NULL); + auto response = CefV8Value::CreateObject(nullptr, nullptr); response->SetValue("Count", CefV8Value::CreateInt(javascriptObjects->Count), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); @@ -579,156 +720,102 @@ namespace CefSharp auto boundObjects = CefListValue::Create(); - for (auto i = 0; i < javascriptObjects->Count; i++) + auto i = 0; + + for each (auto jsObject in javascriptObjects) { auto dict = CefDictionaryValue::Create(); - auto name = javascriptObjects[i]->JavascriptName; - dict->SetString("Name", StringUtils::ToNative(name)); + auto objectName = jsObject->JavascriptName; + dict->SetString("Name", StringUtils::ToNative(objectName)); dict->SetBool("IsCached", false); dict->SetBool("AlreadyBound", false); - boundObjects->SetDictionary(i, dict); + boundObjects->SetDictionary(i++, dict); } args->SetList(0, boundObjects); - browser->SendProcessMessage(CefProcessId::PID_BROWSER, msg); + frame->SendProcessMessage(CefProcessId::PID_BROWSER, msg); } } finally { context->Exit(); + + delete callback; } } } - } - - handled = true; - } - else if (name == kJavascriptAsyncMethodCallResponse) - { - auto frameId = GetInt64(argList, 0); - auto callbackId = GetInt64(argList, 1); - - JavascriptRootObjectWrapper^ rootObjectWrapper; - browserWrapper->JavascriptRootObjectWrappers->TryGetValue(frameId, rootObjectWrapper); + else + { + LOG(INFO) << "CefAppUnmanagedWrapper Frame Invalid"; + } - if (rootObjectWrapper != nullptr) + handled = true; + } + else if (name == kJavascriptAsyncMethodCallResponse) { - JavascriptAsyncMethodCallback^ callback; - if (rootObjectWrapper->TryGetAndRemoveMethodCallback(callbackId, callback)) + if (frame.get() && frame->IsValid()) { + auto frameId = StringUtils::ToClr(frame->GetIdentifier()); + auto callbackId = GetInt64(argList, 0); + + JavascriptRootObjectWrapper^ rootObjectWrapper; + _jsRootObjectWrappersByFrameId->TryGetValue(frameId, rootObjectWrapper); - try + if (rootObjectWrapper != nullptr) { - auto frame = browser->GetFrame(frameId); - if (frame.get()) + JavascriptAsyncMethodCallback^ callback; + if (rootObjectWrapper->TryGetAndRemoveMethodCallback(callbackId, callback)) { - auto context = frame->GetV8Context(); - - if (context.get() && context->Enter()) + try { - try + auto context = frame->GetV8Context(); + + if (context.get() && context->Enter()) { - auto success = argList->GetBool(2); - if (success) + try { - callback->Success(DeserializeV8Object(argList, 3)); + auto success = argList->GetBool(1); + if (success) + { + callback->Success(DeserializeV8Object(argList, 2)); + } + else + { + callback->Fail(argList->GetString(2)); + } } - else + finally { - callback->Fail(argList->GetString(3)); + context->Exit(); } } - finally + else { - context->Exit(); + callback->Fail("Unable to Enter Context"); } } - else + finally { - callback->Fail("Unable to Enter Context"); + //dispose + delete callback; } } } - finally - { - //dispose - delete callback; - } } + handled = true; } - handled = true; - } - return handled; - }; + return handled; + }; - void CefAppUnmanagedWrapper::OnRenderThreadCreated(CefRefPtr extraInfo) - { - //Check to see if we have a list - if (extraInfo.get()) + void CefAppUnmanagedWrapper::OnWebKitInitialized() { - auto extensionList = extraInfo->GetList(0); - if (extensionList.get()) + if (!Object::ReferenceEquals(_handler, nullptr)) { - for (size_t i = 0; i < extensionList->GetSize(); i++) - { - auto extension = extensionList->GetList(i); - auto ext = gcnew V8Extension(StringUtils::ToClr(extension->GetString(0)), StringUtils::ToClr(extension->GetString(1))); - - _extensions->Add(ext); - } + _handler->OnWebKitInitialized(); } } } - - void CefAppUnmanagedWrapper::OnWebKitInitialized() - { - for each(V8Extension^ extension in _extensions->AsReadOnly()) - { - //only support extensions without handlers now - CefRegisterExtension(StringUtils::ToNative(extension->Name), StringUtils::ToNative(extension->JavascriptCode), NULL); - } - } - - void CefAppUnmanagedWrapper::OnRegisterCustomSchemes(CefRawPtr registrar) - { - for each (CefCustomScheme^ scheme in _schemes->AsReadOnly()) - { - int options = cef_scheme_options_t::CEF_SCHEME_OPTION_NONE; - - if (scheme->IsStandard) - { - options |= cef_scheme_options_t::CEF_SCHEME_OPTION_STANDARD; - } - - if (scheme->IsLocal) - { - options |= cef_scheme_options_t::CEF_SCHEME_OPTION_LOCAL; - } - - if (scheme->IsDisplayIsolated) - { - options |= cef_scheme_options_t::CEF_SCHEME_OPTION_DISPLAY_ISOLATED; - } - - if (scheme->IsSecure) - { - options |= cef_scheme_options_t::CEF_SCHEME_OPTION_SECURE; - } - - if (scheme->IsCorsEnabled) - { - options |= cef_scheme_options_t::CEF_SCHEME_OPTION_CORS_ENABLED; - } - - if (scheme->IsCSPBypassing) - { - options |= cef_scheme_options_t::CEF_SCHEME_OPTION_CSP_BYPASSING; - } - - registrar->AddCustomScheme(StringUtils::ToNative(scheme->SchemeName), options); - } - } } diff --git a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.h b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.h index ef037e6d19..d0e3506d3a 100644 --- a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.h @@ -5,10 +5,11 @@ #pragma once #include "Stdafx.h" -#include "include/cef_app.h" #include "include/cef_base.h" +#include "SubProcessApp.h" #include "CefBrowserWrapper.h" +#include "JavascriptBindingSettings.h" #include "RegisterBoundObjectRegistry.h" using namespace System::Collections::Generic; @@ -16,73 +17,100 @@ using namespace CefSharp::RenderProcess; namespace CefSharp { - // This class is the native subprocess level CEF object wrapper. - private class CefAppUnmanagedWrapper : CefApp, CefRenderProcessHandler + namespace BrowserSubprocess { - private: - gcroot _handler; - gcroot^> _onBrowserCreated; - gcroot^> _onBrowserDestroyed; - gcroot^> _browserWrappers; - gcroot^> _extensions; - gcroot^> _schemes; - bool _focusedNodeChangedEnabled; - bool _legacyBindingEnabled; + // This class is the native subprocess level CEF object wrapper. + private class CefAppUnmanagedWrapper : SubProcessApp, CefRenderProcessHandler + { + private: + gcroot _handler; + gcroot^> _onBrowserCreated; + gcroot^> _onBrowserDestroyed; + gcroot^> _browserWrappers; + gcroot^> _browserJavascriptBindingSettings; + gcroot^> _jsRootObjectWrappersByFrameId; + bool _focusedNodeChangedEnabled; + bool _legacyBindingEnabled; - // The serialized registered object data waiting to be used. - gcroot^> _javascriptObjects; + // The property names used to call bound objects + CefString _jsBindingPropertyName; + CefString _jsBindingPropertyNameCamelCase; - gcroot _registerBoundObjectRegistry; + // The serialized registered object data waiting to be used. + gcroot^> _javascriptObjects; - public: - static const CefString kPromiseCreatorScript; + gcroot _registerBoundObjectRegistry; + bool IsJavascriptBindingApiAllowed(JavascriptBindingSettings^ javascriptBindingSettings, CefRefPtr frame); - CefAppUnmanagedWrapper(IRenderProcessHandler^ handler, List^ schemes, bool enableFocusedNodeChanged, Action^ onBrowserCreated, Action^ onBrowserDestroyed) - { - _handler = handler; - _onBrowserCreated = onBrowserCreated; - _onBrowserDestroyed = onBrowserDestroyed; - _browserWrappers = gcnew ConcurrentDictionary(); - _extensions = gcnew List(); - _schemes = schemes; - _focusedNodeChangedEnabled = enableFocusedNodeChanged; - _javascriptObjects = gcnew Dictionary(); - _registerBoundObjectRegistry = gcnew RegisterBoundObjectRegistry(); - _legacyBindingEnabled = false; - } - - ~CefAppUnmanagedWrapper() - { - if (!Object::ReferenceEquals(_browserWrappers, nullptr)) + public: + static const CefString kPromiseCreatorScript; + + CefAppUnmanagedWrapper(IRenderProcessHandler^ handler, List^ schemes, bool enableFocusedNodeChanged, Action^ onBrowserCreated, Action^ onBrowserDestroyed) : SubProcessApp(schemes) + { + _handler = handler; + _onBrowserCreated = onBrowserCreated; + _onBrowserDestroyed = onBrowserDestroyed; + _browserWrappers = gcnew ConcurrentDictionary(); + _browserJavascriptBindingSettings = gcnew ConcurrentDictionary(); + _jsRootObjectWrappersByFrameId = gcnew ConcurrentDictionary(); + _focusedNodeChangedEnabled = enableFocusedNodeChanged; + _javascriptObjects = gcnew Dictionary(); + _registerBoundObjectRegistry = gcnew RegisterBoundObjectRegistry(); + _legacyBindingEnabled = false; + _jsBindingPropertyName = "CefSharp"; + _jsBindingPropertyNameCamelCase = "cefSharp"; + } + + ~CefAppUnmanagedWrapper() { - for each(CefBrowserWrapper^ browser in Enumerable::OfType(_browserWrappers)) + if (!Object::ReferenceEquals(_browserWrappers, nullptr)) { - delete browser; + for each (CefBrowserWrapper ^ browser in _browserWrappers->Values) + { + delete browser; + } + + _browserWrappers = nullptr; } - _browserWrappers = nullptr; + if (!Object::ReferenceEquals(_browserJavascriptBindingSettings, nullptr)) + { + for each (JavascriptBindingSettings ^ javascriptBindingSettings in _browserJavascriptBindingSettings->Values) + { + delete javascriptBindingSettings; + } + + _browserJavascriptBindingSettings = nullptr; + } + + if (!Object::ReferenceEquals(_jsRootObjectWrappersByFrameId, nullptr)) + { + for each (JavascriptRootObjectWrapper^ rootObject in _jsRootObjectWrappersByFrameId->Values) + { + delete rootObject; + } + + _jsRootObjectWrappersByFrameId = nullptr; + } + + delete _onBrowserCreated; + delete _onBrowserDestroyed; } - delete _onBrowserCreated; - delete _onBrowserDestroyed; - delete _extensions; - delete _schemes; - } - - CefBrowserWrapper^ FindBrowserWrapper(int browserId); - JavascriptRootObjectWrapper^ GetJsRootObjectWrapper(int browserId, int64 frameId); - - virtual DECL CefRefPtr GetRenderProcessHandler() OVERRIDE; - virtual DECL void OnBrowserCreated(CefRefPtr browser) OVERRIDE; - virtual DECL void OnBrowserDestroyed(CefRefPtr browser) OVERRIDE; - virtual DECL void OnContextCreated(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) OVERRIDE; - virtual DECL void OnContextReleased(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) OVERRIDE; - virtual DECL bool OnProcessMessageReceived(CefRefPtr browser, CefProcessId sourceProcessId, CefRefPtr message) OVERRIDE; - virtual DECL void OnRenderThreadCreated(CefRefPtr extraInfo) OVERRIDE; - virtual DECL void OnWebKitInitialized() OVERRIDE; - virtual DECL void OnRegisterCustomSchemes(CefRawPtr registrar) OVERRIDE; - virtual DECL void OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) OVERRIDE; - virtual DECL void OnUncaughtException(CefRefPtr browser, CefRefPtr frame, CefRefPtr context, CefRefPtr exception, CefRefPtr stackTrace) OVERRIDE; - - IMPLEMENT_REFCOUNTING(CefAppUnmanagedWrapper); - }; + + CefBrowserWrapper^ FindBrowserWrapper(int browserId); + JavascriptRootObjectWrapper^ GetJsRootObjectWrapper(int browserId, const CefString& frameId); + + virtual DECL CefRefPtr GetRenderProcessHandler() override; + virtual DECL void OnBrowserCreated(CefRefPtr browser, CefRefPtr extraInfo) override; + virtual DECL void OnBrowserDestroyed(CefRefPtr browser) override; + virtual DECL void OnContextCreated(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) override; + virtual DECL void OnContextReleased(CefRefPtr browser, CefRefPtr frame, CefRefPtr context) override; + virtual DECL bool OnProcessMessageReceived(CefRefPtr browser, CefRefPtr frame, CefProcessId sourceProcessId, CefRefPtr message) override; + virtual DECL void OnWebKitInitialized() override; + virtual DECL void OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) override; + virtual DECL void OnUncaughtException(CefRefPtr browser, CefRefPtr frame, CefRefPtr context, CefRefPtr exception, CefRefPtr stackTrace) override; + + IMPLEMENT_REFCOUNTINGM(CefAppUnmanagedWrapper); + }; + } } diff --git a/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h b/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h index 33b226b74f..934725eaeb 100644 --- a/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h @@ -11,61 +11,51 @@ #include "Stdafx.h" #include "JavascriptRootObjectWrapper.h" -using namespace CefSharp::Internals::Async; +using namespace CefSharp::BrowserSubprocess::Async; +#ifndef NETCOREAPP using namespace System::ServiceModel; +#endif using namespace System::Threading; using namespace System::Threading::Tasks; namespace CefSharp { - // "Master class" for wrapping everything that the Cef Subprocess needs - // for ONE CefBrowser. - public ref class CefBrowserWrapper + namespace BrowserSubprocess { - private: - MCefRefPtr _cefBrowser; - - internal: - //Frame Identifier is used as Key - property ConcurrentDictionary^ JavascriptRootObjectWrappers; - - public: - CefBrowserWrapper(CefRefPtr cefBrowser) - { - _cefBrowser = cefBrowser; - BrowserId = cefBrowser->GetIdentifier(); - IsPopup = cefBrowser->IsPopup(); - - JavascriptRootObjectWrappers = gcnew ConcurrentDictionary(); - } - - !CefBrowserWrapper() - { - _cefBrowser = nullptr; - } - - ~CefBrowserWrapper() + // "Master class" for wrapping everything that the Cef Subprocess needs + // for ONE CefBrowser. + public ref class CefBrowserWrapper { - this->!CefBrowserWrapper(); + private: + MCefRefPtr _cefBrowser; - if (JavascriptRootObjectWrappers != nullptr) + public: + CefBrowserWrapper(const CefRefPtr &cefBrowser) { - for each(KeyValuePair entry in JavascriptRootObjectWrappers) - { - delete entry.Value; - } - - JavascriptRootObjectWrappers = nullptr; + _cefBrowser = cefBrowser.get(); + BrowserId = cefBrowser->GetIdentifier(); + IsPopup = cefBrowser->IsPopup(); } - } - property int BrowserId; - property bool IsPopup; + !CefBrowserWrapper() + { + _cefBrowser = nullptr; + } - // This allows us to create the WCF proxies back to our parent process. - property ChannelFactory^ ChannelFactory; + ~CefBrowserWrapper() + { + this->!CefBrowserWrapper(); + } - // The WCF proxy to the parent process. - property IBrowserProcess^ BrowserProcess; - }; + property int BrowserId; + property bool IsPopup; + +#ifndef NETCOREAPP + // This allows us to create the WCF proxies back to our parent process. + property ChannelFactory^ ChannelFactory; + // The WCF proxy to the parent process. + property IBrowserProcess^ BrowserProcess; +#endif + }; + } } diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.filters b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.filters new file mode 100644 index 0000000000..adeeecfd00 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.filters @@ -0,0 +1,200 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + Header Files + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj new file mode 100644 index 0000000000..fa493b2c34 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -0,0 +1,351 @@ + + + + + + + + + Debug + Win32 + + + Debug + x64 + + + Debug + arm64 + + + Release + Win32 + + + Release + x64 + + + Release + arm64 + + + + 16.0 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C} + CefSharp.BrowserSubprocess.Core + CefSharpBrowserSubprocessCore + NetCoreCProj + net6.0 + 10.0 + 10.0.10240.0 + + + + + DynamicLibrary + true + NetCore + Unicode + + + DynamicLibrary + true + NetCore + Unicode + + + DynamicLibrary + true + NetCore + Unicode + + + DynamicLibrary + false + NetCore + Unicode + + + DynamicLibrary + false + NetCore + Unicode + + + DynamicLibrary + false + NetCore + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + true + ..\CefSharp.snk + true + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + true + ..\CefSharp.snk + true + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + true + ..\CefSharp.snk + true + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + ..\CefSharp.snk + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + ..\CefSharp.snk + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + ..\CefSharp.snk + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + Disabled + _DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + true + stdcpp20 + CompileAsCpp + + + true + libcef.lib;libcef_dll_wrapper.lib;User32.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion); + /ignore:4099 %(AdditionalOptions) + + + Assembly.manifest + + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + Disabled + _DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + stdcpp20 + CompileAsCpp + + + true + libcef.lib;libcef_dll_wrapper.lib;User32.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion); + /ignore:4099 %(AdditionalOptions) + + + Assembly.manifest + + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + Disabled + _DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + stdcpp20 + CompileAsCpp + + + true + libcef.lib;libcef_dll_wrapper.lib;User32.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion); + /ignore:4099 %(AdditionalOptions) + + + Assembly.manifest + + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + true + stdcpp20 + CompileAsCpp + + + true + libcef.lib;libcef_dll_wrapper.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + + + Assembly.manifest + + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + stdcpp20 + CompileAsCpp + + + true + libcef.lib;libcef_dll_wrapper.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + + + Assembly.manifest + + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + stdcpp20 + CompileAsCpp + + + true + libcef.lib;libcef_dll_wrapper.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + + + Assembly.manifest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + Create + + + + + + + {39E385AD-DC5C-451E-B061-09AF3EE038EB} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj index 4f55b26986..24a4245ba8 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj @@ -1,6 +1,9 @@  - + + + + Debug @@ -23,10 +26,11 @@ {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C} ManagedCProj CefSharpBrowserSubprocessCore - v4.5.2 + v4.6.2 + 10.0 - + DynamicLibrary true @@ -106,10 +110,12 @@ Use true true + stdcpp20 + CompileAsCpp true - libcef.lib;libcef_dll_wrapper.lib + libcef.lib;libcef_dll_wrapper.lib;User32.lib $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion); /ignore:4099 %(AdditionalOptions) @@ -122,10 +128,12 @@ WIN32;_DEBUG;EXPORT;%(PreprocessorDefinitions) Use true + stdcpp20 + CompileAsCpp true - libcef.lib;libcef_dll_wrapper.lib + libcef.lib;libcef_dll_wrapper.lib;User32.lib $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion); /ignore:4099 %(AdditionalOptions) @@ -138,6 +146,8 @@ Use true true + stdcpp20 + CompileAsCpp true @@ -152,6 +162,8 @@ WIN32;NDEBUG;EXPORT;%(PreprocessorDefinitions) Use true + stdcpp20 + CompileAsCpp true @@ -167,16 +179,27 @@ - - - - - + + + + + + + + + + + + + + + + @@ -201,8 +224,8 @@ - - + + @@ -237,8 +260,12 @@ - + - + + + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters index 58aad7f43e..8b695aad3e 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters @@ -32,10 +32,10 @@ Header Files - + Header Files - + Header Files @@ -56,10 +56,7 @@ Header Files - - Header Files - - + Header Files @@ -77,7 +74,7 @@ Header Files - + Header Files @@ -107,6 +104,30 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + @@ -139,7 +160,7 @@ Source Files - + Source Files @@ -157,7 +178,7 @@ Source Files - + Source Files @@ -172,11 +193,20 @@ Source Files + + Header Files + + + Header Files + + + Source Files + - + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptBindingSettings.h b/CefSharp.BrowserSubprocess.Core/JavascriptBindingSettings.h new file mode 100644 index 0000000000..8ef2f888bb --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/JavascriptBindingSettings.h @@ -0,0 +1,47 @@ +// Copyright © 2013 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "include/cef_v8.h" + +#include "Stdafx.h" + +namespace CefSharp +{ + namespace BrowserSubprocess + { + private ref class JavascriptBindingSettings + { + private: + MCefRefPtr _javascriptBindingApiAllowOrigins; + + public: + JavascriptBindingSettings() + { + JavascriptBindingApiEnabled = true; + JavascriptBindingApiHasAllowOrigins = false; + JavascriptBindingApiAllowOrigins = nullptr; + } + + !JavascriptBindingSettings() + { + _javascriptBindingApiAllowOrigins = nullptr; + } + + ~JavascriptBindingSettings() + { + this->!JavascriptBindingSettings(); + } + + property bool JavascriptBindingApiEnabled; + property bool JavascriptBindingApiHasAllowOrigins; + property CefRefPtr JavascriptBindingApiAllowOrigins + { + CefRefPtr get() { return _javascriptBindingApiAllowOrigins.get(); } + void set(CefRefPtr value) { _javascriptBindingApiAllowOrigins = value.get(); } + } + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptCallbackRegistry.cpp b/CefSharp.BrowserSubprocess.Core/JavascriptCallbackRegistry.cpp index e8fa646943..a9389a9ca9 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptCallbackRegistry.cpp +++ b/CefSharp.BrowserSubprocess.Core/JavascriptCallbackRegistry.cpp @@ -6,10 +6,11 @@ #include "JavascriptCallbackRegistry.h" using namespace System::Threading; +using namespace CefSharp::BrowserSubprocess; namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { JavascriptCallback^ JavascriptCallbackRegistry::Register(const CefRefPtr& context, const CefRefPtr& value) { @@ -17,14 +18,15 @@ namespace CefSharp JavascriptCallbackWrapper^ wrapper = gcnew JavascriptCallbackWrapper(value, context); _callbacks->TryAdd(newId, wrapper); + auto result = gcnew JavascriptCallback(); result->Id = newId; - result->BrowserId = _browserId; - result->FrameId = context->GetFrame()->GetIdentifier(); + result->BrowserId = context->GetBrowser()->GetIdentifier(); + result->FrameId = StringUtils::ToClr(context->GetFrame()->GetIdentifier()); return result; } - JavascriptCallbackWrapper^ JavascriptCallbackRegistry::FindWrapper(int64 id) + JavascriptCallbackWrapper^ JavascriptCallbackRegistry::FindWrapper(int64_t id) { JavascriptCallbackWrapper^ callback; _callbacks->TryGetValue(id, callback); @@ -41,4 +43,4 @@ namespace CefSharp } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptCallbackRegistry.h b/CefSharp.BrowserSubprocess.Core/JavascriptCallbackRegistry.h index 6d31c82251..b2872055a9 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptCallbackRegistry.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptCallbackRegistry.h @@ -7,10 +7,11 @@ #include "JavascriptCallbackWrapper.h" using namespace System::Collections::Concurrent; +using namespace CefSharp::BrowserSubprocess; namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { private ref class JavascriptCallbackRegistry { @@ -19,14 +20,13 @@ namespace CefSharp //Is static so ids are unique to this process, which is required until #1984 is implemented //and callbacks are disposed of properly between contexts static Int64 _lastId; - int _browserId; ConcurrentDictionary^ _callbacks; internal: - JavascriptCallbackWrapper^ FindWrapper(int64 id); + JavascriptCallbackWrapper^ FindWrapper(int64_t id); public: - JavascriptCallbackRegistry(int browserId) : _browserId(browserId) + JavascriptCallbackRegistry() { _callbacks = gcnew ConcurrentDictionary(); } diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptCallbackWrapper.h b/CefSharp.BrowserSubprocess.Core/JavascriptCallbackWrapper.h index 7c50966214..ac2072825f 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptCallbackWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptCallbackWrapper.h @@ -8,7 +8,7 @@ namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { private ref class JavascriptCallbackWrapper { @@ -45,4 +45,4 @@ namespace CefSharp } }; } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.cpp b/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.cpp index b63627aac6..24267876dd 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.cpp +++ b/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.cpp @@ -8,69 +8,73 @@ namespace CefSharp { - bool JavascriptMethodHandler::Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) + namespace BrowserSubprocess { - auto parameter = gcnew array(arguments.size()); - - for (std::vector>::size_type i = 0; i != arguments.size(); i++) - { - parameter[i] = TypeUtils::ConvertFromCef(arguments[i], _callbackRegistry); - } - - try + bool JavascriptMethodHandler::Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) { - auto response = _method->Invoke(parameter); + auto size = static_cast(arguments.size()); + auto parameter = gcnew array(size); - retval = ConvertToCefObject(response->Result); - if (!response->Success) + for (int i = 0; i < size; i++) { - exception = StringUtils::ToNative(response->Message); + parameter[i] = TypeUtils::ConvertFromCef(arguments[i], _callbackRegistry); } - } - catch (Exception^ ex) - { - exception = StringUtils::ToNative(ex->ToString()); - } - //NOTE: Return true otherwise exception is ignored - return true; - } + try + { + auto response = _method->Invoke(parameter); - CefRefPtr JavascriptMethodHandler::ConvertToCefObject(Object^ obj) - { - if (obj == nullptr) - { - return CefV8Value::CreateNull(); - } + retval = ConvertToCefObject(response->Result); + if (!response->Success) + { + exception = StringUtils::ToNative(response->Message); + } + } + catch (Exception^ ex) + { + exception = StringUtils::ToNative(ex->ToString()); + } - auto type = obj->GetType(); + //NOTE: Return true otherwise exception is ignored + return true; + } - if (type == JavascriptObject::typeid) + CefRefPtr JavascriptMethodHandler::ConvertToCefObject(Object^ obj) { - JavascriptObject^ javascriptObject = (JavascriptObject^)obj; - CefRefPtr cefObject = CefV8Value::CreateObject(NULL, NULL); + if (obj == nullptr) + { + return CefV8Value::CreateNull(); + } - for (int i = 0; i < javascriptObject->Properties->Count; i++) + auto type = obj->GetType(); + + if (type == JavascriptObject::typeid) { - auto prop = javascriptObject->Properties[i]; + JavascriptObject^ javascriptObject = (JavascriptObject^)obj; + CefRefPtr cefObject = CefV8Value::CreateObject(nullptr, nullptr); - if (prop->IsComplexType) + for (int i = 0; i < javascriptObject->Properties->Count; i++) { - auto v8Value = ConvertToCefObject(prop->JsObject); + auto prop = javascriptObject->Properties[i]; - cefObject->SetValue(StringUtils::ToNative(prop->JavascriptName), v8Value, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); - } - else - { - auto v8Value = TypeUtils::ConvertToCef(prop->PropertyValue, nullptr); + if (prop->IsComplexType) + { + auto v8Value = ConvertToCefObject(prop->JsObject); - cefObject->SetValue(StringUtils::ToNative(prop->JavascriptName), v8Value, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + cefObject->SetValue(StringUtils::ToNative(prop->JavascriptName), v8Value, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + } + else + { + auto v8Value = TypeUtils::ConvertToCef(prop->PropertyValue, nullptr); + + cefObject->SetValue(StringUtils::ToNative(prop->JavascriptName), v8Value, CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_NONE); + } } + + return cefObject; } - return cefObject; + return TypeUtils::ConvertToCef(obj, nullptr); } - - return TypeUtils::ConvertToCef(obj, nullptr); } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.h b/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.h index c7202c4a4e..36ee2c31e8 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.h @@ -7,33 +7,38 @@ #include "include/cef_v8.h" #include "JavascriptCallbackRegistry.h" +using namespace CefSharp::Internals::Wcf; + namespace CefSharp { - private class JavascriptMethodHandler : public CefV8Handler + namespace BrowserSubprocess { - private: - gcroot^, BrowserProcessResponse^>^> _method; - gcroot _callbackRegistry; - - public: - JavascriptMethodHandler(Func^, BrowserProcessResponse^>^ method, JavascriptCallbackRegistry^ callbackRegistry) - { - _method = method; - _callbackRegistry = callbackRegistry; - } - - ~JavascriptMethodHandler() + private class JavascriptMethodHandler : public CefV8Handler { - delete _method; - // The callback registry is a shared instance among all method handlers (async & sync). - // It's lifecycle is managed in the JavascriptRootObjectWrapper. - _callbackRegistry = nullptr; - } - - virtual bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) OVERRIDE; - - CefRefPtr ConvertToCefObject(Object^ obj); - - IMPLEMENT_REFCOUNTING(JavascriptMethodHandler); - }; + private: + gcroot^, BrowserProcessResponse^>^> _method; + gcroot _callbackRegistry; + + public: + JavascriptMethodHandler(Func^, BrowserProcessResponse^>^ method, JavascriptCallbackRegistry^ callbackRegistry) + { + _method = method; + _callbackRegistry = callbackRegistry; + } + + ~JavascriptMethodHandler() + { + delete _method; + // The callback registry is a shared instance among all method handlers (async & sync). + // It's lifecycle is managed in the JavascriptRootObjectWrapper. + _callbackRegistry = nullptr; + } + + virtual bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) override; + + CefRefPtr ConvertToCefObject(Object^ obj); + + IMPLEMENT_REFCOUNTINGM(JavascriptMethodHandler); + }; + } } diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptMethodWrapper.cpp b/CefSharp.BrowserSubprocess.Core/JavascriptMethodWrapper.cpp index 19041027e7..ab8feed45d 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptMethodWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/JavascriptMethodWrapper.cpp @@ -10,17 +10,20 @@ namespace CefSharp { - void JavascriptMethodWrapper::Bind(JavascriptMethod^ javascriptMethod, const CefRefPtr& v8Value) + namespace BrowserSubprocess { - _javascriptMethodName = javascriptMethod->JavascriptName; - auto methodName = StringUtils::ToNative(javascriptMethod->JavascriptName); - auto v8Function = CefV8Value::CreateFunction(methodName, _javascriptMethodHandler.get()); + void JavascriptMethodWrapper::Bind(JavascriptMethod^ javascriptMethod, const CefRefPtr& v8Value) + { + _javascriptMethodName = javascriptMethod->JavascriptName; + auto methodName = StringUtils::ToNative(javascriptMethod->JavascriptName); + auto v8Function = CefV8Value::CreateFunction(methodName, _javascriptMethodHandler.get()); - v8Value->SetValue(methodName, v8Function, V8_PROPERTY_ATTRIBUTE_NONE); - }; + v8Value->SetValue(methodName, v8Function, V8_PROPERTY_ATTRIBUTE_NONE); + }; - BrowserProcessResponse^ JavascriptMethodWrapper::Execute(array^ parameters) - { - return _browserProcess->CallMethod(_ownerId, _javascriptMethodName, parameters); + BrowserProcessResponse^ JavascriptMethodWrapper::Execute(array^ parameters) + { + return _browserProcess->CallMethod(_ownerId, _javascriptMethodName, parameters); + } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptMethodWrapper.h b/CefSharp.BrowserSubprocess.Core/JavascriptMethodWrapper.h index 296e493481..ebf980b8cc 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptMethodWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptMethodWrapper.h @@ -10,38 +10,42 @@ #include "JavascriptMethodHandler.h" using namespace System::Runtime::Serialization; +using namespace CefSharp::Internals::Wcf; namespace CefSharp { - private ref class JavascriptMethodWrapper + namespace BrowserSubprocess { - private: - MCefRefPtr _javascriptMethodHandler; - int64 _ownerId; - String^ _javascriptMethodName; - IBrowserProcess^ _browserProcess; - - public: - JavascriptMethodWrapper(int64 ownerId, IBrowserProcess^ browserProcess, JavascriptCallbackRegistry^ callbackRegistry) + private ref class JavascriptMethodWrapper { - _ownerId = ownerId; - _browserProcess = browserProcess; - _javascriptMethodHandler = new JavascriptMethodHandler(gcnew Func^, BrowserProcessResponse^>(this, &JavascriptMethodWrapper::Execute), callbackRegistry); - } - - !JavascriptMethodWrapper() - { - _javascriptMethodHandler = nullptr; - } - - ~JavascriptMethodWrapper() - { - this->!JavascriptMethodWrapper(); - - _browserProcess = nullptr; - } - - void Bind(JavascriptMethod^ javascriptMethod, const CefRefPtr& v8Value); - BrowserProcessResponse^ Execute(array^ parameters); - }; -} \ No newline at end of file + private: + MCefRefPtr _javascriptMethodHandler; + int64_t _ownerId; + String^ _javascriptMethodName; + IBrowserProcess^ _browserProcess; + + public: + JavascriptMethodWrapper(int64_t ownerId, IBrowserProcess^ browserProcess, JavascriptCallbackRegistry^ callbackRegistry) + { + _ownerId = ownerId; + _browserProcess = browserProcess; + _javascriptMethodHandler = new JavascriptMethodHandler(gcnew Func^, BrowserProcessResponse^>(this, &JavascriptMethodWrapper::Execute), callbackRegistry); + } + + !JavascriptMethodWrapper() + { + _javascriptMethodHandler = nullptr; + } + + ~JavascriptMethodWrapper() + { + this->!JavascriptMethodWrapper(); + + _browserProcess = nullptr; + } + + void Bind(JavascriptMethod^ javascriptMethod, const CefRefPtr& v8Value); + BrowserProcessResponse^ Execute(array^ parameters); + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptObjectWrapper.cpp b/CefSharp.BrowserSubprocess.Core/JavascriptObjectWrapper.cpp index 46bbbb9b22..afb2926dd8 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptObjectWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/JavascriptObjectWrapper.cpp @@ -10,45 +10,48 @@ namespace CefSharp { - void JavascriptObjectWrapper::Bind(JavascriptObject^ object, const CefRefPtr& v8Value, JavascriptCallbackRegistry^ callbackRegistry) + namespace BrowserSubprocess { - _objectId = object->Id; - - //Create property handler for get and set of Properties of this object - _jsPropertyHandler = new JavascriptPropertyHandler( - gcnew Func(this, &JavascriptObjectWrapper::GetProperty), - gcnew Func(this, &JavascriptObjectWrapper::SetProperty) - ); - - //V8Value that represents this javascript object - only one per complex type - auto javascriptObject = CefV8Value::CreateObject(_jsPropertyHandler.get(), NULL); - auto objectName = StringUtils::ToNative(object->JavascriptName); - v8Value->SetValue(objectName, javascriptObject, V8_PROPERTY_ATTRIBUTE_NONE); - - for each (JavascriptMethod^ method in Enumerable::OfType(object->Methods)) + void JavascriptObjectWrapper::Bind(JavascriptObject^ object, const CefRefPtr& v8Value, JavascriptCallbackRegistry^ callbackRegistry) { - auto wrappedMethod = gcnew JavascriptMethodWrapper(object->Id, _browserProcess, callbackRegistry); - wrappedMethod->Bind(method, javascriptObject); - - _wrappedMethods->Add(wrappedMethod); + _objectId = object->Id; + + //Create property handler for get and set of Properties of this object + _jsPropertyHandler = new JavascriptPropertyHandler( + gcnew Func(this, &JavascriptObjectWrapper::GetProperty), + gcnew Func(this, &JavascriptObjectWrapper::SetProperty) + ); + + //V8Value that represents this javascript object - only one per complex type + auto javascriptObject = CefV8Value::CreateObject(_jsPropertyHandler.get(), nullptr); + auto objectName = StringUtils::ToNative(object->JavascriptName); + v8Value->SetValue(objectName, javascriptObject, V8_PROPERTY_ATTRIBUTE_NONE); + + for each (JavascriptMethod ^ method in Enumerable::OfType(object->Methods)) + { + auto wrappedMethod = gcnew JavascriptMethodWrapper(object->Id, _browserProcess, callbackRegistry); + wrappedMethod->Bind(method, javascriptObject); + + _wrappedMethods->Add(wrappedMethod); + } + + for each (JavascriptProperty ^ prop in Enumerable::OfType(object->Properties)) + { + auto wrappedproperty = gcnew JavascriptPropertyWrapper(object->Id, _browserProcess); + wrappedproperty->Bind(prop, javascriptObject, callbackRegistry); + + _wrappedProperties->Add(wrappedproperty); + } } - for each (JavascriptProperty^ prop in Enumerable::OfType(object->Properties)) + BrowserProcessResponse^ JavascriptObjectWrapper::GetProperty(String^ memberName) { - auto wrappedproperty = gcnew JavascriptPropertyWrapper(object->Id, _browserProcess); - wrappedproperty->Bind(prop, javascriptObject, callbackRegistry); + return _browserProcess->GetProperty(_objectId, memberName); + }; - _wrappedProperties->Add(wrappedproperty); - } + BrowserProcessResponse^ JavascriptObjectWrapper::SetProperty(String^ memberName, Object^ value) + { + return _browserProcess->SetProperty(_objectId, memberName, value); + }; } - - BrowserProcessResponse^ JavascriptObjectWrapper::GetProperty(String^ memberName) - { - return _browserProcess->GetProperty(_objectId, memberName); - }; - - BrowserProcessResponse^ JavascriptObjectWrapper::SetProperty(String^ memberName, Object^ value) - { - return _browserProcess->SetProperty(_objectId, memberName, value); - }; -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptObjectWrapper.h b/CefSharp.BrowserSubprocess.Core/JavascriptObjectWrapper.h index 9a5bb763ca..28eebd3b55 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptObjectWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptObjectWrapper.h @@ -17,45 +17,48 @@ using namespace System::Collections::Generic; namespace CefSharp { - private ref class JavascriptObjectWrapper + namespace BrowserSubprocess { - private: - List^ _wrappedMethods; - List^ _wrappedProperties; - IBrowserProcess^ _browserProcess; - MCefRefPtr _jsPropertyHandler; - int64 _objectId; - - public: - JavascriptObjectWrapper(IBrowserProcess^ browserProcess) + private ref class JavascriptObjectWrapper { - _browserProcess = browserProcess; + private: + List^ _wrappedMethods; + List^ _wrappedProperties; + IBrowserProcess^ _browserProcess; + MCefRefPtr _jsPropertyHandler; + int64_t _objectId; - _wrappedMethods = gcnew List(); - _wrappedProperties = gcnew List(); - } - - !JavascriptObjectWrapper() - { - _jsPropertyHandler = nullptr; - } + public: + JavascriptObjectWrapper(IBrowserProcess^ browserProcess) + { + _browserProcess = browserProcess; - ~JavascriptObjectWrapper() - { - this->!JavascriptObjectWrapper(); + _wrappedMethods = gcnew List(); + _wrappedProperties = gcnew List(); + } - for each (JavascriptMethodWrapper^ var in _wrappedMethods) + !JavascriptObjectWrapper() { - delete var; + _jsPropertyHandler = nullptr; } - for each (JavascriptPropertyWrapper^ var in _wrappedProperties) + + ~JavascriptObjectWrapper() { - delete var; + this->!JavascriptObjectWrapper(); + + for each (JavascriptMethodWrapper ^ var in _wrappedMethods) + { + delete var; + } + for each (JavascriptPropertyWrapper ^ var in _wrappedProperties) + { + delete var; + } } - } - void Bind(JavascriptObject^ object, const CefRefPtr& v8Value, JavascriptCallbackRegistry^ callbackRegistry); - BrowserProcessResponse^ GetProperty(String^ memberName); - BrowserProcessResponse^ SetProperty(String^ memberName, Object^ value); - }; -} \ No newline at end of file + void Bind(JavascriptObject^ object, const CefRefPtr& v8Value, JavascriptCallbackRegistry^ callbackRegistry); + BrowserProcessResponse^ GetProperty(String^ memberName); + BrowserProcessResponse^ SetProperty(String^ memberName, Object^ value); + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPostMessageHandler.h b/CefSharp.BrowserSubprocess.Core/JavascriptPostMessageHandler.h new file mode 100644 index 0000000000..9274c0ad8b --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPostMessageHandler.h @@ -0,0 +1,94 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "include/cef_v8.h" +#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h" +#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h" +#include "Serialization\V8Serialization.h" + +using namespace System; +using namespace CefSharp::Internals::Messaging; +using namespace CefSharp::BrowserSubprocess::Serialization; + +namespace CefSharp +{ + namespace BrowserSubprocess + { + const CefString kPostMessage = CefString("PostMessage"); + const CefString kPostMessageCamelCase = CefString("postMessage"); + + private class JavascriptPostMessageHandler : public CefV8Handler + { + private: + gcroot _javascriptCallbackRegistry; + + public: + JavascriptPostMessageHandler(JavascriptCallbackRegistry^ javascriptCallbackRegistry) + { + _javascriptCallbackRegistry = javascriptCallbackRegistry; + } + + bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) override + { + if (arguments.size() == 0 || arguments.size() > 1) + { + //TODO: Improve error message + exception = "Only a single param is accepted"; + + return true; + } + + auto context = CefV8Context::GetCurrentContext(); + if (context.get()) + { + auto frame = context->GetFrame(); + + if (frame.get() && frame->IsValid() && context->Enter()) + { + try + { + auto global = context->GetGlobal(); + + auto request = CefProcessMessage::Create(kJavascriptMessageReceived); + auto argList = request->GetArgumentList(); + + auto params = CefListValue::Create(); + SerializeV8Object(arguments[0], params, 0, _javascriptCallbackRegistry); + + //We're only interested in the first param + if (params->GetSize() > 0) + { + argList->SetValue(0, params->GetValue(0)); + } + + frame->SendProcessMessage(CefProcessId::PID_BROWSER, request); + + retval = CefV8Value::CreateNull(); + } + finally + { + context->Exit(); + } + } + else + { + exception = "Unable to Enter Context"; + } + } + else + { + exception = "Unable to get current context"; + } + + return true; + } + + IMPLEMENT_REFCOUNTINGM(JavascriptPostMessageHandler); + }; + } +} + + diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPromiseHandler.h b/CefSharp.BrowserSubprocess.Core/JavascriptPromiseHandler.h new file mode 100644 index 0000000000..24b7bcd8a3 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPromiseHandler.h @@ -0,0 +1,89 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "include/cef_v8.h" +#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h" +#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h" +#include "Serialization\V8Serialization.h" + +using namespace System; +using namespace CefSharp::Internals::Messaging; +using namespace CefSharp::BrowserSubprocess::Serialization; + +namespace CefSharp +{ + namespace BrowserSubprocess + { + const CefString kSendEvalScriptResponse = CefString("SendEvalScriptResponse"); + const CefString kSendEvalScriptResponseCamelCase = CefString("sendEvalScriptResponse"); + + private class JavascriptPromiseHandler : public CefV8Handler + { + public: + + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) + { + if (arguments.size() < 2) + { + //TODO: Improve error message + exception = "Must specify a callback Id and then/catch."; + + return true; + } + + auto callbackId = arguments[0]->GetIntValue(); + + if (callbackId == 0) + { + exception = "Invalid callback Id"; + + return true; + } + + auto success = arguments[1]->GetBoolValue(); + auto javascriptCallback = arguments.size() < 4 ? false : arguments[3]->GetBoolValue(); + + auto response = CefProcessMessage::Create(javascriptCallback ? kJavascriptCallbackResponse : kEvaluateJavascriptResponse); + + auto responseArgList = response->GetArgumentList(); + //Success + responseArgList->SetBool(0, success); + //Callback Id + SetInt64(responseArgList, 1, callbackId); + if (exception == "") + { + if (success) + { + SerializeV8Object(arguments[2], responseArgList, 2, nullptr); + } + else + { + auto reason = arguments[2]; + responseArgList->SetString(2, reason->GetStringValue()); + } + } + else + { + responseArgList->SetString(2, exception); + } + + auto context = CefV8Context::GetCurrentContext(); + + auto frame = context->GetFrame(); + + frame->SendProcessMessage(CefProcessId::PID_BROWSER, response); + + return false; + } + + IMPLEMENT_REFCOUNTINGM(JavascriptPromiseHandler); + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPromiseResolverCatch.h b/CefSharp.BrowserSubprocess.Core/JavascriptPromiseResolverCatch.h new file mode 100644 index 0000000000..68fccd20e0 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPromiseResolverCatch.h @@ -0,0 +1,71 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "include/cef_v8.h" + +using namespace System; + +namespace CefSharp +{ + namespace BrowserSubprocess + { + private class JavascriptPromiseResolverCatch : public CefV8Handler + { + int64_t _callbackId; + bool _isJsCallback; + + public: + JavascriptPromiseResolverCatch(int64_t callbackId, bool isJsCallback) : _callbackId(callbackId), _isJsCallback(isJsCallback) + { + + } + + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) + { + auto context = CefV8Context::GetCurrentContext(); + + auto reason = arguments[0]; + CefString reasonString; + + if (reason->IsString()) + { + reasonString = reason->GetStringValue(); + } + else + { + //Convert value to String + auto strFunc = context->GetGlobal()->GetValue("String"); + CefV8ValueList args; + args.push_back(reason); + auto strVal = strFunc->ExecuteFunction(nullptr, args); + + reasonString = strVal->GetStringValue(); + } + + auto response = CefProcessMessage::Create(_isJsCallback ? kJavascriptCallbackResponse : kEvaluateJavascriptResponse); + auto responseArgList = response->GetArgumentList(); + + //Success + responseArgList->SetBool(0, false); + //Callback Id + SetInt64(responseArgList, 1, _callbackId); + responseArgList->SetString(2, reasonString); + + auto frame = context->GetFrame(); + + frame->SendProcessMessage(CefProcessId::PID_BROWSER, response); + + return true; + } + + IMPLEMENT_REFCOUNTINGM(JavascriptPromiseResolverCatch); + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPromiseResolverThen.h b/CefSharp.BrowserSubprocess.Core/JavascriptPromiseResolverThen.h new file mode 100644 index 0000000000..49bc984129 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPromiseResolverThen.h @@ -0,0 +1,59 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "include/cef_v8.h" +#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h" +#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h" +#include "Serialization\V8Serialization.h" + +using namespace System; +using namespace CefSharp::Internals::Messaging; +using namespace CefSharp::BrowserSubprocess::Serialization; + +namespace CefSharp +{ + namespace BrowserSubprocess + { + private class JavascriptPromiseResolverThen : public CefV8Handler + { + int64_t _callbackId; + bool _isJsCallback; + + public: + JavascriptPromiseResolverThen(int64_t callbackId, bool isJsCallback) : _callbackId(callbackId), _isJsCallback(isJsCallback) + { + + } + + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) + { + auto response = CefProcessMessage::Create(_isJsCallback ? kJavascriptCallbackResponse : kEvaluateJavascriptResponse); + + auto responseArgList = response->GetArgumentList(); + + //Success + responseArgList->SetBool(0, true); + //Callback Id + SetInt64(responseArgList, 1, _callbackId); + SerializeV8Object(arguments[0], responseArgList, 2, nullptr); + + auto context = CefV8Context::GetCurrentContext(); + + auto frame = context->GetFrame(); + + frame->SendProcessMessage(CefProcessId::PID_BROWSER, response); + + return true; + } + + IMPLEMENT_REFCOUNTINGM(JavascriptPromiseResolverThen); + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPropertyHandler.h b/CefSharp.BrowserSubprocess.Core/JavascriptPropertyHandler.h index b7c67e56ca..1de2931d6c 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptPropertyHandler.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPropertyHandler.h @@ -11,55 +11,58 @@ namespace CefSharp { - private class JavascriptPropertyHandler : public CefV8Accessor + namespace BrowserSubprocess { - gcroot^> _getter; - gcroot^> _setter; - - public: - JavascriptPropertyHandler(Func^ getter, Func^ setter) + private class JavascriptPropertyHandler : public CefV8Accessor { - _getter = getter; - _setter = setter; - } + gcroot^> _getter; + gcroot^> _setter; - ~JavascriptPropertyHandler() - { - delete _getter; - delete _setter; - } + public: + JavascriptPropertyHandler(Func^ getter, Func^ setter) + { + _getter = getter; + _setter = setter; + } + ~JavascriptPropertyHandler() + { + delete _getter; + delete _setter; + } - virtual bool Get(const CefString& name, const CefRefPtr object, CefRefPtr& retval, - CefString& exception) override - { - //System::Diagnostics::Debugger::Break(); - auto propertyName = StringUtils::ToClr(name); - auto response = _getter->Invoke(propertyName); - retval = TypeUtils::ConvertToCef(response->Result, nullptr); - if (!response->Success) + + virtual bool Get(const CefString& name, const CefRefPtr object, CefRefPtr& retval, + CefString& exception) override { - exception = StringUtils::ToNative(response->Message); + //System::Diagnostics::Debugger::Break(); + auto propertyName = StringUtils::ToClr(name); + auto response = _getter->Invoke(propertyName); + retval = TypeUtils::ConvertToCef(response->Result, nullptr); + if (!response->Success) + { + exception = StringUtils::ToNative(response->Message); + } + //NOTE: Return true otherwise exception is ignored + return true; } - //NOTE: Return true otherwise exception is ignored - return true; - } - virtual bool Set(const CefString& name, const CefRefPtr object, const CefRefPtr value, - CefString& exception) override - { - //System::Diagnostics::Debugger::Break(); - auto propertyName = StringUtils::ToClr(name); - auto managedValue = TypeUtils::ConvertFromCef(value, nullptr); - auto response = _setter->Invoke(propertyName, managedValue); - if (!response->Success) + virtual bool Set(const CefString& name, const CefRefPtr object, const CefRefPtr value, + CefString& exception) override { - exception = StringUtils::ToNative(response->Message); + //System::Diagnostics::Debugger::Break(); + auto propertyName = StringUtils::ToClr(name); + auto managedValue = TypeUtils::ConvertFromCef(value, nullptr); + auto response = _setter->Invoke(propertyName, managedValue); + if (!response->Success) + { + exception = StringUtils::ToNative(response->Message); + } + //NOTE: Return true otherwise exception is ignored + return true; } - //NOTE: Return true otherwise exception is ignored - return true; - } - IMPLEMENT_REFCOUNTING(JavascriptPropertyHandler); - }; + IMPLEMENT_REFCOUNTINGM(JavascriptPropertyHandler); + }; + } } diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPropertyWrapper.cpp b/CefSharp.BrowserSubprocess.Core/JavascriptPropertyWrapper.cpp index fd4a85829e..63ec03618d 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptPropertyWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPropertyWrapper.cpp @@ -13,23 +13,26 @@ using namespace System; namespace CefSharp { - void JavascriptPropertyWrapper::Bind(JavascriptProperty^ javascriptProperty, const CefRefPtr& v8Value, JavascriptCallbackRegistry^ callbackRegistry) + namespace BrowserSubprocess { - auto propertyName = StringUtils::ToNative(javascriptProperty->JavascriptName); - auto clrPropertyName = javascriptProperty->JavascriptName; - - if (javascriptProperty->IsComplexType) - { - auto javascriptObjectWrapper = gcnew JavascriptObjectWrapper(_browserProcess); - javascriptObjectWrapper->Bind(javascriptProperty->JsObject, v8Value, callbackRegistry); - - _javascriptObjectWrapper = javascriptObjectWrapper; - } - else + void JavascriptPropertyWrapper::Bind(JavascriptProperty^ javascriptProperty, const CefRefPtr& v8Value, JavascriptCallbackRegistry^ callbackRegistry) { - auto propertyAttribute = javascriptProperty->IsReadOnly ? V8_PROPERTY_ATTRIBUTE_READONLY : V8_PROPERTY_ATTRIBUTE_NONE; - - v8Value->SetValue(propertyName, V8_ACCESS_CONTROL_DEFAULT, propertyAttribute); - } - }; -} \ No newline at end of file + auto propertyName = StringUtils::ToNative(javascriptProperty->JavascriptName); + auto clrPropertyName = javascriptProperty->JavascriptName; + + if (javascriptProperty->IsComplexType) + { + auto javascriptObjectWrapper = gcnew JavascriptObjectWrapper(_browserProcess); + javascriptObjectWrapper->Bind(javascriptProperty->JsObject, v8Value, callbackRegistry); + + _javascriptObjectWrapper = javascriptObjectWrapper; + } + else + { + auto propertyAttribute = javascriptProperty->IsReadOnly ? V8_PROPERTY_ATTRIBUTE_READONLY : V8_PROPERTY_ATTRIBUTE_NONE; + + v8Value->SetValue(propertyName, propertyAttribute); + } + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPropertyWrapper.h b/CefSharp.BrowserSubprocess.Core/JavascriptPropertyWrapper.h index 4235a1a92d..d0ac14ae18 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptPropertyWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPropertyWrapper.h @@ -8,33 +8,38 @@ #include "include/cef_v8.h" #include "JavascriptCallbackRegistry.h" +using namespace CefSharp::Internals::Wcf; + namespace CefSharp { - private ref class JavascriptPropertyWrapper + namespace BrowserSubprocess { - private: - int64 _ownerId; - IBrowserProcess^ _browserProcess; - //TODO: Strongly type this variable - currently trying to include JavascriptObjectWrapper.h creates a circular reference, so won't compile - Object^ _javascriptObjectWrapper; - - public: - JavascriptPropertyWrapper(int64 ownerId, IBrowserProcess^ browserProcess) + private ref class JavascriptPropertyWrapper { - _ownerId = ownerId; - _browserProcess = browserProcess; - _javascriptObjectWrapper = nullptr; - } + private: + int64_t _ownerId; + IBrowserProcess^ _browserProcess; + //TODO: Strongly type this variable - currently trying to include JavascriptObjectWrapper.h creates a circular reference, so won't compile + Object^ _javascriptObjectWrapper; - ~JavascriptPropertyWrapper() - { - if (_javascriptObjectWrapper != nullptr) + public: + JavascriptPropertyWrapper(int64_t ownerId, IBrowserProcess^ browserProcess) { - delete _javascriptObjectWrapper; + _ownerId = ownerId; + _browserProcess = browserProcess; _javascriptObjectWrapper = nullptr; } - } - void Bind(JavascriptProperty^ javascriptProperty, const CefRefPtr& v8Value, JavascriptCallbackRegistry^ callbackRegistry); - }; -} \ No newline at end of file + ~JavascriptPropertyWrapper() + { + if (_javascriptObjectWrapper != nullptr) + { + delete _javascriptObjectWrapper; + _javascriptObjectWrapper = nullptr; + } + } + + void Bind(JavascriptProperty^ javascriptProperty, const CefRefPtr& v8Value, JavascriptCallbackRegistry^ callbackRegistry); + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptRootObjectWrapper.cpp b/CefSharp.BrowserSubprocess.Core/JavascriptRootObjectWrapper.cpp index c31e619ece..6e49c59df4 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptRootObjectWrapper.cpp +++ b/CefSharp.BrowserSubprocess.Core/JavascriptRootObjectWrapper.cpp @@ -12,58 +12,63 @@ using namespace System::Threading; namespace CefSharp { - void JavascriptRootObjectWrapper::Bind(ICollection^ objects, const CefRefPtr& v8Value) + namespace BrowserSubprocess { - if (objects->Count > 0) + void JavascriptRootObjectWrapper::Bind(ICollection^ objects, const CefRefPtr& v8Value) { - auto saveMethod = gcnew Func(this, &JavascriptRootObjectWrapper::SaveMethodCallback); - - for each (JavascriptObject^ obj in Enumerable::OfType(objects)) + if (objects->Count > 0) { - if (obj->IsAsync) - { - auto wrapperObject = gcnew JavascriptAsyncObjectWrapper(_callbackRegistry, saveMethod); - wrapperObject->Bind(obj, v8Value); + auto saveMethod = gcnew Func(this, &JavascriptRootObjectWrapper::SaveMethodCallback); - _wrappedAsyncObjects->Add(wrapperObject); - } - else + for each (JavascriptObject ^ obj in Enumerable::OfType(objects)) { - if (_browserProcess == nullptr) + if (obj->IsAsync) { - LOG(ERROR) << StringUtils::ToNative("IBrowserProcess is null, unable to bind object " + obj->JavascriptName).ToString(); + auto wrapperObject = gcnew JavascriptAsyncObjectWrapper(_callbackRegistry, saveMethod); + wrapperObject->Bind(obj, v8Value); - continue; + _wrappedAsyncObjects->Add(wrapperObject); } +#ifndef NETCOREAPP + else + { + if (_browserProcess == nullptr) + { + LOG(ERROR) << StringUtils::ToNative("IBrowserProcess is null, unable to bind object " + obj->JavascriptName).ToString(); + + continue; + } - auto wrapperObject = gcnew JavascriptObjectWrapper(_browserProcess); - wrapperObject->Bind(obj, v8Value, _callbackRegistry); + auto wrapperObject = gcnew JavascriptObjectWrapper(_browserProcess); + wrapperObject->Bind(obj, v8Value, _callbackRegistry); - _wrappedObjects->Add(wrapperObject); + _wrappedObjects->Add(wrapperObject); + } +#endif } } } - } - JavascriptCallbackRegistry^ JavascriptRootObjectWrapper::CallbackRegistry::get() - { - return _callbackRegistry; - } + JavascriptCallbackRegistry^ JavascriptRootObjectWrapper::CallbackRegistry::get() + { + return _callbackRegistry; + } - int64 JavascriptRootObjectWrapper::SaveMethodCallback(JavascriptAsyncMethodCallback^ callback) - { - auto callbackId = Interlocked::Increment(_lastCallback); - _methodCallbacks->Add(callbackId, callback); - return callbackId; - } + int64_t JavascriptRootObjectWrapper::SaveMethodCallback(JavascriptAsyncMethodCallback^ callback) + { + auto callbackId = Interlocked::Increment(_lastCallback); + _methodCallbacks->Add(callbackId, callback); + return callbackId; + } - bool JavascriptRootObjectWrapper::TryGetAndRemoveMethodCallback(int64 id, JavascriptAsyncMethodCallback^% callback) - { - bool result = false; - if (result = _methodCallbacks->TryGetValue(id, callback)) + bool JavascriptRootObjectWrapper::TryGetAndRemoveMethodCallback(int64_t id, JavascriptAsyncMethodCallback^% callback) { - _methodCallbacks->Remove(id); + bool result = false; + if (result = _methodCallbacks->TryGetValue(id, callback)) + { + _methodCallbacks->Remove(id); + } + return result; } - return result; } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptRootObjectWrapper.h b/CefSharp.BrowserSubprocess.Core/JavascriptRootObjectWrapper.h index d0ec80fe4d..ae2add0112 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptRootObjectWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptRootObjectWrapper.h @@ -6,81 +6,105 @@ #include "include/cef_v8.h" #include "JavascriptCallbackRegistry.h" +#ifndef NETCOREAPP #include "JavascriptObjectWrapper.h" +#endif #include "Async/JavascriptAsyncObjectWrapper.h" using namespace System::Runtime::Serialization; using namespace System::Linq; using namespace System::Collections::Generic; -using namespace CefSharp::Internals::Async; +using namespace CefSharp::BrowserSubprocess::Async; +#ifndef NETCOREAPP +using namespace CefSharp::Internals::Wcf; +#endif namespace CefSharp { - // This wraps the transmitted registered objects - // by binding the meta-data to V8 JavaScript objects - // and installing callbacks for changes to those - // objects. - private ref class JavascriptRootObjectWrapper + namespace BrowserSubprocess { - private: - initonly List^ _wrappedObjects; - initonly List^ _wrappedAsyncObjects; - initonly Dictionary^ _methodCallbacks; - int64 _lastCallback; - IBrowserProcess^ _browserProcess; - // The entire set of possible JavaScript functions to - // call directly into. - JavascriptCallbackRegistry^ _callbackRegistry; - - int64 SaveMethodCallback(JavascriptAsyncMethodCallback^ callback); - - internal: - property JavascriptCallbackRegistry^ CallbackRegistry + // This wraps the transmitted registered objects + // by binding the meta-data to V8 JavaScript objects + // and installing callbacks for changes to those + // objects. + private ref class JavascriptRootObjectWrapper { - CefSharp::Internals::JavascriptCallbackRegistry^ get(); - } + private: + //Only access through Interlocked::Increment - used to generate unique callback Id's + //Is static so ids are unique to this process https://github.com/cefsharp/CefSharp/issues/2792 + static int64_t _lastCallback; - public: - JavascriptRootObjectWrapper(int browserId, IBrowserProcess^ browserProcess) - { - _browserProcess = browserProcess; - _wrappedObjects = gcnew List(); - _wrappedAsyncObjects = gcnew List(); - _callbackRegistry = gcnew JavascriptCallbackRegistry(browserId); - _methodCallbacks = gcnew Dictionary(); - } - - ~JavascriptRootObjectWrapper() - { - if (_callbackRegistry != nullptr) - { - delete _callbackRegistry; - _callbackRegistry = nullptr; - } +#ifndef NETCOREAPP + initonly List^ _wrappedObjects; +#endif + initonly List^ _wrappedAsyncObjects; + initonly Dictionary^ _methodCallbacks; +#ifndef NETCOREAPP + IBrowserProcess^ _browserProcess; +#endif + // The entire set of possible JavaScript functions to + // call directly into. + JavascriptCallbackRegistry^ _callbackRegistry; + + int64_t SaveMethodCallback(JavascriptAsyncMethodCallback^ callback); - for each (JavascriptObjectWrapper^ var in _wrappedObjects) + internal: + property JavascriptCallbackRegistry^ CallbackRegistry { - delete var; + JavascriptCallbackRegistry^ get(); } - _wrappedObjects->Clear(); - for each (JavascriptAsyncObjectWrapper^ var in _wrappedAsyncObjects) + public: +#ifdef NETCOREAPP + JavascriptRootObjectWrapper() +#else + JavascriptRootObjectWrapper(IBrowserProcess^ browserProcess) +#endif { - delete var; +#ifndef NETCOREAPP + _browserProcess = browserProcess; + _wrappedObjects = gcnew List(); +#endif + _wrappedAsyncObjects = gcnew List(); + _callbackRegistry = gcnew JavascriptCallbackRegistry(); + _methodCallbacks = gcnew Dictionary(); } - _wrappedAsyncObjects->Clear(); - for each(JavascriptAsyncMethodCallback^ var in _methodCallbacks->Values) + ~JavascriptRootObjectWrapper() { - delete var; + if (_callbackRegistry != nullptr) + { + delete _callbackRegistry; + _callbackRegistry = nullptr; + } + +#ifndef NETCOREAPP + for each (JavascriptObjectWrapper ^ var in _wrappedObjects) + { + delete var; + } + _wrappedObjects->Clear(); + +#endif + + for each (JavascriptAsyncObjectWrapper ^ var in _wrappedAsyncObjects) + { + delete var; + } + _wrappedAsyncObjects->Clear(); + + for each (JavascriptAsyncMethodCallback ^ var in _methodCallbacks->Values) + { + delete var; + } + _methodCallbacks->Clear(); } - _methodCallbacks->Clear(); - } - bool TryGetAndRemoveMethodCallback(int64 id, JavascriptAsyncMethodCallback^% callback); + bool TryGetAndRemoveMethodCallback(int64_t id, JavascriptAsyncMethodCallback^% callback); - void Bind(ICollection^ objects, const CefRefPtr& v8Value); - }; + void Bind(ICollection^ objects, const CefRefPtr& v8Value); + }; + } } diff --git a/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h b/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h index e0d26eb4a8..525bf19538 100644 --- a/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h +++ b/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h @@ -6,8 +6,8 @@ #include "include/cef_v8.h" #include "RegisterBoundObjectRegistry.h" -#include "..\CefSharp.Core\Internals\Messaging\Messages.h" -#include "..\CefSharp.Core\Internals\Serialization\Primitives.h" +#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h" +#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h" using namespace System; using namespace CefSharp::Internals::Messaging; @@ -15,354 +15,115 @@ using namespace CefSharp::Internals::Serialization; namespace CefSharp { - const CefString kIsObjectCached = CefString("IsObjectCached"); - const CefString kIsObjectCachedCamelCase = CefString("isObjectCached"); - const CefString kRemoveObjectFromCache = CefString("RemoveObjectFromCache"); - const CefString kRemoveObjectFromCacheCamelCase = CefString("removeObjectFromCache"); - const CefString kDeleteBoundObject = CefString("DeleteBoundObject"); - const CefString kDeleteBoundObjectCamelCase = CefString("deleteBoundObject"); - const CefString kBindObjectAsync = CefString("BindObjectAsync"); - const CefString kBindObjectAsyncCamelCase = CefString("bindObjectAsync"); - - private class RegisterBoundObjectHandler : public CefV8Handler + namespace BrowserSubprocess { - private: - gcroot _callbackRegistry; - gcroot^> _javascriptObjects; - gcroot _browserWrapper; - - public: - RegisterBoundObjectHandler(RegisterBoundObjectRegistry^ callbackRegistery, Dictionary^ javascriptObjects, CefBrowserWrapper^ browserWrapper) + const CefString kIsObjectCached = CefString("IsObjectCached"); + const CefString kIsObjectCachedCamelCase = CefString("isObjectCached"); + const CefString kRemoveObjectFromCache = CefString("RemoveObjectFromCache"); + const CefString kRemoveObjectFromCacheCamelCase = CefString("removeObjectFromCache"); + const CefString kDeleteBoundObject = CefString("DeleteBoundObject"); + const CefString kDeleteBoundObjectCamelCase = CefString("deleteBoundObject"); + + private class RegisterBoundObjectHandler : public CefV8Handler { - _callbackRegistry = callbackRegistery; - _javascriptObjects = javascriptObjects; - _browserWrapper = browserWrapper; - } + private: + gcroot^> _javascriptObjects; - bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) OVERRIDE - { - auto context = CefV8Context::GetCurrentContext(); - if (context.get()) + public: + RegisterBoundObjectHandler(Dictionary^ javascriptObjects) { - auto browser = context->GetBrowser(); + _javascriptObjects = javascriptObjects; + } - if (context.get() && context->Enter()) + bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) override + { + auto context = CefV8Context::GetCurrentContext(); + if (context.get()) { - try + if (context.get() && context->Enter()) { - auto global = context->GetGlobal(); - - if (name == kIsObjectCached || name == kIsObjectCachedCamelCase) + try { - if (arguments.size() == 0 || arguments.size() > 1) + if (name == kIsObjectCached || name == kIsObjectCachedCamelCase) { - //TODO: Improve error message - exception = "Must specify the name of a single bound object to check the cache for"; - - return true; - } - - auto objectName = arguments[0]->GetStringValue(); - auto managedObjectName = StringUtils::ToClr(objectName); - - //Check to see if the object name is within the cache - retval = CefV8Value::CreateBool(_javascriptObjects->ContainsKey(managedObjectName)); - } - else if (name == kRemoveObjectFromCache || name == kRemoveObjectFromCacheCamelCase) - { - if (arguments.size() == 0 || arguments.size() > 1) - { - //TODO: Improve error message - exception = "Must specify the name of a single bound object to remove from cache"; - - return true; - } - - auto objectName = arguments[0]->GetStringValue(); - auto managedObjectName = StringUtils::ToClr(objectName); - - if (_javascriptObjects->ContainsKey(managedObjectName)) - { - //Remove object from cache - retval = CefV8Value::CreateBool(_javascriptObjects->Remove(managedObjectName)); - } - else - { - retval = CefV8Value::CreateBool(false); - } - } - //TODO: Better name for this function - else if (name == kDeleteBoundObject || name == kDeleteBoundObjectCamelCase) - { - if (arguments.size() == 0 || arguments.size() > 1) - { - //TODO: Improve error message - exception = "Must specify the name of a bound object to unbind, one object at a time."; - - return true; - } - - auto objectName = arguments[0]->GetStringValue(); - - auto global = context->GetGlobal(); - - auto success = global->DeleteValue(objectName); - - retval = CefV8Value::CreateBool(success); - } - else if (name == kBindObjectAsync || name == kBindObjectAsyncCamelCase) - { - CefRefPtr promiseData; - CefRefPtr promiseException; - //this will create a promise and give us the reject/resolve functions {p: Promise, res: resolve(), rej: reject()} - if (!context->Eval(CefAppUnmanagedWrapper::kPromiseCreatorScript, CefString(), 0, promiseData, promiseException)) - { - exception = promiseException->GetMessage(); - - return true; - } - - //return the promose - retval = promiseData->GetValue("p"); - - //References to the promise resolve and reject methods - auto resolve = promiseData->GetValue("res"); - auto reject = promiseData->GetValue("rej"); - - auto callback = gcnew JavascriptAsyncMethodCallback(context, resolve, reject); - - auto request = CefProcessMessage::Create(kJavascriptRootObjectRequest); - auto argList = request->GetArgumentList(); - auto params = CefListValue::Create(); - - auto boundObjectRequired = false; - auto notifyIfAlreadyBound = false; - auto ignoreCache = false; - auto cachedObjects = gcnew List(); - //TODO: Create object to represent this information - auto objectNamesWithBoundStatus = gcnew List^>(); - auto objectCount = 0; - - if (arguments.size() > 0) - { - objectCount = (int)arguments.size(); - - //If first argument is an object, we'll see if it contains config values - if (arguments[0]->IsObject()) + if (arguments.size() == 0 || arguments.size() > 1) { - //TODO: Look at adding some sort of javascript mapping layer to reduce the code duplication - if (arguments[0]->HasValue("NotifyIfAlreadyBound")) - { - auto notify = arguments[0]->GetValue("NotifyIfAlreadyBound"); - if (notify->IsBool()) - { - notifyIfAlreadyBound = notify->GetBoolValue(); - } - } - - if (arguments[0]->HasValue("IgnoreCache")) - { - auto ignore = arguments[0]->GetValue("IgnoreCache"); - if (ignore->IsBool()) - { - ignoreCache = ignore->GetBoolValue(); - } - } - - if (arguments[0]->HasValue("notifyIfAlreadyBound")) - { - auto notify = arguments[0]->GetValue("notifyIfAlreadyBound"); - if (notify->IsBool()) - { - notifyIfAlreadyBound = notify->GetBoolValue(); - } - } - - if (arguments[0]->HasValue("ignoreCache")) - { - auto ignore = arguments[0]->GetValue("ignoreCache"); - if (ignore->IsBool()) - { - ignoreCache = ignore->GetBoolValue(); - } - } + //TODO: Improve error message + exception = "Must specify the name of a single bound object to check the cache for"; - //If we have a config object then we remove that from the count - objectCount = objectCount - 1; + return true; } - //Loop through all arguments and ignore anything that's not a string - for (auto i = 0; i < arguments.size(); i++) - { - //Validate arg as being a string - if (arguments[i]->IsString()) - { - auto objectName = arguments[i]->GetStringValue(); - auto managedObjectName = StringUtils::ToClr(objectName); - auto alreadyBound = global->HasValue(objectName); - auto cached = false; - - //Check if the object has already been bound - if (alreadyBound) - { - cached = _javascriptObjects->ContainsKey(managedObjectName); - } - else - { - //If no matching object found then we'll add the object name to the list - boundObjectRequired = true; - params->SetString(i, objectName); - - JavascriptObject^ obj; - if (_javascriptObjects->TryGetValue(managedObjectName, obj)) - { - cachedObjects->Add(obj); + auto objectName = arguments[0]->GetStringValue(); + auto managedObjectName = StringUtils::ToClr(objectName); - cached = true; - } - } - - objectNamesWithBoundStatus->Add(Tuple::Create(managedObjectName, alreadyBound, cached)); - } - } + //Check to see if the object name is within the cache + retval = CefV8Value::CreateBool(_javascriptObjects->ContainsKey(managedObjectName)); } - else + else if (name == kRemoveObjectFromCache || name == kRemoveObjectFromCacheCamelCase) { - //No objects names were specified so we default to makeing the request - boundObjectRequired = true; - } - - if (boundObjectRequired || ignoreCache) - { - //If the number of cached objects matches the number of args - //(we have a cached copy of all requested objects) - //then we'll immediately bind the cached objects - if (cachedObjects->Count == objectCount && ignoreCache == false) + if (arguments.size() == 0 || arguments.size() > 1) { - auto frame = context->GetFrame(); - if (frame.get()) - { - if (Object::ReferenceEquals(_browserWrapper, nullptr)) - { - callback->Fail("Browser wrapper is null and unable to bind objects"); - } - else - { - auto rootObjectWrappers = _browserWrapper->JavascriptRootObjectWrappers; - - JavascriptRootObjectWrapper^ rootObject; - if (!rootObjectWrappers->TryGetValue(frame->GetIdentifier(), rootObject)) - { - rootObject = gcnew JavascriptRootObjectWrapper(browser->GetIdentifier(), _browserWrapper->BrowserProcess); - rootObjectWrappers->TryAdd(frame->GetIdentifier(), rootObject); - } - - //Cached objects only contains a list of objects not already bound - rootObject->Bind(cachedObjects, context->GetGlobal()); + //TODO: Improve error message + exception = "Must specify the name of a single bound object to remove from cache"; - //Response object has no Accessor or Interceptor - auto response = CefV8Value::CreateObject(NULL, NULL); - - response->SetValue("Count", CefV8Value::CreateInt(cachedObjects->Count), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); - response->SetValue("Success", CefV8Value::CreateBool(true), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); - response->SetValue("Message", CefV8Value::CreateString("OK"), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); - callback->Success(response); + return true; + } - NotifyObjectBound(browser, objectNamesWithBoundStatus); - } - } + auto objectName = arguments[0]->GetStringValue(); + auto managedObjectName = StringUtils::ToClr(objectName); + if (_javascriptObjects->ContainsKey(managedObjectName)) + { + //Remove object from cache + retval = CefV8Value::CreateBool(_javascriptObjects->Remove(managedObjectName)); } else { - //Obtain a callbackId then send off the Request for objects - auto callbackId = _callbackRegistry->SaveMethodCallback(callback); - - argList->SetInt(0, browser->GetIdentifier()); - SetInt64(argList, 1, context->GetFrame()->GetIdentifier()); - SetInt64(argList, 2, callbackId); - argList->SetList(3, params); - - browser->SendProcessMessage(CefProcessId::PID_BROWSER, request); + retval = CefV8Value::CreateBool(false); } } - else + //TODO: Better name for this function + else if (name == kDeleteBoundObject || name == kDeleteBoundObjectCamelCase) { - //Objects already bound or ignore cache + if (arguments.size() == 0 || arguments.size() > 1) + { + //TODO: Improve error message + exception = "Must specify the name of a bound object to unbind, one object at a time."; - //Response object has no Accessor or Interceptor - auto response = CefV8Value::CreateObject(NULL, NULL); + return true; + } - //Objects already bound so we immediately resolve the Promise - response->SetValue("Success", CefV8Value::CreateBool(false), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); - response->SetValue("Count", CefV8Value::CreateInt(0), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); - response->SetValue("Message", CefV8Value::CreateString("Object(s) already bound"), CefV8Value::PropertyAttribute::V8_PROPERTY_ATTRIBUTE_READONLY); + auto objectName = arguments[0]->GetStringValue(); - CefV8ValueList returnArgs; - returnArgs.push_back(response); - //If all the requested objects are bound then we immediately execute resolve - //with Success true and Count of 0 - resolve->ExecuteFunctionWithContext(context, nullptr, returnArgs); + auto global = context->GetGlobal(); - if (notifyIfAlreadyBound) - { - NotifyObjectBound(browser, objectNamesWithBoundStatus); - } + auto success = global->DeleteValue(objectName); + + retval = CefV8Value::CreateBool(success); } } + finally + { + context->Exit(); + } } - finally + else { - context->Exit(); + exception = "Unable to Enter Context"; } } else { - exception = "Unable to Enter Context"; + exception = "Unable to get current context"; } - } - else - { - exception = "Unable to get current context"; - } - return true; - } - - private: - void NotifyObjectBound(const CefRefPtr browser, List^>^ objectNamesWithBoundStatus) - { - //Send message notifying Browser Process of which objects were bound - //We do this after the objects have been created in the V8Context to gurantee - //they are accessible. - auto msg = CefProcessMessage::Create(kJavascriptObjectsBoundInJavascript); - auto args = msg->GetArgumentList(); - - auto boundObjects = CefListValue::Create(); - auto index = 0; - - for each(auto obj in objectNamesWithBoundStatus) - { - auto dict = CefDictionaryValue::Create(); - - auto name = obj->Item1; - auto alreadyBound = obj->Item2; - auto isCached = obj->Item3; - dict->SetString("Name", StringUtils::ToNative(name)); - dict->SetBool("IsCached", isCached); - dict->SetBool("AlreadyBound", alreadyBound); - - boundObjects->SetDictionary(index++, dict); + return true; } - args->SetList(0, boundObjects); - - browser->SendProcessMessage(CefProcessId::PID_BROWSER, msg); - } - - - IMPLEMENT_REFCOUNTING(RegisterBoundObjectHandler); - }; + IMPLEMENT_REFCOUNTINGM(RegisterBoundObjectHandler); + }; + } } diff --git a/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectRegistry.h b/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectRegistry.h index 2fa51b3488..7dd5aaae47 100644 --- a/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectRegistry.h +++ b/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectRegistry.h @@ -12,50 +12,53 @@ using namespace System::Runtime::Serialization; using namespace System::Linq; using namespace System::Threading; using namespace System::Collections::Generic; -using namespace CefSharp::Internals::Async; +using namespace CefSharp::BrowserSubprocess::Async; namespace CefSharp { - //TODO: JSB Fix naming of this class, it's pretty horrible currently - private ref class RegisterBoundObjectRegistry + namespace BrowserSubprocess { - private: - initonly Dictionary^ _methodCallbacks; - int64 _lastCallback; - - public: - RegisterBoundObjectRegistry() + //TODO: JSB Fix naming of this class, it's pretty horrible currently + private ref class RegisterBoundObjectRegistry { - _methodCallbacks = gcnew Dictionary(); - } + private: + //Only access through Interlocked::Increment - used to generate unique callback Id's + //Is static so ids are unique to this process https://github.com/cefsharp/CefSharp/issues/2792 + static int64_t _lastCallback; - ~RegisterBoundObjectRegistry() - { - for each(JavascriptAsyncMethodCallback^ var in _methodCallbacks->Values) + initonly Dictionary^ _methodCallbacks; + + public: + RegisterBoundObjectRegistry() { - delete var; + _methodCallbacks = gcnew Dictionary(); } - _methodCallbacks->Clear(); - } - int64 SaveMethodCallback(JavascriptAsyncMethodCallback^ callback) - { - auto callbackId = Interlocked::Increment(_lastCallback); - _methodCallbacks->Add(callbackId, callback); - return callbackId; - } - - bool TryGetAndRemoveMethodCallback(int64 id, JavascriptAsyncMethodCallback^% callback) - { - bool result = false; - if (result = _methodCallbacks->TryGetValue(id, callback)) + ~RegisterBoundObjectRegistry() { - _methodCallbacks->Remove(id); + for each (JavascriptAsyncMethodCallback ^ var in _methodCallbacks->Values) + { + delete var; + } + _methodCallbacks->Clear(); } - return result; - } - }; -} - + int64_t SaveMethodCallback(JavascriptAsyncMethodCallback^ callback) + { + auto callbackId = Interlocked::Increment(_lastCallback); + _methodCallbacks->Add(callbackId, callback); + return callbackId; + } + bool TryGetAndRemoveMethodCallback(int64_t id, JavascriptAsyncMethodCallback^% callback) + { + bool result = false; + if (result = _methodCallbacks->TryGetValue(id, callback)) + { + _methodCallbacks->Remove(id); + } + return result; + } + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/Resource.rc b/CefSharp.BrowserSubprocess.Core/Resource.rc index 74368860d4..468e9ae580 100644 --- a/CefSharp.BrowserSubprocess.Core/Resource.rc +++ b/CefSharp.BrowserSubprocess.Core/Resource.rc @@ -1,6 +1,8 @@ +#pragma code_page(65001) + 1 VERSIONINFO - FILEVERSION 74.1.130 - PRODUCTVERSION 74.1.130 + FILEVERSION 146,0,100 + PRODUCTVERSION 146,0,100 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -16,10 +18,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "CefSharp.BrowserSubprocess.Core" - VALUE "FileVersion", "74.1.130" - VALUE "LegalCopyright", "Copyright © 2019 The CefSharp Authors" + VALUE "FileVersion", "146.0.100" + VALUE "LegalCopyright", "Copyright © 2023 The CefSharp Authors" VALUE "ProductName", "CefSharp" - VALUE "ProductVersion", "74.1.130" + VALUE "ProductVersion", "146.0.100" END END BLOCK "VarFileInfo" diff --git a/CefSharp.BrowserSubprocess.Core/Serialization/JsObjectsSerialization.cpp b/CefSharp.BrowserSubprocess.Core/Serialization/JsObjectsSerialization.cpp index 25e2272873..15ff56d672 100644 --- a/CefSharp.BrowserSubprocess.Core/Serialization/JsObjectsSerialization.cpp +++ b/CefSharp.BrowserSubprocess.Core/Serialization/JsObjectsSerialization.cpp @@ -4,12 +4,14 @@ #include "stdafx.h" #include "JsObjectsSerialization.h" -#include "../CefSharp.Core/Internals/Serialization/Primitives.h" -#include "../CefSharp.Core/Internals/Serialization/ObjectsSerialization.h" +#include "../CefSharp.Core.Runtime/Internals/Serialization/Primitives.h" +#include "../CefSharp.Core.Runtime/Internals/Serialization/ObjectsSerialization.h" + +using namespace CefSharp::Internals::Serialization; namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Serialization { @@ -68,7 +70,9 @@ namespace CefSharp { auto result = gcnew List(); auto subList = list->GetList(index); - for (auto i = 0; i < subList->GetSize(); i++) + auto size = static_cast(subList->GetSize()); + + for (int i = 0; i < size; i++) { result->Add(DeserializeJsObject(subList, i)); } @@ -77,4 +81,4 @@ namespace CefSharp } } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Serialization/JsObjectsSerialization.h b/CefSharp.BrowserSubprocess.Core/Serialization/JsObjectsSerialization.h index bd5c07ef07..8e643091cc 100644 --- a/CefSharp.BrowserSubprocess.Core/Serialization/JsObjectsSerialization.h +++ b/CefSharp.BrowserSubprocess.Core/Serialization/JsObjectsSerialization.h @@ -8,7 +8,7 @@ namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Serialization { @@ -16,4 +16,4 @@ namespace CefSharp List^ DeserializeJsObjects(const CefRefPtr& list, int index); } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.cpp b/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.cpp index c7bcc8ee99..307ef0b0d4 100644 --- a/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.cpp +++ b/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.cpp @@ -5,15 +5,16 @@ #include "Stdafx.h" #include "V8Serialization.h" #include "JavascriptCallbackRegistry.h" -#include "../CefSharp.Core/Internals/Serialization/Primitives.h" +#include "../CefSharp.Core.Runtime/Internals/Serialization/Primitives.h" #include using namespace std; +using namespace CefSharp::Internals::Serialization; namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { namespace Serialization { @@ -41,7 +42,22 @@ namespace CefSharp } else if (obj->IsInt()) { - list->SetInt(index, obj->GetIntValue()); + // CEF doesn't differentiate between UINT and INT + // so we have to do some additional bounds checking + // To make sure the correct value is returned + // CEF IPC doesn't support UINT so we can only + // support int and double. + // https://github.com/cefsharp/CefSharp/issues/3858 + auto dValue = obj->GetDoubleValue(); + + if (dValue < INT_MIN || dValue > INT_MAX) + { + list->SetDouble(index, dValue); + } + else + { + list->SetInt(index, obj->GetIntValue()); + } } else if (obj->IsDouble()) { @@ -53,26 +69,25 @@ namespace CefSharp } else if (obj->IsDate()) { - SetCefTime(list, index, obj->GetDateValue()); + SetCefTime(list, index, obj->GetDateValue().val); + } + else if (obj->IsArrayBuffer()) + { + SetArrayBuffer(list, index, obj->GetArrayBufferByteLength(), obj->GetArrayBufferData()); } else if (obj->IsArray()) { int arrLength = obj->GetArrayLength(); - std::vector keys; - if (arrLength > 0 && obj->GetKeys(keys)) + auto array = CefListValue::Create(); + if (arrLength > 0) { - auto array = CefListValue::Create(); for (int i = 0; i < arrLength; i++) { - SerializeV8Object(obj->GetValue(keys[i]), array, i, callbackRegistry, seen); + SerializeV8Object(obj->GetValue(i), array, i, callbackRegistry, seen); } - - list->SetList(index, array); - } - else - { - list->SetNull(index); } + + list->SetList(index, array); } else if (obj->IsFunction()) { @@ -86,7 +101,7 @@ namespace CefSharp if (obj->GetKeys(keys) && keys.size() > 0) { auto result = CefDictionaryValue::Create(); - for (int i = 0; i < keys.size(); i++) + for (size_t i = 0; i < keys.size(); i++) { auto p_keyStr = StringUtils::ToClr(keys[i].ToString()); if ((obj->HasValue(keys[i])) && (!p_keyStr->StartsWith("__"))) @@ -145,15 +160,16 @@ namespace CefSharp if (IsCefTime(list, index)) { - return CefV8Value::CreateDate(GetCefTime(list, index)); + auto time = GetCefTime(list, index); + return CefV8Value::CreateDate(time); } if (type == VTYPE_LIST) { auto subList = list->GetList(index); - auto size = subList->GetSize(); + auto size = static_cast(subList->GetSize()); auto result = CefV8Value::CreateArray(size); - for (auto i = 0; i < size; i++) + for (int i = 0; i < size; i++) { result->SetValue(i, DeserializeV8Object(subList, i)); } @@ -168,7 +184,7 @@ namespace CefSharp std::vector keys; subDict->GetKeys(keys); auto result = CefV8Value::CreateObject(nullptr, nullptr); - for (auto i = 0; i < size; i++) + for (size_t i = 0; i < size; i++) { result->SetValue(keys[i], DeserializeV8Object(subDict, keys[i]), V8_PROPERTY_ATTRIBUTE_NONE); } @@ -180,11 +196,12 @@ namespace CefSharp } template void SerializeV8Object(const CefRefPtr &value, const CefRefPtr& list, const int& index, JavascriptCallbackRegistry^ callbackRegistry); + template void SerializeV8Object(const CefRefPtr &value, const CefRefPtr& list, const size_t& index, JavascriptCallbackRegistry^ callbackRegistry); template void SerializeV8Object(const CefRefPtr &value, const CefRefPtr& list, const CefString& index, JavascriptCallbackRegistry^ callbackRegistry); - template void SerializeV8Object(const CefRefPtr &value, const CefRefPtr& list, const int& index, JavascriptCallbackRegistry^ callbackRegistry, value_deque &visited); + template void SerializeV8Object(const CefRefPtr &value, const CefRefPtr& list, const size_t& index, JavascriptCallbackRegistry^ callbackRegistry, value_deque &visited); template void SerializeV8Object(const CefRefPtr &value, const CefRefPtr& list, const CefString& index, JavascriptCallbackRegistry^ callbackRegistry, value_deque &visited); template CefRefPtr DeserializeV8Object(const CefRefPtr& list, const int& index); template CefRefPtr DeserializeV8Object(const CefRefPtr& list, const CefString& index); } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.h b/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.h index d59ad95c59..9c0bc4c6b8 100644 --- a/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.h +++ b/CefSharp.BrowserSubprocess.Core/Serialization/V8Serialization.h @@ -5,13 +5,14 @@ #pragma once #include "include/cef_v8.h" +#include "JavascriptCallbackRegistry.h" + +using namespace CefSharp::Internals; namespace CefSharp { - namespace Internals + namespace BrowserSubprocess { - ref class JavascriptCallbackRegistry; - namespace Serialization { //Functions to serialize/deserialize data sent to/received from the browser process. @@ -26,4 +27,4 @@ namespace CefSharp CefRefPtr DeserializeV8Object(const CefRefPtr& list, const TIndex& index); } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Stdafx.h b/CefSharp.BrowserSubprocess.Core/Stdafx.h index fbdd796040..263c6361ea 100644 --- a/CefSharp.BrowserSubprocess.Core/Stdafx.h +++ b/CefSharp.BrowserSubprocess.Core/Stdafx.h @@ -10,14 +10,17 @@ #define DECL __declspec(dllimport) #endif +#define NOMINMAX + #include #include -#include ".\..\CefSharp.Core\Internals\MCefRefPtr.h" -#include ".\..\CefSharp.Core\Internals\StringUtils.h" +#include ".\..\CefSharp.Core.Runtime\Internals\CefRefCountManaged.h" +#include ".\..\CefSharp.Core.Runtime\Internals\MCefRefPtr.h" +#include ".\..\CefSharp.Core.Runtime\Internals\StringUtils.h" #include "vcclr_local.h" using namespace System; using namespace CefSharp; -using namespace CefSharp::Internals; \ No newline at end of file +using namespace CefSharp::Internals; diff --git a/CefSharp.BrowserSubprocess.Core/SubProcess.h b/CefSharp.BrowserSubprocess.Core/SubProcess.h index ad847ae099..8f988f561b 100644 --- a/CefSharp.BrowserSubprocess.Core/SubProcess.h +++ b/CefSharp.BrowserSubprocess.Core/SubProcess.h @@ -6,10 +6,11 @@ #include "Stdafx.h" #include "include/cef_app.h" -#include "include/cef_base.h" +#include "SubProcessApp.h" #include "CefBrowserWrapper.h" #include "CefAppUnmanagedWrapper.h" +#include "Cef.h" using namespace System::Collections::Generic; using namespace System::Linq; @@ -53,7 +54,7 @@ namespace CefSharp CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer()); - return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get(), NULL); + return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get(), nullptr); } virtual void OnBrowserCreated(CefBrowserWrapper^ cefBrowserWrapper) @@ -66,18 +67,17 @@ namespace CefSharp } - static void EnableHighDPISupport() - { - CefEnableHighDPISupport(); - } - - static int ExecuteProcess() + static int ExecuteProcess(IEnumerable^ args) { auto hInstance = Process::GetCurrentProcess()->Handle; CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer()); - return CefExecuteProcess(cefMainArgs, NULL, NULL); + auto schemes = CefCustomScheme::ParseCommandLineArguments(args); + + CefRefPtr app = new SubProcessApp(schemes); + + return CefExecuteProcess(cefMainArgs, app, nullptr); } }; } diff --git a/CefSharp.BrowserSubprocess.Core/SubProcessApp.h b/CefSharp.BrowserSubprocess.Core/SubProcessApp.h new file mode 100644 index 0000000000..b3e4c9be75 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/SubProcessApp.h @@ -0,0 +1,50 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include/cef_app.h" + +using namespace System::Collections::Generic; + +namespace CefSharp +{ + namespace BrowserSubprocess + { + // CefApp implementation that's common across all subprocess types + public class SubProcessApp : public CefApp + { + private: + gcroot^> _schemes; + + public: + SubProcessApp(List^ schemes) + { + _schemes = schemes; + } + + ~SubProcessApp() + { + delete _schemes; + _schemes = nullptr; + } + + void OnRegisterCustomSchemes(CefRawPtr registrar) override + { + for each (CefCustomScheme ^ scheme in _schemes->AsReadOnly()) + { + auto schemeName = StringUtils::ToNative(scheme->SchemeName); + auto schemeOptions = (int)scheme->Options; + if (!registrar->AddCustomScheme(schemeName, schemeOptions)) + { + LOG(ERROR) << "SubProcessApp::OnRegisterCustomSchemes failed for schemeName:" << schemeName; + } + } + } + + IMPLEMENT_REFCOUNTINGM(SubProcessApp); + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/TypeUtils.cpp b/CefSharp.BrowserSubprocess.Core/TypeUtils.cpp index d65e648aec..1d0afe469c 100644 --- a/CefSharp.BrowserSubprocess.Core/TypeUtils.cpp +++ b/CefSharp.BrowserSubprocess.Core/TypeUtils.cpp @@ -5,266 +5,256 @@ #pragma once #include "Stdafx.h" -#include ".\..\CefSharp.Core\Internals\StringUtils.h" +#include ".\..\CefSharp.Core.Runtime\Internals\StringUtils.h" #include "TypeUtils.h" using namespace System::Collections::Generic; namespace CefSharp { - CefRefPtr TypeUtils::ConvertToCef(Object^ obj, Type^ type) + namespace BrowserSubprocess { - if (type == Void::typeid) + CefRefPtr TypeUtils::ConvertToCef(Object^ obj, Type^ type) { - return CefV8Value::CreateUndefined(); - } - if (obj == nullptr) - { - return CefV8Value::CreateNull(); - } - - if (type == nullptr) - { - type = obj->GetType(); - } + if (type == Void::typeid) + { + return CefV8Value::CreateUndefined(); + } + if (obj == nullptr) + { + return CefV8Value::CreateNull(); + } - Type^ underlyingType = Nullable::GetUnderlyingType(type); - if (underlyingType != nullptr) type = underlyingType; + if (type == nullptr) + { + type = obj->GetType(); + } - if (type == Boolean::typeid) - { - return CefV8Value::CreateBool(safe_cast(obj)); - } - if (type == Int32::typeid) - { - return CefV8Value::CreateInt(safe_cast(obj)); - } - if (type == String::typeid) - { - CefString str = StringUtils::ToNative(safe_cast(obj)); - return CefV8Value::CreateString(str); - } - if (type == Double::typeid) - { - return CefV8Value::CreateDouble(safe_cast(obj)); - } - if (type == Decimal::typeid) - { - return CefV8Value::CreateDouble(Convert::ToDouble(obj)); - } - if (type == SByte::typeid) - { - return CefV8Value::CreateInt(Convert::ToInt32(obj)); - } - if (type == Int16::typeid) - { - return CefV8Value::CreateInt(Convert::ToInt32(obj)); - } - if (type == Int64::typeid) - { - return CefV8Value::CreateDouble(Convert::ToDouble(obj)); - } - if (type == Byte::typeid) - { - return CefV8Value::CreateInt(Convert::ToInt32(obj)); - } - if (type == UInt16::typeid) - { - return CefV8Value::CreateInt(Convert::ToInt32(obj)); - } - if (type == UInt32::typeid) - { - return CefV8Value::CreateDouble(Convert::ToDouble(obj)); - } - if (type == UInt64::typeid) - { - return CefV8Value::CreateDouble(Convert::ToDouble(obj)); - } - if (type == Single::typeid) - { - return CefV8Value::CreateDouble(Convert::ToDouble(obj)); - } - if (type == Char::typeid) - { - return CefV8Value::CreateInt(Convert::ToInt32(obj)); - } - if (type == DateTime::typeid) - { - return CefV8Value::CreateDate(TypeUtils::ConvertDateTimeToCefTime(safe_cast(obj))); - } - if (type->IsArray) - { - Array^ managedArray = (Array^)obj; - CefRefPtr cefArray = CefV8Value::CreateArray(managedArray->Length); + Type^ underlyingType = Nullable::GetUnderlyingType(type); + if (underlyingType != nullptr) type = underlyingType; - for (int i = 0; i < managedArray->Length; i++) + if (type == Boolean::typeid) { - Object^ arrObj; - - arrObj = managedArray->GetValue(i); + return CefV8Value::CreateBool(safe_cast(obj)); + } + if (type == Int32::typeid) + { + return CefV8Value::CreateInt(safe_cast(obj)); + } + if (type == String::typeid) + { + CefString str = StringUtils::ToNative(safe_cast(obj)); + return CefV8Value::CreateString(str); + } + if (type == Double::typeid) + { + return CefV8Value::CreateDouble(safe_cast(obj)); + } + if (type == Decimal::typeid) + { + return CefV8Value::CreateDouble(Convert::ToDouble(obj)); + } + if (type == SByte::typeid) + { + return CefV8Value::CreateInt(Convert::ToInt32(obj)); + } + if (type == Int16::typeid) + { + return CefV8Value::CreateInt(Convert::ToInt32(obj)); + } + if (type == Int64::typeid) + { + return CefV8Value::CreateDouble(Convert::ToDouble(obj)); + } + if (type == Byte::typeid) + { + return CefV8Value::CreateInt(Convert::ToInt32(obj)); + } + if (type == UInt16::typeid) + { + return CefV8Value::CreateInt(Convert::ToInt32(obj)); + } + if (type == UInt32::typeid) + { + return CefV8Value::CreateDouble(Convert::ToDouble(obj)); + } + if (type == UInt64::typeid) + { + return CefV8Value::CreateDouble(Convert::ToDouble(obj)); + } + if (type == Single::typeid) + { + return CefV8Value::CreateDouble(Convert::ToDouble(obj)); + } + if (type == Char::typeid) + { + return CefV8Value::CreateInt(Convert::ToInt32(obj)); + } + if (type == DateTime::typeid) + { + CefBaseTime baseTime; + baseTime.val = CefTimeUtils::FromDateTimeToBaseTime(safe_cast(obj)); + return CefV8Value::CreateDate(baseTime); + } + if (type->IsArray) + { + Array^ managedArray = (Array^)obj; + CefRefPtr cefArray = CefV8Value::CreateArray(managedArray->Length); - if (arrObj != nullptr) + for (int i = 0; i < managedArray->Length; i++) { - CefRefPtr cefObj = TypeUtils::ConvertToCef(arrObj, arrObj->GetType()); + Object^ arrObj; - cefArray->SetValue(i, cefObj); - } - else - { - cefArray->SetValue(i, CefV8Value::CreateNull()); - } - } + arrObj = managedArray->GetValue(i); - return cefArray; - } - if (type->IsValueType && !type->IsPrimitive && !type->IsEnum) - { - cli::array^ fields = type->GetFields(); - CefRefPtr cefArray = CefV8Value::CreateArray(fields->Length); + if (arrObj != nullptr) + { + CefRefPtr cefObj = TypeUtils::ConvertToCef(arrObj, arrObj->GetType()); + + cefArray->SetValue(i, cefObj); + } + else + { + cefArray->SetValue(i, CefV8Value::CreateNull()); + } + } - for (int i = 0; i < fields->Length; i++) + return cefArray; + } + if (type->IsValueType && !type->IsPrimitive && !type->IsEnum) { - String^ fieldName = fields[i]->Name; + cli::array^ fields = type->GetFields(); + CefRefPtr cefArray = CefV8Value::CreateArray(fields->Length); - CefString strFieldName = StringUtils::ToNative(safe_cast(fieldName)); + for (int i = 0; i < fields->Length; i++) + { + String^ fieldName = fields[i]->Name; - Object^ fieldVal = fields[i]->GetValue(obj); + CefString strFieldName = StringUtils::ToNative(safe_cast(fieldName)); - if (fieldVal != nullptr) - { - CefRefPtr cefVal = TypeUtils::ConvertToCef(fieldVal, fieldVal->GetType()); + Object^ fieldVal = fields[i]->GetValue(obj); - cefArray->SetValue(strFieldName, cefVal, V8_PROPERTY_ATTRIBUTE_NONE); - } - else - { - cefArray->SetValue(strFieldName, CefV8Value::CreateNull(), V8_PROPERTY_ATTRIBUTE_NONE); - } - } + if (fieldVal != nullptr) + { + CefRefPtr cefVal = TypeUtils::ConvertToCef(fieldVal, fieldVal->GetType()); - return cefArray; - } - //TODO: What exception type? - throw gcnew Exception(String::Format("Cannot convert '{0}' object from CLR to CEF.", type->FullName)); - } + cefArray->SetValue(strFieldName, cefVal, V8_PROPERTY_ATTRIBUTE_NONE); + } + else + { + cefArray->SetValue(strFieldName, CefV8Value::CreateNull(), V8_PROPERTY_ATTRIBUTE_NONE); + } + } - Object^ TypeUtils::ConvertFromCef(CefRefPtr obj, JavascriptCallbackRegistry^ callbackRegistry) - { - if (obj->IsNull() || obj->IsUndefined()) - { - return nullptr; + return cefArray; + } + //TODO: What exception type? + throw gcnew Exception(String::Format("Cannot convert '{0}' object from CLR to CEF.", type->FullName)); } - if (obj->IsBool()) + Object^ TypeUtils::ConvertFromCef(CefRefPtr obj, JavascriptCallbackRegistry^ callbackRegistry) { - return gcnew System::Boolean(obj->GetBoolValue()); - } - if (obj->IsInt()) - { - return gcnew System::Int32(obj->GetIntValue()); - } - if (obj->IsDouble()) - { - return gcnew System::Double(obj->GetDoubleValue()); - } - if (obj->IsString()) - { - return StringUtils::ToClr(obj->GetStringValue()); - } - if (obj->IsDate()) - { - return TypeUtils::ConvertCefTimeToDateTime(obj->GetDateValue()); - } + if (obj->IsNull() || obj->IsUndefined()) + { + return nullptr; + } - if (obj->IsArray()) - { - int arrLength = obj->GetArrayLength(); + if (obj->IsBool()) + { + return gcnew System::Boolean(obj->GetBoolValue()); + } + if (obj->IsInt()) + { + return gcnew System::Int32(obj->GetIntValue()); + } + if (obj->IsDouble()) + { + return gcnew System::Double(obj->GetDoubleValue()); + } + if (obj->IsString()) + { + return StringUtils::ToClr(obj->GetStringValue()); + } + if (obj->IsDate()) + { + return CefTimeUtils::FromBaseTimeToDateTime(obj->GetDateValue().val); + } - if (arrLength > 0) + if (obj->IsArray()) { - std::vector keys; - if (obj->GetKeys(keys)) - { - auto array = gcnew List(); + int arrLength = obj->GetArrayLength(); - for (int i = 0; i < arrLength; i++) + if (arrLength > 0) + { + std::vector keys; + if (obj->GetKeys(keys)) { - auto data = obj->GetValue(keys[i]); - if (data != nullptr) + auto array = gcnew List(); + + //TODO: This can likely be simplified to just call GetValue(i) rather than accessing the keys + for (int i = 0; i < arrLength; i++) { - auto p_data = TypeUtils::ConvertFromCef(data, callbackRegistry); + auto data = obj->GetValue(keys[i]); + if (data != nullptr) + { + auto p_data = TypeUtils::ConvertFromCef(data, callbackRegistry); - array->Add(p_data); + array->Add(p_data); + } } - } - return array->ToArray(); + return array->ToArray(); + } } - } - - return nullptr; - } - if (obj->IsFunction()) - { - if (callbackRegistry == nullptr) - { return nullptr; } - return callbackRegistry->Register(CefV8Context::GetCurrentContext(), obj); - } - - if (obj->IsObject()) - { - std::vector keys; - if (obj->GetKeys(keys)) + if (obj->IsFunction()) { - int objLength = keys.size(); - if (objLength > 0) + if (callbackRegistry == nullptr) { - auto result = gcnew Dictionary(); + return nullptr; + } + + return callbackRegistry->Register(CefV8Context::GetCurrentContext(), obj); + } - for (int i = 0; i < objLength; i++) + if (obj->IsObject()) + { + std::vector keys; + if (obj->GetKeys(keys)) + { + size_t objLength = keys.size(); + if (objLength > 0) { - String^ p_keyStr = StringUtils::ToClr(keys[i].ToString()); + auto result = gcnew Dictionary(); - if ((obj->HasValue(keys[i])) && (!p_keyStr->StartsWith("__"))) + for (size_t i = 0; i < objLength; i++) { - CefRefPtr data = obj->GetValue(keys[i]); - if (data != nullptr) + String^ p_keyStr = StringUtils::ToClr(keys[i].ToString()); + + if ((obj->HasValue(keys[i])) && (!p_keyStr->StartsWith("__"))) { - Object^ p_data = TypeUtils::ConvertFromCef(data, callbackRegistry); + CefRefPtr data = obj->GetValue(keys[i]); + if (data != nullptr) + { + Object^ p_data = TypeUtils::ConvertFromCef(data, callbackRegistry); - result->Add(p_keyStr, p_data); + result->Add(p_keyStr, p_data); + } } } - } - return result; + return result; + } } + + return nullptr; } - return nullptr; + //TODO: What exception type? + throw gcnew Exception("Cannot convert object from Cef to CLR."); } - - //TODO: What exception type? - throw gcnew Exception("Cannot convert object from Cef to CLR."); - } - - DateTime TypeUtils::ConvertCefTimeToDateTime(CefTime time) - { - return DateTimeUtils::FromCefTime(time.year, - time.month, - time.day_of_month, - time.hour, - time.minute, - time.second, - time.millisecond); - } - - CefTime TypeUtils::ConvertDateTimeToCefTime(DateTime dateTime) - { - return CefTime(DateTimeUtils::ToCefTime(dateTime)); } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/TypeUtils.h b/CefSharp.BrowserSubprocess.Core/TypeUtils.h index 181d03b058..b7392e96b0 100644 --- a/CefSharp.BrowserSubprocess.Core/TypeUtils.h +++ b/CefSharp.BrowserSubprocess.Core/TypeUtils.h @@ -12,41 +12,44 @@ using namespace System; namespace CefSharp { - private class TypeUtils + namespace BrowserSubprocess { - public: - /// - /// Converts a .NET object to an (unmanaged) Chromium V8 object. - /// - /// The .NET object that should be converted. - /// The type of the source object. If this parameter is a null reference, the type will be determined - /// automatically. - /// A corresponding V8 value. - static CefRefPtr ConvertToCef(Object^ obj, Type^ type); + private class TypeUtils + { + public: + /// + /// Converts a .NET object to an (unmanaged) Chromium V8 object. + /// + /// The .NET object that should be converted. + /// The type of the source object. If this parameter is a null reference, the type will be determined + /// automatically. + /// A corresponding V8 value. + static CefRefPtr ConvertToCef(Object^ obj, Type^ type); - /// - /// Converts a Chromium V8 value to a (managed) .NET object - /// using a JavascriptCallbackRegistry param to convert any - /// anonymous function to IJavascriptCallback, if callbackRegistry - /// is nullptr will use nullptr to each anonymous function instead. - /// - /// The V8 value that should be converted. - /// Instance of JavascriptCallbackRegistry to manage IJavascriptCallback instances. - /// A corresponding .NET object. - static Object^ ConvertFromCef(CefRefPtr obj, JavascriptCallbackRegistry^ callbackRegistry); + /// + /// Converts a Chromium V8 value to a (managed) .NET object + /// using a JavascriptCallbackRegistry param to convert any + /// anonymous function to IJavascriptCallback, if callbackRegistry + /// is nullptr will use nullptr to each anonymous function instead. + /// + /// The V8 value that should be converted. + /// Instance of JavascriptCallbackRegistry to manage IJavascriptCallback instances. + /// A corresponding .NET object. + static Object^ ConvertFromCef(CefRefPtr obj, JavascriptCallbackRegistry^ callbackRegistry); - /// - /// Converts a Chromium V8 CefTime (Date) to a (managed) .NET DateTime. - /// - /// The CefTime value that should be converted. - /// A corresponding .NET DateTime. - static DateTime ConvertCefTimeToDateTime(CefTime time); + /// + /// Converts a Chromium V8 CefBaseTime (Date) to a (managed) .NET DateTime. + /// + /// The CefTime value that should be converted. + /// A corresponding .NET DateTime. + static DateTime ConvertCefTimeToDateTime(CefBaseTime time); - /// - /// Converts a a (managed) .NET DateTime to Chromium V8 CefTime (Date). - /// - /// The DateTime value that should be converted. - /// A corresponding CefTime (epoch). - static CefTime ConvertDateTimeToCefTime(DateTime dateTime); - }; -} \ No newline at end of file + /// + /// Converts a a (managed) .NET DateTime to Chromium V8 CefBaseTime (Date). + /// + /// The DateTime value that should be converted. + /// A corresponding CefTime (epoch). + static CefBaseTime ConvertDateTimeToCefTime(DateTime dateTime); + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/WcfBrowserSubprocessExecutable.h b/CefSharp.BrowserSubprocess.Core/WcfBrowserSubprocessExecutable.h new file mode 100644 index 0000000000..18291ddd44 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/WcfBrowserSubprocessExecutable.h @@ -0,0 +1,64 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "SubProcess.h" +#include "WcfEnabledSubProcess.h" +#include "BrowserSubprocessExecutable.h" + +using namespace System; +using namespace CefSharp::Internals; + +namespace CefSharp +{ + namespace BrowserSubprocess + { + /// + /// WcfBrowserSubprocessExecutable provides the fundimental browser process handling for + /// CefSharp.BrowserSubprocess.exe and can be used to self host the BrowserSubProcess in your + /// existing application (preferred approach for .Net Core). + /// If the command line argument is + /// present then the WcfEnabledSubProcess implementation is used. + /// + public ref class WcfBrowserSubprocessExecutable : BrowserSubprocessExecutable + { + public: + WcfBrowserSubprocessExecutable() + { + + } + + /// + /// This function should be called from the application entry point function (typically Program.Main) + /// to execute a secondary process e.g. gpu, renderer, utility + /// This overload is specifically used for .Net 4.x. For hosting your own BrowserSubProcess + /// it's preferable to use the Main method provided by this class. + /// + /// + /// If called for the browser process (identified by no "type" command-line value) it will return immediately + /// with a value of -1. If called for a recognized secondary process it will block until the process should exit + /// and then return the process exit code. + /// ^ args) + { + auto subProcess = gcnew WcfBrowserSubprocessExecutable(); + return subProcess->Main(args, nullptr); + } + + protected: + SubProcess^ GetSubprocess(IEnumerable^ args, int parentProcessId, IRenderProcessHandler^ handler) override + { + auto wcfEnabled = CommandLineArgsParser::HasArgument(args, CefSharpArguments::WcfEnabledArgument); + if (wcfEnabled) + { + return gcnew WcfEnabledSubProcess(parentProcessId, handler, args); + } + return gcnew SubProcess(handler, args); + } + }; + } +} diff --git a/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.cpp b/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.cpp index 029f5e300c..ced1f83c3b 100644 --- a/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.cpp +++ b/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.cpp @@ -58,34 +58,46 @@ namespace CefSharp { auto channelFactory = browser->ChannelFactory; - try + //Add null check for issue https://github.com/cefsharp/CefSharp/issues/2839 + if (channelFactory == nullptr) { - if (channelFactory->State == CommunicationState::Opened) - { - channelFactory->Close(); - } + LOG(ERROR) << "WcfEnabledSubProcess::OnBrowserDestroyed - browser->ChannelFactory was unexpectedly null, see https://github.com/cefsharp/CefSharp/issues/2839 for some debugging tips."; } - catch (Exception^) + else { - channelFactory->Abort(); + try + { + if (channelFactory->State == CommunicationState::Opened) + { + channelFactory->Close(); + } + } + catch (Exception^) + { + channelFactory->Abort(); + } } - auto clientChannel = ((IClientChannel^)browser->BrowserProcess); - - try + //Add null check for issue https://github.com/cefsharp/CefSharp/issues/2839 + if (browser->BrowserProcess != nullptr) { - if (clientChannel->State == CommunicationState::Opened) + auto clientChannel = ((IClientChannel^)browser->BrowserProcess); + + try { - clientChannel->Close(); + if (clientChannel->State == CommunicationState::Opened) + { + clientChannel->Close(); + } + } + catch (Exception^) + { + clientChannel->Abort(); } - } - catch (Exception^) - { - clientChannel->Abort(); } browser->ChannelFactory = nullptr; browser->BrowserProcess = nullptr; } } -} \ No newline at end of file +} diff --git a/CefSharp.BrowserSubprocess.Core/Wrapper/Browser.cpp b/CefSharp.BrowserSubprocess.Core/Wrapper/Browser.cpp index 4052255f75..4e07c1adf4 100644 --- a/CefSharp.BrowserSubprocess.Core/Wrapper/Browser.cpp +++ b/CefSharp.BrowserSubprocess.Core/Wrapper/Browser.cpp @@ -9,6 +9,11 @@ using namespace CefSharp::BrowserSubprocess; +bool Browser::IsValid::get() +{ + return _browser->IsValid(); +} + /// // Returns the browser host object. This method can only be called in the // browser process. @@ -150,9 +155,9 @@ IFrame^ Browser::FocusedFrame::get() // Returns the frame with the specified identifier, or NULL if not found. /// /*--cef(capi_name=get_frame_byident)--*/ -IFrame^ Browser::GetFrame(Int64 identifier) +IFrame^ Browser::GetFrameByIdentifier(String^ identifier) { - auto frame = _browser->GetFrame(identifier); + auto frame = _browser->GetFrameByIdentifier(StringUtils::ToNative(identifier)); if (frame.get()) { @@ -166,9 +171,9 @@ IFrame^ Browser::GetFrame(Int64 identifier) // Returns the frame with the specified name, or NULL if not found. /// /*--cef(optional_param=name)--*/ -IFrame^ Browser::GetFrame(String^ name) +IFrame^ Browser::GetFrameByName(String^ name) { - auto frame = _browser->GetFrame(StringUtils::ToNative(name)); + auto frame = _browser->GetFrameByName(StringUtils::ToNative(name)); if (frame.get()) { @@ -184,21 +189,21 @@ IFrame^ Browser::GetFrame(String^ name) /*--cef()--*/ int Browser::GetFrameCount() { - return _browser->GetFrameCount(); + return static_cast(_browser->GetFrameCount()); } /// // Returns the identifiers of all existing frames. /// /*--cef(count_func=identifiers:GetFrameCount)--*/ -List^ Browser::GetFrameIdentifiers() +List^ Browser::GetFrameIdentifiers() { - std::vector identifiers; + std::vector identifiers; _browser->GetFrameIdentifiers(identifiers); - List^ results = gcnew List(identifiers.size()); + List^ results = gcnew List(static_cast(identifiers.size())); for (UINT i = 0; i < identifiers.size(); i++) { - results->Add(identifiers[i]); + results->Add(StringUtils::ToClr(identifiers[i])); } return results; } @@ -215,6 +220,24 @@ List^ Browser::GetFrameNames() return StringUtils::ToClr(names); } +IReadOnlyCollection^ Browser::GetAllFrames() +{ + std::vector identifiers; + _browser->GetFrameIdentifiers(identifiers); + + auto results = gcnew List(static_cast(identifiers.size())); + for (UINT i = 0; i < identifiers.size(); i++) + { + auto frame = _browser->GetFrameByIdentifier(identifiers[i]); + + if (frame.get()) + { + results->Add(gcnew Frame(frame)); + } + } + return results; +} + bool Browser::IsDisposed::get() { return _disposed; diff --git a/CefSharp.BrowserSubprocess.Core/Wrapper/Browser.h b/CefSharp.BrowserSubprocess.Core/Wrapper/Browser.h index aed46e56ef..c105d8b37e 100644 --- a/CefSharp.BrowserSubprocess.Core/Wrapper/Browser.h +++ b/CefSharp.BrowserSubprocess.Core/Wrapper/Browser.h @@ -19,7 +19,7 @@ namespace CefSharp bool _disposed; internal: - Browser(CefRefPtr &browser) + Browser(const CefRefPtr &browser) : _browser(browser) { } @@ -37,6 +37,11 @@ namespace CefSharp } public: + virtual property bool IsValid + { + bool get(); + } + /// // Returns the browser host object. This method can only be called in the // browser process. @@ -153,13 +158,13 @@ namespace CefSharp // Returns the frame with the specified identifier, or NULL if not found. /// /*--cef(capi_name=get_frame_byident)--*/ - virtual IFrame^ GetFrame(Int64 identifier); + virtual IFrame^ GetFrameByIdentifier(String^ identifier); /// // Returns the frame with the specified name, or NULL if not found. /// /*--cef(optional_param=name)--*/ - virtual IFrame^ GetFrame(String^ name); + virtual IFrame^ GetFrameByName(String^ name); /// // Returns the number of frames that currently exist. @@ -171,7 +176,7 @@ namespace CefSharp // Returns the identifiers of all existing frames. /// /*--cef(count_func=identifiers:GetFrameCount)--*/ - virtual List^ GetFrameIdentifiers(); + virtual List^ GetFrameIdentifiers(); /// // Returns the names of all existing frames. @@ -179,6 +184,8 @@ namespace CefSharp /*--cef()--*/ virtual List^ GetFrameNames(); + virtual IReadOnlyCollection^ GetAllFrames(); + virtual property bool IsDisposed { bool get(); diff --git a/CefSharp.BrowserSubprocess.Core/Wrapper/Frame.cpp b/CefSharp.BrowserSubprocess.Core/Wrapper/Frame.cpp index 1c7798844b..c5b1b3c50e 100644 --- a/CefSharp.BrowserSubprocess.Core/Wrapper/Frame.cpp +++ b/CefSharp.BrowserSubprocess.Core/Wrapper/Frame.cpp @@ -152,17 +152,6 @@ void Frame::LoadUrl(String^ url) _frame->LoadURL(StringUtils::ToNative(url)); } -/// -// Load the contents of |html| with the specified dummy |url|. |url| -// should have a standard scheme (for example, http scheme) or behaviors like -// link clicks and web security restrictions may not behave as expected. -/// -/*--cef()--*/ -void Frame::LoadStringForUrl(String^ html, String^ url) -{ - _frame->LoadString(StringUtils::ToNative(html), StringUtils::ToNative(url)); -} - /// // Execute a string of JavaScript code in this frame. The |script_url| // parameter is the URL where the script in question can be found, if any. @@ -176,7 +165,7 @@ void Frame::ExecuteJavaScriptAsync(String^ code, String^ scriptUrl, int startLin _frame->ExecuteJavaScript(StringUtils::ToNative(code), StringUtils::ToNative(scriptUrl), startLine); } -Task^ Frame::EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable timeout) +Task^ Frame::EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable timeout, bool useImmediatelyInvokedFuncExpression) { throw gcnew NotImplementedException(); } @@ -216,9 +205,9 @@ String^ Frame::Name::get() // Returns the globally unique identifier for this frame. /// /*--cef()--*/ -Int64 Frame::Identifier::get() +String^ Frame::Identifier::get() { - return _frame->GetIdentifier(); + return StringUtils::ToClr(_frame->GetIdentifier()); } /// @@ -290,6 +279,11 @@ IRequest^ Frame::CreateRequest(bool initializePostData) throw gcnew NotImplementedException(); } +IUrlRequest^ Frame::CreateUrlRequest(IRequest^ request, IUrlRequestClient^ client) +{ + throw gcnew NotImplementedException(); +} + bool Frame::IsDisposed::get() { return _disposed; diff --git a/CefSharp.BrowserSubprocess.Core/Wrapper/Frame.h b/CefSharp.BrowserSubprocess.Core/Wrapper/Frame.h index 52f9375630..941d04fb4b 100644 --- a/CefSharp.BrowserSubprocess.Core/Wrapper/Frame.h +++ b/CefSharp.BrowserSubprocess.Core/Wrapper/Frame.h @@ -31,7 +31,7 @@ namespace CefSharp bool _disposed; internal: - Frame(CefRefPtr &frame) + Frame(const CefRefPtr &frame) : _frame(frame), _parentFrame(nullptr), _owningBrowser(nullptr), _syncRoot(gcnew Object()) { @@ -39,7 +39,7 @@ namespace CefSharp !Frame() { - _frame = NULL; + _frame = nullptr; } ~Frame() @@ -154,14 +154,6 @@ namespace CefSharp /*--cef()--*/ virtual void LoadUrl(String^ url); - /// - // Load the contents of |html| with the specified dummy |url|. |url| - // should have a standard scheme (for example, http scheme) or behaviors like - // link clicks and web security restrictions may not behave as expected. - /// - /*--cef()--*/ - virtual void LoadStringForUrl(String^ html, String^ url); - /// // Execute a string of JavaScript code in this frame. The |script_url| // parameter is the URL where the script in question can be found, if any. @@ -172,7 +164,7 @@ namespace CefSharp /*--cef(optional_param=script_url)--*/ virtual void ExecuteJavaScriptAsync(String^ code, String^ scriptUrl, int startLine); - virtual Task^ EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable timeout); + virtual Task^ EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable timeout, bool useImmediatelyInvokedFuncExpression); /// // Returns true if this is the main (top-level) frame. @@ -209,9 +201,9 @@ namespace CefSharp // Returns the globally unique identifier for this frame. /// /*--cef()--*/ - virtual property Int64 Identifier + virtual property String^ Identifier { - Int64 get(); + String^ get(); } /// @@ -241,9 +233,11 @@ namespace CefSharp { IBrowser^ get(); } - + virtual IRequest^ CreateRequest(bool initializePostData); + virtual IUrlRequest^ CreateUrlRequest(IRequest^ request, IUrlRequestClient^ client); + virtual property bool IsDisposed { bool get(); diff --git a/CefSharp.BrowserSubprocess.Core/Wrapper/V8Context.h b/CefSharp.BrowserSubprocess.Core/Wrapper/V8Context.h index 134a6f298c..d9fcf65f09 100644 --- a/CefSharp.BrowserSubprocess.Core/Wrapper/V8Context.h +++ b/CefSharp.BrowserSubprocess.Core/Wrapper/V8Context.h @@ -28,7 +28,7 @@ namespace CefSharp !V8Context() { - _context = NULL; + _context = nullptr; } ~V8Context() diff --git a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config new file mode 100644 index 0000000000..3146a76ea4 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config new file mode 100644 index 0000000000..d349c54ea4 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/packages.config b/CefSharp.BrowserSubprocess.Core/packages.config deleted file mode 100644 index 4cbdc1e94e..0000000000 --- a/CefSharp.BrowserSubprocess.Core/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.csproj b/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.csproj index e602d36625..3641cb9b33 100644 --- a/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.csproj +++ b/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.csproj @@ -1,124 +1,46 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {23EE5140-2C2C-4B53-A954-10B08DCA6BD6} - WinExe - Properties - CefSharp.BrowserSubprocess - CefSharp.BrowserSubprocess - v4.5.2 - - - 512 - - - x86 - true - full - false - bin\x86\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - x86 - pdbonly - true - bin\x86\Release\ - TRACE - prompt - 4 - false - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - bin\Debug\CefSharp.BrowserSubprocess.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - MinimumRecommendedRules.ruleset - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - false - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - bin\Release\CefSharp.BrowserSubprocess.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - MinimumRecommendedRules.ruleset - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - false - - - - - - true - - - ..\CefSharp.snk - - - app.manifest - - - OnOutputUpdated - - - - - - - - - - - - - - - - - - - - {6c4bb501-2f8e-48ac-9ab5-8cfb2d74185c} - CefSharp.BrowserSubprocess.Core - - - {a55848cc-10e7-40cb-addb-04740b16dd43} - CefSharp - - - - - - $(CefSharpBrowserSubprocessPostBuildEvent) - - + + + net462 + WinExe + x86;x64 + false + false + true + ..\CefSharp.snk + app.manifest + CefSharp.BrowserSubprocess.Program + win-x86;win-x64 + + + + full + + + true + true + pdbonly + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.netcore.csproj b/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.netcore.csproj new file mode 100644 index 0000000000..abce3a7a89 --- /dev/null +++ b/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.netcore.csproj @@ -0,0 +1,71 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + + WinExe + net6.0-windows + CefSharp.BrowserSubprocess + CefSharp.BrowserSubprocess + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + app.manifest + CefSharp.BrowserSubprocess.Program + x86;x64;arm64 + + arm64 + + Major + + + + 2 + + + + True + embedded + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + diff --git a/CefSharp.BrowserSubprocess/Program.cs b/CefSharp.BrowserSubprocess/Program.cs index 3a27034d17..6c6a75457d 100644 --- a/CefSharp.BrowserSubprocess/Program.cs +++ b/CefSharp.BrowserSubprocess/Program.cs @@ -2,16 +2,15 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -using System; using System.Diagnostics; -using System.Threading.Tasks; -using CefSharp.Internals; using CefSharp.RenderProcess; namespace CefSharp.BrowserSubprocess { /// /// When implementing your own BrowserSubprocess + /// - For Full .Net use + /// - For .Net Core use (No WCF Support) /// - Include an app.manifest with the dpi/compatability sections, this is required (this project contains the relevant). /// - If you are targeting x86/Win32 then you should set /LargeAddressAware (https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware?view=vs-2017) /// @@ -19,67 +18,21 @@ public class Program { public static int Main(string[] args) { - Debug.WriteLine("BrowserSubprocess starting up with command line: " + String.Join("\n", args)); + Debug.WriteLine("BrowserSubprocess starting up with command line: " + string.Join("\n", args)); - SubProcess.EnableHighDPISupport(); + //Add your own custom implementation of IRenderProcessHandler here + IRenderProcessHandler handler = null; - int result; - var type = args.GetArgumentValue(CefSharpArguments.SubProcessTypeArgument); - - var parentProcessId = -1; - - // The Crashpad Handler doesn't have any HostProcessIdArgument, so we must not try to - // parse it lest we want an ArgumentNullException. - if (type != "crashpad-handler") - { - parentProcessId = int.Parse(args.GetArgumentValue(CefSharpArguments.HostProcessIdArgument)); - if (args.HasArgument(CefSharpArguments.ExitIfParentProcessClosed)) - { - Task.Factory.StartNew(() => AwaitParentProcessExit(parentProcessId), TaskCreationOptions.LongRunning); - } - } - - // Use our custom subProcess provides features like EvaluateJavascript - if (type == "renderer") - { - //Add your own custom implementation of IRenderProcessHandler here - IRenderProcessHandler handler = null; - var wcfEnabled = args.HasArgument(CefSharpArguments.WcfEnabledArgument); - var subProcess = wcfEnabled ? new WcfEnabledSubProcess(parentProcessId, handler, args) : new SubProcess(handler, args); - - using (subProcess) - { - result = subProcess.Run(); - } - } - else - { - result = SubProcess.ExecuteProcess(); - } + //The WcfBrowserSubprocessExecutable provides BrowserSubProcess functionality + //specific to CefSharp, WCF support (required for Sync JSB) will optionally be + //enabled if the CefSharpArguments.WcfEnabledArgument command line arg is present + //For .Net Core use BrowserSubprocessExecutable as there is no WCF support + var browserProcessExe = new WcfBrowserSubprocessExecutable(); + var result = browserProcessExe.Main(args, handler); Debug.WriteLine("BrowserSubprocess shutting down."); return result; } - - private static async void AwaitParentProcessExit(int parentProcessId) - { - try - { - var parentProcess = Process.GetProcessById(parentProcessId); - parentProcess.WaitForExit(); - } - catch (Exception e) - { - //main process probably died already - Debug.WriteLine(e); - } - - await Task.Delay(1000); //wait a bit before exiting - - Debug.WriteLine("BrowserSubprocess shutting down forcibly."); - - Environment.Exit(0); - } } } diff --git a/CefSharp.BrowserSubprocess/Program.netcore.cs b/CefSharp.BrowserSubprocess/Program.netcore.cs new file mode 100644 index 0000000000..b29565f306 --- /dev/null +++ b/CefSharp.BrowserSubprocess/Program.netcore.cs @@ -0,0 +1,35 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Diagnostics; +using CefSharp.RenderProcess; + +namespace CefSharp.BrowserSubprocess +{ + /// + /// When implementing your own BrowserSubprocess + /// - For .Net 6+ use (No WCF Support) + /// - Include an app.manifest with the dpi/compatability sections, this is required (this project contains the relevant). + /// - If you are targeting x86/Win32 then you should set /LargeAddressAware (https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware?view=vs-2017) + /// + public class Program + { + public static int Main(string[] args) + { + Debug.WriteLine("BrowserSubprocess starting up with command line: " + string.Join("\n", args)); + + //Add your own custom implementation of IRenderProcessHandler here + IRenderProcessHandler handler = null; + + //The BrowserSubprocessExecutable provides BrowserSubProcess functionality + //specific to CefSharp there is no WCF support used for the sync JSB feature. + var browserProcessExe = new BrowserSubprocessExecutable(); + var result = browserProcessExe.Main(args, handler); + + Debug.WriteLine("BrowserSubprocess shutting down."); + + return result; + } + } +} diff --git a/CefSharp.BrowserSubprocess/Properties/launchSettings.json b/CefSharp.BrowserSubprocess/Properties/launchSettings.json new file mode 100644 index 0000000000..cdf806c5be --- /dev/null +++ b/CefSharp.BrowserSubprocess/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "CefSharp.BrowserSubprocess.netcore": { + "commandName": "Project", + "nativeDebugging": true + } + } +} \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess/app.config b/CefSharp.BrowserSubprocess/app.config index de82893200..ac5aa757cc 100644 --- a/CefSharp.BrowserSubprocess/app.config +++ b/CefSharp.BrowserSubprocess/app.config @@ -1,3 +1,3 @@ - + diff --git a/CefSharp.BrowserSubprocess/app.manifest b/CefSharp.BrowserSubprocess/app.manifest index 89999a1c34..5ae4abdf74 100644 --- a/CefSharp.BrowserSubprocess/app.manifest +++ b/CefSharp.BrowserSubprocess/app.manifest @@ -8,7 +8,7 @@ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + @@ -27,12 +27,6 @@ - - - true/PM - - - + + obj.netcore\ + bin.netcore\ + + + + + + net6.0 + CefSharp.Core + CefSharp.Core.Runtime + $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + CS1591,CS0436 + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + $(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll + + + + + $(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll + + + + + $(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\win32\$(Configuration)\CefSharp.Core.Runtime.dll + + + + + false + $(ProjectDir) + $(GenAPITargetDir)$(AssemblyName).netcore.cs + + + + + + + + + + + + + + + diff --git a/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs b/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs new file mode 100644 index 0000000000..e4bb6a3f6b --- /dev/null +++ b/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs @@ -0,0 +1,358 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// GenAPI Version: 5.0.2.37403 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +namespace CefSharp.Core +{ + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class BrowserSettings : CefSharp.IBrowserSettings + { + public BrowserSettings() { } + public BrowserSettings(bool autoDispose) { } + public virtual bool AutoDispose { get { throw null; } } + public virtual uint BackgroundColor { get { throw null; } set { } } + public virtual CefSharp.CefState ChromeStatusBubble { get { throw null; } set { } } + public virtual CefSharp.CefState ChromeZoomBubble { get { throw null; } set { } } + public virtual string CursiveFontFamily { get { throw null; } set { } } + public virtual CefSharp.CefState Databases { get { throw null; } set { } } + public virtual string DefaultEncoding { get { throw null; } set { } } + public virtual int DefaultFixedFontSize { get { throw null; } set { } } + public virtual int DefaultFontSize { get { throw null; } set { } } + public virtual string FantasyFontFamily { get { throw null; } set { } } + public virtual string FixedFontFamily { get { throw null; } set { } } + public virtual CefSharp.CefState ImageLoading { get { throw null; } set { } } + public virtual CefSharp.CefState ImageShrinkStandaloneToFit { get { throw null; } set { } } + public virtual bool IsDisposed { get { throw null; } } + public virtual CefSharp.CefState Javascript { get { throw null; } set { } } + public virtual CefSharp.CefState JavascriptAccessClipboard { get { throw null; } set { } } + public virtual CefSharp.CefState JavascriptCloseWindows { get { throw null; } set { } } + public virtual CefSharp.CefState JavascriptDomPaste { get { throw null; } set { } } + public virtual CefSharp.CefState LocalStorage { get { throw null; } set { } } + public virtual int MinimumFontSize { get { throw null; } set { } } + public virtual int MinimumLogicalFontSize { get { throw null; } set { } } + public virtual CefSharp.CefState RemoteFonts { get { throw null; } set { } } + public virtual string SansSerifFontFamily { get { throw null; } set { } } + public virtual string SerifFontFamily { get { throw null; } set { } } + public virtual string StandardFontFamily { get { throw null; } set { } } + public virtual CefSharp.CefState TabToLinks { get { throw null; } set { } } + public virtual CefSharp.CefState TextAreaResize { get { throw null; } set { } } + public virtual CefSharp.CefState WebGl { get { throw null; } set { } } + public virtual int WindowlessFrameRate { get { throw null; } set { } } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~BrowserSettings() { } + public virtual CefSharp.IBrowserSettings UnWrap() { throw null; } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed partial class Cef + { + public Cef() { } + public static string ApiHashPlatform { get { throw null; } } + public static int ApiVersion { get { throw null; } } + public static string CefCommitHash { get { throw null; } } + public static string CefSharpVersion { get { throw null; } } + public static string CefVersion { get { throw null; } } + public static string ChromiumVersion { get { throw null; } } + public static bool CrashReportingEnabled { get { throw null; } } + public static System.Threading.Tasks.TaskFactory FileThreadTaskFactory { get { throw null; } set { } } + public static System.Threading.Tasks.TaskFactory IOThreadTaskFactory { get { throw null; } set { } } + public static bool? IsInitialized { get { throw null; } } + public static bool IsShutdown { get { throw null; } } + public static System.Threading.Tasks.TaskFactory UIThreadTaskFactory { get { throw null; } set { } } + public static bool AddCrossOriginWhitelistEntry(string sourceOrigin, string targetProtocol, string targetDomain, bool allowTargetSubdomains) { throw null; } + public static void AddDisposable(System.IDisposable item) { } + public static string ApiHash(int version, int entry) { throw null; } + public static bool ClearCrossOriginWhitelist() { throw null; } + public static bool ClearSchemeHandlerFactories() { throw null; } + public static uint ColorSetARGB(uint a, uint r, uint g, uint b) { throw null; } + public static bool CurrentlyOnThread(CefSharp.CefThreadIds threadId) { throw null; } + public static void DoMessageLoopWork() { } + public static void EnableWaitForBrowsersToClose() { } + public static int ExecuteProcess() { throw null; } + public static CefSharp.Enums.ResultCode GetExitCode() { throw null; } + public static CefSharp.ICookieManager GetGlobalCookieManager() { throw null; } + public static CefSharp.ICookieManager GetGlobalCookieManager(CefSharp.ICompletionCallback callback) { throw null; } + public static CefSharp.IRequestContext GetGlobalRequestContext() { throw null; } + public static string GetMimeType(string extension) { throw null; } + public static int GetMinLogLevel() { throw null; } + public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings) { throw null; } + public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck) { throw null; } + public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck, CefSharp.IApp cefApp) { throw null; } + public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck, CefSharp.IBrowserProcessHandler browserProcessHandler) { throw null; } + public static bool IsWindows10OrGreaterEx() { throw null; } + public static CefSharp.UrlParts ParseUrl(string url) { throw null; } + public static bool PostAction(CefSharp.CefThreadIds threadId, System.Action action) { throw null; } + public static bool PostDelayedAction(CefSharp.CefThreadIds threadId, System.Action action, int delayInMs) { throw null; } + public static void PreShutdown() { } + public static void QuitMessageLoop() { } + public static bool RemoveCrossOriginWhitelistEntry(string sourceOrigin, string targetProtocol, string targetDomain, bool allowTargetSubdomains) { throw null; } + public static void RemoveDisposable(System.IDisposable item) { } + public static void RunMessageLoop() { } + public static void SetCrashKeyValue(string key, string value) { } + public static void Shutdown() { } + public static void ShutdownWithoutChecks() { } + public static void WaitForBrowsersToClose() { } + public static void WaitForBrowsersToClose(int timeoutInMiliseconds) { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed partial class CefSettingsBase : System.IDisposable + { + public CefSettingsBase() { } + public string AcceptLanguageList { get { throw null; } set { } } + public uint BackgroundColor { get { throw null; } set { } } + public string BrowserSubprocessPath { get { throw null; } set { } } + public string CachePath { get { throw null; } set { } } + public CefSharp.Internals.CommandLineArgDictionary CefCommandLineArgs { get { throw null; } } + public System.Collections.Generic.IEnumerable CefCustomSchemes { get { throw null; } } + public string ChromePolicyId { get { throw null; } set { } } + public bool CommandLineArgsDisabled { get { throw null; } set { } } + public bool CookieableSchemesExcludeDefaults { get { throw null; } set { } } + public string CookieableSchemesList { get { throw null; } set { } } + public bool ExternalMessagePump { get { throw null; } set { } } + public string JavascriptFlags { get { throw null; } set { } } + public string Locale { get { throw null; } set { } } + public string LocalesDirPath { get { throw null; } set { } } + public string LogFile { get { throw null; } set { } } + public CefSharp.LogSeverity LogSeverity { get { throw null; } set { } } + public bool MultiThreadedMessageLoop { get { throw null; } set { } } + public bool PersistSessionCookies { get { throw null; } set { } } + public int RemoteDebuggingPort { get { throw null; } set { } } + public string ResourcesDirPath { get { throw null; } set { } } + public string RootCachePath { get { throw null; } set { } } + public int UncaughtExceptionStackSize { get { throw null; } set { } } + public string UserAgent { get { throw null; } set { } } + public string UserAgentProduct { get { throw null; } set { } } + public bool WindowlessRenderingEnabled { get { throw null; } set { } } + public void Dispose() { } + protected void Dispose(bool A_0) { } + ~CefSettingsBase() { } + public void RegisterScheme(CefSharp.CefCustomScheme cefCustomScheme) { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class DragData : CefSharp.Internals.CefWrapper, CefSharp.IDragData + { + internal DragData() { } + public virtual string FileName { get { throw null; } set { } } + public virtual System.Collections.Generic.IList FileNames { get { throw null; } } + public virtual System.Collections.Generic.IList FilePaths { get { throw null; } } + public virtual string FragmentBaseUrl { get { throw null; } set { } } + public virtual string FragmentHtml { get { throw null; } set { } } + public virtual string FragmentText { get { throw null; } set { } } + public virtual bool HasImage { get { throw null; } } + public virtual CefSharp.IImage Image { get { throw null; } } + public virtual CefSharp.Structs.Point ImageHotspot { get { throw null; } } + public virtual bool IsFile { get { throw null; } set { } } + public virtual bool IsFragment { get { throw null; } set { } } + public virtual bool IsLink { get { throw null; } set { } } + public virtual bool IsReadOnly { get { throw null; } set { } } + public virtual string LinkMetaData { get { throw null; } set { } } + public virtual string LinkTitle { get { throw null; } set { } } + public virtual string LinkUrl { get { throw null; } set { } } + public virtual void AddFile(string path, string displayName) { } + public virtual void ClearFilenames() { } + public virtual CefSharp.IDragData Clone() { throw null; } + public static CefSharp.IDragData Create() { throw null; } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~DragData() { } + public virtual long GetFileContents(System.IO.Stream stream) { throw null; } + public virtual void ResetFileContents() { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class ManagedCefBrowserAdapter : CefSharp.Internals.IBrowserAdapter + { + public ManagedCefBrowserAdapter(CefSharp.Internals.IWebBrowserInternal webBrowserInternal, bool offScreenRendering) { } + public virtual bool IsDisposed { get { throw null; } } + public virtual CefSharp.Internals.IJavascriptCallbackFactory JavascriptCallbackFactory { get { throw null; } } + public virtual CefSharp.Internals.IJavascriptObjectRepositoryInternal JavascriptObjectRepository { get { throw null; } } + public virtual CefSharp.Internals.IMethodRunnerQueue MethodRunnerQueue { get { throw null; } } + public virtual void CreateBrowser(CefSharp.IWindowInfo windowInfo, CefSharp.IBrowserSettings browserSettings, CefSharp.IRequestContext requestContext, string address) { } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~ManagedCefBrowserAdapter() { } + public virtual CefSharp.IBrowser GetBrowser(int browserId) { throw null; } + public virtual void OnAfterBrowserCreated(CefSharp.IBrowser browser) { } + public virtual void Resize(int width, int height) { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed partial class NativeMethodWrapper + { + public NativeMethodWrapper() { } + public static bool IsFocused(System.IntPtr handle) { throw null; } + public static System.IntPtr LoadCursorFromLibCef(int resourceIdentifier) { throw null; } + public static void MemoryCopy(System.IntPtr dest, System.IntPtr src, int numberOfBytes) { } + public static void RemoveExNoActivateStyle(System.IntPtr browserHwnd) { } + public static void SetWindowParent(System.IntPtr child, System.IntPtr newParent) { } + public static void SetWindowPosition(System.IntPtr handle, int x, int y, int width, int height) { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class PopupFeatures : CefSharp.IPopupFeatures, System.IDisposable + { + internal PopupFeatures() { } + public virtual int? Height { get { throw null; } } + public virtual bool IsPopup { get { throw null; } } + public virtual int? Width { get { throw null; } } + public virtual int? X { get { throw null; } } + public virtual int? Y { get { throw null; } } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~PopupFeatures() { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class PostData : CefSharp.Internals.CefWrapper, CefSharp.IPostData + { + public PostData() { } + public virtual System.Collections.Generic.IList Elements { get { throw null; } } + public virtual bool HasExcludedElements { get { throw null; } } + public virtual bool IsReadOnly { get { throw null; } } + public virtual bool AddElement(CefSharp.IPostDataElement element) { throw null; } + public virtual CefSharp.IPostDataElement CreatePostDataElement() { throw null; } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~PostData() { } + public virtual bool RemoveElement(CefSharp.IPostDataElement element) { throw null; } + public virtual void RemoveElements() { } + public virtual CefSharp.IPostData UnWrap() { throw null; } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class PostDataElement : CefSharp.Internals.CefWrapper, CefSharp.IPostDataElement + { + public PostDataElement() { } + public virtual byte[] Bytes { get { throw null; } set { } } + public virtual string File { get { throw null; } set { } } + public virtual bool IsReadOnly { get { throw null; } } + public virtual CefSharp.PostDataElementType Type { get { throw null; } } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~PostDataElement() { } + public virtual void SetToEmpty() { } + public virtual CefSharp.IPostDataElement UnWrap() { throw null; } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class Request : CefSharp.Internals.CefWrapper, CefSharp.IRequest + { + public Request() { } + public virtual CefSharp.UrlRequestFlags Flags { get { throw null; } set { } } + public virtual System.Collections.Specialized.NameValueCollection Headers { get { throw null; } set { } } + public virtual ulong Identifier { get { throw null; } } + public virtual bool IsReadOnly { get { throw null; } } + public virtual string Method { get { throw null; } set { } } + public virtual CefSharp.IPostData PostData { get { throw null; } set { } } + public virtual CefSharp.ReferrerPolicy ReferrerPolicy { get { throw null; } } + public virtual string ReferrerUrl { get { throw null; } } + public virtual CefSharp.ResourceType ResourceType { get { throw null; } } + public virtual CefSharp.TransitionType TransitionType { get { throw null; } } + public virtual string Url { get { throw null; } set { } } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~Request() { } + public virtual string GetHeaderByName(string name) { throw null; } + public virtual void InitializePostData() { } + public virtual void SetHeaderByName(string name, string value, bool overwrite) { } + public virtual void SetReferrer(string referrerUrl, CefSharp.ReferrerPolicy policy) { } + public virtual CefSharp.IRequest UnWrap() { throw null; } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class RequestContext : CefSharp.Internals.CefWrapper, CefSharp.IRequestContext + { + public RequestContext() { } + public RequestContext(CefSharp.Core.RequestContextSettings settings) { } + public RequestContext(CefSharp.Core.RequestContextSettings settings, CefSharp.IRequestContextHandler requestContextHandler) { } + public RequestContext(CefSharp.IRequestContext otherRequestContext) { } + public RequestContext(CefSharp.IRequestContext otherRequestContext, CefSharp.IRequestContextHandler requestContextHandler) { } + public RequestContext(CefSharp.IRequestContextHandler requestContextHandler) { } + public virtual string CachePath { get { throw null; } } + public virtual bool IsGlobal { get { throw null; } } + public virtual bool CanSetPreference(string name) { throw null; } + public virtual void ClearCertificateExceptions(CefSharp.ICompletionCallback callback) { } + public virtual void ClearHttpAuthCredentials(CefSharp.ICompletionCallback callback) { } + public virtual bool ClearSchemeHandlerFactories() { throw null; } + public virtual void CloseAllConnections(CefSharp.ICompletionCallback callback) { } + public static CefSharp.IRequestContext CreateContext(CefSharp.IRequestContext other, CefSharp.IRequestContextHandler requestContextHandler) { throw null; } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~RequestContext() { } + public virtual System.Collections.Generic.IDictionary GetAllPreferences(bool includeDefaults) { throw null; } + public virtual CefSharp.Enums.ContentSettingValues GetContentSetting(string requestingUrl, string topLevelUrl, CefSharp.Enums.ContentSettingTypes contentType) { throw null; } + public virtual CefSharp.ICookieManager GetCookieManager(CefSharp.ICompletionCallback callback) { throw null; } + public virtual object GetPreference(string name) { throw null; } + public virtual object GetWebsiteSetting(string requestingUrl, string topLevelUrl, CefSharp.Enums.ContentSettingTypes contentType) { throw null; } + public virtual bool HasPreference(string name) { throw null; } + public virtual bool IsSame(CefSharp.IRequestContext context) { throw null; } + public virtual bool IsSharingWith(CefSharp.IRequestContext context) { throw null; } + public virtual bool RegisterSchemeHandlerFactory(string schemeName, string domainName, CefSharp.ISchemeHandlerFactory factory) { throw null; } + public virtual System.Threading.Tasks.Task ResolveHostAsync(System.Uri origin) { throw null; } + public virtual void SetContentSetting(string requestingUrl, string topLevelUrl, CefSharp.Enums.ContentSettingTypes contentType, CefSharp.Enums.ContentSettingValues value) { } + public virtual bool SetPreference(string name, object value, out string error) { throw null; } + public virtual void SetWebsiteSetting(string requestingUrl, string topLevelUrl, CefSharp.Enums.ContentSettingTypes contentType, object value) { } + public virtual CefSharp.IRequestContext UnWrap() { throw null; } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class RequestContextSettings : System.IDisposable + { + public RequestContextSettings() { } + public string AcceptLanguageList { get { throw null; } set { } } + public string CachePath { get { throw null; } set { } } + public bool CookieableSchemesExcludeDefaults { get { throw null; } set { } } + public string CookieableSchemesList { get { throw null; } set { } } + public bool PersistSessionCookies { get { throw null; } set { } } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~RequestContextSettings() { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class UrlRequest : CefSharp.Internals.CefWrapper, CefSharp.IUrlRequest + { + public UrlRequest(CefSharp.IRequest request, CefSharp.IUrlRequestClient urlRequestClient) { } + public UrlRequest(CefSharp.IRequest request, CefSharp.IUrlRequestClient urlRequestClient, CefSharp.IRequestContext requestContext) { } + public virtual CefSharp.UrlRequestStatus RequestStatus { get { throw null; } } + public virtual CefSharp.IResponse Response { get { throw null; } } + public virtual bool ResponseWasCached { get { throw null; } } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~UrlRequest() { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public partial class WindowInfo : CefSharp.IWindowInfo + { + public WindowInfo() { } + public virtual uint ExStyle { get { throw null; } set { } } + public virtual bool ExternalBeginFrameEnabled { get { throw null; } set { } } + public virtual int Height { get { throw null; } set { } } + public virtual System.IntPtr ParentWindowHandle { get { throw null; } set { } } + public virtual CefSharp.CefRuntimeStyle RuntimeStyle { get { throw null; } set { } } + public virtual bool SharedTextureEnabled { get { throw null; } set { } } + public virtual uint Style { get { throw null; } set { } } + public virtual int Width { get { throw null; } set { } } + public virtual System.IntPtr WindowHandle { get { throw null; } set { } } + public virtual bool WindowlessRenderingEnabled { get { throw null; } set { } } + public virtual string WindowName { get { throw null; } set { } } + public virtual int X { get { throw null; } set { } } + public virtual int Y { get { throw null; } set { } } + public void Dispose() { } + protected virtual void Dispose(bool A_0) { } + ~WindowInfo() { } + public virtual void SetAsChild(System.IntPtr parentHandle) { } + public virtual void SetAsChild(System.IntPtr parentHandle, CefSharp.Structs.Rect windowBounds) { } + public virtual void SetAsChild(System.IntPtr parentHandle, int left, int top, int right, int bottom) { } + public virtual void SetAsPopup(System.IntPtr parentHandle, string windowName) { } + public virtual void SetAsWindowless(System.IntPtr parentHandle) { } + public virtual CefSharp.IWindowInfo UnWrap() { throw null; } + } +} +namespace CefSharp.Internals +{ + public abstract partial class CefWrapper + { + internal CefWrapper() { } + protected bool _disposed; + public virtual bool IsDisposed { get { throw null; } } + protected void ThrowIfDisposed() { } + protected void ThrowIfExecutedOnNonCefUiThread() { } + } +} diff --git a/CefSharp.Core.Runtime.RefAssembly/Properties/AssemblyInfo.cs b/CefSharp.Core.Runtime.RefAssembly/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..0d99bdd5c6 --- /dev/null +++ b/CefSharp.Core.Runtime.RefAssembly/Properties/AssemblyInfo.cs @@ -0,0 +1,23 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using CefSharp; + +[assembly: AssemblyTitle("CefSharp.Core.Runtime")] +[assembly:AssemblyDescription("CefSharp Core Runtime Library (VC++)")] +[assembly:AssemblyCompany(AssemblyInfo.AssemblyCompany)] +[assembly:AssemblyProduct(AssemblyInfo.AssemblyProduct)] +[assembly:AssemblyCopyright(AssemblyInfo.AssemblyCopyright)] + +[assembly:AssemblyVersion(AssemblyInfo.AssemblyVersion)] +[assembly:ComVisible(AssemblyInfo.ComVisible)] +[assembly:CLSCompliant(AssemblyInfo.ClsCompliant)] + + +[assembly:AssemblyConfiguration("")] +[assembly:AssemblyTrademark("")] +[assembly:AssemblyCulture("")] diff --git a/CefSharp.Core.Runtime/Assembly.manifest b/CefSharp.Core.Runtime/Assembly.manifest new file mode 100644 index 0000000000..01c92358c2 --- /dev/null +++ b/CefSharp.Core.Runtime/Assembly.manifest @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/CefSharp.Core/AssemblyInfo.cpp b/CefSharp.Core.Runtime/AssemblyInfo.cpp similarity index 79% rename from CefSharp.Core/AssemblyInfo.cpp rename to CefSharp.Core.Runtime/AssemblyInfo.cpp index 8de588180a..faebb78466 100644 --- a/CefSharp.Core/AssemblyInfo.cpp +++ b/CefSharp.Core.Runtime/AssemblyInfo.cpp @@ -11,7 +11,8 @@ using namespace System::Runtime::InteropServices; using namespace System::Security::Permissions; using namespace CefSharp; -[assembly:AssemblyTitle("CefSharp.Core")]; +[assembly:AssemblyTitle("CefSharp.Core.Runtime")]; +[assembly:AssemblyDescription("CefSharp Core Runtime Library (VC++)")]; [assembly:AssemblyCompany(AssemblyInfo::AssemblyCompany)]; [assembly:AssemblyProduct(AssemblyInfo::AssemblyProduct)]; [assembly:AssemblyCopyright(AssemblyInfo::AssemblyCopyright)]; @@ -20,14 +21,10 @@ using namespace CefSharp; [assembly:ComVisible(AssemblyInfo::ComVisible)]; [assembly:CLSCompliant(AssemblyInfo::ClsCompliant)]; -[assembly:AssemblyDescription("")]; [assembly:AssemblyConfiguration("")]; [assembly:AssemblyTrademark("")]; [assembly:AssemblyCulture("")]; [assembly:InternalsVisibleTo(AssemblyInfo::CefSharpBrowserSubprocessCoreProject)]; [assembly:InternalsVisibleTo(AssemblyInfo::CefSharpBrowserSubprocessProject)]; -[assembly:InternalsVisibleTo(AssemblyInfo::CefSharpWpfProject)]; -[assembly:InternalsVisibleTo(AssemblyInfo::CefSharpWinFormsProject)]; -[assembly:InternalsVisibleTo(AssemblyInfo::CefSharpOffScreenProject)]; [assembly:InternalsVisibleTo(AssemblyInfo::CefSharpTestProject)]; diff --git a/CefSharp.Core.Runtime/BrowserSettings.h b/CefSharp.Core.Runtime/BrowserSettings.h new file mode 100644 index 0000000000..eb88e29c77 --- /dev/null +++ b/CefSharp.Core.Runtime/BrowserSettings.h @@ -0,0 +1,370 @@ +// Copyright © 2010 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\internal\cef_types_wrappers.h" + +namespace CefSharp +{ + namespace Core + { + /// + /// Browser initialization settings. Specify NULL or 0 to get the recommended + /// default values. The consequences of using custom values may not be well + /// tested. Many of these and other settings can also configured using command- + /// line switches. + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class BrowserSettings : IBrowserSettings + { + private: + bool _isDisposed = false; + bool _ownsPointer = false; + bool _autoDispose = false; + internal: + CefBrowserSettings* _browserSettings; + + /// + /// Internal Constructor + /// + BrowserSettings(CefBrowserSettings* browserSettings) + { + _browserSettings = browserSettings; + } + + public: + /// + /// Default Constructor + /// + BrowserSettings() : _browserSettings(new CefBrowserSettings()) + { + _ownsPointer = true; + } + + BrowserSettings(bool autoDispose) : _browserSettings(new CefBrowserSettings()) + { + _ownsPointer = true; + _autoDispose = autoDispose; + } + + /// + /// Finalizer. + /// + !BrowserSettings() + { + if (_ownsPointer) + { + delete _browserSettings; + } + + _browserSettings = nullptr; + _isDisposed = true; + } + + /// + /// Destructor. + /// + ~BrowserSettings() + { + this->!BrowserSettings(); + } + + /// + /// StandardFontFamily + /// + virtual property String^ StandardFontFamily + { + String^ get() { return StringUtils::ToClr(_browserSettings->standard_font_family); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->standard_font_family, value); } + } + + /// + /// FixedFontFamily + /// + virtual property String^ FixedFontFamily + { + String^ get() { return StringUtils::ToClr(_browserSettings->fixed_font_family); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->fixed_font_family, value); } + } + + /// + /// SerifFontFamily + /// + virtual property String^ SerifFontFamily + { + String^ get() { return StringUtils::ToClr(_browserSettings->serif_font_family); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->serif_font_family, value); } + } + + /// + /// SansSerifFontFamily + /// + virtual property String^ SansSerifFontFamily + { + String^ get() { return StringUtils::ToClr(_browserSettings->sans_serif_font_family); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->sans_serif_font_family, value); } + } + + /// + /// CursiveFontFamily + /// + virtual property String^ CursiveFontFamily + { + String^ get() { return StringUtils::ToClr(_browserSettings->cursive_font_family); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->cursive_font_family, value); } + } + + /// + /// FantasyFontFamily + /// + virtual property String^ FantasyFontFamily + { + String^ get() { return StringUtils::ToClr(_browserSettings->fantasy_font_family); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->fantasy_font_family, value); } + } + + /// + /// DefaultFontSize + /// + virtual property int DefaultFontSize + { + int get() { return _browserSettings->default_font_size; } + void set(int value) { _browserSettings->default_font_size = value; } + } + + /// + /// DefaultFixedFontSize + /// + virtual property int DefaultFixedFontSize + { + int get() { return _browserSettings->default_fixed_font_size; } + void set(int value) { _browserSettings->default_fixed_font_size = value; } + } + + /// + /// MinimumFontSize + /// + virtual property int MinimumFontSize + { + int get() { return _browserSettings->minimum_font_size; } + void set(int value) { _browserSettings->minimum_font_size = value; } + } + + /// + /// MinimumLogicalFontSize + /// + virtual property int MinimumLogicalFontSize + { + int get() { return _browserSettings->minimum_logical_font_size; } + void set(int value) { _browserSettings->minimum_logical_font_size = value; } + } + + /// + /// Default encoding for Web content. If empty "ISO-8859-1" will be used. Also + /// configurable using the "default-encoding" command-line switch. + /// + virtual property String^ DefaultEncoding + { + String^ get() { return StringUtils::ToClr(_browserSettings->default_encoding); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->default_encoding, value); } + } + + /// + /// Controls the loading of fonts from remote sources. Also configurable using + /// the "disable-remote-fonts" command-line switch. + /// + virtual property CefState RemoteFonts + { + CefState get() { return (CefState)_browserSettings->remote_fonts; } + void set(CefState value) { _browserSettings->remote_fonts = (cef_state_t)value; } + } + + /// + /// Controls whether JavaScript can be executed. (Used to Enable/Disable javascript) + /// Also configurable using the "disable-javascript" command-line switch. + /// + virtual property CefState Javascript + { + CefState get() { return (CefState)_browserSettings->javascript; } + void set(CefState value) { _browserSettings->javascript = (cef_state_t)value; } + } + + /// + /// Controls whether JavaScript can be used to close windows that were not + /// opened via JavaScript. JavaScript can still be used to close windows that + /// were opened via JavaScript. Also configurable using the + /// "disable-javascript-close-windows" command-line switch. + /// + virtual property CefState JavascriptCloseWindows + { + CefState get() { return (CefState)_browserSettings->javascript_close_windows; } + void set(CefState value) { _browserSettings->javascript_close_windows = (cef_state_t)value; } + } + + /// + /// Controls whether JavaScript can access the clipboard. Also configurable + /// using the "disable-javascript-access-clipboard" command-line switch. + /// + virtual property CefState JavascriptAccessClipboard + { + CefState get() { return (CefState)_browserSettings->javascript_access_clipboard; } + void set(CefState value) { _browserSettings->javascript_access_clipboard = (cef_state_t)value; } + } + + /// + /// Controls whether DOM pasting is supported in the editor via + /// execCommand("paste"). The |javascript_access_clipboard| setting must also + /// be enabled. Also configurable using the "disable-javascript-dom-paste" + /// command-line switch. + /// + virtual property CefState JavascriptDomPaste + { + CefState get() { return (CefState)_browserSettings->javascript_dom_paste; } + void set(CefState value) { _browserSettings->javascript_dom_paste = (cef_state_t)value; } + } + + /// + /// Controls whether image URLs will be loaded from the network. A cached image + /// will still be rendered if requested. Also configurable using the + /// "disable-image-loading" command-line switch. + /// + virtual property CefState ImageLoading + { + CefState get() { return (CefState)_browserSettings->image_loading; } + void set(CefState value) { _browserSettings->image_loading = (cef_state_t)value; } + } + + /// + /// Controls whether standalone images will be shrunk to fit the page. Also + /// configurable using the "image-shrink-standalone-to-fit" command-line + /// switch. + /// + virtual property CefState ImageShrinkStandaloneToFit + { + CefState get() { return (CefState)_browserSettings->image_shrink_standalone_to_fit; } + void set(CefState value) { _browserSettings->image_shrink_standalone_to_fit = (cef_state_t)value; } + } + + /// + /// Controls whether text areas can be resized. Also configurable using the + /// "disable-text-area-resize" command-line switch. + /// + virtual property CefState TextAreaResize + { + CefState get() { return (CefState)_browserSettings->text_area_resize; } + void set(CefState value) { _browserSettings->text_area_resize = (cef_state_t)value; } + } + + /// + /// Controls whether the tab key can advance focus to links. Also configurable + /// using the "disable-tab-to-links" command-line switch. + /// + virtual property CefState TabToLinks + { + CefState get() { return (CefState)_browserSettings->tab_to_links; } + void set(CefState value) { _browserSettings->tab_to_links = (cef_state_t)value; } + } + + /// + /// Controls whether local storage can be used. Also configurable using the + /// "disable-local-storage" command-line switch. + /// + virtual property CefState LocalStorage + { + CefState get() { return (CefState)_browserSettings->local_storage; } + void set(CefState value) { _browserSettings->local_storage = (cef_state_t)value; } + } + + /// + /// Controls whether databases can be used. Also configurable using the + /// "disable-databases" command-line switch. + /// + virtual property CefState Databases + { + CefState get() { return (CefState)_browserSettings->databases_deprecated; } + void set(CefState value) { _browserSettings->databases_deprecated = (cef_state_t)value; } + } + + /// + /// Controls whether WebGL can be used. Note that WebGL requires hardware + /// support and may not work on all systems even when enabled. Also + /// configurable using the "disable-webgl" command-line switch. + /// + virtual property CefState WebGl + { + CefState get() { return (CefState)_browserSettings->webgl; } + void set(CefState value) { _browserSettings->webgl = (cef_state_t)value; } + } + + /// + /// Controls whether the Chrome status bubble will be used. Only supported with Chrome style. + /// + virtual property CefState ChromeStatusBubble + { + CefState get() { return (CefState)_browserSettings->chrome_status_bubble; } + void set(CefState value) { _browserSettings->chrome_status_bubble = (cef_state_t)value; } + } + + /// + /// Controls whether the Chrome zoom bubble will be shown when zooming. Only supported with Chrome style. + /// + virtual property CefState ChromeZoomBubble + { + CefState get() { return (CefState)_browserSettings->chrome_zoom_bubble; } + void set(CefState value) { _browserSettings->chrome_zoom_bubble = (cef_state_t)value; } + } + + /// + /// Background color used for the browser before a document is loaded and when no document color + /// is specified. The alpha component must be either fully opaque (0xFF) or fully transparent (0x00). + /// If the alpha component is fully opaque then the RGB components will be used as the background + /// color. If the alpha component is fully transparent for a WinForms browser then the + /// CefSettings.BackgroundColor value will be used. If the alpha component is fully transparent + /// for a windowless (WPF/OffScreen) browser then transparent painting will be enabled. + /// + virtual property uint32_t BackgroundColor + { + uint32_t get() { return _browserSettings->background_color; } + void set(uint32_t value) { _browserSettings->background_color = value; } + } + + /// + /// The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint + /// will be called for a windowless browser. The actual fps may be lower if + /// the browser cannot generate frames at the requested rate. The minimum + /// value is 1 and the maximum value is 60 (default 30). This value can also be + /// changed dynamically via IBrowserHost.SetWindowlessFrameRate. + /// + virtual property int WindowlessFrameRate + { + int get() { return _browserSettings->windowless_frame_rate; } + void set(int value) { _browserSettings->windowless_frame_rate = value; } + } + + /// + /// Gets a value indicating if the browser settings has been disposed. + /// + virtual property bool IsDisposed + { + bool get() { return _isDisposed; } + } + + /// + /// True if dispose should be called after this object is used + /// + virtual property bool AutoDispose + { + bool get() { return _autoDispose; } + } + + virtual IBrowserSettings^ UnWrap() + { + return this; + } + }; + } +} diff --git a/CefSharp.Core.Runtime/Cef.h b/CefSharp.Core.Runtime/Cef.h new file mode 100644 index 0000000000..c0a087ae89 --- /dev/null +++ b/CefSharp.Core.Runtime/Cef.h @@ -0,0 +1,979 @@ +// Copyright © 2013 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#ifndef CEFSHARP_CORE_CEF_H_ +#define CEFSHARP_CORE_CEF_H_ + +#pragma once + +#include "Stdafx.h" + +#include "versionhelpers.h"; +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Internals/CefSharpApp.h" +#include "Internals/CefTaskScheduler.h" +#include "Internals/CefTaskDelegate.h" +#include "CookieManager.h" +#include "CefSettingsBase.h" +#include "RequestContext.h" + +using namespace System::Collections::Generic; +using namespace System::Linq; +using namespace System::Reflection; +using namespace msclr::interop; + +namespace CefSharp +{ + namespace Core + { + /// + /// Global CEF methods are exposed through this class. e.g. CefInitalize maps to Cef.Initialize + /// CEF API Doc https://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html + /// This class cannot be inherited. + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class Cef sealed + { + private: + static Object^ _sync; + + static Nullable _initialized; + static bool _hasShutdown = false; + static HashSet^ _disposables; + static int _initializedThreadId; + static bool _multiThreadedMessageLoop = true; + static bool _waitForBrowsersToCloseEnabled = false; + + static Cef() + { + _sync = gcnew Object(); + _disposables = gcnew HashSet(); + } + + static bool CurrentOnUiThread() + { + return CefCurrentlyOn(CefThreadId::TID_UI); + } + + public: + + static property TaskFactory^ UIThreadTaskFactory; + static property TaskFactory^ IOThreadTaskFactory; + static property TaskFactory^ FileThreadTaskFactory; + + static void AddDisposable(IDisposable^ item) + { + msclr::lock l(_sync); + + _disposables->Add(item); + } + + static void RemoveDisposable(IDisposable^ item) + { + msclr::lock l(_sync); + + _disposables->Remove(item); + } + + /// Gets a value that indicates whether CefSharp is initialized. + /// true if CefSharp is initialized; otherwise, false. + static property Nullable IsInitialized + { + Nullable get() + { + return _initialized; + } + } + + /// Gets a value that indicates whether CefSharp was shutdown. + /// true if CefSharp was shutdown; otherwise, false. + static property bool IsShutdown + { + bool get() + { + return _hasShutdown; + } + } + + /// Gets a value that indicates the version of CefSharp currently being used. + /// The CefSharp version. + static property String^ CefSharpVersion + { + String^ get() + { + Assembly^ assembly = Assembly::GetAssembly(Cef::typeid); + return assembly->GetName()->Version->ToString(); + } + } + + /// Gets a value that indicates the CEF version currently being used. + /// The CEF Version + static property String^ CefVersion + { + String^ get() + { + return String::Format("r{0}", CEF_VERSION); + } + } + + /// + /// API version that will be compiled client-side. The experimental (unversioned) + /// API is selected by default. Clients can set the CEF_API_VERSION value in + /// their project configuration to configure an explicit API version. Unlike + /// the experimental API, explicit API versions are back/forward compatible with + /// a specific range of CEF versions. + /// + static property int ApiVersion + { + int get() + { + return CEF_API_VERSION; + } + } + + /// + /// API hashes for the selected CEF_API_VERSION. API hashes are created for + /// each version by analyzing CEF header files for C API type definitions. The + /// hash value will change when header files are modified in a way that may + /// cause binary incompatibility with other builds. + /// + static property String^ ApiHashPlatform + { + String^ get() + { + auto hash = CEF_API_HASH_PLATFORM; + + return gcnew String(hash); + } + } + + /// Gets a value that indicates the Chromium version currently being used. + /// The Chromium version. + static property String^ ChromiumVersion + { + String^ get() + { + auto version = gcnew Version(CHROME_VERSION_MAJOR, CHROME_VERSION_MINOR, CHROME_VERSION_BUILD, CHROME_VERSION_PATCH); + + return version->ToString(); + } + } + + /// + /// Gets a value that indicates the Git Hash for CEF version currently being used. + /// + /// The Git Commit Hash + static property String^ CefCommitHash + { + String^ get() + { + return CEF_COMMIT_HASH; + } + } + + /// + /// Configures the CEF API version and returns API hashes for the libcef + /// library. The entry parameter describes which hash value will be returned: + /// + /// 0 - CEF_API_HASH_PLATFORM + /// 1 - CEF_API_HASH_UNIVERSAL (deprecated, same as CEF_API_HASH_PLATFORM) + /// 2 - CEF_COMMIT_HASH (from cef_version.h) + /// + /// + /// parameter should be CEF_API_VERSION and any changes to this value will be ignored after the first call to this method. + /// The entry parameter describes which hash value will be returned: + /// + /// returns API hashes for the libcef library. + /// The returned string is owned by the library and should not be freed. + /// + static String^ ApiHash(int version, int entry) + { + auto response = cef_api_hash(version, entry); + + return gcnew String(response); + } + + /// + /// Parse the specified url into its component parts. + /// Uses a GURL to parse the Url. GURL is Google's URL parsing library. + /// + /// url + /// Returns null if the URL is empty or invalid. + static UrlParts^ ParseUrl(String^ url) + { + if (String::IsNullOrEmpty(url)) + { + return nullptr; + } + + CefURLParts parts; + + if (CefParseURL(StringUtils::ToNative(url), parts)) + { + auto url = gcnew UrlParts(); + url->Fragment = StringUtils::ToClr(parts.fragment); + url->Host = StringUtils::ToClr(parts.host); + url->Origin = StringUtils::ToClr(parts.origin); + url->Password = StringUtils::ToClr(parts.password); + url->Path = StringUtils::ToClr(parts.path); + url->Query = StringUtils::ToClr(parts.query); + url->Scheme = StringUtils::ToClr(parts.scheme); + url->Spec = StringUtils::ToClr(parts.spec); + url->Username = StringUtils::ToClr(parts.username); + + auto portString = StringUtils::ToClr(parts.port); + if (!String::IsNullOrEmpty(portString)) + { + int port = 0; + + if (int::TryParse(portString, port)) + { + url->Port = port; + } + } + + return url; + } + + return nullptr; + } + + /// + /// Initializes CefSharp with user-provided settings. + /// It's important to note that Initialize and Shutdown MUST be called on your main + /// application thread (typically the UI thread). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// true if successful; otherwise, false. + static bool Initialize(CefSettingsBase^ cefSettings) + { + auto cefApp = gcnew DefaultApp(nullptr, cefSettings->CefCustomSchemes); + + return Initialize(cefSettings, false, cefApp); + } + + /// + /// Initializes CefSharp with user-provided settings. + /// It's important to note that Initialize/Shutdown MUST be called on your main + /// application thread (typically the UI thread). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// Check that all relevant dependencies avaliable, throws exception if any are missing + /// true if successful; otherwise, false. + static bool Initialize(CefSettingsBase^ cefSettings, bool performDependencyCheck) + { + auto cefApp = gcnew DefaultApp(nullptr, cefSettings->CefCustomSchemes); + + return Initialize(cefSettings, performDependencyCheck, cefApp); + } + + /// + /// Initializes CefSharp with user-provided settings. + /// It's important to note that Initialize/Shutdown MUST be called on your main + /// applicaiton thread (Typically the UI thead). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// Check that all relevant dependencies avaliable, throws exception if any are missing + /// The handler for functionality specific to the browser process. Null if you don't wish to handle these events + /// true if successful; otherwise, false. + static bool Initialize(CefSettingsBase^ cefSettings, bool performDependencyCheck, IBrowserProcessHandler^ browserProcessHandler) + { + auto cefApp = gcnew DefaultApp(browserProcessHandler, cefSettings->CefCustomSchemes); + + return Initialize(cefSettings, performDependencyCheck, cefApp); + } + + /// + /// Initializes CefSharp with user-provided settings. + /// It's important to note that Initialize/Shutdown MUST be called on your main + /// application thread (typically the UI thread). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// Check that all relevant dependencies avaliable, throws exception if any are missing + /// Implement this interface to provide handler implementations. Null if you don't wish to handle these events + /// true if successful; otherwise, false. + static bool Initialize(CefSettingsBase^ cefSettings, bool performDependencyCheck, IApp^ cefApp) + { + if (_initialized.HasValue) + { + // NOTE: Can only initialize Cef once, to make this explicitly clear throw exception on subsiquent attempts + throw gcnew Exception("Cef.Initialize can only be called once per process. This is a limitation of the underlying " + + "CEF/Chromium framework. You can change many (not all) settings at runtime through RequestContext.SetPreference. " + + "See https://github.com/cefsharp/CefSharp/wiki/General-Usage#request-context-browser-isolation " + + "Use Cef.IsInitialized to check if Cef.Initialize has already been called to avoid this exception. " + + "If you are seeing this unexpectedly then you are likely " + + "calling Cef.Initialize after you've created an instance of ChromiumWebBrowser, it must be called before the first instance is created."); + } + + if (_hasShutdown) + { + // NOTE: CefShutdown has already been called. + throw gcnew Exception("Cef.Shutdown has already been called. Cef.Initialize can only be called once per process. " + + "This is a limitation of the underlying CEF/Chromium framework. Calling Cef.Initialize after Cef.Shutdown is not supported. " + "You can change many (not all) settings at runtime through RequestContext.SetPreference." + + "See https://github.com/cefsharp/CefSharp/wiki/General-Usage#request-context-browser-isolation"); + } + + //Empty string is acceptable, the main application executable will be used + if (cefSettings->BrowserSubprocessPath == nullptr) + { + throw gcnew Exception("CefSettings BrowserSubprocessPath cannot be null."); + } + + PathCheck::AssertAbsolute(cefSettings->RootCachePath, "CefSettings.RootCachePath"); + PathCheck::AssertAbsolute(cefSettings->CachePath, "CefSettings.CachePath"); + PathCheck::AssertAbsolute(cefSettings->LocalesDirPath, "CefSettings.LocalesDirPath"); + PathCheck::AssertAbsolute(cefSettings->BrowserSubprocessPath, "CefSettings.BrowserSubprocessPath"); + + if (performDependencyCheck) + { + DependencyChecker::AssertAllDependenciesPresent(cefSettings->Locale, cefSettings->LocalesDirPath, cefSettings->ResourcesDirPath, false, cefSettings->BrowserSubprocessPath); + } + else if (!File::Exists(cefSettings->BrowserSubprocessPath)) + { + throw gcnew FileNotFoundException("CefSettings.BrowserSubprocessPath not found.", cefSettings->BrowserSubprocessPath); + } + + UIThreadTaskFactory = gcnew TaskFactory(gcnew CefTaskScheduler(TID_UI)); + IOThreadTaskFactory = gcnew TaskFactory(gcnew CefTaskScheduler(TID_IO)); + FileThreadTaskFactory = gcnew TaskFactory(gcnew CefTaskScheduler(TID_FILE_BACKGROUND)); + + //Allows us to execute Tasks on the CEF UI thread in CefSharp.dll + CefThread::Initialize(UIThreadTaskFactory, gcnew Func(&CurrentOnUiThread)); + + //To allow FolderSchemeHandlerFactory to access GetMimeType we pass in a Func + CefSharp::SchemeHandler::FolderSchemeHandlerFactory::GetMimeTypeDelegate = gcnew Func(&GetMimeType); + + CefRefPtr app(new CefSharpApp(cefSettings->ExternalMessagePump, + cefSettings->CommandLineArgsDisabled, + cefSettings->CefCommandLineArgs, + cefSettings->CefCustomSchemes, + cefApp)); + CefMainArgs main_args; + CefSettings settings = *(cefSettings->_cefSettings); + + auto success = CefInitialize(main_args, settings, app.get(), nullptr); + + if (!success) + { + CefSharp::Internals::GlobalContextInitialized::SetResult(false); + } + + _initialized = success; + _multiThreadedMessageLoop = cefSettings->MultiThreadedMessageLoop; + + _initializedThreadId = Thread::CurrentThread->ManagedThreadId; + + //We took a copy of CefSettings earlier, now we set our pointer to nullptr + delete cefSettings; + + return success; + } + + /// + /// Run the CEF message loop. Use this function instead of an application- + /// provided message loop to get the best balance between performance and CPU + /// usage. This function should only be called on the main application thread and + /// only if Cef.Initialize() is called with a + /// CefSettings.MultiThreadedMessageLoop value of false. This function will + /// block until a quit message is received by the system. + /// + static void RunMessageLoop() + { + CefRunMessageLoop(); + } + + /// + /// Quit the CEF message loop that was started by calling Cef.RunMessageLoop(). + /// This function should only be called on the main application thread and only + /// if Cef.RunMessageLoop() was used. + /// + static void QuitMessageLoop() + { + CefQuitMessageLoop(); + } + + /// + /// Perform a single iteration of CEF message loop processing.This function is + /// provided for cases where the CEF message loop must be integrated into an + /// existing application message loop. Use of this function is not recommended + /// for most users; use CefSettings.MultiThreadedMessageLoop if possible (the default). + /// When using this function care must be taken to balance performance + /// against excessive CPU usage. It is recommended to enable the + /// CefSettings.ExternalMessagePump option when using + /// this function so that IBrowserProcessHandler.OnScheduleMessagePumpWork() + /// callbacks can facilitate the scheduling process. This function should only be + /// called on the main application thread and only if Cef.Initialize() is called + /// with a CefSettings.MultiThreadedMessageLoop value of false. This function + /// will not block. + /// + static void DoMessageLoopWork() + { + CefDoMessageLoopWork(); + } + + /// + /// This function should be called from the application entry point function to execute a secondary process. + /// It can be used to run secondary processes from the browser client executable (default behavior) or + /// from a separate executable specified by the CefSettings.browser_subprocess_path value. + /// If called for the browser process (identified by no "type" command-line value) it will return immediately with a value of -1. + /// If called for a recognized secondary process it will block until the process should exit and then return the process exit code. + /// The |application| parameter may be empty. The |windows_sandbox_info| parameter is only used on Windows and may be NULL (see cef_sandbox_win.h for details). + /// + static int ExecuteProcess() + { + auto hInstance = Process::GetCurrentProcess()->Handle; + + CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer()); + //TODO: Look at ways to expose an instance of CefApp + //CefRefPtr app(new CefSharpApp(nullptr, nullptr)); + + return CefExecuteProcess(cefMainArgs, nullptr, nullptr); + } + + /// Add an entry to the cross-origin whitelist. + /// The origin allowed to be accessed by the target protocol/domain. + /// The target protocol allowed to access the source origin. + /// The optional target domain allowed to access the source origin. + /// If set to true would allow a blah.example.com if the + /// was set to example.com + /// + /// Returns false if is invalid or the whitelist cannot be accessed. + /// + /// The same-origin policy restricts how scripts hosted from different origins + /// (scheme + domain + port) can communicate. By default, scripts can only access + /// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes + /// (but no other schemes) can use the "Access-Control-Allow-Origin" header to + /// allow cross-origin requests. For example, https://source.example.com can make + /// XMLHttpRequest requests on http://target.example.com if the + /// http://target.example.com request returns an "Access-Control-Allow-Origin: + /// https://source.example.com" response header. + // + /// Scripts in separate frames or iframes and hosted from the same protocol and + /// domain suffix can execute cross-origin JavaScript if both pages set the + /// document.domain value to the same domain suffix. For example, + /// scheme://foo.example.com and scheme://bar.example.com can communicate using + /// JavaScript if both domains set document.domain="example.com". + // + /// This method is used to allow access to origins that would otherwise violate + /// the same-origin policy. Scripts hosted underneath the fully qualified + /// URL (like http://www.example.com) will be allowed access to + /// all resources hosted on the specified and . + /// If is non-empty and if false only + /// exact domain matches will be allowed. If contains a top- + /// level domain component (like "example.com") and is + /// true sub-domain matches will be allowed. If is empty and + /// if true all domains and IP addresses will be + /// allowed. + // + /// This method cannot be used to bypass the restrictions on local or display + /// isolated schemes. See the comments on for more + /// information. + /// + /// This function may be called on any thread. Returns false if + /// is invalid or the whitelist cannot be accessed. + /// + static bool AddCrossOriginWhitelistEntry( + String^ sourceOrigin, + String^ targetProtocol, + String^ targetDomain, + bool allowTargetSubdomains) + { + return CefAddCrossOriginWhitelistEntry( + StringUtils::ToNative(sourceOrigin), + StringUtils::ToNative(targetProtocol), + StringUtils::ToNative(targetDomain), + allowTargetSubdomains); + } + + /// Remove entry from cross-origin whitelist + /// The origin allowed to be accessed by the target protocol/domain. + /// The target protocol allowed to access the source origin. + /// The optional target domain allowed to access the source origin. + /// If set to true would allow a blah.example.com if the + /// was set to example.com + /// + /// + /// Remove an entry from the cross-origin access whitelist. Returns false if + /// is invalid or the whitelist cannot be accessed. + /// + static bool RemoveCrossOriginWhitelistEntry(String^ sourceOrigin, + String^ targetProtocol, + String^ targetDomain, + bool allowTargetSubdomains) + + { + return CefRemoveCrossOriginWhitelistEntry( + StringUtils::ToNative(sourceOrigin), + StringUtils::ToNative(targetProtocol), + StringUtils::ToNative(targetDomain), + allowTargetSubdomains); + } + + /// Remove all entries from the cross-origin access whitelist. + /// + /// Remove all entries from the cross-origin access whitelist. Returns false if + /// the whitelist cannot be accessed. + /// + static bool ClearCrossOriginWhitelist() + { + return CefClearCrossOriginWhitelist(); + } + + /// + /// Returns the global cookie manager. By default data will be stored at CefSettings.CachePath if specified or in memory otherwise. + /// Using this method is equivalent to calling Cef.GetGlobalRequestContext().GetCookieManager() + /// The cookie managers storage is created in an async fashion, whilst this method may return a cookie manager instance, + /// there may be a short delay before you can Get/Write cookies. + /// To be sure the cookie manager has been initialized use one of the following + /// - Use the GetGlobalCookieManager(ICompletionCallback) overload and access the ICookieManager after + /// ICompletionCallback.OnComplete has been called. + /// - Access the ICookieManager instance in IBrowserProcessHandler.OnContextInitialized. + /// - Use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events. + /// + /// A the global cookie manager or null if the RequestContext has not yet been initialized. + static ICookieManager^ GetGlobalCookieManager() + { + return GetGlobalCookieManager(nullptr); + } + + /// + /// Returns the global cookie manager. By default data will be stored at CefSettings.CachePath if specified or in memory otherwise. + /// Using this method is equivalent to calling Cef.GetGlobalRequestContext().GetCookieManager() + /// The cookie managers storage is created in an async fashion, whilst this method may return a cookie manager instance, + /// there may be a short delay before you can Get/Write cookies. + /// To be sure the cookie manager has been initialized use one of the following + /// - Access the ICookieManager after ICompletionCallback.OnComplete has been called + /// - Access the ICookieManager instance in IBrowserProcessHandler.OnContextInitialized. + /// - Use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events. + /// + /// If non-NULL it will be executed asnychronously on the CEF UI thread after the manager's storage has been initialized. + /// A the global cookie manager or null if the RequestContext has not yet been initialized. + static ICookieManager^ GetGlobalCookieManager(ICompletionCallback^ callback) + { + CefRefPtr c = callback == nullptr ? nullptr : new CefCompletionCallbackAdapter(callback); + + auto cookieManager = CefCookieManager::GetGlobalManager(c); + if (cookieManager.get()) + { + return gcnew CookieManager(cookieManager); + } + + return nullptr; + } + + /// + /// This function can optionally be called on the main application thread after + /// CefInitialize to retrieve the initialization exit code. When CefInitialize + /// returns true the exit code will be 0 (ResultCode.NormalExit). + /// Otherwise, see ResultCode for possible exit code values including + /// browser process initialization errors and normal early exit conditions + /// (such as ResultCode.NormalExitProcessNotified for process singleton relaunch behavior). + /// + static ResultCode GetExitCode() + { + return (ResultCode)CefGetExitCode(); + } + + /// + /// Called prior to calling Cef.Shutdown, this diposes of any remaning + /// ChromiumWebBrowser instances. In WPF this is used from Dispatcher.ShutdownStarted + /// to release the unmanaged resources held by the ChromiumWebBrowser instances. + /// Generally speaking you don't need to call this yourself. + /// + static void PreShutdown() + { + msclr::lock l(_sync); + + for each(IDisposable^ diposable in Enumerable::ToList(_disposables)) + { + delete diposable; + } + + _disposables->Clear(); + + GC::Collect(); + GC::WaitForPendingFinalizers(); + } + + /// + /// Shuts down CefSharp and the underlying CEF infrastructure. This method is safe to call multiple times; it will only + /// shut down CEF on the first call (all subsequent calls will be ignored). + /// This method should be called on the main application thread to shut down the CEF browser process before the application exits. + /// If you are Using CefSharp.OffScreen then you must call this explicitly before your application exits or it will hang. + /// This method must be called on the same thread as Initialize. If you don't call Shutdown explicitly then CefSharp.Wpf and CefSharp.WinForms + /// versions will do their best to call Shutdown for you, if your application is having trouble closing then call thus explicitly. + /// + static void Shutdown() + { + if (_initialized.GetValueOrDefault()) + { + msclr::lock l(_sync); + + if (_initialized.GetValueOrDefault()) + { + if (_initializedThreadId != Thread::CurrentThread->ManagedThreadId) + { + throw gcnew Exception("Cef.Shutdown must be called on the same thread that Cef.Initialize was called - typically your UI thread. " + + "If you called Cef.Initialize on a Thread other than the UI thread then you will need to call Cef.Shutdown on the same thread. " + + "Cef.Initialize was called on ManagedThreadId: " + _initializedThreadId + " where Cef.Shutdown is being called on " + + "ManagedThreadId: " + Thread::CurrentThread->ManagedThreadId); + } + + UIThreadTaskFactory = nullptr; + IOThreadTaskFactory = nullptr; + FileThreadTaskFactory = nullptr; + + CefThread::Shutdown(); + + for each(IDisposable^ diposable in Enumerable::ToList(_disposables)) + { + delete diposable; + } + + GC::Collect(); + GC::WaitForPendingFinalizers(); + + if (!_multiThreadedMessageLoop) + { + // We need to run the message pump until it is idle. However we don't have + // that information here so we run the message loop "for a while". + // See https://github.com/cztomczak/cefpython/issues/245 for an excellent description + for (int i = 0; i < 10; i++) + { + DoMessageLoopWork(); + + // Sleep to allow the CEF proc to do work. + Sleep(50); + } + } + + CefShutdown(); + _initialized = false; + _hasShutdown = true; + } + } + } + + /// + /// This method should only be used by advanced users, if you're unsure then use Cef.Shutdown(). + /// This function should be called on the main application thread to shut down + /// the CEF browser process before the application exits. This method simply obtains a lock + /// and calls the native CefShutdown method, only IsInitialized is checked. All ChromiumWebBrowser + /// instances MUST be Disposed of before calling this method. If calling this method results in a crash + /// or hangs then you're likely hanging on to some unmanaged resources or haven't closed all of your browser + /// instances + /// + static void ShutdownWithoutChecks() + { + if (_initialized.GetValueOrDefault()) + { + msclr::lock l(_sync); + + if (_initialized.GetValueOrDefault()) + { + CefShutdown(); + _initialized = false; + _hasShutdown = true; + } + } + } + + /// + /// Clear all scheme handler factories registered with the global request context. + /// Returns false on error. This function may be called on any thread in the browser process. + /// Using this function is equivalent to calling Cef.GetGlobalRequestContext().ClearSchemeHandlerFactories(). + /// + /// Returns false on error. + static bool ClearSchemeHandlerFactories() + { + return CefClearSchemeHandlerFactories(); + } + + /// + /// Returns true if called on the specified CEF thread. + /// + /// Returns true if called on the specified thread. + static bool CurrentlyOnThread(CefThreadIds threadId) + { + return CefCurrentlyOn((CefThreadId)threadId); + } + + /// + /// Gets the Global Request Context. Make sure to Dispose of this object when finished. + /// The earlier possible place to access the IRequestContext is in IBrowserProcessHandler.OnContextInitialized. + /// Alternative use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events. + /// + /// Returns the global request context or null if the RequestContext has not been initialized yet. + static IRequestContext^ GetGlobalRequestContext() + { + auto context = CefRequestContext::GetGlobalContext(); + + if (context.get()) + { + return gcnew RequestContext(context); + } + + return nullptr; + } + + /// + /// Helper function (wrapper around the CefColorSetARGB macro) which combines + /// the 4 color components into an uint32 for use with BackgroundColor property + /// + /// Alpha + /// Red + /// Green + /// Blue + /// Returns the color. + static uint32_t ColorSetARGB(uint32_t a, uint32_t r, uint32_t g, uint32_t b) + { + return CefColorSetARGB(a, r, g, b); + } + + /// + /// Crash reporting is configured using an INI-style config file named + /// crash_reporter.cfg. This file must be placed next to + /// the main application executable. File contents are as follows: + /// + /// # Comments start with a hash character and must be on their own line. + /// + /// [Config] + /// ProductName=<Value of the "prod" crash key; defaults to "cef"> + /// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version> + /// AppName=<Windows only; App-specific folder name component for storing crash + /// information; default to "CEF"> + /// ExternalHandler=<Windows only; Name of the external handler exe to use + /// instead of re-launching the main exe; default to empty> + /// ServerURL=<crash server URL; default to empty> + /// RateLimitEnabled=<True if uploads should be rate limited; default to true> + /// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; + /// default to 5> + /// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value + /// will cause older reports to be deleted; default to 20> + /// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; + /// default to 5> + /// + /// [CrashKeys] + /// my_key1=<small|medium|large> + /// my_key2=<small|medium|large> + /// + /// Config section: + /// + /// If "ProductName" and/or "ProductVersion" are set then the specified values + /// will be included in the crash dump metadata. + /// + /// If "AppName" is set on Windows then crash report information (metrics, + /// database and dumps) will be stored locally on disk under the + /// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. + /// + /// If "ExternalHandler" is set on Windows then the specified exe will be + /// launched as the crashpad-handler instead of re-launching the main process + /// exe. The value can be an absolute path or a path relative to the main exe + /// directory. + /// + /// If "ServerURL" is set then crashes will be uploaded as a multi-part POST + /// request to the specified URL. Otherwise, reports will only be stored locally + /// on disk. + /// + /// If "RateLimitEnabled" is set to true then crash report uploads will be rate + /// limited as follows: + /// 1. If "MaxUploadsPerDay" is set to a positive value then at most the + /// specified number of crashes will be uploaded in each 24 hour period. + /// 2. If crash upload fails due to a network or server error then an + /// incremental backoff delay up to a maximum of 24 hours will be applied for + /// retries. + /// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the + /// "MaxUploadsPerDay" value will be reduced to 1 until the client is + /// restarted. This helps to avoid an upload flood when the network or + /// server error is resolved. + /// + /// If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage + /// on disk will be limited to that size in megabytes. For example, on Windows + /// each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to + /// about 34 crash reports stored on disk. + /// + /// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older + /// than the specified age in days will be deleted. + /// + /// CrashKeys section: + /// + /// Any number of crash keys can be specified for use by the application. Crash + /// key values will be truncated based on the specified size (small = 63 bytes, + /// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set + /// from any thread or process using the Cef.SetCrashKeyValue function. These + /// key/value pairs will be sent to the crash server along with the crash dump + /// file. Medium and large values will be chunked for submission. For example, + /// if your key is named "mykey" then the value will be broken into ordered + /// chunks and submitted using keys named "mykey-1", "mykey-2", etc. + /// + /// Returns true if crash reporting is enabled. + static property bool CrashReportingEnabled + { + bool get() + { + return CefCrashReportingEnabled(); + } + } + + /// + /// Sets or clears a specific key-value pair from the crash metadata. + /// + static void SetCrashKeyValue(String^ key, String^ value) + { + CefSetCrashKeyValue(StringUtils::ToNative(key), StringUtils::ToNative(value)); + } + + static int GetMinLogLevel() + { + return cef_get_min_log_level(); + } + + /// + /// Returns the mime type for the specified file extension or an empty string if unknown. + /// + /// file extension + /// Returns the mime type for the specified file extension or an empty string if unknown. + static String^ GetMimeType(String^ extension) + { + if (extension == nullptr) + { + throw gcnew ArgumentNullException("extension"); + } + + if (extension->StartsWith(".")) + { + extension = extension->Substring(1, extension->Length - 1); + } + + auto mimeType = StringUtils::ToClr(CefGetMimeType(StringUtils::ToNative(extension))); + + //Lookup to see if we have a custom mapping + //MimeTypeMapping::GetCustomMapping will Fallback + //to application/octet-stream if no mapping found + if (String::IsNullOrEmpty(mimeType)) + { + return MimeTypeMapping::GetCustomMapping(extension); + } + + return mimeType; + } + + /// + /// WaitForBrowsersToClose is not enabled by default, call this method + /// before Cef.Initialize to enable. If you aren't calling Cef.Initialize + /// explicitly then this should be called before creating your first + /// ChromiumWebBrowser instance. + /// + static void EnableWaitForBrowsersToClose() + { + if (_waitForBrowsersToCloseEnabled) + { + return; + } + + if (_initialized.HasValue) + { + throw gcnew Exception("Must be enabled before Cef.Initialize is called. "); + } + + _waitForBrowsersToCloseEnabled = true; + + BrowserRefCounter::Instance = gcnew BrowserRefCounter(); + } + + /// + /// Helper method to ensure all ChromiumWebBrowser instances have been + /// closed/disposed, should be called before Cef.Shutdown. + /// Disposes all remaning ChromiumWebBrowser instances + /// then waits for CEF to release it's remaning CefBrowser instances. + /// Finally a small delay of 50ms to allow for CEF to finish it's cleanup. + /// Should only be called when MultiThreadedMessageLoop = true; + /// (Hasn't been tested when when CEF integrates into main message loop). + /// + static void WaitForBrowsersToClose() + { + WaitForBrowsersToClose(750); + } + + /// + /// Helper method to ensure all ChromiumWebBrowser instances have been + /// closed/disposed, should be called before Cef.Shutdown. + /// Disposes all remaning ChromiumWebBrowser instances + /// then waits for CEF to release it's remaning CefBrowser instances. + /// Finally a small delay of 50ms to allow for CEF to finish it's cleanup. + /// Should only be called when MultiThreadedMessageLoop = true; + /// (Hasn't been tested when when CEF integrates into main message loop). + /// + /// The timeout in miliseconds. + static void WaitForBrowsersToClose(int timeoutInMiliseconds) + { + if (!_waitForBrowsersToCloseEnabled) + { + throw gcnew Exception("This feature is currently disabled. Call Cef.EnableWaitForBrowsersToClose before calling Cef.Initialize to enable."); + } + + //Dispose of any remaining browser instances + for each(IDisposable^ diposable in Enumerable::ToList(_disposables)) + { + delete diposable; + } + + //Clear the list as we've disposed of them all now. + _disposables->Clear(); + + //Wait for the browsers to close + BrowserRefCounter::Instance->WaitForBrowsersToClose(timeoutInMiliseconds); + + //A few extra ms to allow for CEF to finish + Thread::Sleep(50); + } + + /// + /// Post an action for delayed execution on the specified thread. + /// + /// thread id + /// action to execute + /// delay in ms + /// bool + static bool PostDelayedAction(CefThreadIds threadId, Action^ action, int delayInMs) + { + auto task = new CefTaskDelegate(action); + + return CefPostDelayedTask((cef_thread_id_t)threadId, task, delayInMs); + } + + /// + /// Post an action for execution on the specified thread. + /// + /// thread id + /// action to execute + /// bool + static bool PostAction(CefThreadIds threadId, Action^ action) + { + auto task = new CefTaskDelegate(action); + + return CefPostTask((cef_thread_id_t)threadId, task); + } + + static bool IsWindows10OrGreaterEx() + { + return IsWindows10OrGreater(); + } + }; + } +} +#endif // CEFSHARP_CORE_CEF_H_ diff --git a/CefSharp.Core.Runtime/CefSettingsBase.h b/CefSharp.Core.Runtime/CefSettingsBase.h new file mode 100644 index 0000000000..c8b3b85e5f --- /dev/null +++ b/CefSharp.Core.Runtime/CefSettingsBase.h @@ -0,0 +1,384 @@ +// Copyright © 2010 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +using namespace System::Collections::Generic; +using namespace System::IO; + +namespace CefSharp +{ + namespace Core + { + /// + /// Initialization settings. Many of these and other settings can also configured using command-line switches. + /// WPF/WinForms/OffScreen each have their own CefSettings implementation that sets + /// relevant settings e.g. OffScreen starts with audio muted. + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class CefSettingsBase sealed + { + private: + /// + /// Command Line Arguments Dictionary. + /// + CommandLineArgDictionary^ _cefCommandLineArgs; + + internal: + /// + /// CefSettings unmanaged pointer + /// + ::CefSettings* _cefSettings; + /// + /// CefCustomScheme collection + /// + List^ _cefCustomSchemes; + + public: + /// + /// Default Constructor. + /// + CefSettingsBase() : _cefSettings(new ::CefSettings()) + { + _cefSettings->multi_threaded_message_loop = true; + _cefSettings->no_sandbox = true; + BrowserSubprocessPath = Path::Combine(Path::GetDirectoryName(CefSettingsBase::typeid->Assembly->Location), "CefSharp.BrowserSubprocess.exe"); + _cefCustomSchemes = gcnew List(); + _cefCommandLineArgs = gcnew CommandLineArgDictionary(); + } + + /// + /// Finalizer. + /// + !CefSettingsBase() + { + _cefSettings = nullptr; + } + + /// + /// Destructor. + /// + ~CefSettingsBase() + { + this->!CefSettingsBase(); + } + + /// + /// Add Customs schemes to this collection. + /// + property IEnumerable^ CefCustomSchemes + { + IEnumerable^ get() { return _cefCustomSchemes; } + } + + /// + /// Add custom command line argumens to this collection, they will be added in OnBeforeCommandLineProcessing. The + /// CefSettings.CommandLineArgsDisabled value can be used to start with an empty command-line object. Any values specified in + /// CefSettings that equate to command-line arguments will be set before this method is called. + /// + property CommandLineArgDictionary^ CefCommandLineArgs + { + CommandLineArgDictionary^ get() { return _cefCommandLineArgs; } + } + + /// + /// Set to true to disable configuration of browser process features using standard CEF and Chromium command-line arguments. + /// Configuration can still be specified using CEF data structures or by adding to CefCommandLineArgs. + /// + property bool CommandLineArgsDisabled + { + bool get() { return _cefSettings->command_line_args_disabled == 1; } + void set(bool value) { _cefSettings->command_line_args_disabled = value; } + } + + /// + /// Set to true to control browser process main (UI) thread message pump scheduling via the + /// IBrowserProcessHandler.OnScheduleMessagePumpWork callback. This option is recommended for use in combination with the + /// Cef.DoMessageLoopWork() function in cases where the CEF message loop must be integrated into an existing application message + /// loop (see additional comments and warnings on Cef.DoMessageLoopWork). Enabling this option is not recommended for most users; + /// leave this option disabled and use either MultiThreadedMessageLoop (the default) if possible. + /// + property bool ExternalMessagePump + { + bool get() { return _cefSettings->external_message_pump == 1; } + void set(bool value) { _cefSettings->external_message_pump = value; } + } + + /// + /// Set to true to have the browser process message loop run in a separate thread. If false than the CefDoMessageLoopWork() + /// function must be called from your application message loop. This option is only supported on Windows. The default value is + /// true. + /// + property bool MultiThreadedMessageLoop + { + bool get() { return _cefSettings->multi_threaded_message_loop == 1; } + void set(bool value) { _cefSettings->multi_threaded_message_loop = value; } + } + + /// + /// The path to a separate executable that will be launched for sub-processes. By default the browser process executable is used. + /// See the comments on Cef.ExecuteProcess() for details. If this value is non-empty then it must be an absolute path. + /// Also configurable using the "browser-subprocess-path" command-line switch. + /// Defaults to using the provided CefSharp.BrowserSubprocess.exe instance + /// + property String^ BrowserSubprocessPath + { + String^ get() { return StringUtils::ToClr(_cefSettings->browser_subprocess_path); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->browser_subprocess_path, value); } + } + + /// + /// The location where data for the global browser cache will be stored on disk. In this value is non-empty then it must be + /// an absolute path that is must be either equal to or a child directory of CefSettings.RootCachePath (if RootCachePath is + /// empty it will default to this value). If the value is empty then browsers will be created in "incognito mode" where + /// in-memory caches are used for storage and no data is persisted to disk. HTML5 databases such as localStorage will only + /// persist across sessions if a cache path is specified. Can be overridden for individual RequestContext instances via the + /// RequestContextSettings.CachePath value. + /// + property String^ CachePath + { + String^ get() { return StringUtils::ToClr(_cefSettings->cache_path); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->cache_path, value); } + } + + /// + /// The root directory for installation-specific data and the parent directory for profile-specific data. + /// All CachePath and RequestContextSettings.CachePath" values must have this parent directory + /// in common. If this value is empty and is non-empty then it will default to the + /// CachePath value. Any non-empty value must be an absolute path. If both values are empty then + /// the default platform-specific directory will be used ("AppData\Local\CEF\User Data" directory under the user + /// profile directory on Windows). + /// + /// **Use of the default directory is not recommended in production applications(see below).** + /// + /// Multiple application instances writing to the same RootCachePath directory could result in data corruption. + /// A process singleton lock based on the RootCachePath value is therefore used to protect against this. + /// This singleton behavior applies to all CEF-based applications using version 120 or newer. + /// You should customize RootCachePath for your application and implement IBrowserProcessHandler.OnAlreadyRunningAppRelaunch, + /// which will then be called on any app relaunch with the same RootCachePath value. + /// + /// Failure to set the RootCachePath value correctly may result in startup crashes or other unexpected behaviors + /// + property String^ RootCachePath + { + String^ get() { return StringUtils::ToClr(_cefSettings->root_cache_path); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->root_cache_path, value); } + } + + /// + /// The locale string that will be passed to WebKit. If empty the default locale of "en-US" will be used. Also configurable using + /// the "lang" command-line switch. + /// + property String^ Locale + { + String^ get() { return StringUtils::ToClr(_cefSettings->locale); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->locale, value); } + } + + /// + /// The fully qualified path for the locales directory. If this value is empty the locales directory must be located in the + /// module directory. If this value is non-empty then it must be an absolute path. Also configurable using the "locales-dir-path" + /// command-line switch. + /// + property String^ LocalesDirPath + { + String^ get() { return StringUtils::ToClr(_cefSettings->locales_dir_path); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->locales_dir_path, value); } + } + + /// + /// The fully qualified path for the resources directory. If this value is empty the cef.pak and/or devtools_resources.pak files + /// must be located in the module directory. Also configurable using the "resources-dir-path" command-line switch. + /// + property String^ ResourcesDirPath + { + String^ get() { return StringUtils::ToClr(_cefSettings->resources_dir_path); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->resources_dir_path, value); } + } + + /// + /// The directory and file name to use for the debug log. If empty a default log file name and location will be used. On Windows + /// a "debug.log" file will be written in the main executable directory. Also configurable using the"log-file" command- line + /// switch. + /// + property String^ LogFile + { + String^ get() { return StringUtils::ToClr(_cefSettings->log_file); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->log_file, value); } + } + + /// + /// The log severity. Only messages of this severity level or higher will be logged. When set to + /// no messages will be written to the log file, but Fatal messages will still be + /// output to stderr. Also configurable using the "log-severity" command-line switch with a value of "verbose", "info", "warning", + /// "error", "fatal", "error-report" or "disable". + /// + property CefSharp::LogSeverity LogSeverity + { + CefSharp::LogSeverity get() { return (CefSharp::LogSeverity)_cefSettings->log_severity; } + void set(CefSharp::LogSeverity value) { _cefSettings->log_severity = (cef_log_severity_t)value; } + } + + /// + /// Custom flags that will be used when initializing the V8 JavaScript engine. The consequences of using custom flags may not be + /// well tested. Also configurable using the "js-flags" command-line switch. + /// + property String^ JavascriptFlags + { + String^ get() { return StringUtils::ToClr(_cefSettings->javascript_flags); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->javascript_flags, value); } + } + + /// + /// Value that will be inserted as the product portion of the default User-Agent string. If empty the Chromium product version + /// will be used. If UserAgent is specified this value will be ignored. Also configurable using the "user-agent-product" command- + /// line switch. + /// + property String^ UserAgentProduct + { + String^ get() { return StringUtils::ToClr(_cefSettings->user_agent_product); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->user_agent_product, value); } + } + + /// + /// Set to a value between 1024 and 65535 to enable remote debugging on the specified port. For example, if 8080 is specified the + /// remote debugging URL will be http://localhost:8080. CEF can be remotely debugged from any CEF or Chrome browser window. Also + /// configurable using the "remote-debugging-port" command-line switch. + /// + property int RemoteDebuggingPort + { + int get() { return _cefSettings->remote_debugging_port; } + void set(int value) { _cefSettings->remote_debugging_port = value; } + } + + /// + /// The number of stack trace frames to capture for uncaught exceptions. Specify a positive value to enable the + /// CefRenderProcessHandler:: OnUncaughtException() callback. Specify 0 (default value) and OnUncaughtException() will not be + /// called. Also configurable using the "uncaught-exception-stack-size" command-line switch. + /// + property int UncaughtExceptionStackSize + { + int get() { return _cefSettings->uncaught_exception_stack_size; } + void set(int value) { _cefSettings->uncaught_exception_stack_size = value; } + } + + /// + /// Value that will be returned as the User-Agent HTTP header. If empty the default User-Agent string will be used. Also + /// configurable using the "user-agent" command-line switch. + /// + property String^ UserAgent + { + String^ get() { return StringUtils::ToClr(_cefSettings->user_agent); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->user_agent, value); } + } + + /// + /// Set to true (1) to enable windowless (off-screen) rendering support. Do not enable this value if the application does not use + /// windowless rendering as it may reduce rendering performance on some systems. + /// + property bool WindowlessRenderingEnabled + { + bool get() { return _cefSettings->windowless_rendering_enabled == 1; } + void set(bool value) { _cefSettings->windowless_rendering_enabled = value; } + } + + /// + /// The directory where data for the global browser cache will be stored on disk. + /// If this value is non-empty then it must be an absolute path that is either equal to or a child directory + /// of RootCachePath. If this value is empty then browsers will be created in "incognito mode" + /// where in-memory caches are used for storage and no profile-specific data is persisted to disk + /// (installation-specific data will still be persisted in RootCachePath). HTML5 databases + /// such as localStorage will only persist across sessions if a cache path is specified. + /// Can be overridden for individual RequestContext instances via the RequestContextSettings.CachePath value. + /// Any child directory value will be ignored and the "default" profile (also a child directory) will be used + /// instead. + /// + property bool PersistSessionCookies + { + bool get() { return _cefSettings->persist_session_cookies == 1; } + void set(bool value) { _cefSettings->persist_session_cookies = value; } + } + + /// + /// Comma delimited ordered list of language codes without any whitespace that will be used in the "Accept-Language" HTTP header. + /// May be set globally using the CefSettings.AcceptLanguageList value. If both values are empty then "en-US,en" will be used. + /// + /// + property String^ AcceptLanguageList + { + String^ get() { return StringUtils::ToClr(_cefSettings->accept_language_list); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->accept_language_list, value); } + } + + /// + /// Background color used for the browser before a document is loaded and when no document color is specified. The alpha + /// component must be either fully opaque (0xFF) or fully transparent (0x00). If the alpha component is fully opaque then the RGB + /// components will be used as the background color. If the alpha component is fully transparent for a WinForms browser then the + /// default value of opaque white be used. If the alpha component is fully transparent for a windowless (WPF/OffScreen) browser + /// then transparent painting will be enabled. + /// + property uint32_t BackgroundColor + { + uint32_t get() { return _cefSettings->background_color; } + void set(uint32_t value) { _cefSettings->background_color = value; } + } + + /// + /// Comma delimited list of schemes supported by the associated + /// ICookieManager. If CookieableSchemesExcludeDefaults is false the + /// default schemes ("http", "https", "ws" and "wss") will also be supported. + /// Specifying a CookieableSchemesList value and setting + /// CookieableSchemesExcludeDefaults to true will disable all loading + /// and saving of cookies for this manager. Can be overridden + /// for individual RequestContext instances via the + /// RequestContextSettings.CookieableSchemesList and + /// RequestContextSettings.CookieableSchemesExcludeDefaults values. + /// + property String^ CookieableSchemesList + { + String^ get() { return StringUtils::ToClr(_cefSettings->cookieable_schemes_list); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->cookieable_schemes_list, value); } + } + + /// + /// If CookieableSchemesExcludeDefaults is false the + /// default schemes ("http", "https", "ws" and "wss") will also be supported. + /// Specifying a CookieableSchemesList value and setting + /// CookieableSchemesExcludeDefaults to true will disable all loading + /// and saving of cookies for this manager. Can be overridden + /// for individual RequestContext instances via the + /// RequestContextSettings.CookieableSchemesList and + /// RequestContextSettings.CookieableSchemesExcludeDefaults values. + /// + property bool CookieableSchemesExcludeDefaults + { + bool get() { return _cefSettings->cookieable_schemes_exclude_defaults == 1; } + void set(bool value) { _cefSettings->cookieable_schemes_exclude_defaults = value; } + } + + /// + /// The Chrome policy ID. This value is used to configure managed policies. + /// + property String^ ChromePolicyId + { + String^ get() { return StringUtils::ToClr(_cefSettings->chrome_policy_id); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->chrome_policy_id, value); } + } + + /// + /// Registers a custom scheme using the provided settings. + /// + /// The CefCustomScheme which provides the details about the scheme. + void RegisterScheme(CefCustomScheme^ cefCustomScheme) + { + //Scheme names are converted to lowercase + cefCustomScheme->SchemeName = cefCustomScheme->SchemeName->ToLower(); + + _cefCustomSchemes->Add(cefCustomScheme); + } + }; + } +} diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj new file mode 100644 index 0000000000..e49e42a777 --- /dev/null +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj @@ -0,0 +1,479 @@ + + + + + + + + + Debug + Win32 + + + Debug + x64 + + + Debug + arm64 + + + Release + Win32 + + + Release + x64 + + + Release + arm64 + + + + 16.0 + {7B495581-2271-4F41-9476-ACB86E8C864F} + CefSharp.Core.Runtime + CefSharp + NetCoreCProj + net6.0 + 10.0.10240.0 + + + + + DynamicLibrary + Unicode + NetCore + true + + + DynamicLibrary + Unicode + NetCore + true + + + DynamicLibrary + Unicode + NetCore + true + + + DynamicLibrary + Unicode + NetCore + + + DynamicLibrary + Unicode + NetCore + + + DynamicLibrary + Unicode + NetCore + + + + + + + + + + + + + + + + + + + + + + + + + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + false + false + ..\CefSharp.snk + AllRules.ruleset + + + CefSharp.Core.Runtime + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + false + ..\CefSharp.snk + AllRules.ruleset + + + CefSharp.Core.Runtime + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + false + ..\CefSharp.snk + AllRules.ruleset + + + CefSharp.Core.Runtime + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + bin.netcore\$(Platform)\$(Configuration)\ + false + AllRules.ruleset + + + CefSharp.Core.Runtime + ..\CefSharp.snk + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + AllRules.ruleset + + + CefSharp.Core.Runtime + ..\CefSharp.snk + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + AllRules.ruleset + + + CefSharp.Core.Runtime + ..\CefSharp.snk + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + + Disabled + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;OS_WIN;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Use + true + Level3 + ProgramDatabase + Stdafx.h + true + true + stdcpp20 + CompileAsCpp + + + false + + + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + false + true + true + MachineX86 + false + false + $(LinkKeyFile) + /ignore:4099 %(AdditionalOptions) + libcef.dll;%(DelayLoadDLLs) + + + Assembly.manifest + + + + + Disabled + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Use + true + Level3 + ProgramDatabase + Stdafx.h + true + stdcpp20 + CompileAsCpp + + + false + + + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + false + true + true + false + false + $(LinkKeyFile) + + + Assembly.manifest + + + + + Disabled + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Use + true + Level3 + ProgramDatabase + Stdafx.h + true + stdcpp20 + CompileAsCpp + + + false + + + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + false + true + true + false + false + $(LinkKeyFile) + + + Assembly.manifest + + + + + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _NDEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;OS_WIN;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDLL + Use + Level3 + ProgramDatabase + true + true + true + stdcpp20 + CompileAsCpp + + + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + LinkVerbose + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + true + MachineX86 + $(LinkKeyFile) + + + Assembly.manifest + + + + + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _NDEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDLL + Use + Level3 + ProgramDatabase + true + true + stdcpp20 + CompileAsCpp + + + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + true + $(LinkKeyFile) + + + Assembly.manifest + + + + + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _NDEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDLL + Use + Level3 + ProgramDatabase + true + true + stdcpp20 + CompileAsCpp + + + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + true + $(LinkKeyFile) + + + Assembly.manifest + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {39E385AD-DC5C-451E-B061-09AF3EE038EB} + false + true + true + false + false + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj.filters b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj.filters new file mode 100644 index 0000000000..f225404bd0 --- /dev/null +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj.filters @@ -0,0 +1,343 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Header Files + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Core/CefSharp.Core.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj similarity index 83% rename from CefSharp.Core/CefSharp.Core.vcxproj rename to CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj index b9d6908f53..069b91466d 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj @@ -1,6 +1,9 @@  - + + + + Debug @@ -23,7 +26,7 @@ {7B495581-2271-4F41-9476-ACB86E8C864F} CefSharp ManagedCProj - v4.5.2 + v4.6.2 @@ -77,7 +80,7 @@ AllRules.ruleset - CefSharp.Core + CefSharp.Core.Runtime $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) @@ -87,7 +90,7 @@ AllRules.ruleset - CefSharp.Core + CefSharp.Core.Runtime bin\$(Platform)\$(Configuration)\ obj\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) @@ -98,7 +101,7 @@ AllRules.ruleset - CefSharp.Core + CefSharp.Core.Runtime ..\CefSharp.snk obj\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) @@ -108,7 +111,7 @@ AllRules.ruleset - CefSharp.Core + CefSharp.Core.Runtime ..\CefSharp.snk bin\$(Platform)\$(Configuration)\ obj\$(Platform)\$(Configuration)\ @@ -127,6 +130,8 @@ Stdafx.h true true + stdcpp20 + CompileAsCpp false @@ -157,6 +162,8 @@ ProgramDatabase Stdafx.h true + stdcpp20 + CompileAsCpp false @@ -183,6 +190,8 @@ true true true + stdcpp20 + CompileAsCpp opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) @@ -203,6 +212,8 @@ ProgramDatabase true true + stdcpp20 + CompileAsCpp opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) @@ -232,40 +243,49 @@ - - + + + - - - + - + Create Create Create Create + - - - + + + + + + + + + + + + @@ -280,54 +300,52 @@ - - - - - + + + + + - + - - - + - + - - + + @@ -346,8 +364,12 @@ - + - + + + + + \ No newline at end of file diff --git a/CefSharp.Core/CefSharp.Core.vcxproj.filters b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters similarity index 84% rename from CefSharp.Core/CefSharp.Core.vcxproj.filters rename to CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters index 7bf38ab352..203ef52396 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj.filters +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters @@ -17,33 +17,18 @@ Source Files - - Source Files - - - Source Files - Source Files - - Source Files - Source Files Source Files - - Source Files - Source Files - - Source Files - Source Files @@ -77,10 +62,25 @@ Source Files - + + Source Files + + Source Files - + + Source Files + + + Source Files + + + Source Files + + + Source Files + + Source Files @@ -100,12 +100,6 @@ Header Files - - Header Files - - - Header Files - Header Files @@ -121,15 +115,9 @@ Header Files - - Header Files - Header Files - - Header Files - Header Files @@ -139,15 +127,6 @@ Header Files - - Header Files - - - Header Files - - - Header Files - Header Files @@ -193,12 +172,6 @@ Header Files - - Header Files - - - Header Files - Header Files @@ -259,9 +232,6 @@ Header Files - - Header Files - Header Files @@ -280,36 +250,84 @@ Header Files - + + Header Files + + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - - - + Header Files - + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + Header Files - + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + Header Files @@ -317,6 +335,6 @@ - + \ No newline at end of file diff --git a/CefSharp.Core/CookieManager.cpp b/CefSharp.Core.Runtime/CookieManager.cpp similarity index 62% rename from CefSharp.Core/CookieManager.cpp rename to CefSharp.Core.Runtime/CookieManager.cpp index 60a6e2003d..e227396fc7 100644 --- a/CefSharp.Core/CookieManager.cpp +++ b/CefSharp.Core.Runtime/CookieManager.cpp @@ -5,7 +5,7 @@ #include "Stdafx.h" #include "CookieManager.h" -#include "Internals\CookieVisitor.h" +#include "Internals\CefCookieVisitorAdapter.h" #include "Internals\CefCompletionCallbackAdapter.h" #include "Internals\CefSetCookieCallbackAdapter.h" #include "Internals\CefDeleteCookiesCallbackAdapter.h" @@ -26,7 +26,7 @@ namespace CefSharp { ThrowIfDisposed(); - CefRefPtr wrapper = callback == nullptr ? NULL : new CefDeleteCookiesCallbackAdapter(callback); + CefRefPtr wrapper = callback == nullptr ? nullptr : new CefDeleteCookiesCallbackAdapter(callback); return _cookieManager->DeleteCookies(StringUtils::ToNative(url), StringUtils::ToNative(name), wrapper); } @@ -35,7 +35,7 @@ namespace CefSharp { ThrowIfDisposed(); - CefRefPtr wrapper = callback == nullptr ? NULL : new CefSetCookieCallbackAdapter(callback); + CefRefPtr wrapper = callback == nullptr ? nullptr : new CefSetCookieCallbackAdapter(callback); CefCookie c; StringUtils::AssignNativeFromClr(c.name, cookie->Name); @@ -45,41 +45,28 @@ namespace CefSharp c.secure = cookie->Secure; c.httponly = cookie->HttpOnly; c.has_expires = cookie->Expires.HasValue; + if (cookie->Expires.HasValue) { - auto expires = cookie->Expires.Value; - c.expires = CefTime(DateTimeUtils::ToCefTime(expires)); + c.expires.val = CefTimeUtils::FromDateTimeToBaseTime(cookie->Expires.Value); } - c.creation = CefTime(DateTimeUtils::ToCefTime(cookie->Creation)); - c.last_access = CefTime(DateTimeUtils::ToCefTime(cookie->LastAccess)); + // creation/last_access are basically readonly (assigned by Chromium when the cookie is created) + // So I don't think we actually need to set them. The other option is to assign them to DateTime.Now + // Issue #4234 + //c.creation.val = CefTimeUtils::FromDateTimeToBaseTime(cookie->Creation); + //c.last_access.val = CefTimeUtils::FromDateTimeToBaseTime(cookie->LastAccess); + c.same_site = (cef_cookie_same_site_t)cookie->SameSite; + c.priority = (cef_cookie_priority_t)cookie->Priority; return _cookieManager->SetCookie(StringUtils::ToNative(url), c, wrapper); } - bool CookieManager::SetStoragePath(String^ path, bool persistSessionCookies, ICompletionCallback^ callback) - { - ThrowIfDisposed(); - - CefRefPtr wrapper = callback == nullptr ? NULL : new CefCompletionCallbackAdapter(callback); - - return _cookieManager->SetStoragePath(StringUtils::ToNative(path), persistSessionCookies, wrapper); - } - - void CookieManager::SetSupportedSchemes(cli::array^ schemes, ICompletionCallback^ callback) - { - ThrowIfDisposed(); - - CefRefPtr wrapper = callback == nullptr ? NULL : new CefCompletionCallbackAdapter(callback); - - _cookieManager->SetSupportedSchemes(StringUtils::ToNative(schemes), wrapper); - } - bool CookieManager::VisitAllCookies(ICookieVisitor^ visitor) { ThrowIfDisposed(); - CefRefPtr cookieVisitor = new CookieVisitor(visitor); + CefRefPtr cookieVisitor = new CefCookieVisitorAdapter(visitor); return _cookieManager->VisitAllCookies(cookieVisitor); } @@ -88,7 +75,7 @@ namespace CefSharp { ThrowIfDisposed(); - CefRefPtr cookieVisitor = new CookieVisitor(visitor); + CefRefPtr cookieVisitor = new CefCookieVisitorAdapter(visitor); return _cookieManager->VisitUrlCookies(StringUtils::ToNative(url), includeHttpOnly, cookieVisitor); } @@ -97,7 +84,7 @@ namespace CefSharp { ThrowIfDisposed(); - CefRefPtr wrapper = callback == nullptr ? NULL : new CefCompletionCallbackAdapter(callback); + CefRefPtr wrapper = callback == nullptr ? nullptr : new CefCompletionCallbackAdapter(callback); return _cookieManager->FlushStore(wrapper); } diff --git a/CefSharp.Core/CookieManager.h b/CefSharp.Core.Runtime/CookieManager.h similarity index 53% rename from CefSharp.Core/CookieManager.h rename to CefSharp.Core.Runtime/CookieManager.h index f3ffc646c5..fc3d856116 100644 --- a/CefSharp.Core/CookieManager.h +++ b/CefSharp.Core.Runtime/CookieManager.h @@ -11,7 +11,9 @@ namespace CefSharp { - public ref class CookieManager : public ICookieManager + //TODO: No longer possible for users to create a CookieManager, can be made private now + /// + private ref class CookieManager : public ICookieManager { private: MCefRefPtr _cookieManager; @@ -29,29 +31,12 @@ namespace CefSharp { if (this == nullptr) { - return NULL; + return nullptr; } return _cookieManager.get(); } public: - /// - // Creates a new cookie manager. If |path| is empty data will be stored in - // memory only. Otherwise, data will be stored at the specified |path|. To - // persist session cookies (cookies without an expiry date or validity - // interval) set |persist_session_cookies| to true. Session cookies are - // generally intended to be transient and most Web browsers do not persist - // them. If |callback| is non-NULL it will be executed asnychronously on the - // IO thread after the manager's storage has been initialized. - /// - /*--cef(optional_param=path,optional_param=callback)--*/ - CookieManager(String^ path, bool persistSessionCookies, ICompletionCallback^ callback) - { - CefRefPtr wrapper = callback == nullptr ? NULL : new CefCompletionCallbackAdapter(callback); - - _cookieManager = CefCookieManager::CreateManager(StringUtils::ToNative(path), persistSessionCookies, wrapper); - } - !CookieManager() { this->_cookieManager = nullptr; @@ -64,8 +49,6 @@ namespace CefSharp virtual bool DeleteCookies(String^ url, String^ name, IDeleteCookiesCallback^ callback); virtual bool SetCookie(String^ url, Cookie^ cookie, ISetCookieCallback^ callback); - virtual bool SetStoragePath(String^ path, bool persistSessionSookies, ICompletionCallback^ callback); - virtual void SetSupportedSchemes(cli::array^ schemes, ICompletionCallback^ callback); virtual bool VisitAllCookies(ICookieVisitor^ visitor); virtual bool VisitUrlCookies(String^ url, bool includeHttpOnly, ICookieVisitor^ visitor); virtual bool FlushStore(ICompletionCallback^ callback); @@ -78,4 +61,4 @@ namespace CefSharp } } }; -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/CefDragDataWrapper.h b/CefSharp.Core.Runtime/DragData.h similarity index 83% rename from CefSharp.Core/Internals/CefDragDataWrapper.h rename to CefSharp.Core.Runtime/DragData.h index f7fce6fa9a..b31f0af62f 100644 --- a/CefSharp.Core/Internals/CefDragDataWrapper.h +++ b/CefSharp.Core.Runtime/DragData.h @@ -8,24 +8,25 @@ #include "include/cef_drag_data.h" -#include "CefWrapper.h" -#include "CefImageWrapper.h" -#include "CefWriteHandlerWrapper.h" +#include "Internals\CefWrapper.h" +#include "Internals\CefImageWrapper.h" +#include "Internals\CefWriteHandlerWrapper.h" using namespace std; using namespace System::IO; namespace CefSharp { - namespace Internals + namespace Core { - public ref class CefDragDataWrapper : public IDragData, public CefWrapper + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class DragData : public IDragData, public CefWrapper { private: MCefRefPtr _wrappedDragData; internal: - CefDragDataWrapper(CefRefPtr &dragData) : + DragData(const CefRefPtr &dragData) : _wrappedDragData(dragData) { IsReadOnly = dragData->IsReadOnly(); @@ -35,18 +36,27 @@ namespace CefSharp IsLink = dragData->IsLink(); } - !CefDragDataWrapper() + !DragData() { _wrappedDragData = nullptr; } - ~CefDragDataWrapper() + ~DragData() { - this->!CefDragDataWrapper(); + this->!DragData(); _disposed = true; } + operator CefRefPtr() + { + if (this == nullptr) + { + return nullptr; + } + return _wrappedDragData.get(); + } + public: virtual property bool IsReadOnly; virtual property String^ FileName; @@ -56,17 +66,16 @@ namespace CefSharp virtual IDragData^ Clone() { - return gcnew CefDragDataWrapper(_wrappedDragData->Clone()); + return gcnew DragData(_wrappedDragData->Clone()); } /// // Create a new CefDragData object. /// /*--cef()--*/ - static CefDragDataWrapper^ Create() + static IDragData^ Create() { - CefRefPtr cefDragData = CefDragData::Create(); - return gcnew CefDragDataWrapper(cefDragData); + return gcnew DragData(CefDragData::Create()); } //TODO: Vector is a pointer, so can potentially be updated (items may be possibly removed) @@ -81,6 +90,18 @@ namespace CefSharp } } + //TODO: Vector is a pointer, so can potentially be updated (items may be possibly removed) + virtual property IList^ FilePaths + { + IList^ get() + { + auto paths = vector(); + _wrappedDragData->GetFilePaths(paths); + + return StringUtils::ToClr(paths); + } + } + virtual property String^ FragmentBaseUrl { String^ get() @@ -198,11 +219,16 @@ namespace CefSharp _wrappedDragData->ResetFileContents(); } + virtual void ClearFilenames() + { + _wrappedDragData->ClearFilenames(); + } + virtual Int64 GetFileContents(Stream^ stream) { if (stream == nullptr) { - return (Int64)_wrappedDragData->GetFileContents(NULL); + return (Int64)_wrappedDragData->GetFileContents(nullptr); } auto writeHandler = new CefWriteHandlerWrapper(stream); @@ -210,15 +236,6 @@ namespace CefSharp auto writer = CefStreamWriter::CreateForHandler(writeHandler); return (Int64)_wrappedDragData->GetFileContents(writer); } - - operator CefRefPtr() - { - if (this == nullptr) - { - return NULL; - } - return _wrappedDragData.get(); - } }; } } diff --git a/CefSharp.Core/Internals/CefAuthCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefAuthCallbackWrapper.h similarity index 86% rename from CefSharp.Core/Internals/CefAuthCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefAuthCallbackWrapper.h index 725ee428ff..65b5aa2a70 100644 --- a/CefSharp.Core/Internals/CefAuthCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefAuthCallbackWrapper.h @@ -17,25 +17,22 @@ namespace CefSharp { private: MCefRefPtr _callback; - IFrame^ _frame; public: - CefAuthCallbackWrapper(CefRefPtr &callback, IFrame^ frame) - : _callback(callback), _frame(frame) + CefAuthCallbackWrapper(CefRefPtr &callback) + : _callback(callback) { } !CefAuthCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefAuthCallbackWrapper() { this->!CefAuthCallbackWrapper(); - delete _frame; - _frame = nullptr; _disposed = true; } @@ -59,4 +56,4 @@ namespace CefSharp } }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/CefBeforeDownloadCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefBeforeDownloadCallbackWrapper.h similarity index 97% rename from CefSharp.Core/Internals/CefBeforeDownloadCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefBeforeDownloadCallbackWrapper.h index 0b0fbd8715..53e490aa5f 100644 --- a/CefSharp.Core/Internals/CefBeforeDownloadCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefBeforeDownloadCallbackWrapper.h @@ -27,7 +27,7 @@ namespace CefSharp !CefBeforeDownloadCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefBeforeDownloadCallbackWrapper() diff --git a/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp b/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp similarity index 72% rename from CefSharp.Core/Internals/CefBrowserHostWrapper.cpp rename to CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp index 5540619e3b..5b8da2a87b 100644 --- a/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp +++ b/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp @@ -6,22 +6,26 @@ #include "CefBrowserHostWrapper.h" #include "include\cef_client.h" +#include "include\cef_parser.h" #include "Cef.h" -#include "CefExtensionWrapper.h" #include "CefTaskScheduler.h" -#include "CefDragDataWrapper.h" +#include "DragData.h" #include "CefRunFileDialogCallbackAdapter.h" #include "CefPdfPrintCallbackWrapper.h" #include "CefNavigationEntryVisitorAdapter.h" +#include "CefRegistrationWrapper.h" +#include "CefDevToolsMessageObserverAdapter.h" #include "RequestContext.h" #include "WindowInfo.h" +using namespace CefSharp::Core; + void CefBrowserHostWrapper::DragTargetDragEnter(IDragData^ dragData, MouseEvent mouseEvent, DragOperationsMask allowedOperations) { ThrowIfDisposed(); - auto dragDataWrapper = static_cast(dragData); + auto dragDataWrapper = static_cast(dragData); dragDataWrapper->ResetFileContents(); // Recommended by documentation to reset before calling DragEnter _browserHost->DragTargetDragEnter(static_cast>(dragDataWrapper), GetCefMouseEvent(mouseEvent), (CefBrowserHost::DragOperationsMask) allowedOperations); } @@ -82,20 +86,21 @@ void CefBrowserHostWrapper::PrintToPdf(String^ path, PdfPrintSettings^ settings, CefPdfPrintSettings nativeSettings; if (settings != nullptr) { - StringUtils::AssignNativeFromClr(nativeSettings.header_footer_title, settings->HeaderFooterTitle); - StringUtils::AssignNativeFromClr(nativeSettings.header_footer_url, settings->HeaderFooterUrl); - nativeSettings.backgrounds_enabled = settings->BackgroundsEnabled ? 1 : 0; - nativeSettings.header_footer_enabled = settings->HeaderFooterEnabled ? 1 : 0; nativeSettings.landscape = settings->Landscape ? 1 : 0; - nativeSettings.selection_only = settings->SelectionOnly ? 1 : 0; + nativeSettings.print_background = settings->PrintBackground ? 1 : 0; + nativeSettings.scale = settings->Scale; + nativeSettings.paper_height = settings->PaperHeight; + nativeSettings.paper_width = settings->PaperWidth; + nativeSettings.prefer_css_page_size = settings->PreferCssPageSize ? 1 : 0; + nativeSettings.margin_type = static_cast(settings->MarginType); nativeSettings.margin_bottom = settings->MarginBottom; nativeSettings.margin_top = settings->MarginTop; nativeSettings.margin_left = settings->MarginLeft; nativeSettings.margin_right = settings->MarginRight; - nativeSettings.scale_factor = settings->ScaleFactor; - nativeSettings.page_height = settings->PageHeight; - nativeSettings.page_width = settings->PageWidth; - nativeSettings.margin_type = static_cast(settings->MarginType); + StringUtils::AssignNativeFromClr(nativeSettings.page_ranges, settings->PageRanges); + nativeSettings.display_header_footer = settings->DisplayHeaderFooter ? 1 : 0; + StringUtils::AssignNativeFromClr(nativeSettings.header_template, settings->HeaderTemplate); + StringUtils::AssignNativeFromClr(nativeSettings.footer_template, settings->FooterTemplate); } _browserHost->PrintToPDF(StringUtils::ToNative(path), nativeSettings, new CefPdfPrintCallbackWrapper(callback)); @@ -108,16 +113,27 @@ void CefBrowserHostWrapper::SetZoomLevel(double zoomLevel) _browserHost->SetZoomLevel(zoomLevel); } -Task^ CefBrowserHostWrapper::GetZoomLevelAsync() +double CefBrowserHostWrapper::GetZoomLevel() { ThrowIfDisposed(); if (CefCurrentlyOn(TID_UI)) { - auto taskSource = gcnew TaskCompletionSource(); - CefSharp::Internals::TaskExtensions::TrySetResultAsync(taskSource, GetZoomLevelOnUI()); - return taskSource->Task; + return _browserHost->GetZoomLevel(); + } + + throw gcnew InvalidOperationException("This method can only be called directly on the CEF UI Thread. Use GetZoomLevelAsync or use Cef.UIThreadTaskFactory to marshal the call onto the CEF UI Thread."); + +} + +Task^ CefBrowserHostWrapper::GetZoomLevelAsync() +{ + ThrowIfDisposed(); + + if (CefCurrentlyOn(TID_UI)) + { + return Task::FromResult(GetZoomLevelOnUI()); } return Cef::UIThreadTaskFactory->StartNew(gcnew Func(this, &CefBrowserHostWrapper::GetZoomLevelOnUI)); } @@ -136,6 +152,14 @@ void CefBrowserHostWrapper::CloseBrowser(bool forceClose) _browserHost->CloseBrowser(forceClose); } +bool CefBrowserHostWrapper::TryCloseBrowser() +{ + ThrowIfDisposed(); + ThrowIfExecutedOnNonCefUiThread(); + + return _browserHost->TryCloseBrowser(); +} + void CefBrowserHostWrapper::ShowDevTools(IWindowInfo^ windowInfo, int inspectElementAtX, int inspectElementAtY) { ThrowIfDisposed(); @@ -145,11 +169,12 @@ void CefBrowserHostWrapper::ShowDevTools(IWindowInfo^ windowInfo, int inspectEle if (windowInfo == nullptr) { - nativeWindowInfo.SetAsPopup(_browserHost->GetWindowHandle(), "DevTools"); + nativeWindowInfo.SetAsPopup(NULL, "DevTools"); } else { - auto cefWindowInfoWrapper = static_cast(windowInfo); + //Get the inner instance then case that + auto cefWindowInfoWrapper = static_cast(windowInfo->UnWrap()); nativeWindowInfo = *cefWindowInfoWrapper->GetWindowInfo(); } @@ -171,35 +196,97 @@ bool CefBrowserHostWrapper::HasDevTools::get() return _browserHost->HasDevTools(); } -void CefBrowserHostWrapper::AddWordToDictionary(String^ word) +bool CefBrowserHostWrapper::SendDevToolsMessage(String^ messageAsJson) { ThrowIfDisposed(); - _browserHost->AddWordToDictionary(StringUtils::ToNative(word)); + ThrowIfExecutedOnNonCefUiThread(); + + if (String::IsNullOrEmpty(messageAsJson)) + { + throw gcnew ArgumentNullException("messageAsJson"); + } + + //NOTE: Prefix with cli:: namespace as VS2015 gets confused with std::array + cli::array^ buffer = System::Text::Encoding::UTF8->GetBytes(messageAsJson); + pin_ptr src = &buffer[0]; + + return _browserHost->SendDevToolsMessage(static_cast(src), buffer->Length); } -void CefBrowserHostWrapper::ReplaceMisspelling(String^ word) +int CefBrowserHostWrapper::ExecuteDevToolsMethod(int messageId, String^ method, IDictionary^ paramaters) { ThrowIfDisposed(); - _browserHost->ReplaceMisspelling(StringUtils::ToNative(word)); + ThrowIfExecutedOnNonCefUiThread(); + + if (paramaters == nullptr) + { + return _browserHost->ExecuteDevToolsMethod(messageId, StringUtils::ToNative(method), nullptr); + } + + auto val = TypeConversion::ToNative(paramaters); + + if (val && val->GetType() == VTYPE_DICTIONARY) + { + return _browserHost->ExecuteDevToolsMethod(messageId, StringUtils::ToNative(method), val->GetDictionary()); + } + + throw gcnew Exception("Unable to convert paramaters to CefDictionaryValue."); } -IExtension^ CefBrowserHostWrapper::Extension::get() + + +int CefBrowserHostWrapper::ExecuteDevToolsMethod(int messageId, String^ method, String^ paramsAsJson) { ThrowIfDisposed(); - auto extension = _browserHost->GetExtension(); + ThrowIfExecutedOnNonCefUiThread(); - if (extension.get()) + if (String::IsNullOrEmpty(paramsAsJson)) { - return gcnew CefExtensionWrapper(_browserHost->GetExtension()); + return _browserHost->ExecuteDevToolsMethod(messageId, StringUtils::ToNative(method), nullptr); } - return nullptr; + auto val = CefParseJSON(StringUtils::ToNative(paramsAsJson), cef_json_parser_options_t::JSON_PARSER_RFC); + + if (val && val->GetType() == VTYPE_DICTIONARY) + { + return _browserHost->ExecuteDevToolsMethod(messageId, StringUtils::ToNative(method), val->GetDictionary()); + } + + throw gcnew Exception("Unable to parse paramsAsJson with CefParseJSON method"); +} + +IRegistration^ CefBrowserHostWrapper::AddDevToolsMessageObserver(IDevToolsMessageObserver^ observer) +{ + ThrowIfDisposed(); + + auto registration = _browserHost->AddDevToolsMessageObserver(new CefDevToolsMessageObserverAdapter(observer)); + + return gcnew CefRegistrationWrapper(registration); +} + +int CefBrowserHostWrapper::GetNextDevToolsMessageId() +{ + return Interlocked::Increment(_lastDevToolsMessageId); +} + +void CefBrowserHostWrapper::AddWordToDictionary(String^ word) +{ + ThrowIfDisposed(); + + _browserHost->AddWordToDictionary(StringUtils::ToNative(word)); +} + +void CefBrowserHostWrapper::ReplaceMisspelling(String^ word) +{ + ThrowIfDisposed(); + + _browserHost->ReplaceMisspelling(StringUtils::ToNative(word)); } -void CefBrowserHostWrapper::RunFileDialog(CefFileDialogMode mode, String^ title, String^ defaultFilePath, IList^ acceptFilters, int selectedAcceptFilter, IRunFileDialogCallback^ callback) +void CefBrowserHostWrapper::RunFileDialog(CefFileDialogMode mode, String^ title, String^ defaultFilePath, IList^ acceptFilters, IRunFileDialogCallback^ callback) { ThrowIfDisposed(); @@ -207,15 +294,14 @@ void CefBrowserHostWrapper::RunFileDialog(CefFileDialogMode mode, String^ title, StringUtils::ToNative(title), StringUtils::ToNative(defaultFilePath), StringUtils::ToNative(acceptFilters), - selectedAcceptFilter, new CefRunFileDialogCallbackAdapter(callback)); } -void CefBrowserHostWrapper::Find(int identifier, String^ searchText, bool forward, bool matchCase, bool findNext) +void CefBrowserHostWrapper::Find(String^ searchText, bool forward, bool matchCase, bool findNext) { ThrowIfDisposed(); - _browserHost->Find(identifier, StringUtils::ToNative(searchText), forward, matchCase, findNext); + _browserHost->Find(StringUtils::ToNative(searchText), forward, matchCase, findNext); } void CefBrowserHostWrapper::StopFinding(bool clearSelection) @@ -236,7 +322,7 @@ void CefBrowserHostWrapper::SendFocusEvent(bool setFocus) { ThrowIfDisposed(); - _browserHost->SendFocusEvent(setFocus); + _browserHost->SetFocus(setFocus); } void CefBrowserHostWrapper::SendKeyEvent(KeyEvent keyEvent) @@ -246,7 +332,7 @@ void CefBrowserHostWrapper::SendKeyEvent(KeyEvent keyEvent) CefKeyEvent nativeKeyEvent; nativeKeyEvent.focus_on_editable_field = keyEvent.FocusOnEditableField == 1; nativeKeyEvent.is_system_key = keyEvent.IsSystemKey == 1; - nativeKeyEvent.modifiers = (uint32)keyEvent.Modifiers; + nativeKeyEvent.modifiers = (uint32_t)keyEvent.Modifiers; nativeKeyEvent.type = (cef_key_event_type_t)keyEvent.Type; nativeKeyEvent.native_key_code = keyEvent.NativeKeyCode; nativeKeyEvent.windows_key_code = keyEvent.WindowsKeyCode; @@ -264,6 +350,7 @@ void CefBrowserHostWrapper::SendKeyEvent(int message, int wParam, int lParam) keyEvent.is_system_key = message == WM_SYSCHAR || message == WM_SYSKEYDOWN || message == WM_SYSKEYUP; + keyEvent.modifiers = GetCefKeyboardModifiers(wParam, lParam); if (message == WM_KEYDOWN || message == WM_SYSKEYDOWN) { @@ -276,8 +363,30 @@ void CefBrowserHostWrapper::SendKeyEvent(int message, int wParam, int lParam) else { keyEvent.type = KEYEVENT_CHAR; + + // mimic alt-gr check behaviour from + // src/ui/events/win/events_win_utils.cc: GetModifiersFromKeyState + if (IsKeyDown(VK_MENU)) + { + // reverse AltGr detection taken from PlatformKeyMap::UsesAltGraph + // instead of checking all combination for ctrl-alt, just check current char + HKL current_layout = ::GetKeyboardLayout(0); + + // https://docs.microsoft.com/en-gb/windows/win32/api/winuser/nf-winuser-vkkeyscanexw + // ... high-order byte contains the shift state, + // which can be a combination of the following flag bits. + // 1 Either SHIFT key is pressed. + // 2 Either CTRL key is pressed. + // 4 Either ALT key is pressed. + SHORT scan_res = ::VkKeyScanExW(wParam, current_layout); + constexpr auto ctrlAlt = (2 | 4); + if (((scan_res >> 8) & ctrlAlt) == ctrlAlt) // ctrl-alt pressed + { + keyEvent.modifiers &= ~(EVENTFLAG_CONTROL_DOWN | EVENTFLAG_ALT_DOWN); + keyEvent.modifiers |= EVENTFLAG_ALTGR_DOWN; + } + } } - keyEvent.modifiers = GetCefKeyboardModifiers(wParam, lParam); _browserHost->SendKeyEvent(keyEvent); } @@ -309,7 +418,7 @@ void CefBrowserHostWrapper::SendMouseWheelEvent(MouseEvent mouseEvent, int delta CefMouseEvent m; m.x = mouseEvent.X; m.y = mouseEvent.Y; - m.modifiers = (uint32)mouseEvent.Modifiers; + m.modifiers = (uint32_t)mouseEvent.Modifiers; _browserHost->SendMouseWheelEvent(m, deltaX, deltaY); } @@ -323,7 +432,7 @@ void CefBrowserHostWrapper::SendTouchEvent(TouchEvent evt) { CefTouchEvent e; e.id = evt.Id; - e.modifiers = (uint32)evt.Modifiers; + e.modifiers = (uint32_t)evt.Modifiers; e.pointer_type = (cef_pointer_type_t)evt.PointerType; e.pressure = evt.Pressure; e.radius_x = evt.RadiusX; @@ -358,14 +467,7 @@ void CefBrowserHostWrapper::Invalidate(PaintElementType type) _browserHost->Invalidate((CefBrowserHost::PaintElementType)type); } -bool CefBrowserHostWrapper::IsBackgroundHost::get() -{ - ThrowIfDisposed(); - - return _browserHost->IsBackgroundHost(); -} - -void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange) +void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange) { ThrowIfDisposed(); @@ -382,6 +484,7 @@ void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::arrayImeSetComposition(StringUtils::ToNative(text), underlinesVector, repRange, selRange); } -void CefBrowserHostWrapper::ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos) +void CefBrowserHostWrapper::ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos) { ThrowIfDisposed(); @@ -434,7 +537,7 @@ void CefBrowserHostWrapper::SendMouseClickEvent(MouseEvent mouseEvent, MouseButt CefMouseEvent m; m.x = mouseEvent.X; m.y = mouseEvent.Y; - m.modifiers = (uint32)mouseEvent.Modifiers; + m.modifiers = (uint32_t)mouseEvent.Modifiers; _browserHost->SendMouseClickEvent(m, (CefBrowserHost::MouseButtonType) mouseButtonType, mouseUp, clickCount); } @@ -446,7 +549,7 @@ void CefBrowserHostWrapper::SendMouseMoveEvent(MouseEvent mouseEvent, bool mouse CefMouseEvent m; m.x = mouseEvent.X; m.y = mouseEvent.Y; - m.modifiers = (uint32)mouseEvent.Modifiers; + m.modifiers = (uint32_t)mouseEvent.Modifiers; _browserHost->SendMouseMoveEvent(m, mouseLeave); } @@ -478,6 +581,8 @@ NavigationEntry^ CefBrowserHostWrapper::GetVisibleNavigationEntry() { ThrowIfDisposed(); + ThrowIfExecutedOnNonCefUiThread(); + auto entry = _browserHost->GetVisibleNavigationEntry(); return TypeConversion::FromNative(entry, true); @@ -511,20 +616,6 @@ void CefBrowserHostWrapper::WindowlessFrameRate::set(int val) _browserHost->SetWindowlessFrameRate(val); } -bool CefBrowserHostWrapper::MouseCursorChangeDisabled::get() -{ - ThrowIfDisposed(); - - return _browserHost->IsMouseCursorChangeDisabled(); -} - -void CefBrowserHostWrapper::MouseCursorChangeDisabled::set(bool val) -{ - ThrowIfDisposed(); - - _browserHost->SetMouseCursorChangeDisabled(val); -} - bool CefBrowserHostWrapper::WindowRenderingDisabled::get() { ThrowIfDisposed(); @@ -574,7 +665,7 @@ IRequestContext^ CefBrowserHostWrapper::RequestContext::get() { ThrowIfDisposed(); - return gcnew CefSharp::RequestContext(_browserHost->GetRequestContext()); + return gcnew CefSharp::Core::RequestContext(_browserHost->GetRequestContext()); } CefMouseEvent CefBrowserHostWrapper::GetCefMouseEvent(MouseEvent mouseEvent) @@ -582,7 +673,7 @@ CefMouseEvent CefBrowserHostWrapper::GetCefMouseEvent(MouseEvent mouseEvent) CefMouseEvent cefMouseEvent; cefMouseEvent.x = mouseEvent.X; cefMouseEvent.y = mouseEvent.Y; - cefMouseEvent.modifiers = (uint32)mouseEvent.Modifiers; + cefMouseEvent.modifiers = (uint32_t)mouseEvent.Modifiers; return cefMouseEvent; } diff --git a/CefSharp.Core/Internals/CefBrowserHostWrapper.h b/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h similarity index 81% rename from CefSharp.Core/Internals/CefBrowserHostWrapper.h rename to CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h index db798841e0..4db8861ca7 100644 --- a/CefSharp.Core/Internals/CefBrowserHostWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h @@ -21,17 +21,18 @@ namespace CefSharp { private: MCefRefPtr _browserHost; + int _lastDevToolsMessageId = 0; double GetZoomLevelOnUI(); internal: - CefBrowserHostWrapper(CefRefPtr &browserHost) : _browserHost(browserHost) + CefBrowserHostWrapper(const CefRefPtr &browserHost) : _browserHost(browserHost) { } !CefBrowserHostWrapper() { - _browserHost = NULL; + _browserHost = nullptr; } ~CefBrowserHostWrapper() @@ -46,9 +47,11 @@ namespace CefSharp virtual void Print(); virtual void PrintToPdf(String^ path, PdfPrintSettings^ settings, IPrintToPdfCallback^ callback); virtual void SetZoomLevel(double zoomLevel); + virtual double GetZoomLevel(); virtual Task^ GetZoomLevelAsync(); virtual IntPtr GetWindowHandle(); virtual void CloseBrowser(bool forceClose); + virtual bool TryCloseBrowser(); virtual void DragTargetDragEnter(IDragData^ dragData, MouseEvent mouseEvent, DragOperationsMask allowedOperations); virtual void DragTargetDragOver(MouseEvent mouseEvent, DragOperationsMask allowedOperations); @@ -69,17 +72,18 @@ namespace CefSharp bool get(); } + virtual bool SendDevToolsMessage(String^ messageAsJson); + virtual int ExecuteDevToolsMethod(int messageId, String^ method, String^ paramsAsJson); + virtual int ExecuteDevToolsMethod(int messageId, String^ method, IDictionary^ paramaters); + virtual IRegistration^ AddDevToolsMessageObserver(IDevToolsMessageObserver^ observer); + virtual int GetNextDevToolsMessageId(); + virtual void AddWordToDictionary(String^ word); virtual void ReplaceMisspelling(String^ word); - virtual property IExtension^ Extension - { - IExtension^ get(); - } - - virtual void RunFileDialog(CefFileDialogMode mode, String^ title, String^ defaultFilePath, IList^ acceptFilters, int selectedAcceptFilter, IRunFileDialogCallback^ callback); + virtual void RunFileDialog(CefFileDialogMode mode, String^ title, String^ defaultFilePath, IList^ acceptFilters, IRunFileDialogCallback^ callback); - virtual void Find(int identifier, String^ searchText, bool forward, bool matchCase, bool findNext); + virtual void Find(String^ searchText, bool forward, bool matchCase, bool findNext); virtual void StopFinding(bool clearSelection); virtual void SetFocus(bool focus); @@ -93,13 +97,8 @@ namespace CefSharp virtual void Invalidate(PaintElementType type); - virtual property bool IsBackgroundHost - { - bool get(); - } - - virtual void ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange); - virtual void ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos); + virtual void ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange); + virtual void ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos); virtual void ImeFinishComposingText(bool keepSelection); virtual void ImeCancelComposition(); @@ -129,12 +128,6 @@ namespace CefSharp void set(int val); } - virtual property bool MouseCursorChangeDisabled - { - bool get(); - void set(bool val); - } - virtual property bool WindowRenderingDisabled { bool get(); diff --git a/CefSharp.Core/Internals/CefSharpBrowserWrapper.cpp b/CefSharp.Core.Runtime/Internals/CefBrowserWrapper.cpp similarity index 59% rename from CefSharp.Core/Internals/CefSharpBrowserWrapper.cpp rename to CefSharp.Core.Runtime/Internals/CefBrowserWrapper.cpp index b078629aad..4d9e2af1bd 100644 --- a/CefSharp.Core/Internals/CefSharpBrowserWrapper.cpp +++ b/CefSharp.Core.Runtime/Internals/CefBrowserWrapper.cpp @@ -5,15 +5,21 @@ #include "Stdafx.h" #include "Internals\CefFrameWrapper.h" -#include "Internals\CefSharpBrowserWrapper.h" +#include "Internals\CefBrowserWrapper.h" #include "Internals\CefBrowserHostWrapper.h" +bool CefBrowserWrapper::IsValid::get() +{ + ThrowIfDisposed(); + return _browser->IsValid(); +} + /// // Returns the browser host object. This method can only be called in the // browser process. /// /*--cef()--*/ -IBrowserHost^ CefSharpBrowserWrapper::GetHost() +IBrowserHost^ CefBrowserWrapper::GetHost() { ThrowIfDisposed(); @@ -29,7 +35,7 @@ IBrowserHost^ CefSharpBrowserWrapper::GetHost() // Returns true if the browser can navigate backwards. /// /*--cef()--*/ -bool CefSharpBrowserWrapper::CanGoBack::get() +bool CefBrowserWrapper::CanGoBack::get() { ThrowIfDisposed(); return _browser->CanGoBack(); @@ -39,7 +45,7 @@ bool CefSharpBrowserWrapper::CanGoBack::get() // Navigate backwards. /// /*--cef()--*/ -void CefSharpBrowserWrapper::GoBack() +void CefBrowserWrapper::GoBack() { ThrowIfDisposed(); _browser->GoBack(); @@ -49,7 +55,7 @@ void CefSharpBrowserWrapper::GoBack() // Returns true if the browser can navigate forwards. /// /*--cef()--*/ -bool CefSharpBrowserWrapper::CanGoForward::get() +bool CefBrowserWrapper::CanGoForward::get() { ThrowIfDisposed(); return _browser->CanGoForward(); @@ -59,7 +65,7 @@ bool CefSharpBrowserWrapper::CanGoForward::get() // Navigate forwards. /// /*--cef()--*/ -void CefSharpBrowserWrapper::GoForward() +void CefBrowserWrapper::GoForward() { ThrowIfDisposed(); _browser->GoForward(); @@ -69,13 +75,13 @@ void CefSharpBrowserWrapper::GoForward() // Returns true if the browser is currently loading. /// /*--cef()--*/ -bool CefSharpBrowserWrapper::IsLoading::get() +bool CefBrowserWrapper::IsLoading::get() { ThrowIfDisposed(); return _browser->IsLoading(); } -void CefSharpBrowserWrapper::CloseBrowser(bool forceClose) +void CefBrowserWrapper::CloseBrowser(bool forceClose) { ThrowIfDisposed(); _browser->GetHost()->CloseBrowser(forceClose); @@ -85,7 +91,7 @@ void CefSharpBrowserWrapper::CloseBrowser(bool forceClose) // Reload the current page. /// /*--cef()--*/ -void CefSharpBrowserWrapper::Reload(bool ignoreCache) +void CefBrowserWrapper::Reload(bool ignoreCache) { ThrowIfDisposed(); @@ -103,7 +109,7 @@ void CefSharpBrowserWrapper::Reload(bool ignoreCache) // Stop loading the page. /// /*--cef()--*/ -void CefSharpBrowserWrapper::StopLoad() +void CefBrowserWrapper::StopLoad() { ThrowIfDisposed(); _browser->StopLoad(); @@ -113,7 +119,7 @@ void CefSharpBrowserWrapper::StopLoad() // Returns the globally unique identifier for this browser. /// /*--cef()--*/ -int CefSharpBrowserWrapper::Identifier::get() +int CefBrowserWrapper::Identifier::get() { ThrowIfDisposed(); return _browser->GetIdentifier(); @@ -124,17 +130,17 @@ int CefSharpBrowserWrapper::Identifier::get() // object. /// /*--cef()--*/ -bool CefSharpBrowserWrapper::IsSame(IBrowser^ that) +bool CefBrowserWrapper::IsSame(IBrowser^ that) { ThrowIfDisposed(); - return _browser->IsSame(dynamic_cast(that)->_browser.get()); + return _browser->IsSame(dynamic_cast(that)->_browser.get()); } /// // Returns true if the window is a popup window. /// /*--cef()--*/ -bool CefSharpBrowserWrapper::IsPopup::get() +bool CefBrowserWrapper::IsPopup::get() { ThrowIfDisposed(); return _browser->IsPopup(); @@ -144,38 +150,53 @@ bool CefSharpBrowserWrapper::IsPopup::get() // Returns true if a document has been loaded in the browser. /// /*--cef()--*/ -bool CefSharpBrowserWrapper::HasDocument::get() +bool CefBrowserWrapper::HasDocument::get() { ThrowIfDisposed(); return _browser->HasDocument(); } -IFrame^ CefSharpBrowserWrapper::MainFrame::get() +IFrame^ CefBrowserWrapper::MainFrame::get() { ThrowIfDisposed(); + auto frame = _browser->GetMainFrame(); - return gcnew CefFrameWrapper(frame); + + if (frame.get()) + { + return gcnew CefFrameWrapper(frame); + } + + return nullptr; } /// // Returns the focused frame for the browser window. /// /*--cef()--*/ -IFrame^ CefSharpBrowserWrapper::FocusedFrame::get() +IFrame^ CefBrowserWrapper::FocusedFrame::get() { ThrowIfDisposed(); - return gcnew CefFrameWrapper(_browser->GetFocusedFrame()); + + auto frame = _browser->GetFocusedFrame(); + + if (frame.get()) + { + return gcnew CefFrameWrapper(frame); + } + + return nullptr; } /// // Returns the frame with the specified identifier, or NULL if not found. /// /*--cef(capi_name=get_frame_byident)--*/ -IFrame^ CefSharpBrowserWrapper::GetFrame(Int64 identifier) +IFrame^ CefBrowserWrapper::GetFrameByIdentifier(String^ identifier) { ThrowIfDisposed(); - auto frame = _browser->GetFrame(identifier); + auto frame = _browser->GetFrameByIdentifier(StringUtils::ToNative(identifier)); if (frame.get()) { @@ -189,11 +210,11 @@ IFrame^ CefSharpBrowserWrapper::GetFrame(Int64 identifier) // Returns the frame with the specified name, or NULL if not found. /// /*--cef(optional_param=name)--*/ -IFrame^ CefSharpBrowserWrapper::GetFrame(String^ name) +IFrame^ CefBrowserWrapper::GetFrameByName(String^ name) { ThrowIfDisposed(); - auto frame = _browser->GetFrame(StringUtils::ToNative(name)); + auto frame = _browser->GetFrameByName(StringUtils::ToNative(name)); if (frame.get()) { @@ -207,26 +228,26 @@ IFrame^ CefSharpBrowserWrapper::GetFrame(String^ name) // Returns the number of frames that currently exist. /// /*--cef()--*/ -int CefSharpBrowserWrapper::GetFrameCount() +int CefBrowserWrapper::GetFrameCount() { ThrowIfDisposed(); - return _browser->GetFrameCount(); + return static_cast(_browser->GetFrameCount()); } /// // Returns the identifiers of all existing frames. /// /*--cef(count_func=identifiers:GetFrameCount)--*/ -List^ CefSharpBrowserWrapper::GetFrameIdentifiers() +List^ CefBrowserWrapper::GetFrameIdentifiers() { ThrowIfDisposed(); - std::vector identifiers; + std::vector identifiers; _browser->GetFrameIdentifiers(identifiers); - List^ results = gcnew List(identifiers.size()); + List^ results = gcnew List(static_cast(identifiers.size())); for (UINT i = 0; i < identifiers.size(); i++) { - results->Add(identifiers[i]); + results->Add(StringUtils::ToClr(identifiers[i])); } return results; } @@ -235,7 +256,7 @@ List^ CefSharpBrowserWrapper::GetFrameIdentifiers() // Returns the names of all existing frames. /// /*--cef()--*/ -List^ CefSharpBrowserWrapper::GetFrameNames() +List^ CefBrowserWrapper::GetFrameNames() { ThrowIfDisposed(); @@ -245,18 +266,25 @@ List^ CefSharpBrowserWrapper::GetFrameNames() return StringUtils::ToClr(names); } -// -// Send a message to the specified |target_process|. Returns true if the -// message was sent successfully. -/// -/*--cef()--*/ -bool CefSharpBrowserWrapper::SendProcessMessage(CefProcessId targetProcess, CefRefPtr message) +IReadOnlyCollection^ CefBrowserWrapper::GetAllFrames() { - ThrowIfDisposed(); - return _browser->SendProcessMessage(targetProcess, message); + std::vector identifiers; + _browser->GetFrameIdentifiers(identifiers); + + auto results = gcnew List(static_cast(identifiers.size())); + for (UINT i = 0; i < identifiers.size(); i++) + { + auto frame = _browser->GetFrameByIdentifier(identifiers[i]); + + if (frame.get()) + { + results->Add(gcnew CefFrameWrapper(frame)); + } + } + return results; } -MCefRefPtr CefSharpBrowserWrapper::Browser::get() +MCefRefPtr CefBrowserWrapper::Browser::get() { return _browser; -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/CefSharpBrowserWrapper.h b/CefSharp.Core.Runtime/Internals/CefBrowserWrapper.h similarity index 85% rename from CefSharp.Core/Internals/CefSharpBrowserWrapper.h rename to CefSharp.Core.Runtime/Internals/CefBrowserWrapper.h index 92479beea1..13ed5dcdb1 100644 --- a/CefSharp.Core/Internals/CefSharpBrowserWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefBrowserWrapper.h @@ -13,27 +13,27 @@ namespace CefSharp { namespace Internals { - private ref class CefSharpBrowserWrapper : public IBrowser, public CefWrapper + private ref class CefBrowserWrapper : public IBrowser, public CefWrapper { private: MCefRefPtr _browser; IBrowserHost^ _browserHost; internal: - CefSharpBrowserWrapper::CefSharpBrowserWrapper(CefRefPtr &browser) + CefBrowserWrapper(const CefRefPtr &browser) : _browser(browser), _browserHost(nullptr) { } - !CefSharpBrowserWrapper() + !CefBrowserWrapper() { // Release the reference. _browser = nullptr; } - ~CefSharpBrowserWrapper() + ~CefBrowserWrapper() { - this->!CefSharpBrowserWrapper(); + this->!CefBrowserWrapper(); delete _browserHost; _browserHost = nullptr; _disposed = true; @@ -45,6 +45,11 @@ namespace CefSharp } public: + virtual property bool IsValid + { + bool get(); + } + /// // Returns the browser host object. This method can only be called in the // browser process. @@ -161,13 +166,13 @@ namespace CefSharp // Returns the frame with the specified identifier, or NULL if not found. /// /*--cef(capi_name=get_frame_byident)--*/ - virtual IFrame^ GetFrame(Int64 identifier); + virtual IFrame^ GetFrameByIdentifier(String^ identifier); /// // Returns the frame with the specified name, or NULL if not found. /// /*--cef(optional_param=name)--*/ - virtual IFrame^ GetFrame(String^ name); + virtual IFrame^ GetFrameByName(String^ name); /// // Returns the number of frames that currently exist. @@ -179,7 +184,7 @@ namespace CefSharp // Returns the identifiers of all existing frames. /// /*--cef(count_func=identifiers:GetFrameCount)--*/ - virtual List^ GetFrameIdentifiers(); + virtual List^ GetFrameIdentifiers(); /// // Returns the names of all existing frames. @@ -187,12 +192,7 @@ namespace CefSharp /*--cef()--*/ virtual List^ GetFrameNames(); - // - // Send a message to the specified |target_process|. Returns true if the - // message was sent successfully. - /// - /*--cef()--*/ - virtual bool SendProcessMessage(CefProcessId targetProcess, CefRefPtr message); + virtual IReadOnlyCollection^ GetAllFrames(); }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/CefCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefCallbackWrapper.h similarity index 96% rename from CefSharp.Core/Internals/CefCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefCallbackWrapper.h index b69a00cd2d..7587f82d3f 100644 --- a/CefSharp.Core/Internals/CefCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefCallbackWrapper.h @@ -27,7 +27,7 @@ namespace CefSharp !CefCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefCallbackWrapper() diff --git a/CefSharp.Core/Internals/CefCertificateCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefCertificateCallbackWrapper.h similarity index 61% rename from CefSharp.Core/Internals/CefCertificateCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefCertificateCallbackWrapper.h index 812c8fa146..2fe2883b46 100644 --- a/CefSharp.Core/Internals/CefCertificateCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefCertificateCallbackWrapper.h @@ -30,7 +30,7 @@ namespace CefSharp !CefCertificateCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefCertificateCallbackWrapper() @@ -46,33 +46,16 @@ namespace CefSharp if (cert == nullptr) { - _callback->Select(NULL); + _callback->Select(nullptr); } else { - auto certSerial = cert->SerialNumber; + auto certThumbprint = cert->Thumbprint; std::vector>::const_iterator it = _certificateList.begin(); for (; it != _certificateList.end(); ++it) { - - // TODO: Need to make this logic of comparing serial number of the certificate (*it) - // with the selected certificate returned by the user selection (cert). - // Better and more performant way would be to read the serial number from - // (*it) and convert it into System::String, so that it can directly compared - // with certSerial. This is how I tried it but the Encoding class garbled up - // the string when converting it from CefRefPtr to System::String - // Try to find a better way to do this - // - //auto serialNum((*it)->GetSerialNumber()); - //auto byteSize = serialNum->GetSize(); - //auto bufferByte = gcnew cli::array(byteSize); - //pin_ptr src = &bufferByte[0]; // pin pointer to first element in arr - //serialNum->GetData(static_cast(src), byteSize, 0); - //UTF8Encoding^ encoding = gcnew UTF8Encoding; - //auto serialStr(encoding->GetString(bufferByte)); - auto bytes((*it)->GetDEREncoded()); auto byteSize = bytes->GetSize(); @@ -81,9 +64,9 @@ namespace CefSharp bytes->GetData(static_cast(src), byteSize, 0); auto newcert = gcnew System::Security::Cryptography::X509Certificates::X509Certificate2(bufferByte); - auto serialStr = newcert->SerialNumber; + auto thumbprintStr = newcert->Thumbprint; - if (certSerial == serialStr) + if (String::Equals(certThumbprint, thumbprintStr, StringComparison::OrdinalIgnoreCase)) { _callback->Select(*it); break; diff --git a/CefSharp.Core/Internals/CefCompletionCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefCompletionCallbackAdapter.h similarity index 88% rename from CefSharp.Core/Internals/CefCompletionCallbackAdapter.h rename to CefSharp.Core.Runtime/Internals/CefCompletionCallbackAdapter.h index d27e8c6b2a..410d11c4b4 100644 --- a/CefSharp.Core/Internals/CefCompletionCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefCompletionCallbackAdapter.h @@ -28,12 +28,12 @@ namespace CefSharp _handler = nullptr; } - void OnComplete() OVERRIDE + void OnComplete() override { _handler->OnComplete(); } - IMPLEMENT_REFCOUNTING(CefCompletionCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefCompletionCallbackAdapter); }; } } diff --git a/CefSharp.Core/Internals/CefContextMenuParamsWrapper.cpp b/CefSharp.Core.Runtime/Internals/CefContextMenuParamsWrapper.cpp similarity index 93% rename from CefSharp.Core/Internals/CefContextMenuParamsWrapper.cpp rename to CefSharp.Core.Runtime/Internals/CefContextMenuParamsWrapper.cpp index bc99421119..fa98e45067 100644 --- a/CefSharp.Core/Internals/CefContextMenuParamsWrapper.cpp +++ b/CefSharp.Core.Runtime/Internals/CefContextMenuParamsWrapper.cpp @@ -111,7 +111,7 @@ namespace CefSharp { ThrowIfDisposed(); - std::vector& dictionarySuggestions = std::vector(); + std::vector dictionarySuggestions; bool result = _wrappedInfo->GetDictionarySuggestions(dictionarySuggestions); return StringUtils::ToClr(dictionarySuggestions); @@ -144,12 +144,5 @@ namespace CefSharp return _wrappedInfo->IsCustomMenu(); } - - bool CefContextMenuParamsWrapper::IsPepperMenu::get() - { - ThrowIfDisposed(); - - return _wrappedInfo->IsPepperMenu(); - } } } diff --git a/CefSharp.Core/Internals/CefContextMenuParamsWrapper.h b/CefSharp.Core.Runtime/Internals/CefContextMenuParamsWrapper.h similarity index 95% rename from CefSharp.Core/Internals/CefContextMenuParamsWrapper.h rename to CefSharp.Core.Runtime/Internals/CefContextMenuParamsWrapper.h index d257b7fe74..0ac01ee114 100644 --- a/CefSharp.Core/Internals/CefContextMenuParamsWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefContextMenuParamsWrapper.h @@ -27,7 +27,7 @@ namespace CefSharp !CefContextMenuParamsWrapper() { - _wrappedInfo = NULL; + _wrappedInfo = nullptr; } ~CefContextMenuParamsWrapper() @@ -57,7 +57,6 @@ namespace CefSharp virtual property bool IsSpellCheckEnabled { bool get(); } virtual property ContextMenuEditState EditStateFlags { ContextMenuEditState get(); } virtual property bool IsCustomMenu { bool get(); } - virtual property bool IsPepperMenu { bool get(); } }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefCookieAccessFilterAdapter.h b/CefSharp.Core.Runtime/Internals/CefCookieAccessFilterAdapter.h new file mode 100644 index 0000000000..943902e949 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefCookieAccessFilterAdapter.h @@ -0,0 +1,82 @@ +// Copyright © 2014 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include\cef_resource_request_handler.h" + +#include "CefResponseWrapper.h" +#include "Request.h" +#include "CefFrameWrapper.h" +#include "CefBrowserWrapper.h" + +using namespace CefSharp::Core; + +namespace CefSharp +{ + namespace Internals + { + private class CefCookieAccessFilterAdapter : public CefCookieAccessFilter + { + private: + gcroot _handler; + gcroot _browserControl; + + public: + CefCookieAccessFilterAdapter(ICookieAccessFilter^ handler, IWebBrowser^ browserControl) + { + _handler = handler; + _browserControl = browserControl; + } + + ~CefCookieAccessFilterAdapter() + { + delete _handler; + _handler = nullptr; + _browserControl = nullptr; + } + + + bool CanSendCookie(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, const CefCookie& cookie) override + { + Request requestWrapper(request); + auto managedCookie = TypeConversion::FromNative(cookie); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + + CefBrowserWrapper browserWrapper(browser); + CefFrameWrapper frameWrapper(frame); + + return _handler->CanSendCookie(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper, managedCookie); + } + + return _handler->CanSendCookie(_browserControl, nullptr, nullptr, %requestWrapper, managedCookie); + } + + bool CanSaveCookie(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response, const CefCookie& cookie) override + { + Request requestWrapper(request); + CefResponseWrapper responseWrapper(response); + auto managedCookie = TypeConversion::FromNative(cookie); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + + CefBrowserWrapper browserWrapper(browser); + CefFrameWrapper frameWrapper(frame); + + return _handler->CanSaveCookie(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper, managedCookie); + } + + return _handler->CanSaveCookie(_browserControl, nullptr, nullptr, %requestWrapper, %responseWrapper, managedCookie); + } + + IMPLEMENT_REFCOUNTINGM(CefCookieAccessFilterAdapter); + }; + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefCookieVisitorAdapter.h b/CefSharp.Core.Runtime/Internals/CefCookieVisitorAdapter.h new file mode 100644 index 0000000000..0a4af572ee --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefCookieVisitorAdapter.h @@ -0,0 +1,43 @@ +// Copyright © 2012 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "TypeConversion.h" +#include "include/cef_cookie.h" + + +namespace CefSharp +{ + namespace Internals + { + private class CefCookieVisitorAdapter : public CefCookieVisitor + { + private: + gcroot _visitor; + + public: + CefCookieVisitorAdapter(ICookieVisitor^ visitor) : + _visitor(visitor) + { + } + + ~CefCookieVisitorAdapter() + { + delete _visitor; + _visitor = nullptr; + } + + virtual bool Visit(const CefCookie& cefCookie, int count, int total, bool& deleteCookie) override + { + auto cookie = TypeConversion::FromNative(cefCookie); + + return _visitor->Visit(cookie, count, total, deleteCookie); + } + + IMPLEMENT_REFCOUNTINGM(CefCookieVisitorAdapter); + }; + } +} diff --git a/CefSharp.Core/Internals/CefDeleteCookiesCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefDeleteCookiesCallbackAdapter.h similarity index 87% rename from CefSharp.Core/Internals/CefDeleteCookiesCallbackAdapter.h rename to CefSharp.Core.Runtime/Internals/CefDeleteCookiesCallbackAdapter.h index 62088a18ed..bf0d2d9ae6 100644 --- a/CefSharp.Core/Internals/CefDeleteCookiesCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefDeleteCookiesCallbackAdapter.h @@ -28,12 +28,12 @@ namespace CefSharp _handler = nullptr; } - void OnComplete(int numDeleted) OVERRIDE + void OnComplete(int numDeleted) override { _handler->OnComplete(numDeleted); } - IMPLEMENT_REFCOUNTING(CefDeleteCookiesCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefDeleteCookiesCallbackAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefDevToolsMessageObserverAdapter.h b/CefSharp.Core.Runtime/Internals/CefDevToolsMessageObserverAdapter.h new file mode 100644 index 0000000000..fea1ff5c23 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefDevToolsMessageObserverAdapter.h @@ -0,0 +1,82 @@ +// Copyright © 2014 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include\cef_callback.h" + +#include "CefBrowserWrapper.h" +#include "StringUtils.h" + +using namespace CefSharp::Callback; +using namespace System::IO; + +namespace CefSharp +{ + namespace Internals + { + private class CefDevToolsMessageObserverAdapter : public CefDevToolsMessageObserver + { + private: + gcroot _handler; + + public: + CefDevToolsMessageObserverAdapter(IDevToolsMessageObserver^ handler) + { + _handler = handler; + } + + ~CefDevToolsMessageObserverAdapter() + { + delete _handler; + _handler = nullptr; + } + + virtual bool OnDevToolsMessage(CefRefPtr browser, const void* message, size_t message_size) + { + CefBrowserWrapper browserWrapper(browser); + UnmanagedMemoryStream messageStream((Byte*)message, (Int64)message_size, (Int64)message_size, FileAccess::Read); + + return _handler->OnDevToolsMessage(%browserWrapper, %messageStream); + } + + virtual void OnDevToolsMethodResult(CefRefPtr browser, + int message_id, + bool success, + const void* result, + size_t result_size) override + { + CefBrowserWrapper browserWrapper(browser); + UnmanagedMemoryStream resultStream((Byte*)result, (Int64)result_size, (Int64)result_size, FileAccess::Read); + + _handler->OnDevToolsMethodResult(%browserWrapper, message_id, success, %resultStream); + } + + virtual void OnDevToolsEvent(CefRefPtr browser, const CefString& method, const void* params, size_t params_size) override + { + CefBrowserWrapper browserWrapper(browser); + UnmanagedMemoryStream paramsStream((Byte*)params, (Int64)params_size, (Int64)params_size, FileAccess::Read); + + _handler->OnDevToolsEvent(%browserWrapper, StringUtils::ToClr(method), %paramsStream); + } + + void OnDevToolsAgentAttached(CefRefPtr browser) override + { + CefBrowserWrapper browserWrapper(browser); + + _handler->OnDevToolsAgentAttached(%browserWrapper); + } + + void OnDevToolsAgentDetached(CefRefPtr browser) override + { + CefBrowserWrapper browserWrapper(browser); + + _handler->OnDevToolsAgentDetached(%browserWrapper); + } + + IMPLEMENT_REFCOUNTINGM(CefDevToolsMessageObserverAdapter); + }; + } +} diff --git a/CefSharp.Core/Internals/CefDownloadItemCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefDownloadItemCallbackWrapper.h similarity index 83% rename from CefSharp.Core/Internals/CefDownloadItemCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefDownloadItemCallbackWrapper.h index bc8a141fee..6a6e594e17 100644 --- a/CefSharp.Core/Internals/CefDownloadItemCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefDownloadItemCallbackWrapper.h @@ -27,7 +27,7 @@ namespace CefSharp !CefDownloadItemCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefDownloadItemCallbackWrapper() @@ -50,18 +50,18 @@ namespace CefSharp { ThrowIfDisposed(); + //Only free the callback when cancel called + //Need to be able to pause/resume #3145 _callback->Pause(); - - delete this; } virtual void Resume() { ThrowIfDisposed(); + //Only free the callback when cancel called + //Need to be able to pause/resume #3145 _callback->Resume(); - - _callback = NULL; } }; } diff --git a/CefSharp.Core/Internals/CefFileDialogCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefFileDialogCallbackWrapper.h similarity index 84% rename from CefSharp.Core/Internals/CefFileDialogCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefFileDialogCallbackWrapper.h index e94534a589..9b33854acc 100644 --- a/CefSharp.Core/Internals/CefFileDialogCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefFileDialogCallbackWrapper.h @@ -26,7 +26,7 @@ namespace CefSharp !CefFileDialogCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefFileDialogCallbackWrapper() @@ -36,11 +36,11 @@ namespace CefSharp _disposed = true; } - virtual void Continue(int selectedAcceptFilter, List^ filePaths) + virtual void Continue(List^ filePaths) { ThrowIfDisposed(); - _callback->Continue(selectedAcceptFilter, StringUtils::ToNative(filePaths)); + _callback->Continue(StringUtils::ToNative(filePaths)); delete this; } diff --git a/CefSharp.Core/Internals/CefFrameWrapper.cpp b/CefSharp.Core.Runtime/Internals/CefFrameWrapper.cpp similarity index 73% rename from CefSharp.Core/Internals/CefFrameWrapper.cpp rename to CefSharp.Core.Runtime/Internals/CefFrameWrapper.cpp index 9351f70b7c..e852a83816 100644 --- a/CefSharp.Core/Internals/CefFrameWrapper.cpp +++ b/CefSharp.Core.Runtime/Internals/CefFrameWrapper.cpp @@ -5,11 +5,19 @@ #include "Stdafx.h" #include -#include "Internals\CefSharpBrowserWrapper.h" -#include "Internals\CefRequestWrapper.h" +#include "UrlRequest.h" +#include "Request.h" +#include "Internals\CefBrowserWrapper.h" #include "Internals\CefFrameWrapper.h" -#include "Internals\StringVisitor.h" +#include "Internals\CefStringVisitorAdapter.h" #include "Internals\ClientAdapter.h" +#include "Internals\Serialization\Primitives.h" +#include "Internals\Messaging\Messages.h" +#include "Internals\CefURLRequestClientAdapter.h" + +using namespace CefSharp::Core; +using namespace CefSharp::Internals::Messaging; +using namespace CefSharp::Internals::Serialization; /// // True if this object is currently attached to a valid frame. @@ -131,7 +139,7 @@ Task^ CefFrameWrapper::GetSourceAsync() ThrowIfFrameInvalid(); auto taskStringVisitor = gcnew TaskStringVisitor(); - _frame->GetSource(new StringVisitor(taskStringVisitor)); + _frame->GetSource(new CefStringVisitorAdapter(taskStringVisitor)); return taskStringVisitor->Task; } @@ -145,7 +153,7 @@ void CefFrameWrapper::GetSource(IStringVisitor^ visitor) ThrowIfDisposed(); ThrowIfFrameInvalid(); - _frame->GetSource(new StringVisitor(visitor)); + _frame->GetSource(new CefStringVisitorAdapter(visitor)); } /// @@ -159,7 +167,7 @@ Task^ CefFrameWrapper::GetTextAsync() ThrowIfFrameInvalid(); auto taskStringVisitor = gcnew TaskStringVisitor(); - _frame->GetText(new StringVisitor(taskStringVisitor)); + _frame->GetText(new CefStringVisitorAdapter(taskStringVisitor)); return taskStringVisitor->Task; } @@ -173,7 +181,7 @@ void CefFrameWrapper::GetText(IStringVisitor^ visitor) ThrowIfDisposed(); ThrowIfFrameInvalid(); - _frame->GetText(new StringVisitor(visitor)); + _frame->GetText(new CefStringVisitorAdapter(visitor)); } @@ -186,7 +194,7 @@ void CefFrameWrapper::LoadRequest(IRequest^ request) ThrowIfDisposed(); ThrowIfFrameInvalid(); - auto requestWrapper = (CefRequestWrapper^)request; + auto requestWrapper = (Request^)request->UnWrap(); _frame->LoadRequest(requestWrapper); } @@ -202,20 +210,6 @@ void CefFrameWrapper::LoadUrl(String^ url) _frame->LoadURL(StringUtils::ToNative(url)); } -/// -// Load the contents of |html| with the specified dummy |url|. |url| -// should have a standard scheme (for example, http scheme) or behaviors like -// link clicks and web security restrictions may not behave as expected. -/// -/*--cef()--*/ -void CefFrameWrapper::LoadStringForUrl(String^ html, String^ url) -{ - ThrowIfDisposed(); - ThrowIfFrameInvalid(); - - _frame->LoadString(StringUtils::ToNative(html), StringUtils::ToNative(url)); -} - /// // Execute a string of JavaScript code in this frame. The |script_url| // parameter is the URL where the script in question can be found, if any. @@ -232,7 +226,7 @@ void CefFrameWrapper::ExecuteJavaScriptAsync(String^ code, String^ scriptUrl, in _frame->ExecuteJavaScript(StringUtils::ToNative(code), StringUtils::ToNative(scriptUrl), startLine); } -Task^ CefFrameWrapper::EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable timeout) +Task^ CefFrameWrapper::EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable timeout, bool useImmediatelyInvokedFuncExpression) { ThrowIfDisposed(); ThrowIfFrameInvalid(); @@ -240,9 +234,34 @@ Task^ CefFrameWrapper::EvaluateScriptAsync(String^ script, auto browser = _frame->GetBrowser(); auto host = browser->GetHost(); + //If we're unable to get the underlying browser/browserhost then return null + if (!browser.get() || !host.get()) + { + return Task::FromException(gcnew InvalidOperationException("Browser host not available")); + } + auto client = static_cast(host->GetClient().get()); - return client->EvaluateScriptAsync(browser->GetIdentifier(), browser->IsPopup(), _frame->GetIdentifier(), script, scriptUrl, startLine, timeout); + auto pendingTaskRepository = client->GetPendingTaskRepository(); + + //create a new taskcompletionsource + auto idAndComplectionSource = pendingTaskRepository->CreatePendingTask(Identifier, timeout); + + if (useImmediatelyInvokedFuncExpression) + { + script = "(function() { let cefSharpInternalCallbackId = " + idAndComplectionSource.Key + "; " + script + " })();"; + } + + auto message = CefProcessMessage::Create(kEvaluateJavascriptRequest); + auto argList = message->GetArgumentList(); + SetInt64(argList, 0, idAndComplectionSource.Key); + argList->SetString(1, StringUtils::ToNative(script)); + argList->SetString(2, StringUtils::ToNative(scriptUrl)); + argList->SetInt(3, startLine); + + _frame->SendProcessMessage(CefProcessId::PID_RENDERER, message); + + return idAndComplectionSource.Value->Task; } /// @@ -252,7 +271,6 @@ Task^ CefFrameWrapper::EvaluateScriptAsync(String^ script, bool CefFrameWrapper::IsMain::get() { ThrowIfDisposed(); - ThrowIfFrameInvalid(); return _frame->IsMain(); } @@ -289,12 +307,11 @@ String^ CefFrameWrapper::Name::get() // Returns the globally unique identifier for this frame. /// /*--cef()--*/ -Int64 CefFrameWrapper::Identifier::get() +String^ CefFrameWrapper::Identifier::get() { ThrowIfDisposed(); - ThrowIfFrameInvalid(); - return _frame->GetIdentifier(); + return StringUtils::ToClr(_frame->GetIdentifier()); } /// @@ -366,7 +383,7 @@ IBrowser^ CefFrameWrapper::Browser::get() return _owningBrowser; } - _owningBrowser = gcnew CefSharpBrowserWrapper(_frame->GetBrowser()); + _owningBrowser = gcnew CefBrowserWrapper(_frame->GetBrowser()); return _owningBrowser; } @@ -379,7 +396,28 @@ IRequest^ CefFrameWrapper::CreateRequest(bool initializePostData) request->SetPostData(CefPostData::Create()); } - return gcnew CefRequestWrapper(request); + return gcnew Request(request); +} + +IUrlRequest^ CefFrameWrapper::CreateUrlRequest(IRequest^ request, IUrlRequestClient^ client) +{ + ThrowIfDisposed(); + + if (request == nullptr) + { + throw gcnew ArgumentNullException("request"); + } + + if (client == nullptr) + { + throw gcnew ArgumentNullException("client"); + } + + auto urlRequest = _frame->CreateURLRequest( + (Request^)request->UnWrap(), + new CefUrlRequestClientAdapter(client)); + + return gcnew UrlRequest(urlRequest); } void CefFrameWrapper::ThrowIfFrameInvalid() @@ -388,4 +426,4 @@ void CefFrameWrapper::ThrowIfFrameInvalid() { throw gcnew Exception(L"The underlying frame is no longer valid - please check the IsValid property before calling!"); } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/CefFrameWrapper.h b/CefSharp.Core.Runtime/Internals/CefFrameWrapper.h similarity index 81% rename from CefSharp.Core/Internals/CefFrameWrapper.h rename to CefSharp.Core.Runtime/Internals/CefFrameWrapper.h index b79454d820..3493e3bdd2 100644 --- a/CefSharp.Core/Internals/CefFrameWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefFrameWrapper.h @@ -32,7 +32,7 @@ namespace CefSharp Object^ _syncRoot; internal: - CefFrameWrapper::CefFrameWrapper(CefRefPtr &frame) + CefFrameWrapper(const CefRefPtr &frame) : _frame(frame), _parentFrame(nullptr), _owningBrowser(nullptr), _syncRoot(gcnew Object()) { @@ -40,7 +40,7 @@ namespace CefSharp !CefFrameWrapper() { - _frame = NULL; + _frame = nullptr; } ~CefFrameWrapper() @@ -155,14 +155,6 @@ namespace CefSharp /*--cef()--*/ virtual void LoadUrl(String^ url); - /// - // Load the contents of |html| with the specified dummy |url|. |url| - // should have a standard scheme (for example, http scheme) or behaviors like - // link clicks and web security restrictions may not behave as expected. - /// - /*--cef()--*/ - virtual void LoadStringForUrl(String^ html, String^ url); - /// // Execute a string of JavaScript code in this frame. The |script_url| // parameter is the URL where the script in question can be found, if any. @@ -173,7 +165,7 @@ namespace CefSharp /*--cef(optional_param=script_url)--*/ virtual void ExecuteJavaScriptAsync(String^ code, String^ scriptUrl, int startLine); - virtual Task^ EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable timeout); + virtual Task^ EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable timeout, bool useImmediatelyInvokedFuncExpression); /// // Returns true if this is the main (top-level) frame. @@ -210,9 +202,9 @@ namespace CefSharp // Returns the globally unique identifier for this frame. /// /*--cef()--*/ - virtual property Int64 Identifier + virtual property String^ Identifier { - Int64 get(); + String^ get(); } /// @@ -255,6 +247,30 @@ namespace CefSharp virtual IRequest^ CreateRequest(bool initializePostData); + /// + // Create a new URL request that will be treated as originating from this + // frame and the associated browser. This request may be intercepted by the + // client via CefResourceRequestHandler or CefSchemeHandlerFactory. Use + // CefURLRequest::Create instead if you do not want the request to have this + // association, in which case it may be handled differently (see documentation + // on that method). Requests may originate from both the browser process and + // the render process. + // + // For requests originating from the browser process: + // - POST data may only contain a single element of type PDE_TYPE_FILE or + // PDE_TYPE_BYTES. + // For requests originating from the render process: + // - POST data may only contain a single element of type PDE_TYPE_BYTES. + // - If the response contains Content-Disposition or Mime-Type header values + // that would not normally be rendered then the response may receive + // special handling inside the browser (for example, via the file download + // code path instead of the URL request code path). + // + // The |request| object will be marked as read-only after calling this method. + /// + /*--cef()--*/ + virtual IUrlRequest^ CreateUrlRequest(IRequest^ request, IUrlRequestClient^ client); + void ThrowIfFrameInvalid(); }; } diff --git a/CefSharp.Core/Internals/CefImageWrapper.h b/CefSharp.Core.Runtime/Internals/CefImageWrapper.h similarity index 98% rename from CefSharp.Core/Internals/CefImageWrapper.h rename to CefSharp.Core.Runtime/Internals/CefImageWrapper.h index b8f6f118b3..4358d841c4 100644 --- a/CefSharp.Core/Internals/CefImageWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefImageWrapper.h @@ -21,14 +21,14 @@ namespace CefSharp internal: MCefRefPtr _image; - CefImageWrapper::CefImageWrapper(CefRefPtr &image) + CefImageWrapper(const CefRefPtr &image) : _image(image) { } !CefImageWrapper() { - _image = NULL; + _image = nullptr; } ~CefImageWrapper() diff --git a/CefSharp.Core/Internals/CefJSDialogCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefJSDialogCallbackWrapper.h similarity index 97% rename from CefSharp.Core/Internals/CefJSDialogCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefJSDialogCallbackWrapper.h index 4867fde6ef..6e541974e0 100644 --- a/CefSharp.Core/Internals/CefJSDialogCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefJSDialogCallbackWrapper.h @@ -23,7 +23,7 @@ namespace CefSharp !CefJSDialogCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefJSDialogCallbackWrapper() diff --git a/CefSharp.Core.Runtime/Internals/CefMediaAccessCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefMediaAccessCallbackWrapper.h new file mode 100644 index 0000000000..718d60ac3b --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefMediaAccessCallbackWrapper.h @@ -0,0 +1,58 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_permission_handler.h" +#include "CefWrapper.h" + +namespace CefSharp +{ + namespace Internals + { + private ref class CefMediaAccessCallbackWrapper : public IMediaAccessCallback, public CefWrapper + { + private: + MCefRefPtr _callback; + public: + CefMediaAccessCallbackWrapper(CefRefPtr& callback) : + _callback(callback) + { + + } + + !CefMediaAccessCallbackWrapper() + { + _callback = nullptr; + } + + ~CefMediaAccessCallbackWrapper() + { + this->!CefMediaAccessCallbackWrapper(); + + _disposed = true; + } + + virtual void Cancel() + { + ThrowIfDisposed(); + + _callback->Cancel(); + + delete this; + } + + virtual void Continue(MediaAccessPermissionType allowedPermissions) + { + ThrowIfDisposed(); + + _callback->Continue(static_cast(allowedPermissions)); + + delete this; + } + }; + } +} diff --git a/CefSharp.Core/Internals/CefMenuModelWrapper.h b/CefSharp.Core.Runtime/Internals/CefMenuModelWrapper.h similarity index 99% rename from CefSharp.Core/Internals/CefMenuModelWrapper.h rename to CefSharp.Core.Runtime/Internals/CefMenuModelWrapper.h index a4b0b4df18..72c4c1911d 100644 --- a/CefSharp.Core/Internals/CefMenuModelWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefMenuModelWrapper.h @@ -28,7 +28,7 @@ namespace CefSharp !CefMenuModelWrapper() { - _menu = NULL; + _menu = nullptr; } ~CefMenuModelWrapper() diff --git a/CefSharp.Core/Internals/CefNavigationEntryVisitorAdapter.h b/CefSharp.Core.Runtime/Internals/CefNavigationEntryVisitorAdapter.h similarity index 88% rename from CefSharp.Core/Internals/CefNavigationEntryVisitorAdapter.h rename to CefSharp.Core.Runtime/Internals/CefNavigationEntryVisitorAdapter.h index 5d5bd0741f..8a125556e7 100644 --- a/CefSharp.Core/Internals/CefNavigationEntryVisitorAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefNavigationEntryVisitorAdapter.h @@ -6,6 +6,7 @@ #include "Stdafx.h" #include "include\cef_browser.h" +#include "Internals\TypeConversion.h" namespace CefSharp { @@ -31,14 +32,14 @@ namespace CefSharp bool Visit(CefRefPtr entry, bool current, int index, - int total) OVERRIDE + int total) override { auto navEntry = TypeConversion::FromNative(entry, current); return _handler->Visit(navEntry, current, index, total); } - IMPLEMENT_REFCOUNTING(CefNavigationEntryVisitorAdapter); + IMPLEMENT_REFCOUNTINGM(CefNavigationEntryVisitorAdapter); }; } } diff --git a/CefSharp.Core/Internals/CefPdfPrintCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefPdfPrintCallbackWrapper.h similarity index 92% rename from CefSharp.Core/Internals/CefPdfPrintCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefPdfPrintCallbackWrapper.h index 07108a3277..fdbdd47132 100644 --- a/CefSharp.Core/Internals/CefPdfPrintCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefPdfPrintCallbackWrapper.h @@ -29,7 +29,7 @@ namespace CefSharp _callback = nullptr; } - virtual void OnPdfPrintFinished(const CefString& path, bool ok) OVERRIDE + virtual void OnPdfPrintFinished(const CefString& path, bool ok) override { if (static_cast(_callback) != nullptr) { @@ -37,7 +37,7 @@ namespace CefSharp } } - IMPLEMENT_REFCOUNTING(CefPdfPrintCallbackWrapper); + IMPLEMENT_REFCOUNTINGM(CefPdfPrintCallbackWrapper); }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core.Runtime/Internals/CefPermissionPromptCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefPermissionPromptCallbackWrapper.h new file mode 100644 index 0000000000..108ce39bd7 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefPermissionPromptCallbackWrapper.h @@ -0,0 +1,49 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_permission_handler.h" +#include "CefWrapper.h" + +namespace CefSharp +{ + namespace Internals + { + private ref class CefPermissionPromptCallbackWrapper : public IPermissionPromptCallback, public CefWrapper + { + private: + MCefRefPtr _callback; + public: + CefPermissionPromptCallbackWrapper(CefRefPtr &callback): + _callback(callback) + { + + } + + !CefPermissionPromptCallbackWrapper() + { + _callback = nullptr; + } + + ~CefPermissionPromptCallbackWrapper() + { + this->!CefPermissionPromptCallbackWrapper(); + + _disposed = true; + } + + virtual void Continue(PermissionRequestResult result) + { + ThrowIfDisposed(); + + _callback->Continue(static_cast(result)); + + delete this; + } + }; + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefRefCountManaged.cpp b/CefSharp.Core.Runtime/Internals/CefRefCountManaged.cpp new file mode 100644 index 0000000000..283b0e6321 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefRefCountManaged.cpp @@ -0,0 +1,2 @@ +#include "stdafx.h" +#include "CefRefCountManaged.h" diff --git a/CefSharp.Core.Runtime/Internals/CefRefCountManaged.h b/CefSharp.Core.Runtime/Internals/CefRefCountManaged.h new file mode 100644 index 0000000000..7788376541 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefRefCountManaged.h @@ -0,0 +1,86 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#ifndef CEFSHARP_CORE_CEFREFCOUNTEDMANAGED_H +#define CEFSHARP_CORE_CEFREFCOUNTEDMANAGED_H +#pragma once + +#include + +#include "include\base\cef_macros.h" + +class CefRefCountManaged +{ +public: + CefRefCountManaged() : ref_count_(0) + { + } + + /// + // Increment the reference count. + /// + void AddRef() const + { + InterlockedIncrement(&ref_count_); + } + + /// + // Decrement the reference count. Returns true if the reference count is 0. + /// + bool Release() const + { + LONG res = InterlockedDecrement(&ref_count_); + + return res == 0; + } + + /// + // Returns true if the reference count is 1. + /// + bool HasOneRef() const + { + LONG res = InterlockedCompareExchange(&ref_count_, 0, 0); + + return res == 1; + } + + /// + // Returns true if the reference count is at least 1. + /// + bool HasAtLeastOneRef() const + { + LONG res = InterlockedCompareExchange(&ref_count_, 0, 0); + + return res > 0; + } + +private: + mutable volatile LONG ref_count_; + DISALLOW_COPY_AND_ASSIGN(CefRefCountManaged); +}; + + +/// +// Macro that provides a reference counting implementation for classes extending +// CefBase. +/// +#define IMPLEMENT_REFCOUNTINGM(ClassName) \ + public: \ + void AddRef() const override { ref_count_.AddRef(); } \ + bool Release() const override { \ + if (ref_count_.Release()) { \ + delete static_cast(this); \ + return true; \ + } \ + return false; \ + } \ + bool HasOneRef() const override { return ref_count_.HasOneRef(); } \ + bool HasAtLeastOneRef() const override { \ + return ref_count_.HasAtLeastOneRef(); \ + } \ + \ + private: \ + CefRefCountManaged ref_count_ + +#endif // CEFSHARP_CORE_CEFREFCOUNTEDMANAGED_H diff --git a/CefSharp.Core.Runtime/Internals/CefRegistrationWrapper.h b/CefSharp.Core.Runtime/Internals/CefRegistrationWrapper.h new file mode 100644 index 0000000000..b2d0f19e2b --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefRegistrationWrapper.h @@ -0,0 +1,41 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_registration.h" +#include "CefWrapper.h" + +namespace CefSharp +{ + namespace Internals + { + private ref class CefRegistrationWrapper : public IRegistration, public CefWrapper + { + private: + MCefRefPtr _callback; + + public: + CefRegistrationWrapper(CefRefPtr &callback) + : _callback(callback) + { + + } + + !CefRegistrationWrapper() + { + _callback = nullptr; + } + + ~CefRegistrationWrapper() + { + this->!CefRegistrationWrapper(); + + _disposed = true; + } + }; + } +} diff --git a/CefSharp.Core/Internals/CefRequestCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefRequestCallbackWrapper.h similarity index 78% rename from CefSharp.Core/Internals/CefRequestCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefRequestCallbackWrapper.h index c2f12d0b0c..17b52a6043 100644 --- a/CefSharp.Core/Internals/CefRequestCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefRequestCallbackWrapper.h @@ -14,18 +14,18 @@ namespace CefSharp private ref class CefRequestCallbackWrapper : public IRequestCallback, public CefWrapper { private: - MCefRefPtr _callback; + MCefRefPtr _callback; IFrame^ _frame; IRequest^ _request; internal: - CefRequestCallbackWrapper(CefRefPtr &callback) + CefRequestCallbackWrapper(CefRefPtr &callback) : _callback(callback), _frame(nullptr), _request(nullptr) { } CefRequestCallbackWrapper( - CefRefPtr &callback, + CefRefPtr &callback, IFrame^ frame, IRequest^ request) : _callback(callback), _frame(frame), _request(request) @@ -34,7 +34,7 @@ namespace CefSharp !CefRequestCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefRequestCallbackWrapper() @@ -53,7 +53,14 @@ namespace CefSharp { ThrowIfDisposed(); - _callback->Continue(allow); + if (allow) + { + _callback->Continue(); + } + else + { + _callback->Cancel(); + } delete this; } diff --git a/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.cpp b/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.cpp new file mode 100644 index 0000000000..bb474c8fd3 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.cpp @@ -0,0 +1,64 @@ +// Copyright © 2018 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#include "Stdafx.h" + +#include "CefRequestContextHandlerAdapter.h" +#include "CookieManager.h" +#include "Request.h" +#include "RequestContext.h" +#include "Internals\ReportUnhandledExceptions.h" +#include "Internals\TypeConversion.h" +#include "Internals\CefBrowserWrapper.h" +#include "Internals\CefFrameWrapper.h" +#include "Internals\CefResourceRequestHandlerAdapter.h" + +using namespace CefSharp::Core; + +namespace CefSharp +{ + namespace Internals + { + void CefRequestContextHandlerAdapter::OnRequestContextInitialized(CefRefPtr requestContext) + { + if (!Object::ReferenceEquals(_requestContextHandler, nullptr)) + { + RequestContext ctx(requestContext); + + _requestContextHandler->OnRequestContextInitialized(%ctx); + } + } + + CefRefPtr CefRequestContextHandlerAdapter::GetResourceRequestHandler( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + bool is_navigation, + bool is_download, + const CefString& request_initiator, + bool& disable_default_handling) + { + if (Object::ReferenceEquals(_requestContextHandler, nullptr)) + { + + return nullptr; + } + + CefBrowserWrapper browserWrapper(browser); + CefFrameWrapper frameWrapper(frame); + Request requestWrapper(request); + + auto handler = _requestContextHandler->GetResourceRequestHandler(%browserWrapper, %frameWrapper, %requestWrapper, is_navigation, is_download, StringUtils::ToClr(request_initiator), disable_default_handling); + + if (Object::ReferenceEquals(handler, nullptr)) + { + return nullptr; + } + + //CefRequestContext is not associated with a specific browser + //so browserControl param is always nullptr. + return new CefResourceRequestHandlerAdapter(nullptr, handler); + } + } +} diff --git a/CefSharp.Core/Internals/CefRequestContextHandlerAdapter.h b/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.h similarity index 68% rename from CefSharp.Core/Internals/CefRequestContextHandlerAdapter.h rename to CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.h index 8b17ada5e8..ffd749318f 100644 --- a/CefSharp.Core/Internals/CefRequestContextHandlerAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.h @@ -31,18 +31,18 @@ namespace CefSharp _requestContextHandler = nullptr; } - virtual CefRefPtr GetCookieManager() OVERRIDE; - - virtual bool OnBeforePluginLoad(const CefString& mime_type, - const CefString& plugin_url, - bool is_main_frame, - const CefString& top_origin_url, - CefRefPtr plugin_info, - CefRequestContextHandler::PluginPolicy* plugin_policy) OVERRIDE; - - virtual void OnRequestContextInitialized(CefRefPtr requestContext) OVERRIDE; - - IMPLEMENT_REFCOUNTING(CefRequestContextHandlerAdapter); + virtual void OnRequestContextInitialized(CefRefPtr requestContext) override; + + virtual CefRefPtr GetResourceRequestHandler( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + bool is_navigation, + bool is_download, + const CefString& request_initiator, + bool& disable_default_handling) override; + + IMPLEMENT_REFCOUNTINGM(CefRequestContextHandlerAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefResolveCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefResolveCallbackAdapter.h new file mode 100644 index 0000000000..f3cf3c76e9 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefResolveCallbackAdapter.h @@ -0,0 +1,39 @@ +// Copyright © 2016 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include/cef_request_context.h" + +namespace CefSharp +{ + namespace Internals + { + private class CefResolveCallbackAdapter : public CefResolveCallback + { + private: + gcroot _handler; + + public: + CefResolveCallbackAdapter(IResolveCallback^ handler) + { + _handler = handler; + } + + ~CefResolveCallbackAdapter() + { + delete _handler; + _handler = nullptr; + } + + void OnResolveCompleted(cef_errorcode_t result, const std::vector& resolvedIps) override + { + _handler->OnResolveCompleted((CefErrorCode)result, StringUtils::ToClr(resolvedIps)); + } + + IMPLEMENT_REFCOUNTINGM(CefResolveCallbackAdapter); + }; + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.cpp b/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.cpp new file mode 100644 index 0000000000..d814b1f722 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.cpp @@ -0,0 +1,83 @@ +// Copyright © 2010 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#include "Stdafx.h" + +#include "Request.h" +#include "CefResourceHandlerAdapter.h" +#include "Internals/CefResponseWrapper.h" +#include "Internals/CefCallbackWrapper.h" +#include "Internals/CefResourceReadCallbackWrapper.h" +#include "Internals/CefResourceSkipCallbackWrapper.h" +#include "Internals/TypeConversion.h" + +using namespace System::Runtime::InteropServices; +using namespace System::IO; + +using namespace CefSharp::Core; + +namespace CefSharp +{ + namespace Internals + { + bool CefResourceHandlerAdapter::Open(CefRefPtr request, bool& handleRequest, CefRefPtr callback) + { + auto callbackWrapper = gcnew CefCallbackWrapper(callback); + _request = gcnew Request(request); + + return _handler->Open(_request, handleRequest, callbackWrapper); + } + + void CefResourceHandlerAdapter::GetResponseHeaders(CefRefPtr response, int64_t& response_length, CefString& redirectUrl) + { + String^ newRedirectUrl; + + CefResponseWrapper responseWrapper(response); + + _handler->GetResponseHeaders(% responseWrapper, response_length, newRedirectUrl); + + redirectUrl = StringUtils::ToNative(newRedirectUrl); + } + + bool CefResourceHandlerAdapter::Skip(int64_t bytesToSkip, int64_t& bytesSkipped, CefRefPtr callback) + { + auto callbackWrapper = gcnew CefResourceSkipCallbackWrapper(callback); + + return _handler->Skip(bytesToSkip, bytesSkipped, callbackWrapper); + } + + bool CefResourceHandlerAdapter::Read(void* dataOut, int bytesToRead, int& bytesRead, CefRefPtr callback) + { + auto writeStream = gcnew UnmanagedMemoryStream((Byte*)dataOut, (Int64)bytesToRead, (Int64)bytesToRead, FileAccess::Write); + auto callbackWrapper = gcnew CefResourceReadCallbackWrapper(callback); + + return _handler->Read(writeStream, bytesRead, callbackWrapper); + } + + void CefResourceHandlerAdapter::Cancel() + { + _handler->Cancel(); + + delete _request; + _request = nullptr; + } + + //Deprecated + bool CefResourceHandlerAdapter::ProcessRequest(CefRefPtr request, CefRefPtr callback) + { + auto callbackWrapper = gcnew CefCallbackWrapper(callback); + _request = gcnew Request(request); + + return _handler->ProcessRequest(_request, callbackWrapper); + } + + bool CefResourceHandlerAdapter::ReadResponse(void* dataOut, int bytesToRead, int& bytesRead, CefRefPtr callback) + { + auto writeStream = gcnew UnmanagedMemoryStream((Byte*)dataOut, (Int64)bytesToRead, (Int64)bytesToRead, FileAccess::Write); + auto callbackWrapper = gcnew CefCallbackWrapper(callback); + + return _handler->ReadResponse(writeStream, bytesRead, callbackWrapper); + } + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.h b/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.h new file mode 100644 index 0000000000..6789c69b19 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.h @@ -0,0 +1,50 @@ +// Copyright © 2010 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include/cef_scheme.h" + +using namespace System::IO; +using namespace System::Collections::Specialized; + +namespace CefSharp +{ + namespace Internals + { + private class CefResourceHandlerAdapter : public CefResourceHandler + { + private: + gcroot _handler; + gcroot _request; + public: + CefResourceHandlerAdapter(IResourceHandler^ handler) + : _handler(handler) + { + } + + ~CefResourceHandlerAdapter() + { + delete _handler; + _handler = nullptr; + + delete _request; + _request = nullptr; + } + + virtual bool Open(CefRefPtr request, bool& handle_request, CefRefPtr callback) override; + virtual void GetResponseHeaders(CefRefPtr response, int64_t& response_length, CefString& redirectUrl) override; + virtual bool Skip(int64_t bytesToSkip, int64_t& bytesSkipped, CefRefPtr callback) override; + virtual bool Read(void* dataOut, int bytesToRead, int& bytesRead, CefRefPtr callback) override; + virtual void Cancel() override; + + //Depricated + virtual bool ProcessRequest(CefRefPtr request, CefRefPtr callback) override; + virtual bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr callback) override; + + IMPLEMENT_REFCOUNTINGM(CefResourceHandlerAdapter); + }; + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefResourceReadCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefResourceReadCallbackWrapper.h new file mode 100644 index 0000000000..5b1be89f84 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefResourceReadCallbackWrapper.h @@ -0,0 +1,52 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_resource_handler.h" +#include "CefWrapper.h" + +using namespace CefSharp::Callback; + +namespace CefSharp +{ + namespace Internals + { + private ref class CefResourceReadCallbackWrapper : public IResourceReadCallback, public CefWrapper + { + private: + MCefRefPtr _callback; + + public: + CefResourceReadCallbackWrapper(CefRefPtr &callback) : + _callback(callback) + { + + } + + !CefResourceReadCallbackWrapper() + { + _callback = nullptr; + } + + ~CefResourceReadCallbackWrapper() + { + this->!CefResourceReadCallbackWrapper(); + + _disposed = true; + } + + virtual void Continue(int bytesRead) + { + ThrowIfDisposed(); + + _callback->Continue(bytesRead); + + delete this; + } + }; + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefResourceRequestHandlerAdapter.h b/CefSharp.Core.Runtime/Internals/CefResourceRequestHandlerAdapter.h new file mode 100644 index 0000000000..fe9f476558 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefResourceRequestHandlerAdapter.h @@ -0,0 +1,355 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_resource_request_handler.h" +#include "include\wrapper\cef_stream_resource_handler.h" + +#include "CefResponseWrapper.h" +#include "Request.h" +#include "CefFrameWrapper.h" +#include "CefBrowserWrapper.h" +#include "CefResourceHandlerAdapter.h" +#include "CefResponseFilterAdapter.h" +#include "CefRequestCallbackWrapper.h" +#include "CefCookieAccessFilterAdapter.h" + +using namespace CefSharp::Core; + +namespace CefSharp +{ + namespace Internals + { + //TODO: NetworkService - Code duplication should be improved + //going with the simplest and easiest option now + private class CefResourceRequestHandlerAdapter : public CefResourceRequestHandler + { + private: + gcroot _handler; + gcroot _browserControl; + //For resource requests that are handled by CefRequestContextHandlerAdapter::GetResourceRequestHandler + //this will be false + bool _hasAssociatedBrowserControl; + + public: + CefResourceRequestHandlerAdapter(IWebBrowser^ browserControl, IResourceRequestHandler^ handler) : + _handler(handler), _browserControl(browserControl) + { + _hasAssociatedBrowserControl = !Object::ReferenceEquals(_browserControl, nullptr); + } + + ~CefResourceRequestHandlerAdapter() + { + delete _handler; + _handler = nullptr; + } + + CefRefPtr GetCookieAccessFilter(CefRefPtr browser, CefRefPtr frame, CefRefPtr request) override + { + ICookieAccessFilter^ accessFilter; + Request requestWrapper(request); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + IBrowser^ existingBrowserWrapper; + CefFrameWrapper frameWrapper(frame); + + // If we already have an IBrowser instance then use it, otherwise we'll pass in a scoped instance + // which cannot be accessed outside the scope of the method. We should under normal circumstanaces + // have a IBrowser reference already ready to use. + if (_hasAssociatedBrowserControl && _browserControl->TryGetBrowserCoreById(browser->GetIdentifier(), existingBrowserWrapper)) + { + accessFilter = _handler->GetCookieAccessFilter(_browserControl, existingBrowserWrapper, %frameWrapper, %requestWrapper); + } + else + { + CefBrowserWrapper browserWrapper(browser); + + accessFilter = _handler->GetCookieAccessFilter(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper); + } + } + else + { + accessFilter = _handler->GetCookieAccessFilter(_browserControl, nullptr, nullptr, %requestWrapper); + } + + if (accessFilter == nullptr) + { + return nullptr; + } + + return new CefCookieAccessFilterAdapter(accessFilter, _browserControl); + } + + cef_return_value_t OnBeforeResourceLoad(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr callback) override + { + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + IBrowser^ existingBrowserWrapper; + //We pass the frame and request wrappers to CefRequestCallbackWrapper so they can be disposed of + //when the callback is executed + auto frameWrapper = gcnew CefFrameWrapper(frame); + auto requestWrapper = gcnew Request(request); + auto requestCallback = gcnew CefRequestCallbackWrapper(callback, frameWrapper, requestWrapper); + + // If we already have an IBrowser instance then use it, otherwise we'll pass in a scoped instance + // which cannot be accessed outside the scope of the method. We should under normal circumstanaces + // have a IBrowser reference already ready to use. + if (_hasAssociatedBrowserControl && _browserControl->TryGetBrowserCoreById(browser->GetIdentifier(), existingBrowserWrapper)) + { + return (cef_return_value_t)_handler->OnBeforeResourceLoad(_browserControl, existingBrowserWrapper, frameWrapper, requestWrapper, requestCallback); + } + + CefBrowserWrapper browserWrapper(browser); + + return (cef_return_value_t)_handler->OnBeforeResourceLoad(_browserControl, %browserWrapper, frameWrapper, requestWrapper, requestCallback); + } + + auto requestWrapper = gcnew Request(request); + auto requestCallback = gcnew CefRequestCallbackWrapper(callback, nullptr, requestWrapper); + + return (cef_return_value_t)_handler->OnBeforeResourceLoad(_browserControl, nullptr, nullptr, requestWrapper, requestCallback); + } + + CefRefPtr GetResourceHandler(CefRefPtr browser, CefRefPtr frame, CefRefPtr request) override + { + IResourceHandler^ resourceHandler; + Request requestWrapper(request); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + IBrowser^ existingBrowserWrapper; + CefFrameWrapper frameWrapper(frame); + + // If we already have an IBrowser instance then use it, otherwise we'll pass in a scoped instance + // which cannot be accessed outside the scope of the method. We should under normal circumstanaces + // have a IBrowser reference already ready to use. + if (_hasAssociatedBrowserControl && _browserControl->TryGetBrowserCoreById(browser->GetIdentifier(), existingBrowserWrapper)) + { + resourceHandler = _handler->GetResourceHandler(_browserControl, existingBrowserWrapper, %frameWrapper, %requestWrapper); + } + else + { + CefBrowserWrapper browserWrapper(browser); + + resourceHandler = _handler->GetResourceHandler(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper); + } + } + else + { + resourceHandler = _handler->GetResourceHandler(_browserControl, nullptr, nullptr, %requestWrapper); + } + + if (resourceHandler == nullptr) + { + return nullptr; + } + + if (resourceHandler->GetType() == FileResourceHandler::typeid) + { + auto fileResourceHandler = static_cast(resourceHandler); + + auto streamReader = CefStreamReader::CreateForFile(StringUtils::ToNative(fileResourceHandler->FilePath)); + + if (streamReader.get()) + { + return new CefStreamResourceHandler(StringUtils::ToNative(fileResourceHandler->MimeType), streamReader); + } + else + { + auto msg = "Unable to load resource CefStreamReader::CreateForFile returned nullptr for file:" + fileResourceHandler->FilePath; + LOG(ERROR) << StringUtils::ToNative(msg).ToString(); + + return nullptr; + } + } + else if (resourceHandler->GetType() == ByteArrayResourceHandler::typeid) + { + auto byteArrayResourceHandler = static_cast(resourceHandler); + + //NOTE: Prefix with cli:: namespace as VS2015 gets confused with std::array + cli::array^ buffer = byteArrayResourceHandler->Data; + pin_ptr src = &buffer[0]; + + auto streamReader = CefStreamReader::CreateForData(static_cast(src), buffer->Length); + + return new CefStreamResourceHandler(StringUtils::ToNative(byteArrayResourceHandler->MimeType), streamReader); + } + + return new CefResourceHandlerAdapter(resourceHandler); + } + + void OnResourceRedirect(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response, CefString& newUrl) override + { + auto managedNewUrl = StringUtils::ToClr(newUrl); + Request requestWrapper(request); + CefResponseWrapper responseWrapper(response); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + IBrowser^ existingBrowserWrapper; + CefFrameWrapper frameWrapper(frame); + + // If we already have an IBrowser instance then use it, otherwise we'll pass in a scoped instance + // which cannot be accessed outside the scope of the method. We should under normal circumstanaces + // have a IBrowser reference already ready to use. + if (_hasAssociatedBrowserControl && _browserControl->TryGetBrowserCoreById(browser->GetIdentifier(), existingBrowserWrapper)) + { + _handler->OnResourceRedirect(_browserControl, existingBrowserWrapper, %frameWrapper, %requestWrapper, %responseWrapper, managedNewUrl); + } + else + { + CefBrowserWrapper browserWrapper(browser); + + _handler->OnResourceRedirect(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper, managedNewUrl); + } + } + else + { + _handler->OnResourceRedirect(_browserControl, nullptr, nullptr, %requestWrapper, %responseWrapper, managedNewUrl); + } + + newUrl = StringUtils::ToNative(managedNewUrl); + + } + + bool OnResourceResponse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response) override + { + Request requestWrapper(request); + CefResponseWrapper responseWrapper(response); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + IBrowser^ existingBrowserWrapper; + CefFrameWrapper frameWrapper(frame); + + // If we already have an IBrowser instance then use it, otherwise we'll pass in a scoped instance + // which cannot be accessed outside the scope of the method. We should under normal circumstanaces + // have a IBrowser reference already ready to use. + if (_hasAssociatedBrowserControl && _browserControl->TryGetBrowserCoreById(browser->GetIdentifier(), existingBrowserWrapper)) + { + return _handler->OnResourceResponse(_browserControl, existingBrowserWrapper, %frameWrapper, %requestWrapper, %responseWrapper); + } + + CefBrowserWrapper browserWrapper(browser); + + return _handler->OnResourceResponse(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper); + } + + return _handler->OnResourceResponse(_browserControl, nullptr, nullptr, %requestWrapper, %responseWrapper); + } + + CefRefPtr GetResourceResponseFilter(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response) override + { + IResponseFilter^ responseFilter; + Request requestWrapper(request); + CefResponseWrapper responseWrapper(response); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + IBrowser^ existingBrowserWrapper; + CefFrameWrapper frameWrapper(frame); + + // If we already have an IBrowser instance then use it, otherwise we'll pass in a scoped instance + // which cannot be accessed outside the scope of the method. We should under normal circumstanaces + // have a IBrowser reference already ready to use. + if (_hasAssociatedBrowserControl && _browserControl->TryGetBrowserCoreById(browser->GetIdentifier(), existingBrowserWrapper)) + { + responseFilter = _handler->GetResourceResponseFilter(_browserControl, existingBrowserWrapper, %frameWrapper, %requestWrapper, %responseWrapper); + } + else + { + CefBrowserWrapper browserWrapper(browser); + + responseFilter = _handler->GetResourceResponseFilter(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper); + } + } + else + { + responseFilter = _handler->GetResourceResponseFilter(_browserControl, nullptr, nullptr, %requestWrapper, %responseWrapper); + } + + if (responseFilter == nullptr) + { + return nullptr; + } + + return new CefResponseFilterAdapter(responseFilter); + } + + void OnResourceLoadComplete(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response, URLRequestStatus status, int64_t receivedContentLength) override + { + Request requestWrapper(request); + CefResponseWrapper responseWrapper(response); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + IBrowser^ existingBrowserWrapper; + CefFrameWrapper frameWrapper(frame); + + // If we already have an IBrowser instance then use it, otherwise we'll pass in a scoped instance + // which cannot be accessed outside the scope of the method. We should under normal circumstanaces + // have a IBrowser reference already ready to use. + if (_hasAssociatedBrowserControl && _browserControl->TryGetBrowserCoreById(browser->GetIdentifier(), existingBrowserWrapper)) + { + _handler->OnResourceLoadComplete(_browserControl, existingBrowserWrapper, %frameWrapper, %requestWrapper, %responseWrapper, (UrlRequestStatus)status, receivedContentLength); + } + else + { + CefBrowserWrapper browserWrapper(browser); + + _handler->OnResourceLoadComplete(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper, (UrlRequestStatus)status, receivedContentLength); + } + } + else + { + _handler->OnResourceLoadComplete(_browserControl, nullptr, nullptr, %requestWrapper, %responseWrapper, (UrlRequestStatus)status, receivedContentLength); + } + } + + void OnProtocolExecution(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool& allowOSExecution) override + { + Request requestWrapper(request); + + //For ServiceWorker browser and frame will be null + if (browser.get() && frame.get()) + { + IBrowser^ existingBrowserWrapper; + CefFrameWrapper frameWrapper(frame); + + // If we already have an IBrowser instance then use it, otherwise we'll pass in a scoped instance + // which cannot be accessed outside the scope of the method. We should under normal circumstanaces + // have a IBrowser reference already ready to use. + if (_hasAssociatedBrowserControl && _browserControl->TryGetBrowserCoreById(browser->GetIdentifier(), existingBrowserWrapper)) + { + allowOSExecution = _handler->OnProtocolExecution(_browserControl, existingBrowserWrapper, %frameWrapper, %requestWrapper); + } + else + { + CefBrowserWrapper browserWrapper(browser); + + allowOSExecution = _handler->OnProtocolExecution(_browserControl, %browserWrapper, %frameWrapper, %requestWrapper); + } + } + else + { + + allowOSExecution = _handler->OnProtocolExecution(_browserControl, nullptr, nullptr, %requestWrapper); + } + } + + IMPLEMENT_REFCOUNTINGM(CefResourceRequestHandlerAdapter); + }; + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefResourceSkipCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefResourceSkipCallbackWrapper.h new file mode 100644 index 0000000000..ef339cc56d --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefResourceSkipCallbackWrapper.h @@ -0,0 +1,52 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_resource_handler.h" +#include "CefWrapper.h" + +using namespace CefSharp::Callback; + +namespace CefSharp +{ + namespace Internals + { + private ref class CefResourceSkipCallbackWrapper : public IResourceSkipCallback, public CefWrapper + { + private: + MCefRefPtr _callback; + + public: + CefResourceSkipCallbackWrapper(CefRefPtr &callback) : + _callback(callback) + { + + } + + !CefResourceSkipCallbackWrapper() + { + _callback = nullptr; + } + + ~CefResourceSkipCallbackWrapper() + { + this->!CefResourceSkipCallbackWrapper(); + + _disposed = true; + } + + virtual void Continue(Int64 bytesSkipped) + { + ThrowIfDisposed(); + + _callback->Continue(bytesSkipped); + + delete this; + } + }; + } +} diff --git a/CefSharp.Core/Internals/CefResponseFilterAdapter.h b/CefSharp.Core.Runtime/Internals/CefResponseFilterAdapter.h similarity index 95% rename from CefSharp.Core/Internals/CefResponseFilterAdapter.h rename to CefSharp.Core.Runtime/Internals/CefResponseFilterAdapter.h index 33e4eec46c..7ecf3807ad 100644 --- a/CefSharp.Core/Internals/CefResponseFilterAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefResponseFilterAdapter.h @@ -32,7 +32,7 @@ namespace CefSharp _filter = nullptr; } - virtual bool InitFilter() OVERRIDE + virtual bool InitFilter() override { return _filter->InitFilter(); } @@ -54,7 +54,7 @@ namespace CefSharp // the method returns RESPONSE_FILTER_DONE or RESPONSE_FILTER_ERROR. Do not // keep a reference to the buffers passed to this method. /*--cef(optional_param=data_in,default_retval=RESPONSE_FILTER_ERROR)--*/ - virtual FilterStatus Filter(void* dataIn, size_t dataInSize, size_t& dataInRead, void* dataOut, size_t dataOutSize, size_t& dataOutWritten) OVERRIDE + virtual FilterStatus Filter(void* dataIn, size_t dataInSize, size_t& dataInRead, void* dataOut, size_t dataOutSize, size_t& dataOutWritten) override { Int64 dataInReadPtr = 0; Int64 dataOutWrittenPtr = 0; @@ -79,7 +79,7 @@ namespace CefSharp return (FilterStatus)status; } - IMPLEMENT_REFCOUNTING(CefResponseFilterAdapter); + IMPLEMENT_REFCOUNTINGM(CefResponseFilterAdapter); }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/CefResponseWrapper.h b/CefSharp.Core.Runtime/Internals/CefResponseWrapper.h similarity index 69% rename from CefSharp.Core/Internals/CefResponseWrapper.h rename to CefSharp.Core.Runtime/Internals/CefResponseWrapper.h index 28a22c706a..a344dc18a1 100644 --- a/CefSharp.Core/Internals/CefResponseWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefResponseWrapper.h @@ -19,7 +19,7 @@ namespace CefSharp { MCefRefPtr _response; internal: - CefResponseWrapper(CefRefPtr &response) : + CefResponseWrapper(const CefRefPtr &response) : _response(response) { @@ -38,6 +38,23 @@ namespace CefSharp } public: + virtual property String^ Charset + { + String^ get() + { + ThrowIfDisposed(); + + return StringUtils::ToClr(_response->GetCharset()); + } + void set(String^ val) + { + ThrowIfDisposed(); + ThrowIfReadOnly(); + + _response->SetCharset(StringUtils::ToNative(val)); + } + } + virtual property bool IsReadOnly { bool get() @@ -59,6 +76,7 @@ namespace CefSharp void set(CefErrorCode val) { ThrowIfDisposed(); + ThrowIfReadOnly(); _response->SetError((cef_errorcode_t)val); } @@ -75,6 +93,7 @@ namespace CefSharp void set(int val) { ThrowIfDisposed(); + ThrowIfReadOnly(); _response->SetStatus(val); } @@ -91,6 +110,7 @@ namespace CefSharp void set(String^ val) { ThrowIfDisposed(); + ThrowIfReadOnly(); _response->SetStatusText(StringUtils::ToNative(val)); } @@ -107,6 +127,7 @@ namespace CefSharp void set(String^ val) { ThrowIfDisposed(); + ThrowIfReadOnly(); _response->SetMimeType(StringUtils::ToNative(val)); } @@ -122,7 +143,7 @@ namespace CefSharp CefRequest::HeaderMap hm; _response->GetHeaderMap(hm); - NameValueCollection^ headers = gcnew NameValueCollection(); + auto headers = gcnew HeaderNameValueCollection(); for (CefRequest::HeaderMap::iterator it = hm.begin(); it != hm.end(); ++it) { @@ -131,11 +152,17 @@ namespace CefSharp headers->Add(name, value); } + if (_response->IsReadOnly()) + { + headers->SetReadOnly(); + } + return headers; } void set(NameValueCollection^ headers) { ThrowIfDisposed(); + ThrowIfReadOnly(); _response->SetHeaderMap(TypeConversion::ToNative(headers)); } @@ -152,6 +179,29 @@ namespace CefSharp Headers = headers; } } + + virtual String^ GetHeaderByName(String^ name) + { + ThrowIfDisposed(); + + return StringUtils::ToClr(_response->GetHeaderByName(StringUtils::ToNative(name))); + } + + virtual void SetHeaderByName(String^ name, String^ value, bool overwrite) + { + ThrowIfDisposed(); + ThrowIfReadOnly(); + + _response->SetHeaderByName(StringUtils::ToNative(name), StringUtils::ToNative(value), overwrite); + } + + void ThrowIfReadOnly() + { + if (_response->IsReadOnly()) + { + throw gcnew NotSupportedException("IResponse is read-only and cannot be modified. Check IResponse.IsReadOnly to guard against this exception."); + } + } }; } } diff --git a/CefSharp.Core/Internals/CefRunContextMenuCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefRunContextMenuCallbackWrapper.h similarity index 90% rename from CefSharp.Core/Internals/CefRunContextMenuCallbackWrapper.h rename to CefSharp.Core.Runtime/Internals/CefRunContextMenuCallbackWrapper.h index 701de5bb03..9d1c8421e7 100644 --- a/CefSharp.Core/Internals/CefRunContextMenuCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefRunContextMenuCallbackWrapper.h @@ -27,7 +27,7 @@ namespace CefSharp !CefRunContextMenuCallbackWrapper() { - _callback = NULL; + _callback = nullptr; } ~CefRunContextMenuCallbackWrapper() @@ -50,7 +50,7 @@ namespace CefSharp { ThrowIfDisposed(); - _callback->Continue((int)commandId, (CefRunContextMenuCallback::EventFlags) eventFlags); + _callback->Continue((int)commandId, (cef_event_flags_t) eventFlags); delete this; } diff --git a/CefSharp.Core/Internals/CefRunFileDialogCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefRunFileDialogCallbackAdapter.h similarity index 75% rename from CefSharp.Core/Internals/CefRunFileDialogCallbackAdapter.h rename to CefSharp.Core.Runtime/Internals/CefRunFileDialogCallbackAdapter.h index 448f1bebc3..14f8d5ac61 100644 --- a/CefSharp.Core/Internals/CefRunFileDialogCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefRunFileDialogCallbackAdapter.h @@ -30,15 +30,15 @@ namespace CefSharp _callback = nullptr; } - virtual void OnFileDialogDismissed(int selectedAcceptFilter, const std::vector& filePaths) OVERRIDE + virtual void OnFileDialogDismissed(const std::vector& filePaths) override { if (static_cast(_callback) != nullptr) { - _callback->OnFileDialogDismissed(selectedAcceptFilter, StringUtils::ToClr(filePaths)); + _callback->OnFileDialogDismissed(StringUtils::ToClr(filePaths)); } } - IMPLEMENT_REFCOUNTING(CefRunFileDialogCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefRunFileDialogCallbackAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefSchemeHandlerFactoryAdapter.h b/CefSharp.Core.Runtime/Internals/CefSchemeHandlerFactoryAdapter.h new file mode 100644 index 0000000000..e2ff28f40f --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefSchemeHandlerFactoryAdapter.h @@ -0,0 +1,90 @@ +// Copyright © 2015 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include\cef_scheme.h" +#include "include\wrapper\cef_stream_resource_handler.h" + +#include "Internals\CefBrowserWrapper.h" +#include "Internals\CefFrameWrapper.h" +#include "Request.h" +#include "CefResourceHandlerAdapter.h" + +using namespace System::IO; +using namespace System::Collections::Specialized; + +using namespace CefSharp::Core; + +namespace CefSharp +{ + namespace Internals + { + private class CefSchemeHandlerFactoryAdapter : public CefSchemeHandlerFactory + { + gcroot _factory; + + public: + CefSchemeHandlerFactoryAdapter(ISchemeHandlerFactory^ factory) + : _factory(factory) + { + } + + ~CefSchemeHandlerFactoryAdapter() + { + _factory = nullptr; + } + + virtual CefRefPtr Create(CefRefPtr browser, CefRefPtr frame, const CefString& schemeName, CefRefPtr request) override + { + CefBrowserWrapper browserWrapper(browser); + CefFrameWrapper frameWrapper(frame); + Request requestWrapper(request); + + auto handler = _factory->Create(%browserWrapper, %frameWrapper, StringUtils::ToClr(schemeName), %requestWrapper); + + if (handler == nullptr) + { + return nullptr; + } + + if (handler->GetType() == FileResourceHandler::typeid) + { + auto resourceHandler = static_cast(handler); + + auto streamReader = CefStreamReader::CreateForFile(StringUtils::ToNative(resourceHandler->FilePath)); + + if (streamReader.get()) + { + return new CefStreamResourceHandler(StringUtils::ToNative(resourceHandler->MimeType), streamReader); + } + else + { + auto msg = "Unable to load resource CefStreamReader::CreateForFile returned nullptr for file:" + resourceHandler->FilePath; + LOG(ERROR) << StringUtils::ToNative(msg).ToString(); + + return nullptr; + } + } + else if (handler->GetType() == ByteArrayResourceHandler::typeid) + { + auto resourceHandler = static_cast(handler); + + //NOTE: Prefix with cli:: namespace as VS2015 gets confused with std::array + cli::array^ buffer = resourceHandler->Data; + pin_ptr src = &buffer[0]; + + auto streamReader = CefStreamReader::CreateForData(static_cast(src), buffer->Length); + + return new CefStreamResourceHandler(StringUtils::ToNative(resourceHandler->MimeType), streamReader); + } + + return new CefResourceHandlerAdapter(handler); + } + + IMPLEMENT_REFCOUNTINGM(CefSchemeHandlerFactoryAdapter); + }; + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefSchemeRegistrarWrapper.h b/CefSharp.Core.Runtime/Internals/CefSchemeRegistrarWrapper.h new file mode 100644 index 0000000000..e1cd3bb840 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefSchemeRegistrarWrapper.h @@ -0,0 +1,48 @@ +// Copyright © 2018 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_scheme.h" +#include "CefWrapper.h" + +using namespace CefSharp::Enums; + +namespace CefSharp +{ + namespace Internals + { + private ref class CefSchemeRegistrarWrapper : public ISchemeRegistrar, public CefWrapper + { + private: + CefSchemeRegistrar* _registra; + + public: + CefSchemeRegistrarWrapper(CefRawPtr ®istra) : + _registra(registra) + { + + } + + !CefSchemeRegistrarWrapper() + { + _registra = nullptr; + } + + ~CefSchemeRegistrarWrapper() + { + this->!CefSchemeRegistrarWrapper(); + + _disposed = true; + } + + virtual bool AddCustomScheme(String^ schemeName, CefSharp::Enums::SchemeOptions schemeOptions) + { + return _registra->AddCustomScheme(StringUtils::ToNative(schemeName), (int)schemeOptions); + } + }; + } +} diff --git a/CefSharp.Core/Internals/CefSetCookieCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefSetCookieCallbackAdapter.h similarity index 87% rename from CefSharp.Core/Internals/CefSetCookieCallbackAdapter.h rename to CefSharp.Core.Runtime/Internals/CefSetCookieCallbackAdapter.h index cab351a9af..4ad2a5c0dd 100644 --- a/CefSharp.Core/Internals/CefSetCookieCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefSetCookieCallbackAdapter.h @@ -28,12 +28,12 @@ namespace CefSharp _handler = nullptr; } - void OnComplete(bool success) OVERRIDE + void OnComplete(bool success) override { _handler->OnComplete(success); } - IMPLEMENT_REFCOUNTING(CefSetCookieCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefSetCookieCallbackAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefSharpApp.h b/CefSharp.Core.Runtime/Internals/CefSharpApp.h new file mode 100644 index 0000000000..f4cfffc7f5 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefSharpApp.h @@ -0,0 +1,246 @@ +// Copyright © 2013 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_app.h" +#include "include\cef_scheme.h" + +#include "CefSettingsBase.h" +#include "CefSchemeHandlerFactoryAdapter.h" +#include "Internals\CefSchemeRegistrarWrapper.h" + +using namespace CefSharp::Core; + +namespace CefSharp +{ + namespace Internals + { + private class CefSharpApp : public CefApp, + public CefBrowserProcessHandler + { + gcroot^> _customSchemes; + gcroot _commandLineArgs; + gcroot _app; + bool _commandLineDisabled; + bool _hasCustomScheme; + gcroot _customSchemeArg; + + public: + CefSharpApp(bool externalMessagePump, bool commandLineDisabled, CommandLineArgDictionary^ commandLineArgs, IEnumerable^ customSchemes, IApp^ app) : + _commandLineDisabled(commandLineDisabled), + _commandLineArgs(commandLineArgs), + _customSchemes(customSchemes), + _app(app), + _hasCustomScheme(false) + { + auto isMissingHandler = Object::ReferenceEquals(app, nullptr) || Object::ReferenceEquals(app->BrowserProcessHandler, nullptr); + if (externalMessagePump && isMissingHandler) + { + throw gcnew Exception("browserProcessHandler cannot be null when using cefSettings.ExternalMessagePump"); + } + + if (System::Linq::Enumerable::Count(customSchemes) > 0) + { + String^ argument = "="; + auto registeredSchemes = gcnew List(); + + for each (CefCustomScheme ^ scheme in customSchemes) + { + //We don't need to register http or https in the render process + if (scheme->SchemeName == "http" || + scheme->SchemeName == "https") + { + continue; + } + + //We've already registered this scheme name + if (registeredSchemes->Contains(scheme->SchemeName)) + { + continue; + } + + _hasCustomScheme = true; + + registeredSchemes->Add(scheme->SchemeName); + + argument += scheme->SchemeName + "|"; + argument += ((int)scheme->Options).ToString() + ";"; + } + + if (_hasCustomScheme) + { + _customSchemeArg = argument->TrimEnd(';'); + } + } + } + + ~CefSharpApp() + { + _customSchemes = nullptr; + _commandLineArgs = nullptr; + delete _app; + _app = nullptr; + } + + virtual CefRefPtr GetBrowserProcessHandler() override + { + return this; + } + + virtual void OnContextInitialized() override + { + auto customSchemes = (IEnumerable^)_customSchemes; + + //CefRegisterSchemeHandlerFactory requires access to the Global CefRequestContext + for each (CefCustomScheme^ cefCustomScheme in customSchemes) + { + if (!Object::ReferenceEquals(cefCustomScheme->SchemeHandlerFactory, nullptr)) + { + auto domainName = cefCustomScheme->DomainName ? cefCustomScheme->DomainName : String::Empty; + + CefRefPtr wrapper = new CefSchemeHandlerFactoryAdapter(cefCustomScheme->SchemeHandlerFactory); + CefRegisterSchemeHandlerFactory(StringUtils::ToNative(cefCustomScheme->SchemeName), StringUtils::ToNative(domainName), wrapper); + } + } + + CefSharp::Internals::GlobalContextInitialized::SetResult(true); + + if (!Object::ReferenceEquals(_app, nullptr) && !Object::ReferenceEquals(_app->BrowserProcessHandler, nullptr)) + { + _app->BrowserProcessHandler->OnContextInitialized(); + } + } + + virtual void OnScheduleMessagePumpWork(int64_t delay_ms) override + { + //We rely on previous checks to make sure _app and _app->BrowserProcessHandler aren't null + _app->BrowserProcessHandler->OnScheduleMessagePumpWork(delay_ms); + } + + virtual bool OnAlreadyRunningAppRelaunch(CefRefPtr commandLine, const CefString& currentDirectory) override + { + if (Object::ReferenceEquals(_app, nullptr) || Object::ReferenceEquals(_app->BrowserProcessHandler, nullptr)) + { + return false; + } + + auto managedArgs = gcnew Dictionary(); + + CefCommandLine::ArgumentList args; + commandLine->GetArguments(args); + + for (auto arg : args) + { + managedArgs->Add(StringUtils::ToClr(arg), String::Empty); + } + + CefCommandLine::SwitchMap switches; + commandLine->GetSwitches(switches); + + for (auto s : switches) + { + managedArgs->Add(StringUtils::ToClr(s.first), StringUtils::ToClr(s.second)); + } + + auto readOnlyArgs = gcnew System::Collections::ObjectModel::ReadOnlyDictionary(managedArgs); + + return _app->BrowserProcessHandler->OnAlreadyRunningAppRelaunch(readOnlyArgs, StringUtils::ToClr(currentDirectory)); + } + + virtual void OnBeforeChildProcessLaunch(CefRefPtr commandLine) override + { +#ifndef NETCOREAPP + if (CefSharpSettings::WcfEnabled) + { + commandLine->AppendArgument(StringUtils::ToNative(CefSharpArguments::WcfEnabledArgument)); + } +#endif + + if (CefSharpSettings::SubprocessExitIfParentProcessClosed) + { + commandLine->AppendSwitch(StringUtils::ToNative(CefSharpArguments::ExitIfParentProcessClosed)); + } + + //ChannelId was removed in https://github.com/chromiumembedded/cef/issues/1912 + //We need to know the process Id to establish WCF communication and for monitoring of parent process exit + commandLine->AppendArgument(StringUtils::ToNative(CefSharpArguments::HostProcessIdArgument + "=" + Process::GetCurrentProcess()->Id)); + + if (_hasCustomScheme) + { + commandLine->AppendArgument(StringUtils::ToNative(CefSharpArguments::CustomSchemeArgument + _customSchemeArg)); + } + + if (CefSharpSettings::FocusedNodeChangedEnabled) + { + commandLine->AppendArgument(StringUtils::ToNative(CefSharpArguments::FocusedNodeChangedEnabledArgument)); + } + } + + virtual void OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr command_line) override + { + if (CefSharpSettings::Proxy != nullptr && !_commandLineDisabled) + { + command_line->AppendSwitchWithValue("proxy-server", StringUtils::ToNative(CefSharpSettings::Proxy->IP + ":" + CefSharpSettings::Proxy->Port)); + + if (!String::IsNullOrEmpty(CefSharpSettings::Proxy->BypassList)) + { + command_line->AppendSwitchWithValue("proxy-bypass-list", StringUtils::ToNative(CefSharpSettings::Proxy->BypassList)); + } + } + + if (_commandLineArgs->Count > 0) + { + auto commandLine = command_line.get(); + + // Not clear what should happen if we + // * already have some command line flags given (is this possible? Perhaps from globalCommandLine) + // * have no flags given (-> call SetProgramm() with first argument?) + + auto args = (CommandLineArgDictionary^)_commandLineArgs; + + for each(KeyValuePair^ kvp in args) + { + CefString name = StringUtils::ToNative(kvp->Key); + CefString value = StringUtils::ToNative(kvp->Value); + + if (kvp->Key == "disable-features" || kvp->Key == "enable-features") + { + //Temp workaround so we can set the disable-features/enable-features command line argument + // See https://github.com/cefsharp/CefSharp/issues/2408 + commandLine->AppendSwitchWithValue(name, value); + } + // Right now the command line args handed to the application (global command line) have higher + // precedence than command line args provided by the app + else if (!commandLine->HasSwitch(name)) + { + if (String::IsNullOrEmpty(kvp->Value)) + { + commandLine->AppendSwitch(name); + } + else + { + commandLine->AppendSwitchWithValue(name, value); + } + } + } + } + } + + virtual void OnRegisterCustomSchemes(CefRawPtr registrar) override + { + if (!Object::ReferenceEquals(_app, nullptr)) + { + CefSchemeRegistrarWrapper wrapper(registrar); + + _app->OnRegisterCustomSchemes(%wrapper); + } + }; + + IMPLEMENT_REFCOUNTINGM(CefSharpApp); + }; + } +} diff --git a/CefSharp.Core/Internals/CefSslInfoWrapper.h b/CefSharp.Core.Runtime/Internals/CefSslInfoWrapper.h similarity index 98% rename from CefSharp.Core/Internals/CefSslInfoWrapper.h rename to CefSharp.Core.Runtime/Internals/CefSslInfoWrapper.h index 71a4c2fbc5..58787ea973 100644 --- a/CefSharp.Core/Internals/CefSslInfoWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefSslInfoWrapper.h @@ -30,7 +30,7 @@ namespace CefSharp !CefSslInfoWrapper() { - _sslInfo = NULL; + _sslInfo = nullptr; } ~CefSslInfoWrapper() diff --git a/CefSharp.Core.Runtime/Internals/CefStringVisitorAdapter.h b/CefSharp.Core.Runtime/Internals/CefStringVisitorAdapter.h new file mode 100644 index 0000000000..d4c190c863 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefStringVisitorAdapter.h @@ -0,0 +1,52 @@ +// Copyright © 2014 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include +#include +#include +#include "include/cef_string_visitor.h" + +using namespace msclr::interop; + +namespace CefSharp +{ + namespace Internals + { + private class CefStringVisitorAdapter : public CefStringVisitor + { + private: + gcroot _visitor; + + public: + CefStringVisitorAdapter(IStringVisitor^ visitor) : + _visitor(visitor) + { + } + + ~CefStringVisitorAdapter() + { + delete _visitor; + _visitor = nullptr; + } + + virtual void Visit(const CefString& string) override + { + // New Mojo IPC implementation uses shared memory rather than a string copy + // Attempt to workaround the access violation that's been reported in a few isolated cases + // by copying the string rather than using directly. + // https://github.com/chromiumembedded/cef/commit/ebee84755ed14e71388b343231d3a419f1c5c1fd + std::wstring str = string.ToWString(); + + auto clrString = marshal_as(str); + + _visitor->Visit(clrString); + } + + IMPLEMENT_REFCOUNTINGM(CefStringVisitorAdapter); + }; + } +} diff --git a/CefSharp.Core.Runtime/Internals/CefTaskDelegate.h b/CefSharp.Core.Runtime/Internals/CefTaskDelegate.h new file mode 100644 index 0000000000..fa9e5c9eff --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefTaskDelegate.h @@ -0,0 +1,42 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include/cef_task.h" + +#include "ReportUnhandledExceptions.h" + +namespace CefSharp +{ + namespace Internals + { + private class CefTaskDelegate : public CefTask + { + private: + gcroot _action; + public: + CefTaskDelegate(Action^ action) : + _action(action) + { + }; + + virtual void Execute() override + { + try + { + _action->Invoke(); + } + catch (Exception^ e) + { + auto msg = gcnew String(L"CefTaskDelegate caught an unexpected exception. This exception has been redirected onto the ThreadPool, add a try catch."); + ReportUnhandledExceptions::Report(msg, e); + } + }; + + IMPLEMENT_REFCOUNTINGM(CefTaskDelegate); + }; + } +} diff --git a/CefSharp.Core/Internals/CefTaskScheduler.h b/CefSharp.Core.Runtime/Internals/CefTaskScheduler.h similarity index 100% rename from CefSharp.Core/Internals/CefTaskScheduler.h rename to CefSharp.Core.Runtime/Internals/CefTaskScheduler.h diff --git a/CefSharp.Core/Internals/CefTaskWrapper.h b/CefSharp.Core.Runtime/Internals/CefTaskWrapper.h similarity index 94% rename from CefSharp.Core/Internals/CefTaskWrapper.h rename to CefSharp.Core.Runtime/Internals/CefTaskWrapper.h index 3c47890219..726d7df109 100644 --- a/CefSharp.Core/Internals/CefTaskWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefTaskWrapper.h @@ -28,7 +28,7 @@ namespace CefSharp { }; - virtual void Execute() OVERRIDE + virtual void Execute() override { try { @@ -45,7 +45,7 @@ namespace CefSharp } }; - IMPLEMENT_REFCOUNTING(CefTaskWrapper); + IMPLEMENT_REFCOUNTINGM(CefTaskWrapper); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.cpp b/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.cpp new file mode 100644 index 0000000000..a638e62232 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.cpp @@ -0,0 +1,54 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#include "Stdafx.h" +#include "CefUrlRequestClientAdapter.h" +#include "UrlRequest.h" +#include "CefAuthCallbackWrapper.h" + +using namespace System::IO; + +using namespace CefSharp::Core; + +void CefUrlRequestClientAdapter::OnRequestComplete(CefRefPtr request) +{ + _client->OnRequestComplete(gcnew UrlRequest(request)); +} + +void CefUrlRequestClientAdapter::OnUploadProgress(CefRefPtr request, int64_t current, int64_t total) +{ + _client->OnUploadProgress(gcnew UrlRequest(request), current, total); +} + +void CefUrlRequestClientAdapter::OnDownloadProgress(CefRefPtr request, int64_t current, int64_t total) +{ + _client->OnDownloadProgress(gcnew UrlRequest(request), current, total); +} + +void CefUrlRequestClientAdapter::OnDownloadData(CefRefPtr request, const void* data, size_t data_length) +{ + UnmanagedMemoryStream readStream((Byte*)data, (Int64)data_length, (Int64)data_length, FileAccess::Read); + + _client->OnDownloadData( + gcnew UrlRequest(request), + %readStream + ); +} + +bool CefUrlRequestClientAdapter::GetAuthCredentials(bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) +{ + return _client->GetAuthCredentials( + isProxy, + StringUtils::ToClr(host), + port, + StringUtils::ToClr(realm), + StringUtils::ToClr(scheme), + gcnew CefAuthCallbackWrapper(callback)); +} + diff --git a/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.h b/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.h new file mode 100644 index 0000000000..200dc8a446 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.h @@ -0,0 +1,94 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "Include\cef_urlrequest.h" + +namespace CefSharp +{ + namespace Internals + { + /// Interface that should be implemented by the CefUrlRequest client. + /// The methods of this class will be called on the same thread that created + /// the request unless otherwise documented. + private class CefUrlRequestClientAdapter : public CefURLRequestClient + { + private: + gcroot _client; + + public: + CefUrlRequestClientAdapter(IUrlRequestClient^ client) + { + _client = client; + } + + ~CefUrlRequestClientAdapter() + { + delete _client; + _client = nullptr; + } + + // Notifies the client that the request has completed. Use the + // CefURLRequest::GetRequestStatus method to determine if the request was + // successful or not. + /// + /*--cef()--*/ + virtual void OnRequestComplete(CefRefPtr request) override; + + /// + // Notifies the client of upload progress. |current| denotes the number of + // bytes sent so far and |total| is the total size of uploading data (or -1 if + // chunked upload is enabled). This method will only be called if the + // UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. + /// + /*--cef()--*/ + virtual void OnUploadProgress(CefRefPtr request, + int64_t current, + int64_t total) override; + + ///ref + // Notifies the client of download progress. |current| denotes the number of + // bytes received up to the call and |total| is the expected total size of the + // response (or -1 if not determined). + /// + /*--cef()--*/ + virtual void OnDownloadProgress(CefRefPtr request, + int64_t current, + int64_t total) override; + + /// + // Called when some part of the response is read. |data| contains the current + // bytes received since the last call. This method will not be called if the + // UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. + /// + /*--cef()--*/ + virtual void OnDownloadData(CefRefPtr request, + const void* data, + size_t data_length) override; + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true to continue the + // request and call CefAuthCallback::Continue() when the authentication + // information is available. If the request has an associated browser/frame + // then returning false will result in a call to GetAuthCredentials on the + // CefRequestHandler associated with that browser, if any. Otherwise, + // returning false will cancel the request immediately. This method will only + // be called for requests initiated from the browser process. + /// + /*--cef(optional_param=realm)--*/ + virtual bool GetAuthCredentials(bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) override; + + IMPLEMENT_REFCOUNTINGM(CefUrlRequestClientAdapter); + }; + } +} diff --git a/CefSharp.Core/Internals/CefValueWrapper.cpp b/CefSharp.Core.Runtime/Internals/CefValueWrapper.cpp similarity index 94% rename from CefSharp.Core/Internals/CefValueWrapper.cpp rename to CefSharp.Core.Runtime/Internals/CefValueWrapper.cpp index 32a4647e6b..a369893c31 100644 --- a/CefSharp.Core/Internals/CefValueWrapper.cpp +++ b/CefSharp.Core.Runtime/Internals/CefValueWrapper.cpp @@ -51,7 +51,7 @@ IDictionary^ CefValueWrapper::GetDictionary() CefDictionaryValue::KeyList keys; dictionary->GetKeys(keys); - for (auto i = 0; i < keys.size(); i++) + for (size_t i = 0; i < keys.size(); i++) { auto key = keys[i]; auto keyValue = StringUtils::ToClr(key); @@ -70,7 +70,7 @@ IList^ CefValueWrapper::GetList() auto list = _cefValue->GetList(); auto result = gcnew List(list->GetSize()); - for (auto i = 0; i < list->GetSize(); i++) + for (size_t i = 0; i < list->GetSize(); i++) { result->Add(gcnew CefValueWrapper(list->GetValue(i))); } @@ -83,4 +83,4 @@ Object^ CefValueWrapper::GetObject() ThrowIfDisposed(); return TypeConversion::FromNative(_cefValue.get()); -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/CefValueWrapper.h b/CefSharp.Core.Runtime/Internals/CefValueWrapper.h similarity index 53% rename from CefSharp.Core/Internals/CefValueWrapper.h rename to CefSharp.Core.Runtime/Internals/CefValueWrapper.h index 8d977c1c7d..ea14a59f9e 100644 --- a/CefSharp.Core/Internals/CefValueWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefValueWrapper.h @@ -13,19 +13,53 @@ namespace CefSharp { namespace Internals { + [System::Diagnostics::DebuggerDisplay("{DebuggerDisplay,nq}")] private ref class CefValueWrapper : public IValue, public CefWrapper { private: MCefRefPtr _cefValue; + property String^ DebuggerDisplay + { + String^ get() + { + if (IsDisposed) + { + return "CefValueWrapper"; + } + + if (Type == Enums::ValueType::String) + { + return GetString(); + } + + if (Type == Enums::ValueType::Bool) + { + return GetBool().ToString(); + } + + if (Type == Enums::ValueType::Int) + { + return GetInt().ToString(); + } + + if (Type == Enums::ValueType::Double) + { + return GetDouble().ToString(); + } + + return "CefValueWrapper: " + Type.ToString(); + } + } + internal: - CefValueWrapper(CefRefPtr &cefValue) : _cefValue(cefValue) + CefValueWrapper(const CefRefPtr &cefValue) : _cefValue(cefValue) { } !CefValueWrapper() { - _cefValue = NULL; + _cefValue = nullptr; } ~CefValueWrapper() @@ -55,4 +89,4 @@ namespace CefSharp } }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/CefWrapper.h b/CefSharp.Core.Runtime/Internals/CefWrapper.h similarity index 100% rename from CefSharp.Core/Internals/CefWrapper.h rename to CefSharp.Core.Runtime/Internals/CefWrapper.h diff --git a/CefSharp.Core/Internals/CefWriteHandlerWrapper.h b/CefSharp.Core.Runtime/Internals/CefWriteHandlerWrapper.h similarity index 89% rename from CefSharp.Core/Internals/CefWriteHandlerWrapper.h rename to CefSharp.Core.Runtime/Internals/CefWriteHandlerWrapper.h index a87d57d989..3c55085bc8 100644 --- a/CefSharp.Core/Internals/CefWriteHandlerWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefWriteHandlerWrapper.h @@ -32,7 +32,7 @@ namespace CefSharp _stream = nullptr; } - virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE + virtual size_t Write(const void* ptr, size_t size, size_t n) override { try { @@ -49,7 +49,7 @@ namespace CefSharp } } - virtual int Seek(int64 offset, int whence) OVERRIDE + virtual int Seek(int64_t offset, int whence) override { System::IO::SeekOrigin seekOrigin; @@ -93,23 +93,23 @@ namespace CefSharp return 0; } - virtual int64 Tell() OVERRIDE + virtual int64_t Tell() override { - return static_cast(_stream->Position); + return static_cast(_stream->Position); } - virtual int Flush() OVERRIDE + virtual int Flush() override { _stream->Flush(); return 0; } - virtual bool MayBlock() OVERRIDE + virtual bool MayBlock() override { return !_isMemoryStream; } - IMPLEMENT_REFCOUNTING(CefWriteHandlerWrapper); + IMPLEMENT_REFCOUNTINGM(CefWriteHandlerWrapper); }; } } diff --git a/CefSharp.Core/Internals/ClientAdapter.cpp b/CefSharp.Core.Runtime/Internals/ClientAdapter.cpp similarity index 65% rename from CefSharp.Core/Internals/ClientAdapter.cpp rename to CefSharp.Core.Runtime/Internals/ClientAdapter.cpp index 43543ccfb6..91808c0b4f 100644 --- a/CefSharp.Core/Internals/ClientAdapter.cpp +++ b/CefSharp.Core.Runtime/Internals/ClientAdapter.cpp @@ -13,28 +13,27 @@ #include "CefCertificateCallbackWrapper.h" #include "CefContextMenuParamsWrapper.h" #include "CefDownloadItemCallbackWrapper.h" -#include "CefDragDataWrapper.h" +#include "DragData.h" #include "CefFileDialogCallbackWrapper.h" #include "CefFrameWrapper.h" #include "CefJSDialogCallbackWrapper.h" #include "CefMenuModelWrapper.h" -#include "CefRequestWrapper.h" -#include "CefResponseWrapper.h" -#include "CefResponseFilterAdapter.h" +#include "Request.h" +#include "CefResourceRequestHandlerAdapter.h" #include "CefRequestCallbackWrapper.h" #include "CefRunContextMenuCallbackWrapper.h" +#include "CefPermissionPromptCallbackWrapper.h" #include "CefSslInfoWrapper.h" -#include "CefSharpBrowserWrapper.h" +#include "CefBrowserWrapper.h" +#include "CefMediaAccessCallbackWrapper.h" #include "ManagedCefBrowserAdapter.h" #include "Messaging\Messages.h" #include "PopupFeatures.h" -#include "ResourceHandlerWrapper.h" #include "Serialization\Primitives.h" #include "Serialization\V8Serialization.h" #include "Serialization\JsObjectsSerialization.h" #include "Serialization\ObjectsSerialization.h" #include "TypeConversion.h" - #include "WindowInfo.h" using namespace CefSharp::Internals::Messaging; @@ -54,8 +53,18 @@ namespace CefSharp return _browser; } + //IJavascriptCallbacks that are finalized after the browser has been Disposed + //but before the IBrowserAdapter.IsDisposed is set might end up here + //attempting to access _popupBrowsers which has been set to null already. + auto popupBrowsers = _popupBrowsers; + + if (Object::ReferenceEquals(popupBrowsers, nullptr)) + { + return nullptr; + } + IBrowser^ popupBrowser; - if (_popupBrowsers->TryGetValue(browserId, popupBrowser)) + if (popupBrowsers->TryGetValue(browserId, popupBrowser)) { return popupBrowser; } @@ -66,23 +75,62 @@ namespace CefSharp IBrowser^ ClientAdapter::GetBrowserWrapper(int browserId, bool isPopup) { + if (!isPopup) + { + return _browser; + } + + IBrowser^ popupBrowser; + if (_popupBrowsers->TryGetValue(browserId, popupBrowser)) + { + return popupBrowser; + } + + // For popups that were hosted using a ChromiumWebBrowser instance if (_browserControl->HasParent) { return _browser; } - if (isPopup) + return nullptr; + } + + // Is a main browser if isPopuo == false or the IBrowser instance is directly associated + // with the ChromiumWebBrowser instance. Should be true in cases + // where ChromiumWebBrowser is instanciated directly or + // when a popup is hosted in a ChromiumWebBrowser instance + // For popups hosted in ChromiumWebBrowser instances it's important + // that DevTools popups return false; + bool ClientAdapter::IsMainBrowser(bool isPopup, int browserId) + { + // Main browser is always true + if (!isPopup) { - IBrowser^ popupBrowser; - if (_popupBrowsers->TryGetValue(browserId, popupBrowser)) - { - return popupBrowser; - } + return true; + } - return nullptr; + // If popup and HasParent == false then always false + if (!_browserControl->HasParent) + { + return false; } - return _browser; + // This method is called from OnAfterCreated before _cefBrowser is set + // If the _cefBrowser reference is null then this should be a ChromiumWebBrowser + // hosted as a popup + if (!_cefBrowser.get()) + { + return true; + } + + // For popups hosted in ChromiumWebBrowser instance directly (non DevTools popup) + // then return true; + if (_cefBrowser->GetIdentifier() == browserId) + { + return true; + } + + return false; } void ClientAdapter::CloseAllPopups(bool forceClose) @@ -100,10 +148,10 @@ namespace CefSharp } } - bool ClientAdapter::OnBeforePopup(CefRefPtr browser, CefRefPtr frame, const CefString& target_url, + bool ClientAdapter::OnBeforePopup(CefRefPtr browser, CefRefPtr frame, int popup_id, const CefString& target_url, const CefString& target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, - CefRefPtr& client, CefBrowserSettings& settings, bool* no_javascript_access) + CefRefPtr& client, CefBrowserSettings& settings, CefRefPtr& extraInfo, bool* no_javascript_access) { auto handler = _browserControl->LifeSpanHandler; @@ -167,16 +215,11 @@ namespace CefSharp void ClientAdapter::OnAfterCreated(CefRefPtr browser) { - auto browserWrapper = gcnew CefSharpBrowserWrapper(browser); + BrowserRefCounter::Instance->Increment(_browserControl->GetType()); - auto isPopup = browser->IsPopup() && !_browserControl->HasParent; + auto browserWrapper = gcnew CefBrowserWrapper(browser); - if (isPopup) - { - // Add to the list of popup browsers. - _popupBrowsers->Add(browser->GetIdentifier(), browserWrapper); - } - else + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _browserHwnd = browser->GetHost()->GetWindowHandle(); _cefBrowser = browser; @@ -188,13 +231,16 @@ namespace CefSharp _browserAdapter->OnAfterBrowserCreated(browserWrapper); } } + else + { + // Add to the list of popup browsers. + _popupBrowsers->Add(browser->GetIdentifier(), browserWrapper); + } auto handler = _browserControl->LifeSpanHandler; if (handler != nullptr) { - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), isPopup); - handler->OnAfterCreated(_browserControl, browserWrapper); } } @@ -208,7 +254,7 @@ namespace CefSharp //By this point it's possible IBrowser references have been disposed //Rather than attempting to rework the rather complex closing logic //It's easier to pass in a new wrapper and dispose it straight away - CefSharpBrowserWrapper browserWrapper(browser); + CefBrowserWrapper browserWrapper(browser); return handler->DoClose(_browserControl, %browserWrapper); } @@ -218,7 +264,6 @@ namespace CefSharp void ClientAdapter::OnBeforeClose(CefRefPtr browser) { - auto isPopup = browser->IsPopup() && !_browserControl->HasParent; auto handler = _browserControl->LifeSpanHandler; if (handler != nullptr) @@ -226,25 +271,25 @@ namespace CefSharp //By this point it's possible IBrowser references have been disposed //Rather than attempting to rework the rather complex closing logic //It's easier to pass in a new wrapper and dispose it straight away - CefSharpBrowserWrapper browserWrapper(browser); + CefBrowserWrapper browserWrapper(browser); handler->OnBeforeClose(_browserControl, %browserWrapper); } - if (isPopup) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) + { + _cefBrowser = nullptr; + } + else { // Remove from the browser popup list. auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), true); _popupBrowsers->Remove(browser->GetIdentifier()); - // Dispose the CefSharpBrowserWrapper + // Dispose the CefBrowserWrapper delete browserWrapper; } - //TODO: When creating a new ChromiumWebBrowser and passing in a newBrowser to OnBeforePopup - //the handles don't match up (at least in WPF), need to investigate further. - else if (_browserHwnd == browser->GetHost()->GetWindowHandle() || _browserControl->HasParent) - { - _cefBrowser = NULL; - } + + BrowserRefCounter::Instance->Decrement(_browserControl->GetType()); } void ClientAdapter::OnLoadingStateChange(CefRefPtr browser, bool isLoading, bool canGoBack, bool canGoForward) @@ -252,7 +297,7 @@ namespace CefSharp auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); auto args = gcnew LoadingStateChangedEventArgs(browserWrapper, canGoBack, canGoForward, isLoading); - if (!browser->IsPopup()) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _browserControl->SetLoadingStateChange(args); } @@ -270,7 +315,7 @@ namespace CefSharp auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); auto args = gcnew AddressChangedEventArgs(browserWrapper, StringUtils::ToClr(address)); - if (!browser->IsPopup()) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _browserControl->SetAddress(args); } @@ -285,31 +330,73 @@ namespace CefSharp bool ClientAdapter::OnAutoResize(CefRefPtr browser, const CefSize& new_size) { + auto handler = _browserControl->DisplayHandler; + + if (handler == nullptr) + { + return false; + } + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + return handler->OnAutoResize(_browserControl, browserWrapper, CefSharp::Structs::Size(new_size.width, new_size.height)); + } + + bool ClientAdapter::OnCursorChange(CefRefPtr browser, CefCursorHandle cursor, cef_cursor_type_t type, const CefCursorInfo& custom_cursor_info) + { auto handler = _browserControl->DisplayHandler; if (handler == nullptr) { + InternalCursorChange(browser, cursor, type, custom_cursor_info); + return false; + } + + CursorInfo customCursorInfo; + + //TODO: this is duplicated in RenderClientAdapter::InternalCursorChange + //Only create the struct when we actually have a custom cursor + if (type == cef_cursor_type_t::CT_CUSTOM) + { + Point hotspot = Point(custom_cursor_info.hotspot.x, custom_cursor_info.hotspot.y); + Size size = Size(custom_cursor_info.size.width, custom_cursor_info.size.height); + customCursorInfo = CursorInfo(IntPtr((void*)custom_cursor_info.buffer), hotspot, custom_cursor_info.image_scale_factor, size); } - return handler->OnAutoResize(_browserControl, browserWrapper, CefSharp::Structs::Size(new_size.width, new_size.height)); + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + + auto handled = handler->OnCursorChange(_browserControl, browserWrapper, (IntPtr)cursor, (CefSharp::Enums::CursorType)type, customCursorInfo); + + if (handled) + { + return true; + } + + InternalCursorChange(browser, cursor, type, custom_cursor_info); + + return false; + }; + + void ClientAdapter::InternalCursorChange(CefRefPtr browser, CefCursorHandle cursor, cef_cursor_type_t type, const CefCursorInfo& custom_cursor_info) + { + } void ClientAdapter::OnTitleChange(CefRefPtr browser, const CefString& title) { - auto args = gcnew TitleChangedEventArgs(StringUtils::ToClr(title)); + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + auto args = gcnew TitleChangedEventArgs(browserWrapper, StringUtils::ToClr(title)); - if (browser->IsPopup() && !_browserControl->HasParent) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { - // Set the popup window title - auto hwnd = browser->GetHost()->GetWindowHandle(); - SetWindowText(hwnd, std::wstring(title).c_str()); + _browserControl->SetTitle(args); } else { - _browserControl->SetTitle(args); + // Set the popup window title + auto hwnd = browser->GetHost()->GetWindowHandle(); + SetWindowText(hwnd, std::wstring(title).c_str()); } auto handler = _browserControl->DisplayHandler; @@ -363,7 +450,7 @@ namespace CefSharp bool returnFlag = true; //NOTE: Only called if tooltip changed otherwise called many times - // also only called when using OSR, https://bitbucket.org/chromiumembedded/cef/issues/783 + // also only called when using OSR, https://github.com/chromiumembedded/cef/issues/783 if (hasChanged) { @@ -373,7 +460,7 @@ namespace CefSharp returnFlag = handler->OnTooltipChanged(_browserControl, tooltip); } - if (!browser->IsPopup()) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _tooltip = tooltip; _browserControl->SetTooltipText(_tooltip); @@ -385,9 +472,11 @@ namespace CefSharp bool ClientAdapter::OnConsoleMessage(CefRefPtr browser, cef_log_severity_t level, const CefString& message, const CefString& source, int line) { - auto args = gcnew ConsoleMessageEventArgs((LogSeverity)level, StringUtils::ToClr(message), StringUtils::ToClr(source), line); + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - if (!browser->IsPopup()) + auto args = gcnew ConsoleMessageEventArgs(browserWrapper, (LogSeverity)level, StringUtils::ToClr(message), StringUtils::ToClr(source), line); + + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _browserControl->OnConsoleMessage(args); } @@ -406,7 +495,7 @@ namespace CefSharp auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); auto args = gcnew StatusMessageEventArgs(browserWrapper, StringUtils::ToClr(value)); - if (!browser->IsPopup()) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _browserControl->OnStatusMessage(args); } @@ -457,7 +546,7 @@ namespace CefSharp auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); CefFrameWrapper frameWrapper(frame); - if (!browser->IsPopup()) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _browserControl->OnFrameLoadStart(gcnew FrameLoadStartEventArgs(browserWrapper, %frameWrapper, (CefSharp::TransitionType)transitionType)); } @@ -474,7 +563,7 @@ namespace CefSharp auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); CefFrameWrapper frameWrapper(frame); - if (!browser->IsPopup()) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _browserControl->OnFrameLoadEnd(gcnew FrameLoadEndEventArgs(browserWrapper, %frameWrapper, httpStatusCode)); } @@ -492,7 +581,7 @@ namespace CefSharp auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); CefFrameWrapper frameWrapper(frame); - if (!browser->IsPopup()) + if (IsMainBrowser(browser->IsPopup(), browser->GetIdentifier())) { _browserControl->OnLoadError(gcnew LoadErrorEventArgs(browserWrapper, %frameWrapper, (CefErrorCode)errorCode, StringUtils::ToClr(errorText), StringUtils::ToClr(failedUrl))); @@ -518,7 +607,7 @@ namespace CefSharp auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); CefFrameWrapper frameWrapper(frame); - CefRequestWrapper requestWrapper(request); + Request requestWrapper(request); return handler->OnBeforeBrowse(_browserControl, browserWrapper, %frameWrapper, %requestWrapper, userGesture, isRedirect); } @@ -539,149 +628,48 @@ namespace CefSharp return handler->OnOpenUrlFromTab(_browserControl, browserWrapper, %frameWrapper, StringUtils::ToClr(targetUrl), (CefSharp::WindowOpenDisposition)targetDisposition, userGesture); } - bool ClientAdapter::OnCertificateError(CefRefPtr browser, cef_errorcode_t cert_error, const CefString& request_url, CefRefPtr ssl_info, CefRefPtr callback) - { - auto handler = _browserControl->RequestHandler; - - if (handler == nullptr) - { - return false; - } - - // If callback is empty the error cannot be recovered from and the request will be canceled automatically. - // Still notify the user of the certificate error just don't provide a callback. - auto requestCallback = callback == NULL ? nullptr : gcnew CefRequestCallbackWrapper(callback); - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - auto sslInfoWrapper = gcnew CefSslInfoWrapper(ssl_info); - - return handler->OnCertificateError(_browserControl, browserWrapper, (CefErrorCode)cert_error, StringUtils::ToClr(request_url), sslInfoWrapper, requestCallback); - } - - bool ClientAdapter::CanGetCookies(CefRefPtr browser, CefRefPtr frame, CefRefPtr request) - { - auto handler = _browserControl->RequestHandler; - - if (handler == nullptr) - { - return true; - } - - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - CefFrameWrapper frameWrapper(frame); - CefRequestWrapper requestWrapper(request); - - return handler->CanGetCookies(_browserControl, browserWrapper, %frameWrapper, %requestWrapper); - } - - bool ClientAdapter::CanSetCookie(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, const CefCookie& cefCookie) + CefRefPtr ClientAdapter::GetResourceRequestHandler(CefRefPtr browser, + CefRefPtr frame, CefRefPtr request, bool isNavigation, bool isDownload, const CefString& requestInitiator, bool& disableDefaultHandling) { auto handler = _browserControl->RequestHandler; + auto resourceRequestHandlerFactory = _browserControl->ResourceRequestHandlerFactory; - if (handler == nullptr) + //No handler and no factory, we'll just return null + if (handler == nullptr && resourceRequestHandlerFactory == nullptr) { - return true; + return nullptr; } auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); CefFrameWrapper frameWrapper(frame); - CefRequestWrapper requestWrapper(request); - - auto cookie = TypeConversion::FromNative(cefCookie); - - return handler->CanSetCookie(_browserControl, browserWrapper, %frameWrapper, %requestWrapper, cookie); - } - - bool ClientAdapter::OnQuotaRequest(CefRefPtr browser, const CefString& originUrl, int64 newSize, CefRefPtr callback) - { - auto handler = _browserControl->RequestHandler; - - if (handler == nullptr) - { - return false; - } - - auto requestCallback = gcnew CefRequestCallbackWrapper(callback); - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - - return handler->OnQuotaRequest(_browserControl, browserWrapper, StringUtils::ToClr(originUrl), newSize, requestCallback); - } - - void ClientAdapter::OnPluginCrashed(CefRefPtr browser, const CefString& plugin_path) - { - auto handler = _browserControl->RequestHandler; + Request requestWrapper(request); if (handler != nullptr) { - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - - handler->OnPluginCrashed(_browserControl, browserWrapper, StringUtils::ToClr(plugin_path)); - } - } + auto resourceRequestHandler = handler->GetResourceRequestHandler(_browserControl, browserWrapper, %frameWrapper, + %requestWrapper, isNavigation, isDownload, StringUtils::ToClr(requestInitiator), disableDefaultHandling); - void ClientAdapter::OnRenderViewReady(CefRefPtr browser) - { - if (CefSharpSettings::LegacyJavascriptBindingEnabled) - { - if (!Object::ReferenceEquals(_browserAdapter, nullptr) && !_browserAdapter->IsDisposed && !browser->IsPopup()) + if (resourceRequestHandler != nullptr) { - auto objectRepository = _browserAdapter->JavascriptObjectRepository; - - //For legacy binding we only send kJavascriptRootObjectResponse when we have bound objects - if (objectRepository->HasBoundObjects) - { - auto msg = CefProcessMessage::Create(kJavascriptRootObjectResponse); - auto responseArgList = msg->GetArgumentList(); - responseArgList->SetBool(0, true); //Use Legacy Behaviour (auto bind on context creation) - responseArgList->SetInt(1, -1); //BrowserId - SetInt64(responseArgList, 2, 0); //FrameId - SetInt64(responseArgList, 3, 0); //CallbackId - SerializeJsObjects(objectRepository->GetObjects(nullptr), responseArgList, 4); - browser->SendProcessMessage(CefProcessId::PID_RENDERER, msg); - } + return new CefResourceRequestHandlerAdapter(_browserControl, resourceRequestHandler); } } - auto handler = _browserControl->RequestHandler; - - if (handler != nullptr) - { - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - - handler->OnRenderViewReady(_browserControl, browserWrapper); - } - } - - void ClientAdapter::OnRenderProcessTerminated(CefRefPtr browser, TerminationStatus status) - { - auto handler = _browserControl->RequestHandler; - - if (handler != nullptr) + if (resourceRequestHandlerFactory != nullptr && resourceRequestHandlerFactory->HasHandlers) { - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + auto factoryHandler = resourceRequestHandlerFactory->GetResourceRequestHandler(_browserControl, browserWrapper, %frameWrapper, + %requestWrapper, isNavigation, isDownload, StringUtils::ToClr(requestInitiator), disableDefaultHandling); - handler->OnRenderProcessTerminated(_browserControl, browserWrapper, (CefTerminationStatus)status); + if (factoryHandler != nullptr) + { + return new CefResourceRequestHandlerAdapter(_browserControl, factoryHandler); + } } - } - - void ClientAdapter::OnResourceRedirect(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response, CefString& newUrl) - { - auto handler = _browserControl->RequestHandler; - if (handler != nullptr) - { - auto managedNewUrl = StringUtils::ToClr(newUrl); - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - CefFrameWrapper frameWrapper(frame); - CefRequestWrapper requestWrapper(request); - CefResponseWrapper responseWrapper(response); - - handler->OnResourceRedirect(_browserControl, browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper, managedNewUrl); - - newUrl = StringUtils::ToNative(managedNewUrl); - } + return nullptr; } - bool ClientAdapter::OnResourceResponse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response) + bool ClientAdapter::OnCertificateError(CefRefPtr browser, cef_errorcode_t cert_error, const CefString& request_url, CefRefPtr ssl_info, CefRefPtr callback) { auto handler = _browserControl->RequestHandler; @@ -690,54 +678,42 @@ namespace CefSharp return false; } + // If callback is empty the error cannot be recovered from and the request will be canceled automatically. + // Still notify the user of the certificate error just don't provide a callback. + auto requestCallback = callback == nullptr ? nullptr : gcnew CefRequestCallbackWrapper(callback); auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - CefFrameWrapper frameWrapper(frame); - CefRequestWrapper requestWrapper(request); - CefResponseWrapper responseWrapper(response); + auto sslInfoWrapper = gcnew CefSslInfoWrapper(ssl_info); - return handler->OnResourceResponse(_browserControl, browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper); + return handler->OnCertificateError(_browserControl, browserWrapper, (CefErrorCode)cert_error, StringUtils::ToClr(request_url), sslInfoWrapper, requestCallback); } - CefRefPtr ClientAdapter::GetResourceResponseFilter(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response) + void ClientAdapter::OnRenderViewReady(CefRefPtr browser) { auto handler = _browserControl->RequestHandler; - if (handler == nullptr) + if (handler != nullptr) { - return NULL; - } - - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - CefFrameWrapper frameWrapper(frame); - CefRequestWrapper requestWrapper(request); - CefResponseWrapper responseWrapper(response); - - auto filter = handler->GetResourceResponseFilter(_browserControl, browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper); + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - if (filter == nullptr) - { - return NULL; + handler->OnRenderViewReady(_browserControl, browserWrapper); } - - return new CefResponseFilterAdapter(filter); } - void ClientAdapter::OnResourceLoadComplete(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response, URLRequestStatus status, int64 receivedContentLength) + void ClientAdapter::OnRenderProcessTerminated(CefRefPtr browser, TerminationStatus status, int errorCode, const CefString& errorString) { + _pendingTaskRepository->CancelPendingTasks(); + auto handler = _browserControl->RequestHandler; if (handler != nullptr) { auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - CefFrameWrapper frameWrapper(frame); - CefRequestWrapper requestWrapper(request); - CefResponseWrapper responseWrapper(response); - handler->OnResourceLoadComplete(_browserControl, browserWrapper, %frameWrapper, %requestWrapper, %responseWrapper, (UrlRequestStatus)status, receivedContentLength); + handler->OnRenderProcessTerminated(_browserControl, browserWrapper, (CefTerminationStatus)status, errorCode, StringUtils::ToClr(errorString)); } } - void ClientAdapter::OnProtocolExecution(CefRefPtr browser, const CefString& url, bool& allowOSExecution) + void ClientAdapter::OnDocumentAvailableInMainFrame(CefRefPtr browser) { auto handler = _browserControl->RequestHandler; @@ -745,86 +721,11 @@ namespace CefSharp { auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - allowOSExecution = handler->OnProtocolExecution(_browserControl, browserWrapper, StringUtils::ToClr(url)); + handler->OnDocumentAvailableInMainFrame(_browserControl, browserWrapper); } } - // Called on the IO thread before a resource is loaded. To allow the resource - // to load normally return NULL. To specify a handler for the resource return - // a CefResourceHandler object. The |request| object should not be modified in - // this callback. - CefRefPtr ClientAdapter::GetResourceHandler(CefRefPtr browser, CefRefPtr frame, CefRefPtr request) - { - auto factory = _browserControl->ResourceHandlerFactory; - - if (factory == nullptr || !factory->HasHandlers) - { - return NULL; - } - - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - CefFrameWrapper frameWrapper(frame); - CefRequestWrapper requestWrapper(request); - - auto handler = factory->GetResourceHandler(_browserControl, browserWrapper, %frameWrapper, %requestWrapper); - - if (handler == nullptr) - { - return NULL; - } - - if (handler->GetType() == FileResourceHandler::typeid) - { - auto resourceHandler = static_cast(handler); - - auto streamReader = CefStreamReader::CreateForFile(StringUtils::ToNative(resourceHandler->FilePath)); - - if (streamReader.get()) - { - return new CefStreamResourceHandler(StringUtils::ToNative(resourceHandler->MimeType), streamReader); - } - else - { - auto msg = "Unable to load resource CefStreamReader::CreateForFile returned NULL for file:" + resourceHandler->FilePath; - LOG(ERROR) << StringUtils::ToNative(msg).ToString(); - - return NULL; - } - } - else if (handler->GetType() == ByteArrayResourceHandler::typeid) - { - auto resourceHandler = static_cast(handler); - - //NOTE: Prefix with cli:: namespace as VS2015 gets confused with std::array - cli::array^ buffer = resourceHandler->Data; - pin_ptr src = &buffer[0]; - - auto streamReader = CefStreamReader::CreateForData(static_cast(src), buffer->Length); - - return new CefStreamResourceHandler(StringUtils::ToNative(resourceHandler->MimeType), streamReader); - } - - return new ResourceHandlerWrapper(handler); - } - - cef_return_value_t ClientAdapter::OnBeforeResourceLoad(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr callback) - { - auto handler = _browserControl->RequestHandler; - - if (handler == nullptr) - { - return cef_return_value_t::RV_CONTINUE; - } - - auto frameWrapper = gcnew CefFrameWrapper(frame); - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - auto requestWrapper = gcnew CefRequestWrapper(request); - auto requestCallback = gcnew CefRequestCallbackWrapper(callback, frameWrapper, requestWrapper); - - return (cef_return_value_t)handler->OnBeforeResourceLoad(_browserControl, browserWrapper, frameWrapper, requestWrapper, requestCallback); - } - - bool ClientAdapter::GetAuthCredentials(CefRefPtr browser, CefRefPtr frame, bool isProxy, + bool ClientAdapter::GetAuthCredentials(CefRefPtr browser, const CefString& originUrl, bool isProxy, const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr callback) { if (isProxy && CefSharpSettings::Proxy != nullptr && CefSharpSettings::Proxy->IP == StringUtils::ToClr(host) && CefSharpSettings::Proxy->HasUsernameAndPassword()) @@ -841,11 +742,10 @@ namespace CefSharp } auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - auto frameWrapper = gcnew CefFrameWrapper(frame); - auto callbackWrapper = gcnew CefAuthCallbackWrapper(callback, frameWrapper); + auto callbackWrapper = gcnew CefAuthCallbackWrapper(callback); return handler->GetAuthCredentials( - _browserControl, browserWrapper, frameWrapper, isProxy, + _browserControl, browserWrapper, StringUtils::ToClr(originUrl), isProxy, StringUtils::ToClr(host), port, StringUtils::ToClr(realm), StringUtils::ToClr(scheme), callbackWrapper); } @@ -862,9 +762,10 @@ namespace CefSharp } auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - auto callbackWrapper = gcnew CefCertificateCallbackWrapper(callback, certificates); auto list = gcnew X509Certificate2Collection(); + // Create a copy of the vector in an attempt to fix #2948 + CefRequestHandler::X509CertificateList certs; std::vector >::const_iterator it = certificates.begin(); @@ -879,8 +780,12 @@ namespace CefSharp bytes->GetData(static_cast(src), byteSize, 0); auto cert = gcnew X509Certificate2(bufferByte); list->Add(cert); + + certs.push_back(*it); } + auto callbackWrapper = gcnew CefCertificateCallbackWrapper(callback, certs); + return handler->OnSelectClientCertificate( _browserControl, browserWrapper, isProxy, StringUtils::ToClr(host), port, list, callbackWrapper); @@ -979,7 +884,7 @@ namespace CefSharp //For DevTools (which is hosted as a popup) OnSetFocus is called before OnAfterCreated so we don't // have a reference to the standard popup IBrowser wrapper, so we just pass a // short term reference. - CefSharpBrowserWrapper browserWrapper(browser); + CefBrowserWrapper browserWrapper(browser); return handler->OnSetFocus(_browserControl, %browserWrapper, (CefFocusSource)source); } @@ -1055,8 +960,13 @@ namespace CefSharp } } - bool ClientAdapter::OnFileDialog(CefRefPtr browser, FileDialogMode mode, const CefString& title, - const CefString& default_file_path, const std::vector& accept_filters, int selected_accept_filter, + bool ClientAdapter::OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + const std::vector& accept_extensions, + const std::vector& accept_descriptions, CefRefPtr callback) { auto handler = _browserControl->DialogHandler; @@ -1069,18 +979,15 @@ namespace CefSharp auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); auto callbackWrapper = gcnew CefFileDialogCallbackWrapper(callback); - auto dialogMode = mode & FileDialogMode::FILE_DIALOG_TYPE_MASK; - auto dialogFlags = mode & ~FileDialogMode::FILE_DIALOG_TYPE_MASK; - return handler->OnFileDialog( _browserControl, browserWrapper, - (CefFileDialogMode)dialogMode, - (CefFileDialogFlags)dialogFlags, + (CefFileDialogMode)mode, StringUtils::ToClr(title), StringUtils::ToClr(default_file_path), StringUtils::ToClr(accept_filters), - selected_accept_filter, + StringUtils::ToClr(accept_extensions), + StringUtils::ToClr(accept_descriptions), callbackWrapper); } @@ -1093,13 +1000,13 @@ namespace CefSharp return false; } - CefDragDataWrapper dragDataWrapper(dragData); + DragData dragDataWrapper(dragData); auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); return handler->OnDragEnter(_browserControl, browserWrapper, %dragDataWrapper, (CefSharp::Enums::DragOperationsMask)mask); } - void ClientAdapter::OnDraggableRegionsChanged(CefRefPtr browser, const std::vector& regions) + void ClientAdapter::OnDraggableRegionsChanged(CefRefPtr browser, CefRefPtr frame, const std::vector& regions) { auto handler = _browserControl->DragHandler; @@ -1107,26 +1014,43 @@ namespace CefSharp { auto regionsList = TypeConversion::FromNative(regions); auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + CefFrameWrapper frameWrapper(frame); - return handler->OnDraggableRegionsChanged(_browserControl, browserWrapper, regionsList); + return handler->OnDraggableRegionsChanged(_browserControl, browserWrapper, %frameWrapper, regionsList); } } - void ClientAdapter::OnBeforeDownload(CefRefPtr browser, CefRefPtr download_item, - const CefString& suggested_name, CefRefPtr callback) + bool ClientAdapter::CanDownload(CefRefPtr browser, const CefString& url, const CefString& request_method) { auto handler = _browserControl->DownloadHandler; - if (handler != nullptr) + if (handler == nullptr) { - auto downloadItem = TypeConversion::FromNative(download_item); - downloadItem->SuggestedFileName = StringUtils::ToClr(suggested_name); + return true; + } - auto callbackWrapper = gcnew CefBeforeDownloadCallbackWrapper(callback); - auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + + return handler->CanDownload(_browserControl, browserWrapper, StringUtils::ToClr(url), StringUtils::ToClr(request_method)); + } + + bool ClientAdapter::OnBeforeDownload(CefRefPtr browser, CefRefPtr download_item, + const CefString& suggested_name, CefRefPtr callback) + { + auto handler = _browserControl->DownloadHandler; - handler->OnBeforeDownload(_browserControl, browserWrapper, downloadItem, callbackWrapper); + if (handler == nullptr) + { + return false; } + + auto downloadItem = TypeConversion::FromNative(download_item); + downloadItem->SuggestedFileName = StringUtils::ToClr(suggested_name); + + auto callbackWrapper = gcnew CefBeforeDownloadCallbackWrapper(callback); + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + + return handler->OnBeforeDownload(_browserControl, browserWrapper, downloadItem, callbackWrapper); }; void ClientAdapter::OnDownloadUpdated(CefRefPtr browser, CefRefPtr download_item, @@ -1156,7 +1080,44 @@ namespace CefSharp } } - void ClientAdapter::OnAudioStreamStarted(CefRefPtr browser, int audio_stream_id, int channels, ChannelLayout channel_layout, int sample_rate, int frames_per_buffer) + bool ClientAdapter::GetAudioParameters(CefRefPtr browser, CefAudioParameters & params) + { + auto handler = _browserControl->AudioHandler; + + if (handler == nullptr) + { + return false; + } + + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + auto parameters = new AudioParameters((CefSharp::Enums::ChannelLayout)params.channel_layout, params.sample_rate, params.frames_per_buffer); + + auto result = handler->GetAudioParameters(_browserControl, browserWrapper, *parameters); + + if (result) + { + params.channel_layout = (cef_channel_layout_t)parameters->ChannelLayout; + params.sample_rate = parameters->SampleRate; + params.frames_per_buffer = parameters->FramesPerBuffer; + } + + return result; + } + + void ClientAdapter::OnAudioStreamStarted(CefRefPtr browser, const CefAudioParameters& params, int channels) + { + auto handler = _browserControl->AudioHandler; + + if (handler != nullptr) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + AudioParameters parameters((CefSharp::Enums::ChannelLayout)params.channel_layout, params.sample_rate, params.frames_per_buffer); + + handler->OnAudioStreamStarted(_browserControl, browserWrapper, parameters, channels); + } + } + + void ClientAdapter::OnAudioStreamPacket(CefRefPtr browser, const float** data, int frames, int64_t pts) { auto handler = _browserControl->AudioHandler; @@ -1164,11 +1125,11 @@ namespace CefSharp { auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - handler->OnAudioStreamStarted(_browserControl, browserWrapper, audio_stream_id, channels, (CefSharp::Enums::ChannelLayout)channel_layout, sample_rate, frames_per_buffer); + handler->OnAudioStreamPacket(_browserControl, browserWrapper, IntPtr((void *)data), frames, pts); } } - void ClientAdapter::OnAudioStreamPacket(CefRefPtr browser, int audio_stream_id, const float** data, int frames, int64 pts) + void ClientAdapter::OnAudioStreamStopped(CefRefPtr browser) { auto handler = _browserControl->AudioHandler; @@ -1176,11 +1137,11 @@ namespace CefSharp { auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - handler->OnAudioStreamPacket(_browserControl, browserWrapper, audio_stream_id, IntPtr((void *)data), frames, pts); + handler->OnAudioStreamStopped(_browserControl, browserWrapper); } } - void ClientAdapter::OnAudioStreamStopped(CefRefPtr browser, int audio_stream_id) + void ClientAdapter::OnAudioStreamError(CefRefPtr browser, const CefString& message) { auto handler = _browserControl->AudioHandler; @@ -1188,86 +1149,220 @@ namespace CefSharp { auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - handler->OnAudioStreamStopped(_browserControl, browserWrapper, audio_stream_id); + handler->OnAudioStreamError(_browserControl, browserWrapper, StringUtils::ToClr(message)); } } - bool ClientAdapter::OnProcessMessageReceived(CefRefPtr browser, CefProcessId source_process, CefRefPtr message) + void ClientAdapter::OnFrameCreated(CefRefPtr browser, CefRefPtr frame) { + auto handler = _browserControl->FrameHandler; + + if (handler != nullptr) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + auto frameWrapper = gcnew CefFrameWrapper(frame); + + if (browserWrapper == nullptr) + { + // Very first OnFrameCreated called may happen before OnAfterCreated + // so we have to create a new wrapper that's lifespan is scoped to this single call. + CefBrowserWrapper browserWrapper(browser); + + handler->OnFrameCreated(_browserControl, %browserWrapper, frameWrapper); + } + else + { + handler->OnFrameCreated(_browserControl, browserWrapper, frameWrapper); + } + } + } + + void ClientAdapter::OnFrameAttached(CefRefPtr browser, CefRefPtr frame, bool reattached) + { + auto handler = _browserControl->FrameHandler; + + if (handler != nullptr) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + CefFrameWrapper frameWrapper(frame); + + handler->OnFrameAttached(_browserControl, browserWrapper, % frameWrapper, reattached); + } + } + + void ClientAdapter::OnFrameDetached(CefRefPtr browser, CefRefPtr frame) + { + auto handler = _browserControl->FrameHandler; + + if (handler != nullptr) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + CefFrameWrapper frameWrapper(frame); + + handler->OnFrameDetached(_browserControl, browserWrapper, % frameWrapper); + } + } + + void ClientAdapter::OnMainFrameChanged(CefRefPtr browser, CefRefPtr oldFrame, CefRefPtr newFrame) + { + auto handler = _browserControl->FrameHandler; + + if (handler != nullptr) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + + CefFrameWrapper^ oldFrameWrapper = nullptr; + if (oldFrame.get()) + { + oldFrameWrapper = gcnew CefFrameWrapper(oldFrame); + } + + CefFrameWrapper^ newFrameWrapper = nullptr; + if (newFrame.get()) + { + newFrameWrapper = gcnew CefFrameWrapper(newFrame); + } + + handler->OnMainFrameChanged(_browserControl, browserWrapper, oldFrameWrapper, newFrameWrapper); + + delete oldFrameWrapper; + delete newFrameWrapper; + } + } + + bool ClientAdapter::OnShowPermissionPrompt(CefRefPtr browser, uint64_t prompt_id, + const CefString& requesting_origin, uint32_t requested_permissions, + CefRefPtr callback) + { + auto handler = _browserControl->PermissionHandler; + if (handler != nullptr) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + auto callbackWrapper = gcnew CefPermissionPromptCallbackWrapper(callback); + + return handler->OnShowPermissionPrompt(_browserControl, browserWrapper, prompt_id, StringUtils::ToClr(requesting_origin), (PermissionRequestType)requested_permissions, callbackWrapper); + } + + return false; + } + + void ClientAdapter::OnDismissPermissionPrompt(CefRefPtr browser, uint64_t prompt_id, + cef_permission_request_result_t result) + { + auto handler = _browserControl->PermissionHandler; + if (handler != nullptr) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + + handler->OnDismissPermissionPrompt(_browserControl, browserWrapper, prompt_id, (PermissionRequestResult)result); + } + } + + bool ClientAdapter::OnRequestMediaAccessPermission(CefRefPtr browser, CefRefPtr frame, + const CefString& requesting_origin, uint32_t requested_permissions, + CefRefPtr callback) + { + auto handler = _browserControl->PermissionHandler; + if (handler != nullptr) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + CefFrameWrapper frameWrapper(frame); + auto callbackWrapper = gcnew CefMediaAccessCallbackWrapper(callback); + + return handler->OnRequestMediaAccessPermission(_browserControl, browserWrapper, %frameWrapper, StringUtils::ToClr(requesting_origin), (MediaAccessPermissionType)requested_permissions, callbackWrapper); + } + return false; + } + + bool ClientAdapter::OnProcessMessageReceived(CefRefPtr browser, CefRefPtr frame, CefProcessId source_process, CefRefPtr message) + { + if (_disposed) + { + return true; + } + auto handled = false; auto name = message->GetName(); auto argList = message->GetArgumentList(); - IJavascriptCallbackFactory^ callbackFactory = _browserAdapter->JavascriptCallbackFactory; //TODO: JSB Rename messages (remove Root from name) if (name == kJavascriptRootObjectRequest) { - if (!Object::ReferenceEquals(_browserAdapter, nullptr) && !_browserAdapter->IsDisposed) + auto browserAdapter = _browserAdapter; + if (Object::ReferenceEquals(browserAdapter, nullptr) || browserAdapter->IsDisposed) { - auto objectRepository = _browserAdapter->JavascriptObjectRepository; + return true; + } + + auto objectRepository = browserAdapter->JavascriptObjectRepository; - auto browserId = argList->GetInt(0); - auto frameId = GetInt64(argList, 1); - auto callbackId = GetInt64(argList, 2); - auto objectNames = argList->GetList(3); + if (objectRepository == nullptr) + { + return true; + } - auto names = gcnew List(objectNames->GetSize()); - for (auto i = 0; i < objectNames->GetSize(); i++) - { - names->Add(StringUtils::ToClr(objectNames->GetString(i))); - } + auto callbackId = GetInt64(argList, 0); + auto objectNames = argList->GetList(1); - //Call GetObjects with the list of names provided (will default to all if the list is empty - //Previously we only sent a response if there were bound objects, now we always send - //a response so the promise is resolved. - auto objs = objectRepository->GetObjects(names); - - auto msg = CefProcessMessage::Create(kJavascriptRootObjectResponse); - auto responseArgList = msg->GetArgumentList(); - responseArgList->SetBool(0, false); //Use LegacyBehaviour (false) - responseArgList->SetInt(1, browserId); - SetInt64(responseArgList, 2, frameId); - SetInt64(responseArgList, 3, callbackId); - SerializeJsObjects(objs, responseArgList, 4); - browser->SendProcessMessage(CefProcessId::PID_RENDERER, msg); + auto names = gcnew List(objectNames->GetSize()); + for (size_t i = 0; i < objectNames->GetSize(); i++) + { + names->Add(StringUtils::ToClr(objectNames->GetString(i))); } + //Call GetObjects with the list of names provided (will default to all if the list is empty + //Previously we only sent a response if there were bound objects, now we always send + //a response so the promise is resolved. + auto objs = objectRepository->GetObjects(StringUtils::ToClr(frame->GetURL()), names); + + auto msg = CefProcessMessage::Create(kJavascriptRootObjectResponse); + auto responseArgList = msg->GetArgumentList(); + SetInt64(responseArgList, 0, callbackId); + SerializeJsObjects(objs, responseArgList, 1); + frame->SendProcessMessage(CefProcessId::PID_RENDERER, msg); + handled = true; } else if (name == kJavascriptObjectsBoundInJavascript) { - if (!Object::ReferenceEquals(_browserAdapter, nullptr) && !_browserAdapter->IsDisposed) + auto browserAdapter = _browserAdapter; + if (Object::ReferenceEquals(browserAdapter, nullptr) || browserAdapter->IsDisposed) { - auto objectRepository = _browserAdapter->JavascriptObjectRepository; + return true; + } - auto boundObjects = argList->GetList(0); - auto objs = gcnew List^>(boundObjects->GetSize()); - for (auto i = 0; i < boundObjects->GetSize(); i++) - { - auto obj = boundObjects->GetDictionary(i); - auto name = obj->GetString("Name"); - auto alreadyBound = obj->GetBool("AlreadyBound"); - auto isCached = obj->GetBool("IsCached"); + auto objectRepository = browserAdapter->JavascriptObjectRepository; - objs->Add(Tuple::Create(StringUtils::ToClr(name), alreadyBound, isCached)); - } + if (objectRepository == nullptr) + { + return true; + } - objectRepository->ObjectsBound(objs); + auto boundObjects = argList->GetList(0); + auto objs = gcnew List^>(boundObjects->GetSize()); + for (size_t i = 0; i < boundObjects->GetSize(); i++) + { + auto obj = boundObjects->GetDictionary(i); + auto objectName = obj->GetString("Name"); + auto alreadyBound = obj->GetBool("AlreadyBound"); + auto isCached = obj->GetBool("IsCached"); + + objs->Add(Tuple::Create(StringUtils::ToClr(objectName), alreadyBound, isCached)); } + objectRepository->ObjectsBound(objs); + handled = true; } else if (name == kOnContextCreatedRequest) { - auto frame = browser->GetFrame(GetInt64(argList, 0)); - //In certain circumstances the frame has already been destroyed by the time //we get here, only continue if we have a valid frame reference - if (frame.get()) + if (frame.get() && frame->IsValid()) { if (frame->IsMain()) { - _browserControl->SetCanExecuteJavascriptOnMainFrame(true); + _browserControl->SetCanExecuteJavascriptOnMainFrame(StringUtils::ToClr(frame->GetIdentifier()), true); } auto handler = _browserControl->RenderProcessMessageHandler; @@ -1285,15 +1380,17 @@ namespace CefSharp } else if (name == kOnContextReleasedRequest) { - auto frame = browser->GetFrame(GetInt64(argList, 0)); - //In certain circumstances the frame has already been destroyed by the time //we get here, only continue if we have a valid frame reference - if (frame.get()) + if (frame.get() && frame->IsValid()) { + auto frameId = StringUtils::ToClr(frame->GetIdentifier()); + + _pendingTaskRepository->CancelPendingTasks(frameId); + if (frame->IsMain()) { - _browserControl->SetCanExecuteJavascriptOnMainFrame(false); + _browserControl->SetCanExecuteJavascriptOnMainFrame(frameId, false); } auto handler = _browserControl->RenderProcessMessageHandler; @@ -1316,19 +1413,18 @@ namespace CefSharp { IDomNode^ node = nullptr; - // 0: frame ID (int 64) - // 1: is a node (bool) - // 2: tag name (string) - // 3: attributes (dictionary) + // 0: is a node (bool) + // 1: tag name (string) + // 2: attributes (dictionary) auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - CefFrameWrapper frameWrapper(browser->GetFrame(GetInt64(argList, 0))); + CefFrameWrapper frameWrapper(frame); - auto notEmpty = argList->GetBool(1); + auto notEmpty = argList->GetBool(0); if (notEmpty) { // Node information was passed from the render process. - auto tagName = StringUtils::ToClr(argList->GetString(2)); - auto argAttributes = argList->GetDictionary(3); + auto tagName = StringUtils::ToClr(argList->GetString(1)); + auto argAttributes = argList->GetDictionary(2); auto attributes = gcnew System::Collections::Generic::Dictionary(); CefDictionaryValue::KeyList keys; argAttributes->GetKeys(keys); @@ -1350,24 +1446,24 @@ namespace CefSharp if (handler != nullptr) { auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); - CefFrameWrapper frameWrapper(browser->GetFrame(GetInt64(argList, 0))); + CefFrameWrapper frameWrapper(frame); auto exception = gcnew JavascriptException(); - exception->Message = StringUtils::ToClr(argList->GetString(1)); + exception->Message = StringUtils::ToClr(argList->GetString(0)); auto stackTrace = gcnew System::Collections::Generic::List(); - auto argFrames = argList->GetList(2); + auto argFrames = argList->GetList(1); for (auto i = 0; i < static_cast(argFrames->GetSize()); i++) { - auto frame = argFrames->GetList(i); + auto argFrame = argFrames->GetList(i); auto stackFrame = gcnew JavascriptStackFrame(); - stackFrame->FunctionName = StringUtils::ToClr(frame->GetString(0)); - stackFrame->LineNumber = frame->GetInt(1); - stackFrame->ColumnNumber = frame->GetInt(2); - stackFrame->SourceName = StringUtils::ToClr(frame->GetString(3)); + stackFrame->FunctionName = StringUtils::ToClr(argFrame->GetString(0)); + stackFrame->LineNumber = argFrame->GetInt(1); + stackFrame->ColumnNumber = argFrame->GetInt(2); + stackFrame->SourceName = StringUtils::ToClr(argFrame->GetString(3)); stackTrace->Add(stackFrame); } @@ -1379,10 +1475,23 @@ namespace CefSharp } else if (name == kEvaluateJavascriptResponse || name == kJavascriptCallbackResponse) { + auto browserAdapter = _browserAdapter; + if (Object::ReferenceEquals(browserAdapter, nullptr) || browserAdapter->IsDisposed) + { + return true; + } + + auto frameId = StringUtils::ToClr(frame->GetIdentifier()); + + auto callbackFactory = browserAdapter->JavascriptCallbackFactory; + auto success = argList->GetBool(0); auto callbackId = GetInt64(argList, 1); - auto pendingTask = _pendingTaskRepository->RemovePendingTask(callbackId); + auto pendingTask = name == kEvaluateJavascriptResponse ? + _pendingTaskRepository->RemovePendingTask(frameId, callbackId) : + _pendingTaskRepository->RemoveJavascriptCallbackPendingTask(frameId, callbackId); + if (pendingTask != nullptr) { auto response = gcnew JavascriptResponse(); @@ -1397,58 +1506,70 @@ namespace CefSharp response->Message = StringUtils::ToClr(argList->GetString(2)); } - CefSharp::Internals::TaskExtensions::TrySetResultAsync(pendingTask, response); + pendingTask->TrySetResult(response); } handled = true; } - else if (name == kJavascriptAsyncMethodCallRequest && !_browserAdapter->IsDisposed) + else if (name == kJavascriptAsyncMethodCallRequest) { - auto frameId = GetInt64(argList, 0); - auto objectId = GetInt64(argList, 1); - auto callbackId = GetInt64(argList, 2); - auto methodName = StringUtils::ToClr(argList->GetString(3)); - auto arguments = argList->GetList(4); - auto methodInvocation = gcnew MethodInvocation(browser->GetIdentifier(), frameId, objectId, methodName, (callbackId > 0 ? Nullable(callbackId) : Nullable())); + auto browserAdapter = _browserAdapter; + if (Object::ReferenceEquals(browserAdapter, nullptr) || browserAdapter->IsDisposed) + { + return true; + } + + auto callbackFactory = browserAdapter->JavascriptCallbackFactory; + auto methodRunnerQueue = browserAdapter->MethodRunnerQueue; + + //Dispose is called on a different thread, so there's a chance + //dispose is called after our IsDisposed checks, make sure we have + //actual references. + if (callbackFactory == nullptr || methodRunnerQueue == nullptr) + { + return true; + } + + auto frameId = StringUtils::ToClr(frame->GetIdentifier()); + auto objectId = GetInt64(argList, 0); + auto callbackId = GetInt64(argList, 1); + auto methodName = StringUtils::ToClr(argList->GetString(2)); + auto arguments = argList->GetList(3); + auto methodInvocation = gcnew MethodInvocation(browser->GetIdentifier(), frameId, objectId, methodName, (callbackId > 0 ? Nullable(callbackId) : Nullable())); for (auto i = 0; i < static_cast(arguments->GetSize()); i++) { methodInvocation->Parameters->Add(DeserializeObject(arguments, i, callbackFactory)); } - _browserAdapter->MethodRunnerQueue->Enqueue(methodInvocation); + methodRunnerQueue->Enqueue(methodInvocation); handled = true; } - - return handled; - } - - Task^ ClientAdapter::EvaluateScriptAsync(int browserId, bool isBrowserPopup, int64 frameId, String^ script, String^ scriptUrl, int startLine, Nullable timeout) - { - auto browser = GetBrowserWrapper(browserId, isBrowserPopup); - - //If we're unable to get the underlying browser wrapper then return null - if (browser == nullptr) + else if (name == kJavascriptMessageReceived) { - return nullptr; - } + auto browserAdapter = _browserAdapter; + if (Object::ReferenceEquals(browserAdapter, nullptr) || browserAdapter->IsDisposed) + { + return true; + } - auto browserWrapper = static_cast(browser); + auto callbackFactory = browserAdapter->JavascriptCallbackFactory; + //In certain circumstances the frame has already been destroyed by the time + //we get here, only continue if we have a valid frame reference + if (frame.get() && frame->IsValid()) + { + auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup()); + CefFrameWrapper frameWrapper(frame); - //create a new taskcompletionsource - auto idAndComplectionSource = _pendingTaskRepository->CreatePendingTask(timeout); + auto deserializedMessage = DeserializeObject(argList, 0, callbackFactory); - auto message = CefProcessMessage::Create(kEvaluateJavascriptRequest); - auto argList = message->GetArgumentList(); - SetInt64(argList, 0, frameId); - SetInt64(argList, 1, idAndComplectionSource.Key); - argList->SetString(2, StringUtils::ToNative(script)); - argList->SetString(3, StringUtils::ToNative(scriptUrl)); - argList->SetInt(4, startLine); + _browserControl->SetJavascriptMessageReceived(gcnew JavascriptMessageReceivedEventArgs(browserWrapper, %frameWrapper, deserializedMessage)); + } - browserWrapper->SendProcessMessage(CefProcessId::PID_RENDERER, message); + handled = true; + } - return idAndComplectionSource.Value->Task; + return handled; } PendingTaskRepository^ ClientAdapter::GetPendingTaskRepository() @@ -1458,29 +1579,39 @@ namespace CefSharp void ClientAdapter::MethodInvocationComplete(MethodInvocationResult^ result) { - if (result->CallbackId.HasValue) + auto browser = GetBrowserWrapper(result->BrowserId); + + if (result->CallbackId.HasValue && browser != nullptr && !browser->IsDisposed) { - auto message = CefProcessMessage::Create(kJavascriptAsyncMethodCallResponse); - auto argList = message->GetArgumentList(); - SetInt64(argList, 0, result->FrameId); - SetInt64(argList, 1, result->CallbackId.Value); - argList->SetBool(2, result->Success); - if (result->Success) + auto wrapper = static_cast(browser); + if (wrapper == nullptr) { - SerializeV8Object(argList, 3, result->Result); - } - else - { - argList->SetString(3, StringUtils::ToNative(result->Message)); + return; } - auto browser = GetBrowserWrapper(result->BrowserId); + auto cefBrowser = wrapper->Browser; - if (browser != nullptr) + if (cefBrowser.get()) { - auto wrapper = static_cast(browser); + auto frame = cefBrowser->GetFrameByIdentifier(StringUtils::ToNative(result->FrameId)); - wrapper->Browser->SendProcessMessage(CefProcessId::PID_RENDERER, message); + if (frame.get() && frame->IsValid()) + { + auto message = CefProcessMessage::Create(kJavascriptAsyncMethodCallResponse); + auto argList = message->GetArgumentList(); + SetInt64(argList, 0, result->CallbackId.Value); + argList->SetBool(1, result->Success); + if (result->Success) + { + SerializeV8Object(argList, 2, result->Result, result->NameConverter); + } + else + { + argList->SetString(2, StringUtils::ToNative(result->Message)); + } + + frame->SendProcessMessage(CefProcessId::PID_RENDERER, message); + } } } } diff --git a/CefSharp.Core/Internals/ClientAdapter.h b/CefSharp.Core.Runtime/Internals/ClientAdapter.h similarity index 59% rename from CefSharp.Core/Internals/ClientAdapter.h rename to CefSharp.Core.Runtime/Internals/ClientAdapter.h index 93ba97a5e6..eef96bc426 100644 --- a/CefSharp.Core/Internals/ClientAdapter.h +++ b/CefSharp.Core.Runtime/Internals/ClientAdapter.h @@ -33,12 +33,15 @@ namespace CefSharp public CefDragHandler, public CefDownloadHandler, public CefFindHandler, - public CefAudioHandler + public CefAudioHandler, + public CefFrameHandler, + public CefPermissionHandler { private: gcroot _browserControl; HWND _browserHwnd; CefRefPtr _cefBrowser; + bool _disposed; gcroot _browser; gcroot^> _popupBrowsers; @@ -47,12 +50,6 @@ namespace CefSharp //contains in-progress eval script tasks gcroot^> _pendingTaskRepository; //contains js callback factories for each browser - - void ThrowUnknownPopupBrowser(String^ context) - { - throw gcnew ApplicationException(String::Format("{0} couldn't find IBrowser entry! Please contact CefSharp development.", context)); - } - IBrowser^ GetBrowserWrapper(int browserId, bool isPopup); public: @@ -61,25 +58,28 @@ namespace CefSharp _popupBrowsers(gcnew Dictionary()), _pendingTaskRepository(gcnew PendingTaskRepository()), _browserAdapter(browserAdapter), - _browserHwnd(NULL) + _browserHwnd(nullptr), + _disposed(false) { } ~ClientAdapter() { + _disposed = true; + CloseAllPopups(true); - //this will dispose the repository and cancel all pending tasks - delete _pendingTaskRepository; + _pendingTaskRepository->CancelPendingTasks(); _browser = nullptr; _browserControl = nullptr; _browserHwnd = nullptr; - _cefBrowser = NULL; + _cefBrowser = nullptr; _tooltip = nullptr; _browserAdapter = nullptr; _popupBrowsers = nullptr; + _pendingTaskRepository = nullptr; } HWND GetBrowserHwnd() { return _browserHwnd; } @@ -87,137 +87,157 @@ namespace CefSharp void CloseAllPopups(bool forceClose); void MethodInvocationComplete(MethodInvocationResult^ result); IBrowser^ GetBrowserWrapper(int browserId); + bool IsMainBrowser(bool isPopup, int browserId); // CefClient - virtual DECL CefRefPtr GetLifeSpanHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetLoadHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetRequestHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetDisplayHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetDownloadHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetContextMenuHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetFocusHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetKeyboardHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetJSDialogHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetDialogHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetDragHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetFindHandler() OVERRIDE { return this; } - virtual DECL CefRefPtr GetAudioHandler() OVERRIDE - { - //Audio Mirroring in CEF is only enabled when we a handler is returned - //We return NULL if no handler is specified for performance reasons - if (_browserControl->AudioHandler == nullptr) - { - return NULL; - } - - return this; - } - virtual DECL bool OnProcessMessageReceived(CefRefPtr browser, CefProcessId source_process, CefRefPtr message) OVERRIDE; + virtual DECL CefRefPtr GetLifeSpanHandler() override { return this; } + virtual DECL CefRefPtr GetLoadHandler() override { return this; } + virtual DECL CefRefPtr GetRequestHandler() override { return this; } + virtual DECL CefRefPtr GetDisplayHandler() override { return this; } + virtual DECL CefRefPtr GetDownloadHandler() override { return this; } + virtual DECL CefRefPtr GetContextMenuHandler() override { return this; } + virtual DECL CefRefPtr GetFocusHandler() override { return this; } + virtual DECL CefRefPtr GetKeyboardHandler() override { return this; } + virtual DECL CefRefPtr GetJSDialogHandler() override { return this; } + virtual DECL CefRefPtr GetDialogHandler() override { return this; } + virtual DECL CefRefPtr GetDragHandler() override { return this; } + virtual DECL CefRefPtr GetFindHandler() override { return this; } + virtual DECL CefRefPtr GetAudioHandler() override { return this; } + virtual DECL CefRefPtr GetFrameHandler() override { return this; } + virtual DECL CefRefPtr GetPermissionHandler() override { return this; } + virtual DECL bool OnProcessMessageReceived(CefRefPtr browser, CefRefPtr frame, CefProcessId source_process, CefRefPtr message) override; // CefLifeSpanHandler virtual DECL bool OnBeforePopup(CefRefPtr browser, CefRefPtr frame, + int popup_id, const CefString& target_url, const CefString& target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures, - CefWindowInfo& windowInfo, CefRefPtr& client, CefBrowserSettings& settings, bool* no_javascript_access) OVERRIDE; - virtual DECL void OnAfterCreated(CefRefPtr browser) OVERRIDE; - virtual DECL bool DoClose(CefRefPtr browser) OVERRIDE; - virtual DECL void OnBeforeClose(CefRefPtr browser) OVERRIDE; + CefWindowInfo& windowInfo, CefRefPtr& client, CefBrowserSettings& settings, CefRefPtr& extraInfo, bool* no_javascript_access) override; + virtual DECL void OnAfterCreated(CefRefPtr browser) override; + virtual DECL bool DoClose(CefRefPtr browser) override; + virtual DECL void OnBeforeClose(CefRefPtr browser) override; // CefLoadHandler - virtual DECL void OnLoadStart(CefRefPtr browser, CefRefPtr frame, TransitionType transitionType) OVERRIDE; - virtual DECL void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) OVERRIDE; - virtual DECL void OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& errorText, const CefString& failedUrl) OVERRIDE; + virtual DECL void OnLoadStart(CefRefPtr browser, CefRefPtr frame, TransitionType transitionType) override; + virtual DECL void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) override; + virtual DECL void OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& errorText, const CefString& failedUrl) override; // CefRequestHandler - virtual DECL CefRefPtr GetResourceHandler(CefRefPtr browser, CefRefPtr frame, CefRefPtr request) OVERRIDE; - virtual DECL cef_return_value_t OnBeforeResourceLoad(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr callback) OVERRIDE; - virtual DECL bool GetAuthCredentials(CefRefPtr browser, CefRefPtr frame, bool isProxy, - const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr callback) OVERRIDE; - virtual DECL bool OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool userGesture, bool isRedirect) OVERRIDE; + virtual DECL bool OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool userGesture, bool isRedirect) override; virtual DECL bool OnOpenURLFromTab(CefRefPtr browser, CefRefPtr frame, const CefString& targetUrl, - CefRequestHandler::WindowOpenDisposition targetDisposition, bool userGesture) OVERRIDE; - virtual DECL bool OnCertificateError(CefRefPtr browser, cef_errorcode_t cert_error, const CefString& request_url, CefRefPtr ssl_info, CefRefPtr callback) OVERRIDE; - virtual DECL bool CanGetCookies(CefRefPtr browser, CefRefPtr frame, CefRefPtr request) OVERRIDE; - virtual DECL bool CanSetCookie(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, const CefCookie& cookie) OVERRIDE; - virtual DECL bool OnQuotaRequest(CefRefPtr browser, const CefString& originUrl, int64 newSize, CefRefPtr callback) OVERRIDE; - virtual DECL void OnResourceRedirect(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response, CefString& newUrl) OVERRIDE; - virtual DECL bool OnResourceResponse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response) OVERRIDE; - virtual DECL CefRefPtr GetResourceResponseFilter(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response) OVERRIDE; - virtual DECL void OnResourceLoadComplete(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response, URLRequestStatus status, int64 receivedContentLength) OVERRIDE; - virtual DECL void OnProtocolExecution(CefRefPtr browser, const CefString& url, bool& allowOSExecution) OVERRIDE; - virtual DECL void OnPluginCrashed(CefRefPtr browser, const CefString& plugin_path) OVERRIDE; - virtual DECL void OnRenderViewReady(CefRefPtr browser) OVERRIDE; - virtual DECL void OnRenderProcessTerminated(CefRefPtr browser, TerminationStatus status) OVERRIDE; + CefRequestHandler::WindowOpenDisposition targetDisposition, bool userGesture) override; + virtual DECL CefRefPtr GetResourceRequestHandler(CefRefPtr browser, + CefRefPtr frame, CefRefPtr request, bool isNavigation, bool isDownload, const CefString& requestInitiator, bool& disableDefaultHandling) override; + virtual DECL bool GetAuthCredentials(CefRefPtr browser, const CefString& originUrl, bool isProxy, + const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr callback) override; + virtual DECL bool OnCertificateError(CefRefPtr browser, cef_errorcode_t cert_error, const CefString& request_url, CefRefPtr ssl_info, CefRefPtr callback) override; virtual DECL bool OnSelectClientCertificate(CefRefPtr browser, bool isProxy, const CefString& host, int port, - const CefRequestHandler::X509CertificateList& certificates, CefRefPtr callback) OVERRIDE; + const CefRequestHandler::X509CertificateList& certificates, CefRefPtr callback) override; + virtual DECL void OnRenderViewReady(CefRefPtr browser) override; + virtual DECL void OnRenderProcessTerminated(CefRefPtr browser, TerminationStatus status, int errorCode, const CefString& errorString) override; + virtual DECL void OnDocumentAvailableInMainFrame(CefRefPtr browser) override; // CefDisplayHandler - virtual DECL void OnLoadingStateChange(CefRefPtr browser, bool isLoading, bool canGoBack, bool canGoForward) OVERRIDE; - virtual DECL void OnAddressChange(CefRefPtr browser, CefRefPtr frame, const CefString& url) OVERRIDE; - virtual DECL bool OnAutoResize(CefRefPtr< CefBrowser > browser, const CefSize& new_size) OVERRIDE; - virtual DECL void OnTitleChange(CefRefPtr browser, const CefString& title) OVERRIDE; - virtual DECL void OnFaviconURLChange(CefRefPtr browser, const std::vector& iconUrls) OVERRIDE; - virtual DECL void OnFullscreenModeChange(CefRefPtr browser, bool fullscreen) OVERRIDE; - virtual DECL void OnLoadingProgressChange(CefRefPtr browser, double progress) OVERRIDE; - virtual DECL bool OnTooltip(CefRefPtr browser, CefString& text) OVERRIDE; - virtual DECL bool OnConsoleMessage(CefRefPtr browser, cef_log_severity_t level, const CefString& message, const CefString& source, int line) OVERRIDE; - virtual DECL void OnStatusMessage(CefRefPtr browser, const CefString& message) OVERRIDE; + virtual DECL void OnLoadingStateChange(CefRefPtr browser, bool isLoading, bool canGoBack, bool canGoForward) override; + virtual DECL void OnAddressChange(CefRefPtr browser, CefRefPtr frame, const CefString& url) override; + virtual DECL bool OnAutoResize(CefRefPtr< CefBrowser > browser, const CefSize& new_size) override; + virtual DECL bool OnCursorChange(CefRefPtr browser, CefCursorHandle cursor, cef_cursor_type_t type, const CefCursorInfo & custom_cursor_info) override; + virtual DECL void OnTitleChange(CefRefPtr browser, const CefString& title) override; + virtual DECL void OnFaviconURLChange(CefRefPtr browser, const std::vector& iconUrls) override; + virtual DECL void OnFullscreenModeChange(CefRefPtr browser, bool fullscreen) override; + virtual DECL void OnLoadingProgressChange(CefRefPtr browser, double progress) override; + virtual DECL bool OnTooltip(CefRefPtr browser, CefString& text) override; + virtual DECL bool OnConsoleMessage(CefRefPtr browser, cef_log_severity_t level, const CefString& message, const CefString& source, int line) override; + virtual DECL void OnStatusMessage(CefRefPtr browser, const CefString& message) override; + + virtual DECL void InternalCursorChange(CefRefPtr browser, CefCursorHandle cursor, cef_cursor_type_t type, const CefCursorInfo& custom_cursor_info); // CefContextMenuHandler virtual DECL void OnBeforeContextMenu(CefRefPtr browser, CefRefPtr frame, - CefRefPtr params, CefRefPtr model) OVERRIDE; + CefRefPtr params, CefRefPtr model) override; virtual DECL bool OnContextMenuCommand(CefRefPtr browser, CefRefPtr frame, - CefRefPtr params, int commandId, EventFlags eventFlags) OVERRIDE; - virtual DECL void OnContextMenuDismissed(CefRefPtr browser, CefRefPtr frame) OVERRIDE; - virtual DECL bool RunContextMenu(CefRefPtr browser, CefRefPtr frame, CefRefPtr params, CefRefPtr model, CefRefPtr callback) OVERRIDE; + CefRefPtr params, int commandId, EventFlags eventFlags) override; + virtual DECL void OnContextMenuDismissed(CefRefPtr browser, CefRefPtr frame) override; + virtual DECL bool RunContextMenu(CefRefPtr browser, CefRefPtr frame, CefRefPtr params, CefRefPtr model, CefRefPtr callback) override; // CefFocusHandler - virtual DECL void OnGotFocus(CefRefPtr browser) OVERRIDE; - virtual DECL bool OnSetFocus(CefRefPtr browser, FocusSource source) OVERRIDE; - virtual DECL void OnTakeFocus(CefRefPtr browser, bool next) OVERRIDE; + virtual DECL void OnGotFocus(CefRefPtr browser) override; + virtual DECL bool OnSetFocus(CefRefPtr browser, FocusSource source) override; + virtual DECL void OnTakeFocus(CefRefPtr browser, bool next) override; // CefKeyboardHandler - virtual DECL bool OnKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event) OVERRIDE; - virtual DECL bool OnPreKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event, bool* is_keyboard_shortcut) OVERRIDE; + virtual DECL bool OnKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event) override; + virtual DECL bool OnPreKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event, bool* is_keyboard_shortcut) override; // CefJSDialogHandler virtual DECL bool OnJSDialog(CefRefPtr browser, const CefString& origin_url, JSDialogType dialog_type, const CefString& message_text, const CefString& default_prompt_text, - CefRefPtr callback, bool& suppress_message) OVERRIDE; + CefRefPtr callback, bool& suppress_message) override; virtual DECL bool OnBeforeUnloadDialog(CefRefPtr browser, const CefString& message_text, bool is_reload, - CefRefPtr callback) OVERRIDE; - virtual DECL void OnResetDialogState(CefRefPtr browser) OVERRIDE; - virtual DECL void OnDialogClosed(CefRefPtr browser) OVERRIDE; + CefRefPtr callback) override; + virtual DECL void OnResetDialogState(CefRefPtr browser) override; + virtual DECL void OnDialogClosed(CefRefPtr browser) override; // CefDialogHandler - virtual DECL bool OnFileDialog(CefRefPtr browser, FileDialogMode mode, const CefString& title, - const CefString& default_file_path, const std::vector& accept_filters, int selected_accept_filter, - CefRefPtr callback) OVERRIDE; + virtual DECL bool OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector& accept_filters, + const std::vector& accept_extensions, + const std::vector& accept_descriptions, + CefRefPtr callback) override; //CefDragHandler - virtual DECL bool OnDragEnter(CefRefPtr browser, CefRefPtr dragData, DragOperationsMask mask) OVERRIDE; - virtual DECL void OnDraggableRegionsChanged(CefRefPtr browser, const std::vector& regions) OVERRIDE; + virtual DECL bool OnDragEnter(CefRefPtr browser, CefRefPtr dragData, DragOperationsMask mask) override; + virtual DECL void OnDraggableRegionsChanged(CefRefPtr browser, CefRefPtr frame, const std::vector& regions) override; //CefDownloadHandler - virtual DECL void OnBeforeDownload(CefRefPtr browser, CefRefPtr download_item, - const CefString& suggested_name, CefRefPtr callback) OVERRIDE; + virtual DECL bool CanDownload(CefRefPtr browser, const CefString & url, const CefString & request_method) override; + virtual DECL bool OnBeforeDownload(CefRefPtr browser, CefRefPtr download_item, + const CefString& suggested_name, CefRefPtr callback) override; virtual DECL void OnDownloadUpdated(CefRefPtr browser, CefRefPtr download_item, - CefRefPtr callback) OVERRIDE; + CefRefPtr callback) override; //CefFindHandler - virtual DECL void OnFindResult(CefRefPtr browser, int identifier, int count, const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate) OVERRIDE; + virtual DECL void OnFindResult(CefRefPtr browser, int identifier, int count, const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate) override; //CefAudioHandler - virtual DECL void OnAudioStreamStarted(CefRefPtr browser, int audio_stream_id, int channels, ChannelLayout channel_layout, int sample_rate, int frames_per_buffer) OVERRIDE; - virtual DECL void OnAudioStreamPacket(CefRefPtr browser, int audio_stream_id, const float** data, int frames, int64 pts) OVERRIDE; - virtual DECL void OnAudioStreamStopped(CefRefPtr browser, int audio_stream_id) OVERRIDE; - - //sends out an eval script request to the render process - Task^ EvaluateScriptAsync(int browserId, bool isBrowserPopup, int64 frameId, String^ script, String^ scriptUrl, int startLine, Nullable timeout); - - IMPLEMENT_REFCOUNTING(ClientAdapter); + virtual DECL bool GetAudioParameters(CefRefPtr browser, CefAudioParameters & params) override; + virtual DECL void OnAudioStreamStarted(CefRefPtr browser, const CefAudioParameters& params, int channels) override; + virtual DECL void OnAudioStreamPacket(CefRefPtr browser, const float** data, int frames, int64_t pts) override; + virtual DECL void OnAudioStreamStopped(CefRefPtr browser) override; + virtual DECL void OnAudioStreamError(CefRefPtr browser, const CefString& message) override; + + //CefFrameHandler + virtual DECL void OnFrameCreated(CefRefPtr browser, CefRefPtr frame) override; + virtual DECL void OnFrameAttached(CefRefPtr browser, CefRefPtr frame, bool reattached) override; + virtual DECL void OnFrameDetached(CefRefPtr browser, CefRefPtr frame) override; + virtual DECL void OnMainFrameChanged(CefRefPtr browser, CefRefPtr old_frame, CefRefPtr new_frame) override; + + //CefPermissionHandler + virtual DECL bool OnShowPermissionPrompt( + CefRefPtr browser, + uint64_t prompt_id, + const CefString& requesting_origin, + uint32_t requested_permissions, + CefRefPtr callback) override; + + virtual DECL void OnDismissPermissionPrompt( + CefRefPtr browser, + uint64_t prompt_id, + cef_permission_request_result_t result) override; + + virtual DECL bool OnRequestMediaAccessPermission( + CefRefPtr browser, + CefRefPtr frame, + const CefString& requesting_origin, + uint32_t requested_permissions, + CefRefPtr callback) override; + + IMPLEMENT_REFCOUNTINGM(ClientAdapter); }; } } diff --git a/CefSharp.Core/Internals/JavascriptCallbackFactory.cpp b/CefSharp.Core.Runtime/Internals/JavascriptCallbackFactory.cpp similarity index 100% rename from CefSharp.Core/Internals/JavascriptCallbackFactory.cpp rename to CefSharp.Core.Runtime/Internals/JavascriptCallbackFactory.cpp diff --git a/CefSharp.Core/Internals/JavascriptCallbackFactory.h b/CefSharp.Core.Runtime/Internals/JavascriptCallbackFactory.h similarity index 90% rename from CefSharp.Core/Internals/JavascriptCallbackFactory.h rename to CefSharp.Core.Runtime/Internals/JavascriptCallbackFactory.h index 880f57824d..81030ed326 100644 --- a/CefSharp.Core/Internals/JavascriptCallbackFactory.h +++ b/CefSharp.Core.Runtime/Internals/JavascriptCallbackFactory.h @@ -18,9 +18,9 @@ namespace CefSharp { } - property WeakReference^ BrowserAdapter; + property WeakReference^ BrowserAdapter; virtual IJavascriptCallback^ Create(JavascriptCallback^ callback); }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/JavascriptCallbackProxy.cpp b/CefSharp.Core.Runtime/Internals/JavascriptCallbackProxy.cpp similarity index 50% rename from CefSharp.Core/Internals/JavascriptCallbackProxy.cpp rename to CefSharp.Core.Runtime/Internals/JavascriptCallbackProxy.cpp index b725f105b0..1e96fb9181 100644 --- a/CefSharp.Core/Internals/JavascriptCallbackProxy.cpp +++ b/CefSharp.Core.Runtime/Internals/JavascriptCallbackProxy.cpp @@ -16,6 +16,11 @@ namespace CefSharp namespace Internals { Task^ JavascriptCallbackProxy::ExecuteAsync(cli::array^ parameters) + { + return ExecuteWithTimeoutAsync(Nullable(), parameters); + } + + Task^ JavascriptCallbackProxy::ExecuteWithTimeoutAsync(Nullable timeout, cli::array^ parameters) { DisposedGuard(); @@ -25,26 +30,38 @@ namespace CefSharp throw gcnew InvalidOperationException("Browser instance is null. Check CanExecute before calling this method."); } - auto browserWrapper = static_cast(browser); + auto browserWrapper = static_cast(browser); - auto doneCallback = _pendingTasks->CreatePendingTask(Nullable()); + auto frame = browserWrapper->Browser->GetFrameByIdentifier(StringUtils::ToNative(_callback->FrameId)); - auto callbackMessage = CefProcessMessage::Create(kJavascriptCallbackRequest); - auto argList = callbackMessage->GetArgumentList(); - SetInt64(argList, 0, _callback->FrameId); - SetInt64(argList, 1, doneCallback.Key); - SetInt64(argList, 2, _callback->Id); - auto paramList = CefListValue::Create(); - for (int i = 0; i < parameters->Length; i++) + if (frame.get() && frame->IsValid()) { - auto param = parameters[i]; - SerializeV8Object(paramList, i, param); + auto javascriptNameConverter = GetJavascriptNameConverter(); + + auto doneCallback = _pendingTasks->CreateJavascriptCallbackPendingTask(_callback->FrameId, _callback->Id, timeout); + + auto callbackMessage = CefProcessMessage::Create(kJavascriptCallbackRequest); + auto argList = callbackMessage->GetArgumentList(); + SetInt64(argList, 0, doneCallback.Key); + SetInt64(argList, 1, _callback->Id); + auto paramList = CefListValue::Create(); + for (int i = 0; i < parameters->Length; i++) + { + auto param = parameters[i]; + SerializeV8Object(paramList, i, param, javascriptNameConverter); + } + argList->SetList(2, paramList); + + frame->SendProcessMessage(CefProcessId::PID_RENDERER, callbackMessage); + + return doneCallback.Value->Task; } - argList->SetList(3, paramList); - browserWrapper->SendProcessMessage(CefProcessId::PID_RENDERER, callbackMessage); + auto invalidFrameResponse = gcnew JavascriptResponse(); + invalidFrameResponse->Success = false; + invalidFrameResponse->Message = "Frame with Id:" + _callback->FrameId + " is no longer valid."; - return doneCallback.Value->Task; + return Task::FromResult(invalidFrameResponse); } CefRefPtr JavascriptCallbackProxy::CreateDestroyMessage() @@ -52,16 +69,16 @@ namespace CefSharp auto result = CefProcessMessage::Create(kJavascriptCallbackDestroyRequest); auto argList = result->GetArgumentList(); SetInt64(argList, 0, _callback->Id); - SetInt64(argList, 1, _callback->FrameId); return result; } + //TODO: Reduce code duplication IBrowser^ JavascriptCallbackProxy::GetBrowser() { IBrowser^ result = nullptr; - if (_browserAdapter->IsAlive) + IBrowserAdapter^ browserAdapter; + if (_browserAdapter->TryGetTarget(browserAdapter)) { - auto browserAdapter = static_cast(_browserAdapter->Target); if (!browserAdapter->IsDisposed) { result = browserAdapter->GetBrowser(_callback->BrowserId); @@ -70,6 +87,20 @@ namespace CefSharp return result; } + IJavascriptNameConverter^ JavascriptCallbackProxy::GetJavascriptNameConverter() + { + IJavascriptNameConverter^ result = nullptr; + IBrowserAdapter^ browserAdapter; + if (_browserAdapter->TryGetTarget(browserAdapter)) + { + if (!browserAdapter->IsDisposed && browserAdapter->JavascriptObjectRepository != nullptr) + { + result = browserAdapter->JavascriptObjectRepository->NameConverter; + } + } + return result; + } + Int64 JavascriptCallbackProxy::Id::get() { DisposedGuard(); @@ -96,9 +127,7 @@ namespace CefSharp } //If the frame Id is still valid then we can attemp to execute the callback - //NOTE: Currently it appears that the same FrameId is reused until a render process - //switch occurs, when a new frame Id is allocated. - auto frame = browser->GetFrame(_callback->FrameId); + auto frame = browser->GetFrameByIdentifier(_callback->FrameId); if (frame == nullptr) { return false; diff --git a/CefSharp.Core/Internals/JavascriptCallbackProxy.h b/CefSharp.Core.Runtime/Internals/JavascriptCallbackProxy.h similarity index 69% rename from CefSharp.Core/Internals/JavascriptCallbackProxy.h rename to CefSharp.Core.Runtime/Internals/JavascriptCallbackProxy.h index 5ac0369804..f32ea790cc 100644 --- a/CefSharp.Core/Internals/JavascriptCallbackProxy.h +++ b/CefSharp.Core.Runtime/Internals/JavascriptCallbackProxy.h @@ -9,9 +9,10 @@ #include "include/cef_app.h" #include "..\ManagedCefBrowserAdapter.h" -#include "Internals\CefSharpBrowserWrapper.h" +#include "Internals\CefBrowserWrapper.h" using namespace System::Threading::Tasks; +using namespace CefSharp::JavascriptBinding; namespace CefSharp { @@ -20,16 +21,17 @@ namespace CefSharp private ref class JavascriptCallbackProxy : public IJavascriptCallback { private: - WeakReference^ _browserAdapter; + WeakReference^ _browserAdapter; JavascriptCallback^ _callback; PendingTaskRepository^ _pendingTasks; bool _disposed; CefRefPtr CreateDestroyMessage(); IBrowser^ GetBrowser(); + IJavascriptNameConverter^ GetJavascriptNameConverter(); void DisposedGuard(); public: - JavascriptCallbackProxy(JavascriptCallback^ callback, PendingTaskRepository^ pendingTasks, WeakReference^ browserAdapter) + JavascriptCallbackProxy(JavascriptCallback^ callback, PendingTaskRepository^ pendingTasks, WeakReference^ browserAdapter) :_callback(callback), _pendingTasks(pendingTasks), _disposed(false) { _browserAdapter = browserAdapter; @@ -45,13 +47,18 @@ namespace CefSharp auto browser = GetBrowser(); if (browser != nullptr && !browser->IsDisposed) { - auto browserWrapper = static_cast(browser); - browserWrapper->SendProcessMessage(CefProcessId::PID_RENDERER, CreateDestroyMessage()); + auto browserWrapper = static_cast(browser)->Browser; + auto frame = browserWrapper->GetFrameByIdentifier(StringUtils::ToNative(_callback->FrameId)); + if (frame.get() && frame->IsValid()) + { + frame->SendProcessMessage(CefProcessId::PID_RENDERER, CreateDestroyMessage()); + } } _disposed = true; } virtual Task^ ExecuteAsync(cli::array^ parameters); + virtual Task^ ExecuteWithTimeoutAsync(Nullable timeout, cli::array^ parameters); virtual property Int64 Id { @@ -69,4 +76,4 @@ namespace CefSharp } }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/MCefRefPtr.h b/CefSharp.Core.Runtime/Internals/MCefRefPtr.h similarity index 93% rename from CefSharp.Core/Internals/MCefRefPtr.h rename to CefSharp.Core.Runtime/Internals/MCefRefPtr.h index c6368c3faf..2a8998d7e2 100644 --- a/CefSharp.Core/Internals/MCefRefPtr.h +++ b/CefSharp.Core.Runtime/Internals/MCefRefPtr.h @@ -18,7 +18,7 @@ namespace CefSharp T* _ptr; public: - MCefRefPtr() : _ptr(NULL) {} + MCefRefPtr() : _ptr(nullptr) {} MCefRefPtr(T* p) : _ptr(p) { @@ -132,10 +132,15 @@ namespace CefSharp return false; } +//TODO: Is this used? Disable warnings for now though code can likely be removed +#pragma warning( push ) +#pragma warning(disable:4302) +#pragma warning(disable:4311) virtual int GetHashCode() override { return (int)_ptr; } +#pragma warning( pop ) }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/Messaging/Messages.h b/CefSharp.Core.Runtime/Internals/Messaging/Messages.h similarity index 94% rename from CefSharp.Core/Internals/Messaging/Messages.h rename to CefSharp.Core.Runtime/Internals/Messaging/Messages.h index 58f73c4fa4..db7f54e71f 100644 --- a/CefSharp.Core/Internals/Messaging/Messages.h +++ b/CefSharp.Core.Runtime/Internals/Messaging/Messages.h @@ -45,6 +45,9 @@ namespace CefSharp const CefString kOnUncaughtException = "OnUncaughtException"; //Message containing a request/notification that JSB objects have been bound const CefString kJavascriptObjectsBoundInJavascript = "JavascriptObjectsBoundInJavascript"; + + //Message containing the CefSharp.PostMessage request + const CefString kJavascriptMessageReceived = "JavascriptMessageReceived"; } } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/RenderClientAdapter.h b/CefSharp.Core.Runtime/Internals/RenderClientAdapter.h similarity index 87% rename from CefSharp.Core/Internals/RenderClientAdapter.h rename to CefSharp.Core.Runtime/Internals/RenderClientAdapter.h index d43a2e4b33..3d2888c80f 100644 --- a/CefSharp.Core/Internals/RenderClientAdapter.h +++ b/CefSharp.Core.Runtime/Internals/RenderClientAdapter.h @@ -7,11 +7,13 @@ #include "Stdafx.h" #include +#include "DragData.h" #include "ClientAdapter.h" #include "CefValueWrapper.h" using namespace msclr; using namespace CefSharp::Structs; +using namespace CefSharp::Core; namespace CefSharp { @@ -37,13 +39,13 @@ namespace CefSharp } // CefClient - virtual DECL CefRefPtr GetRenderHandler() OVERRIDE { return this; }; + virtual DECL CefRefPtr GetRenderHandler() override { return this; }; // CefRenderHandler - virtual DECL CefRefPtr GetAccessibilityHandler() OVERRIDE { return this; } + virtual DECL CefRefPtr GetAccessibilityHandler() override { return this; } // CefRenderHandler - virtual DECL bool GetScreenInfo(CefRefPtr browser, CefScreenInfo& screen_info) OVERRIDE + virtual DECL bool GetScreenInfo(CefRefPtr browser, CefScreenInfo& screen_info) override { if ((IRenderWebBrowser^)_renderWebBrowser == nullptr) { @@ -91,7 +93,7 @@ namespace CefSharp } // CefRenderHandler - virtual DECL void GetViewRect(CefRefPtr browser, CefRect& rect) OVERRIDE + virtual DECL void GetViewRect(CefRefPtr browser, CefRect& rect) override { if ((IRenderWebBrowser^)_renderWebBrowser == nullptr) { @@ -106,12 +108,12 @@ namespace CefSharp rect = CefRect(viewRect.X, viewRect.Y, viewRect.Width, viewRect.Height); //Cefclient defaults these to 1 instead of 0, we'll do the same - if (rect.height == 0) + if (rect.height <= 0) { rect.height = 1; } - if (rect.width == 0) + if (rect.width <= 0) { rect.width = 1; } @@ -123,7 +125,7 @@ namespace CefSharp // coordinates. Return true if the screen coordinates were provided. /// /*--cef()--*/ - virtual DECL bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, int& screenX, int& screenY) OVERRIDE + virtual DECL bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, int& screenX, int& screenY) override { return _renderWebBrowser->GetScreenPoint(viewX, viewY, screenX, screenY); } @@ -133,7 +135,7 @@ namespace CefSharp // should be shown if |show| is true and hidden if |show| is false. /// /*--cef()--*/ - virtual DECL void OnPopupShow(CefRefPtr browser, bool show) OVERRIDE + virtual DECL void OnPopupShow(CefRefPtr browser, bool show) override { _renderWebBrowser->OnPopupShow(show); }; @@ -143,31 +145,31 @@ namespace CefSharp // contains the new location and size. /// /*--cef()--*/ - virtual DECL void OnPopupSize(CefRefPtr browser, const CefRect& rect) OVERRIDE + virtual DECL void OnPopupSize(CefRefPtr browser, const CefRect& rect) override { _renderWebBrowser->OnPopupSize(Rect(rect.x, rect.y, rect.width, rect.height)); }; - virtual DECL void OnAcceleratedPaint(CefRefPtr browser, PaintElementType type, const RectList& dirtyRects, void* shared_handle) OVERRIDE + virtual DECL void OnAcceleratedPaint(CefRefPtr browser, PaintElementType type, const RectList& dirtyRects, const CefAcceleratedPaintInfo& info) override { CefRect r = dirtyRects.front(); - _renderWebBrowser->OnAcceleratedPaint((CefSharp::PaintElementType)type, CefSharp::Structs::Rect(r.x, r.y, r.width, r.height), IntPtr((void *)shared_handle)); + AcceleratedPaintInfo^ api = gcnew AcceleratedPaintInfo((IntPtr)info.shared_texture_handle, (ColorType)info.format); + _renderWebBrowser->OnAcceleratedPaint((CefSharp::PaintElementType)type, CefSharp::Structs::Rect(r.x, r.y, r.width, r.height), api); } virtual DECL void OnPaint(CefRefPtr browser, PaintElementType type, const RectList& dirtyRects, - const void* buffer, int width, int height) OVERRIDE + const void* buffer, int width, int height) override { CefRect r = dirtyRects.front(); _renderWebBrowser->OnPaint((CefSharp::PaintElementType)type, CefSharp::Structs::Rect(r.x, r.y, r.width, r.height), IntPtr((void *)buffer), width, height); }; - virtual DECL void OnCursorChange(CefRefPtr browser, CefCursorHandle cursor, CursorType type, - const CefCursorInfo& custom_cursor_info) OVERRIDE + virtual DECL void InternalCursorChange(CefRefPtr browser, CefCursorHandle cursor, cef_cursor_type_t type, const CefCursorInfo& custom_cursor_info) override { CursorInfo customCursorInfo; //Only create the struct when we actually have a custom cursor - if (type == CursorType::CT_CUSTOM) + if (type == cef_cursor_type_t::CT_CUSTOM) { Point hotspot = Point(custom_cursor_info.hotspot.x, custom_cursor_info.hotspot.y); Size size = Size(custom_cursor_info.size.width, custom_cursor_info.size.height); @@ -175,12 +177,12 @@ namespace CefSharp } _renderWebBrowser->OnCursorChange((IntPtr)cursor, (CefSharp::Enums::CursorType)type, customCursorInfo); - }; + } virtual DECL bool StartDragging(CefRefPtr browser, CefRefPtr dragData, - CefRenderHandler::DragOperationsMask allowedOps, int x, int y) OVERRIDE + CefRenderHandler::DragOperationsMask allowedOps, int x, int y) override { - CefDragDataWrapper dragDataWrapper(dragData); + DragData dragDataWrapper(dragData); return _renderWebBrowser->StartDragging(%dragDataWrapper, (CefSharp::Enums::DragOperationsMask)allowedOps, x, y); } @@ -190,7 +192,7 @@ namespace CefSharp // (none, move, copy, link). /// /*--cef()--*/ - virtual DECL void UpdateDragCursor(CefRefPtr browser, CefRenderHandler::DragOperation operation) OVERRIDE + virtual DECL void UpdateDragCursor(CefRefPtr browser, CefRenderHandler::DragOperation operation) override { return _renderWebBrowser->UpdateDragCursor((CefSharp::Enums::DragOperationsMask)operation); } @@ -201,7 +203,7 @@ namespace CefSharp // bounds of each character in view coordinates. /// /*--cef()--*/ - virtual DECL void OnImeCompositionRangeChanged(CefRefPtr browser, const CefRange& selectedRange, const RectList& characterBounds) OVERRIDE + virtual DECL void OnImeCompositionRangeChanged(CefRefPtr browser, const CefRange& selectedRange, const RectList& characterBounds) override { auto charBounds = gcnew cli::array((int)characterBounds.size()); @@ -211,11 +213,11 @@ namespace CefSharp charBounds[index] = Rect((*it).x, (*it).y, (*it).width, (*it).height); } - _renderWebBrowser->OnImeCompositionRangeChanged(Range(selectedRange.from, selectedRange.to), charBounds); + _renderWebBrowser->OnImeCompositionRangeChanged(CefSharp::Structs::Range(selectedRange.from, selectedRange.to), charBounds); } //CefAccessibilityHandler - virtual DECL void OnAccessibilityLocationChange(CefRefPtr value) OVERRIDE + virtual DECL void OnAccessibilityLocationChange(CefRefPtr value) override { auto handler = _renderWebBrowser->AccessibilityHandler; @@ -227,7 +229,7 @@ namespace CefSharp } } - virtual DECL void OnAccessibilityTreeChange(CefRefPtr value) OVERRIDE + virtual DECL void OnAccessibilityTreeChange(CefRefPtr value) override { auto handler = _renderWebBrowser->AccessibilityHandler; @@ -239,12 +241,12 @@ namespace CefSharp } } - virtual DECL void OnVirtualKeyboardRequested(CefRefPtr browser, cef_text_input_mode_t input_mode) OVERRIDE + virtual DECL void OnVirtualKeyboardRequested(CefRefPtr browser, cef_text_input_mode_t input_mode) override { _renderWebBrowser->OnVirtualKeyboardRequested(GetBrowserWrapper(browser->GetIdentifier()), (CefSharp::Enums::TextInputMode)input_mode); } - IMPLEMENT_REFCOUNTING(RenderClientAdapter); + IMPLEMENT_REFCOUNTINGM(RenderClientAdapter); }; } } diff --git a/CefSharp.Core/Internals/ReportUnhandledExceptions.h b/CefSharp.Core.Runtime/Internals/ReportUnhandledExceptions.h similarity index 100% rename from CefSharp.Core/Internals/ReportUnhandledExceptions.h rename to CefSharp.Core.Runtime/Internals/ReportUnhandledExceptions.h diff --git a/CefSharp.Core/Internals/Serialization/JsObjectsSerialization.cpp b/CefSharp.Core.Runtime/Internals/Serialization/JsObjectsSerialization.cpp similarity index 94% rename from CefSharp.Core/Internals/Serialization/JsObjectsSerialization.cpp rename to CefSharp.Core.Runtime/Internals/Serialization/JsObjectsSerialization.cpp index f76962f41f..6ecd3331cd 100644 --- a/CefSharp.Core/Internals/Serialization/JsObjectsSerialization.cpp +++ b/CefSharp.Core.Runtime/Internals/Serialization/JsObjectsSerialization.cpp @@ -53,9 +53,11 @@ namespace CefSharp propertyList->SetNull(j++); } + //TODO: Can we remove this safely? It doesn't appear to actually be used as PropertyValue + //should only be set when using Sync Binding if (jsProperty->PropertyValue != nullptr) { - SerializeV8Object(propertyList, j++, jsProperty->PropertyValue); + SerializeV8Object(propertyList, j++, jsProperty->PropertyValue, nullptr); } else { @@ -79,4 +81,4 @@ namespace CefSharp } } } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/Serialization/JsObjectsSerialization.h b/CefSharp.Core.Runtime/Internals/Serialization/JsObjectsSerialization.h similarity index 100% rename from CefSharp.Core/Internals/Serialization/JsObjectsSerialization.h rename to CefSharp.Core.Runtime/Internals/Serialization/JsObjectsSerialization.h diff --git a/CefSharp.Core/Internals/Serialization/ObjectsSerialization.cpp b/CefSharp.Core.Runtime/Internals/Serialization/ObjectsSerialization.cpp similarity index 83% rename from CefSharp.Core/Internals/Serialization/ObjectsSerialization.cpp rename to CefSharp.Core.Runtime/Internals/Serialization/ObjectsSerialization.cpp index 650d6beca8..8f2175b6ab 100644 --- a/CefSharp.Core/Internals/Serialization/ObjectsSerialization.cpp +++ b/CefSharp.Core.Runtime/Internals/Serialization/ObjectsSerialization.cpp @@ -36,7 +36,11 @@ namespace CefSharp else if (IsCefTime(list, index)) { auto cefTime = GetCefTime(list, index); - result = ConvertCefTimeToDateTime(cefTime); + result = CefTimeUtils::FromBaseTimeToDateTime(cefTime.val); + } + else if (IsArrayBuffer(list, index)) + { + result = GetArrayBuffer(list, index); } else if (IsJsCallback(list, index) && javascriptCallbackFactory != nullptr) { @@ -54,8 +58,8 @@ namespace CefSharp else if (type == VTYPE_LIST) { auto subList = list->GetList(index); - auto array = gcnew List(subList->GetSize()); - for (auto i = 0; i < subList->GetSize(); i++) + auto array = gcnew List(static_cast(subList->GetSize())); + for (size_t i = 0; i < subList->GetSize(); i++) { array->Add(DeserializeObject(subList, i, javascriptCallbackFactory)); } @@ -69,7 +73,7 @@ namespace CefSharp std::vector keys; subDict->GetKeys(keys); - for (auto i = 0; i < keys.size(); i++) + for (size_t i = 0; i < keys.size(); i++) { auto key = StringUtils::ToClr(keys[i]); auto value = DeserializeObject(subDict, keys[i], javascriptCallbackFactory); @@ -81,16 +85,6 @@ namespace CefSharp return result; } - - DateTime ConvertCefTimeToDateTime(CefTime time) - { - auto epoch = time.GetDoubleT(); - if (epoch == 0) - { - return DateTime::MinValue; - } - return DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(epoch).ToLocalTime(); - } } } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/Serialization/ObjectsSerialization.h b/CefSharp.Core.Runtime/Internals/Serialization/ObjectsSerialization.h similarity index 100% rename from CefSharp.Core/Internals/Serialization/ObjectsSerialization.h rename to CefSharp.Core.Runtime/Internals/Serialization/ObjectsSerialization.h diff --git a/CefSharp.Core/Internals/Serialization/Primitives.cpp b/CefSharp.Core.Runtime/Internals/Serialization/Primitives.cpp similarity index 54% rename from CefSharp.Core/Internals/Serialization/Primitives.cpp rename to CefSharp.Core.Runtime/Internals/Serialization/Primitives.cpp index 46f5cd8025..c24020fe85 100644 --- a/CefSharp.Core/Internals/Serialization/Primitives.cpp +++ b/CefSharp.Core.Runtime/Internals/Serialization/Primitives.cpp @@ -19,7 +19,8 @@ namespace CefSharp { INT64, CEFTIME, - JSCALLBACK + JSCALLBACK, + ARRAYBUFFER }; template @@ -37,23 +38,23 @@ namespace CefSharp } template - void SetInt64(const CefRefPtr& list, TIndex index, const int64 &value) + void SetInt64(const CefRefPtr& list, TIndex index, const int64_t&value) { - unsigned char mem[1 + sizeof(int64)]; + unsigned char mem[1 + sizeof(int64_t)]; mem[0] = static_cast(PrimitiveType::INT64); - memcpy(reinterpret_cast(mem + 1), &value, sizeof(int64)); + memcpy(reinterpret_cast(mem + 1), &value, sizeof(int64_t)); auto binaryValue = CefBinaryValue::Create(mem, sizeof(mem)); list->SetBinary(index, binaryValue); } template - int64 GetInt64(const CefRefPtr& list, TIndex index) + int64_t GetInt64(const CefRefPtr& list, TIndex index) { - int64 result; + int64_t result; auto binaryValue = list->GetBinary(index); - binaryValue->GetData(&result, sizeof(int64), 1); + binaryValue->GetData(&result, sizeof(int64_t), 1); return result; } @@ -65,26 +66,25 @@ namespace CefSharp } template - void SetCefTime(const CefRefPtr& list, TIndex index, const CefTime &value) + void SetCefTime(const CefRefPtr& list, TIndex index, const int64_t&value) { - auto doubleT = value.GetDoubleT(); - unsigned char mem[1 + sizeof(double)]; + unsigned char mem[1 + sizeof(int64_t)]; mem[0] = static_cast(PrimitiveType::CEFTIME); - memcpy(reinterpret_cast(mem + 1), &doubleT, sizeof(double)); + memcpy(reinterpret_cast(mem + 1), &value, sizeof(int64_t)); auto binaryValue = CefBinaryValue::Create(mem, sizeof(mem)); list->SetBinary(index, binaryValue); } template - CefTime GetCefTime(const CefRefPtr& list, TIndex index) + CefBaseTime GetCefTime(const CefRefPtr& list, TIndex index) { - double doubleT; + CefBaseTime baseTime; auto binaryValue = list->GetBinary(index); - binaryValue->GetData(&doubleT, sizeof(double), 1); + binaryValue->GetData(&baseTime.val, sizeof(int64_t), 1); - return CefTime(doubleT); + return baseTime; } template @@ -92,41 +92,62 @@ namespace CefSharp { return IsType(PrimitiveType::CEFTIME, list, index); } + template - void SetJsCallback(const CefRefPtr& list, TIndex index, JavascriptCallback^ value) + void SetArrayBuffer(const CefRefPtr& list, TIndex index, const size_t& size, const void* value) { - auto id = value->Id; - auto browserId = value->BrowserId; - auto frameId = value->FrameId; + const auto src = static_cast(value); - unsigned char mem[1 + sizeof(int) + sizeof(int64) + sizeof(int64)]; - mem[0] = static_cast(PrimitiveType::JSCALLBACK); - memcpy(reinterpret_cast(mem + 1), &browserId, sizeof(int)); - memcpy(reinterpret_cast(mem + 1 + sizeof(int)), &id, sizeof(int64)); - memcpy(reinterpret_cast(mem + 1 + sizeof(int) + sizeof(int64)), &frameId, sizeof(int64)); + auto dest = new uint8_t[size + 1]; + dest[0] = static_cast(PrimitiveType::ARRAYBUFFER); + memcpy(&dest[1], src, size); - auto binaryValue = CefBinaryValue::Create(mem, sizeof(mem)); + list->SetBinary(index, CefBinaryValue::Create(dest, size + 1)); + } + + template + cli::array^ GetArrayBuffer(const CefRefPtr& list, TIndex index) + { + auto binaryValue = list->GetBinary(index); + auto size = binaryValue->GetSize() - 1; + + auto bufferByte = gcnew cli::array(static_cast(size)); + pin_ptr src = &bufferByte[0]; // pin pointer to first element in arr + + binaryValue->GetData(static_cast(src), size, 1); + + return bufferByte; + } + + template + bool IsArrayBuffer(const CefRefPtr& list, TIndex index) + { + return IsType(PrimitiveType::ARRAYBUFFER, list, index); + } + + template + void SetJsCallback(const CefRefPtr& list, TIndex index, JavascriptCallback^ value) + { + auto bytes = value->ToByteArray(static_cast(PrimitiveType::JSCALLBACK)); + pin_ptr bytesPtr = &bytes[0]; + + auto binaryValue = CefBinaryValue::Create(bytesPtr, bytes->Length); list->SetBinary(index, binaryValue); } template JavascriptCallback^ GetJsCallback(const CefRefPtr& list, TIndex index) { - auto result = gcnew JavascriptCallback(); - int64 id; - int browserId; - int64 frameId; - auto binaryValue = list->GetBinary(index); - binaryValue->GetData(&browserId, sizeof(int), 1); - binaryValue->GetData(&id, sizeof(int64), 1 + sizeof(int)); - binaryValue->GetData(&frameId, sizeof(int64), 1 + sizeof(int) + sizeof(int64)); + auto bufferSize = (int)binaryValue->GetSize(); + auto buffer = gcnew cli::array(bufferSize); + pin_ptr bufferPtr = &buffer[0]; // pin pointer to first element in arr - result->Id = id; - result->BrowserId = browserId; - result->FrameId = frameId; + //TODO: We can potentially further optimise this by geting binaryValue->GetRawData + // and then reading directly from that + binaryValue->GetData(static_cast(bufferPtr), bufferSize, 0); - return result; + return JavascriptCallback::FromBytes(buffer); } template @@ -136,4 +157,4 @@ namespace CefSharp } } } -} \ No newline at end of file +} diff --git a/CefSharp.Core.Runtime/Internals/Serialization/Primitives.h b/CefSharp.Core.Runtime/Internals/Serialization/Primitives.h new file mode 100644 index 0000000000..04aad9b7f4 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/Serialization/Primitives.h @@ -0,0 +1,84 @@ +// Copyright © 2015 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +namespace CefSharp +{ + namespace Internals + { + namespace Serialization + { + //Functions to serialize/deserialize specific types into CefBinaryValue + + template + void SetInt64(const CefRefPtr& list, TIndex index, const int64_t&value); + template + int64_t GetInt64(const CefRefPtr& list, TIndex index); + template + bool IsInt64(const CefRefPtr& list, TIndex index); + + template + void SetCefTime(const CefRefPtr& list, TIndex index, const int64_t&value); + template + CefBaseTime GetCefTime(const CefRefPtr& list, TIndex index); + template + bool IsCefTime(const CefRefPtr& list, TIndex index); + + template + void SetArrayBuffer(const CefRefPtr& list, TIndex index, const size_t& size, const void* value); + template + cli::array^ GetArrayBuffer(const CefRefPtr& list, TIndex index); + template + bool IsArrayBuffer(const CefRefPtr& list, TIndex index); + + template + void SetJsCallback(const CefRefPtr& list, TIndex index, JavascriptCallback^ value); + template + JavascriptCallback^ GetJsCallback(const CefRefPtr& list, TIndex index); + template + bool IsJsCallback(const CefRefPtr& list, TIndex index); + + template void SetInt64(const CefRefPtr& list, int index, const int64_t&value); + template void SetInt64(const CefRefPtr& list, size_t index, const int64_t&value); + template void SetInt64(const CefRefPtr& list, CefString index, const int64_t&value); + template int64_t GetInt64(const CefRefPtr& list, int index); + template int64_t GetInt64(const CefRefPtr& list, size_t index); + template int64_t GetInt64(const CefRefPtr& list, CefString index); + template bool IsInt64(const CefRefPtr& list, int index); + template bool IsInt64(const CefRefPtr& list, size_t index); + template bool IsInt64(const CefRefPtr& list, CefString index); + + template void SetCefTime(const CefRefPtr& list, int index, const int64_t&value); + template void SetCefTime(const CefRefPtr& list, size_t index, const int64_t&value); + template void SetCefTime(const CefRefPtr& list, CefString index, const int64_t&value); + template CefBaseTime GetCefTime(const CefRefPtr& list, int index); + template CefBaseTime GetCefTime(const CefRefPtr& list, size_t index); + template CefBaseTime GetCefTime(const CefRefPtr& list, CefString index); + template bool IsCefTime(const CefRefPtr& list, size_t index); + template bool IsCefTime(const CefRefPtr& list, int index); + template bool IsCefTime(const CefRefPtr& list, CefString index); + + template void SetArrayBuffer(const CefRefPtr& list, int index, const size_t& size, const void* value); + template void SetArrayBuffer(const CefRefPtr& list, size_t index, const size_t& size, const void* value); + template void SetArrayBuffer(const CefRefPtr& list, CefString index, const size_t& size, const void* value); + template cli::array^ GetArrayBuffer(const CefRefPtr& list, int index); + template cli::array^ GetArrayBuffer(const CefRefPtr& list, size_t index); + template cli::array^ GetArrayBuffer(const CefRefPtr& list, CefString index); + template bool IsArrayBuffer(const CefRefPtr& list, size_t index); + template bool IsArrayBuffer(const CefRefPtr& list, int index); + template bool IsArrayBuffer(const CefRefPtr& list, CefString index); + + template void SetJsCallback(const CefRefPtr& list, int index, JavascriptCallback^ value); + template void SetJsCallback(const CefRefPtr& list, size_t index, JavascriptCallback^ value); + template void SetJsCallback(const CefRefPtr& list, CefString index, JavascriptCallback^ value); + template JavascriptCallback^ GetJsCallback(const CefRefPtr& list, int index); + template JavascriptCallback^ GetJsCallback(const CefRefPtr& list, size_t index); + template JavascriptCallback^ GetJsCallback(const CefRefPtr& list, CefString index); + template bool IsJsCallback(const CefRefPtr& list, int index); + template bool IsJsCallback(const CefRefPtr& list, size_t index); + template bool IsJsCallback(const CefRefPtr& list, CefString index); + } + } +} diff --git a/CefSharp.Core/Internals/Serialization/V8Serialization.cpp b/CefSharp.Core.Runtime/Internals/Serialization/V8Serialization.cpp similarity index 68% rename from CefSharp.Core/Internals/Serialization/V8Serialization.cpp rename to CefSharp.Core.Runtime/Internals/Serialization/V8Serialization.cpp index ea5eaa8c91..faf4840763 100644 --- a/CefSharp.Core/Internals/Serialization/V8Serialization.cpp +++ b/CefSharp.Core.Runtime/Internals/Serialization/V8Serialization.cpp @@ -5,12 +5,26 @@ #include "Stdafx.h" #include "include\cef_values.h" +#include "include\cef_parser.h" #include "V8Serialization.h" #include "Primitives.h" using namespace System::Collections::Generic; +namespace +{ + String^ GetJavascriptName(System::Reflection::MemberInfo^ memberInfo, IJavascriptNameConverter^ nameConverter) + { + if (nameConverter == nullptr) + { + return memberInfo->Name; + } + + return nameConverter->ConvertReturnedObjectPropertyAndFieldToNameJavascript(memberInfo); + } +} + namespace CefSharp { namespace Internals @@ -18,17 +32,17 @@ namespace CefSharp namespace Serialization { template - void SerializeV8Object(const CefRefPtr& list, const TIndex& index, Object^ obj) + void SerializeV8Object(const CefRefPtr& list, const TIndex& index, Object^ obj, IJavascriptNameConverter^ nameConverter) { // Collection of ancestors to currently serialised object. // This enables prevention of endless loops due to cycles in graphs where // a child references one of its ancestors. auto ancestors = gcnew HashSet(); - SerializeV8SimpleObject(list, index, obj, ancestors); + SerializeV8SimpleObject(list, index, obj, ancestors, nameConverter); } template - void SerializeV8SimpleObject(const CefRefPtr& list, const TIndex& index, Object^ obj, HashSet^ ancestors) + void SerializeV8SimpleObject(const CefRefPtr& list, const TIndex& index, Object^ obj, HashSet^ ancestors, IJavascriptNameConverter^ nameConverter) { list->SetNull(index); @@ -100,7 +114,7 @@ namespace CefSharp } else if (type == DateTime::typeid) { - SetCefTime(list, index, ConvertDateTimeToCefTime(safe_cast(obj))); + SetCefTime(list, index, CefTimeUtils::FromDateTimeToBaseTime(safe_cast(obj))); } // Serialize enum to sbyte, short, int, long, byte, ushort, uint, ulong (check type of enum) else if (type->IsEnum) @@ -109,22 +123,35 @@ namespace CefSharp if (subType == SByte::typeid || subType == Int16::typeid || subType == Int32::typeid || - subType == Byte::typeid || + subType == Byte::typeid || subType == UInt16::typeid) { list->SetInt(index, Convert::ToInt32(obj)); } else if (subType == Int64::typeid || - subType == UInt32::typeid || - subType == UInt64::typeid) + subType == UInt32::typeid || + subType == UInt64::typeid) { list->SetDouble(index, Convert::ToDouble(obj)); } else { - throw gcnew NotSupportedException("Unable to serialize Type"); + //Unexpected type, just convert it to a string + list->SetString(index, StringUtils::ToNative(Convert::ToString(obj))); } } + // ExpandoObject only implements IDictionary not the non-generic System.Collection.IDictionary like Dictionary does + else if (type == System::Dynamic::ExpandoObject::typeid) + { + auto subDict = CefDictionaryValue::Create(); + auto dict = (System::Collections::Generic::IDictionary^) obj; + for each (auto kvp in dict) + { + auto fieldName = StringUtils::ToNative(Convert::ToString(kvp.Key)); + SerializeV8SimpleObject(subDict, fieldName, kvp.Value, ancestors, nameConverter); + } + list->SetDictionary(index, subDict); + } // Serialize dictionary to CefDictionary (key,value pairs) else if (System::Collections::IDictionary::typeid->IsAssignableFrom(type)) { @@ -133,7 +160,7 @@ namespace CefSharp for each (System::Collections::DictionaryEntry kvp in dict) { auto fieldName = StringUtils::ToNative(Convert::ToString(kvp.Key)); - SerializeV8SimpleObject(subDict, fieldName, kvp.Value, ancestors); + SerializeV8SimpleObject(subDict, fieldName, kvp.Value, ancestors, nameConverter); } list->SetDictionary(index, subDict); } @@ -145,11 +172,30 @@ namespace CefSharp int i = 0; for each (Object^ arrObj in enumerable) { - SerializeV8SimpleObject(subList, i, arrObj, ancestors); + SerializeV8SimpleObject(subList, i, arrObj, ancestors, nameConverter); i++; } list->SetList(index, subList); } + else if (CefSharp::Web::JsonString::typeid->IsAssignableFrom(type)) + { + auto jsonString = (CefSharp::Web::JsonString^) obj; + + //Tried to use CefParseJSONAndReturnError, keeps returning error when + //CefParseJson works for the same string, so must be a CEF bug + auto jsonValue = CefParseJSON(StringUtils::ToNative(jsonString->Json), + cef_json_parser_options_t::JSON_PARSER_ALLOW_TRAILING_COMMAS); + + if (jsonValue.get()) + { + list->SetValue(index, jsonValue); + } + else + { + list->SetString(index, CefString("V8Serialization - Unable to parse JSON")); + } + } + // Serialize class/structs to CefDictionary (key,value pairs) else if (!type->IsPrimitive && !type->IsEnum) { @@ -158,35 +204,28 @@ namespace CefSharp for (int i = 0; i < fields->Length; i++) { - auto fieldName = StringUtils::ToNative(fields[i]->Name); + auto fieldName = GetJavascriptName(fields[i], nameConverter); auto fieldValue = fields[i]->GetValue(obj); - SerializeV8SimpleObject(subDict, fieldName, fieldValue, ancestors); + SerializeV8SimpleObject(subDict, StringUtils::ToNative(fieldName), fieldValue, ancestors, nameConverter); } auto properties = type->GetProperties(); for (int i = 0; i < properties->Length; i++) { - auto propertyName = StringUtils::ToNative(properties[i]->Name); + auto propertyName = GetJavascriptName(properties[i], nameConverter); auto propertyValue = properties[i]->GetValue(obj); - SerializeV8SimpleObject(subDict, propertyName, propertyValue, ancestors); + SerializeV8SimpleObject(subDict, StringUtils::ToNative(propertyName), propertyValue, ancestors, nameConverter); } list->SetDictionary(index, subDict); } else { - throw gcnew NotSupportedException("Unable to serialize Type"); + list->SetString(index, StringUtils::ToNative("Unable to serialize Type - " + obj->GetType()->ToString())); } ancestors->Remove(obj); } - - CefTime ConvertDateTimeToCefTime(DateTime dateTime) - { - auto timeSpan = dateTime.ToUniversalTime() - DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind::Utc); - - return CefTime(timeSpan.TotalSeconds); - } } } } diff --git a/CefSharp.Core/Internals/Serialization/V8Serialization.h b/CefSharp.Core.Runtime/Internals/Serialization/V8Serialization.h similarity index 59% rename from CefSharp.Core/Internals/Serialization/V8Serialization.h rename to CefSharp.Core.Runtime/Internals/Serialization/V8Serialization.h index f90980f51c..528f9f4758 100644 --- a/CefSharp.Core/Internals/Serialization/V8Serialization.h +++ b/CefSharp.Core.Runtime/Internals/Serialization/V8Serialization.h @@ -4,6 +4,8 @@ #pragma once +using namespace CefSharp::JavascriptBinding; + namespace CefSharp { namespace Internals @@ -14,13 +16,14 @@ namespace CefSharp //Serializes data into a given position in a CefListValue or CefDictionaryValue template - void SerializeV8Object(const CefRefPtr& list, const TIndex& index, Object^ obj); + void SerializeV8Object(const CefRefPtr& list, const TIndex& index, Object^ obj, IJavascriptNameConverter^ nameConverter); template - void SerializeV8SimpleObject(const CefRefPtr& list, const TIndex& index, Object^ obj, HashSet^ seen); + void SerializeV8SimpleObject(const CefRefPtr& list, const TIndex& index, Object^ obj, HashSet^ seen, IJavascriptNameConverter^ nameConverter); - template void SerializeV8Object(const CefRefPtr& list, const int& index, Object^ obj); - template void SerializeV8Object(const CefRefPtr& list, const CefString& index, Object^ obj); + template void SerializeV8Object(const CefRefPtr& list, const int& index, Object^ obj, IJavascriptNameConverter^ nameConverter); + template void SerializeV8Object(const CefRefPtr& list, const size_t& index, Object^ obj, IJavascriptNameConverter^ nameConverter); + template void SerializeV8Object(const CefRefPtr& list, const CefString& index, Object^ obj, IJavascriptNameConverter^ nameConverter); } } } \ No newline at end of file diff --git a/CefSharp.Core/Internals/StringUtils.h b/CefSharp.Core.Runtime/Internals/StringUtils.h similarity index 89% rename from CefSharp.Core/Internals/StringUtils.h rename to CefSharp.Core.Runtime/Internals/StringUtils.h index 18342bf8e8..2ba1467ad7 100644 --- a/CefSharp.Core/Internals/StringUtils.h +++ b/CefSharp.Core.Runtime/Internals/StringUtils.h @@ -26,9 +26,11 @@ namespace CefSharp /// The string that should be converted. /// A .NET string. [DebuggerStepThrough] - static String^ StringUtils::ToClr(const cef_string_t& cefStr) + static String^ ToClr(const cef_string_t& cefStr) { - return gcnew String(cefStr.str); + auto str = reinterpret_cast(cefStr.str); + + return gcnew String(str); } /// @@ -37,9 +39,11 @@ namespace CefSharp /// The string that should be converted. /// A .NET string. [DebuggerStepThrough] - static String^ StringUtils::ToClr(const CefString& cefStr) + static String^ ToClr(const CefString& cefStr) { - return gcnew String(cefStr.c_str()); + auto str = reinterpret_cast(cefStr.c_str()); + + return gcnew String(str); } /// @@ -108,14 +112,14 @@ namespace CefSharp /// The cef_string_t that should be updated. /// The .NET string whose value should be used to update cefStr. [DebuggerStepThrough] - static void StringUtils::AssignNativeFromClr(cef_string_t& cefStr, String^ str) + static void AssignNativeFromClr(cef_string_t& cefStr, String^ str) { cef_string_clear(&cefStr); if (str != nullptr) { pin_ptr pStr = PtrToStringChars(str); - cef_string_copy(pStr, str->Length, &cefStr); + cef_string_copy(reinterpret_cast(pStr), str->Length, &cefStr); } } @@ -129,10 +133,10 @@ namespace CefSharp if (exception.get()) { std::wstringstream logMessageBuilder; - logMessageBuilder << exception->GetMessage().c_str() << L"\n@ "; + logMessageBuilder << exception->GetMessage().ToWString() << L"\n@ "; if (!exception->GetScriptResourceName().empty()) { - logMessageBuilder << exception->GetScriptResourceName().c_str(); + logMessageBuilder << exception->GetScriptResourceName().ToWString(); } logMessageBuilder << L":" << exception->GetLineNumber() << L":" << exception->GetStartColumn(); return CefString(logMessageBuilder.str()); @@ -142,4 +146,4 @@ namespace CefSharp } }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core/Internals/TypeConversion.h b/CefSharp.Core.Runtime/Internals/TypeConversion.h similarity index 83% rename from CefSharp.Core/Internals/TypeConversion.h rename to CefSharp.Core.Runtime/Internals/TypeConversion.h index 9862df781e..b4f2e135c9 100644 --- a/CefSharp.Core/Internals/TypeConversion.h +++ b/CefSharp.Core.Runtime/Internals/TypeConversion.h @@ -9,7 +9,6 @@ #include "include/internal/cef_ptr.h" #include "include\cef_download_item.h" #include "include\cef_response.h" -#include "include\cef_web_plugin.h" #include "Serialization\ObjectsSerialization.h" #include "Serialization\V8Serialization.h" @@ -63,8 +62,8 @@ namespace CefSharp item->PercentComplete = downloadItem->GetPercentComplete(); item->TotalBytes = downloadItem->GetTotalBytes(); item->ReceivedBytes = downloadItem->GetReceivedBytes(); - item->StartTime = FromNative(downloadItem->GetStartTime()); - item->EndTime = FromNative(downloadItem->GetEndTime()); + item->StartTime = CefTimeUtils::FromBaseTimeToNullableDateTime((downloadItem->GetStartTime().val)); + item->EndTime = CefTimeUtils::FromBaseTimeToNullableDateTime(downloadItem->GetEndTime().val); item->FullPath = StringUtils::ToClr(downloadItem->GetFullPath()); item->Id = downloadItem->GetId(); item->Url = StringUtils::ToClr(downloadItem->GetURL()); @@ -77,25 +76,6 @@ namespace CefSharp return item; } - //Convert from CefTime to Nullable - static Nullable FromNative(CefTime time) - { - auto epoch = time.GetDoubleT(); - if (epoch == 0) - { - return Nullable(); - } - return Nullable(DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(epoch).ToLocalTime()); - } - - static WebPluginInfo^ FromNative(CefRefPtr webPluginInfo) - { - return gcnew WebPluginInfo(StringUtils::ToClr(webPluginInfo->GetName()), - StringUtils::ToClr(webPluginInfo->GetDescription()), - StringUtils::ToClr(webPluginInfo->GetPath()), - StringUtils::ToClr(webPluginInfo->GetVersion())); - } - static IList^ FromNative(const std::vector& regions) { if (regions.size() == 0) @@ -159,8 +139,10 @@ namespace CefSharp for each (System::Collections::DictionaryEntry entry in dictionary) { auto key = StringUtils::ToNative(Convert::ToString(entry.Key)); - auto value = entry.Value; - SerializeV8Object(cefDictionary, key, value); + auto entryValue = entry.Value; + //We don't pass a nameConverter here as the keys should + //remain unchanged + SerializeV8Object(cefDictionary, key, entryValue, nullptr); } cefValue->SetDictionary(cefDictionary); @@ -173,7 +155,9 @@ namespace CefSharp int i = 0; for each (Object^ arrObj in enumerable) { - SerializeV8Object(cefList, i, arrObj); + //We don't pass a nameConverter here as the keys should + //remain unchanged + SerializeV8Object(cefList, i, arrObj, nullptr); i++; } @@ -237,7 +221,7 @@ namespace CefSharp CefDictionaryValue::KeyList keys; dictionary->GetKeys(keys); - for (auto i = 0; i < keys.size(); i++) + for (size_t i = 0; i < keys.size(); i++) { auto key = StringUtils::ToClr(keys[i]); auto value = DeserializeObject(dictionary, keys[i], nullptr); @@ -251,7 +235,7 @@ namespace CefSharp static List^ FromNative(const CefRefPtr& list) { auto result = gcnew List(list->GetSize()); - for (auto i = 0; i < list->GetSize(); i++) + for (size_t i = 0; i < list->GetSize(); i++) { result->Add(DeserializeObject(list, i, nullptr)); } @@ -259,18 +243,6 @@ namespace CefSharp return result; } - // Copied from CefSharp.BrowserSubprocess.Core\TypeUtils.h since it can't be included - static DateTime ConvertCefTimeToDateTime(CefTime time) - { - return DateTimeUtils::FromCefTime(time.year, - time.month, - time.day_of_month, - time.hour, - time.minute, - time.second, - time.millisecond); - } - static Cookie^ FromNative(const CefCookie& cefCookie) { auto cookie = gcnew Cookie(); @@ -284,12 +256,14 @@ namespace CefSharp cookie->Path = StringUtils::ToClr(cefCookie.path); cookie->Secure = cefCookie.secure == 1; cookie->HttpOnly = cefCookie.httponly == 1; - cookie->Creation = ConvertCefTimeToDateTime(cefCookie.creation); - cookie->LastAccess = ConvertCefTimeToDateTime(cefCookie.last_access); + cookie->SetCreationDate(cefCookie.creation.val); + cookie->SetLastAccessDate(cefCookie.last_access.val); + cookie->SameSite = (CefSharp::Enums::CookieSameSite)cefCookie.same_site; + cookie->Priority = (CefSharp::Enums::CookiePriority)cefCookie.priority; if (cefCookie.has_expires) { - cookie->Expires = ConvertCefTimeToDateTime(cefCookie.expires); + cookie->Expires = CefTimeUtils::FromBaseTimeToDateTime(cefCookie.expires.val); } } @@ -299,7 +273,7 @@ namespace CefSharp static NavigationEntry^ FromNative(const CefRefPtr entry, bool current) { SslStatus^ sslStatus; - + if (!entry.get()) { return nullptr; @@ -310,8 +284,7 @@ namespace CefSharp return gcnew NavigationEntry(current, DateTime::MinValue, nullptr, -1, nullptr, nullptr, (TransitionType)-1, nullptr, false, false, sslStatus); } - auto time = entry->GetCompletionTime(); - DateTime completionTime = CefTimeUtils::ConvertCefTimeToDateTime(time.GetDoubleT()); + DateTime completionTime = CefTimeUtils::FromBaseTimeToDateTime(entry->GetCompletionTime().val); auto ssl = entry->GetSSLStatus(); X509Certificate2^ sslCertificate; diff --git a/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.cpp b/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.cpp new file mode 100644 index 0000000000..7a3a202291 --- /dev/null +++ b/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.cpp @@ -0,0 +1,256 @@ +// Copyright © 2014 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#include "Stdafx.h" + +#include "ManagedCefBrowserAdapter.h" +#include "WindowInfo.h" +#include "Internals\Messaging\Messages.h" +#include "Internals\CefFrameWrapper.h" +#include "Internals\CefBrowserWrapper.h" +#include "Internals\Serialization\Primitives.h" +#include "Internals\Serialization\JsObjectsSerialization.h" + +using namespace CefSharp::Internals::Serialization; +using namespace CefSharp::Internals::Messaging; + +namespace CefSharp +{ + namespace Core + { + + bool ManagedCefBrowserAdapter::IsDisposed::get() + { + return _isDisposed; + } + + void ManagedCefBrowserAdapter::CreateBrowser(IWindowInfo^ windowInfo, IBrowserSettings^ browserSettings, IRequestContext^ requestContext, String^ address) + { + CefString addressNative = StringUtils::ToNative(address); + + if (browserSettings == nullptr) + { + throw gcnew ArgumentNullException("browserSettings", "cannot be null"); + } + + if (browserSettings->IsDisposed) + { + throw gcnew ObjectDisposedException("browserSettings", "browser settings has already been disposed. " + + "BrowserSettings created by CefSharp are automatically disposed, to control the lifecycle create and set your own instance."); + } + + auto objectRepository = _javaScriptObjectRepository; + auto objectRepositorySettings = objectRepository->Settings; + + //It's no longer possible to change these settings + objectRepositorySettings->Freeze(); + + CefRefPtr extraInfo = CefDictionaryValue::Create(); + auto legacyBindingEnabled = false; + + if (objectRepositorySettings->LegacyBindingEnabled) + { + auto legacyBoundObjects = objectRepository->GetLegacyBoundObjects(address); + + legacyBindingEnabled = objectRepository->HasBoundObjects; + + //For legacy binding we only add values if we have bond objects. + if (legacyBindingEnabled) + { + auto listValue = CefListValue::Create(); + + SerializeJsObjects(legacyBoundObjects, listValue, 0); + + extraInfo->SetList("LegacyBindingObjects", listValue); + } + } + + extraInfo->SetBool("LegacyBindingEnabled", legacyBindingEnabled); + + if (!String::IsNullOrEmpty(objectRepositorySettings->JavascriptBindingApiGlobalObjectName)) + { + auto globalObjName = objectRepositorySettings->JavascriptBindingApiGlobalObjectName; + + if (StringCheck::IsFirstCharacterLowercase(globalObjName)) + { + extraInfo->SetString("JsBindingPropertyNameCamelCase", StringUtils::ToNative(globalObjName)); + } + else + { + extraInfo->SetString("JsBindingPropertyName", StringUtils::ToNative(globalObjName)); + } + } + + extraInfo->SetBool("JavascriptBindingApiEnabled", objectRepositorySettings->JavascriptBindingApiEnabled); + + auto hasJavascriptBindingApiAllowOrigins = objectRepositorySettings->HasJavascriptBindingApiAllowOrigins(); + + extraInfo->SetBool("JavascriptBindingApiHasAllowOrigins", hasJavascriptBindingApiAllowOrigins); + + if (hasJavascriptBindingApiAllowOrigins) + { + auto allowOriginList = CefListValue::Create(); + + for (int i = 0; i < objectRepositorySettings->JavascriptBindingApiAllowOrigins->Length; i++) + { + allowOriginList->SetString(i, StringUtils::ToNative(objectRepositorySettings->JavascriptBindingApiAllowOrigins[i])); + } + + extraInfo->SetList("JavascriptBindingApiAllowOrigins", allowOriginList); + } + + CefRefPtr requestCtx; + + if (requestContext != nullptr) + { + auto managedRequestCtx = (RequestContext^)requestContext->UnWrap(); + requestCtx = static_cast>(managedRequestCtx); + } + + auto winInfo = (WindowInfo^)windowInfo->UnWrap(); + auto bSettings = (BrowserSettings^)browserSettings->UnWrap(); + + if (!CefBrowserHost::CreateBrowser(*winInfo->GetWindowInfo(), _clientAdapter.get(), addressNative, + *bSettings->_browserSettings, extraInfo, requestCtx)) + { + throw gcnew InvalidOperationException("CefBrowserHost::CreateBrowser call failed, review the CEF log file for more details."); + } + + delete windowInfo; + } + +#ifndef NETCOREAPP + // NOTE: This was moved out of OnAfterBrowserCreated to prevent the System.ServiceModel assembly from being loaded when WCF is not enabled. + __declspec(noinline) void ManagedCefBrowserAdapter::InitializeBrowserProcessServiceHost(IBrowser^ browser) + { + if (browser->IsDisposed) + { + return; + } + + //As the default the browser is Disposed on a different thread to this method it's possible that + //we arrive here after browser has started Disposing. In that case there's likely to be an exception + //accessing the Browser and possibly the serviceHost. + //https://github.com/cefsharp/CefSharp/issues/3437 + try + { + _browserProcessServiceHost = gcnew BrowserProcessServiceHost(_javaScriptObjectRepository, Process::GetCurrentProcess()->Id, browser->Identifier, _javascriptCallbackFactory); + //NOTE: Attempt to solve timing issue where browser is opened and rapidly disposed. In some cases a call to Open throws + // an exception about the process already being closed. Two relevant issues are #862 and #804. + if (_browserProcessServiceHost->State == CommunicationState::Created) + { + _browserProcessServiceHost->Open(); + } + } + catch (Exception^) + { + //Ignore exception as it's likely cause when the browser is closing/disposed + } + } + + // NOTE: This was moved out of ~ManagedCefBrowserAdapter to prevent the System.ServiceModel assembly from being loaded when WCF is not enabled. + __declspec(noinline) void ManagedCefBrowserAdapter::DisposeBrowserProcessServiceHost() + { + if (_browserProcessServiceHost != nullptr) + { + if (CefSharpSettings::WcfTimeout > TimeSpan::Zero) + { + _browserProcessServiceHost->Close(CefSharpSettings::WcfTimeout); + } + else + { + _browserProcessServiceHost->Abort(); + } + _browserProcessServiceHost = nullptr; + } + } +#endif + + void ManagedCefBrowserAdapter::OnAfterBrowserCreated(IBrowser^ browser) + { + if (!_isDisposed) + { + _browserWrapper = browser; + _javascriptCallbackFactory->BrowserAdapter = gcnew WeakReference(this); + + //Browser has been initialized, it's now too late to register a sync JSB object if Wcf wasn't enabled + _javaScriptObjectRepository->IsBrowserInitialized = true; + +#ifndef NETCOREAPP + if (CefSharpSettings::WcfEnabled) + { + InitializeBrowserProcessServiceHost(browser); + } +#endif + + if (_webBrowserInternal != nullptr) + { + _webBrowserInternal->OnAfterBrowserCreated(browser); + } + } + } + + void ManagedCefBrowserAdapter::Resize(int width, int height) + { + HWND browserHwnd = _clientAdapter->GetBrowserHwnd(); + if (browserHwnd) + { + if (width == 0 && height == 0) + { + // For windowed browsers when the frame window is minimized set the + // browser window size to 0x0 to reduce resource usage. + SetWindowPos(browserHwnd, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); + } + else + { + SetWindowPos(browserHwnd, NULL, 0, 0, width, height, SWP_NOZORDER); + } + } + } + + IBrowser^ ManagedCefBrowserAdapter::GetBrowser(int browserId) + { + if (_clientAdapter.get()) + { + return _clientAdapter->GetBrowserWrapper(browserId); + } + + return nullptr; + } + + IJavascriptCallbackFactory^ ManagedCefBrowserAdapter::JavascriptCallbackFactory::get() + { + return _javascriptCallbackFactory; + } + + IJavascriptObjectRepositoryInternal^ ManagedCefBrowserAdapter::JavascriptObjectRepository::get() + { + return _javaScriptObjectRepository; + } + + IMethodRunnerQueue^ ManagedCefBrowserAdapter::MethodRunnerQueue::get() + { + return _methodRunnerQueue; + } + + void ManagedCefBrowserAdapter::MethodInvocationComplete(Object^ sender, MethodInvocationCompleteArgs^ e) + { + if (_isDisposed) + { + return; + } + + auto result = e->Result; + if (result->CallbackId.HasValue) + { + _clientAdapter->MethodInvocationComplete(result); + } + } + + MCefRefPtr ManagedCefBrowserAdapter::GetClientAdapter() + { + return _clientAdapter; + } + } +} diff --git a/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.h b/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.h new file mode 100644 index 0000000000..dd44a019c5 --- /dev/null +++ b/CefSharp.Core.Runtime/ManagedCefBrowserAdapter.h @@ -0,0 +1,155 @@ +// Copyright © 2013 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#ifndef CEFSHARP_CORE_MANAGEDCEFBROWSERADAPTER_H_ +#define CEFSHARP_CORE_MANAGEDCEFBROWSERADAPTER_H_ + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_client.h" + +#include "BrowserSettings.h" +#include "RequestContext.h" +#include "Internals/ClientAdapter.h" +#include "Internals/RenderClientAdapter.h" +#include "Internals/JavascriptCallbackFactory.h" + +using namespace System::Diagnostics; +#ifndef NETCOREAPP +using namespace System::ServiceModel; +using namespace CefSharp::Internals::Wcf; +#endif +using namespace System::Threading; +using namespace System::Threading::Tasks; + +namespace CefSharp +{ + namespace Core + { + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class ManagedCefBrowserAdapter : public IBrowserAdapter + { + MCefRefPtr _clientAdapter; +#ifndef NETCOREAPP + BrowserProcessServiceHost^ _browserProcessServiceHost; +#endif + IWebBrowserInternal^ _webBrowserInternal; + IJavascriptObjectRepositoryInternal^ _javaScriptObjectRepository; + JavascriptCallbackFactory^ _javascriptCallbackFactory; + IMethodRunnerQueue^ _methodRunnerQueue; + IBrowser^ _browserWrapper; + bool _isDisposed; + + private: + void MethodInvocationComplete(Object^ sender, MethodInvocationCompleteArgs^ e); +#ifndef NETCOREAPP + void InitializeBrowserProcessServiceHost(IBrowser^ browser); + void DisposeBrowserProcessServiceHost(); +#endif + + internal: + MCefRefPtr GetClientAdapter(); + + public: + ManagedCefBrowserAdapter(IWebBrowserInternal^ webBrowserInternal, bool offScreenRendering) + : _isDisposed(false) + { + if (offScreenRendering) + { + _clientAdapter = new RenderClientAdapter(webBrowserInternal, this); + } + else + { + _clientAdapter = new ClientAdapter(webBrowserInternal, this); + } + + _webBrowserInternal = webBrowserInternal; + _javaScriptObjectRepository = gcnew CefSharp::Internals::JavascriptObjectRepository(); + _javascriptCallbackFactory = gcnew CefSharp::Internals::JavascriptCallbackFactory(_clientAdapter->GetPendingTaskRepository()); + + if (CefSharpSettings::ConcurrentTaskExecution) + { + _methodRunnerQueue = gcnew CefSharp::Internals::ConcurrentMethodRunnerQueue(_javaScriptObjectRepository); + } + else + { + _methodRunnerQueue = gcnew CefSharp::Internals::MethodRunnerQueue(_javaScriptObjectRepository); + } + + _methodRunnerQueue->MethodInvocationComplete += gcnew EventHandler(this, &ManagedCefBrowserAdapter::MethodInvocationComplete); + } + + !ManagedCefBrowserAdapter() + { + _clientAdapter = nullptr; + } + + ~ManagedCefBrowserAdapter() + { + _isDisposed = true; + + // Stop the method runner before releasing browser adapter and browser wrapper (#2529) + if (_methodRunnerQueue != nullptr) + { + _methodRunnerQueue->MethodInvocationComplete -= gcnew EventHandler(this, &ManagedCefBrowserAdapter::MethodInvocationComplete); + delete _methodRunnerQueue; + _methodRunnerQueue = nullptr; + } + + // Release the MCefRefPtr reference + // before calling _browserWrapper->CloseBrowser(true) + this->!ManagedCefBrowserAdapter(); + + if (_browserWrapper != nullptr) + { + _browserWrapper->CloseBrowser(true); + + delete _browserWrapper; + _browserWrapper = nullptr; + } + +#ifndef NETCOREAPP + if (CefSharpSettings::WcfEnabled) + { + DisposeBrowserProcessServiceHost(); + } +#endif + + _webBrowserInternal = nullptr; + delete _javaScriptObjectRepository; + _javaScriptObjectRepository = nullptr; + } + + virtual property bool IsDisposed + { + bool get(); + } + + virtual void OnAfterBrowserCreated(IBrowser^ browser); + virtual void CreateBrowser(IWindowInfo^ windowInfo, IBrowserSettings^ browserSettings, IRequestContext^ requestContext, String^ address); + virtual void Resize(int width, int height); + + virtual IBrowser^ GetBrowser(int browserId); + + virtual property IJavascriptCallbackFactory^ JavascriptCallbackFactory + { + CefSharp::Internals::IJavascriptCallbackFactory^ get(); + } + + virtual property IJavascriptObjectRepositoryInternal^ JavascriptObjectRepository + { + CefSharp::Internals::IJavascriptObjectRepositoryInternal^ get(); + } + + virtual property IMethodRunnerQueue^ MethodRunnerQueue + { + CefSharp::Internals::IMethodRunnerQueue^ get(); + } + }; + } +} +#endif // CEFSHARP_CORE_INTERNALS_CLIENTADAPTER_H_ diff --git a/CefSharp.Core.Runtime/NativeMethodWrapper.cpp b/CefSharp.Core.Runtime/NativeMethodWrapper.cpp new file mode 100644 index 0000000000..82bc1ef2c7 --- /dev/null +++ b/CefSharp.Core.Runtime/NativeMethodWrapper.cpp @@ -0,0 +1,82 @@ +// Copyright © 2014 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#include "Stdafx.h" + +#include "NativeMethodWrapper.h" + +namespace CefSharp +{ + namespace Core + { + void NativeMethodWrapper::MemoryCopy(IntPtr dest, IntPtr src, int numberOfBytes) + { + RtlCopyMemory(dest.ToPointer(), src.ToPointer(), numberOfBytes); + } + + bool NativeMethodWrapper::IsFocused(IntPtr handle) + { + // Ask Windows which control has the focus and then check if it's one of our children + auto focusControl = GetFocus(); + return focusControl != 0 && (IsChild((HWND)handle.ToPointer(), focusControl) == 1); + } + + void NativeMethodWrapper::SetWindowPosition(IntPtr handle, int x, int y, int width, int height) + { + HWND browserHwnd = static_cast(handle.ToPointer()); + if (browserHwnd) + { + if (width == 0 && height == 0) + { + // For windowed browsers when the frame window is minimized set the + // browser window size to 0x0 to reduce resource usage. + SetWindowPos(browserHwnd, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); + } + else + { + SetWindowPos(browserHwnd, NULL, x, y, width, height, SWP_NOZORDER); + } + } + } + + void NativeMethodWrapper::SetWindowParent(IntPtr child, IntPtr newParent) + { + HWND childHwnd = static_cast(child.ToPointer()); + HWND newParentHwnd = static_cast(newParent.ToPointer()); + + SetParent(childHwnd, newParentHwnd); + } + + void NativeMethodWrapper::RemoveExNoActivateStyle(IntPtr browserHwnd) + { + HWND hwnd = static_cast(browserHwnd.ToPointer()); + + auto exStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE); + + if (exStyle & WS_EX_NOACTIVATE) + { + //Remove WS_EX_NOACTIVATE + SetWindowLongPtr(hwnd, GWL_EXSTYLE, exStyle & ~WS_EX_NOACTIVATE); + } + } + + IntPtr NativeMethodWrapper::LoadCursorFromLibCef(int resourceIdentifier) + { + auto moduleName = L"libcef.dll"; + + HMODULE hModule = GetModuleHandle(moduleName); + + if (hModule == nullptr) + { + return IntPtr::Zero; + } + + auto lpCursorName = MAKEINTRESOURCE(resourceIdentifier); + + auto cursor = LoadCursor(hModule, lpCursorName); + + return static_cast(cursor); + } + } +} diff --git a/CefSharp.Core.Runtime/NativeMethodWrapper.h b/CefSharp.Core.Runtime/NativeMethodWrapper.h new file mode 100644 index 0000000000..980f82698e --- /dev/null +++ b/CefSharp.Core.Runtime/NativeMethodWrapper.h @@ -0,0 +1,29 @@ +// Copyright © 2012 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +namespace CefSharp +{ + namespace Core + { + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class NativeMethodWrapper sealed + { + public: + //Method cannot be called CopyMemory/RtlCopyMemroy as that's a macro name + //Length is currently int, update if required to handle larger data structures + //(int is plenty big enough for our current use case) + static void MemoryCopy(IntPtr dest, IntPtr src, int numberOfBytes); + static bool IsFocused(IntPtr handle); + static void SetWindowPosition(IntPtr handle, int x, int y, int width, int height); + static void SetWindowParent(IntPtr child, IntPtr newParent); + static void RemoveExNoActivateStyle(IntPtr browserHwnd); + static IntPtr LoadCursorFromLibCef(int resourceIdentifier); + }; + } +} diff --git a/CefSharp.Core.Runtime/PopupFeatures.h b/CefSharp.Core.Runtime/PopupFeatures.h new file mode 100644 index 0000000000..9099931d56 --- /dev/null +++ b/CefSharp.Core.Runtime/PopupFeatures.h @@ -0,0 +1,70 @@ +// Copyright © 2016 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +namespace CefSharp +{ + namespace Core + { + /// + /// Class representing popup window features. + /// + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class PopupFeatures : IPopupFeatures + { + private: + const CefPopupFeatures* _popupFeatures; + + internal: + /// + /// Constructor. + /// + /// The popup features. + PopupFeatures(const CefPopupFeatures* popupFeatures) + { + _popupFeatures = popupFeatures; + } + + public: + !PopupFeatures() + { + _popupFeatures = nullptr; + } + + ~PopupFeatures() + { + this->!PopupFeatures(); + } + + virtual property System::Nullable X + { + System::Nullable get() { return _popupFeatures->xSet ? _popupFeatures->x : Nullable(); } + } + + virtual property System::Nullable Y + { + System::Nullable get() { return _popupFeatures->ySet ? _popupFeatures->y : Nullable(); } + } + + virtual property System::Nullable Width + { + System::Nullable get() { return _popupFeatures->widthSet ? _popupFeatures->width : Nullable(); } + } + + virtual property System::Nullable Height + { + System::Nullable get() { return _popupFeatures->heightSet ? _popupFeatures->height : Nullable(); } + } + + virtual property bool IsPopup + { + bool get() { return _popupFeatures->isPopup == 1; } + } + }; + } +} diff --git a/CefSharp.Core/Internals/CefPostDataWrapper.h b/CefSharp.Core.Runtime/PostData.h similarity index 59% rename from CefSharp.Core/Internals/CefPostDataWrapper.h rename to CefSharp.Core.Runtime/PostData.h index 77d4c01daa..f665d315c5 100644 --- a/CefSharp.Core/Internals/CefPostDataWrapper.h +++ b/CefSharp.Core.Runtime/PostData.h @@ -8,37 +8,48 @@ #include "include\cef_request.h" +#include "PostDataElement.h" #include "Internals\TypeConversion.h" -#include "CefPostDataElementWrapper.h" -#include "CefWrapper.h" +#include "Internals\CefWrapper.h" using namespace System::Collections::Generic; using namespace System::Collections::ObjectModel; namespace CefSharp { - namespace Internals + namespace Core { - private ref class CefPostDataWrapper : public IPostData, public CefWrapper + /// + /// Form Post Data + /// + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class PostData : public IPostData, public CefWrapper { MCefRefPtr _postData; List^ _postDataElements; internal: - CefPostDataWrapper(CefRefPtr &postData) : + PostData(CefRefPtr &postData) : _postData(postData) { } - !CefPostDataWrapper() + /// + /// Finalizer. + /// + !PostData() { _postData = nullptr; } - ~CefPostDataWrapper() + /// + /// Destructor. + /// + ~PostData() { - this->!CefPostDataWrapper(); + this->!PostData(); if (_postDataElements != nullptr) { @@ -54,7 +65,39 @@ namespace CefSharp _disposed = true; } + /// + /// Throw exception if Readonly + /// + /// Thrown when an exception error condition occurs. + void ThrowIfReadOnly() + { + if (IsReadOnly) + { + throw gcnew Exception(gcnew String(L"This IPostDataWrapper is readonly and cannot be modified.")); + } + } + + operator CefRefPtr() + { + if (this == nullptr) + { + return nullptr; + } + return _postData.get(); + } + public: + /// + /// Initializes a new instance of the PostData class. + /// + PostData() + { + _postData = CefPostData::Create().get(); + } + + /// + /// Returns true if this object is read-only. + /// virtual property bool IsReadOnly { bool get() @@ -65,6 +108,9 @@ namespace CefSharp } } + /// + /// Retrieve the post data elements. + /// virtual property IList^ Elements { IList^ get() @@ -88,7 +134,7 @@ namespace CefSharp { CefPostDataElement *el = it->get(); - _postDataElements->Add(gcnew CefPostDataElementWrapper(el)); + _postDataElements->Add(gcnew PostDataElement(el)); } } @@ -96,6 +142,11 @@ namespace CefSharp } } + /// + /// Add the specified . + /// + /// element to be added. + /// Returns true if the add succeeds. virtual bool AddElement(IPostDataElement^ element) { ThrowIfDisposed(); @@ -113,11 +164,16 @@ namespace CefSharp _postDataElements->Add(element); - auto elementWrapper = (CefPostDataElementWrapper^)element; + auto elementWrapper = (PostDataElement^)element->UnWrap(); return _postData->AddElement(elementWrapper); } + /// + /// Remove the specified . + /// + /// element to be removed. + /// Returns true if the add succeeds. virtual bool RemoveElement(IPostDataElement^ element) { ThrowIfDisposed(); @@ -134,11 +190,14 @@ namespace CefSharp _postDataElements->Remove(element); - auto elementWrapper = (CefPostDataElementWrapper^)element; + auto elementWrapper = (PostDataElement^)element->UnWrap(); return _postData->RemoveElement(elementWrapper); } + /// + /// Remove all existing post data elements. + /// virtual void RemoveElements() { ThrowIfDisposed(); @@ -148,13 +207,23 @@ namespace CefSharp _postData->RemoveElements(); } + /// + /// Create a new instance + /// + /// PostDataElement virtual IPostDataElement^ CreatePostDataElement() { auto element = CefPostDataElement::Create(); - return gcnew CefPostDataElementWrapper(element); + return gcnew PostDataElement(element); } + /// + /// Returns true if the underlying POST data includes elements that are not + /// represented by this IPostData object (for example, multi-part file upload + /// data). Modifying IPostData objects with excluded elements may result in + /// the request failing. + /// virtual property bool HasExcludedElements { bool get() @@ -165,12 +234,9 @@ namespace CefSharp } } - void ThrowIfReadOnly() + virtual IPostData^ UnWrap() { - if (IsReadOnly) - { - throw gcnew Exception(gcnew String(L"This IPostDataWrapper is readonly and cannot be modified.")); - } + return this; } }; } diff --git a/CefSharp.Core/Internals/CefPostDataElementWrapper.h b/CefSharp.Core.Runtime/PostDataElement.h similarity index 80% rename from CefSharp.Core/Internals/CefPostDataElementWrapper.h rename to CefSharp.Core.Runtime/PostDataElement.h index 12a97e8bb8..3daea5673b 100644 --- a/CefSharp.Core/Internals/CefPostDataElementWrapper.h +++ b/CefSharp.Core.Runtime/PostDataElement.h @@ -8,37 +8,52 @@ #include "include\cef_request.h" #include "Internals\TypeConversion.h" -#include "CefWrapper.h" +#include "Internals\CefWrapper.h" using namespace System::Collections::Specialized; namespace CefSharp { - namespace Internals + namespace Core { - private ref class CefPostDataElementWrapper : public IPostDataElement, public CefWrapper + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class PostDataElement : public IPostDataElement, public CefWrapper { MCefRefPtr _postDataElement; internal: - CefPostDataElementWrapper(CefRefPtr postDataElement) : + PostDataElement(CefRefPtr postDataElement) : _postDataElement(postDataElement) { } - !CefPostDataElementWrapper() + !PostDataElement() { _postDataElement = nullptr; } - ~CefPostDataElementWrapper() + ~PostDataElement() { - this->!CefPostDataElementWrapper(); + this->!PostDataElement(); _disposed = true; } + operator CefRefPtr() + { + if (this == nullptr) + { + return nullptr; + } + return _postDataElement.get(); + } + public: + PostDataElement() + { + _postDataElement = CefPostDataElement::Create().get(); + } + virtual property bool IsReadOnly { bool get() @@ -110,13 +125,9 @@ namespace CefSharp } } - operator CefRefPtr() + virtual IPostDataElement^ UnWrap() { - if (this == nullptr) - { - return NULL; - } - return _postDataElement.get(); + return this; } }; } diff --git a/CefSharp.Core.Runtime/Request.cpp b/CefSharp.Core.Runtime/Request.cpp new file mode 100644 index 0000000000..96ed56fa0f --- /dev/null +++ b/CefSharp.Core.Runtime/Request.cpp @@ -0,0 +1,213 @@ +// Copyright © 2010 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#include "Stdafx.h" +#include "Request.h" +#include "PostData.h" + +using namespace System::Text; + +namespace CefSharp +{ + namespace Core + { + UrlRequestFlags Request::Flags::get() + { + ThrowIfDisposed(); + + return (UrlRequestFlags)_request->GetFlags(); + } + + void Request::Flags::set(UrlRequestFlags flags) + { + ThrowIfDisposed(); + ThrowIfReadOnly(); + + _request->SetFlags((int)flags); + } + + String^ Request::Url::get() + { + ThrowIfDisposed(); + + return StringUtils::ToClr(_request->GetURL()); + } + + void Request::Url::set(String^ url) + { + if (url == nullptr) + { + throw gcnew System::ArgumentException("cannot be null", "url"); + } + + ThrowIfDisposed(); + ThrowIfReadOnly(); + + CefString str = StringUtils::ToNative(url); + _request->SetURL(str); + } + + String^ Request::Method::get() + { + ThrowIfDisposed(); + + return StringUtils::ToClr(_request->GetMethod()); + } + + void Request::Method::set(String^ method) + { + if (method == nullptr) + { + throw gcnew System::ArgumentException("cannot be null", "method"); + } + + ThrowIfDisposed(); + ThrowIfReadOnly(); + + _request->SetMethod(StringUtils::ToNative(method)); + } + + UInt64 Request::Identifier::get() + { + ThrowIfDisposed(); + + return _request->GetIdentifier(); + } + + void Request::SetReferrer(String^ referrerUrl, CefSharp::ReferrerPolicy policy) + { + ThrowIfDisposed(); + ThrowIfReadOnly(); + + _request->SetReferrer(StringUtils::ToNative(referrerUrl), (cef_referrer_policy_t)policy); + } + + String^ Request::ReferrerUrl::get() + { + ThrowIfDisposed(); + + return StringUtils::ToClr(_request->GetReferrerURL()); + } + + CefSharp::ResourceType Request::ResourceType::get() + { + ThrowIfDisposed(); + + return (CefSharp::ResourceType)_request->GetResourceType(); + } + + CefSharp::ReferrerPolicy Request::ReferrerPolicy::get() + { + ThrowIfDisposed(); + + return (CefSharp::ReferrerPolicy)_request->GetReferrerPolicy(); + } + + NameValueCollection^ Request::Headers::get() + { + ThrowIfDisposed(); + + CefRequest::HeaderMap hm; + _request->GetHeaderMap(hm); + + auto headers = gcnew HeaderNameValueCollection(); + + for (CefRequest::HeaderMap::iterator it = hm.begin(); it != hm.end(); ++it) + { + String^ name = StringUtils::ToClr(it->first); + String^ value = StringUtils::ToClr(it->second); + headers->Add(name, value); + } + + if (_request->IsReadOnly()) + { + headers->SetReadOnly(); + } + + return headers; + } + + void Request::Headers::set(NameValueCollection^ headers) + { + ThrowIfDisposed(); + ThrowIfReadOnly(); + + CefRequest::HeaderMap hm; + + for each(String^ key in headers) + { + CefString name = StringUtils::ToNative(key); + for each(String^ element in headers->GetValues(key)) + { + CefString value = StringUtils::ToNative(element); + hm.insert(std::make_pair(name, value)); + } + } + + _request->SetHeaderMap(hm); + } + + TransitionType Request::TransitionType::get() + { + ThrowIfDisposed(); + + return (CefSharp::TransitionType) _request->GetTransitionType(); + } + + IPostData^ Request::PostData::get() + { + ThrowIfDisposed(); + + if (_postData == nullptr) + { + auto postData = _request->GetPostData(); + if (postData.get()) + { + _postData = gcnew CefSharp::Core::PostData(postData); + } + } + return _postData; + } + + void Request::PostData::set(IPostData^ postData) + { + ThrowIfDisposed(); + + ThrowIfReadOnly(); + + _request->SetPostData((CefSharp::Core::PostData^)postData->UnWrap()); + } + + bool Request::IsReadOnly::get() + { + ThrowIfDisposed(); + + return _request->IsReadOnly(); + } + + void Request::InitializePostData() + { + ThrowIfDisposed(); + + ThrowIfReadOnly(); + + _request->SetPostData(CefPostData::Create()); + } + + String^ Request::GetHeaderByName(String^ name) + { + ThrowIfDisposed(); + + return StringUtils::ToClr(_request->GetHeaderByName(StringUtils::ToNative(name))); + } + + void Request::SetHeaderByName(String^ name, String^ value, bool overwrite) + { + ThrowIfDisposed(); + ThrowIfReadOnly(); + + _request->SetHeaderByName(StringUtils::ToNative(name), StringUtils::ToNative(value), overwrite); + } + } +} diff --git a/CefSharp.Core/Internals/CefRequestWrapper.h b/CefSharp.Core.Runtime/Request.h similarity index 58% rename from CefSharp.Core/Internals/CefRequestWrapper.h rename to CefSharp.Core.Runtime/Request.h index 6045e95c20..e94976fff7 100644 --- a/CefSharp.Core/Internals/CefRequestWrapper.h +++ b/CefSharp.Core.Runtime/Request.h @@ -7,39 +7,62 @@ #include "Stdafx.h" #include "include\cef_request.h" -#include "CefWrapper.h" +#include "Internals\CefWrapper.h" using namespace System::Collections::Specialized; namespace CefSharp { - namespace Internals + namespace Core { - private ref class CefRequestWrapper : public IRequest, public CefWrapper + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class Request : public IRequest, public CefWrapper { - MCefRefPtr _wrappedRequest; + MCefRefPtr _request; IPostData^ _postData; internal: - CefRequestWrapper(CefRefPtr &cefRequest) : - _wrappedRequest(cefRequest), _postData(nullptr) + Request(CefRefPtr &cefRequest) : + _request(cefRequest), _postData(nullptr) { } - !CefRequestWrapper() + !Request() { - _wrappedRequest = nullptr; + _request = nullptr; } - ~CefRequestWrapper() + ~Request() { - this->!CefRequestWrapper(); + this->!Request(); delete _postData; _disposed = true; } + operator CefRefPtr() + { + if (this == nullptr) + { + return nullptr; + } + return _request.get(); + } + + void ThrowIfReadOnly() + { + if (_request->IsReadOnly()) + { + throw gcnew NotSupportedException("IRequest is read-only and cannot be modified. Check IRequest.IsReadOnly to guard against this exception."); + } + } + public: + Request() + { + _request = CefRequest::Create().get(); + } + virtual property UrlRequestFlags Flags { UrlRequestFlags get(); void set(UrlRequestFlags flags); } virtual property String^ Url { String^ get(); void set(String^ url); } virtual property String^ Method { String^ get(); void set(String^ method); } @@ -50,17 +73,16 @@ namespace CefSharp virtual property ReferrerPolicy ReferrerPolicy { CefSharp::ReferrerPolicy get(); } virtual property NameValueCollection^ Headers { NameValueCollection^ get(); void set(NameValueCollection^ url); } virtual property TransitionType TransitionType { CefSharp::TransitionType get(); } - virtual property IPostData^ PostData { IPostData^ get(); } + virtual property IPostData^ PostData { IPostData^ get(); void set(IPostData^ postData); } virtual property bool IsReadOnly { bool get(); } virtual void InitializePostData(); - operator CefRefPtr() + virtual String^ GetHeaderByName(String^ name); + virtual void SetHeaderByName(String^ name, String^ value, bool overwrite); + + virtual IRequest^ UnWrap() { - if (this == nullptr) - { - return NULL; - } - return _wrappedRequest.get(); + return this; } }; } diff --git a/CefSharp.Core.Runtime/RequestContext.cpp b/CefSharp.Core.Runtime/RequestContext.cpp new file mode 100644 index 0000000000..3e20bc3eb4 --- /dev/null +++ b/CefSharp.Core.Runtime/RequestContext.cpp @@ -0,0 +1,206 @@ +// Copyright © 2015 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#include "Stdafx.h" +#include "RequestContext.h" + +#include "include\cef_parser.h" + +#include "CookieManager.h" +#include "Internals\CefSchemeHandlerFactoryAdapter.h" +#include "Internals\CefCompletionCallbackAdapter.h" +#include "Internals\CefResolveCallbackAdapter.h" +#include "Internals\TypeConversion.h" + +using namespace System::Runtime::InteropServices; + +namespace CefSharp +{ + namespace Core + { + bool RequestContext::IsSame(IRequestContext^ context) + { + ThrowIfDisposed(); + + auto requestContext = (RequestContext^)context->UnWrap(); + + return _requestContext->IsSame(requestContext); + } + + bool RequestContext::IsSharingWith(IRequestContext^ context) + { + ThrowIfDisposed(); + + auto requestContext = (RequestContext^)context->UnWrap(); + + return _requestContext->IsSharingWith(requestContext); + } + + ICookieManager^ RequestContext::GetCookieManager(ICompletionCallback^ callback) + { + ThrowIfDisposed(); + + CefRefPtr wrapper = callback == nullptr ? nullptr : new CefCompletionCallbackAdapter(callback); + + auto cookieManager = _requestContext->GetCookieManager(wrapper); + if (cookieManager.get()) + { + return gcnew CookieManager(cookieManager); + } + return nullptr; + } + + bool RequestContext::RegisterSchemeHandlerFactory(String^ schemeName, String^ domainName, ISchemeHandlerFactory^ factory) + { + ThrowIfDisposed(); + + auto wrapper = new CefSchemeHandlerFactoryAdapter(factory); + return _requestContext->RegisterSchemeHandlerFactory(StringUtils::ToNative(schemeName), StringUtils::ToNative(domainName), wrapper); + } + + bool RequestContext::ClearSchemeHandlerFactories() + { + ThrowIfDisposed(); + + return _requestContext->ClearSchemeHandlerFactories(); + } + + bool RequestContext::HasPreference(String^ name) + { + ThrowIfDisposed(); + + ThrowIfExecutedOnNonCefUiThread(); + + return _requestContext->HasPreference(StringUtils::ToNative(name)); + } + + Object^ RequestContext::GetPreference(String^ name) + { + ThrowIfDisposed(); + + ThrowIfExecutedOnNonCefUiThread(); + + return TypeConversion::FromNative(_requestContext->GetPreference(StringUtils::ToNative(name))); + } + + IDictionary^ RequestContext::GetAllPreferences(bool includeDefaults) + { + ThrowIfDisposed(); + + auto preferences = _requestContext->GetAllPreferences(includeDefaults); + + return TypeConversion::FromNative(preferences); + } + + bool RequestContext::CanSetPreference(String^ name) + { + ThrowIfDisposed(); + + ThrowIfExecutedOnNonCefUiThread(); + + return _requestContext->CanSetPreference(StringUtils::ToNative(name)); + } + + bool RequestContext::SetPreference(String^ name, Object^ value, [Out] String^ %error) + { + ThrowIfDisposed(); + + ThrowIfExecutedOnNonCefUiThread(); + + CefString cefError; + + auto success = _requestContext->SetPreference(StringUtils::ToNative(name), TypeConversion::ToNative(value), cefError); + + error = StringUtils::ToClr(cefError); + + return success; + } + + void RequestContext::ClearCertificateExceptions(ICompletionCallback^ callback) + { + ThrowIfDisposed(); + + CefRefPtr wrapper = callback == nullptr ? nullptr : new CefCompletionCallbackAdapter(callback); + + _requestContext->ClearCertificateExceptions(wrapper); + } + + void RequestContext::ClearHttpAuthCredentials(ICompletionCallback^ callback) + { + ThrowIfDisposed(); + + //TODO: Remove this once CEF Issue has been resolved + //ClearHttpAuthCredentials crashes when no callback specified + if (callback == nullptr) + { + callback = gcnew CefSharp::Callback::NoOpCompletionCallback(); + } + + CefRefPtr wrapper = callback == nullptr ? nullptr : new CefCompletionCallbackAdapter(callback); + + _requestContext->ClearHttpAuthCredentials(wrapper); + } + + void RequestContext::CloseAllConnections(ICompletionCallback^ callback) + { + ThrowIfDisposed(); + + CefRefPtr wrapper = callback == nullptr ? nullptr : new CefCompletionCallbackAdapter(callback); + + _requestContext->CloseAllConnections(wrapper); + } + + Task^ RequestContext::ResolveHostAsync(Uri^ origin) + { + ThrowIfDisposed(); + + auto callback = gcnew TaskResolveCallback(); + + CefRefPtr callbackWrapper = new CefResolveCallbackAdapter(callback); + + _requestContext->ResolveHost(StringUtils::ToNative(origin->AbsoluteUri), callbackWrapper); + + return callback->Task; + } + + Object^ RequestContext::GetWebsiteSetting(String^ requestingUrl, String^ topLevelUrl, Enums::ContentSettingTypes contentType) + { + ThrowIfDisposed(); + + auto result = _requestContext->GetWebsiteSetting(StringUtils::ToNative(requestingUrl), StringUtils::ToNative(topLevelUrl), (cef_content_setting_types_t)contentType); + + return TypeConversion::FromNative(result); + } + + void RequestContext::SetWebsiteSetting(String^ requestingUrl, String^ topLevelUrl, Enums::ContentSettingTypes contentType, Object^ value) + { + ThrowIfDisposed(); + + auto nativeValue = TypeConversion::ToNative(value); + + _requestContext->SetWebsiteSetting(StringUtils::ToNative(requestingUrl), StringUtils::ToNative(topLevelUrl), (cef_content_setting_types_t)contentType, nativeValue); + } + + Enums::ContentSettingValues RequestContext::GetContentSetting(String^ requestingUrl, String^ topLevelUrl, Enums::ContentSettingTypes contentType) + { + ThrowIfDisposed(); + + auto result = _requestContext->GetContentSetting(StringUtils::ToNative(requestingUrl), StringUtils::ToNative(topLevelUrl), (cef_content_setting_types_t)contentType); + + return (Enums::ContentSettingValues)result; + } + + void RequestContext::SetContentSetting(String^ requestingUrl, String^ topLevelUrl, Enums::ContentSettingTypes contentType, Enums::ContentSettingValues value) + { + ThrowIfDisposed(); + + _requestContext->SetContentSetting(StringUtils::ToNative(requestingUrl), StringUtils::ToNative(topLevelUrl), (cef_content_setting_types_t)contentType, (cef_content_setting_values_t)value); + } + + IRequestContext^ RequestContext::UnWrap() + { + return this; + } + } +} diff --git a/CefSharp.Core.Runtime/RequestContext.h b/CefSharp.Core.Runtime/RequestContext.h new file mode 100644 index 0000000000..a46ca63a4a --- /dev/null +++ b/CefSharp.Core.Runtime/RequestContext.h @@ -0,0 +1,384 @@ +// Copyright © 2015 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#ifndef CEFSHARP_CORE_REQUESTCONTEXT_H_ +#define CEFSHARP_CORE_REQUESTCONTEXT_H_ + +#pragma once + +#include "Stdafx.h" +#include "include\cef_request_context.h" + +#include "RequestContextSettings.h" +#include "Internals\CefRequestContextHandlerAdapter.h" +#include "Internals\CefWrapper.h" + +using namespace System::Runtime::InteropServices; +using namespace System::Threading::Tasks; + +namespace CefSharp +{ + namespace Core + { + /// + /// A request context provides request handling for a set of related browser objects. + /// A request context is specified when creating a new browser object via the CefBrowserHost + /// static factory methods. Browser objects with different request contexts will never be + /// hosted in the same render process. Browser objects with the same request context may or + /// may not be hosted in the same render process depending on the process model. + /// Browser objects created indirectly via the JavaScript window.open function or targeted + /// links will share the same render process and the same request context as the source browser. + /// When running in single-process mode there is only a single render process (the main process) + /// and so all browsers created in single-process mode will share the same request context. + /// This will be the first request context passed into a CefBrowserHost static factory method + /// and all other request context objects will be ignored. + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class RequestContext : public IRequestContext, public CefWrapper + { + private: + MCefRefPtr _requestContext; + RequestContextSettings^ _settings; + + internal: + RequestContext(const CefRefPtr& context) + { + _requestContext = context.get(); + _settings = nullptr; + } + + operator CefRefPtr() + { + if (this == nullptr) + { + return nullptr; + } + return _requestContext.get(); + } + + public: + RequestContext() + { + CefRequestContextSettings settings; + _requestContext = CefRequestContext::CreateContext(settings, nullptr).get(); + } + + RequestContext(RequestContextSettings^ settings) : _settings(settings) + { + PathCheck::AssertAbsolute(settings->CachePath, "RequestContextSettings.CachePath"); + + _requestContext = CefRequestContext::CreateContext(settings, nullptr).get(); + } + + RequestContext(IRequestContextHandler^ requestContextHandler) + { + CefRequestContextSettings settings; + _requestContext = CefRequestContext::CreateContext(settings, new CefRequestContextHandlerAdapter(requestContextHandler)).get(); + } + + RequestContext(RequestContextSettings^ settings, IRequestContextHandler^ requestContextHandler) : _settings(settings) + { + PathCheck::AssertAbsolute(settings->CachePath, "RequestContextSettings.CachePath"); + + _requestContext = CefRequestContext::CreateContext(settings, new CefRequestContextHandlerAdapter(requestContextHandler)).get(); + } + + ///Creates a new context object that shares storage with | other | and uses an optional | handler | . + RequestContext(IRequestContext^ otherRequestContext) + { + _requestContext = CefRequestContext::CreateContext((RequestContext^)otherRequestContext->UnWrap(), nullptr).get(); + } + + RequestContext(IRequestContext^ otherRequestContext, IRequestContextHandler^ requestContextHandler) + { + _requestContext = CefRequestContext::CreateContext((RequestContext^)otherRequestContext->UnWrap(), new CefRequestContextHandlerAdapter(requestContextHandler)).get(); + } + + !RequestContext() + { + _requestContext = nullptr; + } + + ~RequestContext() + { + this->!RequestContext(); + + delete _settings; + + _disposed = true; + } + + /// + /// Creates a new context object that shares storage with other and uses an + /// optional handler. + /// + /// shares storage with this RequestContext + /// optional requestContext handler + /// Returns a new RequestContext + static IRequestContext^ CreateContext(IRequestContext^ other, IRequestContextHandler^ requestContextHandler) + { + auto otherRequestContext = static_cast(other->UnWrap()); + CefRefPtr handler = requestContextHandler == nullptr ? nullptr : new CefRequestContextHandlerAdapter(requestContextHandler); + + auto newContext = CefRequestContext::CreateContext(otherRequestContext, handler); + return gcnew RequestContext(newContext); + } + + /// + /// Returns true if this object is pointing to the same context object. + /// + /// context to compare + /// Returns true if the same + virtual bool IsSame(IRequestContext^ context); + + /// + /// Returns true if this object is sharing the same storage as the specified context. + /// + /// context to compare + /// Returns true if same storage + virtual bool IsSharingWith(IRequestContext^ context); + + /// + /// Returns the default cookie manager for this object. This will be the global + /// cookie manager if this object is the global request context. + /// + /// If callback is non-NULL it will be executed asnychronously on the CEF IO thread + /// after the manager's storage has been initialized. + /// Returns the default cookie manager for this object + virtual ICookieManager^ GetCookieManager(ICompletionCallback^ callback); + + /// + /// Returns true if this object is the global context. The global context is + /// used by default when creating a browser or URL request with a NULL context + /// argument. + /// + virtual property bool IsGlobal + { + bool get() + { + ThrowIfDisposed(); + return _requestContext->IsGlobal(); + } + } + + /// + /// Register a scheme handler factory for the specified schemeName and optional domainName. + /// An empty domainName value for a standard scheme will cause the factory to match all domain + /// names. The domainName value will be ignored for non-standard schemes. If schemeName is + /// a built-in scheme and no handler is returned by factory then the built-in scheme handler + /// factory will be called. If schemeName is a custom scheme then you must also implement the + /// IApp.OnRegisterCustomSchemes() method in all processes. This function may be called multiple + /// times to change or remove the factory that matches the specified schemeName and optional + /// domainName. + /// + /// Scheme Name + /// Optional domain name + /// Scheme handler factory + /// Returns false if an error occurs. + virtual bool RegisterSchemeHandlerFactory(String^ schemeName, String^ domainName, ISchemeHandlerFactory^ factory); + + /// + /// Clear all registered scheme handler factories. + /// + /// Returns false on error. + virtual bool ClearSchemeHandlerFactories(); + + /// + /// Returns the cache path for this object. If empty an "incognito mode" + /// in-memory cache is being used. + /// + virtual property String^ CachePath + { + String^ get() + { + ThrowIfDisposed(); + + return StringUtils::ToClr(_requestContext->GetCachePath()); + } + } + + /// + /// Returns true if a preference with the specified name exists. This method + /// must be called on the CEF UI thread. + /// + /// name of preference + /// bool if the preference exists + /// Use Cef.UIThreadTaskFactory to execute this method if required, + /// and ChromiumWebBrowser.IsBrowserInitializedChanged are both + /// executed on the CEF UI thread, so can be called directly. + /// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main + /// application thread will be the CEF UI thread. + virtual bool HasPreference(String^ name); + + /// + /// Returns the value for the preference with the specified name. Returns + /// NULL if the preference does not exist. The returned object contains a copy + /// of the underlying preference value and modifications to the returned object + /// will not modify the underlying preference value. This method must be called + /// on the CEF UI thread. + /// + /// preference name + /// Returns the value for the preference with the specified name + /// Use Cef.UIThreadTaskFactory to execute this method if required, + /// and ChromiumWebBrowser.IsBrowserInitializedChanged are both + /// executed on the CEF UI thread, so can be called directly. + /// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main + /// application thread will be the CEF UI thread. + virtual Object^ GetPreference(String^ name); + + /// + /// Returns all preferences as a dictionary. The returned + /// object contains a copy of the underlying preference values and + /// modifications to the returned object will not modify the underlying + /// preference values. This method must be called on the browser process UI + /// thread. + /// + /// If true then + /// preferences currently at their default value will be included. + /// Preferences (dictionary can have sub dictionaries) + virtual IDictionary^ GetAllPreferences(bool includeDefaults); + + /// + /// Returns true if the preference with the specified name can be modified + /// using SetPreference. As one example preferences set via the command-line + /// usually cannot be modified. This method must be called on the CEF UI thread. + /// + /// preference key + /// Returns true if the preference with the specified name can be modified + /// using SetPreference + /// Use Cef.UIThreadTaskFactory to execute this method if required, + /// and ChromiumWebBrowser.IsBrowserInitializedChanged are both + /// executed on the CEF UI thread, so can be called directly. + /// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main + /// application thread will be the CEF UI thread. + virtual bool CanSetPreference(String^ name); + + /// + /// Set the value associated with preference name. If value is null the + /// preference will be restored to its default value. If setting the preference + /// fails then error will be populated with a detailed description of the + /// problem. This method must be called on the CEF UI thread. + /// Preferences set via the command-line usually cannot be modified. + /// + /// preference key + /// preference value + /// out error + /// Returns true if the value is set successfully and false otherwise. + /// Use Cef.UIThreadTaskFactory to execute this method if required, + /// and ChromiumWebBrowser.IsBrowserInitializedChanged are both + /// executed on the CEF UI thread, so can be called directly. + /// When CefSettings.MultiThreadedMessageLoop == false (the default is true) then the main + /// application thread will be the CEF UI thread. + virtual bool SetPreference(String^ name, Object^ value, [Out] String^ %error); + + /// + /// Clears all certificate exceptions that were added as part of handling + /// . If you call this it is + /// recommended that you also call or you risk not + /// being prompted again for server certificates if you reconnect quickly. + /// + /// If is non-NULL it will be executed on the CEF UI thread after + /// completion. This param is optional + virtual void ClearCertificateExceptions(ICompletionCallback^ callback); + + /// + /// Clears all HTTP authentication credentials that were added as part of handling + /// . + /// + /// If is non-NULL it will be executed on the CEF UI thread after + /// completion. This param is optional + virtual void ClearHttpAuthCredentials(ICompletionCallback^ callback); + + /// + /// Clears all active and idle connections that Chromium currently has. + /// This is only recommended if you have released all other CEF objects but + /// don't yet want to call Cef.Shutdown(). + /// + /// If is non-NULL it will be executed on the CEF UI thread after + /// completion. This param is optional + virtual void CloseAllConnections(ICompletionCallback^ callback); + + /// + /// Attempts to resolve origin to a list of associated IP addresses. + /// + /// host name to resolve + /// A task that represents the Resoolve Host operation. The value of the TResult parameter contains ResolveCallbackResult. + virtual Task^ ResolveHostAsync(Uri^ origin); + + /// + /// Returns the current value for that applies for the + /// specified URLs. If both URLs are empty the default value will be returned. + /// Returns null if no value is configured. + /// Must be called on the browser + /// process UI thread. + /// + /// Requesting url + /// Top level url + /// Content type + /// Returns the current value for that applies for the + /// specified URLs. + virtual Object^ GetWebsiteSetting(String^ requestingUrl, String^ topLevelUrl, Enums::ContentSettingTypes contentType); + + /// + /// Sets the current value for for the specified URLs in the + /// default scope. If both URLs are empty, and the context is not incognito, + /// the default value will be set. Pass null for to remove the + /// default value for this content type. + /// + /// WARNING: Incorrect usage of this method may cause instability or security + /// issues in Chromium. Make sure that you first understand the potential + /// impact of any changes to by reviewing the related source + /// code in Chromium. For example, if you plan to modify + /// , first review and understand the usage of + /// ContentSettingsType::POPUPS in Chromium: + /// https://source.chromium.org/search?q=ContentSettingsType::POPUPS + /// + /// Requesting url + /// Top level url + /// Content type + /// value + virtual void SetWebsiteSetting(String^ requestingUrl, String^ topLevelUrl, Enums::ContentSettingTypes contentType, Object^ value); + + /// + /// Returns the current value for that applies for the + /// specified URLs. If both URLs are empty the default value will be returned. + /// Returns if no value is configured. Must + /// be called on the browser process UI thread. + /// + /// Requesting url + /// Top level url + /// Content type + /// Returns the current value for that applies for the + /// specified URLs. + virtual Enums::ContentSettingValues GetContentSetting(String^ requestingUrl, String^ topLevelUrl, Enums::ContentSettingTypes contentType); + + /// + /// Sets the current value for for the specified URLs in the + /// default scope. If both URLs are empty, and the context is not incognito, + /// the default value will be set. Pass for + /// to use the default value for this content type. + /// + /// WARNING: Incorrect usage of this method may cause instability or security + /// issues in Chromium. Make sure that you first understand the potential + /// impact of any changes to |content_type| by reviewing the related source + /// code in Chromium. For example, if you plan to modify + /// , first review and understand the usage of + /// ContentSettingsType::POPUPS in Chromium: + /// https://source.chromium.org/search?q=ContentSettingsType::POPUPS + /// + /// Requesting url + /// Top level url + /// Content type + /// value + virtual void SetContentSetting(String^ requestingUrl, String^ topLevelUrl, Enums::ContentSettingTypes contentType, Enums::ContentSettingValues value); + + /// + /// Gets the inner most instance + /// + /// current instance + virtual IRequestContext^ UnWrap(); + }; + } +} +#endif // CEFSHARP_CORE_REQUESTCONTEXT_H_ diff --git a/CefSharp.Core.Runtime/RequestContextSettings.h b/CefSharp.Core.Runtime/RequestContextSettings.h new file mode 100644 index 0000000000..0a26b32f81 --- /dev/null +++ b/CefSharp.Core.Runtime/RequestContextSettings.h @@ -0,0 +1,120 @@ +// Copyright © 2015 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" +#include "include\cef_request_context.h" + +namespace CefSharp +{ + namespace Core + { + /// + /// RequestContextSettings + /// + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class RequestContextSettings + { + private: + CefRequestContextSettings* _settings; + + internal: + operator CefRequestContextSettings() + { + return *_settings; + } + + public: + /// + /// Initializes a new instance of the RequestContextSettings class. + /// + RequestContextSettings() : _settings(new CefRequestContextSettings()) + { + } + + !RequestContextSettings() + { + delete _settings; + } + + ~RequestContextSettings() + { + this->!RequestContextSettings(); + } + + /// + /// To persist session cookies (cookies without an expiry date or validity + /// interval) by default when using the global cookie manager set this value to + /// true. Session cookies are generally intended to be transient and most + /// Web browsers do not persist them. Can be set globally using the + /// CefSettings.PersistSessionCookies value. This value will be ignored if + /// CachePath is empty or if it matches the CefSettings.CachePath value. + /// + property bool PersistSessionCookies + { + bool get() { return _settings->persist_session_cookies == 1; } + void set(bool value) { _settings->persist_session_cookies = value; } + } + + /// + /// The directory where cache data for this request context will be stored on disk. + /// If this value is non - empty then it must be an absolute path that is either equal to or a + /// child directory of CefSettings.RootCachePath.If this value is empty then browsers will be + /// created in "incognito mode" where in - memory caches are used for storage and no profile - + /// specific data is persisted to disk(installation - specific data will still be persisted in RootCachePath). + /// HTML5 databases such as localStorage will only persist across sessions if a cache path is specified. + /// To share the global browser cache and related configuration set this value to match the CefSettings.CachePath value. + /// + property String^ CachePath + { + String^ get() { return StringUtils::ToClr(_settings->cache_path); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_settings->cache_path, value); } + } + + /// + /// Comma delimited ordered list of language codes without any whitespace that + /// will be used in the "Accept-Language" HTTP header. Can be set globally + /// using the CefSettings.accept_language_list value or overridden on a per- + /// browser basis using the BrowserSettings.AcceptLanguageList value. If + /// all values are empty then "en-US,en" will be used. This value will be + /// ignored if CachePath matches the CefSettings.CachePath value. + /// + property String^ AcceptLanguageList + { + String^ get() { return StringUtils::ToClr(_settings->accept_language_list); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_settings->accept_language_list, value); } + } + + /// + /// Comma delimited list of schemes supported by the associated + /// ICookieManager. If CookieableSchemesExcludeDefaults is false the + /// default schemes ("http", "https", "ws" and "wss") will also be supported. + /// Specifying a CookieableSchemesList value and setting + /// CookieableSchemesExcludeDefaults to true will disable all loading + /// and saving of cookies for this manager. This value will be ignored if + /// matches the value. + /// + property String^ CookieableSchemesList + { + String^ get() { return StringUtils::ToClr(_settings->cookieable_schemes_list); } + void set(String^ value) { StringUtils::AssignNativeFromClr(_settings->cookieable_schemes_list, value); } + } + + /// + /// If CookieableSchemesExcludeDefaults is false the + /// default schemes ("http", "https", "ws" and "wss") will also be supported. + /// Specifying a CookieableSchemesList value and setting + /// CookieableSchemesExcludeDefaults to true will disable all loading + /// and saving of cookies for this manager. This value will be ignored if + /// matches the value. + /// + property bool CookieableSchemesExcludeDefaults + { + bool get() { return _settings->cookieable_schemes_exclude_defaults == 1; } + void set(bool value) { _settings->cookieable_schemes_exclude_defaults = value; } + } + }; + } +} diff --git a/CefSharp.Core/Resource.aps b/CefSharp.Core.Runtime/Resource.aps similarity index 100% rename from CefSharp.Core/Resource.aps rename to CefSharp.Core.Runtime/Resource.aps diff --git a/CefSharp.Core/Resource.rc b/CefSharp.Core.Runtime/Resource.rc similarity index 65% rename from CefSharp.Core/Resource.rc rename to CefSharp.Core.Runtime/Resource.rc index 5a22c831e8..0340426f4f 100644 --- a/CefSharp.Core/Resource.rc +++ b/CefSharp.Core.Runtime/Resource.rc @@ -1,6 +1,8 @@ +#pragma code_page(65001) + 1 VERSIONINFO - FILEVERSION 74.1.130 - PRODUCTVERSION 74.1.130 + FILEVERSION 146,0,100 + PRODUCTVERSION 146,0,100 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -16,10 +18,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "CefSharp.Core" - VALUE "FileVersion", "74.1.130" - VALUE "LegalCopyright", "Copyright © 2019 The CefSharp Authors" + VALUE "FileVersion", "146.0.100" + VALUE "LegalCopyright", "Copyright © 2023 The CefSharp Authors" VALUE "ProductName", "CefSharp" - VALUE "ProductVersion", "74.1.130" + VALUE "ProductVersion", "146.0.100" END END BLOCK "VarFileInfo" diff --git a/CefSharp.Core/Stdafx.cpp b/CefSharp.Core.Runtime/Stdafx.cpp similarity index 100% rename from CefSharp.Core/Stdafx.cpp rename to CefSharp.Core.Runtime/Stdafx.cpp diff --git a/CefSharp.Core/Stdafx.h b/CefSharp.Core.Runtime/Stdafx.h similarity index 85% rename from CefSharp.Core/Stdafx.h rename to CefSharp.Core.Runtime/Stdafx.h index b08bc4b554..c234e6e0ef 100644 --- a/CefSharp.Core/Stdafx.h +++ b/CefSharp.Core.Runtime/Stdafx.h @@ -10,15 +10,18 @@ #define DECL __declspec(dllimport) #endif +#define NOMINMAX + #include #include #include +#include "Internals\CefRefCountManaged.h" #include "Internals\MCefRefPtr.h" #include "Internals\StringUtils.h" #include "vcclr_local.h" using namespace CefSharp; using namespace CefSharp::Internals; -using namespace System; \ No newline at end of file +using namespace System; diff --git a/CefSharp.Core.Runtime/UrlRequest.cpp b/CefSharp.Core.Runtime/UrlRequest.cpp new file mode 100644 index 0000000000..f3b8c9dc54 --- /dev/null +++ b/CefSharp.Core.Runtime/UrlRequest.cpp @@ -0,0 +1,35 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#include "Stdafx.h" +#include "UrlRequest.h" +#include "Internals\CefResponseWrapper.h" + +namespace CefSharp +{ + namespace Core + { + + bool UrlRequest::ResponseWasCached::get() + { + ThrowIfDisposed(); + + return _urlRequest->ResponseWasCached(); + } + + IResponse^ UrlRequest::Response::get() + { + ThrowIfDisposed(); + + return gcnew CefResponseWrapper(_urlRequest->GetResponse()); + } + + UrlRequestStatus UrlRequest::RequestStatus::get() + { + ThrowIfDisposed(); + + return (UrlRequestStatus)_urlRequest->GetRequestStatus(); + } + } +} diff --git a/CefSharp.Core.Runtime/UrlRequest.h b/CefSharp.Core.Runtime/UrlRequest.h new file mode 100644 index 0000000000..02ab9f758e --- /dev/null +++ b/CefSharp.Core.Runtime/UrlRequest.h @@ -0,0 +1,97 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\cef_urlrequest.h" + +#include "Request.h" +#include "RequestContext.h" +#include "Internals\CefUrlRequestClientAdapter.h" +#include "Internals\CefWrapper.h" + +namespace CefSharp +{ + namespace Core + { + // Class used to make a URL request. URL requests are not associated with + // a browser instance so no CefClient callbacks will be executed. + // URL requests can be created on any valid CEF thread in either the browser + // or render process. Once created the methods of the URL request object must + // be accessed on the same thread that created it. + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class UrlRequest : public IUrlRequest, public CefWrapper + { + private: + MCefRefPtr _urlRequest; + internal: + UrlRequest(CefRefPtr &urlRequest) + : _urlRequest(urlRequest) + { + } + + !UrlRequest() + { + _urlRequest = nullptr; + } + + ~UrlRequest() + { + this->!UrlRequest(); + } + + public: + UrlRequest(IRequest^ request, IUrlRequestClient^ urlRequestClient) + : UrlRequest(request, urlRequestClient, nullptr) + { + } + + UrlRequest(IRequest^ request, IUrlRequestClient^ urlRequestClient, IRequestContext^ requestContext) + { + if (request == nullptr) + { + throw gcnew ArgumentNullException("request"); + } + if (urlRequestClient == nullptr) + { + throw gcnew ArgumentNullException("urlRequestClient"); + } + + _urlRequest = CefURLRequest::Create((Request^)request, new CefUrlRequestClientAdapter(urlRequestClient), (RequestContext^)requestContext).get(); + } + + /// + // Returns true if the response body was served from the cache. This includes + // responses for which revalidation was required. + /// + /*--cef()--*/ + virtual property bool ResponseWasCached + { + bool get(); + } + + /// + // Returns the response, or NULL if no response information is available. + // Response information will only be available after the upload has completed. + // The returned object is read-only and should not be modified. + /// + /*--cef()--*/ + virtual property IResponse^ Response + { + IResponse^ get(); + } + + /// + // Returns the request status. + /// + /*--cef(default_retval=UR_UNKNOWN)--*/ + virtual property UrlRequestStatus RequestStatus + { + UrlRequestStatus get(); + } + }; + } +} diff --git a/CefSharp.Core.Runtime/WindowInfo.h b/CefSharp.Core.Runtime/WindowInfo.h new file mode 100644 index 0000000000..bb00382015 --- /dev/null +++ b/CefSharp.Core.Runtime/WindowInfo.h @@ -0,0 +1,262 @@ +// Copyright © 2015 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +#pragma once + +#include "Stdafx.h" + +#include "include\internal\cef_win.h" + +namespace CefSharp +{ + namespace Core + { + [System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)] + public ref class WindowInfo : public IWindowInfo + { + private: + CefWindowInfo* _windowInfo; + bool _ownsPointer = false; + + internal: + WindowInfo(CefWindowInfo* windowInfo) : _windowInfo(windowInfo) + { + + } + + CefWindowInfo* GetWindowInfo() + { + return _windowInfo; + } + + public: + WindowInfo() : _windowInfo(new CefWindowInfo()) + { + _ownsPointer = true; + } + + !WindowInfo() + { + if (_ownsPointer) + { + delete _windowInfo; + } + + _windowInfo = nullptr; + } + + ~WindowInfo() + { + this->!WindowInfo(); + } + + virtual property int X + { + int get() + { + return _windowInfo->bounds.x; + } + void set(int x) + { + _windowInfo->bounds.x = x; + } + } + + virtual property int Y + { + int get() + { + return _windowInfo->bounds.y; + } + void set(int y) + { + _windowInfo->bounds.y = y; + } + } + + virtual property int Width + { + int get() + { + return _windowInfo->bounds.width; + } + void set(int width) + { + _windowInfo->bounds.width = width; + } + } + + virtual property int Height + { + int get() + { + return _windowInfo->bounds.height; + } + void set(int height) + { + _windowInfo->bounds.height = height; + } + } + + virtual property UINT32 Style + { + UINT32 get() + { + return _windowInfo->style; + } + void set(UINT32 style) + { + _windowInfo->style = style; + } + } + + virtual property UINT32 ExStyle + { + UINT32 get() + { + return _windowInfo->ex_style; + } + void set(UINT32 ex_style) + { + _windowInfo->ex_style = ex_style; + } + } + + virtual property IntPtr ParentWindowHandle + { + IntPtr get() + { + return IntPtr(_windowInfo->parent_window); + } + void set(IntPtr parentWindowHandle) + { + _windowInfo->parent_window = (HWND)parentWindowHandle.ToPointer(); + } + } + + virtual property IntPtr WindowHandle + { + IntPtr get() + { + return IntPtr(_windowInfo->window); + } + void set(IntPtr windowHandle) + { + _windowInfo->window = (HWND)windowHandle.ToPointer(); + } + } + + virtual property String^ WindowName + { + String^ get() + { + return StringUtils::ToClr(_windowInfo->window_name); + } + void set(String^ value) + { + StringUtils::AssignNativeFromClr(_windowInfo->window_name, value); + } + } + + virtual property bool WindowlessRenderingEnabled + { + bool get() + { + return _windowInfo->windowless_rendering_enabled == 1; + } + void set(bool windowlessRenderingEnabled) + { + _windowInfo->windowless_rendering_enabled = windowlessRenderingEnabled; + } + } + + virtual property bool SharedTextureEnabled + { + bool get() + { + return _windowInfo->shared_texture_enabled == 1; + } + void set(bool sharedTextureEnabled) + { + _windowInfo->shared_texture_enabled = sharedTextureEnabled; + } + } + + virtual property bool ExternalBeginFrameEnabled + { + bool get() + { + return _windowInfo->external_begin_frame_enabled == 1; + } + void set(bool externalBeginFrameEnabled) + { + _windowInfo->external_begin_frame_enabled = externalBeginFrameEnabled; + } + } + + virtual property CefRuntimeStyle RuntimeStyle + { + CefRuntimeStyle get() + { + return (CefRuntimeStyle)_windowInfo->runtime_style; + } + void set(CefRuntimeStyle style) + { + _windowInfo->runtime_style = (cef_runtime_style_t)style; + } + } + + virtual void SetAsChild(IntPtr parentHandle) + { + CefWindowInfo window; + CefRect windowBounds; + + HWND hwnd = static_cast(parentHandle.ToPointer()); + + RECT rect; + GetClientRect(hwnd, &rect); + + windowBounds.x = rect.left; + windowBounds.y = rect.top; + windowBounds.width = rect.right - rect.left; + windowBounds.height = rect.bottom - rect.top; + + _windowInfo->SetAsChild(hwnd, windowBounds); + } + + virtual void SetAsChild(IntPtr parentHandle, CefSharp::Structs::Rect windowBounds) + { + auto rect = CefRect(windowBounds.X, windowBounds.Y, windowBounds.Width, windowBounds.Height); + + _windowInfo->SetAsChild((HWND)parentHandle.ToPointer(), rect); + } + + virtual void SetAsChild(IntPtr parentHandle, int left, int top, int right, int bottom) + { + CefRect windowBounds; + windowBounds.x = left; + windowBounds.y = top; + windowBounds.width = right - left; + windowBounds.height = bottom - top; + + _windowInfo->SetAsChild((HWND)parentHandle.ToPointer(), windowBounds); + } + + virtual void SetAsPopup(IntPtr parentHandle, String^ windowName) + { + _windowInfo->SetAsPopup((HWND)parentHandle.ToPointer(), StringUtils::ToNative(windowName)); + } + + virtual void SetAsWindowless(IntPtr parentHandle) + { + _windowInfo->SetAsWindowless((HWND)parentHandle.ToPointer()); + } + + virtual IWindowInfo^ UnWrap() + { + return this; + } + }; + } +} diff --git a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config new file mode 100644 index 0000000000..3146a76ea4 --- /dev/null +++ b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config new file mode 100644 index 0000000000..d349c54ea4 --- /dev/null +++ b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CefSharp.Core/resource.h b/CefSharp.Core.Runtime/resource.h similarity index 100% rename from CefSharp.Core/resource.h rename to CefSharp.Core.Runtime/resource.h diff --git a/CefSharp.Core/vcclr_local.h b/CefSharp.Core.Runtime/vcclr_local.h similarity index 100% rename from CefSharp.Core/vcclr_local.h rename to CefSharp.Core.Runtime/vcclr_local.h diff --git a/CefSharp.Core/AbstractCefSettings.h b/CefSharp.Core/AbstractCefSettings.h deleted file mode 100644 index 73f11422ec..0000000000 --- a/CefSharp.Core/AbstractCefSettings.h +++ /dev/null @@ -1,457 +0,0 @@ -// Copyright © 2010 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -#pragma once - -#include "Stdafx.h" - -using namespace System::Collections::Generic; -using namespace System::IO; - -namespace CefSharp -{ - /// - /// Initialization settings. Many of these and other settings can also configured - /// using command-line switches. - /// - public ref class AbstractCefSettings abstract - { - private: - List^ _cefExtensions; - IDictionary^ _cefCommandLineArgs; - - internal: - ::CefSettings* _cefSettings; - List^ _cefCustomSchemes; - - public: - /// - /// Default Constructor - /// - AbstractCefSettings() : _cefSettings(new ::CefSettings()) - { - _cefSettings->multi_threaded_message_loop = true; - _cefSettings->no_sandbox = true; - BrowserSubprocessPath = Path::Combine(Path::GetDirectoryName(this->GetType()->Assembly->Location), "CefSharp.BrowserSubprocess.exe"); - _cefCustomSchemes = gcnew List(); - _cefExtensions = gcnew List(); - _cefCommandLineArgs = gcnew Dictionary(); - - //Automatically discovered and load a system-wide installation of Pepper Flash. - _cefCommandLineArgs->Add("enable-system-flash", "1"); - - //CEF has switched to the new process model defined that was implemented - //in the Chromium Site isolation project, we'll continue to use the older - //process model by default. - //https://github.com/cefsharp/CefSharp/issues/2553 - _cefCommandLineArgs->Add("process-per-site-instance", "1"); - } - - !AbstractCefSettings() - { - delete _cefSettings; - } - - ~AbstractCefSettings() - { - this->!AbstractCefSettings(); - } - - /// - /// Add Customs schemes to this collection - /// - property IEnumerable^ CefCustomSchemes - { - IEnumerable^ get() { return _cefCustomSchemes; } - } - - /// - /// List of all V8Extensions to be registered using CefRegisterExtension - /// in the render process. - /// - virtual property IEnumerable^ Extensions - { - IEnumerable^ get() { return _cefExtensions; } - } - - /// - /// Add custom command line argumens to this collection, they will be - /// added in OnBeforeCommandLineProcessing. - // The CefSettings.command_line_args_disabled value can be used to start with an empty command-line object. Any values specified in CefSettings that equate to command-line arguments will be set before this method is called. - /// - virtual property IDictionary^ CefCommandLineArgs - { - IDictionary^ get() { return _cefCommandLineArgs; } - } - - /// - /// Set to true to disable configuration of browser process features using - /// standard CEF and Chromium command-line arguments. Configuration can still - /// be specified using CEF data structures or by adding to CefCommandLineArgs - /// - property bool CommandLineArgsDisabled - { - bool get() { return _cefSettings->command_line_args_disabled == 1; } - void set(bool value) { _cefSettings->command_line_args_disabled = value; } - } - - /// - /// Set to true to enable date-based expiration of built in network security information (i.e. certificate transparency logs, - /// HSTS preloading and pinning information). Enabling this option improves network security but may cause HTTPS load failures when - /// using CEF binaries built more than 10 weeks in the past. See https://www.certificate-transparency.org/ and - /// https://www.chromium.org/hsts for details. Can be set globally using the CefSettings.EnableNetSecurityExpiration value. - /// - property bool EnableNetSecurityExpiration - { - bool get() { return _cefSettings->enable_net_security_expiration == 1; } - void set(bool value) { _cefSettings->enable_net_security_expiration = value; } - } - - /// - /// Set to true to control browser process main (UI) thread message pump - /// scheduling via the IBrowserProcessHandler.OnScheduleMessagePumpWork - /// callback. This option is recommended for use in combination with the - /// Cef.DoMessageLoopWork() function in cases where the CEF message loop must be - /// integrated into an existing application message loop (see additional - /// comments and warnings on Cef.DoMessageLoopWork). Enabling this option is not - /// recommended for most users; leave this option disabled and use either - /// MultiThreadedMessageLoop (the default) if possible. - /// - property bool ExternalMessagePump - { - bool get() { return _cefSettings->external_message_pump == 1; } - void set(bool value) { _cefSettings->external_message_pump = value; } - } - - /// - /// Set to true to have the browser process message loop run in a separate - /// thread. If false than the CefDoMessageLoopWork() function must be - /// called from your application message loop. This option is only supported on - /// Windows. The default value is true - /// - property bool MultiThreadedMessageLoop - { - bool get() { return _cefSettings->multi_threaded_message_loop == 1; } - void set(bool value) { _cefSettings->multi_threaded_message_loop = value; } - } - - /// - /// The path to a separate executable that will be launched for sub-processes. - /// By default the browser process executable is used. See the comments on - /// Cef.ExecuteProcess() for details. Also configurable using the - /// "browser-subprocess-path" command-line switch. Default is CefSharp.BrowserSubprocess.exe - /// - property String^ BrowserSubprocessPath - { - String^ get() { return StringUtils::ToClr(_cefSettings->browser_subprocess_path); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->browser_subprocess_path, value); } - } - - /// - /// The location where cache data will be stored on disk. If empty then - /// browsers will be created in "incognito mode" where in-memory caches are - /// used for storage and no data is persisted to disk. HTML5 databases such as - /// localStorage will only persist across sessions if a cache path is - /// specified. Can be overridden for individual CefRequestContext instances via - /// the RequestContextSettings.CachePath value. - /// - property String^ CachePath - { - String^ get() { return StringUtils::ToClr(_cefSettings->cache_path); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->cache_path, value); } - } - - /// - /// The location where user data such as spell checking dictionary files will - /// be stored on disk. If empty then the default platform-specific user data - /// directory will be used ("~/.cef_user_data" directory on Linux, - /// "~/Library/Application Support/CEF/User Data" directory on Mac OS X, - /// "Local Settings\Application Data\CEF\User Data" directory under the user - /// profile directory on Windows). - /// - property String^ UserDataPath - { - String^ get() { return StringUtils::ToClr(_cefSettings->user_data_path); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->user_data_path, value); } - } - - /// - /// Set to true in order to completely ignore SSL certificate errors. - /// This is NOT recommended. - /// - property bool IgnoreCertificateErrors - { - bool get() { return _cefSettings->ignore_certificate_errors == 1; } - void set(bool value) { _cefSettings->ignore_certificate_errors = value; } - } - - /// - /// The locale string that will be passed to WebKit. If empty the default - /// locale of "en-US" will be used. Also configurable using the "lang" - /// command-line switch. - /// - property String^ Locale - { - String^ get() { return StringUtils::ToClr(_cefSettings->locale); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->locale, value); } - } - - /// - /// The fully qualified path for the locales directory. If this value is empty - /// the locales directory must be located in the module directory. - /// Also configurable using the "locales-dir-path" command-line switch. - /// - property String^ LocalesDirPath - { - String^ get() { return StringUtils::ToClr(_cefSettings->locales_dir_path); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->locales_dir_path, value); } - } - - /// - /// The fully qualified path for the resources directory. If this value is - /// empty the cef.pak and/or devtools_resources.pak files must be located in - /// the module directory. Also configurable using the "resources-dir-path" command-line - /// switch. - /// - property String^ ResourcesDirPath - { - String^ get() { return StringUtils::ToClr(_cefSettings->resources_dir_path); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->resources_dir_path, value); } - } - - /// - /// The directory and file name to use for the debug log. If empty a default - /// log file name and location will be used. On Windows and Linux a "debug.log" - /// file will be written in the main executable directory. - /// Also configurable using the"log-file" command-line switch. - /// - property String^ LogFile - { - String^ get() { return StringUtils::ToClr(_cefSettings->log_file); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->log_file, value); } - } - - /// - /// The log severity. Only messages of this severity level or higher will be - /// logged. When set to no messages will be written to the log file, - /// but Fatal messages will still be output to stderr. Also configurable using the "log-severity" command-line switch with - /// a value of "verbose", "info", "warning", "error", "fatal", "error-report" or "disable". - /// - property CefSharp::LogSeverity LogSeverity - { - CefSharp::LogSeverity get() { return (CefSharp::LogSeverity)_cefSettings->log_severity; } - void set(CefSharp::LogSeverity value) { _cefSettings->log_severity = (cef_log_severity_t)value; } - } - - /// - /// Custom flags that will be used when initializing the V8 JavaScript engine. - /// The consequences of using custom flags may not be well tested. Also - /// configurable using the "js-flags" command-line switch. - /// - property String^ JavascriptFlags - { - String^ get() { return StringUtils::ToClr(_cefSettings->javascript_flags); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->javascript_flags, value); } - } - - /// - /// Set to true to disable loading of pack files for resources and locales. - /// A resource bundle handler must be provided for the browser and render - /// processes via CefApp::GetResourceBundleHandler() if loading of pack files - /// is disabled. Also configurable using the "disable-pack-loading" command- - /// line switch. - /// - property bool PackLoadingDisabled - { - bool get() { return _cefSettings->pack_loading_disabled == 1; } - void set(bool value) { _cefSettings->pack_loading_disabled = value; } - } - - /// - /// Value that will be inserted as the product portion of the default - /// User-Agent string. If empty the Chromium product version will be used. If - /// |userAgent| is specified this value will be ignored. Also configurable - /// using the "product-version" command-line switch. - /// - property String^ ProductVersion - { - String^ get() { return StringUtils::ToClr(_cefSettings->product_version); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->product_version, value); } - } - - /// - /// Set to a value between 1024 and 65535 to enable remote debugging on the - /// specified port. For example, if 8080 is specified the remote debugging URL - /// will be http://localhost:8080. CEF can be remotely debugged from any CEF or - /// Chrome browser window. Also configurable using the "remote-debugging-port" - /// command-line switch. - /// - property int RemoteDebuggingPort - { - int get() { return _cefSettings->remote_debugging_port; } - void set(int value) { _cefSettings->remote_debugging_port = value; } - } - - /// - /// The number of stack trace frames to capture for uncaught exceptions. - /// Specify a positive value to enable the CefRenderProcessHandler:: - /// OnUncaughtException() callback. Specify 0 (default value) and - /// OnUncaughtException() will not be called. Also configurable using the - /// "uncaught-exception-stack-size" command-line switch. - /// - property int UncaughtExceptionStackSize - { - int get() { return _cefSettings->uncaught_exception_stack_size; } - void set(int value) { _cefSettings->uncaught_exception_stack_size = value; } - } - - /// - /// Value that will be returned as the User-Agent HTTP header. If empty the - /// default User-Agent string will be used. Also configurable using the - /// "user-agent" command-line switch. - /// - property String^ UserAgent - { - String^ get() { return StringUtils::ToClr(_cefSettings->user_agent); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->user_agent, value); } - } - - /// - /// Set to true (1) to enable windowless (off-screen) rendering support. Do not - /// enable this value if the application does not use windowless rendering as - /// it may reduce rendering performance on some systems. - /// - property bool WindowlessRenderingEnabled - { - bool get() { return _cefSettings->windowless_rendering_enabled == 1; } - void set(bool value) { _cefSettings->windowless_rendering_enabled = value; } - } - - /// - /// To persist session cookies (cookies without an expiry date or validity - /// interval) by default when using the global cookie manager set this value to - /// true. Session cookies are generally intended to be transient and most - /// Web browsers do not persist them. A CachePath value must also be - /// specified to enable this feature. Also configurable using the - /// "persist-session-cookies" command-line switch. Can be overridden for - /// individual RequestContext instances via the - /// RequestContextSettings.PersistSessionCookies value. - /// - property bool PersistSessionCookies - { - bool get() { return _cefSettings->persist_session_cookies == 1; } - void set(bool value) { _cefSettings->persist_session_cookies = value; } - } - - /// - /// To persist user preferences as a JSON file in the cache path directory set - /// this value to true. A CachePath value must also be specified - /// to enable this feature. Also configurable using the - /// "persist-user-preferences" command-line switch. Can be overridden for - /// individual RequestContext instances via the - /// RequestContextSettings.PersistUserPreferences value. - /// - property bool PersistUserPreferences - { - bool get() { return _cefSettings->persist_user_preferences == 1; } - void set(bool value) { _cefSettings->persist_user_preferences = value; } - } - - /// - /// Comma delimited ordered list of language codes without any whitespace that - /// will be used in the "Accept-Language" HTTP header. May be set globally - /// using the CefSettings.AcceptLanguageList value. If both values are - /// empty then "en-US,en" will be used. - /// - property String^ AcceptLanguageList - { - String^ get() { return StringUtils::ToClr(_cefSettings->accept_language_list); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_cefSettings->accept_language_list, value); } - } - - /// - /// Background color used for the browser before a document is loaded and when no document color is - /// specified. The alpha component must be either fully opaque (0xFF) or fully transparent (0x00). - /// If the alpha component is fully opaque then the RGB components will be used as the background - /// color. If the alpha component is fully transparent for a WinForms browser then the default value - /// of opaque white be used. If the alpha component is fully transparent for a windowless - /// (WPF/OffScreen) browser then transparent painting will be enabled. - /// - virtual property uint32 BackgroundColor - { - uint32 get() { return _cefSettings->background_color; } - void set(uint32 value) { _cefSettings->background_color = value; } - } - - /// - /// Registers a custom scheme using the provided settings. - /// - /// The CefCustomScheme which provides the details about the scheme. - void RegisterScheme(CefCustomScheme^ cefCustomScheme) - { - //Scheme names are converted to lowercase - cefCustomScheme->SchemeName = cefCustomScheme->SchemeName->ToLower(); - - _cefCustomSchemes->Add(cefCustomScheme); - } - - /// - /// Register a new V8 extension with the specified JavaScript extension code - /// - /// The V8Extension that contains the extension code. - void RegisterExtension(V8Extension^ extension) - { - if (_cefExtensions->Contains(extension)) - { - throw gcnew ArgumentException("An extension with the same name is already registered.", "extension"); - } - _cefExtensions->Add(extension); - } - - /// - /// Set command line argument to disable GPU Acceleration, this will disable WebGL. - /// - void DisableGpuAcceleration() - { - if (!_cefCommandLineArgs->ContainsKey("disable-gpu")) - { - _cefCommandLineArgs->Add("disable-gpu", "1"); - } - } - - /// - /// Set command line arguments for best OSR (Offscreen and WPF) Rendering performance - /// This will disable WebGL, look at the source to determine which flags best suite - /// your requirements. - /// - void SetOffScreenRenderingBestPerformanceArgs() - { - // Use software rendering and compositing (disable GPU) for increased FPS - // and decreased CPU usage. This will also disable WebGL so remove these - // switches if you need that capability. - // See https://bitbucket.org/chromiumembedded/cef/issues/1257 for details. - if (!_cefCommandLineArgs->ContainsKey("disable-gpu")) - { - _cefCommandLineArgs->Add("disable-gpu", "1"); - } - - if (!_cefCommandLineArgs->ContainsKey("disable-gpu-compositing")) - { - _cefCommandLineArgs->Add("disable-gpu-compositing", "1"); - } - - // Synchronize the frame rate between all processes. This results in - // decreased CPU usage by avoiding the generation of extra frames that - // would otherwise be discarded. The frame rate can be set at browser - // creation time via CefBrowserSettings.windowless_frame_rate or changed - // dynamically using CefBrowserHost::SetWindowlessFrameRate. In cefclient - // it can be set via the command-line using `--off-screen-frame-rate=XX`. - // See https://bitbucket.org/chromiumembedded/cef/issues/1368 for details. - if (!_cefCommandLineArgs->ContainsKey("enable-begin-frame-scheduling")) - { - _cefCommandLineArgs->Add("enable-begin-frame-scheduling", "1"); - } - } - }; -} diff --git a/CefSharp.Core/BrowserSettings.cs b/CefSharp.Core/BrowserSettings.cs new file mode 100644 index 0000000000..5261619622 --- /dev/null +++ b/CefSharp.Core/BrowserSettings.cs @@ -0,0 +1,248 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +//NOTE:Classes in the CefSharp.Core namespace have been hidden from intellisnse so users don't use them directly + +namespace CefSharp +{ + /// + public class BrowserSettings : IBrowserSettings + { + private CefSharp.Core.BrowserSettings settings; + + /// + public BrowserSettings(bool autoDispose = false) + { + settings = new CefSharp.Core.BrowserSettings(autoDispose); + } + + /// + public string StandardFontFamily + { + get { return settings.StandardFontFamily; } + set { settings.StandardFontFamily = value; } + } + + /// + public string FixedFontFamily + { + get { return settings.FixedFontFamily; } + set { settings.FixedFontFamily = value; } + } + + /// + public string SerifFontFamily + { + get { return settings.SerifFontFamily; } + set { settings.SerifFontFamily = value; } + } + + /// + public string SansSerifFontFamily + { + get { return settings.SansSerifFontFamily; } + set { settings.SansSerifFontFamily = value; } + } + + /// + public string CursiveFontFamily + { + get { return settings.CursiveFontFamily; } + set { settings.CursiveFontFamily = value; } + } + + /// + public string FantasyFontFamily + { + get { return settings.FantasyFontFamily; } + set { settings.FantasyFontFamily = value; } + } + + /// + public int DefaultFontSize + { + get { return settings.DefaultFontSize; } + set { settings.DefaultFontSize = value; } + } + + /// + public int DefaultFixedFontSize + { + get { return settings.DefaultFixedFontSize; } + set { settings.DefaultFixedFontSize = value; } + } + + /// + public int MinimumFontSize + { + get { return settings.MinimumFontSize; } + set { settings.MinimumFontSize = value; } + } + + /// + public int MinimumLogicalFontSize + { + get { return settings.MinimumLogicalFontSize; } + set { settings.MinimumLogicalFontSize = value; } + } + + /// + public string DefaultEncoding + { + get { return settings.DefaultEncoding; } + set { settings.DefaultEncoding = value; } + } + + /// + public CefState RemoteFonts + { + get { return settings.RemoteFonts; } + set { settings.RemoteFonts = value; } + } + + /// + public CefState Javascript + { + get { return settings.Javascript; } + set { settings.Javascript = value; } + } + + /// + public CefState JavascriptCloseWindows + { + get { return settings.JavascriptCloseWindows; } + set { settings.JavascriptCloseWindows = value; } + } + + /// + public CefState JavascriptAccessClipboard + { + get { return settings.JavascriptAccessClipboard; } + set { settings.JavascriptAccessClipboard = value; } + } + + /// + public CefState JavascriptDomPaste + { + get { return settings.JavascriptDomPaste; } + set { settings.JavascriptDomPaste = value; } + } + + /// + public CefState ImageLoading + { + get { return settings.ImageLoading; } + set { settings.ImageLoading = value; } + } + + /// + public CefState ImageShrinkStandaloneToFit + { + get { return settings.ImageShrinkStandaloneToFit; } + set { settings.ImageShrinkStandaloneToFit = value; } + } + + /// + public CefState TextAreaResize + { + get { return settings.TextAreaResize; } + set { settings.TextAreaResize = value; } + } + + /// + public CefState TabToLinks + { + get { return settings.TabToLinks; } + set { settings.TabToLinks = value; } + } + + /// + public CefState LocalStorage + { + get { return settings.LocalStorage; } + set { settings.LocalStorage = value; } + } + + /// + public CefState Databases + { + get { return settings.Databases; } + set { settings.Databases = value; } + } + + /// + public CefState WebGl + { + get { return settings.WebGl; } + set { settings.WebGl = value; } + } + + /// + public CefState ChromeStatusBubble + { + get { return settings.ChromeStatusBubble; } + set { settings.ChromeStatusBubble = value; } + } + + /// + public CefState ChromeZoomBubble + { + get { return settings.ChromeZoomBubble; } + set { settings.ChromeZoomBubble = value; } + } + + /// + public uint BackgroundColor + { + get { return settings.BackgroundColor; } + set { settings.BackgroundColor = value; } + } + + /// + public int WindowlessFrameRate + { + get { return settings.WindowlessFrameRate; } + set { settings.WindowlessFrameRate = value; } + } + + /// + public bool IsDisposed + { + get { return settings.IsDisposed; } + } + + /// + public bool AutoDispose + { + get { return settings.AutoDispose; } + } + + /// + public void Dispose() + { + settings.Dispose(); + } + + /// + /// Used internally to get the underlying instance. + /// Unlikely you'll use this yourself. + /// + /// the inner most instance + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public IBrowserSettings UnWrap() + { + return settings; + } + + /// + /// Create a new instance of + /// + /// set to false if you plan to reuse the instance, otherwise true + /// BrowserSettings + public static IBrowserSettings Create(bool autoDispose = false) + { + return new CefSharp.Core.BrowserSettings(autoDispose); + } + } +} diff --git a/CefSharp.Core/BrowserSettings.h b/CefSharp.Core/BrowserSettings.h deleted file mode 100644 index 8ee5c3c439..0000000000 --- a/CefSharp.Core/BrowserSettings.h +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright © 2010 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -#pragma once - -#include "Stdafx.h" - -#include "include\internal\cef_types_wrappers.h" - -namespace CefSharp -{ - /// - /// Browser initialization settings. Specify NULL or 0 to get the recommended - /// default values. The consequences of using custom values may not be well - /// tested. Many of these and other settings can also configured using command- - /// line switches. - /// - public ref class BrowserSettings : IBrowserSettings - { - private: - bool _isDisposed = false; - bool _ownsPointer = false; - bool _frameworkCreated = false; - internal: - CefBrowserSettings* _browserSettings; - - /// - /// Internal Constructor - /// - BrowserSettings(CefBrowserSettings* browserSettings) - { - _browserSettings = browserSettings; - } - - BrowserSettings(bool frameworkCreated) : _browserSettings(new CefBrowserSettings()) - { - _ownsPointer = true; - _frameworkCreated = frameworkCreated; - } - - public: - /// - /// Default Constructor - /// - BrowserSettings() : _browserSettings(new CefBrowserSettings()) - { - _ownsPointer = true; - } - - !BrowserSettings() - { - if (_ownsPointer) - { - delete _browserSettings; - } - - _browserSettings = NULL; - _isDisposed = true; - } - - ~BrowserSettings() - { - this->!BrowserSettings(); - } - - /// - /// StandardFontFamily - /// - virtual property String^ StandardFontFamily - { - String^ get() { return StringUtils::ToClr(_browserSettings->standard_font_family); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->standard_font_family, value); } - } - - /// - /// FixedFontFamily - /// - virtual property String^ FixedFontFamily - { - String^ get() { return StringUtils::ToClr(_browserSettings->fixed_font_family); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->fixed_font_family, value); } - } - - /// - /// SerifFontFamily - /// - virtual property String^ SerifFontFamily - { - String^ get() { return StringUtils::ToClr(_browserSettings->serif_font_family); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->serif_font_family, value); } - } - - /// - /// SansSerifFontFamily - /// - virtual property String^ SansSerifFontFamily - { - String^ get() { return StringUtils::ToClr(_browserSettings->sans_serif_font_family); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->sans_serif_font_family, value); } - } - - /// - /// CursiveFontFamily - /// - virtual property String^ CursiveFontFamily - { - String^ get() { return StringUtils::ToClr(_browserSettings->cursive_font_family); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->cursive_font_family, value); } - } - - /// - /// FantasyFontFamily - /// - virtual property String^ FantasyFontFamily - { - String^ get() { return StringUtils::ToClr(_browserSettings->fantasy_font_family); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->fantasy_font_family, value); } - } - - /// - /// DefaultFontSize - /// - virtual property int DefaultFontSize - { - int get() { return _browserSettings->default_font_size; } - void set(int value) { _browserSettings->default_font_size = value; } - } - - /// - /// DefaultFixedFontSize - /// - virtual property int DefaultFixedFontSize - { - int get() { return _browserSettings->default_fixed_font_size; } - void set(int value) { _browserSettings->default_fixed_font_size = value; } - } - - /// - /// MinimumFontSize - /// - virtual property int MinimumFontSize - { - int get() { return _browserSettings->minimum_font_size; } - void set(int value) { _browserSettings->minimum_font_size = value; } - } - - /// - /// MinimumLogicalFontSize - /// - virtual property int MinimumLogicalFontSize - { - int get() { return _browserSettings->minimum_logical_font_size; } - void set(int value) { _browserSettings->minimum_logical_font_size = value; } - } - - /// - /// Default encoding for Web content. If empty "ISO-8859-1" will be used. Also - /// configurable using the "default-encoding" command-line switch. - /// - virtual property String^ DefaultEncoding - { - String^ get() { return StringUtils::ToClr(_browserSettings->default_encoding); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->default_encoding, value); } - } - - /// - /// Controls the loading of fonts from remote sources. Also configurable using - /// the "disable-remote-fonts" command-line switch. - /// - virtual property CefState RemoteFonts - { - CefState get() { return (CefState)_browserSettings->remote_fonts; } - void set(CefState value) { _browserSettings->remote_fonts = (cef_state_t)value; } - } - - /// - /// Controls whether JavaScript can be executed. (Used to Enable/Disable javascript) - /// Also configurable using the "disable-javascript" command-line switch. - /// - virtual property CefState Javascript - { - CefState get() { return (CefState)_browserSettings->javascript; } - void set(CefState value) { _browserSettings->javascript = (cef_state_t)value; } - } - - /// - /// Controls whether JavaScript can be used to close windows that were not - /// opened via JavaScript. JavaScript can still be used to close windows that - /// were opened via JavaScript. Also configurable using the - /// "disable-javascript-close-windows" command-line switch. - /// - virtual property CefState JavascriptCloseWindows - { - CefState get() { return (CefState)_browserSettings->javascript_close_windows; } - void set(CefState value) { _browserSettings->javascript_close_windows = (cef_state_t)value; } - } - - /// - /// Controls whether JavaScript can access the clipboard. Also configurable - /// using the "disable-javascript-access-clipboard" command-line switch. - /// - virtual property CefState JavascriptAccessClipboard - { - CefState get() { return (CefState)_browserSettings->javascript_access_clipboard; } - void set(CefState value) { _browserSettings->javascript_access_clipboard = (cef_state_t)value; } - } - - /// - /// Controls whether DOM pasting is supported in the editor via - /// execCommand("paste"). The |javascript_access_clipboard| setting must also - /// be enabled. Also configurable using the "disable-javascript-dom-paste" - /// command-line switch. - /// - virtual property CefState JavascriptDomPaste - { - CefState get() { return (CefState)_browserSettings->javascript_dom_paste; } - void set(CefState value) { _browserSettings->javascript_dom_paste = (cef_state_t)value; } - } - - /// - /// Controls whether any plugins will be loaded. Also configurable using the - /// "disable-plugins" command-line switch. - /// - virtual property CefState Plugins - { - CefState get() { return (CefState)_browserSettings->plugins; } - void set(CefState value) { _browserSettings->plugins = (cef_state_t)value; } - } - - /// - /// Controls whether file URLs will have access to all URLs. Also configurable - /// using the "allow-universal-access-from-files" command-line switch. - /// - virtual property CefState UniversalAccessFromFileUrls - { - CefState get() { return (CefState)_browserSettings->universal_access_from_file_urls; } - void set(CefState value) { _browserSettings->universal_access_from_file_urls = (cef_state_t)value; } - } - - /// - /// Controls whether file URLs will have access to other file URLs. Also - /// configurable using the "allow-access-from-files" command-line switch. - /// - virtual property CefState FileAccessFromFileUrls - { - CefState get() { return (CefState)_browserSettings->file_access_from_file_urls; } - void set(CefState value) { _browserSettings->file_access_from_file_urls = (cef_state_t)value; } - } - - /// - /// Controls whether web security restrictions (same-origin policy) will be - /// enforced. Disabling this setting is not recommend as it will allow risky - /// security behavior such as cross-site scripting (XSS). Also configurable - /// using the "disable-web-security" command-line switch. - /// - virtual property CefState WebSecurity - { - CefState get() { return (CefState)_browserSettings->web_security; } - void set(CefState value) { _browserSettings->web_security = (cef_state_t)value; } - } - - /// - /// Controls whether image URLs will be loaded from the network. A cached image - /// will still be rendered if requested. Also configurable using the - /// "disable-image-loading" command-line switch. - /// - virtual property CefState ImageLoading - { - CefState get() { return (CefState)_browserSettings->image_loading; } - void set(CefState value) { _browserSettings->image_loading = (cef_state_t)value; } - } - - /// - /// Controls whether standalone images will be shrunk to fit the page. Also - /// configurable using the "image-shrink-standalone-to-fit" command-line - /// switch. - /// - virtual property CefState ImageShrinkStandaloneToFit - { - CefState get() { return (CefState)_browserSettings->image_shrink_standalone_to_fit; } - void set(CefState value) { _browserSettings->image_shrink_standalone_to_fit = (cef_state_t)value; } - } - - /// - /// Controls whether text areas can be resized. Also configurable using the - /// "disable-text-area-resize" command-line switch. - /// - virtual property CefState TextAreaResize - { - CefState get() { return (CefState)_browserSettings->text_area_resize; } - void set(CefState value) { _browserSettings->text_area_resize = (cef_state_t)value; } - } - - /// - /// Controls whether the tab key can advance focus to links. Also configurable - /// using the "disable-tab-to-links" command-line switch. - /// - virtual property CefState TabToLinks - { - CefState get() { return (CefState)_browserSettings->tab_to_links; } - void set(CefState value) { _browserSettings->tab_to_links = (cef_state_t)value; } - } - - /// - /// Controls whether local storage can be used. Also configurable using the - /// "disable-local-storage" command-line switch. - /// - virtual property CefState LocalStorage - { - CefState get() { return (CefState)_browserSettings->local_storage; } - void set(CefState value) { _browserSettings->local_storage = (cef_state_t)value; } - } - - /// - /// Controls whether databases can be used. Also configurable using the - /// "disable-databases" command-line switch. - /// - virtual property CefState Databases - { - CefState get() { return (CefState)_browserSettings->databases; } - void set(CefState value) { _browserSettings->databases = (cef_state_t)value; } - } - - /// - /// Controls whether the application cache can be used. Also configurable using - /// the "disable-application-cache" command-line switch. - /// - virtual property CefState ApplicationCache - { - CefState get() { return (CefState)_browserSettings->application_cache; } - void set(CefState value) { _browserSettings->application_cache = (cef_state_t)value; } - } - - /// - /// Controls whether WebGL can be used. Note that WebGL requires hardware - /// support and may not work on all systems even when enabled. Also - /// configurable using the "disable-webgl" command-line switch. - /// - virtual property CefState WebGl - { - CefState get() { return (CefState)_browserSettings->webgl; } - void set(CefState value) { _browserSettings->webgl = (cef_state_t)value; } - } - - /// - /// Background color used for the browser before a document is loaded and when no document color - /// is specified. The alpha component must be either fully opaque (0xFF) or fully transparent (0x00). - /// If the alpha component is fully opaque then the RGB components will be used as the background - /// color. If the alpha component is fully transparent for a WinForms browser then the - /// CefSettings.BackgroundColor value will be used. If the alpha component is fully transparent - /// for a windowless (WPF/OffScreen) browser then transparent painting will be enabled. - /// - virtual property uint32 BackgroundColor - { - uint32 get() { return _browserSettings->background_color; } - void set(uint32 value) { _browserSettings->background_color = value; } - } - - /// - /// Comma delimited ordered list of language codes without any whitespace that - /// will be used in the "Accept-Language" HTTP header. May be overridden on a - /// per-browser basis using the CefBrowserSettings.AcceptLanguageList value. - /// If both values are empty then "en-US,en" will be used. Can be overridden - /// for individual RequestContext instances via the - /// RequestContextSettings.AcceptLanguageList value. - /// - virtual property String^ AcceptLanguageList - { - String^ get() { return StringUtils::ToClr(_browserSettings->accept_language_list); } - void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->accept_language_list, value); } - } - - /// - /// The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint - /// will be called for a windowless browser. The actual fps may be lower if - /// the browser cannot generate frames at the requested rate. The minimum - /// value is 1 and the maximum value is 60 (default 30). This value can also be - /// changed dynamically via IBrowserHost.SetWindowlessFrameRate. - /// - virtual property int WindowlessFrameRate - { - int get() { return _browserSettings->windowless_frame_rate; } - void set(int value) { _browserSettings->windowless_frame_rate = value; } - } - - /// - /// Gets a value indicating if the browser settings has been disposed. - /// - virtual property bool IsDisposed - { - bool get() { return _isDisposed; } - } - - virtual property bool FrameworkCreated - { - bool get() { return _frameworkCreated; } - } - }; -} diff --git a/CefSharp.Core/BrowserSettings.netcore.cs b/CefSharp.Core/BrowserSettings.netcore.cs new file mode 100644 index 0000000000..5c5a6467ca --- /dev/null +++ b/CefSharp.Core/BrowserSettings.netcore.cs @@ -0,0 +1,28 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +//NOTE:Classes in the CefSharp.Core namespace have been hidden from intellisnse so users don't use them directly + +namespace CefSharp +{ + /// + public class BrowserSettings : CefSharp.Core.BrowserSettings + { + /// + public BrowserSettings(bool autoDispose = false) : base(autoDispose) + { + + } + + /// + /// Create a new instance of + /// + /// set to false if you plan to reuse the instance, otherwise true + /// BrowserSettings + public static IBrowserSettings Create(bool autoDispose = false) + { + return new CefSharp.Core.BrowserSettings(autoDispose); + } + } +} diff --git a/CefSharp.Core/BrowserSubprocess/SelfHost.cs b/CefSharp.Core/BrowserSubprocess/SelfHost.cs new file mode 100644 index 0000000000..f97c16eafa --- /dev/null +++ b/CefSharp.Core/BrowserSubprocess/SelfHost.cs @@ -0,0 +1,99 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +//NOTE:Classes in the CefSharp.Core namespace have been hidden from intellisnse so users don't use them directly + +using CefSharp.Internals; +using System; +using System.IO; + +namespace CefSharp.BrowserSubprocess +{ + /// + /// SelfHost allows your application executable to be used as the BrowserSubProcess + /// with minimal effort. + /// https://github.com/cefsharp/CefSharp/wiki/SelfHost-BrowserSubProcess + /// + /// + /// //WinForms Example + /// public class Program + /// { + /// [STAThread] + /// public static int Main(string[] args) + /// { + /// var exitCode = CefSharp.BrowserSubprocess.SelfHost.Main(args); + /// + /// if (exitCode >= 0) + /// { + /// return exitCode; + /// } + /// + /// var settings = new CefSettings(); + /// //Absolute path to your applications executable + /// settings.BrowserSubprocessPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; + /// + /// Cef.Initialize(settings); + /// + /// var browser = new BrowserForm(true); + /// Application.Run(browser); + /// + /// return 0; + /// } + /// } + /// + public class SelfHost + { + /// + /// This function should be called from the application entry point function (typically Program.Main) + /// to execute a secondary process e.g. gpu, renderer, utility + /// This overload is specifically used for .Net Core. For hosting your own BrowserSubProcess + /// it's preferable to use the Main method provided by this class. + /// - Pass in command line args + /// + /// command line args + /// + /// If called for the browser process (identified by no "type" command-line value) it will return immediately + /// with a value of -1. If called for a recognized secondary process it will block until the process should exit + /// and then return the process exit code. + /// + public static int Main(string[] args) + { + var type = CommandLineArgsParser.GetArgumentValue(args, CefSharpArguments.SubProcessTypeArgument); + + if (string.IsNullOrEmpty(type)) + { + //If --type param missing from command line CEF/Chromium assums + //this is the main process (as all subprocesses must have a type param). + //Return -1 to indicate this behaviour. + return -1; + } + + +#if NETCOREAPP + var browserSubprocessDllPath = Initializer.BrowserSubProcessCorePath; + if (!File.Exists(browserSubprocessDllPath)) + { + browserSubprocessDllPath = Path.Combine(Path.GetDirectoryName(typeof(CefSharp.Core.BrowserSettings).Assembly.Location), "CefSharp.BrowserSubprocess.Core.dll"); + } + var browserSubprocessDll = System.Runtime.Loader.AssemblyLoadContext.Default.LoadFromAssemblyPath(browserSubprocessDllPath); + var browserSubprocessExecutableType = browserSubprocessDll.GetType("CefSharp.BrowserSubprocess.BrowserSubprocessExecutable"); +#else + var browserSubprocessDllPath = Path.Combine(Path.GetDirectoryName(typeof(CefSharp.Core.BrowserSettings).Assembly.Location), "CefSharp.BrowserSubprocess.Core.dll"); + var browserSubprocessDll = System.Reflection.Assembly.LoadFrom(browserSubprocessDllPath); + var browserSubprocessExecutableType = browserSubprocessDll.GetType("CefSharp.BrowserSubprocess.WcfBrowserSubprocessExecutable"); +#endif + + var browserSubprocessExecutable = Activator.CreateInstance(browserSubprocessExecutableType); + + var mainMethod = browserSubprocessExecutableType.GetMethod("MainSelfHost", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public); + var argCount = mainMethod.GetParameters(); + + var methodArgs = new object[] { args }; + + var exitCode = mainMethod.Invoke(null, methodArgs); + + return (int)exitCode; + } + } +} diff --git a/CefSharp.Core/Cef.cs b/CefSharp.Core/Cef.cs new file mode 100644 index 0000000000..e95b42b80c --- /dev/null +++ b/CefSharp.Core/Cef.cs @@ -0,0 +1,773 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +//NOTE:Classes in the CefSharp.Core namespace have been hidden from intellisnse so users don't use them directly + +using System; +using System.Threading.Tasks; +using CefSharp.Enums; +using CefSharp.Internals; + +namespace CefSharp +{ + /// + /// Global CEF methods are exposed through this class. e.g. CefInitalize maps to Cef.Initialize + /// CEF API Doc https://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html + /// This class cannot be inherited. + /// + public static class Cef + { + /// + /// Event is raised when is called, + /// before the shutdown logic is executed. + /// + /// + /// Will be called on the same thread as + /// + public static event EventHandler ShutdownStarted; + + public static TaskFactory UIThreadTaskFactory + { + get { return Core.Cef.UIThreadTaskFactory; } + } + public static TaskFactory IOThreadTaskFactory + { + get { return Core.Cef.IOThreadTaskFactory; } + } + public static TaskFactory FileThreadTaskFactory + { + get { return Core.Cef.FileThreadTaskFactory; } + } + + public static void AddDisposable(IDisposable item) + { + Core.Cef.AddDisposable(item); + } + + public static void RemoveDisposable(IDisposable item) + { + Core.Cef.RemoveDisposable(item); + } + + /// Gets a value that indicates whether CefSharp is initialized. + /// + /// true if CefSharp is initialized; returns false if initialize failed. + /// null if initialize not yet called. + /// + public static bool? IsInitialized + { + get { return Core.Cef.IsInitialized; } + } + + /// Gets a value that indicates whether CefSharp was shutdown. + /// true if CefSharp was shutdown; otherwise, false. + public static bool IsShutdown + { + get { return Core.Cef.IsShutdown; } + } + + /// Gets a value that indicates the version of CefSharp currently being used. + /// The CefSharp version. + public static string CefSharpVersion + { + get { return Core.Cef.CefSharpVersion; } + } + + /// Gets a value that indicates the CEF version currently being used. + /// The CEF Version + public static string CefVersion + { + get { return Core.Cef.CefVersion; } + } + + /// + /// API version that will be compiled client-side. The experimental (unversioned) + /// API is selected by default. Clients can set the CEF_API_VERSION value in + /// their project configuration to configure an explicit API version. Unlike + /// the experimental API, explicit API versions are back/forward compatible with + /// a specific range of CEF versions. + /// + public static int ApiVersion + { + get { return Core.Cef.ApiVersion; } + } + + + /// + /// API hashes for the selected CEF_API_VERSION. API hashes are created for + /// each version by analyzing CEF header files for C API type definitions. The + /// hash value will change when header files are modified in a way that may + /// cause binary incompatibility with other builds. + /// + public static string ApiHashPlatform + { + get { return Core.Cef.ApiHashPlatform; } + } + + /// Gets a value that indicates the Chromium version currently being used. + /// The Chromium version. + public static string ChromiumVersion + { + get { return Core.Cef.ChromiumVersion; } + } + + /// + /// Gets a value that indicates the Git Hash for CEF version currently being used. + /// + /// The Git Commit Hash + public static string CefCommitHash + { + get { return Core.Cef.CefCommitHash; } + } + + /// + /// Configures the CEF API version and returns API hashes for the libcef + /// library. Defaults to CEF_API_HASH_PLATFORM + /// + /// parameter should be CEF_API_VERSION and any changes to this value will be ignored after the first call to this method. + /// + /// returns API hashes for the libcef library. + /// The returned string is owned by the library and should not be freed. + /// + public static string ApiHash(int version) + { + return ApiHash(version, 0); + } + + /// + /// Configures the CEF API version and returns API hashes for the libcef + /// library. The entry parameter describes which hash value will be returned: + /// + /// 0 - CEF_API_HASH_PLATFORM + /// 1 - CEF_API_HASH_UNIVERSAL (deprecated, same as CEF_API_HASH_PLATFORM) + /// 2 - CEF_COMMIT_HASH (from cef_version.h) + /// + /// + /// parameter should be CEF_API_VERSION and any changes to this value will be ignored after the first call to this method. + /// The entry parameter describes which hash value will be returned: + /// + /// returns API hashes for the libcef library. + /// The returned string is owned by the library and should not be freed. + /// + public static string ApiHash(int version, int entry) + { + return Core.Cef.ApiHash(version, entry); + } + + /// + /// Parse the specified url into its component parts. + /// Uses a GURL to parse the Url. GURL is Google's URL parsing library. + /// + /// url + /// Returns null if the URL is empty or invalid. + public static UrlParts ParseUrl(string url) + { + return Core.Cef.ParseUrl(url); + } + + /// + /// Initializes CefSharp with user-provided settings. + /// It's important to note that Initialize and Shutdown MUST be called on your main + /// application thread (typically the UI thread). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// true if successful; otherwise, false. + public static bool Initialize(CefSettingsBase settings) + { + using (settings) + { + return Core.Cef.Initialize(settings.settings); + } + } + + /// + /// Initializes CefSharp with user-provided settings. + /// It's important to note that Initialize/Shutdown MUST be called on your main + /// application thread (typically the UI thread). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// Check that all relevant dependencies available, throws exception if any are missing + /// true if successful; otherwise, false. + public static bool Initialize(CefSettingsBase settings, bool performDependencyCheck) + { + using (settings) + { + return Core.Cef.Initialize(settings.settings, performDependencyCheck); + } + } + + /// + /// Initializes CefSharp with user-provided settings. + /// It's important to note that Initialize/Shutdown MUST be called on your main + /// application thread (typically the UI thread). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// Check that all relevant dependencies available, throws exception if any are missing + /// The handler for functionality specific to the browser process. Null if you don't wish to handle these events + /// true if successful; otherwise, false. + public static bool Initialize(CefSettingsBase settings, bool performDependencyCheck, IBrowserProcessHandler browserProcessHandler) + { + using (settings) + { + return Core.Cef.Initialize(settings.settings, performDependencyCheck, browserProcessHandler); + } + } + + /// + /// Initializes CefSharp with user-provided settings. + /// It's important to note that Initialize/Shutdown MUST be called on your main + /// application thread (typically the UI thread). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// Check that all relevant dependencies available, throws exception if any are missing + /// Implement this interface to provide handler implementations. Null if you don't wish to handle these events + /// true if successful; otherwise, false. + public static bool Initialize(CefSettingsBase settings, bool performDependencyCheck, IApp cefApp) + { + using (settings) + { + return Core.Cef.Initialize(settings.settings, performDependencyCheck, cefApp); + } + } + + /// + /// Initializes CefSharp with user-provided settings. This method allows you to wait for + /// to be called before continuing. + /// It's important to note that Initialize and Shutdown MUST be called on your main + /// application thread (typically the UI thread). If you call them on different + /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. + /// + /// CefSharp configuration settings. + /// Check that all relevant dependencies available, throws exception if any are missing + /// The handler for functionality specific to the browser process. Null if you don't wish to handle these events + /// returns a Task that can be awaited. true if successful; otherwise, false. If false check the log file for possible errors + /// + /// If successful then the Task will be completed successfully when is called. + /// If successful then the continuation will happen syncrionously on the CEF UI thread. + /// + public static Task InitializeAsync(CefSettingsBase settings, bool performDependencyCheck = true, IBrowserProcessHandler browserProcessHandler = null) + { + using (settings) + { + try + { + //Ignore the result, the Task will be set in Core.Cef.Initialze + Core.Cef.Initialize(settings.settings, performDependencyCheck, browserProcessHandler); + } + catch (Exception ex) + { + GlobalContextInitialized.SetException(ex); + } + } + + return GlobalContextInitialized.Task; + } + + /// + /// Run the CEF message loop. Use this function instead of an application- + /// provided message loop to get the best balance between performance and CPU + /// usage. This function should only be called on the main application thread and + /// only if Cef.Initialize() is called with a + /// CefSettings.MultiThreadedMessageLoop value of false. This function will + /// block until a quit message is received by the system. + /// + public static void RunMessageLoop() + { + Core.Cef.RunMessageLoop(); + } + + /// + /// Quit the CEF message loop that was started by calling Cef.RunMessageLoop(). + /// This function should only be called on the main application thread and only + /// if Cef.RunMessageLoop() was used. + /// + public static void QuitMessageLoop() + { + Core.Cef.QuitMessageLoop(); + } + + /// + /// Perform a single iteration of CEF message loop processing.This function is + /// provided for cases where the CEF message loop must be integrated into an + /// existing application message loop. Use of this function is not recommended + /// for most users; use CefSettings.MultiThreadedMessageLoop if possible (the default). + /// When using this function care must be taken to balance performance + /// against excessive CPU usage. It is recommended to enable the + /// CefSettings.ExternalMessagePump option when using + /// this function so that IBrowserProcessHandler.OnScheduleMessagePumpWork() + /// callbacks can facilitate the scheduling process. This function should only be + /// called on the main application thread and only if Cef.Initialize() is called + /// with a CefSettings.MultiThreadedMessageLoop value of false. This function + /// will not block. + /// + public static void DoMessageLoopWork() + { + Core.Cef.DoMessageLoopWork(); + } + + /// + /// This function should be called from the application entry point function to execute a secondary process. + /// It can be used to run secondary processes from the browser client executable (default behavior) or + /// from a separate executable specified by the CefSettings.browser_subprocess_path value. + /// If called for the browser process (identified by no "type" command-line value) it will return immediately with a value of -1. + /// If called for a recognized secondary process it will block until the process should exit and then return the process exit code. + /// The |application| parameter may be empty. The |windows_sandbox_info| parameter is only used on Windows and may be NULL (see cef_sandbox_win.h for details). + /// + public static int ExecuteProcess() + { + return Core.Cef.ExecuteProcess(); + } + + /// Add an entry to the cross-origin whitelist. + /// The origin allowed to be accessed by the target protocol/domain. + /// The target protocol allowed to access the source origin. + /// The optional target domain allowed to access the source origin. + /// If set to true would allow a blah.example.com if the + /// was set to example.com + /// + /// Returns false if is invalid or the whitelist cannot be accessed. + /// + /// The same-origin policy restricts how scripts hosted from different origins + /// (scheme + domain + port) can communicate. By default, scripts can only access + /// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes + /// (but no other schemes) can use the "Access-Control-Allow-Origin" header to + /// allow cross-origin requests. For example, https://source.example.com can make + /// XMLHttpRequest requests on http://target.example.com if the + /// http://target.example.com request returns an "Access-Control-Allow-Origin: + /// https://source.example.com" response header. + /// + /// Scripts in separate frames or iframes and hosted from the same protocol and + /// domain suffix can execute cross-origin JavaScript if both pages set the + /// document.domain value to the same domain suffix. For example, + /// scheme://foo.example.com and scheme://bar.example.com can communicate using + /// JavaScript if both domains set document.domain="example.com". + /// + /// This method is used to allow access to origins that would otherwise violate + /// the same-origin policy. Scripts hosted underneath the fully qualified + /// URL (like http://www.example.com) will be allowed access to + /// all resources hosted on the specified and . + /// If is non-empty and if false only + /// exact domain matches will be allowed. If contains a top- + /// level domain component (like "example.com") and is + /// true sub-domain matches will be allowed. If is empty and + /// if true all domains and IP addresses will be + /// allowed. + /// + /// This method cannot be used to bypass the restrictions on local or display + /// isolated schemes. See the comments on for more + /// information. + /// + /// This function may be called on any thread. Returns false if + /// is invalid or the whitelist cannot be accessed. + /// + public static bool AddCrossOriginWhitelistEntry( + string sourceOrigin, + string targetProtocol, + string targetDomain, + bool allowTargetSubdomains) + { + return Core.Cef.AddCrossOriginWhitelistEntry( + sourceOrigin, + targetProtocol, + targetDomain, + allowTargetSubdomains); + } + + /// Remove entry from cross-origin whitelist + /// The origin allowed to be accessed by the target protocol/domain. + /// The target protocol allowed to access the source origin. + /// The optional target domain allowed to access the source origin. + /// If set to true would allow a blah.example.com if the + /// was set to example.com + /// + /// + /// Remove an entry from the cross-origin access whitelist. Returns false if + /// is invalid or the whitelist cannot be accessed. + /// + public static bool RemoveCrossOriginWhitelistEntry(string sourceOrigin, + string targetProtocol, + string targetDomain, + bool allowTargetSubdomains) + + { + return Core.Cef.RemoveCrossOriginWhitelistEntry( + sourceOrigin, + targetProtocol, + targetDomain, + allowTargetSubdomains); + } + + /// Remove all entries from the cross-origin access whitelist. + /// + /// Remove all entries from the cross-origin access whitelist. Returns false if + /// the whitelist cannot be accessed. + /// + public static bool ClearCrossOriginWhitelist() + { + return Core.Cef.ClearCrossOriginWhitelist(); + } + + /// + /// Returns the global cookie manager. By default data will be stored at CefSettings.CachePath if specified or in memory otherwise. + /// Using this method is equivalent to calling Cef.GetGlobalRequestContext().GetCookieManager() + /// The cookie managers storage is created in an async fashion, whilst this method may return a cookie manager instance, + /// there may be a short delay before you can Get/Write cookies. + /// To be sure the cookie manager has been initialized use one of the following + /// - Access the ICookieManager after ICompletionCallback.OnComplete has been called + /// - Access the ICookieManager instance in IBrowserProcessHandler.OnContextInitialized. + /// - Use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events. + /// + /// If non-NULL it will be executed asynchronously on the CEF UI thread after the manager's storage has been initialized. + /// A the global cookie manager or null if the RequestContext has not yet been initialized. + public static ICookieManager GetGlobalCookieManager(ICompletionCallback callback = null) + { + return Core.Cef.GetGlobalCookieManager(callback); + } + + /// + /// This function can optionally be called on the main application thread after + /// CefInitialize to retrieve the initialization exit code. When CefInitialize + /// returns true the exit code will be 0 (). + /// Otherwise, see for possible exit code values including + /// browser process initialization errors and normal early exit conditions + /// (such as for process singleton relaunch behavior). + /// + public static ResultCode GetExitCode() + { + return Core.Cef.GetExitCode(); + } + + /// + /// Called prior to calling Cef.Shutdown, this disposes of any remaining + /// ChromiumWebBrowser instances. In WPF this is used from Dispatcher.ShutdownStarted + /// to release the unmanaged resources held by the ChromiumWebBrowser instances. + /// Generally speaking you don't need to call this yourself. + /// + public static void PreShutdown() + { + Core.Cef.PreShutdown(); + } + + /// + /// Shuts down CefSharp and the underlying CEF infrastructure. This method is safe to call multiple times; it will only + /// shut down CEF on the first call (all subsequent calls will be ignored). + /// This method should be called on the main application thread to shut down the CEF browser process before the application exits. + /// If you are Using CefSharp.OffScreen then you must call this explicitly before your application exits or it will hang. + /// This method must be called on the same thread as Initialize. If you don't call Shutdown explicitly then CefSharp.Wpf and CefSharp.WinForms + /// versions will do their best to call Shutdown for you, if your application is having trouble closing then call thus explicitly. + /// + public static void Shutdown() + { + ShutdownStarted?.Invoke(null, EventArgs.Empty); + ShutdownStarted = null; + + Core.Cef.Shutdown(); + } + + /// + /// This method should only be used by advanced users, if you're unsure then use Cef.Shutdown(). + /// This function should be called on the main application thread to shut down + /// the CEF browser process before the application exits. This method simply obtains a lock + /// and calls the native CefShutdown method, only IsInitialized is checked. All ChromiumWebBrowser + /// instances MUST be Disposed of before calling this method. If calling this method results in a crash + /// or hangs then you're likely hanging on to some unmanaged resources or haven't closed all of your browser + /// instances + /// + public static void ShutdownWithoutChecks() + { + ShutdownStarted?.Invoke(null, EventArgs.Empty); + ShutdownStarted = null; + + Core.Cef.ShutdownWithoutChecks(); + } + + /// + /// Clear all scheme handler factories registered with the global request context. + /// Returns false on error. This function may be called on any thread in the browser process. + /// Using this function is equivalent to calling Cef.GetGlobalRequestContext().ClearSchemeHandlerFactories(). + /// + /// Returns false on error. + public static bool ClearSchemeHandlerFactories() + { + return Core.Cef.ClearSchemeHandlerFactories(); + } + + /// + /// Returns true if called on the specified CEF thread. + /// + /// Returns true if called on the specified thread. + public static bool CurrentlyOnThread(CefThreadIds threadId) + { + return Core.Cef.CurrentlyOnThread(threadId); + } + + /// + /// Gets the Global Request Context. Make sure to Dispose of this object when finished. + /// The earlier possible place to access the IRequestContext is in IBrowserProcessHandler.OnContextInitialized. + /// Alternative use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events. + /// + /// Returns the global request context or null if the RequestContext has not been initialized yet. + public static IRequestContext GetGlobalRequestContext() + { + return Core.Cef.GetGlobalRequestContext(); + } + + /// + /// Helper function (wrapper around the CefColorSetARGB macro) which combines + /// the 4 color components into an uint32 for use with BackgroundColor property + /// + /// Alpha + /// Red + /// Green + /// Blue + /// Returns the color. + public static UInt32 ColorSetARGB(UInt32 a, UInt32 r, UInt32 g, UInt32 b) + { + return Core.Cef.ColorSetARGB(a, r, g, b); + } + + /// + /// Crash reporting is configured using an INI-style config file named + /// crash_reporter.cfg. This file must be placed next to + /// the main application executable. File contents are as follows: + /// + /// # Comments start with a hash character and must be on their own line. + /// + /// [Config] + /// ProductName=<Value of the "prod" crash key; defaults to "cef"> + /// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version> + /// AppName=<Windows only; App-specific folder name component for storing crash + /// information; default to "CEF"> + /// ExternalHandler=<Windows only; Name of the external handler exe to use + /// instead of re-launching the main exe; default to empty> + /// ServerURL=<crash server URL; default to empty> + /// RateLimitEnabled=<True if uploads should be rate limited; default to true> + /// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; + /// default to 5> + /// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value + /// will cause older reports to be deleted; default to 20> + /// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; + /// default to 5> + /// + /// [CrashKeys] + /// my_key1=<small|medium|large> + /// my_key2=<small|medium|large> + /// + /// Config section: + /// + /// If "ProductName" and/or "ProductVersion" are set then the specified values + /// will be included in the crash dump metadata. + /// + /// If "AppName" is set on Windows then crash report information (metrics, + /// database and dumps) will be stored locally on disk under the + /// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. + /// + /// If "ExternalHandler" is set on Windows then the specified exe will be + /// launched as the crashpad-handler instead of re-launching the main process + /// exe. The value can be an absolute path or a path relative to the main exe + /// directory. + /// + /// If "ServerURL" is set then crashes will be uploaded as a multi-part POST + /// request to the specified URL. Otherwise, reports will only be stored locally + /// on disk. + /// + /// If "RateLimitEnabled" is set to true then crash report uploads will be rate + /// limited as follows: + /// 1. If "MaxUploadsPerDay" is set to a positive value then at most the + /// specified number of crashes will be uploaded in each 24 hour period. + /// 2. If crash upload fails due to a network or server error then an + /// incremental backoff delay up to a maximum of 24 hours will be applied for + /// retries. + /// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the + /// "MaxUploadsPerDay" value will be reduced to 1 until the client is + /// restarted. This helps to avoid an upload flood when the network or + /// server error is resolved. + /// + /// If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage + /// on disk will be limited to that size in megabytes. For example, on Windows + /// each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to + /// about 34 crash reports stored on disk. + /// + /// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older + /// than the specified age in days will be deleted. + /// + /// CrashKeys section: + /// + /// Any number of crash keys can be specified for use by the application. Crash + /// key values will be truncated based on the specified size (small = 63 bytes, + /// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set + /// from any thread or process using the Cef.SetCrashKeyValue function. These + /// key/value pairs will be sent to the crash server along with the crash dump + /// file. Medium and large values will be chunked for submission. For example, + /// if your key is named "mykey" then the value will be broken into ordered + /// chunks and submitted using keys named "mykey-1", "mykey-2", etc. + /// + /// Returns true if crash reporting is enabled. + public static bool CrashReportingEnabled + { + get { return Core.Cef.CrashReportingEnabled; } + } + + /// + /// Sets or clears a specific key-value pair from the crash metadata. + /// + /// key + /// value + public static void SetCrashKeyValue(string key, string value) + { + Core.Cef.SetCrashKeyValue(key, value); + } + + /// + /// Gets the current log level. + /// When is set to then + /// no messages will be written to the log file, but FATAL messages will still be output to stderr. + /// When logging is disabled this method will return . + /// + /// Current Log Level + public static LogSeverity GetMinLogLevel() + { + var severity = Core.Cef.GetMinLogLevel(); + + //Manually convert the int into the enum + //Values don't match (this is a difference in CEF/Chromium) implementation + //we need to deal with it manually, + //https://github.com/chromiumembedded/cef/blob/2a64387259cf14412e24c3267c8a1eb3b99a54e3/include/base/cef_logging.h#L186 + //const LogSeverity LOG_VERBOSE = -1; + //const LogSeverity LOG_INFO = 0; + //const LogSeverity LOG_WARNING = 1; + //const LogSeverity LOG_ERROR = 2; + //const LogSeverity LOG_FATAL = 3; + + if (severity == -1) + { + return LogSeverity.Verbose; + } + + if (severity == 0) + { + return LogSeverity.Info; + } + + if (severity == 1) + { + return LogSeverity.Warning; + } + + if (severity == 2) + { + return LogSeverity.Error; + } + + if (severity == 3) + { + return LogSeverity.Fatal; + } + + //No matching type, return the integer value as enum + return (LogSeverity)severity; + } + + /// + /// Returns the mime type for the specified file extension or an empty string if unknown. + /// + /// file extension + /// Returns the mime type for the specified file extension or an empty string if unknown. + public static string GetMimeType(string extension) + { + return Core.Cef.GetMimeType(extension); + } + + /// + /// WaitForBrowsersToClose is not enabled by default, call this method + /// before Cef.Initialize to enable. If you aren't calling Cef.Initialize + /// explicitly then this should be called before creating your first + /// ChromiumWebBrowser instance. + /// + public static void EnableWaitForBrowsersToClose() + { + Core.Cef.EnableWaitForBrowsersToClose(); + } + + /// + /// Helper method to ensure all ChromiumWebBrowser instances have been + /// closed/disposed, should be called before Cef.Shutdown. + /// Disposes all remaining ChromiumWebBrowser instances + /// then waits for CEF to release its remaining CefBrowser instances. + /// Finally a small delay of 50ms to allow for CEF to finish it's cleanup. + /// Should only be called when MultiThreadedMessageLoop = true; + /// (Hasn't been tested when when CEF integrates into main message loop). + /// + public static void WaitForBrowsersToClose() + { + Core.Cef.WaitForBrowsersToClose(); + } + + + /// + /// Helper method to ensure all ChromiumWebBrowser instances have been + /// closed/disposed, should be called before Cef.Shutdown. + /// Disposes all remaining ChromiumWebBrowser instances + /// then waits for CEF to release its remaining CefBrowser instances. + /// Finally a small delay of 50ms to allow for CEF to finish it's cleanup. + /// Should only be called when MultiThreadedMessageLoop = true; + /// (Hasn't been tested when when CEF integrates into main message loop). + /// + /// The timeout in miliseconds. + public static void WaitForBrowsersToClose(int timeoutInMiliseconds) + { + Core.Cef.WaitForBrowsersToClose(timeoutInMiliseconds); + } + + /// + /// Post an action for delayed execution on the specified thread. + /// + /// thread id + /// action to execute + /// delay in ms + /// bool + public static bool PostDelayedAction(CefThreadIds threadId, Action action, int delayInMs) + { + return Core.Cef.PostDelayedAction(threadId, action, delayInMs); + } + + /// + /// Post an action for execution on the specified thread. + /// + /// thread id + /// action to execute + /// bool + public static bool PostAction(CefThreadIds threadId, Action action) + { + return Core.Cef.PostAction(threadId, action); + } + + /// + /// Indicates if the current OS version matches, or is greater than, the Windows 10 version. + /// Applications not manifested for Windows 10 return false, even if the current operating system version is Windows 10. + /// To manifest your applications for Windows 10, see https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1. + /// + /// True if the current OS version matches, or is greater than, the Windows 10 version; otherwise, false. + public static bool IsWindows10OrGreater() + { + return Core.Cef.IsWindows10OrGreaterEx(); + } + + /// + /// If the current OS version matches, or is greater than, the Windows 10 version then this method does nothing. + /// Applications not manifested for Windows 10 will throw an , even if the current operating system version is Windows 10. + /// To manifest your applications for Windows 10, see https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1. + /// + /// + public static void AssertIsWindows10OrGreater() + { + if (!IsWindows10OrGreater()) + throw new ApplicationException("Current OS version is less than Windows 10. Applications not manifested for Windows 10 throw this exception, even if the current operating system version is Windows 10. To manifest your applications for Windows 10, see https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1."); + } + } +} diff --git a/CefSharp.Core/Cef.h b/CefSharp.Core/Cef.h deleted file mode 100644 index b16495a54a..0000000000 --- a/CefSharp.Core/Cef.h +++ /dev/null @@ -1,750 +0,0 @@ -// Copyright © 2013 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -#ifndef CEFSHARP_CORE_CEF_H_ -#define CEFSHARP_CORE_CEF_H_ - -#pragma once - -#include "Stdafx.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "Internals/CefSharpApp.h" -#include "Internals/PluginVisitor.h" -#include "Internals/CefTaskScheduler.h" -#include "Internals/CefRegisterCdmCallbackAdapter.h" -#include "CookieManager.h" -#include "AbstractCefSettings.h" -#include "RequestContext.h" - -using namespace System::Collections::Generic; -using namespace System::Linq; -using namespace System::Reflection; -using namespace msclr::interop; - -namespace CefSharp -{ - public ref class Cef sealed - { - private: - static Object^ _sync; - - static bool _initialized = false; - static HashSet^ _disposables; - static int _initializedThreadId; - static bool _multiThreadedMessageLoop = true; - - static Cef() - { - _sync = gcnew Object(); - _disposables = gcnew HashSet(); - } - - public: - - static property TaskFactory^ UIThreadTaskFactory; - static property TaskFactory^ IOThreadTaskFactory; - static property TaskFactory^ FileThreadTaskFactory; - - static void AddDisposable(IDisposable^ item) - { - msclr::lock l(_sync); - - _disposables->Add(item); - } - - static void RemoveDisposable(IDisposable^ item) - { - msclr::lock l(_sync); - - _disposables->Remove(item); - } - - /// Gets a value that indicates whether CefSharp is initialized. - /// true if CefSharp is initialized; otherwise, false. - static property bool IsInitialized - { - bool get() - { - return _initialized; - } - - private: - void set(bool value) - { - _initialized = value; - } - } - - /// Gets a value that indicates the version of CefSharp currently being used. - /// The CefSharp version. - static property String^ CefSharpVersion - { - String^ get() - { - Assembly^ assembly = Assembly::GetAssembly(Cef::typeid); - return assembly->GetName()->Version->ToString(); - } - } - - /// Gets a value that indicates the CEF version currently being used. - /// The CEF Version - static property String^ CefVersion - { - String^ get() - { - return String::Format("r{0}", CEF_VERSION); - } - } - - /// Gets a value that indicates the Chromium version currently being used. - /// The Chromium version. - static property String^ ChromiumVersion - { - String^ get() - { - // Need explicit cast here to avoid C4965 warning when the minor version is zero. - return String::Format("{0}.{1}.{2}.{3}", - CHROME_VERSION_MAJOR, (Object^)CHROME_VERSION_MINOR, - CHROME_VERSION_BUILD, CHROME_VERSION_PATCH); - } - } - - /// - /// Gets a value that indicates the Git Hash for CEF version currently being used. - /// - /// The Git Commit Hash - static property String^ CefCommitHash - { - String^ get() - { - return CEF_COMMIT_HASH; - } - } - - /// - /// Initializes CefSharp with user-provided settings. - /// It's important to note that Initialize and Shutdown MUST be called on your main - /// applicaiton thread (Typically the UI thead). If you call them on different - /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. - /// - /// CefSharp configuration settings. - /// true if successful; otherwise, false. - static bool Initialize(AbstractCefSettings^ cefSettings) - { - auto cefApp = gcnew DefaultApp(nullptr, cefSettings->CefCustomSchemes); - - return Initialize(cefSettings, false, cefApp); - } - - /// - /// Initializes CefSharp with user-provided settings. - /// It's important to note that Initialize/Shutdown MUST be called on your main - /// applicaiton thread (Typically the UI thead). If you call them on different - /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. - /// - /// CefSharp configuration settings. - /// Check that all relevant dependencies avaliable, throws exception if any are missing - /// The handler for functionality specific to the browser process. Null if you don't wish to handle these events - /// true if successful; otherwise, false. - static bool Initialize(AbstractCefSettings^ cefSettings, bool performDependencyCheck, IBrowserProcessHandler^ browserProcessHandler) - { - auto cefApp = gcnew DefaultApp(browserProcessHandler, cefSettings->CefCustomSchemes); - - return Initialize(cefSettings, performDependencyCheck, cefApp); - } - - /// - /// Initializes CefSharp with user-provided settings. - /// It's important to note that Initialize/Shutdown MUST be called on your main - /// applicaiton thread (Typically the UI thead). If you call them on different - /// threads, your application will hang. See the documentation for Cef.Shutdown() for more details. - /// - /// CefSharp configuration settings. - /// Check that all relevant dependencies avaliable, throws exception if any are missing - /// Implement this interface to provide handler implementations. Null if you don't wish to handle these events - /// true if successful; otherwise, false. - static bool Initialize(AbstractCefSettings^ cefSettings, bool performDependencyCheck, IApp^ cefApp) - { - if (IsInitialized) - { - // NOTE: Can only initialize Cef once, to make this explicitly clear throw exception on subsiquent attempts - throw gcnew Exception("CEF can only be initialized once per process. This is a limitation of the underlying " + - "CEF/Chromium framework. You can change many (not all) settings at runtime through RequestContext.SetPreference. " + - "See https://github.com/cefsharp/CefSharp/wiki/General-Usage#request-context-browser-isolation " + - "Use Cef.IsInitialized to guard against this exception. If you are seeing this unexpectedly then you are likely " + - "calling Cef.Initialize after you've created an instance of ChromiumWebBrowser, it must be before the first instance is created."); - } - - if (cefSettings->BrowserSubprocessPath == nullptr) - { - throw gcnew Exception("CefSettings BrowserSubprocessPath cannot be null."); - } - - if (performDependencyCheck) - { - DependencyChecker::AssertAllDependenciesPresent(cefSettings->Locale, cefSettings->LocalesDirPath, cefSettings->ResourcesDirPath, cefSettings->PackLoadingDisabled, cefSettings->BrowserSubprocessPath); - } - else if (!File::Exists(cefSettings->BrowserSubprocessPath)) - { - throw gcnew FileNotFoundException("CefSettings BrowserSubprocessPath not found.", cefSettings->BrowserSubprocessPath); - } - - UIThreadTaskFactory = gcnew TaskFactory(gcnew CefTaskScheduler(TID_UI)); - IOThreadTaskFactory = gcnew TaskFactory(gcnew CefTaskScheduler(TID_IO)); - FileThreadTaskFactory = gcnew TaskFactory(gcnew CefTaskScheduler(TID_FILE)); - - CefRefPtr app(new CefSharpApp(cefSettings, cefApp)); - CefMainArgs main_args; - - auto success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get(), NULL); - - _initialized = success; - _multiThreadedMessageLoop = cefSettings->MultiThreadedMessageLoop; - - _initializedThreadId = Thread::CurrentThread->ManagedThreadId; - - return success; - } - - /// - /// Run the CEF message loop. Use this function instead of an application- - /// provided message loop to get the best balance between performance and CPU - /// usage. This function should only be called on the main application thread and - /// only if Cef.Initialize() is called with a - /// CefSettings.MultiThreadedMessageLoop value of false. This function will - /// block until a quit message is received by the system. - /// - static void RunMessageLoop() - { - CefRunMessageLoop(); - } - - /// - /// Quit the CEF message loop that was started by calling Cef.RunMessageLoop(). - /// This function should only be called on the main application thread and only - /// if Cef.RunMessageLoop() was used. - /// - static void QuitMessageLoop() - { - CefQuitMessageLoop(); - } - - /// - /// Perform a single iteration of CEF message loop processing.This function is - /// provided for cases where the CEF message loop must be integrated into an - /// existing application message loop. Use of this function is not recommended - /// for most users; use CefSettings.MultiThreadedMessageLoop if possible (the deault). - /// When using this function care must be taken to balance performance - /// against excessive CPU usage. It is recommended to enable the - /// CefSettings.ExternalMessagePump option when using - /// this function so that IBrowserProcessHandler.OnScheduleMessagePumpWork() - /// callbacks can facilitate the scheduling process. This function should only be - /// called on the main application thread and only if Cef.Initialize() is called - /// with a CefSettings.MultiThreadedMessageLoop value of false. This function - /// will not block. - /// - static void DoMessageLoopWork() - { - CefDoMessageLoopWork(); - } - - /// - /// This function should be called from the application entry point function to execute a secondary process. - /// It can be used to run secondary processes from the browser client executable (default behavior) or - /// from a separate executable specified by the CefSettings.browser_subprocess_path value. - /// If called for the browser process (identified by no "type" command-line value) it will return immediately with a value of -1. - /// If called for a recognized secondary process it will block until the process should exit and then return the process exit code. - /// The |application| parameter may be empty. The |windows_sandbox_info| parameter is only used on Windows and may be NULL (see cef_sandbox_win.h for details). - /// - static int ExecuteProcess() - { - auto hInstance = Process::GetCurrentProcess()->Handle; - - CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer()); - //TODO: Look at ways to expose an instance of CefApp - //CefRefPtr app(new CefSharpApp(nullptr, nullptr)); - - return CefExecuteProcess(cefMainArgs, NULL, NULL); - } - - /// Add an entry to the cross-origin whitelist. - /// The origin allowed to be accessed by the target protocol/domain. - /// The target protocol allowed to access the source origin. - /// The optional target domain allowed to access the source origin. - /// If set to true would allow a blah.example.com if the - /// was set to example.com - /// - /// Returns false if is invalid or the whitelist cannot be accessed. - /// - /// The same-origin policy restricts how scripts hosted from different origins - /// (scheme + domain + port) can communicate. By default, scripts can only access - /// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes - /// (but no other schemes) can use the "Access-Control-Allow-Origin" header to - /// allow cross-origin requests. For example, https://source.example.com can make - /// XMLHttpRequest requests on http://target.example.com if the - /// http://target.example.com request returns an "Access-Control-Allow-Origin: - /// https://source.example.com" response header. - // - /// Scripts in separate frames or iframes and hosted from the same protocol and - /// domain suffix can execute cross-origin JavaScript if both pages set the - /// document.domain value to the same domain suffix. For example, - /// scheme://foo.example.com and scheme://bar.example.com can communicate using - /// JavaScript if both domains set document.domain="example.com". - // - /// This method is used to allow access to origins that would otherwise violate - /// the same-origin policy. Scripts hosted underneath the fully qualified - /// URL (like http://www.example.com) will be allowed access to - /// all resources hosted on the specified and . - /// If is non-empty and if false only - /// exact domain matches will be allowed. If contains a top- - /// level domain component (like "example.com") and is - /// true sub-domain matches will be allowed. If is empty and - /// if true all domains and IP addresses will be - /// allowed. - // - /// This method cannot be used to bypass the restrictions on local or display - /// isolated schemes. See the comments on for more - /// information. - /// - /// This function may be called on any thread. Returns false if - /// is invalid or the whitelist cannot be accessed. - /// - static bool AddCrossOriginWhitelistEntry( - String^ sourceOrigin, - String^ targetProtocol, - String^ targetDomain, - bool allowTargetSubdomains) - { - return CefAddCrossOriginWhitelistEntry( - StringUtils::ToNative(sourceOrigin), - StringUtils::ToNative(targetProtocol), - StringUtils::ToNative(targetDomain), - allowTargetSubdomains); - } - - /// Remove entry from cross-origin whitelist - /// The origin allowed to be accessed by the target protocol/domain. - /// The target protocol allowed to access the source origin. - /// The optional target domain allowed to access the source origin. - /// If set to true would allow a blah.example.com if the - /// was set to example.com - /// - /// - /// Remove an entry from the cross-origin access whitelist. Returns false if - /// is invalid or the whitelist cannot be accessed. - /// - static bool RemoveCrossOriginWhitelistEntry(String^ sourceOrigin, - String^ targetProtocol, - String^ targetDomain, - bool allowTargetSubdomains) - - { - return CefRemoveCrossOriginWhitelistEntry( - StringUtils::ToNative(sourceOrigin), - StringUtils::ToNative(targetProtocol), - StringUtils::ToNative(targetDomain), - allowTargetSubdomains); - } - - /// Remove all entries from the cross-origin access whitelist. - /// - /// Remove all entries from the cross-origin access whitelist. Returns false if - /// the whitelist cannot be accessed. - /// - static bool ClearCrossOriginWhitelist() - { - return CefClearCrossOriginWhitelist(); - } - - /// - /// Returns the global cookie manager. By default data will be stored at CefSettings.CachePath if specified or in memory otherwise. - /// Using this method is equivalent to calling Cef.GetGlobalRequestContext().GetDefaultCookieManager() - /// The earlier possible place to access the ICookieManager is in IBrowserProcessHandler.OnContextInitialized. - /// Alternative use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events. - /// - /// A the global cookie manager or null if the RequestContext has not yet been initialized. - static ICookieManager^ GetGlobalCookieManager() - { - auto cookieManager = CefCookieManager::GetGlobalManager(NULL); - if (cookieManager.get()) - { - return gcnew CookieManager(cookieManager); - } - - return nullptr; - } - - /// - /// Returns a cookie manager that neither stores nor retrieves cookies. All - /// usage of cookies will be blocked including cookies accessed via the network - /// (request/response headers), via JavaScript (document.cookie), and via - /// CefCookieManager methods. No cookies will be displayed in DevTools. If you - /// wish to only block cookies sent via the network use the IRequestHandler - /// CanGetCookies and CanSetCookie methods instead. - /// - /// A blocking cookie manager - static ICookieManager^ GetBlockingCookieManager() - { - auto cookieManager = CefCookieManager::GetBlockingManager(); - if (cookieManager.get()) - { - return gcnew CookieManager(cookieManager); - } - - return nullptr; - } - - /// - /// Shuts down CefSharp and the underlying CEF infrastructure. This method is safe to call multiple times; it will only - /// shut down CEF on the first call (all subsequent calls will be ignored). - /// This method should be called on the main application thread to shut down the CEF browser process before the application exits. - /// If you are Using CefSharp.OffScreen then you must call this explicitly before your application exits or it will hang. - /// This method must be called on the same thread as Initialize. If you don't call Shutdown explicitly then CefSharp.Wpf and CefSharp.WinForms - /// versions will do their best to call Shutdown for you, if your application is having trouble closing then call thus explicitly. - /// - static void Shutdown() - { - if (IsInitialized) - { - msclr::lock l(_sync); - - if (IsInitialized) - { - if (_initializedThreadId != Thread::CurrentThread->ManagedThreadId) - { - throw gcnew Exception("Cef.Shutdown must be called on the same thread that Cef.Initialize was called - typically your UI thread. " + - "If you called Cef.Initialize on a Thread other than the UI thread then you will need to call Cef.Shutdown on the same thread. " + - "Cef.Initialize was called on ManagedThreadId: " + _initializedThreadId + "where Cef.Shutdown is being called on " + - "ManagedThreadId: " + Thread::CurrentThread->ManagedThreadId); - } - - UIThreadTaskFactory = nullptr; - IOThreadTaskFactory = nullptr; - FileThreadTaskFactory = nullptr; - - for each(IDisposable^ diposable in Enumerable::ToList(_disposables)) - { - delete diposable; - } - - GC::Collect(); - GC::WaitForPendingFinalizers(); - - if (!_multiThreadedMessageLoop) - { - // We need to run the message pump until it is idle. However we don't have - // that information here so we run the message loop "for a while". - // See https://github.com/cztomczak/cefpython/issues/245 for an excellent description - for (int i = 0; i < 10; i++) - { - DoMessageLoopWork(); - - // Sleep to allow the CEF proc to do work. - Sleep(50); - } - } - - CefShutdown(); - IsInitialized = false; - } - } - } - - /// - /// This method should only be used by advanced users, if you're unsure then use Cef.Shutdown(). - /// This function should be called on the main application thread to shut down - /// the CEF browser process before the application exits. This method simply obtains a lock - /// and calls the native CefShutdown method, only IsInitialized is checked. All ChromiumWebBrowser - /// instances MUST be Disposed of before calling this method. If calling this method results in a crash - /// or hangs then you're likely hanging on to some unmanaged resources or haven't closed all of your browser - /// instances - /// - static void ShutdownWithoutChecks() - { - if (IsInitialized) - { - msclr::lock l(_sync); - - if (IsInitialized) - { - CefShutdown(); - IsInitialized = false; - } - } - } - - /// - /// Clear all scheme handler factories registered with the global request context. - /// Returns false on error. This function may be called on any thread in the browser process. - /// Using this function is equivalent to calling Cef.GetGlobalRequestContext().ClearSchemeHandlerFactories(). - /// - /// Returns false on error. - static bool ClearSchemeHandlerFactories() - { - return CefClearSchemeHandlerFactories(); - } - - /// - /// Visit web plugin information. Can be called on any thread in the browser process. - /// - static void VisitWebPluginInfo(IWebPluginInfoVisitor^ visitor) - { - CefVisitWebPluginInfo(new PluginVisitor(visitor)); - } - - /// - /// Async returns a list containing Plugin Information - /// (Wrapper around CefVisitWebPluginInfo) - /// - /// Returns List of structs. - static Task^>^ GetPlugins() - { - auto taskVisitor = gcnew TaskWebPluginInfoVisitor(); - CefRefPtr visitor = new PluginVisitor(taskVisitor); - - CefVisitWebPluginInfo(visitor); - - return taskVisitor->Task; - } - - /// - /// Cause the plugin list to refresh the next time it is accessed regardless of whether it has already been loaded. - /// - static void RefreshWebPlugins() - { - CefRefreshWebPlugins(); - } - - /// - /// Unregister an internal plugin. This may be undone the next time RefreshWebPlugins() is called. - /// - /// Path (directory + file). - static void UnregisterInternalWebPlugin(String^ path) - { - CefUnregisterInternalWebPlugin(StringUtils::ToNative(path)); - } - - /// - /// Call during process startup to enable High-DPI support on Windows 7 or newer. - /// Older versions of Windows should be left DPI-unaware because they do not - /// support DirectWrite and GDI fonts are kerned very badly. - /// - static void EnableHighDPISupport() - { - CefEnableHighDPISupport(); - } - - /// - /// Returns true if called on the specified CEF thread. - /// - /// Returns true if called on the specified thread. - static bool CurrentlyOnThread(CefThreadIds threadId) - { - return CefCurrentlyOn((CefThreadId)threadId); - } - - /// - /// Gets the Global Request Context. Make sure to Dispose of this object when finished. - /// The earlier possible place to access the IRequestContext is in IBrowserProcessHandler.OnContextInitialized. - /// Alternative use the ChromiumWebBrowser BrowserInitialized (OffScreen) or IsBrowserInitializedChanged (WinForms/WPF) events. - /// - /// Returns the global request context or null if the RequestContext has not been initialized yet. - static IRequestContext^ GetGlobalRequestContext() - { - auto context = CefRequestContext::GetGlobalContext(); - - if (context.get()) - { - return gcnew RequestContext(context); - } - - return nullptr; - } - - /// - /// Helper function (wrapper around the CefColorSetARGB macro) which combines - /// the 4 color components into an uint32 for use with BackgroundColor property - /// - /// Alpha - /// Red - /// Green - /// Blue - /// Returns the color. - static uint32 ColorSetARGB(uint32 a, uint32 r, uint32 g, uint32 b) - { - return CefColorSetARGB(a, r, g, b); - } - - /// - /// Crash reporting is configured using an INI-style config file named - /// crash_reporter.cfg. This file must be placed next to - /// the main application executable. File contents are as follows: - /// - /// # Comments start with a hash character and must be on their own line. - /// - /// [Config] - /// ProductName=<Value of the "prod" crash key; defaults to "cef"> - /// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version> - /// AppName=<Windows only; App-specific folder name component for storing crash - /// information; default to "CEF"> - /// ExternalHandler=<Windows only; Name of the external handler exe to use - /// instead of re-launching the main exe; default to empty> - /// ServerURL=<crash server URL; default to empty> - /// RateLimitEnabled=<True if uploads should be rate limited; default to true> - /// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; - /// default to 5> - /// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value - /// will cause older reports to be deleted; default to 20> - /// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; - /// default to 5> - /// - /// [CrashKeys] - /// my_key1=<small|medium|large> - /// my_key2=<small|medium|large> - /// - /// Config section: - /// - /// If "ProductName" and/or "ProductVersion" are set then the specified values - /// will be included in the crash dump metadata. - /// - /// If "AppName" is set on Windows then crash report information (metrics, - /// database and dumps) will be stored locally on disk under the - /// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. - /// - /// If "ExternalHandler" is set on Windows then the specified exe will be - /// launched as the crashpad-handler instead of re-launching the main process - /// exe. The value can be an absolute path or a path relative to the main exe - /// directory. - /// - /// If "ServerURL" is set then crashes will be uploaded as a multi-part POST - /// request to the specified URL. Otherwise, reports will only be stored locally - /// on disk. - /// - /// If "RateLimitEnabled" is set to true then crash report uploads will be rate - /// limited as follows: - /// 1. If "MaxUploadsPerDay" is set to a positive value then at most the - /// specified number of crashes will be uploaded in each 24 hour period. - /// 2. If crash upload fails due to a network or server error then an - /// incremental backoff delay up to a maximum of 24 hours will be applied for - /// retries. - /// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the - /// "MaxUploadsPerDay" value will be reduced to 1 until the client is - /// restarted. This helps to avoid an upload flood when the network or - /// server error is resolved. - /// - /// If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage - /// on disk will be limited to that size in megabytes. For example, on Windows - /// each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to - /// about 34 crash reports stored on disk. - /// - /// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older - /// than the specified age in days will be deleted. - /// - /// CrashKeys section: - /// - /// Any number of crash keys can be specified for use by the application. Crash - /// key values will be truncated based on the specified size (small = 63 bytes, - /// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set - /// from any thread or process using the Cef.SetCrashKeyValue function. These - /// key/value pairs will be sent to the crash server along with the crash dump - /// file. Medium and large values will be chunked for submission. For example, - /// if your key is named "mykey" then the value will be broken into ordered - /// chunks and submitted using keys named "mykey-1", "mykey-2", etc. - /// - /// Returns true if crash reporting is enabled. - static property bool CrashReportingEnabled - { - bool get() - { - return CefCrashReportingEnabled(); - } - } - - /// - /// Sets or clears a specific key-value pair from the crash metadata. - /// - static void SetCrashKeyValue(String^ key, String^ value) - { - CefSetCrashKeyValue(StringUtils::ToNative(key), StringUtils::ToNative(value)); - } - - /// - /// Register the Widevine CDM plugin. - /// - /// The client application is responsible for downloading an appropriate - /// platform-specific CDM binary distribution from Google, extracting the - /// contents, and building the required directory structure on the local machine. - /// The method class can be used - /// to implement this functionality in CefSharp. Contact Google via - /// https://www.widevine.com/contact.html for details on CDM download. - /// - /// - /// path is a directory that must contain the following files: - /// 1. manifest.json file from the CDM binary distribution (see below). - /// 2. widevinecdm file from the CDM binary distribution (e.g. - /// widevinecdm.dll on Windows). - /// 3. widevidecdmadapter file from the CEF binary distribution (e.g. - /// widevinecdmadapter.dll on Windows). - /// - /// If any of these files are missing or if the manifest file has incorrect - /// contents the registration will fail and callback will receive an ErrorCode - /// value of . - /// - /// The manifest.json file must contain the following keys: - /// A. "os": Supported OS (e.g. "mac", "win" or "linux"). - /// B. "arch": Supported architecture (e.g. "ia32" or "x64"). - /// C. "x-cdm-module-versions": Module API version (e.g. "4"). - /// D. "x-cdm-interface-versions": Interface API version (e.g. "8"). - /// E. "x-cdm-host-versions": Host API version (e.g. "8"). - /// F. "version": CDM version (e.g. "1.4.8.903"). - /// G. "x-cdm-codecs": List of supported codecs (e.g. "vp8,vp9.0,avc1"). - /// - /// A through E are used to verify compatibility with the current Chromium - /// version. If the CDM is not compatible the registration will fail and - /// callback will receive an ErrorCode value of . - /// - /// If registration is not supported at the time that Cef.RegisterWidevineCdm() is called then callback - /// will receive an ErrorCode value of . - /// - /// is a directory that contains the Widevine CDM files - /// optional callback - - /// will be executed asynchronously once registration is complete - static void RegisterWidevineCdm(String^ path, [Optional] IRegisterCdmCallback^ callback) - { - CefRefPtr adapter = NULL; - - if (callback != nullptr) - { - adapter = new CefRegisterCdmCallbackAdapter(callback); - } - - CefRegisterWidevineCdm(StringUtils::ToNative(path), adapter); - } - - /// - /// Register the Widevine CDM plugin. - /// - /// See for more details. - /// - /// is a directory that contains the Widevine CDM files - /// Returns a Task that can be awaited to receive the response. - static Task^ RegisterWidevineCdmAsync(String^ path) - { - auto callback = gcnew TaskRegisterCdmCallback(); - - RegisterWidevineCdm(path, callback); - - return callback->Task; - } - }; -} -#endif // CEFSHARP_CORE_CEF_H_ diff --git a/CefSharp.Core/CefSettingsBase.cs b/CefSharp.Core/CefSettingsBase.cs new file mode 100644 index 0000000000..f53bead39f --- /dev/null +++ b/CefSharp.Core/CefSettingsBase.cs @@ -0,0 +1,438 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +//NOTE:Classes in the CefSharp.Core namespace have been hidden from intellisnse so users don't use them directly + +using CefSharp.Internals; +using System; +using System.Collections.Generic; + +namespace CefSharp +{ + /// + /// Initialization settings. Many of these and other settings can also configured using command-line switches. + /// WPF/WinForms/OffScreen each have their own CefSettings implementation that sets + /// relevant settings e.g. OffScreen starts with audio muted. + /// + public abstract class CefSettingsBase : IDisposable + { + private bool disposed = false; + internal Core.CefSettingsBase settings = new Core.CefSettingsBase(); + +#if NETCOREAPP + public CefSettingsBase() : base() + { + if(!System.IO.File.Exists(BrowserSubprocessPath)) + { + if(Initializer.LibCefLoaded) + { + BrowserSubprocessPath = Initializer.BrowserSubProcessPath; + } + } + } +#endif + /// + /// Free the unmanaged CefSettingsBase instance. + /// Under normal circumstances you shouldn't need to call this + /// The unmanaged resource will be freed after (or one of the overloads) is called. + /// + public void Dispose() + { + disposed = true; + settings = null; + } + + /// + /// Gets a value indicating if the CefSettings has been disposed. + /// + public bool IsDisposed + { + get { return disposed; } + } + + /// + /// Add Customs schemes to this collection. + /// + public IEnumerable CefCustomSchemes + { + get { return settings.CefCustomSchemes; } + } + + /// + /// Add custom command line argumens to this collection, they will be added in OnBeforeCommandLineProcessing. The + /// CefSettings.CommandLineArgsDisabled value can be used to start with an empty command-line object. Any values specified in + /// CefSettings that equate to command-line arguments will be set before this method is called. + /// + public CommandLineArgDictionary CefCommandLineArgs + { + get { return settings.CefCommandLineArgs; } + } + + /// + /// Set to true to disable configuration of browser process features using standard CEF and Chromium command-line arguments. + /// Configuration can still be specified using CEF data structures or by adding to CefCommandLineArgs. + /// + public bool CommandLineArgsDisabled + { + get { return settings.CommandLineArgsDisabled; } + set { settings.CommandLineArgsDisabled = value; } + } + + /// + /// Set to true to control browser process main (UI) thread message pump scheduling via the + /// IBrowserProcessHandler.OnScheduleMessagePumpWork callback. This option is recommended for use in combination with the + /// Cef.DoMessageLoopWork() function in cases where the CEF message loop must be integrated into an existing application message + /// loop (see additional comments and warnings on Cef.DoMessageLoopWork). Enabling this option is not recommended for most users; + /// leave this option disabled and use either MultiThreadedMessageLoop (the default) if possible. + /// + public bool ExternalMessagePump + { + get { return settings.ExternalMessagePump; } + set { settings.ExternalMessagePump = value; } + } + + /// + /// Set to true to have the browser process message loop run in a separate thread. If false then the CefDoMessageLoopWork() + /// function must be called from your application message loop. This option is only supported on Windows. The default value is + /// true. + /// + public bool MultiThreadedMessageLoop + { + get { return settings.MultiThreadedMessageLoop; } + set { settings.MultiThreadedMessageLoop = value; } + } + + /// + /// The path to a separate executable that will be launched for sub-processes. By default the browser process executable is used. + /// See the comments on Cef.ExecuteProcess() for details. If this value is non-empty then it must be an absolute path. + /// Also configurable using the "browser-subprocess-path" command-line switch. + /// Defaults to using the provided CefSharp.BrowserSubprocess.exe instance + /// + public string BrowserSubprocessPath + { + get { return settings.BrowserSubprocessPath; } + set { settings.BrowserSubprocessPath = value; } + } + + /// + /// The directory where data for the global browser cache will be stored on disk. + /// If this value is non-empty then it must be an absolute path that is either equal to or a child directory + /// of . If this value is empty then browsers will be created in "incognito mode" + /// where in-memory caches are used for storage and no profile-specific data is persisted to disk + /// (installation-specific data will still be persisted in ). HTML5 databases + /// such as localStorage will only persist across sessions if a cache path is specified. + /// Can be overridden for individual RequestContext instances via the value. + /// Any child directory value will be ignored and the "default" profile (also a child directory) will be used + /// instead. + /// + public string CachePath + { + get { return settings.CachePath; } + set { settings.CachePath = value; } + } + + /// + /// The root directory for installation-specific data and the parent directory for profile-specific data. + /// All and values must have this parent directory + /// in common. If this value is empty and is non-empty then it will default to the + /// value. Any non-empty value must be an absolute path. If both values are empty then + /// the default platform-specific directory will be used ("AppData\Local\CEF\User Data" directory under the user + /// profile directory on Windows). + /// + /// **Use of the default directory is not recommended in production applications(see below).** + /// + /// Multiple application instances writing to the same RootCachePath directory could result in data corruption. + /// A process singleton lock based on the RootCachePath value is therefore used to protect against this. + /// This singleton behavior applies to all CEF-based applications using version 120 or newer. + /// You should customize RootCachePath for your application and implement , + /// which will then be called on any app relaunch with the same RootCachePath value. + /// + /// Failure to set the RootCachePath value correctly may result in startup crashes or other unexpected behaviors + /// + public string RootCachePath + { + get { return settings.RootCachePath; } + set { settings.RootCachePath = value; } + } + + /// + /// Set to true in order to completely ignore SSL certificate errors. This is NOT recommended. + /// + public bool IgnoreCertificateErrors + { + get { return settings.CefCommandLineArgs.ContainsKey("ignore-certificate-errors"); } + set + { + if(value) + { + if (!settings.CefCommandLineArgs.ContainsKey("ignore-certificate-errors")) + { + settings.CefCommandLineArgs.Add("ignore-certificate-errors"); + } + } + else + { + if(settings.CefCommandLineArgs.ContainsKey("ignore-certificate-errors")) + { + settings.CefCommandLineArgs.Remove("ignore-certificate-errors"); + } + } + } + } + + /// + /// The locale string that will be passed to WebKit. If empty the default locale of "en-US" will be used. Also configurable using + /// the "lang" command-line switch. + /// + public string Locale + { + get { return settings.Locale; } + set { settings.Locale = value; } + } + + /// + /// The fully qualified path for the locales directory. If this value is empty the locales directory must be located in the + /// module directory. If this value is non-empty then it must be an absolute path. Also configurable using the "locales-dir-path" + /// command-line switch. + /// + public string LocalesDirPath + { + get { return settings.LocalesDirPath; } + set { settings.LocalesDirPath = value; } + } + + /// + /// The fully qualified path for the resources directory. If this value is empty the cef.pak and/or devtools_resources.pak files + /// must be located in the module directory. Also configurable using the "resources-dir-path" command-line switch. + /// + public string ResourcesDirPath + { + get { return settings.ResourcesDirPath; } + set { settings.ResourcesDirPath = value; } + } + + /// + /// The directory and file name to use for the debug log. If empty a default log file name and location will be used. On Windows + /// a "debug.log" file will be written in the main executable directory. Also configurable using the"log-file" command- line + /// switch. + /// + public string LogFile + { + get { return settings.LogFile; } + set { settings.LogFile = value; } + } + + /// + /// The log severity. Only messages of this severity level or higher will be logged. When set to + /// no messages will be written to the log file, but Fatal messages will still be + /// output to stderr. Also configurable using the "log-severity" command-line switch with a value of "verbose", "info", "warning", + /// "error", "fatal", "error-report" or "disable". + /// + public CefSharp.LogSeverity LogSeverity + { + get { return settings.LogSeverity; } + set { settings.LogSeverity = value; } + } + + /// + /// Custom flags that will be used when initializing the V8 JavaScript engine. The consequences of using custom flags may not be + /// well tested. Also configurable using the "js-flags" command-line switch. + /// + public string JavascriptFlags + { + get { return settings.JavascriptFlags; } + set { settings.JavascriptFlags = value; } + } + + /// + /// Value that will be inserted as the product portion of the default User-Agent string. If empty the Chromium product version + /// will be used. If UserAgent is specified this value will be ignored. Also configurable using the "user-agent-product" command- + /// line switch. + /// + public string UserAgentProduct + { + get { return settings.UserAgentProduct; } + set { settings.UserAgentProduct = value; } + } + + /// + /// Set to a value between 1024 and 65535 to enable remote debugging on the specified port. For example, if 8080 is specified the + /// remote debugging URL will be http://localhost:8080. CEF can be remotely debugged from any CEF or Chrome browser window. Also + /// configurable using the "remote-debugging-port" command-line switch. + /// + public int RemoteDebuggingPort + { + get { return settings.RemoteDebuggingPort; } + set { settings.RemoteDebuggingPort = value; } + } + + /// + /// The number of stack trace frames to capture for uncaught exceptions. Specify a positive value to enable the + /// CefRenderProcessHandler. OnUncaughtException() callback. Specify 0 (default value) and OnUncaughtException() will not be + /// called. Also configurable using the "uncaught-exception-stack-size" command-line switch. + /// + public int UncaughtExceptionStackSize + { + get { return settings.UncaughtExceptionStackSize; } + set { settings.UncaughtExceptionStackSize = value; } + } + + /// + /// Value that will be returned as the User-Agent HTTP header. If empty the default User-Agent string will be used. Also + /// configurable using the "user-agent" command-line switch. + /// + public string UserAgent + { + get { return settings.UserAgent; } + set { settings.UserAgent = value; } + } + + /// + /// Set to true (1) to enable windowless (off-screen) rendering support. Do not enable this value if the application does not use + /// windowless rendering as it may reduce rendering performance on some systems. + /// + public bool WindowlessRenderingEnabled + { + get { return settings.WindowlessRenderingEnabled; } + set { settings.WindowlessRenderingEnabled = value; } + } + + /// + /// To persist session cookies (cookies without an expiry date or validity interval) by default when using the global cookie + /// manager set this value to true. Session cookies are generally intended to be transient and most Web browsers do not persist + /// them. A CachePath value must also be specified to enable this feature. Also configurable using the "persist-session-cookies" + /// command-line switch. Can be overridden for individual RequestContext instances via the + /// RequestContextSettings.PersistSessionCookies value. + /// + public bool PersistSessionCookies + { + get { return settings.PersistSessionCookies; } + set { settings.PersistSessionCookies = value; } + } + + /// + /// Comma delimited ordered list of language codes without any whitespace that will be used in the "Accept-Language" HTTP header. + /// May be set globally using the CefSettings.AcceptLanguageList value. If both values are empty then "en-US,en" will be used. + /// + /// + public string AcceptLanguageList + { + get { return settings.AcceptLanguageList; } + set { settings.AcceptLanguageList = value; } + } + + /// + /// Background color used for the browser before a document is loaded and when no document color is specified. The alpha + /// component must be either fully opaque (0xFF) or fully transparent (0x00). If the alpha component is fully opaque then the RGB + /// components will be used as the background color. If the alpha component is fully transparent for a WinForms browser then the + /// default value of opaque white be used. If the alpha component is fully transparent for a windowless (WPF/OffScreen) browser + /// then transparent painting will be enabled. + /// + public UInt32 BackgroundColor + { + get { return settings.BackgroundColor; } + set { settings.BackgroundColor = value; } + } + + /// + /// Comma delimited list of schemes supported by the associated + /// ICookieManager. If CookieableSchemesExcludeDefaults is false the + /// default schemes ("http", "https", "ws" and "wss") will also be supported. + /// Specifying a CookieableSchemesList value and setting + /// CookieableSchemesExcludeDefaults to true will disable all loading + /// and saving of cookies for this manager. Can be overridden + /// for individual RequestContext instances via the + /// RequestContextSettings.CookieableSchemesList and + /// RequestContextSettings.CookieableSchemesExcludeDefaults values. + /// + public string CookieableSchemesList + { + get { return settings.CookieableSchemesList; } + set { settings.CookieableSchemesList = value; } + } + + /// + /// If CookieableSchemesExcludeDefaults is false the + /// default schemes ("http", "https", "ws" and "wss") will also be supported. + /// Specifying a CookieableSchemesList value and setting + /// CookieableSchemesExcludeDefaults to true will disable all loading + /// and saving of cookies for this manager. Can be overridden + /// for individual RequestContext instances via the + /// RequestContextSettings.CookieableSchemesList and + /// RequestContextSettings.CookieableSchemesExcludeDefaults values. + /// + public bool CookieableSchemesExcludeDefaults + { + get { return settings.CookieableSchemesExcludeDefaults; } + set { settings.CookieableSchemesExcludeDefaults = value; } + } + + /// + /// The Chrome policy ID. This value is used to configure chrome enterprise policies. + /// + public string ChromePolicyId + { + get { return settings.ChromePolicyId; } + set { settings.ChromePolicyId = value; } + } + + /// + /// Registers a custom scheme using the provided settings. + /// + /// The CefCustomScheme which provides the details about the scheme. + public void RegisterScheme(CefCustomScheme scheme) + { + settings.RegisterScheme(scheme); + } + + /// + /// Set command line argument to disable GPU Acceleration. WebGL will use + /// software rendering + /// + public void DisableGpuAcceleration() + { + if (!settings.CefCommandLineArgs.ContainsKey("disable-gpu")) + { + settings.CefCommandLineArgs.Add("disable-gpu"); + } + } + + /// + /// Set command line argument to enable Print Preview See + /// https://github.com/chromiumembedded/cef/issues/123/add-support-for-print-preview for details. + /// + public void EnablePrintPreview() + { + if (!settings.CefCommandLineArgs.ContainsKey("enable-print-preview")) + { + settings.CefCommandLineArgs.Add("enable-print-preview"); + } + } + + /// + /// Use software rendering and compositing (disable GPU) for increased FPS + /// and decreased CPU usage. This will also disable WebGL so don't use this + /// method if you need that capability. + /// + /// + /// Sets the --disable-gpu and --disable-gpu-compositing command line args + /// + public void SetOffScreenRenderingBestPerformanceArgs() + { + // Use software rendering and compositing (disable GPU) for increased FPS + // and decreased CPU usage. This will also disable WebGL so remove these + // switches if you need that capability. + // See https://github.com/chromiumembedded/cef/issues/1257 for details. + if (!settings.CefCommandLineArgs.ContainsKey("disable-gpu")) + { + settings.CefCommandLineArgs.Add("disable-gpu"); + } + + if (!settings.CefCommandLineArgs.ContainsKey("disable-gpu-compositing")) + { + settings.CefCommandLineArgs.Add("disable-gpu-compositing"); + } + } + } +} diff --git a/CefSharp.Core/CefSharp.Core.csproj b/CefSharp.Core/CefSharp.Core.csproj new file mode 100644 index 0000000000..f18fe1dd49 --- /dev/null +++ b/CefSharp.Core/CefSharp.Core.csproj @@ -0,0 +1,56 @@ + + + net462 + Library + CefSharp + false + MinimumRecommendedRules.ruleset + true + ..\CefSharp.snk + AnyCPU + + false + + + full + + + bin\Release\CefSharp.Core.XML + true + true + pdbonly + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Core/CefSharp.Core.netcore.csproj b/CefSharp.Core/CefSharp.Core.netcore.csproj new file mode 100644 index 0000000000..227aee5cee --- /dev/null +++ b/CefSharp.Core/CefSharp.Core.netcore.csproj @@ -0,0 +1,78 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + net6.0 + CefSharp.Core + CefSharp.Core + $(BaseOutputPath)$(PlatformTarget)$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + CS1591,CS0436 + 9.0 + + + + true + true + True + embedded + + + + DEBUG;TRACE;NETCOREAPP + + + + TRACE;NETCOREAPP + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + false + + + false + + + + + \ No newline at end of file diff --git a/CefSharp.Core/DevTools/DevToolsClient.Generated.cs b/CefSharp.Core/DevTools/DevToolsClient.Generated.cs new file mode 100644 index 0000000000..b593ec37f4 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsClient.Generated.cs @@ -0,0 +1,70926 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// +// **This code was generated by a tool, do not change directly** +// CHROMIUM VERSION 146.0.7680.165 +using System.Runtime.Serialization; + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// Enum of possible property types. + /// + public enum AXValueType + { + /// + /// boolean + /// + [EnumMember(Value = ("boolean"))] + Boolean, + /// + /// tristate + /// + [EnumMember(Value = ("tristate"))] + Tristate, + /// + /// booleanOrUndefined + /// + [EnumMember(Value = ("booleanOrUndefined"))] + BooleanOrUndefined, + /// + /// idref + /// + [EnumMember(Value = ("idref"))] + Idref, + /// + /// idrefList + /// + [EnumMember(Value = ("idrefList"))] + IdrefList, + /// + /// integer + /// + [EnumMember(Value = ("integer"))] + Integer, + /// + /// node + /// + [EnumMember(Value = ("node"))] + Node, + /// + /// nodeList + /// + [EnumMember(Value = ("nodeList"))] + NodeList, + /// + /// number + /// + [EnumMember(Value = ("number"))] + Number, + /// + /// string + /// + [EnumMember(Value = ("string"))] + String, + /// + /// computedString + /// + [EnumMember(Value = ("computedString"))] + ComputedString, + /// + /// token + /// + [EnumMember(Value = ("token"))] + Token, + /// + /// tokenList + /// + [EnumMember(Value = ("tokenList"))] + TokenList, + /// + /// domRelation + /// + [EnumMember(Value = ("domRelation"))] + DomRelation, + /// + /// role + /// + [EnumMember(Value = ("role"))] + Role, + /// + /// internalRole + /// + [EnumMember(Value = ("internalRole"))] + InternalRole, + /// + /// valueUndefined + /// + [EnumMember(Value = ("valueUndefined"))] + ValueUndefined + } + + /// + /// Enum of possible property sources. + /// + public enum AXValueSourceType + { + /// + /// attribute + /// + [EnumMember(Value = ("attribute"))] + Attribute, + /// + /// implicit + /// + [EnumMember(Value = ("implicit"))] + Implicit, + /// + /// style + /// + [EnumMember(Value = ("style"))] + Style, + /// + /// contents + /// + [EnumMember(Value = ("contents"))] + Contents, + /// + /// placeholder + /// + [EnumMember(Value = ("placeholder"))] + Placeholder, + /// + /// relatedElement + /// + [EnumMember(Value = ("relatedElement"))] + RelatedElement + } + + /// + /// Enum of possible native property sources (as a subtype of a particular AXValueSourceType). + /// + public enum AXValueNativeSourceType + { + /// + /// description + /// + [EnumMember(Value = ("description"))] + Description, + /// + /// figcaption + /// + [EnumMember(Value = ("figcaption"))] + Figcaption, + /// + /// label + /// + [EnumMember(Value = ("label"))] + Label, + /// + /// labelfor + /// + [EnumMember(Value = ("labelfor"))] + Labelfor, + /// + /// labelwrapped + /// + [EnumMember(Value = ("labelwrapped"))] + Labelwrapped, + /// + /// legend + /// + [EnumMember(Value = ("legend"))] + Legend, + /// + /// rubyannotation + /// + [EnumMember(Value = ("rubyannotation"))] + Rubyannotation, + /// + /// tablecaption + /// + [EnumMember(Value = ("tablecaption"))] + Tablecaption, + /// + /// title + /// + [EnumMember(Value = ("title"))] + Title, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other + } + + /// + /// A single source for a computed AX property. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AXValueSource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// What type of source this is. + /// + public CefSharp.DevTools.Accessibility.AXValueSourceType Type + { + get + { + return (CefSharp.DevTools.Accessibility.AXValueSourceType)(StringToEnum(typeof(CefSharp.DevTools.Accessibility.AXValueSourceType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// What type of source this is. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// The value of this property source. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public CefSharp.DevTools.Accessibility.AXValue Value + { + get; + set; + } + + /// + /// The name of the relevant attribute, if any. + /// + [DataMember(Name = ("attribute"), IsRequired = (false))] + public string Attribute + { + get; + set; + } + + /// + /// The value of the relevant attribute, if any. + /// + [DataMember(Name = ("attributeValue"), IsRequired = (false))] + public CefSharp.DevTools.Accessibility.AXValue AttributeValue + { + get; + set; + } + + /// + /// Whether this source is superseded by a higher priority source. + /// + [DataMember(Name = ("superseded"), IsRequired = (false))] + public bool? Superseded + { + get; + set; + } + + /// + /// The native markup source for this value, e.g. a `<label>` element. + /// + public CefSharp.DevTools.Accessibility.AXValueNativeSourceType? NativeSource + { + get + { + return (CefSharp.DevTools.Accessibility.AXValueNativeSourceType? )(StringToEnum(typeof(CefSharp.DevTools.Accessibility.AXValueNativeSourceType? ), nativeSource)); + } + + set + { + this.nativeSource = (EnumToString(value)); + } + } + + /// + /// The native markup source for this value, e.g. a `<label>` element. + /// + [DataMember(Name = ("nativeSource"), IsRequired = (false))] + internal string nativeSource + { + get; + set; + } + + /// + /// The value, such as a node or node list, of the native source. + /// + [DataMember(Name = ("nativeSourceValue"), IsRequired = (false))] + public CefSharp.DevTools.Accessibility.AXValue NativeSourceValue + { + get; + set; + } + + /// + /// Whether the value for this property is invalid. + /// + [DataMember(Name = ("invalid"), IsRequired = (false))] + public bool? Invalid + { + get; + set; + } + + /// + /// Reason for the value being invalid, if it is. + /// + [DataMember(Name = ("invalidReason"), IsRequired = (false))] + public string InvalidReason + { + get; + set; + } + } + + /// + /// AXRelatedNode + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AXRelatedNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The BackendNodeId of the related DOM node. + /// + [DataMember(Name = ("backendDOMNodeId"), IsRequired = (true))] + public int BackendDOMNodeId + { + get; + set; + } + + /// + /// The IDRef value provided, if any. + /// + [DataMember(Name = ("idref"), IsRequired = (false))] + public string Idref + { + get; + set; + } + + /// + /// The text alternative of this node in the current context. + /// + [DataMember(Name = ("text"), IsRequired = (false))] + public string Text + { + get; + set; + } + } + + /// + /// AXProperty + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AXProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The name of this property. + /// + public CefSharp.DevTools.Accessibility.AXPropertyName Name + { + get + { + return (CefSharp.DevTools.Accessibility.AXPropertyName)(StringToEnum(typeof(CefSharp.DevTools.Accessibility.AXPropertyName), name)); + } + + set + { + this.name = (EnumToString(value)); + } + } + + /// + /// The name of this property. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + internal string name + { + get; + set; + } + + /// + /// The value of this property. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public CefSharp.DevTools.Accessibility.AXValue Value + { + get; + set; + } + } + + /// + /// A single computed AX property. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AXValue : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The type of this value. + /// + public CefSharp.DevTools.Accessibility.AXValueType Type + { + get + { + return (CefSharp.DevTools.Accessibility.AXValueType)(StringToEnum(typeof(CefSharp.DevTools.Accessibility.AXValueType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// The type of this value. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// The computed value of this property. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public object Value + { + get; + set; + } + + /// + /// One or more related nodes, if applicable. + /// + [DataMember(Name = ("relatedNodes"), IsRequired = (false))] + public System.Collections.Generic.IList RelatedNodes + { + get; + set; + } + + /// + /// The sources which contributed to the computation of this property. + /// + [DataMember(Name = ("sources"), IsRequired = (false))] + public System.Collections.Generic.IList Sources + { + get; + set; + } + } + + /// + /// Values of AXProperty name: + /// - from 'busy' to 'roledescription': states which apply to every AX node + /// - from 'live' to 'root': attributes which apply to nodes in live regions + /// - from 'autocomplete' to 'valuetext': attributes which apply to widgets + /// - from 'checked' to 'selected': states which apply to widgets + /// - from 'activedescendant' to 'owns': relationships between elements other than parent/child/sibling + /// - from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden + /// + public enum AXPropertyName + { + /// + /// actions + /// + [EnumMember(Value = ("actions"))] + Actions, + /// + /// busy + /// + [EnumMember(Value = ("busy"))] + Busy, + /// + /// disabled + /// + [EnumMember(Value = ("disabled"))] + Disabled, + /// + /// editable + /// + [EnumMember(Value = ("editable"))] + Editable, + /// + /// focusable + /// + [EnumMember(Value = ("focusable"))] + Focusable, + /// + /// focused + /// + [EnumMember(Value = ("focused"))] + Focused, + /// + /// hidden + /// + [EnumMember(Value = ("hidden"))] + Hidden, + /// + /// hiddenRoot + /// + [EnumMember(Value = ("hiddenRoot"))] + HiddenRoot, + /// + /// invalid + /// + [EnumMember(Value = ("invalid"))] + Invalid, + /// + /// keyshortcuts + /// + [EnumMember(Value = ("keyshortcuts"))] + Keyshortcuts, + /// + /// settable + /// + [EnumMember(Value = ("settable"))] + Settable, + /// + /// roledescription + /// + [EnumMember(Value = ("roledescription"))] + Roledescription, + /// + /// live + /// + [EnumMember(Value = ("live"))] + Live, + /// + /// atomic + /// + [EnumMember(Value = ("atomic"))] + Atomic, + /// + /// relevant + /// + [EnumMember(Value = ("relevant"))] + Relevant, + /// + /// root + /// + [EnumMember(Value = ("root"))] + Root, + /// + /// autocomplete + /// + [EnumMember(Value = ("autocomplete"))] + Autocomplete, + /// + /// hasPopup + /// + [EnumMember(Value = ("hasPopup"))] + HasPopup, + /// + /// level + /// + [EnumMember(Value = ("level"))] + Level, + /// + /// multiselectable + /// + [EnumMember(Value = ("multiselectable"))] + Multiselectable, + /// + /// orientation + /// + [EnumMember(Value = ("orientation"))] + Orientation, + /// + /// multiline + /// + [EnumMember(Value = ("multiline"))] + Multiline, + /// + /// readonly + /// + [EnumMember(Value = ("readonly"))] + Readonly, + /// + /// required + /// + [EnumMember(Value = ("required"))] + Required, + /// + /// valuemin + /// + [EnumMember(Value = ("valuemin"))] + Valuemin, + /// + /// valuemax + /// + [EnumMember(Value = ("valuemax"))] + Valuemax, + /// + /// valuetext + /// + [EnumMember(Value = ("valuetext"))] + Valuetext, + /// + /// checked + /// + [EnumMember(Value = ("checked"))] + Checked, + /// + /// expanded + /// + [EnumMember(Value = ("expanded"))] + Expanded, + /// + /// modal + /// + [EnumMember(Value = ("modal"))] + Modal, + /// + /// pressed + /// + [EnumMember(Value = ("pressed"))] + Pressed, + /// + /// selected + /// + [EnumMember(Value = ("selected"))] + Selected, + /// + /// activedescendant + /// + [EnumMember(Value = ("activedescendant"))] + Activedescendant, + /// + /// controls + /// + [EnumMember(Value = ("controls"))] + Controls, + /// + /// describedby + /// + [EnumMember(Value = ("describedby"))] + Describedby, + /// + /// details + /// + [EnumMember(Value = ("details"))] + Details, + /// + /// errormessage + /// + [EnumMember(Value = ("errormessage"))] + Errormessage, + /// + /// flowto + /// + [EnumMember(Value = ("flowto"))] + Flowto, + /// + /// labelledby + /// + [EnumMember(Value = ("labelledby"))] + Labelledby, + /// + /// owns + /// + [EnumMember(Value = ("owns"))] + Owns, + /// + /// url + /// + [EnumMember(Value = ("url"))] + Url, + /// + /// activeFullscreenElement + /// + [EnumMember(Value = ("activeFullscreenElement"))] + ActiveFullscreenElement, + /// + /// activeModalDialog + /// + [EnumMember(Value = ("activeModalDialog"))] + ActiveModalDialog, + /// + /// activeAriaModalDialog + /// + [EnumMember(Value = ("activeAriaModalDialog"))] + ActiveAriaModalDialog, + /// + /// ariaHiddenElement + /// + [EnumMember(Value = ("ariaHiddenElement"))] + AriaHiddenElement, + /// + /// ariaHiddenSubtree + /// + [EnumMember(Value = ("ariaHiddenSubtree"))] + AriaHiddenSubtree, + /// + /// emptyAlt + /// + [EnumMember(Value = ("emptyAlt"))] + EmptyAlt, + /// + /// emptyText + /// + [EnumMember(Value = ("emptyText"))] + EmptyText, + /// + /// inertElement + /// + [EnumMember(Value = ("inertElement"))] + InertElement, + /// + /// inertSubtree + /// + [EnumMember(Value = ("inertSubtree"))] + InertSubtree, + /// + /// labelContainer + /// + [EnumMember(Value = ("labelContainer"))] + LabelContainer, + /// + /// labelFor + /// + [EnumMember(Value = ("labelFor"))] + LabelFor, + /// + /// notRendered + /// + [EnumMember(Value = ("notRendered"))] + NotRendered, + /// + /// notVisible + /// + [EnumMember(Value = ("notVisible"))] + NotVisible, + /// + /// presentationalRole + /// + [EnumMember(Value = ("presentationalRole"))] + PresentationalRole, + /// + /// probablyPresentational + /// + [EnumMember(Value = ("probablyPresentational"))] + ProbablyPresentational, + /// + /// inactiveCarouselTabContent + /// + [EnumMember(Value = ("inactiveCarouselTabContent"))] + InactiveCarouselTabContent, + /// + /// uninteresting + /// + [EnumMember(Value = ("uninteresting"))] + Uninteresting + } + + /// + /// A node in the accessibility tree. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AXNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unique identifier for this node. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public string NodeId + { + get; + set; + } + + /// + /// Whether this node is ignored for accessibility + /// + [DataMember(Name = ("ignored"), IsRequired = (true))] + public bool Ignored + { + get; + set; + } + + /// + /// Collection of reasons why this node is hidden. + /// + [DataMember(Name = ("ignoredReasons"), IsRequired = (false))] + public System.Collections.Generic.IList IgnoredReasons + { + get; + set; + } + + /// + /// This `Node`'s role, whether explicit or implicit. + /// + [DataMember(Name = ("role"), IsRequired = (false))] + public CefSharp.DevTools.Accessibility.AXValue Role + { + get; + set; + } + + /// + /// This `Node`'s Chrome raw role. + /// + [DataMember(Name = ("chromeRole"), IsRequired = (false))] + public CefSharp.DevTools.Accessibility.AXValue ChromeRole + { + get; + set; + } + + /// + /// The accessible name for this `Node`. + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public CefSharp.DevTools.Accessibility.AXValue Name + { + get; + set; + } + + /// + /// The accessible description for this `Node`. + /// + [DataMember(Name = ("description"), IsRequired = (false))] + public CefSharp.DevTools.Accessibility.AXValue Description + { + get; + set; + } + + /// + /// The value for this `Node`. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public CefSharp.DevTools.Accessibility.AXValue Value + { + get; + set; + } + + /// + /// All other properties + /// + [DataMember(Name = ("properties"), IsRequired = (false))] + public System.Collections.Generic.IList Properties + { + get; + set; + } + + /// + /// ID for this node's parent. + /// + [DataMember(Name = ("parentId"), IsRequired = (false))] + public string ParentId + { + get; + set; + } + + /// + /// IDs for each of this node's child nodes. + /// + [DataMember(Name = ("childIds"), IsRequired = (false))] + public string[] ChildIds + { + get; + set; + } + + /// + /// The backend ID for the associated DOM node, if any. + /// + [DataMember(Name = ("backendDOMNodeId"), IsRequired = (false))] + public int? BackendDOMNodeId + { + get; + set; + } + + /// + /// The frame ID for the frame associated with this nodes document. + /// + [DataMember(Name = ("frameId"), IsRequired = (false))] + public string FrameId + { + get; + set; + } + } + + /// + /// The loadComplete event mirrors the load complete event sent by the browser to assistive + /// technology when the web page has finished loading. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class LoadCompleteEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// New document root node. + /// + [DataMember(Name = ("root"), IsRequired = (true))] + public CefSharp.DevTools.Accessibility.AXNode Root + { + get; + private set; + } + } + + /// + /// The nodesUpdated event is sent every time a previously requested node has changed the in tree. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class NodesUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Updated node data. + /// + [DataMember(Name = ("nodes"), IsRequired = (true))] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Animation +{ + /// + /// Animation type of `Animation`. + /// + public enum AnimationType + { + /// + /// CSSTransition + /// + [EnumMember(Value = ("CSSTransition"))] + CSSTransition, + /// + /// CSSAnimation + /// + [EnumMember(Value = ("CSSAnimation"))] + CSSAnimation, + /// + /// WebAnimation + /// + [EnumMember(Value = ("WebAnimation"))] + WebAnimation + } + + /// + /// Animation instance. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Animation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `Animation`'s id. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// `Animation`'s name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// `Animation`'s internal paused state. + /// + [DataMember(Name = ("pausedState"), IsRequired = (true))] + public bool PausedState + { + get; + set; + } + + /// + /// `Animation`'s play state. + /// + [DataMember(Name = ("playState"), IsRequired = (true))] + public string PlayState + { + get; + set; + } + + /// + /// `Animation`'s playback rate. + /// + [DataMember(Name = ("playbackRate"), IsRequired = (true))] + public double PlaybackRate + { + get; + set; + } + + /// + /// `Animation`'s start time. + /// Milliseconds for time based animations and + /// percentage [0 - 100] for scroll driven animations + /// (i.e. when viewOrScrollTimeline exists). + /// + [DataMember(Name = ("startTime"), IsRequired = (true))] + public double StartTime + { + get; + set; + } + + /// + /// `Animation`'s current time. + /// + [DataMember(Name = ("currentTime"), IsRequired = (true))] + public double CurrentTime + { + get; + set; + } + + /// + /// Animation type of `Animation`. + /// + public CefSharp.DevTools.Animation.AnimationType Type + { + get + { + return (CefSharp.DevTools.Animation.AnimationType)(StringToEnum(typeof(CefSharp.DevTools.Animation.AnimationType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Animation type of `Animation`. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// `Animation`'s source animation node. + /// + [DataMember(Name = ("source"), IsRequired = (false))] + public CefSharp.DevTools.Animation.AnimationEffect Source + { + get; + set; + } + + /// + /// A unique ID for `Animation` representing the sources that triggered this CSS + /// animation/transition. + /// + [DataMember(Name = ("cssId"), IsRequired = (false))] + public string CssId + { + get; + set; + } + + /// + /// View or scroll timeline + /// + [DataMember(Name = ("viewOrScrollTimeline"), IsRequired = (false))] + public CefSharp.DevTools.Animation.ViewOrScrollTimeline ViewOrScrollTimeline + { + get; + set; + } + } + + /// + /// Timeline instance + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ViewOrScrollTimeline : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Scroll container node + /// + [DataMember(Name = ("sourceNodeId"), IsRequired = (false))] + public int? SourceNodeId + { + get; + set; + } + + /// + /// Represents the starting scroll position of the timeline + /// as a length offset in pixels from scroll origin. + /// + [DataMember(Name = ("startOffset"), IsRequired = (false))] + public double? StartOffset + { + get; + set; + } + + /// + /// Represents the ending scroll position of the timeline + /// as a length offset in pixels from scroll origin. + /// + [DataMember(Name = ("endOffset"), IsRequired = (false))] + public double? EndOffset + { + get; + set; + } + + /// + /// The element whose principal box's visibility in the + /// scrollport defined the progress of the timeline. + /// Does not exist for animations with ScrollTimeline + /// + [DataMember(Name = ("subjectNodeId"), IsRequired = (false))] + public int? SubjectNodeId + { + get; + set; + } + + /// + /// Orientation of the scroll + /// + public CefSharp.DevTools.DOM.ScrollOrientation Axis + { + get + { + return (CefSharp.DevTools.DOM.ScrollOrientation)(StringToEnum(typeof(CefSharp.DevTools.DOM.ScrollOrientation), axis)); + } + + set + { + this.axis = (EnumToString(value)); + } + } + + /// + /// Orientation of the scroll + /// + [DataMember(Name = ("axis"), IsRequired = (true))] + internal string axis + { + get; + set; + } + } + + /// + /// AnimationEffect instance + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AnimationEffect : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `AnimationEffect`'s delay. + /// + [DataMember(Name = ("delay"), IsRequired = (true))] + public double Delay + { + get; + set; + } + + /// + /// `AnimationEffect`'s end delay. + /// + [DataMember(Name = ("endDelay"), IsRequired = (true))] + public double EndDelay + { + get; + set; + } + + /// + /// `AnimationEffect`'s iteration start. + /// + [DataMember(Name = ("iterationStart"), IsRequired = (true))] + public double IterationStart + { + get; + set; + } + + /// + /// `AnimationEffect`'s iterations. Omitted if the value is infinite. + /// + [DataMember(Name = ("iterations"), IsRequired = (false))] + public double? Iterations + { + get; + set; + } + + /// + /// `AnimationEffect`'s iteration duration. + /// Milliseconds for time based animations and + /// percentage [0 - 100] for scroll driven animations + /// (i.e. when viewOrScrollTimeline exists). + /// + [DataMember(Name = ("duration"), IsRequired = (true))] + public double Duration + { + get; + set; + } + + /// + /// `AnimationEffect`'s playback direction. + /// + [DataMember(Name = ("direction"), IsRequired = (true))] + public string Direction + { + get; + set; + } + + /// + /// `AnimationEffect`'s fill mode. + /// + [DataMember(Name = ("fill"), IsRequired = (true))] + public string Fill + { + get; + set; + } + + /// + /// `AnimationEffect`'s target node. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (false))] + public int? BackendNodeId + { + get; + set; + } + + /// + /// `AnimationEffect`'s keyframes. + /// + [DataMember(Name = ("keyframesRule"), IsRequired = (false))] + public CefSharp.DevTools.Animation.KeyframesRule KeyframesRule + { + get; + set; + } + + /// + /// `AnimationEffect`'s timing function. + /// + [DataMember(Name = ("easing"), IsRequired = (true))] + public string Easing + { + get; + set; + } + } + + /// + /// Keyframes Rule + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class KeyframesRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CSS keyframed animation's name. + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// List of animation keyframes. + /// + [DataMember(Name = ("keyframes"), IsRequired = (true))] + public System.Collections.Generic.IList Keyframes + { + get; + set; + } + } + + /// + /// Keyframe Style + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class KeyframeStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Keyframe's time offset. + /// + [DataMember(Name = ("offset"), IsRequired = (true))] + public string Offset + { + get; + set; + } + + /// + /// `AnimationEffect`'s timing function. + /// + [DataMember(Name = ("easing"), IsRequired = (true))] + public string Easing + { + get; + set; + } + } + + /// + /// Event for when an animation has been cancelled. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AnimationCanceledEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the animation that was cancelled. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + private set; + } + } + + /// + /// Event for each animation that has been created. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AnimationCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the animation that was created. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + private set; + } + } + + /// + /// Event for animation that has been started. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AnimationStartedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Animation that was started. + /// + [DataMember(Name = ("animation"), IsRequired = (true))] + public CefSharp.DevTools.Animation.Animation Animation + { + get; + private set; + } + } + + /// + /// Event for animation that has been updated. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AnimationUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Animation that was updated. + /// + [DataMember(Name = ("animation"), IsRequired = (true))] + public CefSharp.DevTools.Animation.Animation Animation + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Audits +{ + /// + /// Information about a cookie that is affected by an inspector issue. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AffectedCookie : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The following three properties uniquely identify a cookie + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Path + /// + [DataMember(Name = ("path"), IsRequired = (true))] + public string Path + { + get; + set; + } + + /// + /// Domain + /// + [DataMember(Name = ("domain"), IsRequired = (true))] + public string Domain + { + get; + set; + } + } + + /// + /// Information about a request that is affected by an inspector issue. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AffectedRequest : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The unique request id. + /// + [DataMember(Name = ("requestId"), IsRequired = (false))] + public string RequestId + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + } + + /// + /// Information about the frame affected by an inspector issue. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AffectedFrame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FrameId + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + set; + } + } + + /// + /// CookieExclusionReason + /// + public enum CookieExclusionReason + { + /// + /// ExcludeSameSiteUnspecifiedTreatedAsLax + /// + [EnumMember(Value = ("ExcludeSameSiteUnspecifiedTreatedAsLax"))] + ExcludeSameSiteUnspecifiedTreatedAsLax, + /// + /// ExcludeSameSiteNoneInsecure + /// + [EnumMember(Value = ("ExcludeSameSiteNoneInsecure"))] + ExcludeSameSiteNoneInsecure, + /// + /// ExcludeSameSiteLax + /// + [EnumMember(Value = ("ExcludeSameSiteLax"))] + ExcludeSameSiteLax, + /// + /// ExcludeSameSiteStrict + /// + [EnumMember(Value = ("ExcludeSameSiteStrict"))] + ExcludeSameSiteStrict, + /// + /// ExcludeDomainNonASCII + /// + [EnumMember(Value = ("ExcludeDomainNonASCII"))] + ExcludeDomainNonASCII, + /// + /// ExcludeThirdPartyCookieBlockedInFirstPartySet + /// + [EnumMember(Value = ("ExcludeThirdPartyCookieBlockedInFirstPartySet"))] + ExcludeThirdPartyCookieBlockedInFirstPartySet, + /// + /// ExcludeThirdPartyPhaseout + /// + [EnumMember(Value = ("ExcludeThirdPartyPhaseout"))] + ExcludeThirdPartyPhaseout, + /// + /// ExcludePortMismatch + /// + [EnumMember(Value = ("ExcludePortMismatch"))] + ExcludePortMismatch, + /// + /// ExcludeSchemeMismatch + /// + [EnumMember(Value = ("ExcludeSchemeMismatch"))] + ExcludeSchemeMismatch + } + + /// + /// CookieWarningReason + /// + public enum CookieWarningReason + { + /// + /// WarnSameSiteUnspecifiedCrossSiteContext + /// + [EnumMember(Value = ("WarnSameSiteUnspecifiedCrossSiteContext"))] + WarnSameSiteUnspecifiedCrossSiteContext, + /// + /// WarnSameSiteNoneInsecure + /// + [EnumMember(Value = ("WarnSameSiteNoneInsecure"))] + WarnSameSiteNoneInsecure, + /// + /// WarnSameSiteUnspecifiedLaxAllowUnsafe + /// + [EnumMember(Value = ("WarnSameSiteUnspecifiedLaxAllowUnsafe"))] + WarnSameSiteUnspecifiedLaxAllowUnsafe, + /// + /// WarnSameSiteStrictLaxDowngradeStrict + /// + [EnumMember(Value = ("WarnSameSiteStrictLaxDowngradeStrict"))] + WarnSameSiteStrictLaxDowngradeStrict, + /// + /// WarnSameSiteStrictCrossDowngradeStrict + /// + [EnumMember(Value = ("WarnSameSiteStrictCrossDowngradeStrict"))] + WarnSameSiteStrictCrossDowngradeStrict, + /// + /// WarnSameSiteStrictCrossDowngradeLax + /// + [EnumMember(Value = ("WarnSameSiteStrictCrossDowngradeLax"))] + WarnSameSiteStrictCrossDowngradeLax, + /// + /// WarnSameSiteLaxCrossDowngradeStrict + /// + [EnumMember(Value = ("WarnSameSiteLaxCrossDowngradeStrict"))] + WarnSameSiteLaxCrossDowngradeStrict, + /// + /// WarnSameSiteLaxCrossDowngradeLax + /// + [EnumMember(Value = ("WarnSameSiteLaxCrossDowngradeLax"))] + WarnSameSiteLaxCrossDowngradeLax, + /// + /// WarnAttributeValueExceedsMaxSize + /// + [EnumMember(Value = ("WarnAttributeValueExceedsMaxSize"))] + WarnAttributeValueExceedsMaxSize, + /// + /// WarnDomainNonASCII + /// + [EnumMember(Value = ("WarnDomainNonASCII"))] + WarnDomainNonASCII, + /// + /// WarnThirdPartyPhaseout + /// + [EnumMember(Value = ("WarnThirdPartyPhaseout"))] + WarnThirdPartyPhaseout, + /// + /// WarnCrossSiteRedirectDowngradeChangesInclusion + /// + [EnumMember(Value = ("WarnCrossSiteRedirectDowngradeChangesInclusion"))] + WarnCrossSiteRedirectDowngradeChangesInclusion, + /// + /// WarnDeprecationTrialMetadata + /// + [EnumMember(Value = ("WarnDeprecationTrialMetadata"))] + WarnDeprecationTrialMetadata, + /// + /// WarnThirdPartyCookieHeuristic + /// + [EnumMember(Value = ("WarnThirdPartyCookieHeuristic"))] + WarnThirdPartyCookieHeuristic + } + + /// + /// CookieOperation + /// + public enum CookieOperation + { + /// + /// SetCookie + /// + [EnumMember(Value = ("SetCookie"))] + SetCookie, + /// + /// ReadCookie + /// + [EnumMember(Value = ("ReadCookie"))] + ReadCookie + } + + /// + /// Represents the category of insight that a cookie issue falls under. + /// + public enum InsightType + { + /// + /// GitHubResource + /// + [EnumMember(Value = ("GitHubResource"))] + GitHubResource, + /// + /// GracePeriod + /// + [EnumMember(Value = ("GracePeriod"))] + GracePeriod, + /// + /// Heuristics + /// + [EnumMember(Value = ("Heuristics"))] + Heuristics + } + + /// + /// Information about the suggested solution to a cookie issue. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CookieIssueInsight : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type + /// + public CefSharp.DevTools.Audits.InsightType Type + { + get + { + return (CefSharp.DevTools.Audits.InsightType)(StringToEnum(typeof(CefSharp.DevTools.Audits.InsightType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Link to table entry in third-party cookie migration readiness list. + /// + [DataMember(Name = ("tableEntryUrl"), IsRequired = (false))] + public string TableEntryUrl + { + get; + set; + } + } + + /// + /// This information is currently necessary, as the front-end has a difficult + /// time finding a specific cookie. With this, we can convey specific error + /// information without the cookie. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CookieIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// If AffectedCookie is not set then rawCookieLine contains the raw + /// Set-Cookie header string. This hints at a problem where the + /// cookie line is syntactically or semantically malformed in a way + /// that no valid cookie could be created. + /// + [DataMember(Name = ("cookie"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedCookie Cookie + { + get; + set; + } + + /// + /// RawCookieLine + /// + [DataMember(Name = ("rawCookieLine"), IsRequired = (false))] + public string RawCookieLine + { + get; + set; + } + + /// + /// CookieWarningReasons + /// + public CefSharp.DevTools.Audits.CookieWarningReason[] CookieWarningReasons + { + get + { + return (CefSharp.DevTools.Audits.CookieWarningReason[])(StringToEnum(typeof(CefSharp.DevTools.Audits.CookieWarningReason[]), cookieWarningReasons)); + } + + set + { + this.cookieWarningReasons = (EnumToString(value)); + } + } + + /// + /// CookieWarningReasons + /// + [DataMember(Name = ("cookieWarningReasons"), IsRequired = (true))] + internal string cookieWarningReasons + { + get; + set; + } + + /// + /// CookieExclusionReasons + /// + public CefSharp.DevTools.Audits.CookieExclusionReason[] CookieExclusionReasons + { + get + { + return (CefSharp.DevTools.Audits.CookieExclusionReason[])(StringToEnum(typeof(CefSharp.DevTools.Audits.CookieExclusionReason[]), cookieExclusionReasons)); + } + + set + { + this.cookieExclusionReasons = (EnumToString(value)); + } + } + + /// + /// CookieExclusionReasons + /// + [DataMember(Name = ("cookieExclusionReasons"), IsRequired = (true))] + internal string cookieExclusionReasons + { + get; + set; + } + + /// + /// Optionally identifies the site-for-cookies and the cookie url, which + /// may be used by the front-end as additional context. + /// + public CefSharp.DevTools.Audits.CookieOperation Operation + { + get + { + return (CefSharp.DevTools.Audits.CookieOperation)(StringToEnum(typeof(CefSharp.DevTools.Audits.CookieOperation), operation)); + } + + set + { + this.operation = (EnumToString(value)); + } + } + + /// + /// Optionally identifies the site-for-cookies and the cookie url, which + /// may be used by the front-end as additional context. + /// + [DataMember(Name = ("operation"), IsRequired = (true))] + internal string operation + { + get; + set; + } + + /// + /// SiteForCookies + /// + [DataMember(Name = ("siteForCookies"), IsRequired = (false))] + public string SiteForCookies + { + get; + set; + } + + /// + /// CookieUrl + /// + [DataMember(Name = ("cookieUrl"), IsRequired = (false))] + public string CookieUrl + { + get; + set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// The recommended solution to the issue. + /// + [DataMember(Name = ("insight"), IsRequired = (false))] + public CefSharp.DevTools.Audits.CookieIssueInsight Insight + { + get; + set; + } + } + + /// + /// MixedContentResolutionStatus + /// + public enum MixedContentResolutionStatus + { + /// + /// MixedContentBlocked + /// + [EnumMember(Value = ("MixedContentBlocked"))] + MixedContentBlocked, + /// + /// MixedContentAutomaticallyUpgraded + /// + [EnumMember(Value = ("MixedContentAutomaticallyUpgraded"))] + MixedContentAutomaticallyUpgraded, + /// + /// MixedContentWarning + /// + [EnumMember(Value = ("MixedContentWarning"))] + MixedContentWarning + } + + /// + /// MixedContentResourceType + /// + public enum MixedContentResourceType + { + /// + /// AttributionSrc + /// + [EnumMember(Value = ("AttributionSrc"))] + AttributionSrc, + /// + /// Audio + /// + [EnumMember(Value = ("Audio"))] + Audio, + /// + /// Beacon + /// + [EnumMember(Value = ("Beacon"))] + Beacon, + /// + /// CSPReport + /// + [EnumMember(Value = ("CSPReport"))] + CSPReport, + /// + /// Download + /// + [EnumMember(Value = ("Download"))] + Download, + /// + /// EventSource + /// + [EnumMember(Value = ("EventSource"))] + EventSource, + /// + /// Favicon + /// + [EnumMember(Value = ("Favicon"))] + Favicon, + /// + /// Font + /// + [EnumMember(Value = ("Font"))] + Font, + /// + /// Form + /// + [EnumMember(Value = ("Form"))] + Form, + /// + /// Frame + /// + [EnumMember(Value = ("Frame"))] + Frame, + /// + /// Image + /// + [EnumMember(Value = ("Image"))] + Image, + /// + /// Import + /// + [EnumMember(Value = ("Import"))] + Import, + /// + /// JSON + /// + [EnumMember(Value = ("JSON"))] + JSON, + /// + /// Manifest + /// + [EnumMember(Value = ("Manifest"))] + Manifest, + /// + /// Ping + /// + [EnumMember(Value = ("Ping"))] + Ping, + /// + /// PluginData + /// + [EnumMember(Value = ("PluginData"))] + PluginData, + /// + /// PluginResource + /// + [EnumMember(Value = ("PluginResource"))] + PluginResource, + /// + /// Prefetch + /// + [EnumMember(Value = ("Prefetch"))] + Prefetch, + /// + /// Resource + /// + [EnumMember(Value = ("Resource"))] + Resource, + /// + /// Script + /// + [EnumMember(Value = ("Script"))] + Script, + /// + /// ServiceWorker + /// + [EnumMember(Value = ("ServiceWorker"))] + ServiceWorker, + /// + /// SharedWorker + /// + [EnumMember(Value = ("SharedWorker"))] + SharedWorker, + /// + /// SpeculationRules + /// + [EnumMember(Value = ("SpeculationRules"))] + SpeculationRules, + /// + /// Stylesheet + /// + [EnumMember(Value = ("Stylesheet"))] + Stylesheet, + /// + /// Track + /// + [EnumMember(Value = ("Track"))] + Track, + /// + /// Video + /// + [EnumMember(Value = ("Video"))] + Video, + /// + /// Worker + /// + [EnumMember(Value = ("Worker"))] + Worker, + /// + /// XMLHttpRequest + /// + [EnumMember(Value = ("XMLHttpRequest"))] + XMLHttpRequest, + /// + /// XSLT + /// + [EnumMember(Value = ("XSLT"))] + XSLT + } + + /// + /// MixedContentIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class MixedContentIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The type of resource causing the mixed content issue (css, js, iframe, + /// form,...). Marked as optional because it is mapped to from + /// blink::mojom::RequestContextType, which will be replaced + /// by network::mojom::RequestDestination + /// + public CefSharp.DevTools.Audits.MixedContentResourceType? ResourceType + { + get + { + return (CefSharp.DevTools.Audits.MixedContentResourceType? )(StringToEnum(typeof(CefSharp.DevTools.Audits.MixedContentResourceType? ), resourceType)); + } + + set + { + this.resourceType = (EnumToString(value)); + } + } + + /// + /// The type of resource causing the mixed content issue (css, js, iframe, + /// form,...). Marked as optional because it is mapped to from + /// blink::mojom::RequestContextType, which will be replaced + /// by network::mojom::RequestDestination + /// + [DataMember(Name = ("resourceType"), IsRequired = (false))] + internal string resourceType + { + get; + set; + } + + /// + /// The way the mixed content issue is being resolved. + /// + public CefSharp.DevTools.Audits.MixedContentResolutionStatus ResolutionStatus + { + get + { + return (CefSharp.DevTools.Audits.MixedContentResolutionStatus)(StringToEnum(typeof(CefSharp.DevTools.Audits.MixedContentResolutionStatus), resolutionStatus)); + } + + set + { + this.resolutionStatus = (EnumToString(value)); + } + } + + /// + /// The way the mixed content issue is being resolved. + /// + [DataMember(Name = ("resolutionStatus"), IsRequired = (true))] + internal string resolutionStatus + { + get; + set; + } + + /// + /// The unsafe http url causing the mixed content issue. + /// + [DataMember(Name = ("insecureURL"), IsRequired = (true))] + public string InsecureURL + { + get; + set; + } + + /// + /// The url responsible for the call to an unsafe url. + /// + [DataMember(Name = ("mainResourceURL"), IsRequired = (true))] + public string MainResourceURL + { + get; + set; + } + + /// + /// The mixed content request. + /// Does not always exist (e.g. for unsafe form submission urls). + /// + [DataMember(Name = ("request"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// Optional because not every mixed content issue is necessarily linked to a frame. + /// + [DataMember(Name = ("frame"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedFrame Frame + { + get; + set; + } + } + + /// + /// Enum indicating the reason a response has been blocked. These reasons are + /// refinements of the net error BLOCKED_BY_RESPONSE. + /// + public enum BlockedByResponseReason + { + /// + /// CoepFrameResourceNeedsCoepHeader + /// + [EnumMember(Value = ("CoepFrameResourceNeedsCoepHeader"))] + CoepFrameResourceNeedsCoepHeader, + /// + /// CoopSandboxedIFrameCannotNavigateToCoopPage + /// + [EnumMember(Value = ("CoopSandboxedIFrameCannotNavigateToCoopPage"))] + CoopSandboxedIFrameCannotNavigateToCoopPage, + /// + /// CorpNotSameOrigin + /// + [EnumMember(Value = ("CorpNotSameOrigin"))] + CorpNotSameOrigin, + /// + /// CorpNotSameOriginAfterDefaultedToSameOriginByCoep + /// + [EnumMember(Value = ("CorpNotSameOriginAfterDefaultedToSameOriginByCoep"))] + CorpNotSameOriginAfterDefaultedToSameOriginByCoep, + /// + /// CorpNotSameOriginAfterDefaultedToSameOriginByDip + /// + [EnumMember(Value = ("CorpNotSameOriginAfterDefaultedToSameOriginByDip"))] + CorpNotSameOriginAfterDefaultedToSameOriginByDip, + /// + /// CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip + /// + [EnumMember(Value = ("CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip"))] + CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip, + /// + /// CorpNotSameSite + /// + [EnumMember(Value = ("CorpNotSameSite"))] + CorpNotSameSite, + /// + /// SRIMessageSignatureMismatch + /// + [EnumMember(Value = ("SRIMessageSignatureMismatch"))] + SRIMessageSignatureMismatch + } + + /// + /// Details for a request that has been blocked with the BLOCKED_BY_RESPONSE + /// code. Currently only used for COEP/COOP, but may be extended to include + /// some CSP errors in the future. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BlockedByResponseIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// ParentFrame + /// + [DataMember(Name = ("parentFrame"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedFrame ParentFrame + { + get; + set; + } + + /// + /// BlockedFrame + /// + [DataMember(Name = ("blockedFrame"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedFrame BlockedFrame + { + get; + set; + } + + /// + /// Reason + /// + public CefSharp.DevTools.Audits.BlockedByResponseReason Reason + { + get + { + return (CefSharp.DevTools.Audits.BlockedByResponseReason)(StringToEnum(typeof(CefSharp.DevTools.Audits.BlockedByResponseReason), reason)); + } + + set + { + this.reason = (EnumToString(value)); + } + } + + /// + /// Reason + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + internal string reason + { + get; + set; + } + } + + /// + /// HeavyAdResolutionStatus + /// + public enum HeavyAdResolutionStatus + { + /// + /// HeavyAdBlocked + /// + [EnumMember(Value = ("HeavyAdBlocked"))] + HeavyAdBlocked, + /// + /// HeavyAdWarning + /// + [EnumMember(Value = ("HeavyAdWarning"))] + HeavyAdWarning + } + + /// + /// HeavyAdReason + /// + public enum HeavyAdReason + { + /// + /// NetworkTotalLimit + /// + [EnumMember(Value = ("NetworkTotalLimit"))] + NetworkTotalLimit, + /// + /// CpuTotalLimit + /// + [EnumMember(Value = ("CpuTotalLimit"))] + CpuTotalLimit, + /// + /// CpuPeakLimit + /// + [EnumMember(Value = ("CpuPeakLimit"))] + CpuPeakLimit + } + + /// + /// HeavyAdIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class HeavyAdIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The resolution status, either blocking the content or warning. + /// + public CefSharp.DevTools.Audits.HeavyAdResolutionStatus Resolution + { + get + { + return (CefSharp.DevTools.Audits.HeavyAdResolutionStatus)(StringToEnum(typeof(CefSharp.DevTools.Audits.HeavyAdResolutionStatus), resolution)); + } + + set + { + this.resolution = (EnumToString(value)); + } + } + + /// + /// The resolution status, either blocking the content or warning. + /// + [DataMember(Name = ("resolution"), IsRequired = (true))] + internal string resolution + { + get; + set; + } + + /// + /// The reason the ad was blocked, total network or cpu or peak cpu. + /// + public CefSharp.DevTools.Audits.HeavyAdReason Reason + { + get + { + return (CefSharp.DevTools.Audits.HeavyAdReason)(StringToEnum(typeof(CefSharp.DevTools.Audits.HeavyAdReason), reason)); + } + + set + { + this.reason = (EnumToString(value)); + } + } + + /// + /// The reason the ad was blocked, total network or cpu or peak cpu. + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + internal string reason + { + get; + set; + } + + /// + /// The frame that was blocked. + /// + [DataMember(Name = ("frame"), IsRequired = (true))] + public CefSharp.DevTools.Audits.AffectedFrame Frame + { + get; + set; + } + } + + /// + /// ContentSecurityPolicyViolationType + /// + public enum ContentSecurityPolicyViolationType + { + /// + /// kInlineViolation + /// + [EnumMember(Value = ("kInlineViolation"))] + KInlineViolation, + /// + /// kEvalViolation + /// + [EnumMember(Value = ("kEvalViolation"))] + KEvalViolation, + /// + /// kURLViolation + /// + [EnumMember(Value = ("kURLViolation"))] + KURLViolation, + /// + /// kSRIViolation + /// + [EnumMember(Value = ("kSRIViolation"))] + KSRIViolation, + /// + /// kTrustedTypesSinkViolation + /// + [EnumMember(Value = ("kTrustedTypesSinkViolation"))] + KTrustedTypesSinkViolation, + /// + /// kTrustedTypesPolicyViolation + /// + [EnumMember(Value = ("kTrustedTypesPolicyViolation"))] + KTrustedTypesPolicyViolation, + /// + /// kWasmEvalViolation + /// + [EnumMember(Value = ("kWasmEvalViolation"))] + KWasmEvalViolation + } + + /// + /// SourceCodeLocation + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SourceCodeLocation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ScriptId + /// + [DataMember(Name = ("scriptId"), IsRequired = (false))] + public string ScriptId + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// LineNumber + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// ColumnNumber + /// + [DataMember(Name = ("columnNumber"), IsRequired = (true))] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// ContentSecurityPolicyIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ContentSecurityPolicyIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The url not included in allowed sources. + /// + [DataMember(Name = ("blockedURL"), IsRequired = (false))] + public string BlockedURL + { + get; + set; + } + + /// + /// Specific directive that is violated, causing the CSP issue. + /// + [DataMember(Name = ("violatedDirective"), IsRequired = (true))] + public string ViolatedDirective + { + get; + set; + } + + /// + /// IsReportOnly + /// + [DataMember(Name = ("isReportOnly"), IsRequired = (true))] + public bool IsReportOnly + { + get; + set; + } + + /// + /// ContentSecurityPolicyViolationType + /// + public CefSharp.DevTools.Audits.ContentSecurityPolicyViolationType ContentSecurityPolicyViolationType + { + get + { + return (CefSharp.DevTools.Audits.ContentSecurityPolicyViolationType)(StringToEnum(typeof(CefSharp.DevTools.Audits.ContentSecurityPolicyViolationType), contentSecurityPolicyViolationType)); + } + + set + { + this.contentSecurityPolicyViolationType = (EnumToString(value)); + } + } + + /// + /// ContentSecurityPolicyViolationType + /// + [DataMember(Name = ("contentSecurityPolicyViolationType"), IsRequired = (true))] + internal string contentSecurityPolicyViolationType + { + get; + set; + } + + /// + /// FrameAncestor + /// + [DataMember(Name = ("frameAncestor"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedFrame FrameAncestor + { + get; + set; + } + + /// + /// SourceCodeLocation + /// + [DataMember(Name = ("sourceCodeLocation"), IsRequired = (false))] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// ViolatingNodeId + /// + [DataMember(Name = ("violatingNodeId"), IsRequired = (false))] + public int? ViolatingNodeId + { + get; + set; + } + } + + /// + /// SharedArrayBufferIssueType + /// + public enum SharedArrayBufferIssueType + { + /// + /// TransferIssue + /// + [EnumMember(Value = ("TransferIssue"))] + TransferIssue, + /// + /// CreationIssue + /// + [EnumMember(Value = ("CreationIssue"))] + CreationIssue + } + + /// + /// Details for a issue arising from an SAB being instantiated in, or + /// transferred to a context that is not cross-origin isolated. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SharedArrayBufferIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// SourceCodeLocation + /// + [DataMember(Name = ("sourceCodeLocation"), IsRequired = (true))] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// IsWarning + /// + [DataMember(Name = ("isWarning"), IsRequired = (true))] + public bool IsWarning + { + get; + set; + } + + /// + /// Type + /// + public CefSharp.DevTools.Audits.SharedArrayBufferIssueType Type + { + get + { + return (CefSharp.DevTools.Audits.SharedArrayBufferIssueType)(StringToEnum(typeof(CefSharp.DevTools.Audits.SharedArrayBufferIssueType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + } + + /// + /// LowTextContrastIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LowTextContrastIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ViolatingNodeId + /// + [DataMember(Name = ("violatingNodeId"), IsRequired = (true))] + public int ViolatingNodeId + { + get; + set; + } + + /// + /// ViolatingNodeSelector + /// + [DataMember(Name = ("violatingNodeSelector"), IsRequired = (true))] + public string ViolatingNodeSelector + { + get; + set; + } + + /// + /// ContrastRatio + /// + [DataMember(Name = ("contrastRatio"), IsRequired = (true))] + public double ContrastRatio + { + get; + set; + } + + /// + /// ThresholdAA + /// + [DataMember(Name = ("thresholdAA"), IsRequired = (true))] + public double ThresholdAA + { + get; + set; + } + + /// + /// ThresholdAAA + /// + [DataMember(Name = ("thresholdAAA"), IsRequired = (true))] + public double ThresholdAAA + { + get; + set; + } + + /// + /// FontSize + /// + [DataMember(Name = ("fontSize"), IsRequired = (true))] + public string FontSize + { + get; + set; + } + + /// + /// FontWeight + /// + [DataMember(Name = ("fontWeight"), IsRequired = (true))] + public string FontWeight + { + get; + set; + } + } + + /// + /// Details for a CORS related issue, e.g. a warning or error related to + /// CORS RFC1918 enforcement. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CorsIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CorsErrorStatus + /// + [DataMember(Name = ("corsErrorStatus"), IsRequired = (true))] + public CefSharp.DevTools.Network.CorsErrorStatus CorsErrorStatus + { + get; + set; + } + + /// + /// IsWarning + /// + [DataMember(Name = ("isWarning"), IsRequired = (true))] + public bool IsWarning + { + get; + set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// Location + /// + [DataMember(Name = ("location"), IsRequired = (false))] + public CefSharp.DevTools.Audits.SourceCodeLocation Location + { + get; + set; + } + + /// + /// InitiatorOrigin + /// + [DataMember(Name = ("initiatorOrigin"), IsRequired = (false))] + public string InitiatorOrigin + { + get; + set; + } + + /// + /// ResourceIPAddressSpace + /// + public CefSharp.DevTools.Network.IPAddressSpace? ResourceIPAddressSpace + { + get + { + return (CefSharp.DevTools.Network.IPAddressSpace? )(StringToEnum(typeof(CefSharp.DevTools.Network.IPAddressSpace? ), resourceIPAddressSpace)); + } + + set + { + this.resourceIPAddressSpace = (EnumToString(value)); + } + } + + /// + /// ResourceIPAddressSpace + /// + [DataMember(Name = ("resourceIPAddressSpace"), IsRequired = (false))] + internal string resourceIPAddressSpace + { + get; + set; + } + + /// + /// ClientSecurityState + /// + [DataMember(Name = ("clientSecurityState"), IsRequired = (false))] + public CefSharp.DevTools.Network.ClientSecurityState ClientSecurityState + { + get; + set; + } + } + + /// + /// AttributionReportingIssueType + /// + public enum AttributionReportingIssueType + { + /// + /// PermissionPolicyDisabled + /// + [EnumMember(Value = ("PermissionPolicyDisabled"))] + PermissionPolicyDisabled, + /// + /// UntrustworthyReportingOrigin + /// + [EnumMember(Value = ("UntrustworthyReportingOrigin"))] + UntrustworthyReportingOrigin, + /// + /// InsecureContext + /// + [EnumMember(Value = ("InsecureContext"))] + InsecureContext, + /// + /// InvalidHeader + /// + [EnumMember(Value = ("InvalidHeader"))] + InvalidHeader, + /// + /// InvalidRegisterTriggerHeader + /// + [EnumMember(Value = ("InvalidRegisterTriggerHeader"))] + InvalidRegisterTriggerHeader, + /// + /// SourceAndTriggerHeaders + /// + [EnumMember(Value = ("SourceAndTriggerHeaders"))] + SourceAndTriggerHeaders, + /// + /// SourceIgnored + /// + [EnumMember(Value = ("SourceIgnored"))] + SourceIgnored, + /// + /// TriggerIgnored + /// + [EnumMember(Value = ("TriggerIgnored"))] + TriggerIgnored, + /// + /// OsSourceIgnored + /// + [EnumMember(Value = ("OsSourceIgnored"))] + OsSourceIgnored, + /// + /// OsTriggerIgnored + /// + [EnumMember(Value = ("OsTriggerIgnored"))] + OsTriggerIgnored, + /// + /// InvalidRegisterOsSourceHeader + /// + [EnumMember(Value = ("InvalidRegisterOsSourceHeader"))] + InvalidRegisterOsSourceHeader, + /// + /// InvalidRegisterOsTriggerHeader + /// + [EnumMember(Value = ("InvalidRegisterOsTriggerHeader"))] + InvalidRegisterOsTriggerHeader, + /// + /// WebAndOsHeaders + /// + [EnumMember(Value = ("WebAndOsHeaders"))] + WebAndOsHeaders, + /// + /// NoWebOrOsSupport + /// + [EnumMember(Value = ("NoWebOrOsSupport"))] + NoWebOrOsSupport, + /// + /// NavigationRegistrationWithoutTransientUserActivation + /// + [EnumMember(Value = ("NavigationRegistrationWithoutTransientUserActivation"))] + NavigationRegistrationWithoutTransientUserActivation, + /// + /// InvalidInfoHeader + /// + [EnumMember(Value = ("InvalidInfoHeader"))] + InvalidInfoHeader, + /// + /// NoRegisterSourceHeader + /// + [EnumMember(Value = ("NoRegisterSourceHeader"))] + NoRegisterSourceHeader, + /// + /// NoRegisterTriggerHeader + /// + [EnumMember(Value = ("NoRegisterTriggerHeader"))] + NoRegisterTriggerHeader, + /// + /// NoRegisterOsSourceHeader + /// + [EnumMember(Value = ("NoRegisterOsSourceHeader"))] + NoRegisterOsSourceHeader, + /// + /// NoRegisterOsTriggerHeader + /// + [EnumMember(Value = ("NoRegisterOsTriggerHeader"))] + NoRegisterOsTriggerHeader, + /// + /// NavigationRegistrationUniqueScopeAlreadySet + /// + [EnumMember(Value = ("NavigationRegistrationUniqueScopeAlreadySet"))] + NavigationRegistrationUniqueScopeAlreadySet + } + + /// + /// SharedDictionaryError + /// + public enum SharedDictionaryError + { + /// + /// UseErrorCrossOriginNoCorsRequest + /// + [EnumMember(Value = ("UseErrorCrossOriginNoCorsRequest"))] + UseErrorCrossOriginNoCorsRequest, + /// + /// UseErrorDictionaryLoadFailure + /// + [EnumMember(Value = ("UseErrorDictionaryLoadFailure"))] + UseErrorDictionaryLoadFailure, + /// + /// UseErrorMatchingDictionaryNotUsed + /// + [EnumMember(Value = ("UseErrorMatchingDictionaryNotUsed"))] + UseErrorMatchingDictionaryNotUsed, + /// + /// UseErrorUnexpectedContentDictionaryHeader + /// + [EnumMember(Value = ("UseErrorUnexpectedContentDictionaryHeader"))] + UseErrorUnexpectedContentDictionaryHeader, + /// + /// WriteErrorCossOriginNoCorsRequest + /// + [EnumMember(Value = ("WriteErrorCossOriginNoCorsRequest"))] + WriteErrorCossOriginNoCorsRequest, + /// + /// WriteErrorDisallowedBySettings + /// + [EnumMember(Value = ("WriteErrorDisallowedBySettings"))] + WriteErrorDisallowedBySettings, + /// + /// WriteErrorExpiredResponse + /// + [EnumMember(Value = ("WriteErrorExpiredResponse"))] + WriteErrorExpiredResponse, + /// + /// WriteErrorFeatureDisabled + /// + [EnumMember(Value = ("WriteErrorFeatureDisabled"))] + WriteErrorFeatureDisabled, + /// + /// WriteErrorInsufficientResources + /// + [EnumMember(Value = ("WriteErrorInsufficientResources"))] + WriteErrorInsufficientResources, + /// + /// WriteErrorInvalidMatchField + /// + [EnumMember(Value = ("WriteErrorInvalidMatchField"))] + WriteErrorInvalidMatchField, + /// + /// WriteErrorInvalidStructuredHeader + /// + [EnumMember(Value = ("WriteErrorInvalidStructuredHeader"))] + WriteErrorInvalidStructuredHeader, + /// + /// WriteErrorInvalidTTLField + /// + [EnumMember(Value = ("WriteErrorInvalidTTLField"))] + WriteErrorInvalidTTLField, + /// + /// WriteErrorNavigationRequest + /// + [EnumMember(Value = ("WriteErrorNavigationRequest"))] + WriteErrorNavigationRequest, + /// + /// WriteErrorNoMatchField + /// + [EnumMember(Value = ("WriteErrorNoMatchField"))] + WriteErrorNoMatchField, + /// + /// WriteErrorNonIntegerTTLField + /// + [EnumMember(Value = ("WriteErrorNonIntegerTTLField"))] + WriteErrorNonIntegerTTLField, + /// + /// WriteErrorNonListMatchDestField + /// + [EnumMember(Value = ("WriteErrorNonListMatchDestField"))] + WriteErrorNonListMatchDestField, + /// + /// WriteErrorNonSecureContext + /// + [EnumMember(Value = ("WriteErrorNonSecureContext"))] + WriteErrorNonSecureContext, + /// + /// WriteErrorNonStringIdField + /// + [EnumMember(Value = ("WriteErrorNonStringIdField"))] + WriteErrorNonStringIdField, + /// + /// WriteErrorNonStringInMatchDestList + /// + [EnumMember(Value = ("WriteErrorNonStringInMatchDestList"))] + WriteErrorNonStringInMatchDestList, + /// + /// WriteErrorNonStringMatchField + /// + [EnumMember(Value = ("WriteErrorNonStringMatchField"))] + WriteErrorNonStringMatchField, + /// + /// WriteErrorNonTokenTypeField + /// + [EnumMember(Value = ("WriteErrorNonTokenTypeField"))] + WriteErrorNonTokenTypeField, + /// + /// WriteErrorRequestAborted + /// + [EnumMember(Value = ("WriteErrorRequestAborted"))] + WriteErrorRequestAborted, + /// + /// WriteErrorShuttingDown + /// + [EnumMember(Value = ("WriteErrorShuttingDown"))] + WriteErrorShuttingDown, + /// + /// WriteErrorTooLongIdField + /// + [EnumMember(Value = ("WriteErrorTooLongIdField"))] + WriteErrorTooLongIdField, + /// + /// WriteErrorUnsupportedType + /// + [EnumMember(Value = ("WriteErrorUnsupportedType"))] + WriteErrorUnsupportedType + } + + /// + /// SRIMessageSignatureError + /// + public enum SRIMessageSignatureError + { + /// + /// MissingSignatureHeader + /// + [EnumMember(Value = ("MissingSignatureHeader"))] + MissingSignatureHeader, + /// + /// MissingSignatureInputHeader + /// + [EnumMember(Value = ("MissingSignatureInputHeader"))] + MissingSignatureInputHeader, + /// + /// InvalidSignatureHeader + /// + [EnumMember(Value = ("InvalidSignatureHeader"))] + InvalidSignatureHeader, + /// + /// InvalidSignatureInputHeader + /// + [EnumMember(Value = ("InvalidSignatureInputHeader"))] + InvalidSignatureInputHeader, + /// + /// SignatureHeaderValueIsNotByteSequence + /// + [EnumMember(Value = ("SignatureHeaderValueIsNotByteSequence"))] + SignatureHeaderValueIsNotByteSequence, + /// + /// SignatureHeaderValueIsParameterized + /// + [EnumMember(Value = ("SignatureHeaderValueIsParameterized"))] + SignatureHeaderValueIsParameterized, + /// + /// SignatureHeaderValueIsIncorrectLength + /// + [EnumMember(Value = ("SignatureHeaderValueIsIncorrectLength"))] + SignatureHeaderValueIsIncorrectLength, + /// + /// SignatureInputHeaderMissingLabel + /// + [EnumMember(Value = ("SignatureInputHeaderMissingLabel"))] + SignatureInputHeaderMissingLabel, + /// + /// SignatureInputHeaderValueNotInnerList + /// + [EnumMember(Value = ("SignatureInputHeaderValueNotInnerList"))] + SignatureInputHeaderValueNotInnerList, + /// + /// SignatureInputHeaderValueMissingComponents + /// + [EnumMember(Value = ("SignatureInputHeaderValueMissingComponents"))] + SignatureInputHeaderValueMissingComponents, + /// + /// SignatureInputHeaderInvalidComponentType + /// + [EnumMember(Value = ("SignatureInputHeaderInvalidComponentType"))] + SignatureInputHeaderInvalidComponentType, + /// + /// SignatureInputHeaderInvalidComponentName + /// + [EnumMember(Value = ("SignatureInputHeaderInvalidComponentName"))] + SignatureInputHeaderInvalidComponentName, + /// + /// SignatureInputHeaderInvalidHeaderComponentParameter + /// + [EnumMember(Value = ("SignatureInputHeaderInvalidHeaderComponentParameter"))] + SignatureInputHeaderInvalidHeaderComponentParameter, + /// + /// SignatureInputHeaderInvalidDerivedComponentParameter + /// + [EnumMember(Value = ("SignatureInputHeaderInvalidDerivedComponentParameter"))] + SignatureInputHeaderInvalidDerivedComponentParameter, + /// + /// SignatureInputHeaderKeyIdLength + /// + [EnumMember(Value = ("SignatureInputHeaderKeyIdLength"))] + SignatureInputHeaderKeyIdLength, + /// + /// SignatureInputHeaderInvalidParameter + /// + [EnumMember(Value = ("SignatureInputHeaderInvalidParameter"))] + SignatureInputHeaderInvalidParameter, + /// + /// SignatureInputHeaderMissingRequiredParameters + /// + [EnumMember(Value = ("SignatureInputHeaderMissingRequiredParameters"))] + SignatureInputHeaderMissingRequiredParameters, + /// + /// ValidationFailedSignatureExpired + /// + [EnumMember(Value = ("ValidationFailedSignatureExpired"))] + ValidationFailedSignatureExpired, + /// + /// ValidationFailedInvalidLength + /// + [EnumMember(Value = ("ValidationFailedInvalidLength"))] + ValidationFailedInvalidLength, + /// + /// ValidationFailedSignatureMismatch + /// + [EnumMember(Value = ("ValidationFailedSignatureMismatch"))] + ValidationFailedSignatureMismatch, + /// + /// ValidationFailedIntegrityMismatch + /// + [EnumMember(Value = ("ValidationFailedIntegrityMismatch"))] + ValidationFailedIntegrityMismatch + } + + /// + /// UnencodedDigestError + /// + public enum UnencodedDigestError + { + /// + /// MalformedDictionary + /// + [EnumMember(Value = ("MalformedDictionary"))] + MalformedDictionary, + /// + /// UnknownAlgorithm + /// + [EnumMember(Value = ("UnknownAlgorithm"))] + UnknownAlgorithm, + /// + /// IncorrectDigestType + /// + [EnumMember(Value = ("IncorrectDigestType"))] + IncorrectDigestType, + /// + /// IncorrectDigestLength + /// + [EnumMember(Value = ("IncorrectDigestLength"))] + IncorrectDigestLength + } + + /// + /// ConnectionAllowlistError + /// + public enum ConnectionAllowlistError + { + /// + /// InvalidHeader + /// + [EnumMember(Value = ("InvalidHeader"))] + InvalidHeader, + /// + /// MoreThanOneList + /// + [EnumMember(Value = ("MoreThanOneList"))] + MoreThanOneList, + /// + /// ItemNotInnerList + /// + [EnumMember(Value = ("ItemNotInnerList"))] + ItemNotInnerList, + /// + /// InvalidAllowlistItemType + /// + [EnumMember(Value = ("InvalidAllowlistItemType"))] + InvalidAllowlistItemType, + /// + /// ReportingEndpointNotToken + /// + [EnumMember(Value = ("ReportingEndpointNotToken"))] + ReportingEndpointNotToken, + /// + /// InvalidUrlPattern + /// + [EnumMember(Value = ("InvalidUrlPattern"))] + InvalidUrlPattern + } + + /// + /// Details for issues around "Attribution Reporting API" usage. + /// Explainer: https://github.com/WICG/attribution-reporting-api + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ViolationType + /// + public CefSharp.DevTools.Audits.AttributionReportingIssueType ViolationType + { + get + { + return (CefSharp.DevTools.Audits.AttributionReportingIssueType)(StringToEnum(typeof(CefSharp.DevTools.Audits.AttributionReportingIssueType), violationType)); + } + + set + { + this.violationType = (EnumToString(value)); + } + } + + /// + /// ViolationType + /// + [DataMember(Name = ("violationType"), IsRequired = (true))] + internal string violationType + { + get; + set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// ViolatingNodeId + /// + [DataMember(Name = ("violatingNodeId"), IsRequired = (false))] + public int? ViolatingNodeId + { + get; + set; + } + + /// + /// InvalidParameter + /// + [DataMember(Name = ("invalidParameter"), IsRequired = (false))] + public string InvalidParameter + { + get; + set; + } + } + + /// + /// Details for issues about documents in Quirks Mode + /// or Limited Quirks Mode that affects page layouting. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class QuirksModeIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// If false, it means the document's mode is "quirks" + /// instead of "limited-quirks". + /// + [DataMember(Name = ("isLimitedQuirksMode"), IsRequired = (true))] + public bool IsLimitedQuirksMode + { + get; + set; + } + + /// + /// DocumentNodeId + /// + [DataMember(Name = ("documentNodeId"), IsRequired = (true))] + public int DocumentNodeId + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// FrameId + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + set; + } + + /// + /// LoaderId + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + set; + } + } + + /// + /// NavigatorUserAgentIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class NavigatorUserAgentIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Location + /// + [DataMember(Name = ("location"), IsRequired = (false))] + public CefSharp.DevTools.Audits.SourceCodeLocation Location + { + get; + set; + } + } + + /// + /// SharedDictionaryIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SharedDictionaryIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// SharedDictionaryError + /// + public CefSharp.DevTools.Audits.SharedDictionaryError SharedDictionaryError + { + get + { + return (CefSharp.DevTools.Audits.SharedDictionaryError)(StringToEnum(typeof(CefSharp.DevTools.Audits.SharedDictionaryError), sharedDictionaryError)); + } + + set + { + this.sharedDictionaryError = (EnumToString(value)); + } + } + + /// + /// SharedDictionaryError + /// + [DataMember(Name = ("sharedDictionaryError"), IsRequired = (true))] + internal string sharedDictionaryError + { + get; + set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// SRIMessageSignatureIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SRIMessageSignatureIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error + /// + public CefSharp.DevTools.Audits.SRIMessageSignatureError Error + { + get + { + return (CefSharp.DevTools.Audits.SRIMessageSignatureError)(StringToEnum(typeof(CefSharp.DevTools.Audits.SRIMessageSignatureError), error)); + } + + set + { + this.error = (EnumToString(value)); + } + } + + /// + /// Error + /// + [DataMember(Name = ("error"), IsRequired = (true))] + internal string error + { + get; + set; + } + + /// + /// SignatureBase + /// + [DataMember(Name = ("signatureBase"), IsRequired = (true))] + public string SignatureBase + { + get; + set; + } + + /// + /// IntegrityAssertions + /// + [DataMember(Name = ("integrityAssertions"), IsRequired = (true))] + public string[] IntegrityAssertions + { + get; + set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// UnencodedDigestIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class UnencodedDigestIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error + /// + public CefSharp.DevTools.Audits.UnencodedDigestError Error + { + get + { + return (CefSharp.DevTools.Audits.UnencodedDigestError)(StringToEnum(typeof(CefSharp.DevTools.Audits.UnencodedDigestError), error)); + } + + set + { + this.error = (EnumToString(value)); + } + } + + /// + /// Error + /// + [DataMember(Name = ("error"), IsRequired = (true))] + internal string error + { + get; + set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// ConnectionAllowlistIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ConnectionAllowlistIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error + /// + public CefSharp.DevTools.Audits.ConnectionAllowlistError Error + { + get + { + return (CefSharp.DevTools.Audits.ConnectionAllowlistError)(StringToEnum(typeof(CefSharp.DevTools.Audits.ConnectionAllowlistError), error)); + } + + set + { + this.error = (EnumToString(value)); + } + } + + /// + /// Error + /// + [DataMember(Name = ("error"), IsRequired = (true))] + internal string error + { + get; + set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// GenericIssueErrorType + /// + public enum GenericIssueErrorType + { + /// + /// FormLabelForNameError + /// + [EnumMember(Value = ("FormLabelForNameError"))] + FormLabelForNameError, + /// + /// FormDuplicateIdForInputError + /// + [EnumMember(Value = ("FormDuplicateIdForInputError"))] + FormDuplicateIdForInputError, + /// + /// FormInputWithNoLabelError + /// + [EnumMember(Value = ("FormInputWithNoLabelError"))] + FormInputWithNoLabelError, + /// + /// FormAutocompleteAttributeEmptyError + /// + [EnumMember(Value = ("FormAutocompleteAttributeEmptyError"))] + FormAutocompleteAttributeEmptyError, + /// + /// FormEmptyIdAndNameAttributesForInputError + /// + [EnumMember(Value = ("FormEmptyIdAndNameAttributesForInputError"))] + FormEmptyIdAndNameAttributesForInputError, + /// + /// FormAriaLabelledByToNonExistingIdError + /// + [EnumMember(Value = ("FormAriaLabelledByToNonExistingIdError"))] + FormAriaLabelledByToNonExistingIdError, + /// + /// FormInputAssignedAutocompleteValueToIdOrNameAttributeError + /// + [EnumMember(Value = ("FormInputAssignedAutocompleteValueToIdOrNameAttributeError"))] + FormInputAssignedAutocompleteValueToIdOrNameAttributeError, + /// + /// FormLabelHasNeitherForNorNestedInputError + /// + [EnumMember(Value = ("FormLabelHasNeitherForNorNestedInputError"))] + FormLabelHasNeitherForNorNestedInputError, + /// + /// FormLabelForMatchesNonExistingIdError + /// + [EnumMember(Value = ("FormLabelForMatchesNonExistingIdError"))] + FormLabelForMatchesNonExistingIdError, + /// + /// FormInputHasWrongButWellIntendedAutocompleteValueError + /// + [EnumMember(Value = ("FormInputHasWrongButWellIntendedAutocompleteValueError"))] + FormInputHasWrongButWellIntendedAutocompleteValueError, + /// + /// ResponseWasBlockedByORB + /// + [EnumMember(Value = ("ResponseWasBlockedByORB"))] + ResponseWasBlockedByORB, + /// + /// NavigationEntryMarkedSkippable + /// + [EnumMember(Value = ("NavigationEntryMarkedSkippable"))] + NavigationEntryMarkedSkippable, + /// + /// AutofillAndManualTextPolicyControlledFeaturesInfo + /// + [EnumMember(Value = ("AutofillAndManualTextPolicyControlledFeaturesInfo"))] + AutofillAndManualTextPolicyControlledFeaturesInfo, + /// + /// AutofillPolicyControlledFeatureInfo + /// + [EnumMember(Value = ("AutofillPolicyControlledFeatureInfo"))] + AutofillPolicyControlledFeatureInfo, + /// + /// ManualTextPolicyControlledFeatureInfo + /// + [EnumMember(Value = ("ManualTextPolicyControlledFeatureInfo"))] + ManualTextPolicyControlledFeatureInfo + } + + /// + /// Depending on the concrete errorType, different properties are set. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class GenericIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Issues with the same errorType are aggregated in the frontend. + /// + public CefSharp.DevTools.Audits.GenericIssueErrorType ErrorType + { + get + { + return (CefSharp.DevTools.Audits.GenericIssueErrorType)(StringToEnum(typeof(CefSharp.DevTools.Audits.GenericIssueErrorType), errorType)); + } + + set + { + this.errorType = (EnumToString(value)); + } + } + + /// + /// Issues with the same errorType are aggregated in the frontend. + /// + [DataMember(Name = ("errorType"), IsRequired = (true))] + internal string errorType + { + get; + set; + } + + /// + /// FrameId + /// + [DataMember(Name = ("frameId"), IsRequired = (false))] + public string FrameId + { + get; + set; + } + + /// + /// ViolatingNodeId + /// + [DataMember(Name = ("violatingNodeId"), IsRequired = (false))] + public int? ViolatingNodeId + { + get; + set; + } + + /// + /// ViolatingNodeAttribute + /// + [DataMember(Name = ("violatingNodeAttribute"), IsRequired = (false))] + public string ViolatingNodeAttribute + { + get; + set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// This issue tracks information needed to print a deprecation message. + /// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DeprecationIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// AffectedFrame + /// + [DataMember(Name = ("affectedFrame"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedFrame AffectedFrame + { + get; + set; + } + + /// + /// SourceCodeLocation + /// + [DataMember(Name = ("sourceCodeLocation"), IsRequired = (true))] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5 + /// + [DataMember(Name = ("type"), IsRequired = (true))] + public string Type + { + get; + set; + } + } + + /// + /// This issue warns about sites in the redirect chain of a finished navigation + /// that may be flagged as trackers and have their state cleared if they don't + /// receive a user interaction. Note that in this context 'site' means eTLD+1. + /// For example, if the URL `https://example.test:80/bounce` was in the + /// redirect chain, the site reported would be `example.test`. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BounceTrackingIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TrackingSites + /// + [DataMember(Name = ("trackingSites"), IsRequired = (true))] + public string[] TrackingSites + { + get; + set; + } + } + + /// + /// This issue warns about third-party sites that are accessing cookies on the + /// current page, and have been permitted due to having a global metadata grant. + /// Note that in this context 'site' means eTLD+1. For example, if the URL + /// `https://example.test:80/web_page` was accessing cookies, the site reported + /// would be `example.test`. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CookieDeprecationMetadataIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// AllowedSites + /// + [DataMember(Name = ("allowedSites"), IsRequired = (true))] + public string[] AllowedSites + { + get; + set; + } + + /// + /// OptOutPercentage + /// + [DataMember(Name = ("optOutPercentage"), IsRequired = (true))] + public double OptOutPercentage + { + get; + set; + } + + /// + /// IsOptOutTopLevel + /// + [DataMember(Name = ("isOptOutTopLevel"), IsRequired = (true))] + public bool IsOptOutTopLevel + { + get; + set; + } + + /// + /// Operation + /// + public CefSharp.DevTools.Audits.CookieOperation Operation + { + get + { + return (CefSharp.DevTools.Audits.CookieOperation)(StringToEnum(typeof(CefSharp.DevTools.Audits.CookieOperation), operation)); + } + + set + { + this.operation = (EnumToString(value)); + } + } + + /// + /// Operation + /// + [DataMember(Name = ("operation"), IsRequired = (true))] + internal string operation + { + get; + set; + } + } + + /// + /// ClientHintIssueReason + /// + public enum ClientHintIssueReason + { + /// + /// MetaTagAllowListInvalidOrigin + /// + [EnumMember(Value = ("MetaTagAllowListInvalidOrigin"))] + MetaTagAllowListInvalidOrigin, + /// + /// MetaTagModifiedHTML + /// + [EnumMember(Value = ("MetaTagModifiedHTML"))] + MetaTagModifiedHTML + } + + /// + /// FederatedAuthRequestIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FederatedAuthRequestIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FederatedAuthRequestIssueReason + /// + public CefSharp.DevTools.Audits.FederatedAuthRequestIssueReason FederatedAuthRequestIssueReason + { + get + { + return (CefSharp.DevTools.Audits.FederatedAuthRequestIssueReason)(StringToEnum(typeof(CefSharp.DevTools.Audits.FederatedAuthRequestIssueReason), federatedAuthRequestIssueReason)); + } + + set + { + this.federatedAuthRequestIssueReason = (EnumToString(value)); + } + } + + /// + /// FederatedAuthRequestIssueReason + /// + [DataMember(Name = ("federatedAuthRequestIssueReason"), IsRequired = (true))] + internal string federatedAuthRequestIssueReason + { + get; + set; + } + } + + /// + /// Represents the failure reason when a federated authentication reason fails. + /// Should be updated alongside RequestIdTokenStatus in + /// third_party/blink/public/mojom/devtools/inspector_issue.mojom to include + /// all cases except for success. + /// + public enum FederatedAuthRequestIssueReason + { + /// + /// ShouldEmbargo + /// + [EnumMember(Value = ("ShouldEmbargo"))] + ShouldEmbargo, + /// + /// TooManyRequests + /// + [EnumMember(Value = ("TooManyRequests"))] + TooManyRequests, + /// + /// WellKnownHttpNotFound + /// + [EnumMember(Value = ("WellKnownHttpNotFound"))] + WellKnownHttpNotFound, + /// + /// WellKnownNoResponse + /// + [EnumMember(Value = ("WellKnownNoResponse"))] + WellKnownNoResponse, + /// + /// WellKnownInvalidResponse + /// + [EnumMember(Value = ("WellKnownInvalidResponse"))] + WellKnownInvalidResponse, + /// + /// WellKnownListEmpty + /// + [EnumMember(Value = ("WellKnownListEmpty"))] + WellKnownListEmpty, + /// + /// WellKnownInvalidContentType + /// + [EnumMember(Value = ("WellKnownInvalidContentType"))] + WellKnownInvalidContentType, + /// + /// ConfigNotInWellKnown + /// + [EnumMember(Value = ("ConfigNotInWellKnown"))] + ConfigNotInWellKnown, + /// + /// WellKnownTooBig + /// + [EnumMember(Value = ("WellKnownTooBig"))] + WellKnownTooBig, + /// + /// ConfigHttpNotFound + /// + [EnumMember(Value = ("ConfigHttpNotFound"))] + ConfigHttpNotFound, + /// + /// ConfigNoResponse + /// + [EnumMember(Value = ("ConfigNoResponse"))] + ConfigNoResponse, + /// + /// ConfigInvalidResponse + /// + [EnumMember(Value = ("ConfigInvalidResponse"))] + ConfigInvalidResponse, + /// + /// ConfigInvalidContentType + /// + [EnumMember(Value = ("ConfigInvalidContentType"))] + ConfigInvalidContentType, + /// + /// ClientMetadataHttpNotFound + /// + [EnumMember(Value = ("ClientMetadataHttpNotFound"))] + ClientMetadataHttpNotFound, + /// + /// ClientMetadataNoResponse + /// + [EnumMember(Value = ("ClientMetadataNoResponse"))] + ClientMetadataNoResponse, + /// + /// ClientMetadataInvalidResponse + /// + [EnumMember(Value = ("ClientMetadataInvalidResponse"))] + ClientMetadataInvalidResponse, + /// + /// ClientMetadataInvalidContentType + /// + [EnumMember(Value = ("ClientMetadataInvalidContentType"))] + ClientMetadataInvalidContentType, + /// + /// IdpNotPotentiallyTrustworthy + /// + [EnumMember(Value = ("IdpNotPotentiallyTrustworthy"))] + IdpNotPotentiallyTrustworthy, + /// + /// DisabledInSettings + /// + [EnumMember(Value = ("DisabledInSettings"))] + DisabledInSettings, + /// + /// DisabledInFlags + /// + [EnumMember(Value = ("DisabledInFlags"))] + DisabledInFlags, + /// + /// ErrorFetchingSignin + /// + [EnumMember(Value = ("ErrorFetchingSignin"))] + ErrorFetchingSignin, + /// + /// InvalidSigninResponse + /// + [EnumMember(Value = ("InvalidSigninResponse"))] + InvalidSigninResponse, + /// + /// AccountsHttpNotFound + /// + [EnumMember(Value = ("AccountsHttpNotFound"))] + AccountsHttpNotFound, + /// + /// AccountsNoResponse + /// + [EnumMember(Value = ("AccountsNoResponse"))] + AccountsNoResponse, + /// + /// AccountsInvalidResponse + /// + [EnumMember(Value = ("AccountsInvalidResponse"))] + AccountsInvalidResponse, + /// + /// AccountsListEmpty + /// + [EnumMember(Value = ("AccountsListEmpty"))] + AccountsListEmpty, + /// + /// AccountsInvalidContentType + /// + [EnumMember(Value = ("AccountsInvalidContentType"))] + AccountsInvalidContentType, + /// + /// IdTokenHttpNotFound + /// + [EnumMember(Value = ("IdTokenHttpNotFound"))] + IdTokenHttpNotFound, + /// + /// IdTokenNoResponse + /// + [EnumMember(Value = ("IdTokenNoResponse"))] + IdTokenNoResponse, + /// + /// IdTokenInvalidResponse + /// + [EnumMember(Value = ("IdTokenInvalidResponse"))] + IdTokenInvalidResponse, + /// + /// IdTokenIdpErrorResponse + /// + [EnumMember(Value = ("IdTokenIdpErrorResponse"))] + IdTokenIdpErrorResponse, + /// + /// IdTokenCrossSiteIdpErrorResponse + /// + [EnumMember(Value = ("IdTokenCrossSiteIdpErrorResponse"))] + IdTokenCrossSiteIdpErrorResponse, + /// + /// IdTokenInvalidRequest + /// + [EnumMember(Value = ("IdTokenInvalidRequest"))] + IdTokenInvalidRequest, + /// + /// IdTokenInvalidContentType + /// + [EnumMember(Value = ("IdTokenInvalidContentType"))] + IdTokenInvalidContentType, + /// + /// ErrorIdToken + /// + [EnumMember(Value = ("ErrorIdToken"))] + ErrorIdToken, + /// + /// Canceled + /// + [EnumMember(Value = ("Canceled"))] + Canceled, + /// + /// RpPageNotVisible + /// + [EnumMember(Value = ("RpPageNotVisible"))] + RpPageNotVisible, + /// + /// SilentMediationFailure + /// + [EnumMember(Value = ("SilentMediationFailure"))] + SilentMediationFailure, + /// + /// ThirdPartyCookiesBlocked + /// + [EnumMember(Value = ("ThirdPartyCookiesBlocked"))] + ThirdPartyCookiesBlocked, + /// + /// NotSignedInWithIdp + /// + [EnumMember(Value = ("NotSignedInWithIdp"))] + NotSignedInWithIdp, + /// + /// MissingTransientUserActivation + /// + [EnumMember(Value = ("MissingTransientUserActivation"))] + MissingTransientUserActivation, + /// + /// ReplacedByActiveMode + /// + [EnumMember(Value = ("ReplacedByActiveMode"))] + ReplacedByActiveMode, + /// + /// InvalidFieldsSpecified + /// + [EnumMember(Value = ("InvalidFieldsSpecified"))] + InvalidFieldsSpecified, + /// + /// RelyingPartyOriginIsOpaque + /// + [EnumMember(Value = ("RelyingPartyOriginIsOpaque"))] + RelyingPartyOriginIsOpaque, + /// + /// TypeNotMatching + /// + [EnumMember(Value = ("TypeNotMatching"))] + TypeNotMatching, + /// + /// UiDismissedNoEmbargo + /// + [EnumMember(Value = ("UiDismissedNoEmbargo"))] + UiDismissedNoEmbargo, + /// + /// CorsError + /// + [EnumMember(Value = ("CorsError"))] + CorsError, + /// + /// SuppressedBySegmentationPlatform + /// + [EnumMember(Value = ("SuppressedBySegmentationPlatform"))] + SuppressedBySegmentationPlatform + } + + /// + /// FederatedAuthUserInfoRequestIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FederatedAuthUserInfoRequestIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FederatedAuthUserInfoRequestIssueReason + /// + public CefSharp.DevTools.Audits.FederatedAuthUserInfoRequestIssueReason FederatedAuthUserInfoRequestIssueReason + { + get + { + return (CefSharp.DevTools.Audits.FederatedAuthUserInfoRequestIssueReason)(StringToEnum(typeof(CefSharp.DevTools.Audits.FederatedAuthUserInfoRequestIssueReason), federatedAuthUserInfoRequestIssueReason)); + } + + set + { + this.federatedAuthUserInfoRequestIssueReason = (EnumToString(value)); + } + } + + /// + /// FederatedAuthUserInfoRequestIssueReason + /// + [DataMember(Name = ("federatedAuthUserInfoRequestIssueReason"), IsRequired = (true))] + internal string federatedAuthUserInfoRequestIssueReason + { + get; + set; + } + } + + /// + /// Represents the failure reason when a getUserInfo() call fails. + /// Should be updated alongside FederatedAuthUserInfoRequestResult in + /// third_party/blink/public/mojom/devtools/inspector_issue.mojom. + /// + public enum FederatedAuthUserInfoRequestIssueReason + { + /// + /// NotSameOrigin + /// + [EnumMember(Value = ("NotSameOrigin"))] + NotSameOrigin, + /// + /// NotIframe + /// + [EnumMember(Value = ("NotIframe"))] + NotIframe, + /// + /// NotPotentiallyTrustworthy + /// + [EnumMember(Value = ("NotPotentiallyTrustworthy"))] + NotPotentiallyTrustworthy, + /// + /// NoApiPermission + /// + [EnumMember(Value = ("NoApiPermission"))] + NoApiPermission, + /// + /// NotSignedInWithIdp + /// + [EnumMember(Value = ("NotSignedInWithIdp"))] + NotSignedInWithIdp, + /// + /// NoAccountSharingPermission + /// + [EnumMember(Value = ("NoAccountSharingPermission"))] + NoAccountSharingPermission, + /// + /// InvalidConfigOrWellKnown + /// + [EnumMember(Value = ("InvalidConfigOrWellKnown"))] + InvalidConfigOrWellKnown, + /// + /// InvalidAccountsResponse + /// + [EnumMember(Value = ("InvalidAccountsResponse"))] + InvalidAccountsResponse, + /// + /// NoReturningUserFromFetchedAccounts + /// + [EnumMember(Value = ("NoReturningUserFromFetchedAccounts"))] + NoReturningUserFromFetchedAccounts + } + + /// + /// This issue tracks client hints related issues. It's used to deprecate old + /// features, encourage the use of new ones, and provide general guidance. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ClientHintIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// SourceCodeLocation + /// + [DataMember(Name = ("sourceCodeLocation"), IsRequired = (true))] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// ClientHintIssueReason + /// + public CefSharp.DevTools.Audits.ClientHintIssueReason ClientHintIssueReason + { + get + { + return (CefSharp.DevTools.Audits.ClientHintIssueReason)(StringToEnum(typeof(CefSharp.DevTools.Audits.ClientHintIssueReason), clientHintIssueReason)); + } + + set + { + this.clientHintIssueReason = (EnumToString(value)); + } + } + + /// + /// ClientHintIssueReason + /// + [DataMember(Name = ("clientHintIssueReason"), IsRequired = (true))] + internal string clientHintIssueReason + { + get; + set; + } + } + + /// + /// FailedRequestInfo + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FailedRequestInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The URL that failed to load. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// The failure message for the failed request. + /// + [DataMember(Name = ("failureMessage"), IsRequired = (true))] + public string FailureMessage + { + get; + set; + } + + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (false))] + public string RequestId + { + get; + set; + } + } + + /// + /// PartitioningBlobURLInfo + /// + public enum PartitioningBlobURLInfo + { + /// + /// BlockedCrossPartitionFetching + /// + [EnumMember(Value = ("BlockedCrossPartitionFetching"))] + BlockedCrossPartitionFetching, + /// + /// EnforceNoopenerForNavigation + /// + [EnumMember(Value = ("EnforceNoopenerForNavigation"))] + EnforceNoopenerForNavigation + } + + /// + /// PartitioningBlobURLIssueDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PartitioningBlobURLIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The BlobURL that failed to load. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Additional information about the Partitioning Blob URL issue. + /// + public CefSharp.DevTools.Audits.PartitioningBlobURLInfo PartitioningBlobURLInfo + { + get + { + return (CefSharp.DevTools.Audits.PartitioningBlobURLInfo)(StringToEnum(typeof(CefSharp.DevTools.Audits.PartitioningBlobURLInfo), partitioningBlobURLInfo)); + } + + set + { + this.partitioningBlobURLInfo = (EnumToString(value)); + } + } + + /// + /// Additional information about the Partitioning Blob URL issue. + /// + [DataMember(Name = ("partitioningBlobURLInfo"), IsRequired = (true))] + internal string partitioningBlobURLInfo + { + get; + set; + } + } + + /// + /// ElementAccessibilityIssueReason + /// + public enum ElementAccessibilityIssueReason + { + /// + /// DisallowedSelectChild + /// + [EnumMember(Value = ("DisallowedSelectChild"))] + DisallowedSelectChild, + /// + /// DisallowedOptGroupChild + /// + [EnumMember(Value = ("DisallowedOptGroupChild"))] + DisallowedOptGroupChild, + /// + /// NonPhrasingContentOptionChild + /// + [EnumMember(Value = ("NonPhrasingContentOptionChild"))] + NonPhrasingContentOptionChild, + /// + /// InteractiveContentOptionChild + /// + [EnumMember(Value = ("InteractiveContentOptionChild"))] + InteractiveContentOptionChild, + /// + /// InteractiveContentLegendChild + /// + [EnumMember(Value = ("InteractiveContentLegendChild"))] + InteractiveContentLegendChild, + /// + /// InteractiveContentSummaryDescendant + /// + [EnumMember(Value = ("InteractiveContentSummaryDescendant"))] + InteractiveContentSummaryDescendant + } + + /// + /// This issue warns about errors in the select or summary element content model. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ElementAccessibilityIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// NodeId + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + set; + } + + /// + /// ElementAccessibilityIssueReason + /// + public CefSharp.DevTools.Audits.ElementAccessibilityIssueReason ElementAccessibilityIssueReason + { + get + { + return (CefSharp.DevTools.Audits.ElementAccessibilityIssueReason)(StringToEnum(typeof(CefSharp.DevTools.Audits.ElementAccessibilityIssueReason), elementAccessibilityIssueReason)); + } + + set + { + this.elementAccessibilityIssueReason = (EnumToString(value)); + } + } + + /// + /// ElementAccessibilityIssueReason + /// + [DataMember(Name = ("elementAccessibilityIssueReason"), IsRequired = (true))] + internal string elementAccessibilityIssueReason + { + get; + set; + } + + /// + /// HasDisallowedAttributes + /// + [DataMember(Name = ("hasDisallowedAttributes"), IsRequired = (true))] + public bool HasDisallowedAttributes + { + get; + set; + } + } + + /// + /// StyleSheetLoadingIssueReason + /// + public enum StyleSheetLoadingIssueReason + { + /// + /// LateImportRule + /// + [EnumMember(Value = ("LateImportRule"))] + LateImportRule, + /// + /// RequestFailed + /// + [EnumMember(Value = ("RequestFailed"))] + RequestFailed + } + + /// + /// This issue warns when a referenced stylesheet couldn't be loaded. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class StylesheetLoadingIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source code position that referenced the failing stylesheet. + /// + [DataMember(Name = ("sourceCodeLocation"), IsRequired = (true))] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// Reason why the stylesheet couldn't be loaded. + /// + public CefSharp.DevTools.Audits.StyleSheetLoadingIssueReason StyleSheetLoadingIssueReason + { + get + { + return (CefSharp.DevTools.Audits.StyleSheetLoadingIssueReason)(StringToEnum(typeof(CefSharp.DevTools.Audits.StyleSheetLoadingIssueReason), styleSheetLoadingIssueReason)); + } + + set + { + this.styleSheetLoadingIssueReason = (EnumToString(value)); + } + } + + /// + /// Reason why the stylesheet couldn't be loaded. + /// + [DataMember(Name = ("styleSheetLoadingIssueReason"), IsRequired = (true))] + internal string styleSheetLoadingIssueReason + { + get; + set; + } + + /// + /// Contains additional info when the failure was due to a request. + /// + [DataMember(Name = ("failedRequestInfo"), IsRequired = (false))] + public CefSharp.DevTools.Audits.FailedRequestInfo FailedRequestInfo + { + get; + set; + } + } + + /// + /// PropertyRuleIssueReason + /// + public enum PropertyRuleIssueReason + { + /// + /// InvalidSyntax + /// + [EnumMember(Value = ("InvalidSyntax"))] + InvalidSyntax, + /// + /// InvalidInitialValue + /// + [EnumMember(Value = ("InvalidInitialValue"))] + InvalidInitialValue, + /// + /// InvalidInherits + /// + [EnumMember(Value = ("InvalidInherits"))] + InvalidInherits, + /// + /// InvalidName + /// + [EnumMember(Value = ("InvalidName"))] + InvalidName + } + + /// + /// This issue warns about errors in property rules that lead to property + /// registrations being ignored. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PropertyRuleIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source code position of the property rule. + /// + [DataMember(Name = ("sourceCodeLocation"), IsRequired = (true))] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// Reason why the property rule was discarded. + /// + public CefSharp.DevTools.Audits.PropertyRuleIssueReason PropertyRuleIssueReason + { + get + { + return (CefSharp.DevTools.Audits.PropertyRuleIssueReason)(StringToEnum(typeof(CefSharp.DevTools.Audits.PropertyRuleIssueReason), propertyRuleIssueReason)); + } + + set + { + this.propertyRuleIssueReason = (EnumToString(value)); + } + } + + /// + /// Reason why the property rule was discarded. + /// + [DataMember(Name = ("propertyRuleIssueReason"), IsRequired = (true))] + internal string propertyRuleIssueReason + { + get; + set; + } + + /// + /// The value of the property rule property that failed to parse + /// + [DataMember(Name = ("propertyValue"), IsRequired = (false))] + public string PropertyValue + { + get; + set; + } + } + + /// + /// UserReidentificationIssueType + /// + public enum UserReidentificationIssueType + { + /// + /// BlockedFrameNavigation + /// + [EnumMember(Value = ("BlockedFrameNavigation"))] + BlockedFrameNavigation, + /// + /// BlockedSubresource + /// + [EnumMember(Value = ("BlockedSubresource"))] + BlockedSubresource, + /// + /// NoisedCanvasReadback + /// + [EnumMember(Value = ("NoisedCanvasReadback"))] + NoisedCanvasReadback + } + + /// + /// This issue warns about uses of APIs that may be considered misuse to + /// re-identify users. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class UserReidentificationIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type + /// + public CefSharp.DevTools.Audits.UserReidentificationIssueType Type + { + get + { + return (CefSharp.DevTools.Audits.UserReidentificationIssueType)(StringToEnum(typeof(CefSharp.DevTools.Audits.UserReidentificationIssueType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Applies to BlockedFrameNavigation and BlockedSubresource issue types. + /// + [DataMember(Name = ("request"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// Applies to NoisedCanvasReadback issue type. + /// + [DataMember(Name = ("sourceCodeLocation"), IsRequired = (false))] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + } + + /// + /// PermissionElementIssueType + /// + public enum PermissionElementIssueType + { + /// + /// InvalidType + /// + [EnumMember(Value = ("InvalidType"))] + InvalidType, + /// + /// FencedFrameDisallowed + /// + [EnumMember(Value = ("FencedFrameDisallowed"))] + FencedFrameDisallowed, + /// + /// CspFrameAncestorsMissing + /// + [EnumMember(Value = ("CspFrameAncestorsMissing"))] + CspFrameAncestorsMissing, + /// + /// PermissionsPolicyBlocked + /// + [EnumMember(Value = ("PermissionsPolicyBlocked"))] + PermissionsPolicyBlocked, + /// + /// PaddingRightUnsupported + /// + [EnumMember(Value = ("PaddingRightUnsupported"))] + PaddingRightUnsupported, + /// + /// PaddingBottomUnsupported + /// + [EnumMember(Value = ("PaddingBottomUnsupported"))] + PaddingBottomUnsupported, + /// + /// InsetBoxShadowUnsupported + /// + [EnumMember(Value = ("InsetBoxShadowUnsupported"))] + InsetBoxShadowUnsupported, + /// + /// RequestInProgress + /// + [EnumMember(Value = ("RequestInProgress"))] + RequestInProgress, + /// + /// UntrustedEvent + /// + [EnumMember(Value = ("UntrustedEvent"))] + UntrustedEvent, + /// + /// RegistrationFailed + /// + [EnumMember(Value = ("RegistrationFailed"))] + RegistrationFailed, + /// + /// TypeNotSupported + /// + [EnumMember(Value = ("TypeNotSupported"))] + TypeNotSupported, + /// + /// InvalidTypeActivation + /// + [EnumMember(Value = ("InvalidTypeActivation"))] + InvalidTypeActivation, + /// + /// SecurityChecksFailed + /// + [EnumMember(Value = ("SecurityChecksFailed"))] + SecurityChecksFailed, + /// + /// ActivationDisabled + /// + [EnumMember(Value = ("ActivationDisabled"))] + ActivationDisabled, + /// + /// GeolocationDeprecated + /// + [EnumMember(Value = ("GeolocationDeprecated"))] + GeolocationDeprecated, + /// + /// InvalidDisplayStyle + /// + [EnumMember(Value = ("InvalidDisplayStyle"))] + InvalidDisplayStyle, + /// + /// NonOpaqueColor + /// + [EnumMember(Value = ("NonOpaqueColor"))] + NonOpaqueColor, + /// + /// LowContrast + /// + [EnumMember(Value = ("LowContrast"))] + LowContrast, + /// + /// FontSizeTooSmall + /// + [EnumMember(Value = ("FontSizeTooSmall"))] + FontSizeTooSmall, + /// + /// FontSizeTooLarge + /// + [EnumMember(Value = ("FontSizeTooLarge"))] + FontSizeTooLarge, + /// + /// InvalidSizeValue + /// + [EnumMember(Value = ("InvalidSizeValue"))] + InvalidSizeValue + } + + /// + /// This issue warns about improper usage of the <permission> element. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PermissionElementIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// IssueType + /// + public CefSharp.DevTools.Audits.PermissionElementIssueType IssueType + { + get + { + return (CefSharp.DevTools.Audits.PermissionElementIssueType)(StringToEnum(typeof(CefSharp.DevTools.Audits.PermissionElementIssueType), issueType)); + } + + set + { + this.issueType = (EnumToString(value)); + } + } + + /// + /// IssueType + /// + [DataMember(Name = ("issueType"), IsRequired = (true))] + internal string issueType + { + get; + set; + } + + /// + /// The value of the type attribute. + /// + [DataMember(Name = ("type"), IsRequired = (false))] + public string Type + { + get; + set; + } + + /// + /// The node ID of the <permission> element. + /// + [DataMember(Name = ("nodeId"), IsRequired = (false))] + public int? NodeId + { + get; + set; + } + + /// + /// True if the issue is a warning, false if it is an error. + /// + [DataMember(Name = ("isWarning"), IsRequired = (false))] + public bool? IsWarning + { + get; + set; + } + + /// + /// Fields for message construction: + /// Used for messages that reference a specific permission name + /// + [DataMember(Name = ("permissionName"), IsRequired = (false))] + public string PermissionName + { + get; + set; + } + + /// + /// Used for messages about occlusion + /// + [DataMember(Name = ("occluderNodeInfo"), IsRequired = (false))] + public string OccluderNodeInfo + { + get; + set; + } + + /// + /// Used for messages about occluder's parent + /// + [DataMember(Name = ("occluderParentNodeInfo"), IsRequired = (false))] + public string OccluderParentNodeInfo + { + get; + set; + } + + /// + /// Used for messages about activation disabled reason + /// + [DataMember(Name = ("disableReason"), IsRequired = (false))] + public string DisableReason + { + get; + set; + } + } + + /// + /// A unique identifier for the type of issue. Each type may use one of the + /// optional fields in InspectorIssueDetails to convey more specific + /// information about the kind of issue. + /// + public enum InspectorIssueCode + { + /// + /// CookieIssue + /// + [EnumMember(Value = ("CookieIssue"))] + CookieIssue, + /// + /// MixedContentIssue + /// + [EnumMember(Value = ("MixedContentIssue"))] + MixedContentIssue, + /// + /// BlockedByResponseIssue + /// + [EnumMember(Value = ("BlockedByResponseIssue"))] + BlockedByResponseIssue, + /// + /// HeavyAdIssue + /// + [EnumMember(Value = ("HeavyAdIssue"))] + HeavyAdIssue, + /// + /// ContentSecurityPolicyIssue + /// + [EnumMember(Value = ("ContentSecurityPolicyIssue"))] + ContentSecurityPolicyIssue, + /// + /// SharedArrayBufferIssue + /// + [EnumMember(Value = ("SharedArrayBufferIssue"))] + SharedArrayBufferIssue, + /// + /// LowTextContrastIssue + /// + [EnumMember(Value = ("LowTextContrastIssue"))] + LowTextContrastIssue, + /// + /// CorsIssue + /// + [EnumMember(Value = ("CorsIssue"))] + CorsIssue, + /// + /// AttributionReportingIssue + /// + [EnumMember(Value = ("AttributionReportingIssue"))] + AttributionReportingIssue, + /// + /// QuirksModeIssue + /// + [EnumMember(Value = ("QuirksModeIssue"))] + QuirksModeIssue, + /// + /// PartitioningBlobURLIssue + /// + [EnumMember(Value = ("PartitioningBlobURLIssue"))] + PartitioningBlobURLIssue, + /// + /// NavigatorUserAgentIssue + /// + [EnumMember(Value = ("NavigatorUserAgentIssue"))] + NavigatorUserAgentIssue, + /// + /// GenericIssue + /// + [EnumMember(Value = ("GenericIssue"))] + GenericIssue, + /// + /// DeprecationIssue + /// + [EnumMember(Value = ("DeprecationIssue"))] + DeprecationIssue, + /// + /// ClientHintIssue + /// + [EnumMember(Value = ("ClientHintIssue"))] + ClientHintIssue, + /// + /// FederatedAuthRequestIssue + /// + [EnumMember(Value = ("FederatedAuthRequestIssue"))] + FederatedAuthRequestIssue, + /// + /// BounceTrackingIssue + /// + [EnumMember(Value = ("BounceTrackingIssue"))] + BounceTrackingIssue, + /// + /// CookieDeprecationMetadataIssue + /// + [EnumMember(Value = ("CookieDeprecationMetadataIssue"))] + CookieDeprecationMetadataIssue, + /// + /// StylesheetLoadingIssue + /// + [EnumMember(Value = ("StylesheetLoadingIssue"))] + StylesheetLoadingIssue, + /// + /// FederatedAuthUserInfoRequestIssue + /// + [EnumMember(Value = ("FederatedAuthUserInfoRequestIssue"))] + FederatedAuthUserInfoRequestIssue, + /// + /// PropertyRuleIssue + /// + [EnumMember(Value = ("PropertyRuleIssue"))] + PropertyRuleIssue, + /// + /// SharedDictionaryIssue + /// + [EnumMember(Value = ("SharedDictionaryIssue"))] + SharedDictionaryIssue, + /// + /// ElementAccessibilityIssue + /// + [EnumMember(Value = ("ElementAccessibilityIssue"))] + ElementAccessibilityIssue, + /// + /// SRIMessageSignatureIssue + /// + [EnumMember(Value = ("SRIMessageSignatureIssue"))] + SRIMessageSignatureIssue, + /// + /// UnencodedDigestIssue + /// + [EnumMember(Value = ("UnencodedDigestIssue"))] + UnencodedDigestIssue, + /// + /// ConnectionAllowlistIssue + /// + [EnumMember(Value = ("ConnectionAllowlistIssue"))] + ConnectionAllowlistIssue, + /// + /// UserReidentificationIssue + /// + [EnumMember(Value = ("UserReidentificationIssue"))] + UserReidentificationIssue, + /// + /// PermissionElementIssue + /// + [EnumMember(Value = ("PermissionElementIssue"))] + PermissionElementIssue + } + + /// + /// This struct holds a list of optional fields with additional information + /// specific to the kind of issue. When adding a new issue code, please also + /// add a new optional field to this type. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InspectorIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CookieIssueDetails + /// + [DataMember(Name = ("cookieIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.CookieIssueDetails CookieIssueDetails + { + get; + set; + } + + /// + /// MixedContentIssueDetails + /// + [DataMember(Name = ("mixedContentIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.MixedContentIssueDetails MixedContentIssueDetails + { + get; + set; + } + + /// + /// BlockedByResponseIssueDetails + /// + [DataMember(Name = ("blockedByResponseIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.BlockedByResponseIssueDetails BlockedByResponseIssueDetails + { + get; + set; + } + + /// + /// HeavyAdIssueDetails + /// + [DataMember(Name = ("heavyAdIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.HeavyAdIssueDetails HeavyAdIssueDetails + { + get; + set; + } + + /// + /// ContentSecurityPolicyIssueDetails + /// + [DataMember(Name = ("contentSecurityPolicyIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.ContentSecurityPolicyIssueDetails ContentSecurityPolicyIssueDetails + { + get; + set; + } + + /// + /// SharedArrayBufferIssueDetails + /// + [DataMember(Name = ("sharedArrayBufferIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.SharedArrayBufferIssueDetails SharedArrayBufferIssueDetails + { + get; + set; + } + + /// + /// LowTextContrastIssueDetails + /// + [DataMember(Name = ("lowTextContrastIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.LowTextContrastIssueDetails LowTextContrastIssueDetails + { + get; + set; + } + + /// + /// CorsIssueDetails + /// + [DataMember(Name = ("corsIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.CorsIssueDetails CorsIssueDetails + { + get; + set; + } + + /// + /// AttributionReportingIssueDetails + /// + [DataMember(Name = ("attributionReportingIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.AttributionReportingIssueDetails AttributionReportingIssueDetails + { + get; + set; + } + + /// + /// QuirksModeIssueDetails + /// + [DataMember(Name = ("quirksModeIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.QuirksModeIssueDetails QuirksModeIssueDetails + { + get; + set; + } + + /// + /// PartitioningBlobURLIssueDetails + /// + [DataMember(Name = ("partitioningBlobURLIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.PartitioningBlobURLIssueDetails PartitioningBlobURLIssueDetails + { + get; + set; + } + + /// + /// NavigatorUserAgentIssueDetails + /// + [DataMember(Name = ("navigatorUserAgentIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.NavigatorUserAgentIssueDetails NavigatorUserAgentIssueDetails + { + get; + set; + } + + /// + /// GenericIssueDetails + /// + [DataMember(Name = ("genericIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.GenericIssueDetails GenericIssueDetails + { + get; + set; + } + + /// + /// DeprecationIssueDetails + /// + [DataMember(Name = ("deprecationIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.DeprecationIssueDetails DeprecationIssueDetails + { + get; + set; + } + + /// + /// ClientHintIssueDetails + /// + [DataMember(Name = ("clientHintIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.ClientHintIssueDetails ClientHintIssueDetails + { + get; + set; + } + + /// + /// FederatedAuthRequestIssueDetails + /// + [DataMember(Name = ("federatedAuthRequestIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.FederatedAuthRequestIssueDetails FederatedAuthRequestIssueDetails + { + get; + set; + } + + /// + /// BounceTrackingIssueDetails + /// + [DataMember(Name = ("bounceTrackingIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.BounceTrackingIssueDetails BounceTrackingIssueDetails + { + get; + set; + } + + /// + /// CookieDeprecationMetadataIssueDetails + /// + [DataMember(Name = ("cookieDeprecationMetadataIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.CookieDeprecationMetadataIssueDetails CookieDeprecationMetadataIssueDetails + { + get; + set; + } + + /// + /// StylesheetLoadingIssueDetails + /// + [DataMember(Name = ("stylesheetLoadingIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.StylesheetLoadingIssueDetails StylesheetLoadingIssueDetails + { + get; + set; + } + + /// + /// PropertyRuleIssueDetails + /// + [DataMember(Name = ("propertyRuleIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.PropertyRuleIssueDetails PropertyRuleIssueDetails + { + get; + set; + } + + /// + /// FederatedAuthUserInfoRequestIssueDetails + /// + [DataMember(Name = ("federatedAuthUserInfoRequestIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.FederatedAuthUserInfoRequestIssueDetails FederatedAuthUserInfoRequestIssueDetails + { + get; + set; + } + + /// + /// SharedDictionaryIssueDetails + /// + [DataMember(Name = ("sharedDictionaryIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.SharedDictionaryIssueDetails SharedDictionaryIssueDetails + { + get; + set; + } + + /// + /// ElementAccessibilityIssueDetails + /// + [DataMember(Name = ("elementAccessibilityIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.ElementAccessibilityIssueDetails ElementAccessibilityIssueDetails + { + get; + set; + } + + /// + /// SriMessageSignatureIssueDetails + /// + [DataMember(Name = ("sriMessageSignatureIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.SRIMessageSignatureIssueDetails SriMessageSignatureIssueDetails + { + get; + set; + } + + /// + /// UnencodedDigestIssueDetails + /// + [DataMember(Name = ("unencodedDigestIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.UnencodedDigestIssueDetails UnencodedDigestIssueDetails + { + get; + set; + } + + /// + /// ConnectionAllowlistIssueDetails + /// + [DataMember(Name = ("connectionAllowlistIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.ConnectionAllowlistIssueDetails ConnectionAllowlistIssueDetails + { + get; + set; + } + + /// + /// UserReidentificationIssueDetails + /// + [DataMember(Name = ("userReidentificationIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.UserReidentificationIssueDetails UserReidentificationIssueDetails + { + get; + set; + } + + /// + /// PermissionElementIssueDetails + /// + [DataMember(Name = ("permissionElementIssueDetails"), IsRequired = (false))] + public CefSharp.DevTools.Audits.PermissionElementIssueDetails PermissionElementIssueDetails + { + get; + set; + } + } + + /// + /// An inspector issue reported from the back-end. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InspectorIssue : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Code + /// + public CefSharp.DevTools.Audits.InspectorIssueCode Code + { + get + { + return (CefSharp.DevTools.Audits.InspectorIssueCode)(StringToEnum(typeof(CefSharp.DevTools.Audits.InspectorIssueCode), code)); + } + + set + { + this.code = (EnumToString(value)); + } + } + + /// + /// Code + /// + [DataMember(Name = ("code"), IsRequired = (true))] + internal string code + { + get; + set; + } + + /// + /// Details + /// + [DataMember(Name = ("details"), IsRequired = (true))] + public CefSharp.DevTools.Audits.InspectorIssueDetails Details + { + get; + set; + } + + /// + /// A unique id for this issue. May be omitted if no other entity (e.g. + /// exception, CDP message, etc.) is referencing this issue. + /// + [DataMember(Name = ("issueId"), IsRequired = (false))] + public string IssueId + { + get; + set; + } + } + + /// + /// issueAdded + /// + [System.Runtime.Serialization.DataContractAttribute] + public class IssueAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Issue + /// + [DataMember(Name = ("issue"), IsRequired = (true))] + public CefSharp.DevTools.Audits.InspectorIssue Issue + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Autofill +{ + /// + /// CreditCard + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CreditCard : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// 16-digit credit card number. + /// + [DataMember(Name = ("number"), IsRequired = (true))] + public string Number + { + get; + set; + } + + /// + /// Name of the credit card owner. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// 2-digit expiry month. + /// + [DataMember(Name = ("expiryMonth"), IsRequired = (true))] + public string ExpiryMonth + { + get; + set; + } + + /// + /// 4-digit expiry year. + /// + [DataMember(Name = ("expiryYear"), IsRequired = (true))] + public string ExpiryYear + { + get; + set; + } + + /// + /// 3-digit card verification code. + /// + [DataMember(Name = ("cvc"), IsRequired = (true))] + public string Cvc + { + get; + set; + } + } + + /// + /// AddressField + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AddressField : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// address field name, for example GIVEN_NAME. + /// The full list of supported field names: + /// https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/field_types.cc;l=38 + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// address field value, for example Jon Doe. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// A list of address fields. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AddressFields : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Fields + /// + [DataMember(Name = ("fields"), IsRequired = (true))] + public System.Collections.Generic.IList Fields + { + get; + set; + } + } + + /// + /// Address + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Address : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// fields and values defining an address. + /// + [DataMember(Name = ("fields"), IsRequired = (true))] + public System.Collections.Generic.IList Fields + { + get; + set; + } + } + + /// + /// Defines how an address can be displayed like in chrome://settings/addresses. + /// Address UI is a two dimensional array, each inner array is an "address information line", and when rendered in a UI surface should be displayed as such. + /// The following address UI for instance: + /// [[{name: "GIVE_NAME", value: "Jon"}, {name: "FAMILY_NAME", value: "Doe"}], [{name: "CITY", value: "Munich"}, {name: "ZIP", value: "81456"}]] + /// should allow the receiver to render: + /// Jon Doe + /// Munich 81456 + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AddressUI : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A two dimension array containing the representation of values from an address profile. + /// + [DataMember(Name = ("addressFields"), IsRequired = (true))] + public System.Collections.Generic.IList AddressFields + { + get; + set; + } + } + + /// + /// Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics. + /// + public enum FillingStrategy + { + /// + /// autocompleteAttribute + /// + [EnumMember(Value = ("autocompleteAttribute"))] + AutocompleteAttribute, + /// + /// autofillInferred + /// + [EnumMember(Value = ("autofillInferred"))] + AutofillInferred + } + + /// + /// FilledField + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FilledField : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The type of the field, e.g text, password etc. + /// + [DataMember(Name = ("htmlType"), IsRequired = (true))] + public string HtmlType + { + get; + set; + } + + /// + /// the html id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// the html name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// the field value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + + /// + /// The actual field type, e.g FAMILY_NAME + /// + [DataMember(Name = ("autofillType"), IsRequired = (true))] + public string AutofillType + { + get; + set; + } + + /// + /// The filling strategy + /// + public CefSharp.DevTools.Autofill.FillingStrategy FillingStrategy + { + get + { + return (CefSharp.DevTools.Autofill.FillingStrategy)(StringToEnum(typeof(CefSharp.DevTools.Autofill.FillingStrategy), fillingStrategy)); + } + + set + { + this.fillingStrategy = (EnumToString(value)); + } + } + + /// + /// The filling strategy + /// + [DataMember(Name = ("fillingStrategy"), IsRequired = (true))] + internal string fillingStrategy + { + get; + set; + } + + /// + /// The frame the field belongs to + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + set; + } + + /// + /// The form field's DOM node + /// + [DataMember(Name = ("fieldId"), IsRequired = (true))] + public int FieldId + { + get; + set; + } + } + + /// + /// Emitted when an address form is filled. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AddressFormFilledEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Information about the fields that were filled + /// + [DataMember(Name = ("filledFields"), IsRequired = (true))] + public System.Collections.Generic.IList FilledFields + { + get; + private set; + } + + /// + /// An UI representation of the address used to fill the form. + /// Consists of a 2D array where each child represents an address/profile line. + /// + [DataMember(Name = ("addressUi"), IsRequired = (true))] + public CefSharp.DevTools.Autofill.AddressUI AddressUi + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.BackgroundService +{ + /// + /// The Background Service that will be associated with the commands/events. + /// Every Background Service operates independently, but they share the same + /// API. + /// + public enum ServiceName + { + /// + /// backgroundFetch + /// + [EnumMember(Value = ("backgroundFetch"))] + BackgroundFetch, + /// + /// backgroundSync + /// + [EnumMember(Value = ("backgroundSync"))] + BackgroundSync, + /// + /// pushMessaging + /// + [EnumMember(Value = ("pushMessaging"))] + PushMessaging, + /// + /// notifications + /// + [EnumMember(Value = ("notifications"))] + Notifications, + /// + /// paymentHandler + /// + [EnumMember(Value = ("paymentHandler"))] + PaymentHandler, + /// + /// periodicBackgroundSync + /// + [EnumMember(Value = ("periodicBackgroundSync"))] + PeriodicBackgroundSync + } + + /// + /// A key-value pair for additional event information to pass along. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class EventMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public string Key + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// BackgroundServiceEvent + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BackgroundServiceEvent : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Timestamp of the event (in seconds). + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + set; + } + + /// + /// The origin this event belongs to. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + set; + } + + /// + /// The Service Worker ID that initiated the event. + /// + [DataMember(Name = ("serviceWorkerRegistrationId"), IsRequired = (true))] + public string ServiceWorkerRegistrationId + { + get; + set; + } + + /// + /// The Background Service this event belongs to. + /// + public CefSharp.DevTools.BackgroundService.ServiceName Service + { + get + { + return (CefSharp.DevTools.BackgroundService.ServiceName)(StringToEnum(typeof(CefSharp.DevTools.BackgroundService.ServiceName), service)); + } + + set + { + this.service = (EnumToString(value)); + } + } + + /// + /// The Background Service this event belongs to. + /// + [DataMember(Name = ("service"), IsRequired = (true))] + internal string service + { + get; + set; + } + + /// + /// A description of the event. + /// + [DataMember(Name = ("eventName"), IsRequired = (true))] + public string EventName + { + get; + set; + } + + /// + /// An identifier that groups related events together. + /// + [DataMember(Name = ("instanceId"), IsRequired = (true))] + public string InstanceId + { + get; + set; + } + + /// + /// A list of event-specific information. + /// + [DataMember(Name = ("eventMetadata"), IsRequired = (true))] + public System.Collections.Generic.IList EventMetadata + { + get; + set; + } + + /// + /// Storage key this event belongs to. + /// + [DataMember(Name = ("storageKey"), IsRequired = (true))] + public string StorageKey + { + get; + set; + } + } + + /// + /// Called when the recording state for the service has been updated. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class RecordingStateChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// IsRecording + /// + [DataMember(Name = ("isRecording"), IsRequired = (true))] + public bool IsRecording + { + get; + private set; + } + + /// + /// Service + /// + public CefSharp.DevTools.BackgroundService.ServiceName Service + { + get + { + return (CefSharp.DevTools.BackgroundService.ServiceName)(StringToEnum(typeof(CefSharp.DevTools.BackgroundService.ServiceName), service)); + } + + set + { + this.service = (EnumToString(value)); + } + } + + /// + /// Service + /// + [DataMember(Name = ("service"), IsRequired = (true))] + internal string service + { + get; + private set; + } + } + + /// + /// Called with all existing backgroundServiceEvents when enabled, and all new + /// events afterwards if enabled and recording. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class BackgroundServiceEventReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// BackgroundServiceEvent + /// + [DataMember(Name = ("backgroundServiceEvent"), IsRequired = (true))] + public CefSharp.DevTools.BackgroundService.BackgroundServiceEvent BackgroundServiceEvent + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + /// + /// Indicates the various states of Central. + /// + public enum CentralState + { + /// + /// absent + /// + [EnumMember(Value = ("absent"))] + Absent, + /// + /// powered-off + /// + [EnumMember(Value = ("powered-off"))] + PoweredOff, + /// + /// powered-on + /// + [EnumMember(Value = ("powered-on"))] + PoweredOn + } + + /// + /// Indicates the various types of GATT event. + /// + public enum GATTOperationType + { + /// + /// connection + /// + [EnumMember(Value = ("connection"))] + Connection, + /// + /// discovery + /// + [EnumMember(Value = ("discovery"))] + Discovery + } + + /// + /// Indicates the various types of characteristic write. + /// + public enum CharacteristicWriteType + { + /// + /// write-default-deprecated + /// + [EnumMember(Value = ("write-default-deprecated"))] + WriteDefaultDeprecated, + /// + /// write-with-response + /// + [EnumMember(Value = ("write-with-response"))] + WriteWithResponse, + /// + /// write-without-response + /// + [EnumMember(Value = ("write-without-response"))] + WriteWithoutResponse + } + + /// + /// Indicates the various types of characteristic operation. + /// + public enum CharacteristicOperationType + { + /// + /// read + /// + [EnumMember(Value = ("read"))] + Read, + /// + /// write + /// + [EnumMember(Value = ("write"))] + Write, + /// + /// subscribe-to-notifications + /// + [EnumMember(Value = ("subscribe-to-notifications"))] + SubscribeToNotifications, + /// + /// unsubscribe-from-notifications + /// + [EnumMember(Value = ("unsubscribe-from-notifications"))] + UnsubscribeFromNotifications + } + + /// + /// Indicates the various types of descriptor operation. + /// + public enum DescriptorOperationType + { + /// + /// read + /// + [EnumMember(Value = ("read"))] + Read, + /// + /// write + /// + [EnumMember(Value = ("write"))] + Write + } + + /// + /// Stores the manufacturer data + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ManufacturerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Company identifier + /// https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/company_identifiers/company_identifiers.yaml + /// https://usb.org/developers + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public int Key + { + get; + set; + } + + /// + /// Manufacturer-specific data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + set; + } + } + + /// + /// Stores the byte data of the advertisement packet sent by a Bluetooth device. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScanRecord : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// Uuids + /// + [DataMember(Name = ("uuids"), IsRequired = (false))] + public string[] Uuids + { + get; + set; + } + + /// + /// Stores the external appearance description of the device. + /// + [DataMember(Name = ("appearance"), IsRequired = (false))] + public int? Appearance + { + get; + set; + } + + /// + /// Stores the transmission power of a broadcasting device. + /// + [DataMember(Name = ("txPower"), IsRequired = (false))] + public int? TxPower + { + get; + set; + } + + /// + /// Key is the company identifier and the value is an array of bytes of + /// manufacturer specific data. + /// + [DataMember(Name = ("manufacturerData"), IsRequired = (false))] + public System.Collections.Generic.IList ManufacturerData + { + get; + set; + } + } + + /// + /// Stores the advertisement packet information that is sent by a Bluetooth device. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScanEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// DeviceAddress + /// + [DataMember(Name = ("deviceAddress"), IsRequired = (true))] + public string DeviceAddress + { + get; + set; + } + + /// + /// Rssi + /// + [DataMember(Name = ("rssi"), IsRequired = (true))] + public int Rssi + { + get; + set; + } + + /// + /// ScanRecord + /// + [DataMember(Name = ("scanRecord"), IsRequired = (true))] + public CefSharp.DevTools.BluetoothEmulation.ScanRecord ScanRecord + { + get; + set; + } + } + + /// + /// Describes the properties of a characteristic. This follows Bluetooth Core + /// Specification BT 4.2 Vol 3 Part G 3.3.1. Characteristic Properties. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CharacteristicProperties : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Broadcast + /// + [DataMember(Name = ("broadcast"), IsRequired = (false))] + public bool? Broadcast + { + get; + set; + } + + /// + /// Read + /// + [DataMember(Name = ("read"), IsRequired = (false))] + public bool? Read + { + get; + set; + } + + /// + /// WriteWithoutResponse + /// + [DataMember(Name = ("writeWithoutResponse"), IsRequired = (false))] + public bool? WriteWithoutResponse + { + get; + set; + } + + /// + /// Write + /// + [DataMember(Name = ("write"), IsRequired = (false))] + public bool? Write + { + get; + set; + } + + /// + /// Notify + /// + [DataMember(Name = ("notify"), IsRequired = (false))] + public bool? Notify + { + get; + set; + } + + /// + /// Indicate + /// + [DataMember(Name = ("indicate"), IsRequired = (false))] + public bool? Indicate + { + get; + set; + } + + /// + /// AuthenticatedSignedWrites + /// + [DataMember(Name = ("authenticatedSignedWrites"), IsRequired = (false))] + public bool? AuthenticatedSignedWrites + { + get; + set; + } + + /// + /// ExtendedProperties + /// + [DataMember(Name = ("extendedProperties"), IsRequired = (false))] + public bool? ExtendedProperties + { + get; + set; + } + } + + /// + /// Event for when a GATT operation of |type| to the peripheral with |address| + /// happened. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class GattOperationReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Address + /// + [DataMember(Name = ("address"), IsRequired = (true))] + public string Address + { + get; + private set; + } + + /// + /// Type + /// + public CefSharp.DevTools.BluetoothEmulation.GATTOperationType Type + { + get + { + return (CefSharp.DevTools.BluetoothEmulation.GATTOperationType)(StringToEnum(typeof(CefSharp.DevTools.BluetoothEmulation.GATTOperationType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + } + + /// + /// Event for when a characteristic operation of |type| to the characteristic + /// respresented by |characteristicId| happened. |data| and |writeType| is + /// expected to exist when |type| is write. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CharacteristicOperationReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// CharacteristicId + /// + [DataMember(Name = ("characteristicId"), IsRequired = (true))] + public string CharacteristicId + { + get; + private set; + } + + /// + /// Type + /// + public CefSharp.DevTools.BluetoothEmulation.CharacteristicOperationType Type + { + get + { + return (CefSharp.DevTools.BluetoothEmulation.CharacteristicOperationType)(StringToEnum(typeof(CefSharp.DevTools.BluetoothEmulation.CharacteristicOperationType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (false))] + public byte[] Data + { + get; + private set; + } + + /// + /// WriteType + /// + public CefSharp.DevTools.BluetoothEmulation.CharacteristicWriteType? WriteType + { + get + { + return (CefSharp.DevTools.BluetoothEmulation.CharacteristicWriteType? )(StringToEnum(typeof(CefSharp.DevTools.BluetoothEmulation.CharacteristicWriteType? ), writeType)); + } + + set + { + this.writeType = (EnumToString(value)); + } + } + + /// + /// WriteType + /// + [DataMember(Name = ("writeType"), IsRequired = (false))] + internal string writeType + { + get; + private set; + } + } + + /// + /// Event for when a descriptor operation of |type| to the descriptor + /// respresented by |descriptorId| happened. |data| is expected to exist when + /// |type| is write. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DescriptorOperationReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// DescriptorId + /// + [DataMember(Name = ("descriptorId"), IsRequired = (true))] + public string DescriptorId + { + get; + private set; + } + + /// + /// Type + /// + public CefSharp.DevTools.BluetoothEmulation.DescriptorOperationType Type + { + get + { + return (CefSharp.DevTools.BluetoothEmulation.DescriptorOperationType)(StringToEnum(typeof(CefSharp.DevTools.BluetoothEmulation.DescriptorOperationType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (false))] + public byte[] Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// The state of the browser window. + /// + public enum WindowState + { + /// + /// normal + /// + [EnumMember(Value = ("normal"))] + Normal, + /// + /// minimized + /// + [EnumMember(Value = ("minimized"))] + Minimized, + /// + /// maximized + /// + [EnumMember(Value = ("maximized"))] + Maximized, + /// + /// fullscreen + /// + [EnumMember(Value = ("fullscreen"))] + Fullscreen + } + + /// + /// Browser window bounds information + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Bounds : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The offset from the left edge of the screen to the window in pixels. + /// + [DataMember(Name = ("left"), IsRequired = (false))] + public int? Left + { + get; + set; + } + + /// + /// The offset from the top edge of the screen to the window in pixels. + /// + [DataMember(Name = ("top"), IsRequired = (false))] + public int? Top + { + get; + set; + } + + /// + /// The window width in pixels. + /// + [DataMember(Name = ("width"), IsRequired = (false))] + public int? Width + { + get; + set; + } + + /// + /// The window height in pixels. + /// + [DataMember(Name = ("height"), IsRequired = (false))] + public int? Height + { + get; + set; + } + + /// + /// The window state. Default to normal. + /// + public CefSharp.DevTools.Browser.WindowState? WindowState + { + get + { + return (CefSharp.DevTools.Browser.WindowState? )(StringToEnum(typeof(CefSharp.DevTools.Browser.WindowState? ), windowState)); + } + + set + { + this.windowState = (EnumToString(value)); + } + } + + /// + /// The window state. Default to normal. + /// + [DataMember(Name = ("windowState"), IsRequired = (false))] + internal string windowState + { + get; + set; + } + } + + /// + /// PermissionType + /// + public enum PermissionType + { + /// + /// ar + /// + [EnumMember(Value = ("ar"))] + Ar, + /// + /// audioCapture + /// + [EnumMember(Value = ("audioCapture"))] + AudioCapture, + /// + /// automaticFullscreen + /// + [EnumMember(Value = ("automaticFullscreen"))] + AutomaticFullscreen, + /// + /// backgroundFetch + /// + [EnumMember(Value = ("backgroundFetch"))] + BackgroundFetch, + /// + /// backgroundSync + /// + [EnumMember(Value = ("backgroundSync"))] + BackgroundSync, + /// + /// cameraPanTiltZoom + /// + [EnumMember(Value = ("cameraPanTiltZoom"))] + CameraPanTiltZoom, + /// + /// capturedSurfaceControl + /// + [EnumMember(Value = ("capturedSurfaceControl"))] + CapturedSurfaceControl, + /// + /// clipboardReadWrite + /// + [EnumMember(Value = ("clipboardReadWrite"))] + ClipboardReadWrite, + /// + /// clipboardSanitizedWrite + /// + [EnumMember(Value = ("clipboardSanitizedWrite"))] + ClipboardSanitizedWrite, + /// + /// displayCapture + /// + [EnumMember(Value = ("displayCapture"))] + DisplayCapture, + /// + /// durableStorage + /// + [EnumMember(Value = ("durableStorage"))] + DurableStorage, + /// + /// geolocation + /// + [EnumMember(Value = ("geolocation"))] + Geolocation, + /// + /// handTracking + /// + [EnumMember(Value = ("handTracking"))] + HandTracking, + /// + /// idleDetection + /// + [EnumMember(Value = ("idleDetection"))] + IdleDetection, + /// + /// keyboardLock + /// + [EnumMember(Value = ("keyboardLock"))] + KeyboardLock, + /// + /// localFonts + /// + [EnumMember(Value = ("localFonts"))] + LocalFonts, + /// + /// localNetwork + /// + [EnumMember(Value = ("localNetwork"))] + LocalNetwork, + /// + /// localNetworkAccess + /// + [EnumMember(Value = ("localNetworkAccess"))] + LocalNetworkAccess, + /// + /// loopbackNetwork + /// + [EnumMember(Value = ("loopbackNetwork"))] + LoopbackNetwork, + /// + /// midi + /// + [EnumMember(Value = ("midi"))] + Midi, + /// + /// midiSysex + /// + [EnumMember(Value = ("midiSysex"))] + MidiSysex, + /// + /// nfc + /// + [EnumMember(Value = ("nfc"))] + Nfc, + /// + /// notifications + /// + [EnumMember(Value = ("notifications"))] + Notifications, + /// + /// paymentHandler + /// + [EnumMember(Value = ("paymentHandler"))] + PaymentHandler, + /// + /// periodicBackgroundSync + /// + [EnumMember(Value = ("periodicBackgroundSync"))] + PeriodicBackgroundSync, + /// + /// pointerLock + /// + [EnumMember(Value = ("pointerLock"))] + PointerLock, + /// + /// protectedMediaIdentifier + /// + [EnumMember(Value = ("protectedMediaIdentifier"))] + ProtectedMediaIdentifier, + /// + /// sensors + /// + [EnumMember(Value = ("sensors"))] + Sensors, + /// + /// smartCard + /// + [EnumMember(Value = ("smartCard"))] + SmartCard, + /// + /// speakerSelection + /// + [EnumMember(Value = ("speakerSelection"))] + SpeakerSelection, + /// + /// storageAccess + /// + [EnumMember(Value = ("storageAccess"))] + StorageAccess, + /// + /// topLevelStorageAccess + /// + [EnumMember(Value = ("topLevelStorageAccess"))] + TopLevelStorageAccess, + /// + /// videoCapture + /// + [EnumMember(Value = ("videoCapture"))] + VideoCapture, + /// + /// vr + /// + [EnumMember(Value = ("vr"))] + Vr, + /// + /// wakeLockScreen + /// + [EnumMember(Value = ("wakeLockScreen"))] + WakeLockScreen, + /// + /// wakeLockSystem + /// + [EnumMember(Value = ("wakeLockSystem"))] + WakeLockSystem, + /// + /// webAppInstallation + /// + [EnumMember(Value = ("webAppInstallation"))] + WebAppInstallation, + /// + /// webPrinting + /// + [EnumMember(Value = ("webPrinting"))] + WebPrinting, + /// + /// windowManagement + /// + [EnumMember(Value = ("windowManagement"))] + WindowManagement + } + + /// + /// PermissionSetting + /// + public enum PermissionSetting + { + /// + /// granted + /// + [EnumMember(Value = ("granted"))] + Granted, + /// + /// denied + /// + [EnumMember(Value = ("denied"))] + Denied, + /// + /// prompt + /// + [EnumMember(Value = ("prompt"))] + Prompt + } + + /// + /// Definition of PermissionDescriptor defined in the Permissions API: + /// https://w3c.github.io/permissions/#dom-permissiondescriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PermissionDescriptor : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of permission. + /// See https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl for valid permission names. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// For "midi" permission, may also specify sysex control. + /// + [DataMember(Name = ("sysex"), IsRequired = (false))] + public bool? Sysex + { + get; + set; + } + + /// + /// For "push" permission, may specify userVisibleOnly. + /// Note that userVisibleOnly = true is the only currently supported type. + /// + [DataMember(Name = ("userVisibleOnly"), IsRequired = (false))] + public bool? UserVisibleOnly + { + get; + set; + } + + /// + /// For "clipboard" permission, may specify allowWithoutSanitization. + /// + [DataMember(Name = ("allowWithoutSanitization"), IsRequired = (false))] + public bool? AllowWithoutSanitization + { + get; + set; + } + + /// + /// For "fullscreen" permission, must specify allowWithoutGesture:true. + /// + [DataMember(Name = ("allowWithoutGesture"), IsRequired = (false))] + public bool? AllowWithoutGesture + { + get; + set; + } + + /// + /// For "camera" permission, may specify panTiltZoom. + /// + [DataMember(Name = ("panTiltZoom"), IsRequired = (false))] + public bool? PanTiltZoom + { + get; + set; + } + } + + /// + /// Browser command ids used by executeBrowserCommand. + /// + public enum BrowserCommandId + { + /// + /// openTabSearch + /// + [EnumMember(Value = ("openTabSearch"))] + OpenTabSearch, + /// + /// closeTabSearch + /// + [EnumMember(Value = ("closeTabSearch"))] + CloseTabSearch, + /// + /// openGlic + /// + [EnumMember(Value = ("openGlic"))] + OpenGlic + } + + /// + /// Chrome histogram bucket. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Bucket : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Minimum value (inclusive). + /// + [DataMember(Name = ("low"), IsRequired = (true))] + public int Low + { + get; + set; + } + + /// + /// Maximum value (exclusive). + /// + [DataMember(Name = ("high"), IsRequired = (true))] + public int High + { + get; + set; + } + + /// + /// Number of samples. + /// + [DataMember(Name = ("count"), IsRequired = (true))] + public int Count + { + get; + set; + } + } + + /// + /// Chrome histogram. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Histogram : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Sum of sample values. + /// + [DataMember(Name = ("sum"), IsRequired = (true))] + public int Sum + { + get; + set; + } + + /// + /// Total number of samples. + /// + [DataMember(Name = ("count"), IsRequired = (true))] + public int Count + { + get; + set; + } + + /// + /// Buckets. + /// + [DataMember(Name = ("buckets"), IsRequired = (true))] + public System.Collections.Generic.IList Buckets + { + get; + set; + } + } + + /// + /// PrivacySandboxAPI + /// + public enum PrivacySandboxAPI + { + /// + /// BiddingAndAuctionServices + /// + [EnumMember(Value = ("BiddingAndAuctionServices"))] + BiddingAndAuctionServices, + /// + /// TrustedKeyValue + /// + [EnumMember(Value = ("TrustedKeyValue"))] + TrustedKeyValue + } + + /// + /// Fired when page is about to start a download. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DownloadWillBeginEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that caused the download to begin. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Global unique identifier of the download. + /// + [DataMember(Name = ("guid"), IsRequired = (true))] + public string Guid + { + get; + private set; + } + + /// + /// URL of the resource being downloaded. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Suggested file name of the resource (the actual name of the file saved on disk may differ). + /// + [DataMember(Name = ("suggestedFilename"), IsRequired = (true))] + public string SuggestedFilename + { + get; + private set; + } + } + + /// + /// Download status. + /// + public enum DownloadProgressState + { + /// + /// inProgress + /// + [EnumMember(Value = ("inProgress"))] + InProgress, + /// + /// completed + /// + [EnumMember(Value = ("completed"))] + Completed, + /// + /// canceled + /// + [EnumMember(Value = ("canceled"))] + Canceled + } + + /// + /// Fired when download makes progress. Last call has |done| == true. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DownloadProgressEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Global unique identifier of the download. + /// + [DataMember(Name = ("guid"), IsRequired = (true))] + public string Guid + { + get; + private set; + } + + /// + /// Total expected bytes to download. + /// + [DataMember(Name = ("totalBytes"), IsRequired = (true))] + public double TotalBytes + { + get; + private set; + } + + /// + /// Total bytes received. + /// + [DataMember(Name = ("receivedBytes"), IsRequired = (true))] + public double ReceivedBytes + { + get; + private set; + } + + /// + /// Download status. + /// + public CefSharp.DevTools.Browser.DownloadProgressState State + { + get + { + return (CefSharp.DevTools.Browser.DownloadProgressState)(StringToEnum(typeof(CefSharp.DevTools.Browser.DownloadProgressState), state)); + } + + set + { + this.state = (EnumToString(value)); + } + } + + /// + /// Download status. + /// + [DataMember(Name = ("state"), IsRequired = (true))] + internal string state + { + get; + private set; + } + + /// + /// If download is "completed", provides the path of the downloaded file. + /// Depending on the platform, it is not guaranteed to be set, nor the file + /// is guaranteed to exist. + /// + [DataMember(Name = ("filePath"), IsRequired = (false))] + public string FilePath + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agent + /// stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via + /// inspector" rules), "regular" for regular stylesheets. + /// + public enum StyleSheetOrigin + { + /// + /// injected + /// + [EnumMember(Value = ("injected"))] + Injected, + /// + /// user-agent + /// + [EnumMember(Value = ("user-agent"))] + UserAgent, + /// + /// inspector + /// + [EnumMember(Value = ("inspector"))] + Inspector, + /// + /// regular + /// + [EnumMember(Value = ("regular"))] + Regular + } + + /// + /// CSS rule collection for a single pseudo style. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PseudoElementMatches : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Pseudo element type. + /// + public CefSharp.DevTools.DOM.PseudoType PseudoType + { + get + { + return (CefSharp.DevTools.DOM.PseudoType)(StringToEnum(typeof(CefSharp.DevTools.DOM.PseudoType), pseudoType)); + } + + set + { + this.pseudoType = (EnumToString(value)); + } + } + + /// + /// Pseudo element type. + /// + [DataMember(Name = ("pseudoType"), IsRequired = (true))] + internal string pseudoType + { + get; + set; + } + + /// + /// Pseudo element custom ident. + /// + [DataMember(Name = ("pseudoIdentifier"), IsRequired = (false))] + public string PseudoIdentifier + { + get; + set; + } + + /// + /// Matches of CSS rules applicable to the pseudo style. + /// + [DataMember(Name = ("matches"), IsRequired = (true))] + public System.Collections.Generic.IList Matches + { + get; + set; + } + } + + /// + /// CSS style coming from animations with the name of the animation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSAnimationStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The name of the animation. + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// The style coming from the animation. + /// + [DataMember(Name = ("style"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// Inherited CSS rule collection from ancestor node. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InheritedStyleEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The ancestor node's inline style, if any, in the style inheritance chain. + /// + [DataMember(Name = ("inlineStyle"), IsRequired = (false))] + public CefSharp.DevTools.CSS.CSSStyle InlineStyle + { + get; + set; + } + + /// + /// Matches of CSS rules matching the ancestor node in the style inheritance chain. + /// + [DataMember(Name = ("matchedCSSRules"), IsRequired = (true))] + public System.Collections.Generic.IList MatchedCSSRules + { + get; + set; + } + } + + /// + /// Inherited CSS style collection for animated styles from ancestor node. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InheritedAnimatedStyleEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Styles coming from the animations of the ancestor, if any, in the style inheritance chain. + /// + [DataMember(Name = ("animationStyles"), IsRequired = (false))] + public System.Collections.Generic.IList AnimationStyles + { + get; + set; + } + + /// + /// The style coming from the transitions of the ancestor, if any, in the style inheritance chain. + /// + [DataMember(Name = ("transitionsStyle"), IsRequired = (false))] + public CefSharp.DevTools.CSS.CSSStyle TransitionsStyle + { + get; + set; + } + } + + /// + /// Inherited pseudo element matches from pseudos of an ancestor node. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InheritedPseudoElementMatches : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Matches of pseudo styles from the pseudos of an ancestor node. + /// + [DataMember(Name = ("pseudoElements"), IsRequired = (true))] + public System.Collections.Generic.IList PseudoElements + { + get; + set; + } + } + + /// + /// Match data for a CSS rule. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RuleMatch : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CSS rule in the match. + /// + [DataMember(Name = ("rule"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSRule Rule + { + get; + set; + } + + /// + /// Matching selector indices in the rule's selectorList selectors (0-based). + /// + [DataMember(Name = ("matchingSelectors"), IsRequired = (true))] + public int[] MatchingSelectors + { + get; + set; + } + } + + /// + /// Data for a simple selector (these are delimited by commas in a selector list). + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Value : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Value text. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + + /// + /// Value range in the underlying resource (if available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Specificity of the selector. + /// + [DataMember(Name = ("specificity"), IsRequired = (false))] + public CefSharp.DevTools.CSS.Specificity Specificity + { + get; + set; + } + } + + /// + /// Specificity: + /// https://drafts.csswg.org/selectors/#specificity-rules + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Specificity : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The a component, which represents the number of ID selectors. + /// + [DataMember(Name = ("a"), IsRequired = (true))] + public int A + { + get; + set; + } + + /// + /// The b component, which represents the number of class selectors, attributes selectors, and + /// pseudo-classes. + /// + [DataMember(Name = ("b"), IsRequired = (true))] + public int B + { + get; + set; + } + + /// + /// The c component, which represents the number of type selectors and pseudo-elements. + /// + [DataMember(Name = ("c"), IsRequired = (true))] + public int C + { + get; + set; + } + } + + /// + /// Selector list data. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SelectorList : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Selectors in the list. + /// + [DataMember(Name = ("selectors"), IsRequired = (true))] + public System.Collections.Generic.IList Selectors + { + get; + set; + } + + /// + /// Rule selector text. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + } + + /// + /// CSS stylesheet metainformation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSStyleSheetHeader : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The stylesheet identifier. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (true))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Owner frame identifier. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + set; + } + + /// + /// Stylesheet resource URL. Empty if this is a constructed stylesheet created using + /// new CSSStyleSheet() (but non-empty if this is a constructed stylesheet imported + /// as a CSS module script). + /// + [DataMember(Name = ("sourceURL"), IsRequired = (true))] + public string SourceURL + { + get; + set; + } + + /// + /// URL of source map associated with the stylesheet (if any). + /// + [DataMember(Name = ("sourceMapURL"), IsRequired = (false))] + public string SourceMapURL + { + get; + set; + } + + /// + /// Stylesheet origin. + /// + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get + { + return (CefSharp.DevTools.CSS.StyleSheetOrigin)(StringToEnum(typeof(CefSharp.DevTools.CSS.StyleSheetOrigin), origin)); + } + + set + { + this.origin = (EnumToString(value)); + } + } + + /// + /// Stylesheet origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + internal string origin + { + get; + set; + } + + /// + /// Stylesheet title. + /// + [DataMember(Name = ("title"), IsRequired = (true))] + public string Title + { + get; + set; + } + + /// + /// The backend id for the owner node of the stylesheet. + /// + [DataMember(Name = ("ownerNode"), IsRequired = (false))] + public int? OwnerNode + { + get; + set; + } + + /// + /// Denotes whether the stylesheet is disabled. + /// + [DataMember(Name = ("disabled"), IsRequired = (true))] + public bool Disabled + { + get; + set; + } + + /// + /// Whether the sourceURL field value comes from the sourceURL comment. + /// + [DataMember(Name = ("hasSourceURL"), IsRequired = (false))] + public bool? HasSourceURL + { + get; + set; + } + + /// + /// Whether this stylesheet is created for STYLE tag by parser. This flag is not set for + /// document.written STYLE tags. + /// + [DataMember(Name = ("isInline"), IsRequired = (true))] + public bool IsInline + { + get; + set; + } + + /// + /// Whether this stylesheet is mutable. Inline stylesheets become mutable + /// after they have been modified via CSSOM API. + /// `<link>` element's stylesheets become mutable only if DevTools modifies them. + /// Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation. + /// + [DataMember(Name = ("isMutable"), IsRequired = (true))] + public bool IsMutable + { + get; + set; + } + + /// + /// True if this stylesheet is created through new CSSStyleSheet() or imported as a + /// CSS module script. + /// + [DataMember(Name = ("isConstructed"), IsRequired = (true))] + public bool IsConstructed + { + get; + set; + } + + /// + /// Line offset of the stylesheet within the resource (zero based). + /// + [DataMember(Name = ("startLine"), IsRequired = (true))] + public double StartLine + { + get; + set; + } + + /// + /// Column offset of the stylesheet within the resource (zero based). + /// + [DataMember(Name = ("startColumn"), IsRequired = (true))] + public double StartColumn + { + get; + set; + } + + /// + /// Size of the content (in characters). + /// + [DataMember(Name = ("length"), IsRequired = (true))] + public double Length + { + get; + set; + } + + /// + /// Line offset of the end of the stylesheet within the resource (zero based). + /// + [DataMember(Name = ("endLine"), IsRequired = (true))] + public double EndLine + { + get; + set; + } + + /// + /// Column offset of the end of the stylesheet within the resource (zero based). + /// + [DataMember(Name = ("endColumn"), IsRequired = (true))] + public double EndColumn + { + get; + set; + } + + /// + /// If the style sheet was loaded from a network resource, this indicates when the resource failed to load + /// + [DataMember(Name = ("loadingFailed"), IsRequired = (false))] + public bool? LoadingFailed + { + get; + set; + } + } + + /// + /// CSS rule representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Rule selector data. + /// + [DataMember(Name = ("selectorList"), IsRequired = (true))] + public CefSharp.DevTools.CSS.SelectorList SelectorList + { + get; + set; + } + + /// + /// Array of selectors from ancestor style rules, sorted by distance from the current rule. + /// + [DataMember(Name = ("nestingSelectors"), IsRequired = (false))] + public string[] NestingSelectors + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get + { + return (CefSharp.DevTools.CSS.StyleSheetOrigin)(StringToEnum(typeof(CefSharp.DevTools.CSS.StyleSheetOrigin), origin)); + } + + set + { + this.origin = (EnumToString(value)); + } + } + + /// + /// Parent stylesheet's origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + internal string origin + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [DataMember(Name = ("style"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + + /// + /// The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule. + /// + [DataMember(Name = ("originTreeScopeNodeId"), IsRequired = (false))] + public int? OriginTreeScopeNodeId + { + get; + set; + } + + /// + /// Media list array (for rules involving media queries). The array enumerates media queries + /// starting with the innermost one, going outwards. + /// + [DataMember(Name = ("media"), IsRequired = (false))] + public System.Collections.Generic.IList Media + { + get; + set; + } + + /// + /// Container query list array (for rules involving container queries). + /// The array enumerates container queries starting with the innermost one, going outwards. + /// + [DataMember(Name = ("containerQueries"), IsRequired = (false))] + public System.Collections.Generic.IList ContainerQueries + { + get; + set; + } + + /// + /// @supports CSS at-rule array. + /// The array enumerates @supports at-rules starting with the innermost one, going outwards. + /// + [DataMember(Name = ("supports"), IsRequired = (false))] + public System.Collections.Generic.IList Supports + { + get; + set; + } + + /// + /// Cascade layer array. Contains the layer hierarchy that this rule belongs to starting + /// with the innermost layer and going outwards. + /// + [DataMember(Name = ("layers"), IsRequired = (false))] + public System.Collections.Generic.IList Layers + { + get; + set; + } + + /// + /// @scope CSS at-rule array. + /// The array enumerates @scope at-rules starting with the innermost one, going outwards. + /// + [DataMember(Name = ("scopes"), IsRequired = (false))] + public System.Collections.Generic.IList Scopes + { + get; + set; + } + + /// + /// The array keeps the types of ancestor CSSRules from the innermost going outwards. + /// + public CefSharp.DevTools.CSS.CSSRuleType[] RuleTypes + { + get + { + return (CefSharp.DevTools.CSS.CSSRuleType[])(StringToEnum(typeof(CefSharp.DevTools.CSS.CSSRuleType[]), ruleTypes)); + } + + set + { + this.ruleTypes = (EnumToString(value)); + } + } + + /// + /// The array keeps the types of ancestor CSSRules from the innermost going outwards. + /// + [DataMember(Name = ("ruleTypes"), IsRequired = (false))] + internal string ruleTypes + { + get; + set; + } + + /// + /// @starting-style CSS at-rule array. + /// The array enumerates @starting-style at-rules starting with the innermost one, going outwards. + /// + [DataMember(Name = ("startingStyles"), IsRequired = (false))] + public System.Collections.Generic.IList StartingStyles + { + get; + set; + } + } + + /// + /// Enum indicating the type of a CSS rule, used to represent the order of a style rule's ancestors. + /// This list only contains rule types that are collected during the ancestor rule collection. + /// + public enum CSSRuleType + { + /// + /// MediaRule + /// + [EnumMember(Value = ("MediaRule"))] + MediaRule, + /// + /// SupportsRule + /// + [EnumMember(Value = ("SupportsRule"))] + SupportsRule, + /// + /// ContainerRule + /// + [EnumMember(Value = ("ContainerRule"))] + ContainerRule, + /// + /// LayerRule + /// + [EnumMember(Value = ("LayerRule"))] + LayerRule, + /// + /// ScopeRule + /// + [EnumMember(Value = ("ScopeRule"))] + ScopeRule, + /// + /// StyleRule + /// + [EnumMember(Value = ("StyleRule"))] + StyleRule, + /// + /// StartingStyleRule + /// + [EnumMember(Value = ("StartingStyleRule"))] + StartingStyleRule + } + + /// + /// CSS coverage information. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RuleUsage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (true))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Offset of the start of the rule (including selector) from the beginning of the stylesheet. + /// + [DataMember(Name = ("startOffset"), IsRequired = (true))] + public double StartOffset + { + get; + set; + } + + /// + /// Offset of the end of the rule body from the beginning of the stylesheet. + /// + [DataMember(Name = ("endOffset"), IsRequired = (true))] + public double EndOffset + { + get; + set; + } + + /// + /// Indicates whether the rule was actually used by some element in the page. + /// + [DataMember(Name = ("used"), IsRequired = (true))] + public bool Used + { + get; + set; + } + } + + /// + /// Text range within a resource. All numbers are zero-based. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SourceRange : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Start line of range. + /// + [DataMember(Name = ("startLine"), IsRequired = (true))] + public int StartLine + { + get; + set; + } + + /// + /// Start column of range (inclusive). + /// + [DataMember(Name = ("startColumn"), IsRequired = (true))] + public int StartColumn + { + get; + set; + } + + /// + /// End line of range + /// + [DataMember(Name = ("endLine"), IsRequired = (true))] + public int EndLine + { + get; + set; + } + + /// + /// End column of range (exclusive). + /// + [DataMember(Name = ("endColumn"), IsRequired = (true))] + public int EndColumn + { + get; + set; + } + } + + /// + /// ShorthandEntry + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ShorthandEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Shorthand name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Shorthand value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + + /// + /// Whether the property has "!important" annotation (implies `false` if absent). + /// + [DataMember(Name = ("important"), IsRequired = (false))] + public bool? Important + { + get; + set; + } + } + + /// + /// CSSComputedStyleProperty + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSComputedStyleProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Computed style property name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Computed style property value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// ComputedStyleExtraFields + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ComputedStyleExtraFields : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Returns whether or not this node is being rendered with base appearance, + /// which happens when it has its appearance property set to base/base-select + /// or it is in the subtree of an element being rendered with base appearance. + /// + [DataMember(Name = ("isAppearanceBase"), IsRequired = (true))] + public bool IsAppearanceBase + { + get; + set; + } + } + + /// + /// CSS style representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// CSS properties in the style. + /// + [DataMember(Name = ("cssProperties"), IsRequired = (true))] + public System.Collections.Generic.IList CssProperties + { + get; + set; + } + + /// + /// Computed values for all shorthands found in the style. + /// + [DataMember(Name = ("shorthandEntries"), IsRequired = (true))] + public System.Collections.Generic.IList ShorthandEntries + { + get; + set; + } + + /// + /// Style declaration text (if available). + /// + [DataMember(Name = ("cssText"), IsRequired = (false))] + public string CssText + { + get; + set; + } + + /// + /// Style declaration range in the enclosing stylesheet (if available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + } + + /// + /// CSS property declaration data. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The property name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// The property value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + + /// + /// Whether the property has "!important" annotation (implies `false` if absent). + /// + [DataMember(Name = ("important"), IsRequired = (false))] + public bool? Important + { + get; + set; + } + + /// + /// Whether the property is implicit (implies `false` if absent). + /// + [DataMember(Name = ("implicit"), IsRequired = (false))] + public bool? Implicit + { + get; + set; + } + + /// + /// The full property text as specified in the style. + /// + [DataMember(Name = ("text"), IsRequired = (false))] + public string Text + { + get; + set; + } + + /// + /// Whether the property is understood by the browser (implies `true` if absent). + /// + [DataMember(Name = ("parsedOk"), IsRequired = (false))] + public bool? ParsedOk + { + get; + set; + } + + /// + /// Whether the property is disabled by the user (present for source-based properties only). + /// + [DataMember(Name = ("disabled"), IsRequired = (false))] + public bool? Disabled + { + get; + set; + } + + /// + /// The entire property range in the enclosing style declaration (if available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Parsed longhand components of this property if it is a shorthand. + /// This field will be empty if the given property is not a shorthand. + /// + [DataMember(Name = ("longhandProperties"), IsRequired = (false))] + public System.Collections.Generic.IList LonghandProperties + { + get; + set; + } + } + + /// + /// Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if + /// specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked + /// stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline + /// stylesheet's STYLE tag. + /// + public enum CSSMediaSource + { + /// + /// mediaRule + /// + [EnumMember(Value = ("mediaRule"))] + MediaRule, + /// + /// importRule + /// + [EnumMember(Value = ("importRule"))] + ImportRule, + /// + /// linkedSheet + /// + [EnumMember(Value = ("linkedSheet"))] + LinkedSheet, + /// + /// inlineSheet + /// + [EnumMember(Value = ("inlineSheet"))] + InlineSheet + } + + /// + /// CSS media rule descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSMedia : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Media query text. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + + /// + /// Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if + /// specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked + /// stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline + /// stylesheet's STYLE tag. + /// + public CefSharp.DevTools.CSS.CSSMediaSource Source + { + get + { + return (CefSharp.DevTools.CSS.CSSMediaSource)(StringToEnum(typeof(CefSharp.DevTools.CSS.CSSMediaSource), source)); + } + + set + { + this.source = (EnumToString(value)); + } + } + + /// + /// Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if + /// specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked + /// stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline + /// stylesheet's STYLE tag. + /// + [DataMember(Name = ("source"), IsRequired = (true))] + internal string source + { + get; + set; + } + + /// + /// URL of the document containing the media query description. + /// + [DataMember(Name = ("sourceURL"), IsRequired = (false))] + public string SourceURL + { + get; + set; + } + + /// + /// The associated rule (@media or @import) header range in the enclosing stylesheet (if + /// available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Array of media queries. + /// + [DataMember(Name = ("mediaList"), IsRequired = (false))] + public System.Collections.Generic.IList MediaList + { + get; + set; + } + } + + /// + /// Media query descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class MediaQuery : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Array of media query expressions. + /// + [DataMember(Name = ("expressions"), IsRequired = (true))] + public System.Collections.Generic.IList Expressions + { + get; + set; + } + + /// + /// Whether the media query condition is satisfied. + /// + [DataMember(Name = ("active"), IsRequired = (true))] + public bool Active + { + get; + set; + } + } + + /// + /// Media query expression descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class MediaQueryExpression : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Media query expression value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public double Value + { + get; + set; + } + + /// + /// Media query expression units. + /// + [DataMember(Name = ("unit"), IsRequired = (true))] + public string Unit + { + get; + set; + } + + /// + /// Media query expression feature. + /// + [DataMember(Name = ("feature"), IsRequired = (true))] + public string Feature + { + get; + set; + } + + /// + /// The associated range of the value text in the enclosing stylesheet (if available). + /// + [DataMember(Name = ("valueRange"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange ValueRange + { + get; + set; + } + + /// + /// Computed length of media query expression (if applicable). + /// + [DataMember(Name = ("computedLength"), IsRequired = (false))] + public double? ComputedLength + { + get; + set; + } + } + + /// + /// CSS container query rule descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSContainerQuery : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Container query text. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Optional name for the container. + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// Optional physical axes queried for the container. + /// + public CefSharp.DevTools.DOM.PhysicalAxes? PhysicalAxes + { + get + { + return (CefSharp.DevTools.DOM.PhysicalAxes? )(StringToEnum(typeof(CefSharp.DevTools.DOM.PhysicalAxes? ), physicalAxes)); + } + + set + { + this.physicalAxes = (EnumToString(value)); + } + } + + /// + /// Optional physical axes queried for the container. + /// + [DataMember(Name = ("physicalAxes"), IsRequired = (false))] + internal string physicalAxes + { + get; + set; + } + + /// + /// Optional logical axes queried for the container. + /// + public CefSharp.DevTools.DOM.LogicalAxes? LogicalAxes + { + get + { + return (CefSharp.DevTools.DOM.LogicalAxes? )(StringToEnum(typeof(CefSharp.DevTools.DOM.LogicalAxes? ), logicalAxes)); + } + + set + { + this.logicalAxes = (EnumToString(value)); + } + } + + /// + /// Optional logical axes queried for the container. + /// + [DataMember(Name = ("logicalAxes"), IsRequired = (false))] + internal string logicalAxes + { + get; + set; + } + + /// + /// true if the query contains scroll-state() queries. + /// + [DataMember(Name = ("queriesScrollState"), IsRequired = (false))] + public bool? QueriesScrollState + { + get; + set; + } + + /// + /// true if the query contains anchored() queries. + /// + [DataMember(Name = ("queriesAnchored"), IsRequired = (false))] + public bool? QueriesAnchored + { + get; + set; + } + } + + /// + /// CSS Supports at-rule descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSSupports : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Supports rule text. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + + /// + /// Whether the supports condition is satisfied. + /// + [DataMember(Name = ("active"), IsRequired = (true))] + public bool Active + { + get; + set; + } + + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + } + + /// + /// CSS Scope at-rule descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSScope : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Scope rule text. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + } + + /// + /// CSS Layer at-rule descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSLayer : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Layer name. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + } + + /// + /// CSS Starting Style at-rule descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSStartingStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [DataMember(Name = ("range"), IsRequired = (false))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + } + + /// + /// CSS Layer data. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSLayerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Layer name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Direct sub-layers + /// + [DataMember(Name = ("subLayers"), IsRequired = (false))] + public System.Collections.Generic.IList SubLayers + { + get; + set; + } + + /// + /// Layer order. The order determines the order of the layer in the cascade order. + /// A higher number has higher priority in the cascade order. + /// + [DataMember(Name = ("order"), IsRequired = (true))] + public double Order + { + get; + set; + } + } + + /// + /// Information about amount of glyphs that were rendered with given font. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PlatformFontUsage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Font's family name reported by platform. + /// + [DataMember(Name = ("familyName"), IsRequired = (true))] + public string FamilyName + { + get; + set; + } + + /// + /// Font's PostScript name reported by platform. + /// + [DataMember(Name = ("postScriptName"), IsRequired = (true))] + public string PostScriptName + { + get; + set; + } + + /// + /// Indicates if the font was downloaded or resolved locally. + /// + [DataMember(Name = ("isCustomFont"), IsRequired = (true))] + public bool IsCustomFont + { + get; + set; + } + + /// + /// Amount of glyphs that were rendered with this font. + /// + [DataMember(Name = ("glyphCount"), IsRequired = (true))] + public double GlyphCount + { + get; + set; + } + } + + /// + /// Information about font variation axes for variable fonts + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FontVariationAxis : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The font-variation-setting tag (a.k.a. "axis tag"). + /// + [DataMember(Name = ("tag"), IsRequired = (true))] + public string Tag + { + get; + set; + } + + /// + /// Human-readable variation name in the default language (normally, "en"). + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// The minimum value (inclusive) the font supports for this tag. + /// + [DataMember(Name = ("minValue"), IsRequired = (true))] + public double MinValue + { + get; + set; + } + + /// + /// The maximum value (inclusive) the font supports for this tag. + /// + [DataMember(Name = ("maxValue"), IsRequired = (true))] + public double MaxValue + { + get; + set; + } + + /// + /// The default value. + /// + [DataMember(Name = ("defaultValue"), IsRequired = (true))] + public double DefaultValue + { + get; + set; + } + } + + /// + /// Properties of a web font: https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions + /// and additional information such as platformFontFamily and fontVariationAxes. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FontFace : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The font-family. + /// + [DataMember(Name = ("fontFamily"), IsRequired = (true))] + public string FontFamily + { + get; + set; + } + + /// + /// The font-style. + /// + [DataMember(Name = ("fontStyle"), IsRequired = (true))] + public string FontStyle + { + get; + set; + } + + /// + /// The font-variant. + /// + [DataMember(Name = ("fontVariant"), IsRequired = (true))] + public string FontVariant + { + get; + set; + } + + /// + /// The font-weight. + /// + [DataMember(Name = ("fontWeight"), IsRequired = (true))] + public string FontWeight + { + get; + set; + } + + /// + /// The font-stretch. + /// + [DataMember(Name = ("fontStretch"), IsRequired = (true))] + public string FontStretch + { + get; + set; + } + + /// + /// The font-display. + /// + [DataMember(Name = ("fontDisplay"), IsRequired = (true))] + public string FontDisplay + { + get; + set; + } + + /// + /// The unicode-range. + /// + [DataMember(Name = ("unicodeRange"), IsRequired = (true))] + public string UnicodeRange + { + get; + set; + } + + /// + /// The src. + /// + [DataMember(Name = ("src"), IsRequired = (true))] + public string Src + { + get; + set; + } + + /// + /// The resolved platform font family + /// + [DataMember(Name = ("platformFontFamily"), IsRequired = (true))] + public string PlatformFontFamily + { + get; + set; + } + + /// + /// Available variation settings (a.k.a. "axes"). + /// + [DataMember(Name = ("fontVariationAxes"), IsRequired = (false))] + public System.Collections.Generic.IList FontVariationAxes + { + get; + set; + } + } + + /// + /// CSS try rule representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSTryRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get + { + return (CefSharp.DevTools.CSS.StyleSheetOrigin)(StringToEnum(typeof(CefSharp.DevTools.CSS.StyleSheetOrigin), origin)); + } + + set + { + this.origin = (EnumToString(value)); + } + } + + /// + /// Parent stylesheet's origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + internal string origin + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [DataMember(Name = ("style"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// CSS @position-try rule representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSPositionTryRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The prelude dashed-ident name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public CefSharp.DevTools.CSS.Value Name + { + get; + set; + } + + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get + { + return (CefSharp.DevTools.CSS.StyleSheetOrigin)(StringToEnum(typeof(CefSharp.DevTools.CSS.StyleSheetOrigin), origin)); + } + + set + { + this.origin = (EnumToString(value)); + } + } + + /// + /// Parent stylesheet's origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + internal string origin + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [DataMember(Name = ("style"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + + /// + /// Active + /// + [DataMember(Name = ("active"), IsRequired = (true))] + public bool Active + { + get; + set; + } + } + + /// + /// CSS keyframes rule representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSKeyframesRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Animation name. + /// + [DataMember(Name = ("animationName"), IsRequired = (true))] + public CefSharp.DevTools.CSS.Value AnimationName + { + get; + set; + } + + /// + /// List of keyframes. + /// + [DataMember(Name = ("keyframes"), IsRequired = (true))] + public System.Collections.Generic.IList Keyframes + { + get; + set; + } + } + + /// + /// Representation of a custom property registration through CSS.registerProperty + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSPropertyRegistration : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// PropertyName + /// + [DataMember(Name = ("propertyName"), IsRequired = (true))] + public string PropertyName + { + get; + set; + } + + /// + /// InitialValue + /// + [DataMember(Name = ("initialValue"), IsRequired = (false))] + public CefSharp.DevTools.CSS.Value InitialValue + { + get; + set; + } + + /// + /// Inherits + /// + [DataMember(Name = ("inherits"), IsRequired = (true))] + public bool Inherits + { + get; + set; + } + + /// + /// Syntax + /// + [DataMember(Name = ("syntax"), IsRequired = (true))] + public string Syntax + { + get; + set; + } + } + + /// + /// Type of at-rule. + /// + public enum CSSAtRuleType + { + /// + /// font-face + /// + [EnumMember(Value = ("font-face"))] + FontFace, + /// + /// font-feature-values + /// + [EnumMember(Value = ("font-feature-values"))] + FontFeatureValues, + /// + /// font-palette-values + /// + [EnumMember(Value = ("font-palette-values"))] + FontPaletteValues + } + + /// + /// Subsection of font-feature-values, if this is a subsection. + /// + public enum CSSAtRuleSubsection + { + /// + /// swash + /// + [EnumMember(Value = ("swash"))] + Swash, + /// + /// annotation + /// + [EnumMember(Value = ("annotation"))] + Annotation, + /// + /// ornaments + /// + [EnumMember(Value = ("ornaments"))] + Ornaments, + /// + /// stylistic + /// + [EnumMember(Value = ("stylistic"))] + Stylistic, + /// + /// styleset + /// + [EnumMember(Value = ("styleset"))] + Styleset, + /// + /// character-variant + /// + [EnumMember(Value = ("character-variant"))] + CharacterVariant + } + + /// + /// CSS generic @rule representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSAtRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type of at-rule. + /// + public CefSharp.DevTools.CSS.CSSAtRuleType Type + { + get + { + return (CefSharp.DevTools.CSS.CSSAtRuleType)(StringToEnum(typeof(CefSharp.DevTools.CSS.CSSAtRuleType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type of at-rule. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Subsection of font-feature-values, if this is a subsection. + /// + public CefSharp.DevTools.CSS.CSSAtRuleSubsection? Subsection + { + get + { + return (CefSharp.DevTools.CSS.CSSAtRuleSubsection? )(StringToEnum(typeof(CefSharp.DevTools.CSS.CSSAtRuleSubsection? ), subsection)); + } + + set + { + this.subsection = (EnumToString(value)); + } + } + + /// + /// Subsection of font-feature-values, if this is a subsection. + /// + [DataMember(Name = ("subsection"), IsRequired = (false))] + internal string subsection + { + get; + set; + } + + /// + /// LINT.ThenChange(//third_party/blink/renderer/core/inspector/inspector_style_sheet.cc:FontVariantAlternatesFeatureType,//third_party/blink/renderer/core/inspector/inspector_css_agent.cc:FontVariantAlternatesFeatureType) + /// Associated name, if applicable. + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public CefSharp.DevTools.CSS.Value Name + { + get; + set; + } + + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get + { + return (CefSharp.DevTools.CSS.StyleSheetOrigin)(StringToEnum(typeof(CefSharp.DevTools.CSS.StyleSheetOrigin), origin)); + } + + set + { + this.origin = (EnumToString(value)); + } + } + + /// + /// Parent stylesheet's origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + internal string origin + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [DataMember(Name = ("style"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// CSS property at-rule representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSPropertyRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get + { + return (CefSharp.DevTools.CSS.StyleSheetOrigin)(StringToEnum(typeof(CefSharp.DevTools.CSS.StyleSheetOrigin), origin)); + } + + set + { + this.origin = (EnumToString(value)); + } + } + + /// + /// Parent stylesheet's origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + internal string origin + { + get; + set; + } + + /// + /// Associated property name. + /// + [DataMember(Name = ("propertyName"), IsRequired = (true))] + public CefSharp.DevTools.CSS.Value PropertyName + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [DataMember(Name = ("style"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// CSS function argument representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSFunctionParameter : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The parameter name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// The parameter type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + public string Type + { + get; + set; + } + } + + /// + /// CSS function conditional block representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSFunctionConditionNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Media query for this conditional block. Only one type of condition should be set. + /// + [DataMember(Name = ("media"), IsRequired = (false))] + public CefSharp.DevTools.CSS.CSSMedia Media + { + get; + set; + } + + /// + /// Container query for this conditional block. Only one type of condition should be set. + /// + [DataMember(Name = ("containerQueries"), IsRequired = (false))] + public CefSharp.DevTools.CSS.CSSContainerQuery ContainerQueries + { + get; + set; + } + + /// + /// @supports CSS at-rule condition. Only one type of condition should be set. + /// + [DataMember(Name = ("supports"), IsRequired = (false))] + public CefSharp.DevTools.CSS.CSSSupports Supports + { + get; + set; + } + + /// + /// Block body. + /// + [DataMember(Name = ("children"), IsRequired = (true))] + public System.Collections.Generic.IList Children + { + get; + set; + } + + /// + /// The condition text. + /// + [DataMember(Name = ("conditionText"), IsRequired = (true))] + public string ConditionText + { + get; + set; + } + } + + /// + /// Section of the body of a CSS function rule. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSFunctionNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A conditional block. If set, style should not be set. + /// + [DataMember(Name = ("condition"), IsRequired = (false))] + public CefSharp.DevTools.CSS.CSSFunctionConditionNode Condition + { + get; + set; + } + + /// + /// Values set by this node. If set, condition should not be set. + /// + [DataMember(Name = ("style"), IsRequired = (false))] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// CSS function at-rule representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSFunctionRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of the function. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public CefSharp.DevTools.CSS.Value Name + { + get; + set; + } + + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get + { + return (CefSharp.DevTools.CSS.StyleSheetOrigin)(StringToEnum(typeof(CefSharp.DevTools.CSS.StyleSheetOrigin), origin)); + } + + set + { + this.origin = (EnumToString(value)); + } + } + + /// + /// Parent stylesheet's origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + internal string origin + { + get; + set; + } + + /// + /// List of parameters. + /// + [DataMember(Name = ("parameters"), IsRequired = (true))] + public System.Collections.Generic.IList Parameters + { + get; + set; + } + + /// + /// Function body. + /// + [DataMember(Name = ("children"), IsRequired = (true))] + public System.Collections.Generic.IList Children + { + get; + set; + } + } + + /// + /// CSS keyframe rule representation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSKeyframeRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (false))] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get + { + return (CefSharp.DevTools.CSS.StyleSheetOrigin)(StringToEnum(typeof(CefSharp.DevTools.CSS.StyleSheetOrigin), origin)); + } + + set + { + this.origin = (EnumToString(value)); + } + } + + /// + /// Parent stylesheet's origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + internal string origin + { + get; + set; + } + + /// + /// Associated key text. + /// + [DataMember(Name = ("keyText"), IsRequired = (true))] + public CefSharp.DevTools.CSS.Value KeyText + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [DataMember(Name = ("style"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// A descriptor of operation to mutate style declaration text. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class StyleDeclarationEdit : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (true))] + public string StyleSheetId + { + get; + set; + } + + /// + /// The range of the style text in the enclosing stylesheet. + /// + [DataMember(Name = ("range"), IsRequired = (true))] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// New style text. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + } + + /// + /// Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded + /// web font. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FontsUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The web font that has loaded. + /// + [DataMember(Name = ("font"), IsRequired = (false))] + public CefSharp.DevTools.CSS.FontFace Font + { + get; + private set; + } + } + + /// + /// Fired whenever an active document stylesheet is added. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class StyleSheetAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Added stylesheet metainfo. + /// + [DataMember(Name = ("header"), IsRequired = (true))] + public CefSharp.DevTools.CSS.CSSStyleSheetHeader Header + { + get; + private set; + } + } + + /// + /// Fired whenever a stylesheet is changed as a result of the client operation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class StyleSheetChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StyleSheetId + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (true))] + public string StyleSheetId + { + get; + private set; + } + } + + /// + /// Fired whenever an active document stylesheet is removed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class StyleSheetRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier of the removed stylesheet. + /// + [DataMember(Name = ("styleSheetId"), IsRequired = (true))] + public string StyleSheetId + { + get; + private set; + } + } + + /// + /// computedStyleUpdated + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ComputedStyleUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The node id that has updated computed styles. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + /// + /// type of HTTP response cached + /// + public enum CachedResponseType + { + /// + /// basic + /// + [EnumMember(Value = ("basic"))] + Basic, + /// + /// cors + /// + [EnumMember(Value = ("cors"))] + Cors, + /// + /// default + /// + [EnumMember(Value = ("default"))] + Default, + /// + /// error + /// + [EnumMember(Value = ("error"))] + Error, + /// + /// opaqueResponse + /// + [EnumMember(Value = ("opaqueResponse"))] + OpaqueResponse, + /// + /// opaqueRedirect + /// + [EnumMember(Value = ("opaqueRedirect"))] + OpaqueRedirect + } + + /// + /// Data entry. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DataEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Request URL. + /// + [DataMember(Name = ("requestURL"), IsRequired = (true))] + public string RequestURL + { + get; + set; + } + + /// + /// Request method. + /// + [DataMember(Name = ("requestMethod"), IsRequired = (true))] + public string RequestMethod + { + get; + set; + } + + /// + /// Request headers + /// + [DataMember(Name = ("requestHeaders"), IsRequired = (true))] + public System.Collections.Generic.IList RequestHeaders + { + get; + set; + } + + /// + /// Number of seconds since epoch. + /// + [DataMember(Name = ("responseTime"), IsRequired = (true))] + public double ResponseTime + { + get; + set; + } + + /// + /// HTTP response status code. + /// + [DataMember(Name = ("responseStatus"), IsRequired = (true))] + public int ResponseStatus + { + get; + set; + } + + /// + /// HTTP response status text. + /// + [DataMember(Name = ("responseStatusText"), IsRequired = (true))] + public string ResponseStatusText + { + get; + set; + } + + /// + /// HTTP response type + /// + public CefSharp.DevTools.CacheStorage.CachedResponseType ResponseType + { + get + { + return (CefSharp.DevTools.CacheStorage.CachedResponseType)(StringToEnum(typeof(CefSharp.DevTools.CacheStorage.CachedResponseType), responseType)); + } + + set + { + this.responseType = (EnumToString(value)); + } + } + + /// + /// HTTP response type + /// + [DataMember(Name = ("responseType"), IsRequired = (true))] + internal string responseType + { + get; + set; + } + + /// + /// Response headers + /// + [DataMember(Name = ("responseHeaders"), IsRequired = (true))] + public System.Collections.Generic.IList ResponseHeaders + { + get; + set; + } + } + + /// + /// Cache identifier. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Cache : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// An opaque unique id of the cache. + /// + [DataMember(Name = ("cacheId"), IsRequired = (true))] + public string CacheId + { + get; + set; + } + + /// + /// Security origin of the cache. + /// + [DataMember(Name = ("securityOrigin"), IsRequired = (true))] + public string SecurityOrigin + { + get; + set; + } + + /// + /// Storage key of the cache. + /// + [DataMember(Name = ("storageKey"), IsRequired = (true))] + public string StorageKey + { + get; + set; + } + + /// + /// Storage bucket of the cache. + /// + [DataMember(Name = ("storageBucket"), IsRequired = (false))] + public CefSharp.DevTools.Storage.StorageBucket StorageBucket + { + get; + set; + } + + /// + /// The name of the cache. + /// + [DataMember(Name = ("cacheName"), IsRequired = (true))] + public string CacheName + { + get; + set; + } + } + + /// + /// Header + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Header : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// Cached response + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CachedResponse : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Entry content, base64-encoded. + /// + [DataMember(Name = ("body"), IsRequired = (true))] + public byte[] Body + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.Cast +{ + /// + /// Sink + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Sink : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// Text describing the current session. Present only if there is an active + /// session on the sink. + /// + [DataMember(Name = ("session"), IsRequired = (false))] + public string Session + { + get; + set; + } + } + + /// + /// This is fired whenever the list of available sinks changes. A sink is a + /// device or a software surface that you can cast to. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class SinksUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Sinks + /// + [DataMember(Name = ("sinks"), IsRequired = (true))] + public System.Collections.Generic.IList Sinks + { + get; + private set; + } + } + + /// + /// This is fired whenever the outstanding issue/error message changes. + /// |issueMessage| is empty if there is no issue. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class IssueUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// IssueMessage + /// + [DataMember(Name = ("issueMessage"), IsRequired = (true))] + public string IssueMessage + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// Backend node with a friendly name. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BackendNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `Node`'s nodeType. + /// + [DataMember(Name = ("nodeType"), IsRequired = (true))] + public int NodeType + { + get; + set; + } + + /// + /// `Node`'s nodeName. + /// + [DataMember(Name = ("nodeName"), IsRequired = (true))] + public string NodeName + { + get; + set; + } + + /// + /// BackendNodeId + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (true))] + public int BackendNodeId + { + get; + set; + } + } + + /// + /// Pseudo element type. + /// + public enum PseudoType + { + /// + /// first-line + /// + [EnumMember(Value = ("first-line"))] + FirstLine, + /// + /// first-letter + /// + [EnumMember(Value = ("first-letter"))] + FirstLetter, + /// + /// checkmark + /// + [EnumMember(Value = ("checkmark"))] + Checkmark, + /// + /// before + /// + [EnumMember(Value = ("before"))] + Before, + /// + /// after + /// + [EnumMember(Value = ("after"))] + After, + /// + /// picker-icon + /// + [EnumMember(Value = ("picker-icon"))] + PickerIcon, + /// + /// interest-hint + /// + [EnumMember(Value = ("interest-hint"))] + InterestHint, + /// + /// marker + /// + [EnumMember(Value = ("marker"))] + Marker, + /// + /// backdrop + /// + [EnumMember(Value = ("backdrop"))] + Backdrop, + /// + /// column + /// + [EnumMember(Value = ("column"))] + Column, + /// + /// selection + /// + [EnumMember(Value = ("selection"))] + Selection, + /// + /// search-text + /// + [EnumMember(Value = ("search-text"))] + SearchText, + /// + /// target-text + /// + [EnumMember(Value = ("target-text"))] + TargetText, + /// + /// spelling-error + /// + [EnumMember(Value = ("spelling-error"))] + SpellingError, + /// + /// grammar-error + /// + [EnumMember(Value = ("grammar-error"))] + GrammarError, + /// + /// highlight + /// + [EnumMember(Value = ("highlight"))] + Highlight, + /// + /// first-line-inherited + /// + [EnumMember(Value = ("first-line-inherited"))] + FirstLineInherited, + /// + /// scroll-marker + /// + [EnumMember(Value = ("scroll-marker"))] + ScrollMarker, + /// + /// scroll-marker-group + /// + [EnumMember(Value = ("scroll-marker-group"))] + ScrollMarkerGroup, + /// + /// scroll-button + /// + [EnumMember(Value = ("scroll-button"))] + ScrollButton, + /// + /// scrollbar + /// + [EnumMember(Value = ("scrollbar"))] + Scrollbar, + /// + /// scrollbar-thumb + /// + [EnumMember(Value = ("scrollbar-thumb"))] + ScrollbarThumb, + /// + /// scrollbar-button + /// + [EnumMember(Value = ("scrollbar-button"))] + ScrollbarButton, + /// + /// scrollbar-track + /// + [EnumMember(Value = ("scrollbar-track"))] + ScrollbarTrack, + /// + /// scrollbar-track-piece + /// + [EnumMember(Value = ("scrollbar-track-piece"))] + ScrollbarTrackPiece, + /// + /// scrollbar-corner + /// + [EnumMember(Value = ("scrollbar-corner"))] + ScrollbarCorner, + /// + /// resizer + /// + [EnumMember(Value = ("resizer"))] + Resizer, + /// + /// input-list-button + /// + [EnumMember(Value = ("input-list-button"))] + InputListButton, + /// + /// view-transition + /// + [EnumMember(Value = ("view-transition"))] + ViewTransition, + /// + /// view-transition-group + /// + [EnumMember(Value = ("view-transition-group"))] + ViewTransitionGroup, + /// + /// view-transition-image-pair + /// + [EnumMember(Value = ("view-transition-image-pair"))] + ViewTransitionImagePair, + /// + /// view-transition-group-children + /// + [EnumMember(Value = ("view-transition-group-children"))] + ViewTransitionGroupChildren, + /// + /// view-transition-old + /// + [EnumMember(Value = ("view-transition-old"))] + ViewTransitionOld, + /// + /// view-transition-new + /// + [EnumMember(Value = ("view-transition-new"))] + ViewTransitionNew, + /// + /// placeholder + /// + [EnumMember(Value = ("placeholder"))] + Placeholder, + /// + /// file-selector-button + /// + [EnumMember(Value = ("file-selector-button"))] + FileSelectorButton, + /// + /// details-content + /// + [EnumMember(Value = ("details-content"))] + DetailsContent, + /// + /// picker + /// + [EnumMember(Value = ("picker"))] + Picker, + /// + /// permission-icon + /// + [EnumMember(Value = ("permission-icon"))] + PermissionIcon, + /// + /// overscroll-area-parent + /// + [EnumMember(Value = ("overscroll-area-parent"))] + OverscrollAreaParent + } + + /// + /// Shadow root type. + /// + public enum ShadowRootType + { + /// + /// user-agent + /// + [EnumMember(Value = ("user-agent"))] + UserAgent, + /// + /// open + /// + [EnumMember(Value = ("open"))] + Open, + /// + /// closed + /// + [EnumMember(Value = ("closed"))] + Closed + } + + /// + /// Document compatibility mode. + /// + public enum CompatibilityMode + { + /// + /// QuirksMode + /// + [EnumMember(Value = ("QuirksMode"))] + QuirksMode, + /// + /// LimitedQuirksMode + /// + [EnumMember(Value = ("LimitedQuirksMode"))] + LimitedQuirksMode, + /// + /// NoQuirksMode + /// + [EnumMember(Value = ("NoQuirksMode"))] + NoQuirksMode + } + + /// + /// ContainerSelector physical axes + /// + public enum PhysicalAxes + { + /// + /// Horizontal + /// + [EnumMember(Value = ("Horizontal"))] + Horizontal, + /// + /// Vertical + /// + [EnumMember(Value = ("Vertical"))] + Vertical, + /// + /// Both + /// + [EnumMember(Value = ("Both"))] + Both + } + + /// + /// ContainerSelector logical axes + /// + public enum LogicalAxes + { + /// + /// Inline + /// + [EnumMember(Value = ("Inline"))] + Inline, + /// + /// Block + /// + [EnumMember(Value = ("Block"))] + Block, + /// + /// Both + /// + [EnumMember(Value = ("Both"))] + Both + } + + /// + /// Physical scroll orientation + /// + public enum ScrollOrientation + { + /// + /// horizontal + /// + [EnumMember(Value = ("horizontal"))] + Horizontal, + /// + /// vertical + /// + [EnumMember(Value = ("vertical"))] + Vertical + } + + /// + /// DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. + /// DOMNode is a base node mirror type. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Node : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend + /// will only push node with given `id` once. It is aware of all requested nodes and will only + /// fire DOM events for nodes known to the client. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + set; + } + + /// + /// The id of the parent node if any. + /// + [DataMember(Name = ("parentId"), IsRequired = (false))] + public int? ParentId + { + get; + set; + } + + /// + /// The BackendNodeId for this node. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (true))] + public int BackendNodeId + { + get; + set; + } + + /// + /// `Node`'s nodeType. + /// + [DataMember(Name = ("nodeType"), IsRequired = (true))] + public int NodeType + { + get; + set; + } + + /// + /// `Node`'s nodeName. + /// + [DataMember(Name = ("nodeName"), IsRequired = (true))] + public string NodeName + { + get; + set; + } + + /// + /// `Node`'s localName. + /// + [DataMember(Name = ("localName"), IsRequired = (true))] + public string LocalName + { + get; + set; + } + + /// + /// `Node`'s nodeValue. + /// + [DataMember(Name = ("nodeValue"), IsRequired = (true))] + public string NodeValue + { + get; + set; + } + + /// + /// Child count for `Container` nodes. + /// + [DataMember(Name = ("childNodeCount"), IsRequired = (false))] + public int? ChildNodeCount + { + get; + set; + } + + /// + /// Child nodes of this node when requested with children. + /// + [DataMember(Name = ("children"), IsRequired = (false))] + public System.Collections.Generic.IList Children + { + get; + set; + } + + /// + /// Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`. + /// + [DataMember(Name = ("attributes"), IsRequired = (false))] + public string[] Attributes + { + get; + set; + } + + /// + /// Document URL that `Document` or `FrameOwner` node points to. + /// + [DataMember(Name = ("documentURL"), IsRequired = (false))] + public string DocumentURL + { + get; + set; + } + + /// + /// Base URL that `Document` or `FrameOwner` node uses for URL completion. + /// + [DataMember(Name = ("baseURL"), IsRequired = (false))] + public string BaseURL + { + get; + set; + } + + /// + /// `DocumentType`'s publicId. + /// + [DataMember(Name = ("publicId"), IsRequired = (false))] + public string PublicId + { + get; + set; + } + + /// + /// `DocumentType`'s systemId. + /// + [DataMember(Name = ("systemId"), IsRequired = (false))] + public string SystemId + { + get; + set; + } + + /// + /// `DocumentType`'s internalSubset. + /// + [DataMember(Name = ("internalSubset"), IsRequired = (false))] + public string InternalSubset + { + get; + set; + } + + /// + /// `Document`'s XML version in case of XML documents. + /// + [DataMember(Name = ("xmlVersion"), IsRequired = (false))] + public string XmlVersion + { + get; + set; + } + + /// + /// `Attr`'s name. + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// `Attr`'s value. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public string Value + { + get; + set; + } + + /// + /// Pseudo element type for this node. + /// + public CefSharp.DevTools.DOM.PseudoType? PseudoType + { + get + { + return (CefSharp.DevTools.DOM.PseudoType? )(StringToEnum(typeof(CefSharp.DevTools.DOM.PseudoType? ), pseudoType)); + } + + set + { + this.pseudoType = (EnumToString(value)); + } + } + + /// + /// Pseudo element type for this node. + /// + [DataMember(Name = ("pseudoType"), IsRequired = (false))] + internal string pseudoType + { + get; + set; + } + + /// + /// Pseudo element identifier for this node. Only present if there is a + /// valid pseudoType. + /// + [DataMember(Name = ("pseudoIdentifier"), IsRequired = (false))] + public string PseudoIdentifier + { + get; + set; + } + + /// + /// Shadow root type. + /// + public CefSharp.DevTools.DOM.ShadowRootType? ShadowRootType + { + get + { + return (CefSharp.DevTools.DOM.ShadowRootType? )(StringToEnum(typeof(CefSharp.DevTools.DOM.ShadowRootType? ), shadowRootType)); + } + + set + { + this.shadowRootType = (EnumToString(value)); + } + } + + /// + /// Shadow root type. + /// + [DataMember(Name = ("shadowRootType"), IsRequired = (false))] + internal string shadowRootType + { + get; + set; + } + + /// + /// Frame ID for frame owner elements. + /// + [DataMember(Name = ("frameId"), IsRequired = (false))] + public string FrameId + { + get; + set; + } + + /// + /// Content document for frame owner elements. + /// + [DataMember(Name = ("contentDocument"), IsRequired = (false))] + public CefSharp.DevTools.DOM.Node ContentDocument + { + get; + set; + } + + /// + /// Shadow root list for given element host. + /// + [DataMember(Name = ("shadowRoots"), IsRequired = (false))] + public System.Collections.Generic.IList ShadowRoots + { + get; + set; + } + + /// + /// Content document fragment for template elements. + /// + [DataMember(Name = ("templateContent"), IsRequired = (false))] + public CefSharp.DevTools.DOM.Node TemplateContent + { + get; + set; + } + + /// + /// Pseudo elements associated with this node. + /// + [DataMember(Name = ("pseudoElements"), IsRequired = (false))] + public System.Collections.Generic.IList PseudoElements + { + get; + set; + } + + /// + /// Deprecated, as the HTML Imports API has been removed (crbug.com/937746). + /// This property used to return the imported document for the HTMLImport links. + /// The property is always undefined now. + /// + [DataMember(Name = ("importedDocument"), IsRequired = (false))] + public CefSharp.DevTools.DOM.Node ImportedDocument + { + get; + set; + } + + /// + /// Distributed nodes for given insertion point. + /// + [DataMember(Name = ("distributedNodes"), IsRequired = (false))] + public System.Collections.Generic.IList DistributedNodes + { + get; + set; + } + + /// + /// Whether the node is SVG. + /// + [DataMember(Name = ("isSVG"), IsRequired = (false))] + public bool? IsSVG + { + get; + set; + } + + /// + /// CompatibilityMode + /// + public CefSharp.DevTools.DOM.CompatibilityMode? CompatibilityMode + { + get + { + return (CefSharp.DevTools.DOM.CompatibilityMode? )(StringToEnum(typeof(CefSharp.DevTools.DOM.CompatibilityMode? ), compatibilityMode)); + } + + set + { + this.compatibilityMode = (EnumToString(value)); + } + } + + /// + /// CompatibilityMode + /// + [DataMember(Name = ("compatibilityMode"), IsRequired = (false))] + internal string compatibilityMode + { + get; + set; + } + + /// + /// AssignedSlot + /// + [DataMember(Name = ("assignedSlot"), IsRequired = (false))] + public CefSharp.DevTools.DOM.BackendNode AssignedSlot + { + get; + set; + } + + /// + /// IsScrollable + /// + [DataMember(Name = ("isScrollable"), IsRequired = (false))] + public bool? IsScrollable + { + get; + set; + } + + /// + /// AffectedByStartingStyles + /// + [DataMember(Name = ("affectedByStartingStyles"), IsRequired = (false))] + public bool? AffectedByStartingStyles + { + get; + set; + } + + /// + /// AdoptedStyleSheets + /// + [DataMember(Name = ("adoptedStyleSheets"), IsRequired = (false))] + public string[] AdoptedStyleSheets + { + get; + set; + } + } + + /// + /// A structure to hold the top-level node of a detached tree and an array of its retained descendants. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DetachedElementInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TreeNode + /// + [DataMember(Name = ("treeNode"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Node TreeNode + { + get; + set; + } + + /// + /// RetainedNodeIds + /// + [DataMember(Name = ("retainedNodeIds"), IsRequired = (true))] + public int[] RetainedNodeIds + { + get; + set; + } + } + + /// + /// A structure holding an RGBA color. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RGBA : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The red component, in the [0-255] range. + /// + [DataMember(Name = ("r"), IsRequired = (true))] + public int R + { + get; + set; + } + + /// + /// The green component, in the [0-255] range. + /// + [DataMember(Name = ("g"), IsRequired = (true))] + public int G + { + get; + set; + } + + /// + /// The blue component, in the [0-255] range. + /// + [DataMember(Name = ("b"), IsRequired = (true))] + public int B + { + get; + set; + } + + /// + /// The alpha component, in the [0-1] range (default: 1). + /// + [DataMember(Name = ("a"), IsRequired = (false))] + public double? A + { + get; + set; + } + } + + /// + /// Box model. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BoxModel : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Content box + /// + [DataMember(Name = ("content"), IsRequired = (true))] + public double[] Content + { + get; + set; + } + + /// + /// Padding box + /// + [DataMember(Name = ("padding"), IsRequired = (true))] + public double[] Padding + { + get; + set; + } + + /// + /// Border box + /// + [DataMember(Name = ("border"), IsRequired = (true))] + public double[] Border + { + get; + set; + } + + /// + /// Margin box + /// + [DataMember(Name = ("margin"), IsRequired = (true))] + public double[] Margin + { + get; + set; + } + + /// + /// Node width + /// + [DataMember(Name = ("width"), IsRequired = (true))] + public int Width + { + get; + set; + } + + /// + /// Node height + /// + [DataMember(Name = ("height"), IsRequired = (true))] + public int Height + { + get; + set; + } + + /// + /// Shape outside coordinates + /// + [DataMember(Name = ("shapeOutside"), IsRequired = (false))] + public CefSharp.DevTools.DOM.ShapeOutsideInfo ShapeOutside + { + get; + set; + } + } + + /// + /// CSS Shape Outside details. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ShapeOutsideInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Shape bounds + /// + [DataMember(Name = ("bounds"), IsRequired = (true))] + public double[] Bounds + { + get; + set; + } + + /// + /// Shape coordinate details + /// + [DataMember(Name = ("shape"), IsRequired = (true))] + public object[] Shape + { + get; + set; + } + + /// + /// Margin shape bounds + /// + [DataMember(Name = ("marginShape"), IsRequired = (true))] + public object[] MarginShape + { + get; + set; + } + } + + /// + /// Rectangle. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Rect : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X coordinate + /// + [DataMember(Name = ("x"), IsRequired = (true))] + public double X + { + get; + set; + } + + /// + /// Y coordinate + /// + [DataMember(Name = ("y"), IsRequired = (true))] + public double Y + { + get; + set; + } + + /// + /// Rectangle width + /// + [DataMember(Name = ("width"), IsRequired = (true))] + public double Width + { + get; + set; + } + + /// + /// Rectangle height + /// + [DataMember(Name = ("height"), IsRequired = (true))] + public double Height + { + get; + set; + } + } + + /// + /// CSSComputedStyleProperty + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CSSComputedStyleProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Computed style property name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Computed style property value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// Fired when `Element`'s attribute is modified. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AttributeModifiedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + + /// + /// Attribute name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + private set; + } + + /// + /// Attribute value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + private set; + } + } + + /// + /// Fired when `Element`'s adoptedStyleSheets are modified. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AdoptedStyleSheetsModifiedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + + /// + /// New adoptedStyleSheets array. + /// + [DataMember(Name = ("adoptedStyleSheets"), IsRequired = (true))] + public string[] AdoptedStyleSheets + { + get; + private set; + } + } + + /// + /// Fired when `Element`'s attribute is removed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AttributeRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + + /// + /// A ttribute name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + private set; + } + } + + /// + /// Mirrors `DOMCharacterDataModified` event. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CharacterDataModifiedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + + /// + /// New text value. + /// + [DataMember(Name = ("characterData"), IsRequired = (true))] + public string CharacterData + { + get; + private set; + } + } + + /// + /// Fired when `Container`'s child node count has changed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ChildNodeCountUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + + /// + /// New node count. + /// + [DataMember(Name = ("childNodeCount"), IsRequired = (true))] + public int ChildNodeCount + { + get; + private set; + } + } + + /// + /// Mirrors `DOMNodeInserted` event. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ChildNodeInsertedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [DataMember(Name = ("parentNodeId"), IsRequired = (true))] + public int ParentNodeId + { + get; + private set; + } + + /// + /// Id of the previous sibling. + /// + [DataMember(Name = ("previousNodeId"), IsRequired = (true))] + public int PreviousNodeId + { + get; + private set; + } + + /// + /// Inserted node data. + /// + [DataMember(Name = ("node"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Node Node + { + get; + private set; + } + } + + /// + /// Mirrors `DOMNodeRemoved` event. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ChildNodeRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Parent id. + /// + [DataMember(Name = ("parentNodeId"), IsRequired = (true))] + public int ParentNodeId + { + get; + private set; + } + + /// + /// Id of the node that has been removed. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + } + + /// + /// Called when distribution is changed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DistributedNodesUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Insertion point where distributed nodes were updated. + /// + [DataMember(Name = ("insertionPointId"), IsRequired = (true))] + public int InsertionPointId + { + get; + private set; + } + + /// + /// Distributed nodes for given insertion point. + /// + [DataMember(Name = ("distributedNodes"), IsRequired = (true))] + public System.Collections.Generic.IList DistributedNodes + { + get; + private set; + } + } + + /// + /// Fired when `Element`'s inline style is modified via a CSS property modification. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class InlineStyleInvalidatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Ids of the nodes for which the inline styles have been invalidated. + /// + [DataMember(Name = ("nodeIds"), IsRequired = (true))] + public int[] NodeIds + { + get; + private set; + } + } + + /// + /// Called when a pseudo element is added to an element. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PseudoElementAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Pseudo element's parent element id. + /// + [DataMember(Name = ("parentId"), IsRequired = (true))] + public int ParentId + { + get; + private set; + } + + /// + /// The added pseudo element. + /// + [DataMember(Name = ("pseudoElement"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Node PseudoElement + { + get; + private set; + } + } + + /// + /// Fired when a node's scrollability state changes. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ScrollableFlagUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The id of the node. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + + /// + /// If the node is scrollable. + /// + [DataMember(Name = ("isScrollable"), IsRequired = (true))] + public bool IsScrollable + { + get; + private set; + } + } + + /// + /// Fired when a node's starting styles changes. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AffectedByStartingStylesFlagUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The id of the node. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + + /// + /// If the node has starting styles. + /// + [DataMember(Name = ("affectedByStartingStyles"), IsRequired = (true))] + public bool AffectedByStartingStyles + { + get; + private set; + } + } + + /// + /// Called when a pseudo element is removed from an element. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PseudoElementRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Pseudo element's parent element id. + /// + [DataMember(Name = ("parentId"), IsRequired = (true))] + public int ParentId + { + get; + private set; + } + + /// + /// The removed pseudo element id. + /// + [DataMember(Name = ("pseudoElementId"), IsRequired = (true))] + public int PseudoElementId + { + get; + private set; + } + } + + /// + /// Fired when backend wants to provide client with the missing DOM structure. This happens upon + /// most of the calls requesting node ids. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class SetChildNodesEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Parent node id to populate with children. + /// + [DataMember(Name = ("parentId"), IsRequired = (true))] + public int ParentId + { + get; + private set; + } + + /// + /// Child nodes array. + /// + [DataMember(Name = ("nodes"), IsRequired = (true))] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } + + /// + /// Called when shadow root is popped from the element. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ShadowRootPoppedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Host element id. + /// + [DataMember(Name = ("hostId"), IsRequired = (true))] + public int HostId + { + get; + private set; + } + + /// + /// Shadow root id. + /// + [DataMember(Name = ("rootId"), IsRequired = (true))] + public int RootId + { + get; + private set; + } + } + + /// + /// Called when shadow root is pushed into the element. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ShadowRootPushedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Host element id. + /// + [DataMember(Name = ("hostId"), IsRequired = (true))] + public int HostId + { + get; + private set; + } + + /// + /// Shadow root. + /// + [DataMember(Name = ("root"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Node Root + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOMDebugger +{ + /// + /// DOM breakpoint type. + /// + public enum DOMBreakpointType + { + /// + /// subtree-modified + /// + [EnumMember(Value = ("subtree-modified"))] + SubtreeModified, + /// + /// attribute-modified + /// + [EnumMember(Value = ("attribute-modified"))] + AttributeModified, + /// + /// node-removed + /// + [EnumMember(Value = ("node-removed"))] + NodeRemoved + } + + /// + /// CSP Violation type. + /// + public enum CSPViolationType + { + /// + /// trustedtype-sink-violation + /// + [EnumMember(Value = ("trustedtype-sink-violation"))] + TrustedtypeSinkViolation, + /// + /// trustedtype-policy-violation + /// + [EnumMember(Value = ("trustedtype-policy-violation"))] + TrustedtypePolicyViolation + } + + /// + /// Object event listener. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class EventListener : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `EventListener`'s type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + public string Type + { + get; + set; + } + + /// + /// `EventListener`'s useCapture. + /// + [DataMember(Name = ("useCapture"), IsRequired = (true))] + public bool UseCapture + { + get; + set; + } + + /// + /// `EventListener`'s passive flag. + /// + [DataMember(Name = ("passive"), IsRequired = (true))] + public bool Passive + { + get; + set; + } + + /// + /// `EventListener`'s once flag. + /// + [DataMember(Name = ("once"), IsRequired = (true))] + public bool Once + { + get; + set; + } + + /// + /// Script id of the handler code. + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + set; + } + + /// + /// Line number in the script (0-based). + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// Column number in the script (0-based). + /// + [DataMember(Name = ("columnNumber"), IsRequired = (true))] + public int ColumnNumber + { + get; + set; + } + + /// + /// Event handler function value. + /// + [DataMember(Name = ("handler"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Handler + { + get; + set; + } + + /// + /// Event original handler function value. + /// + [DataMember(Name = ("originalHandler"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject OriginalHandler + { + get; + set; + } + + /// + /// Node the listener is added to (if any). + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (false))] + public int? BackendNodeId + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.DOMSnapshot +{ + /// + /// A Node in the DOM tree. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DOMNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `Node`'s nodeType. + /// + [DataMember(Name = ("nodeType"), IsRequired = (true))] + public int NodeType + { + get; + set; + } + + /// + /// `Node`'s nodeName. + /// + [DataMember(Name = ("nodeName"), IsRequired = (true))] + public string NodeName + { + get; + set; + } + + /// + /// `Node`'s nodeValue. + /// + [DataMember(Name = ("nodeValue"), IsRequired = (true))] + public string NodeValue + { + get; + set; + } + + /// + /// Only set for textarea elements, contains the text value. + /// + [DataMember(Name = ("textValue"), IsRequired = (false))] + public string TextValue + { + get; + set; + } + + /// + /// Only set for input elements, contains the input's associated text value. + /// + [DataMember(Name = ("inputValue"), IsRequired = (false))] + public string InputValue + { + get; + set; + } + + /// + /// Only set for radio and checkbox input elements, indicates if the element has been checked + /// + [DataMember(Name = ("inputChecked"), IsRequired = (false))] + public bool? InputChecked + { + get; + set; + } + + /// + /// Only set for option elements, indicates if the element has been selected + /// + [DataMember(Name = ("optionSelected"), IsRequired = (false))] + public bool? OptionSelected + { + get; + set; + } + + /// + /// `Node`'s id, corresponds to DOM.Node.backendNodeId. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (true))] + public int BackendNodeId + { + get; + set; + } + + /// + /// The indexes of the node's child nodes in the `domNodes` array returned by `getSnapshot`, if + /// any. + /// + [DataMember(Name = ("childNodeIndexes"), IsRequired = (false))] + public int[] ChildNodeIndexes + { + get; + set; + } + + /// + /// Attributes of an `Element` node. + /// + [DataMember(Name = ("attributes"), IsRequired = (false))] + public System.Collections.Generic.IList Attributes + { + get; + set; + } + + /// + /// Indexes of pseudo elements associated with this node in the `domNodes` array returned by + /// `getSnapshot`, if any. + /// + [DataMember(Name = ("pseudoElementIndexes"), IsRequired = (false))] + public int[] PseudoElementIndexes + { + get; + set; + } + + /// + /// The index of the node's related layout tree node in the `layoutTreeNodes` array returned by + /// `getSnapshot`, if any. + /// + [DataMember(Name = ("layoutNodeIndex"), IsRequired = (false))] + public int? LayoutNodeIndex + { + get; + set; + } + + /// + /// Document URL that `Document` or `FrameOwner` node points to. + /// + [DataMember(Name = ("documentURL"), IsRequired = (false))] + public string DocumentURL + { + get; + set; + } + + /// + /// Base URL that `Document` or `FrameOwner` node uses for URL completion. + /// + [DataMember(Name = ("baseURL"), IsRequired = (false))] + public string BaseURL + { + get; + set; + } + + /// + /// Only set for documents, contains the document's content language. + /// + [DataMember(Name = ("contentLanguage"), IsRequired = (false))] + public string ContentLanguage + { + get; + set; + } + + /// + /// Only set for documents, contains the document's character set encoding. + /// + [DataMember(Name = ("documentEncoding"), IsRequired = (false))] + public string DocumentEncoding + { + get; + set; + } + + /// + /// `DocumentType` node's publicId. + /// + [DataMember(Name = ("publicId"), IsRequired = (false))] + public string PublicId + { + get; + set; + } + + /// + /// `DocumentType` node's systemId. + /// + [DataMember(Name = ("systemId"), IsRequired = (false))] + public string SystemId + { + get; + set; + } + + /// + /// Frame ID for frame owner elements and also for the document node. + /// + [DataMember(Name = ("frameId"), IsRequired = (false))] + public string FrameId + { + get; + set; + } + + /// + /// The index of a frame owner element's content document in the `domNodes` array returned by + /// `getSnapshot`, if any. + /// + [DataMember(Name = ("contentDocumentIndex"), IsRequired = (false))] + public int? ContentDocumentIndex + { + get; + set; + } + + /// + /// Type of a pseudo element node. + /// + public CefSharp.DevTools.DOM.PseudoType? PseudoType + { + get + { + return (CefSharp.DevTools.DOM.PseudoType? )(StringToEnum(typeof(CefSharp.DevTools.DOM.PseudoType? ), pseudoType)); + } + + set + { + this.pseudoType = (EnumToString(value)); + } + } + + /// + /// Type of a pseudo element node. + /// + [DataMember(Name = ("pseudoType"), IsRequired = (false))] + internal string pseudoType + { + get; + set; + } + + /// + /// Shadow root type. + /// + public CefSharp.DevTools.DOM.ShadowRootType? ShadowRootType + { + get + { + return (CefSharp.DevTools.DOM.ShadowRootType? )(StringToEnum(typeof(CefSharp.DevTools.DOM.ShadowRootType? ), shadowRootType)); + } + + set + { + this.shadowRootType = (EnumToString(value)); + } + } + + /// + /// Shadow root type. + /// + [DataMember(Name = ("shadowRootType"), IsRequired = (false))] + internal string shadowRootType + { + get; + set; + } + + /// + /// Whether this DOM node responds to mouse clicks. This includes nodes that have had click + /// event listeners attached via JavaScript as well as anchor tags that naturally navigate when + /// clicked. + /// + [DataMember(Name = ("isClickable"), IsRequired = (false))] + public bool? IsClickable + { + get; + set; + } + + /// + /// Details of the node's event listeners, if any. + /// + [DataMember(Name = ("eventListeners"), IsRequired = (false))] + public System.Collections.Generic.IList EventListeners + { + get; + set; + } + + /// + /// The selected url for nodes with a srcset attribute. + /// + [DataMember(Name = ("currentSourceURL"), IsRequired = (false))] + public string CurrentSourceURL + { + get; + set; + } + + /// + /// The url of the script (if any) that generates this node. + /// + [DataMember(Name = ("originURL"), IsRequired = (false))] + public string OriginURL + { + get; + set; + } + + /// + /// Scroll offsets, set when this node is a Document. + /// + [DataMember(Name = ("scrollOffsetX"), IsRequired = (false))] + public double? ScrollOffsetX + { + get; + set; + } + + /// + /// ScrollOffsetY + /// + [DataMember(Name = ("scrollOffsetY"), IsRequired = (false))] + public double? ScrollOffsetY + { + get; + set; + } + } + + /// + /// Details of post layout rendered text positions. The exact layout should not be regarded as + /// stable and may change between versions. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InlineTextBox : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The bounding box in document coordinates. Note that scroll offset of the document is ignored. + /// + [DataMember(Name = ("boundingBox"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect BoundingBox + { + get; + set; + } + + /// + /// The starting index in characters, for this post layout textbox substring. Characters that + /// would be represented as a surrogate pair in UTF-16 have length 2. + /// + [DataMember(Name = ("startCharacterIndex"), IsRequired = (true))] + public int StartCharacterIndex + { + get; + set; + } + + /// + /// The number of characters in this post layout textbox substring. Characters that would be + /// represented as a surrogate pair in UTF-16 have length 2. + /// + [DataMember(Name = ("numCharacters"), IsRequired = (true))] + public int NumCharacters + { + get; + set; + } + } + + /// + /// Details of an element in the DOM tree with a LayoutObject. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LayoutTreeNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The index of the related DOM node in the `domNodes` array returned by `getSnapshot`. + /// + [DataMember(Name = ("domNodeIndex"), IsRequired = (true))] + public int DomNodeIndex + { + get; + set; + } + + /// + /// The bounding box in document coordinates. Note that scroll offset of the document is ignored. + /// + [DataMember(Name = ("boundingBox"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect BoundingBox + { + get; + set; + } + + /// + /// Contents of the LayoutText, if any. + /// + [DataMember(Name = ("layoutText"), IsRequired = (false))] + public string LayoutText + { + get; + set; + } + + /// + /// The post-layout inline text nodes, if any. + /// + [DataMember(Name = ("inlineTextNodes"), IsRequired = (false))] + public System.Collections.Generic.IList InlineTextNodes + { + get; + set; + } + + /// + /// Index into the `computedStyles` array returned by `getSnapshot`. + /// + [DataMember(Name = ("styleIndex"), IsRequired = (false))] + public int? StyleIndex + { + get; + set; + } + + /// + /// Global paint order index, which is determined by the stacking order of the nodes. Nodes + /// that are painted together will have the same index. Only provided if includePaintOrder in + /// getSnapshot was true. + /// + [DataMember(Name = ("paintOrder"), IsRequired = (false))] + public int? PaintOrder + { + get; + set; + } + + /// + /// Set to true to indicate the element begins a new stacking context. + /// + [DataMember(Name = ("isStackingContext"), IsRequired = (false))] + public bool? IsStackingContext + { + get; + set; + } + } + + /// + /// A subset of the full ComputedStyle as defined by the request whitelist. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ComputedStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name/value pairs of computed style properties. + /// + [DataMember(Name = ("properties"), IsRequired = (true))] + public System.Collections.Generic.IList Properties + { + get; + set; + } + } + + /// + /// A name/value pair. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class NameValue : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Attribute/property name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Attribute/property value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// Data that is only present on rare nodes. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RareStringData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index + /// + [DataMember(Name = ("index"), IsRequired = (true))] + public int[] Index + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public int[] Value + { + get; + set; + } + } + + /// + /// RareBooleanData + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RareBooleanData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index + /// + [DataMember(Name = ("index"), IsRequired = (true))] + public int[] Index + { + get; + set; + } + } + + /// + /// RareIntegerData + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RareIntegerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index + /// + [DataMember(Name = ("index"), IsRequired = (true))] + public int[] Index + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public int[] Value + { + get; + set; + } + } + + /// + /// Document snapshot. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DocumentSnapshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Document URL that `Document` or `FrameOwner` node points to. + /// + [DataMember(Name = ("documentURL"), IsRequired = (true))] + public int DocumentURL + { + get; + set; + } + + /// + /// Document title. + /// + [DataMember(Name = ("title"), IsRequired = (true))] + public int Title + { + get; + set; + } + + /// + /// Base URL that `Document` or `FrameOwner` node uses for URL completion. + /// + [DataMember(Name = ("baseURL"), IsRequired = (true))] + public int BaseURL + { + get; + set; + } + + /// + /// Contains the document's content language. + /// + [DataMember(Name = ("contentLanguage"), IsRequired = (true))] + public int ContentLanguage + { + get; + set; + } + + /// + /// Contains the document's character set encoding. + /// + [DataMember(Name = ("encodingName"), IsRequired = (true))] + public int EncodingName + { + get; + set; + } + + /// + /// `DocumentType` node's publicId. + /// + [DataMember(Name = ("publicId"), IsRequired = (true))] + public int PublicId + { + get; + set; + } + + /// + /// `DocumentType` node's systemId. + /// + [DataMember(Name = ("systemId"), IsRequired = (true))] + public int SystemId + { + get; + set; + } + + /// + /// Frame ID for frame owner elements and also for the document node. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public int FrameId + { + get; + set; + } + + /// + /// A table with dom nodes. + /// + [DataMember(Name = ("nodes"), IsRequired = (true))] + public CefSharp.DevTools.DOMSnapshot.NodeTreeSnapshot Nodes + { + get; + set; + } + + /// + /// The nodes in the layout tree. + /// + [DataMember(Name = ("layout"), IsRequired = (true))] + public CefSharp.DevTools.DOMSnapshot.LayoutTreeSnapshot Layout + { + get; + set; + } + + /// + /// The post-layout inline text nodes. + /// + [DataMember(Name = ("textBoxes"), IsRequired = (true))] + public CefSharp.DevTools.DOMSnapshot.TextBoxSnapshot TextBoxes + { + get; + set; + } + + /// + /// Horizontal scroll offset. + /// + [DataMember(Name = ("scrollOffsetX"), IsRequired = (false))] + public double? ScrollOffsetX + { + get; + set; + } + + /// + /// Vertical scroll offset. + /// + [DataMember(Name = ("scrollOffsetY"), IsRequired = (false))] + public double? ScrollOffsetY + { + get; + set; + } + + /// + /// Document content width. + /// + [DataMember(Name = ("contentWidth"), IsRequired = (false))] + public double? ContentWidth + { + get; + set; + } + + /// + /// Document content height. + /// + [DataMember(Name = ("contentHeight"), IsRequired = (false))] + public double? ContentHeight + { + get; + set; + } + } + + /// + /// Table containing nodes. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class NodeTreeSnapshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Parent node index. + /// + [DataMember(Name = ("parentIndex"), IsRequired = (false))] + public int[] ParentIndex + { + get; + set; + } + + /// + /// `Node`'s nodeType. + /// + [DataMember(Name = ("nodeType"), IsRequired = (false))] + public int[] NodeType + { + get; + set; + } + + /// + /// Type of the shadow root the `Node` is in. String values are equal to the `ShadowRootType` enum. + /// + [DataMember(Name = ("shadowRootType"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareStringData ShadowRootType + { + get; + set; + } + + /// + /// `Node`'s nodeName. + /// + [DataMember(Name = ("nodeName"), IsRequired = (false))] + public int[] NodeName + { + get; + set; + } + + /// + /// `Node`'s nodeValue. + /// + [DataMember(Name = ("nodeValue"), IsRequired = (false))] + public int[] NodeValue + { + get; + set; + } + + /// + /// `Node`'s id, corresponds to DOM.Node.backendNodeId. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (false))] + public int[] BackendNodeId + { + get; + set; + } + + /// + /// Attributes of an `Element` node. Flatten name, value pairs. + /// + [DataMember(Name = ("attributes"), IsRequired = (false))] + public int[] Attributes + { + get; + set; + } + + /// + /// Only set for textarea elements, contains the text value. + /// + [DataMember(Name = ("textValue"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareStringData TextValue + { + get; + set; + } + + /// + /// Only set for input elements, contains the input's associated text value. + /// + [DataMember(Name = ("inputValue"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareStringData InputValue + { + get; + set; + } + + /// + /// Only set for radio and checkbox input elements, indicates if the element has been checked + /// + [DataMember(Name = ("inputChecked"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareBooleanData InputChecked + { + get; + set; + } + + /// + /// Only set for option elements, indicates if the element has been selected + /// + [DataMember(Name = ("optionSelected"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareBooleanData OptionSelected + { + get; + set; + } + + /// + /// The index of the document in the list of the snapshot documents. + /// + [DataMember(Name = ("contentDocumentIndex"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareIntegerData ContentDocumentIndex + { + get; + set; + } + + /// + /// Type of a pseudo element node. + /// + [DataMember(Name = ("pseudoType"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareStringData PseudoType + { + get; + set; + } + + /// + /// Pseudo element identifier for this node. Only present if there is a + /// valid pseudoType. + /// + [DataMember(Name = ("pseudoIdentifier"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareStringData PseudoIdentifier + { + get; + set; + } + + /// + /// Whether this DOM node responds to mouse clicks. This includes nodes that have had click + /// event listeners attached via JavaScript as well as anchor tags that naturally navigate when + /// clicked. + /// + [DataMember(Name = ("isClickable"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareBooleanData IsClickable + { + get; + set; + } + + /// + /// The selected url for nodes with a srcset attribute. + /// + [DataMember(Name = ("currentSourceURL"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareStringData CurrentSourceURL + { + get; + set; + } + + /// + /// The url of the script (if any) that generates this node. + /// + [DataMember(Name = ("originURL"), IsRequired = (false))] + public CefSharp.DevTools.DOMSnapshot.RareStringData OriginURL + { + get; + set; + } + } + + /// + /// Table of details of an element in the DOM tree with a LayoutObject. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LayoutTreeSnapshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index of the corresponding node in the `NodeTreeSnapshot` array returned by `captureSnapshot`. + /// + [DataMember(Name = ("nodeIndex"), IsRequired = (true))] + public int[] NodeIndex + { + get; + set; + } + + /// + /// Array of indexes specifying computed style strings, filtered according to the `computedStyles` parameter passed to `captureSnapshot`. + /// + [DataMember(Name = ("styles"), IsRequired = (true))] + public int[] Styles + { + get; + set; + } + + /// + /// The absolute position bounding box. + /// + [DataMember(Name = ("bounds"), IsRequired = (true))] + public double[] Bounds + { + get; + set; + } + + /// + /// Contents of the LayoutText, if any. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public int[] Text + { + get; + set; + } + + /// + /// Stacking context information. + /// + [DataMember(Name = ("stackingContexts"), IsRequired = (true))] + public CefSharp.DevTools.DOMSnapshot.RareBooleanData StackingContexts + { + get; + set; + } + + /// + /// Global paint order index, which is determined by the stacking order of the nodes. Nodes + /// that are painted together will have the same index. Only provided if includePaintOrder in + /// captureSnapshot was true. + /// + [DataMember(Name = ("paintOrders"), IsRequired = (false))] + public int[] PaintOrders + { + get; + set; + } + + /// + /// The offset rect of nodes. Only available when includeDOMRects is set to true + /// + [DataMember(Name = ("offsetRects"), IsRequired = (false))] + public double[] OffsetRects + { + get; + set; + } + + /// + /// The scroll rect of nodes. Only available when includeDOMRects is set to true + /// + [DataMember(Name = ("scrollRects"), IsRequired = (false))] + public double[] ScrollRects + { + get; + set; + } + + /// + /// The client rect of nodes. Only available when includeDOMRects is set to true + /// + [DataMember(Name = ("clientRects"), IsRequired = (false))] + public double[] ClientRects + { + get; + set; + } + + /// + /// The list of background colors that are blended with colors of overlapping elements. + /// + [DataMember(Name = ("blendedBackgroundColors"), IsRequired = (false))] + public int[] BlendedBackgroundColors + { + get; + set; + } + + /// + /// The list of computed text opacities. + /// + [DataMember(Name = ("textColorOpacities"), IsRequired = (false))] + public double[] TextColorOpacities + { + get; + set; + } + } + + /// + /// Table of details of the post layout rendered text positions. The exact layout should not be regarded as + /// stable and may change between versions. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class TextBoxSnapshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index of the layout tree node that owns this box collection. + /// + [DataMember(Name = ("layoutIndex"), IsRequired = (true))] + public int[] LayoutIndex + { + get; + set; + } + + /// + /// The absolute position bounding box. + /// + [DataMember(Name = ("bounds"), IsRequired = (true))] + public double[] Bounds + { + get; + set; + } + + /// + /// The starting index in characters, for this post layout textbox substring. Characters that + /// would be represented as a surrogate pair in UTF-16 have length 2. + /// + [DataMember(Name = ("start"), IsRequired = (true))] + public int[] Start + { + get; + set; + } + + /// + /// The number of characters in this post layout textbox substring. Characters that would be + /// represented as a surrogate pair in UTF-16 have length 2. + /// + [DataMember(Name = ("length"), IsRequired = (true))] + public int[] Length + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.DOMStorage +{ + /// + /// DOM Storage identifier. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class StorageId : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Security origin for the storage. + /// + [DataMember(Name = ("securityOrigin"), IsRequired = (false))] + public string SecurityOrigin + { + get; + set; + } + + /// + /// Represents a key by which DOM Storage keys its CachedStorageAreas + /// + [DataMember(Name = ("storageKey"), IsRequired = (false))] + public string StorageKey + { + get; + set; + } + + /// + /// Whether the storage is local storage (not session storage). + /// + [DataMember(Name = ("isLocalStorage"), IsRequired = (true))] + public bool IsLocalStorage + { + get; + set; + } + } + + /// + /// domStorageItemAdded + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DomStorageItemAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StorageId + /// + [DataMember(Name = ("storageId"), IsRequired = (true))] + public CefSharp.DevTools.DOMStorage.StorageId StorageId + { + get; + private set; + } + + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public string Key + { + get; + private set; + } + + /// + /// NewValue + /// + [DataMember(Name = ("newValue"), IsRequired = (true))] + public string NewValue + { + get; + private set; + } + } + + /// + /// domStorageItemRemoved + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DomStorageItemRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StorageId + /// + [DataMember(Name = ("storageId"), IsRequired = (true))] + public CefSharp.DevTools.DOMStorage.StorageId StorageId + { + get; + private set; + } + + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public string Key + { + get; + private set; + } + } + + /// + /// domStorageItemUpdated + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DomStorageItemUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StorageId + /// + [DataMember(Name = ("storageId"), IsRequired = (true))] + public CefSharp.DevTools.DOMStorage.StorageId StorageId + { + get; + private set; + } + + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public string Key + { + get; + private set; + } + + /// + /// OldValue + /// + [DataMember(Name = ("oldValue"), IsRequired = (true))] + public string OldValue + { + get; + private set; + } + + /// + /// NewValue + /// + [DataMember(Name = ("newValue"), IsRequired = (true))] + public string NewValue + { + get; + private set; + } + } + + /// + /// domStorageItemsCleared + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DomStorageItemsClearedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StorageId + /// + [DataMember(Name = ("storageId"), IsRequired = (true))] + public CefSharp.DevTools.DOMStorage.StorageId StorageId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DeviceAccess +{ + /// + /// Device information displayed in a user prompt to select a device. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PromptDevice : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// Display name as it appears in a device request user prompt. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + } + + /// + /// A device request opened a user prompt to select a device. Respond with the + /// selectPrompt or cancelPrompt command. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DeviceRequestPromptedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + private set; + } + + /// + /// Devices + /// + [DataMember(Name = ("devices"), IsRequired = (true))] + public System.Collections.Generic.IList Devices + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// SafeAreaInsets + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SafeAreaInsets : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Overrides safe-area-inset-top. + /// + [DataMember(Name = ("top"), IsRequired = (false))] + public int? Top + { + get; + set; + } + + /// + /// Overrides safe-area-max-inset-top. + /// + [DataMember(Name = ("topMax"), IsRequired = (false))] + public int? TopMax + { + get; + set; + } + + /// + /// Overrides safe-area-inset-left. + /// + [DataMember(Name = ("left"), IsRequired = (false))] + public int? Left + { + get; + set; + } + + /// + /// Overrides safe-area-max-inset-left. + /// + [DataMember(Name = ("leftMax"), IsRequired = (false))] + public int? LeftMax + { + get; + set; + } + + /// + /// Overrides safe-area-inset-bottom. + /// + [DataMember(Name = ("bottom"), IsRequired = (false))] + public int? Bottom + { + get; + set; + } + + /// + /// Overrides safe-area-max-inset-bottom. + /// + [DataMember(Name = ("bottomMax"), IsRequired = (false))] + public int? BottomMax + { + get; + set; + } + + /// + /// Overrides safe-area-inset-right. + /// + [DataMember(Name = ("right"), IsRequired = (false))] + public int? Right + { + get; + set; + } + + /// + /// Overrides safe-area-max-inset-right. + /// + [DataMember(Name = ("rightMax"), IsRequired = (false))] + public int? RightMax + { + get; + set; + } + } + + /// + /// Orientation type. + /// + public enum ScreenOrientationType + { + /// + /// portraitPrimary + /// + [EnumMember(Value = ("portraitPrimary"))] + PortraitPrimary, + /// + /// portraitSecondary + /// + [EnumMember(Value = ("portraitSecondary"))] + PortraitSecondary, + /// + /// landscapePrimary + /// + [EnumMember(Value = ("landscapePrimary"))] + LandscapePrimary, + /// + /// landscapeSecondary + /// + [EnumMember(Value = ("landscapeSecondary"))] + LandscapeSecondary + } + + /// + /// Screen orientation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScreenOrientation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Orientation type. + /// + public CefSharp.DevTools.Emulation.ScreenOrientationType Type + { + get + { + return (CefSharp.DevTools.Emulation.ScreenOrientationType)(StringToEnum(typeof(CefSharp.DevTools.Emulation.ScreenOrientationType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Orientation type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Orientation angle. + /// + [DataMember(Name = ("angle"), IsRequired = (true))] + public int Angle + { + get; + set; + } + } + + /// + /// Orientation of a display feature in relation to screen + /// + public enum DisplayFeatureOrientation + { + /// + /// vertical + /// + [EnumMember(Value = ("vertical"))] + Vertical, + /// + /// horizontal + /// + [EnumMember(Value = ("horizontal"))] + Horizontal + } + + /// + /// DisplayFeature + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DisplayFeature : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Orientation of a display feature in relation to screen + /// + public CefSharp.DevTools.Emulation.DisplayFeatureOrientation Orientation + { + get + { + return (CefSharp.DevTools.Emulation.DisplayFeatureOrientation)(StringToEnum(typeof(CefSharp.DevTools.Emulation.DisplayFeatureOrientation), orientation)); + } + + set + { + this.orientation = (EnumToString(value)); + } + } + + /// + /// Orientation of a display feature in relation to screen + /// + [DataMember(Name = ("orientation"), IsRequired = (true))] + internal string orientation + { + get; + set; + } + + /// + /// The offset from the screen origin in either the x (for vertical + /// orientation) or y (for horizontal orientation) direction. + /// + [DataMember(Name = ("offset"), IsRequired = (true))] + public int Offset + { + get; + set; + } + + /// + /// A display feature may mask content such that it is not physically + /// displayed - this length along with the offset describes this area. + /// A display feature that only splits content will have a 0 mask_length. + /// + [DataMember(Name = ("maskLength"), IsRequired = (true))] + public int MaskLength + { + get; + set; + } + } + + /// + /// Current posture of the device + /// + public enum DevicePostureType + { + /// + /// continuous + /// + [EnumMember(Value = ("continuous"))] + Continuous, + /// + /// folded + /// + [EnumMember(Value = ("folded"))] + Folded + } + + /// + /// DevicePosture + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DevicePosture : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Current posture of the device + /// + public CefSharp.DevTools.Emulation.DevicePostureType Type + { + get + { + return (CefSharp.DevTools.Emulation.DevicePostureType)(StringToEnum(typeof(CefSharp.DevTools.Emulation.DevicePostureType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Current posture of the device + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + } + + /// + /// MediaFeature + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class MediaFeature : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to + /// allow the next delayed task (if any) to run; pause: The virtual time base may not advance; + /// pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending + /// resource fetches. + /// + public enum VirtualTimePolicy + { + /// + /// advance + /// + [EnumMember(Value = ("advance"))] + Advance, + /// + /// pause + /// + [EnumMember(Value = ("pause"))] + Pause, + /// + /// pauseIfNetworkFetchesPending + /// + [EnumMember(Value = ("pauseIfNetworkFetchesPending"))] + PauseIfNetworkFetchesPending + } + + /// + /// Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class UserAgentBrandVersion : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Brand + /// + [DataMember(Name = ("brand"), IsRequired = (true))] + public string Brand + { + get; + set; + } + + /// + /// Version + /// + [DataMember(Name = ("version"), IsRequired = (true))] + public string Version + { + get; + set; + } + } + + /// + /// Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints + /// Missing optional values will be filled in by the target with what it would normally use. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class UserAgentMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Brands appearing in Sec-CH-UA. + /// + [DataMember(Name = ("brands"), IsRequired = (false))] + public System.Collections.Generic.IList Brands + { + get; + set; + } + + /// + /// Brands appearing in Sec-CH-UA-Full-Version-List. + /// + [DataMember(Name = ("fullVersionList"), IsRequired = (false))] + public System.Collections.Generic.IList FullVersionList + { + get; + set; + } + + /// + /// FullVersion + /// + [DataMember(Name = ("fullVersion"), IsRequired = (false))] + public string FullVersion + { + get; + set; + } + + /// + /// Platform + /// + [DataMember(Name = ("platform"), IsRequired = (true))] + public string Platform + { + get; + set; + } + + /// + /// PlatformVersion + /// + [DataMember(Name = ("platformVersion"), IsRequired = (true))] + public string PlatformVersion + { + get; + set; + } + + /// + /// Architecture + /// + [DataMember(Name = ("architecture"), IsRequired = (true))] + public string Architecture + { + get; + set; + } + + /// + /// Model + /// + [DataMember(Name = ("model"), IsRequired = (true))] + public string Model + { + get; + set; + } + + /// + /// Mobile + /// + [DataMember(Name = ("mobile"), IsRequired = (true))] + public bool Mobile + { + get; + set; + } + + /// + /// Bitness + /// + [DataMember(Name = ("bitness"), IsRequired = (false))] + public string Bitness + { + get; + set; + } + + /// + /// Wow64 + /// + [DataMember(Name = ("wow64"), IsRequired = (false))] + public bool? Wow64 + { + get; + set; + } + + /// + /// Used to specify User Agent form-factor values. + /// See https://wicg.github.io/ua-client-hints/#sec-ch-ua-form-factors + /// + [DataMember(Name = ("formFactors"), IsRequired = (false))] + public string[] FormFactors + { + get; + set; + } + } + + /// + /// Used to specify sensor types to emulate. + /// See https://w3c.github.io/sensors/#automation for more information. + /// + public enum SensorType + { + /// + /// absolute-orientation + /// + [EnumMember(Value = ("absolute-orientation"))] + AbsoluteOrientation, + /// + /// accelerometer + /// + [EnumMember(Value = ("accelerometer"))] + Accelerometer, + /// + /// ambient-light + /// + [EnumMember(Value = ("ambient-light"))] + AmbientLight, + /// + /// gravity + /// + [EnumMember(Value = ("gravity"))] + Gravity, + /// + /// gyroscope + /// + [EnumMember(Value = ("gyroscope"))] + Gyroscope, + /// + /// linear-acceleration + /// + [EnumMember(Value = ("linear-acceleration"))] + LinearAcceleration, + /// + /// magnetometer + /// + [EnumMember(Value = ("magnetometer"))] + Magnetometer, + /// + /// relative-orientation + /// + [EnumMember(Value = ("relative-orientation"))] + RelativeOrientation + } + + /// + /// SensorMetadata + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SensorMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Available + /// + [DataMember(Name = ("available"), IsRequired = (false))] + public bool? Available + { + get; + set; + } + + /// + /// MinimumFrequency + /// + [DataMember(Name = ("minimumFrequency"), IsRequired = (false))] + public double? MinimumFrequency + { + get; + set; + } + + /// + /// MaximumFrequency + /// + [DataMember(Name = ("maximumFrequency"), IsRequired = (false))] + public double? MaximumFrequency + { + get; + set; + } + } + + /// + /// SensorReadingSingle + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SensorReadingSingle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public double Value + { + get; + set; + } + } + + /// + /// SensorReadingXYZ + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SensorReadingXYZ : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X + /// + [DataMember(Name = ("x"), IsRequired = (true))] + public double X + { + get; + set; + } + + /// + /// Y + /// + [DataMember(Name = ("y"), IsRequired = (true))] + public double Y + { + get; + set; + } + + /// + /// Z + /// + [DataMember(Name = ("z"), IsRequired = (true))] + public double Z + { + get; + set; + } + } + + /// + /// SensorReadingQuaternion + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SensorReadingQuaternion : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X + /// + [DataMember(Name = ("x"), IsRequired = (true))] + public double X + { + get; + set; + } + + /// + /// Y + /// + [DataMember(Name = ("y"), IsRequired = (true))] + public double Y + { + get; + set; + } + + /// + /// Z + /// + [DataMember(Name = ("z"), IsRequired = (true))] + public double Z + { + get; + set; + } + + /// + /// W + /// + [DataMember(Name = ("w"), IsRequired = (true))] + public double W + { + get; + set; + } + } + + /// + /// SensorReading + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SensorReading : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Single + /// + [DataMember(Name = ("single"), IsRequired = (false))] + public CefSharp.DevTools.Emulation.SensorReadingSingle Single + { + get; + set; + } + + /// + /// Xyz + /// + [DataMember(Name = ("xyz"), IsRequired = (false))] + public CefSharp.DevTools.Emulation.SensorReadingXYZ Xyz + { + get; + set; + } + + /// + /// Quaternion + /// + [DataMember(Name = ("quaternion"), IsRequired = (false))] + public CefSharp.DevTools.Emulation.SensorReadingQuaternion Quaternion + { + get; + set; + } + } + + /// + /// PressureSource + /// + public enum PressureSource + { + /// + /// cpu + /// + [EnumMember(Value = ("cpu"))] + Cpu + } + + /// + /// PressureState + /// + public enum PressureState + { + /// + /// nominal + /// + [EnumMember(Value = ("nominal"))] + Nominal, + /// + /// fair + /// + [EnumMember(Value = ("fair"))] + Fair, + /// + /// serious + /// + [EnumMember(Value = ("serious"))] + Serious, + /// + /// critical + /// + [EnumMember(Value = ("critical"))] + Critical + } + + /// + /// PressureMetadata + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PressureMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Available + /// + [DataMember(Name = ("available"), IsRequired = (false))] + public bool? Available + { + get; + set; + } + } + + /// + /// WorkAreaInsets + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class WorkAreaInsets : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Work area top inset in pixels. Default is 0; + /// + [DataMember(Name = ("top"), IsRequired = (false))] + public int? Top + { + get; + set; + } + + /// + /// Work area left inset in pixels. Default is 0; + /// + [DataMember(Name = ("left"), IsRequired = (false))] + public int? Left + { + get; + set; + } + + /// + /// Work area bottom inset in pixels. Default is 0; + /// + [DataMember(Name = ("bottom"), IsRequired = (false))] + public int? Bottom + { + get; + set; + } + + /// + /// Work area right inset in pixels. Default is 0; + /// + [DataMember(Name = ("right"), IsRequired = (false))] + public int? Right + { + get; + set; + } + } + + /// + /// Screen information similar to the one returned by window.getScreenDetails() method, + /// see https://w3c.github.io/window-management/#screendetailed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScreenInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Offset of the left edge of the screen. + /// + [DataMember(Name = ("left"), IsRequired = (true))] + public int Left + { + get; + set; + } + + /// + /// Offset of the top edge of the screen. + /// + [DataMember(Name = ("top"), IsRequired = (true))] + public int Top + { + get; + set; + } + + /// + /// Width of the screen. + /// + [DataMember(Name = ("width"), IsRequired = (true))] + public int Width + { + get; + set; + } + + /// + /// Height of the screen. + /// + [DataMember(Name = ("height"), IsRequired = (true))] + public int Height + { + get; + set; + } + + /// + /// Offset of the left edge of the available screen area. + /// + [DataMember(Name = ("availLeft"), IsRequired = (true))] + public int AvailLeft + { + get; + set; + } + + /// + /// Offset of the top edge of the available screen area. + /// + [DataMember(Name = ("availTop"), IsRequired = (true))] + public int AvailTop + { + get; + set; + } + + /// + /// Width of the available screen area. + /// + [DataMember(Name = ("availWidth"), IsRequired = (true))] + public int AvailWidth + { + get; + set; + } + + /// + /// Height of the available screen area. + /// + [DataMember(Name = ("availHeight"), IsRequired = (true))] + public int AvailHeight + { + get; + set; + } + + /// + /// Specifies the screen's device pixel ratio. + /// + [DataMember(Name = ("devicePixelRatio"), IsRequired = (true))] + public double DevicePixelRatio + { + get; + set; + } + + /// + /// Specifies the screen's orientation. + /// + [DataMember(Name = ("orientation"), IsRequired = (true))] + public CefSharp.DevTools.Emulation.ScreenOrientation Orientation + { + get; + set; + } + + /// + /// Specifies the screen's color depth in bits. + /// + [DataMember(Name = ("colorDepth"), IsRequired = (true))] + public int ColorDepth + { + get; + set; + } + + /// + /// Indicates whether the device has multiple screens. + /// + [DataMember(Name = ("isExtended"), IsRequired = (true))] + public bool IsExtended + { + get; + set; + } + + /// + /// Indicates whether the screen is internal to the device or external, attached to the device. + /// + [DataMember(Name = ("isInternal"), IsRequired = (true))] + public bool IsInternal + { + get; + set; + } + + /// + /// Indicates whether the screen is set as the the operating system primary screen. + /// + [DataMember(Name = ("isPrimary"), IsRequired = (true))] + public bool IsPrimary + { + get; + set; + } + + /// + /// Specifies the descriptive label for the screen. + /// + [DataMember(Name = ("label"), IsRequired = (true))] + public string Label + { + get; + set; + } + + /// + /// Specifies the unique identifier of the screen. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + } + + /// + /// Enum of image types that can be disabled. + /// + public enum DisabledImageType + { + /// + /// avif + /// + [EnumMember(Value = ("avif"))] + Avif, + /// + /// webp + /// + [EnumMember(Value = ("webp"))] + Webp + } +} + +namespace CefSharp.DevTools.Extensions +{ + /// + /// Storage areas. + /// + public enum StorageArea + { + /// + /// session + /// + [EnumMember(Value = ("session"))] + Session, + /// + /// local + /// + [EnumMember(Value = ("local"))] + Local, + /// + /// sync + /// + [EnumMember(Value = ("sync"))] + Sync, + /// + /// managed + /// + [EnumMember(Value = ("managed"))] + Managed + } +} + +namespace CefSharp.DevTools.FedCm +{ + /// + /// Whether this is a sign-up or sign-in action for this account, i.e. + /// whether this account has ever been used to sign in to this RP before. + /// + public enum LoginState + { + /// + /// SignIn + /// + [EnumMember(Value = ("SignIn"))] + SignIn, + /// + /// SignUp + /// + [EnumMember(Value = ("SignUp"))] + SignUp + } + + /// + /// The types of FedCM dialogs. + /// + public enum DialogType + { + /// + /// AccountChooser + /// + [EnumMember(Value = ("AccountChooser"))] + AccountChooser, + /// + /// AutoReauthn + /// + [EnumMember(Value = ("AutoReauthn"))] + AutoReauthn, + /// + /// ConfirmIdpLogin + /// + [EnumMember(Value = ("ConfirmIdpLogin"))] + ConfirmIdpLogin, + /// + /// Error + /// + [EnumMember(Value = ("Error"))] + Error + } + + /// + /// The buttons on the FedCM dialog. + /// + public enum DialogButton + { + /// + /// ConfirmIdpLoginContinue + /// + [EnumMember(Value = ("ConfirmIdpLoginContinue"))] + ConfirmIdpLoginContinue, + /// + /// ErrorGotIt + /// + [EnumMember(Value = ("ErrorGotIt"))] + ErrorGotIt, + /// + /// ErrorMoreDetails + /// + [EnumMember(Value = ("ErrorMoreDetails"))] + ErrorMoreDetails + } + + /// + /// The URLs that each account has + /// + public enum AccountUrlType + { + /// + /// TermsOfService + /// + [EnumMember(Value = ("TermsOfService"))] + TermsOfService, + /// + /// PrivacyPolicy + /// + [EnumMember(Value = ("PrivacyPolicy"))] + PrivacyPolicy + } + + /// + /// Corresponds to IdentityRequestAccount + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Account : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// AccountId + /// + [DataMember(Name = ("accountId"), IsRequired = (true))] + public string AccountId + { + get; + set; + } + + /// + /// Email + /// + [DataMember(Name = ("email"), IsRequired = (true))] + public string Email + { + get; + set; + } + + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// GivenName + /// + [DataMember(Name = ("givenName"), IsRequired = (true))] + public string GivenName + { + get; + set; + } + + /// + /// PictureUrl + /// + [DataMember(Name = ("pictureUrl"), IsRequired = (true))] + public string PictureUrl + { + get; + set; + } + + /// + /// IdpConfigUrl + /// + [DataMember(Name = ("idpConfigUrl"), IsRequired = (true))] + public string IdpConfigUrl + { + get; + set; + } + + /// + /// IdpLoginUrl + /// + [DataMember(Name = ("idpLoginUrl"), IsRequired = (true))] + public string IdpLoginUrl + { + get; + set; + } + + /// + /// LoginState + /// + public CefSharp.DevTools.FedCm.LoginState LoginState + { + get + { + return (CefSharp.DevTools.FedCm.LoginState)(StringToEnum(typeof(CefSharp.DevTools.FedCm.LoginState), loginState)); + } + + set + { + this.loginState = (EnumToString(value)); + } + } + + /// + /// LoginState + /// + [DataMember(Name = ("loginState"), IsRequired = (true))] + internal string loginState + { + get; + set; + } + + /// + /// These two are only set if the loginState is signUp + /// + [DataMember(Name = ("termsOfServiceUrl"), IsRequired = (false))] + public string TermsOfServiceUrl + { + get; + set; + } + + /// + /// PrivacyPolicyUrl + /// + [DataMember(Name = ("privacyPolicyUrl"), IsRequired = (false))] + public string PrivacyPolicyUrl + { + get; + set; + } + } + + /// + /// dialogShown + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DialogShownEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// DialogId + /// + [DataMember(Name = ("dialogId"), IsRequired = (true))] + public string DialogId + { + get; + private set; + } + + /// + /// DialogType + /// + public CefSharp.DevTools.FedCm.DialogType DialogType + { + get + { + return (CefSharp.DevTools.FedCm.DialogType)(StringToEnum(typeof(CefSharp.DevTools.FedCm.DialogType), dialogType)); + } + + set + { + this.dialogType = (EnumToString(value)); + } + } + + /// + /// DialogType + /// + [DataMember(Name = ("dialogType"), IsRequired = (true))] + internal string dialogType + { + get; + private set; + } + + /// + /// Accounts + /// + [DataMember(Name = ("accounts"), IsRequired = (true))] + public System.Collections.Generic.IList Accounts + { + get; + private set; + } + + /// + /// These exist primarily so that the caller can verify the + /// RP context was used appropriately. + /// + [DataMember(Name = ("title"), IsRequired = (true))] + public string Title + { + get; + private set; + } + + /// + /// Subtitle + /// + [DataMember(Name = ("subtitle"), IsRequired = (false))] + public string Subtitle + { + get; + private set; + } + } + + /// + /// Triggered when a dialog is closed, either by user action, JS abort, + /// or a command below. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DialogClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// DialogId + /// + [DataMember(Name = ("dialogId"), IsRequired = (true))] + public string DialogId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Fetch +{ + /// + /// Stages of the request to handle. Request will intercept before the request is + /// sent. Response will intercept after the response is received (but before response + /// body is received). + /// + public enum RequestStage + { + /// + /// Request + /// + [EnumMember(Value = ("Request"))] + Request, + /// + /// Response + /// + [EnumMember(Value = ("Response"))] + Response + } + + /// + /// RequestPattern + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RequestPattern : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is + /// backslash. Omitting is equivalent to `"*"`. + /// + [DataMember(Name = ("urlPattern"), IsRequired = (false))] + public string UrlPattern + { + get; + set; + } + + /// + /// If set, only requests for matching resource types will be intercepted. + /// + public CefSharp.DevTools.Network.ResourceType? ResourceType + { + get + { + return (CefSharp.DevTools.Network.ResourceType? )(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType? ), resourceType)); + } + + set + { + this.resourceType = (EnumToString(value)); + } + } + + /// + /// If set, only requests for matching resource types will be intercepted. + /// + [DataMember(Name = ("resourceType"), IsRequired = (false))] + internal string resourceType + { + get; + set; + } + + /// + /// Stage at which to begin intercepting requests. Default is Request. + /// + public CefSharp.DevTools.Fetch.RequestStage? RequestStage + { + get + { + return (CefSharp.DevTools.Fetch.RequestStage? )(StringToEnum(typeof(CefSharp.DevTools.Fetch.RequestStage? ), requestStage)); + } + + set + { + this.requestStage = (EnumToString(value)); + } + } + + /// + /// Stage at which to begin intercepting requests. Default is Request. + /// + [DataMember(Name = ("requestStage"), IsRequired = (false))] + internal string requestStage + { + get; + set; + } + } + + /// + /// Response HTTP header entry + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class HeaderEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// Source of the authentication challenge. + /// + public enum AuthChallengeSource + { + /// + /// Server + /// + [EnumMember(Value = ("Server"))] + Server, + /// + /// Proxy + /// + [EnumMember(Value = ("Proxy"))] + Proxy + } + + /// + /// Authorization challenge for HTTP status code 401 or 407. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AuthChallenge : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source of the authentication challenge. + /// + public CefSharp.DevTools.Fetch.AuthChallengeSource? Source + { + get + { + return (CefSharp.DevTools.Fetch.AuthChallengeSource? )(StringToEnum(typeof(CefSharp.DevTools.Fetch.AuthChallengeSource? ), source)); + } + + set + { + this.source = (EnumToString(value)); + } + } + + /// + /// Source of the authentication challenge. + /// + [DataMember(Name = ("source"), IsRequired = (false))] + internal string source + { + get; + set; + } + + /// + /// Origin of the challenger. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + set; + } + + /// + /// The authentication scheme used, such as basic or digest + /// + [DataMember(Name = ("scheme"), IsRequired = (true))] + public string Scheme + { + get; + set; + } + + /// + /// The realm of the challenge. May be empty. + /// + [DataMember(Name = ("realm"), IsRequired = (true))] + public string Realm + { + get; + set; + } + } + + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + public enum AuthChallengeResponseResponse + { + /// + /// Default + /// + [EnumMember(Value = ("Default"))] + Default, + /// + /// CancelAuth + /// + [EnumMember(Value = ("CancelAuth"))] + CancelAuth, + /// + /// ProvideCredentials + /// + [EnumMember(Value = ("ProvideCredentials"))] + ProvideCredentials + } + + /// + /// Response to an AuthChallenge. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AuthChallengeResponse : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + public CefSharp.DevTools.Fetch.AuthChallengeResponseResponse Response + { + get + { + return (CefSharp.DevTools.Fetch.AuthChallengeResponseResponse)(StringToEnum(typeof(CefSharp.DevTools.Fetch.AuthChallengeResponseResponse), response)); + } + + set + { + this.response = (EnumToString(value)); + } + } + + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + [DataMember(Name = ("response"), IsRequired = (true))] + internal string response + { + get; + set; + } + + /// + /// The username to provide, possibly empty. Should only be set if response is + /// ProvideCredentials. + /// + [DataMember(Name = ("username"), IsRequired = (false))] + public string Username + { + get; + set; + } + + /// + /// The password to provide, possibly empty. Should only be set if response is + /// ProvideCredentials. + /// + [DataMember(Name = ("password"), IsRequired = (false))] + public string Password + { + get; + set; + } + } + + /// + /// Issued when the domain is enabled and the request URL matches the + /// specified filter. The request is paused until the client responds + /// with one of continueRequest, failRequest or fulfillRequest. + /// The stage of the request can be determined by presence of responseErrorReason + /// and responseStatusCode -- the request is at the response stage if either + /// of these fields is present and in the request stage otherwise. + /// Redirect responses and subsequent requests are reported similarly to regular + /// responses and requests. Redirect responses may be distinguished by the value + /// of `responseStatusCode` (which is one of 301, 302, 303, 307, 308) along with + /// presence of the `location` header. Requests resulting from a redirect will + /// have `redirectedRequestId` field set. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class RequestPausedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Each request the page makes will have a unique id. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// The details of the request. + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Network.Request Request + { + get; + private set; + } + + /// + /// The id of the frame that initiated the request. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// How the requested resource will be used. + /// + public CefSharp.DevTools.Network.ResourceType ResourceType + { + get + { + return (CefSharp.DevTools.Network.ResourceType)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType), resourceType)); + } + + set + { + this.resourceType = (EnumToString(value)); + } + } + + /// + /// How the requested resource will be used. + /// + [DataMember(Name = ("resourceType"), IsRequired = (true))] + internal string resourceType + { + get; + private set; + } + + /// + /// Response error if intercepted at response stage. + /// + public CefSharp.DevTools.Network.ErrorReason? ResponseErrorReason + { + get + { + return (CefSharp.DevTools.Network.ErrorReason? )(StringToEnum(typeof(CefSharp.DevTools.Network.ErrorReason? ), responseErrorReason)); + } + + set + { + this.responseErrorReason = (EnumToString(value)); + } + } + + /// + /// Response error if intercepted at response stage. + /// + [DataMember(Name = ("responseErrorReason"), IsRequired = (false))] + internal string responseErrorReason + { + get; + private set; + } + + /// + /// Response code if intercepted at response stage. + /// + [DataMember(Name = ("responseStatusCode"), IsRequired = (false))] + public int? ResponseStatusCode + { + get; + private set; + } + + /// + /// Response status text if intercepted at response stage. + /// + [DataMember(Name = ("responseStatusText"), IsRequired = (false))] + public string ResponseStatusText + { + get; + private set; + } + + /// + /// Response headers if intercepted at the response stage. + /// + [DataMember(Name = ("responseHeaders"), IsRequired = (false))] + public System.Collections.Generic.IList ResponseHeaders + { + get; + private set; + } + + /// + /// If the intercepted request had a corresponding Network.requestWillBeSent event fired for it, + /// then this networkId will be the same as the requestId present in the requestWillBeSent event. + /// + [DataMember(Name = ("networkId"), IsRequired = (false))] + public string NetworkId + { + get; + private set; + } + + /// + /// If the request is due to a redirect response from the server, the id of the request that + /// has caused the redirect. + /// + [DataMember(Name = ("redirectedRequestId"), IsRequired = (false))] + public string RedirectedRequestId + { + get; + private set; + } + } + + /// + /// Issued when the domain is enabled with handleAuthRequests set to true. + /// The request is paused until client responds with continueWithAuth. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AuthRequiredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Each request the page makes will have a unique id. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// The details of the request. + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Network.Request Request + { + get; + private set; + } + + /// + /// The id of the frame that initiated the request. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// How the requested resource will be used. + /// + public CefSharp.DevTools.Network.ResourceType ResourceType + { + get + { + return (CefSharp.DevTools.Network.ResourceType)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType), resourceType)); + } + + set + { + this.resourceType = (EnumToString(value)); + } + } + + /// + /// How the requested resource will be used. + /// + [DataMember(Name = ("resourceType"), IsRequired = (true))] + internal string resourceType + { + get; + private set; + } + + /// + /// Details of the Authorization Challenge encountered. + /// If this is set, client should respond with continueRequest that + /// contains AuthChallengeResponse. + /// + [DataMember(Name = ("authChallenge"), IsRequired = (true))] + public CefSharp.DevTools.Fetch.AuthChallenge AuthChallenge + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.FileSystem +{ + /// + /// File + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class File : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("lastModified"), IsRequired = (true))] + public double LastModified + { + get; + set; + } + + /// + /// Size in bytes + /// + [DataMember(Name = ("size"), IsRequired = (true))] + public double Size + { + get; + set; + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + public string Type + { + get; + set; + } + } + + /// + /// Directory + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Directory : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// NestedDirectories + /// + [DataMember(Name = ("nestedDirectories"), IsRequired = (true))] + public string[] NestedDirectories + { + get; + set; + } + + /// + /// Files that are directly nested under this directory. + /// + [DataMember(Name = ("nestedFiles"), IsRequired = (true))] + public System.Collections.Generic.IList NestedFiles + { + get; + set; + } + } + + /// + /// BucketFileSystemLocator + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BucketFileSystemLocator : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Storage key + /// + [DataMember(Name = ("storageKey"), IsRequired = (true))] + public string StorageKey + { + get; + set; + } + + /// + /// Bucket name. Not passing a `bucketName` will retrieve the default Bucket. (https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#storage_buckets) + /// + [DataMember(Name = ("bucketName"), IsRequired = (false))] + public string BucketName + { + get; + set; + } + + /// + /// Path to the directory using each path component as an array item. + /// + [DataMember(Name = ("pathComponents"), IsRequired = (true))] + public string[] PathComponents + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.HeadlessExperimental +{ + /// + /// Image compression format (defaults to png). + /// + public enum ScreenshotParamsFormat + { + /// + /// jpeg + /// + [EnumMember(Value = ("jpeg"))] + Jpeg, + /// + /// png + /// + [EnumMember(Value = ("png"))] + Png, + /// + /// webp + /// + [EnumMember(Value = ("webp"))] + Webp + } + + /// + /// Encoding options for a screenshot. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScreenshotParams : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Image compression format (defaults to png). + /// + public CefSharp.DevTools.HeadlessExperimental.ScreenshotParamsFormat? Format + { + get + { + return (CefSharp.DevTools.HeadlessExperimental.ScreenshotParamsFormat? )(StringToEnum(typeof(CefSharp.DevTools.HeadlessExperimental.ScreenshotParamsFormat? ), format)); + } + + set + { + this.format = (EnumToString(value)); + } + } + + /// + /// Image compression format (defaults to png). + /// + [DataMember(Name = ("format"), IsRequired = (false))] + internal string format + { + get; + set; + } + + /// + /// Compression quality from range [0..100] (jpeg and webp only). + /// + [DataMember(Name = ("quality"), IsRequired = (false))] + public int? Quality + { + get; + set; + } + + /// + /// Optimize image encoding for speed, not for resulting size (defaults to false) + /// + [DataMember(Name = ("optimizeForSpeed"), IsRequired = (false))] + public bool? OptimizeForSpeed + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// Database with an array of object stores. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DatabaseWithObjectStores : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Database name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Database version (type is not 'integer', as the standard + /// requires the version number to be 'unsigned long long') + /// + [DataMember(Name = ("version"), IsRequired = (true))] + public double Version + { + get; + set; + } + + /// + /// Object stores in this database. + /// + [DataMember(Name = ("objectStores"), IsRequired = (true))] + public System.Collections.Generic.IList ObjectStores + { + get; + set; + } + } + + /// + /// Object store. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ObjectStore : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Object store name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Object store key path. + /// + [DataMember(Name = ("keyPath"), IsRequired = (true))] + public CefSharp.DevTools.IndexedDB.KeyPath KeyPath + { + get; + set; + } + + /// + /// If true, object store has auto increment flag set. + /// + [DataMember(Name = ("autoIncrement"), IsRequired = (true))] + public bool AutoIncrement + { + get; + set; + } + + /// + /// Indexes in this object store. + /// + [DataMember(Name = ("indexes"), IsRequired = (true))] + public System.Collections.Generic.IList Indexes + { + get; + set; + } + } + + /// + /// Object store index. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ObjectStoreIndex : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Index key path. + /// + [DataMember(Name = ("keyPath"), IsRequired = (true))] + public CefSharp.DevTools.IndexedDB.KeyPath KeyPath + { + get; + set; + } + + /// + /// If true, index is unique. + /// + [DataMember(Name = ("unique"), IsRequired = (true))] + public bool Unique + { + get; + set; + } + + /// + /// If true, index allows multiple entries for a key. + /// + [DataMember(Name = ("multiEntry"), IsRequired = (true))] + public bool MultiEntry + { + get; + set; + } + } + + /// + /// Key type. + /// + public enum KeyType + { + /// + /// number + /// + [EnumMember(Value = ("number"))] + Number, + /// + /// string + /// + [EnumMember(Value = ("string"))] + String, + /// + /// date + /// + [EnumMember(Value = ("date"))] + Date, + /// + /// array + /// + [EnumMember(Value = ("array"))] + Array + } + + /// + /// Key. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Key : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key type. + /// + public CefSharp.DevTools.IndexedDB.KeyType Type + { + get + { + return (CefSharp.DevTools.IndexedDB.KeyType)(StringToEnum(typeof(CefSharp.DevTools.IndexedDB.KeyType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Key type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Number value. + /// + [DataMember(Name = ("number"), IsRequired = (false))] + public double? Number + { + get; + set; + } + + /// + /// String value. + /// + [DataMember(Name = ("string"), IsRequired = (false))] + public string String + { + get; + set; + } + + /// + /// Date value. + /// + [DataMember(Name = ("date"), IsRequired = (false))] + public double? Date + { + get; + set; + } + + /// + /// Array value. + /// + [DataMember(Name = ("array"), IsRequired = (false))] + public System.Collections.Generic.IList Array + { + get; + set; + } + } + + /// + /// Key range. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class KeyRange : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Lower bound. + /// + [DataMember(Name = ("lower"), IsRequired = (false))] + public CefSharp.DevTools.IndexedDB.Key Lower + { + get; + set; + } + + /// + /// Upper bound. + /// + [DataMember(Name = ("upper"), IsRequired = (false))] + public CefSharp.DevTools.IndexedDB.Key Upper + { + get; + set; + } + + /// + /// If true lower bound is open. + /// + [DataMember(Name = ("lowerOpen"), IsRequired = (true))] + public bool LowerOpen + { + get; + set; + } + + /// + /// If true upper bound is open. + /// + [DataMember(Name = ("upperOpen"), IsRequired = (true))] + public bool UpperOpen + { + get; + set; + } + } + + /// + /// Data entry. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DataEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key object. + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.RemoteObject Key + { + get; + set; + } + + /// + /// Primary key object. + /// + [DataMember(Name = ("primaryKey"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.RemoteObject PrimaryKey + { + get; + set; + } + + /// + /// Value object. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.RemoteObject Value + { + get; + set; + } + } + + /// + /// Key path type. + /// + public enum KeyPathType + { + /// + /// null + /// + [EnumMember(Value = ("null"))] + Null, + /// + /// string + /// + [EnumMember(Value = ("string"))] + String, + /// + /// array + /// + [EnumMember(Value = ("array"))] + Array + } + + /// + /// Key path. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class KeyPath : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key path type. + /// + public CefSharp.DevTools.IndexedDB.KeyPathType Type + { + get + { + return (CefSharp.DevTools.IndexedDB.KeyPathType)(StringToEnum(typeof(CefSharp.DevTools.IndexedDB.KeyPathType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Key path type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// String value. + /// + [DataMember(Name = ("string"), IsRequired = (false))] + public string String + { + get; + set; + } + + /// + /// Array value. + /// + [DataMember(Name = ("array"), IsRequired = (false))] + public string[] Array + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.Input +{ + /// + /// TouchPoint + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class TouchPoint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X coordinate of the event relative to the main frame's viewport in CSS pixels. + /// + [DataMember(Name = ("x"), IsRequired = (true))] + public double X + { + get; + set; + } + + /// + /// Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to + /// the top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + /// + [DataMember(Name = ("y"), IsRequired = (true))] + public double Y + { + get; + set; + } + + /// + /// X radius of the touch area (default: 1.0). + /// + [DataMember(Name = ("radiusX"), IsRequired = (false))] + public double? RadiusX + { + get; + set; + } + + /// + /// Y radius of the touch area (default: 1.0). + /// + [DataMember(Name = ("radiusY"), IsRequired = (false))] + public double? RadiusY + { + get; + set; + } + + /// + /// Rotation angle (default: 0.0). + /// + [DataMember(Name = ("rotationAngle"), IsRequired = (false))] + public double? RotationAngle + { + get; + set; + } + + /// + /// Force (default: 1.0). + /// + [DataMember(Name = ("force"), IsRequired = (false))] + public double? Force + { + get; + set; + } + + /// + /// The normalized tangential pressure, which has a range of [-1,1] (default: 0). + /// + [DataMember(Name = ("tangentialPressure"), IsRequired = (false))] + public double? TangentialPressure + { + get; + set; + } + + /// + /// The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0) + /// + [DataMember(Name = ("tiltX"), IsRequired = (false))] + public double? TiltX + { + get; + set; + } + + /// + /// The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0). + /// + [DataMember(Name = ("tiltY"), IsRequired = (false))] + public double? TiltY + { + get; + set; + } + + /// + /// The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0). + /// + [DataMember(Name = ("twist"), IsRequired = (false))] + public int? Twist + { + get; + set; + } + + /// + /// Identifier used to track touch sources between events, must be unique within an event. + /// + [DataMember(Name = ("id"), IsRequired = (false))] + public double? Id + { + get; + set; + } + } + + /// + /// GestureSourceType + /// + public enum GestureSourceType + { + /// + /// default + /// + [EnumMember(Value = ("default"))] + Default, + /// + /// touch + /// + [EnumMember(Value = ("touch"))] + Touch, + /// + /// mouse + /// + [EnumMember(Value = ("mouse"))] + Mouse + } + + /// + /// MouseButton + /// + public enum MouseButton + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// left + /// + [EnumMember(Value = ("left"))] + Left, + /// + /// middle + /// + [EnumMember(Value = ("middle"))] + Middle, + /// + /// right + /// + [EnumMember(Value = ("right"))] + Right, + /// + /// back + /// + [EnumMember(Value = ("back"))] + Back, + /// + /// forward + /// + [EnumMember(Value = ("forward"))] + Forward + } + + /// + /// DragDataItem + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DragDataItem : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Mime type of the dragged data. + /// + [DataMember(Name = ("mimeType"), IsRequired = (true))] + public string MimeType + { + get; + set; + } + + /// + /// Depending of the value of `mimeType`, it contains the dragged link, + /// text, HTML markup or any other data. + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public string Data + { + get; + set; + } + + /// + /// Title associated with a link. Only valid when `mimeType` == "text/uri-list". + /// + [DataMember(Name = ("title"), IsRequired = (false))] + public string Title + { + get; + set; + } + + /// + /// Stores the base URL for the contained markup. Only valid when `mimeType` + /// == "text/html". + /// + [DataMember(Name = ("baseURL"), IsRequired = (false))] + public string BaseURL + { + get; + set; + } + } + + /// + /// DragData + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DragData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Items + /// + [DataMember(Name = ("items"), IsRequired = (true))] + public System.Collections.Generic.IList Items + { + get; + set; + } + + /// + /// List of filenames that should be included when dropping + /// + [DataMember(Name = ("files"), IsRequired = (false))] + public string[] Files + { + get; + set; + } + + /// + /// Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 + /// + [DataMember(Name = ("dragOperationsMask"), IsRequired = (true))] + public int DragOperationsMask + { + get; + set; + } + } + + /// + /// Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to + /// restore normal drag and drop behavior. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DragInterceptedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public CefSharp.DevTools.Input.DragData Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Inspector +{ + /// + /// Fired when remote debugging connection is about to be terminated. Contains detach reason. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DetachedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The reason why connection has been terminated. + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + public string Reason + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// Reason for rectangle to force scrolling on the main thread + /// + public enum ScrollRectType + { + /// + /// RepaintsOnScroll + /// + [EnumMember(Value = ("RepaintsOnScroll"))] + RepaintsOnScroll, + /// + /// TouchEventHandler + /// + [EnumMember(Value = ("TouchEventHandler"))] + TouchEventHandler, + /// + /// WheelEventHandler + /// + [EnumMember(Value = ("WheelEventHandler"))] + WheelEventHandler + } + + /// + /// Rectangle where scrolling happens on the main thread. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScrollRect : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Rectangle itself. + /// + [DataMember(Name = ("rect"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect Rect + { + get; + set; + } + + /// + /// Reason for rectangle to force scrolling on the main thread + /// + public CefSharp.DevTools.LayerTree.ScrollRectType Type + { + get + { + return (CefSharp.DevTools.LayerTree.ScrollRectType)(StringToEnum(typeof(CefSharp.DevTools.LayerTree.ScrollRectType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Reason for rectangle to force scrolling on the main thread + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + } + + /// + /// Sticky position constraints. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class StickyPositionConstraint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Layout rectangle of the sticky element before being shifted + /// + [DataMember(Name = ("stickyBoxRect"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect StickyBoxRect + { + get; + set; + } + + /// + /// Layout rectangle of the containing block of the sticky element + /// + [DataMember(Name = ("containingBlockRect"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect ContainingBlockRect + { + get; + set; + } + + /// + /// The nearest sticky layer that shifts the sticky box + /// + [DataMember(Name = ("nearestLayerShiftingStickyBox"), IsRequired = (false))] + public string NearestLayerShiftingStickyBox + { + get; + set; + } + + /// + /// The nearest sticky layer that shifts the containing block + /// + [DataMember(Name = ("nearestLayerShiftingContainingBlock"), IsRequired = (false))] + public string NearestLayerShiftingContainingBlock + { + get; + set; + } + } + + /// + /// Serialized fragment of layer picture along with its offset within the layer. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PictureTile : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Offset from owning layer left boundary + /// + [DataMember(Name = ("x"), IsRequired = (true))] + public double X + { + get; + set; + } + + /// + /// Offset from owning layer top boundary + /// + [DataMember(Name = ("y"), IsRequired = (true))] + public double Y + { + get; + set; + } + + /// + /// Base64-encoded snapshot data. + /// + [DataMember(Name = ("picture"), IsRequired = (true))] + public byte[] Picture + { + get; + set; + } + } + + /// + /// Information about a compositing layer. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Layer : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The unique id for this layer. + /// + [DataMember(Name = ("layerId"), IsRequired = (true))] + public string LayerId + { + get; + set; + } + + /// + /// The id of parent (not present for root). + /// + [DataMember(Name = ("parentLayerId"), IsRequired = (false))] + public string ParentLayerId + { + get; + set; + } + + /// + /// The backend id for the node associated with this layer. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (false))] + public int? BackendNodeId + { + get; + set; + } + + /// + /// Offset from parent layer, X coordinate. + /// + [DataMember(Name = ("offsetX"), IsRequired = (true))] + public double OffsetX + { + get; + set; + } + + /// + /// Offset from parent layer, Y coordinate. + /// + [DataMember(Name = ("offsetY"), IsRequired = (true))] + public double OffsetY + { + get; + set; + } + + /// + /// Layer width. + /// + [DataMember(Name = ("width"), IsRequired = (true))] + public double Width + { + get; + set; + } + + /// + /// Layer height. + /// + [DataMember(Name = ("height"), IsRequired = (true))] + public double Height + { + get; + set; + } + + /// + /// Transformation matrix for layer, default is identity matrix + /// + [DataMember(Name = ("transform"), IsRequired = (false))] + public double[] Transform + { + get; + set; + } + + /// + /// Transform anchor point X, absent if no transform specified + /// + [DataMember(Name = ("anchorX"), IsRequired = (false))] + public double? AnchorX + { + get; + set; + } + + /// + /// Transform anchor point Y, absent if no transform specified + /// + [DataMember(Name = ("anchorY"), IsRequired = (false))] + public double? AnchorY + { + get; + set; + } + + /// + /// Transform anchor point Z, absent if no transform specified + /// + [DataMember(Name = ("anchorZ"), IsRequired = (false))] + public double? AnchorZ + { + get; + set; + } + + /// + /// Indicates how many time this layer has painted. + /// + [DataMember(Name = ("paintCount"), IsRequired = (true))] + public int PaintCount + { + get; + set; + } + + /// + /// Indicates whether this layer hosts any content, rather than being used for + /// transform/scrolling purposes only. + /// + [DataMember(Name = ("drawsContent"), IsRequired = (true))] + public bool DrawsContent + { + get; + set; + } + + /// + /// Set if layer is not visible. + /// + [DataMember(Name = ("invisible"), IsRequired = (false))] + public bool? Invisible + { + get; + set; + } + + /// + /// Rectangles scrolling on main thread only. + /// + [DataMember(Name = ("scrollRects"), IsRequired = (false))] + public System.Collections.Generic.IList ScrollRects + { + get; + set; + } + + /// + /// Sticky position constraint information + /// + [DataMember(Name = ("stickyPositionConstraint"), IsRequired = (false))] + public CefSharp.DevTools.LayerTree.StickyPositionConstraint StickyPositionConstraint + { + get; + set; + } + } + + /// + /// layerPainted + /// + [System.Runtime.Serialization.DataContractAttribute] + public class LayerPaintedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The id of the painted layer. + /// + [DataMember(Name = ("layerId"), IsRequired = (true))] + public string LayerId + { + get; + private set; + } + + /// + /// Clip rectangle. + /// + [DataMember(Name = ("clip"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect Clip + { + get; + private set; + } + } + + /// + /// layerTreeDidChange + /// + [System.Runtime.Serialization.DataContractAttribute] + public class LayerTreeDidChangeEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Layer tree, absent if not in the compositing mode. + /// + [DataMember(Name = ("layers"), IsRequired = (false))] + public System.Collections.Generic.IList Layers + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Log +{ + /// + /// Log entry source. + /// + public enum LogEntrySource + { + /// + /// xml + /// + [EnumMember(Value = ("xml"))] + Xml, + /// + /// javascript + /// + [EnumMember(Value = ("javascript"))] + Javascript, + /// + /// network + /// + [EnumMember(Value = ("network"))] + Network, + /// + /// storage + /// + [EnumMember(Value = ("storage"))] + Storage, + /// + /// appcache + /// + [EnumMember(Value = ("appcache"))] + Appcache, + /// + /// rendering + /// + [EnumMember(Value = ("rendering"))] + Rendering, + /// + /// security + /// + [EnumMember(Value = ("security"))] + Security, + /// + /// deprecation + /// + [EnumMember(Value = ("deprecation"))] + Deprecation, + /// + /// worker + /// + [EnumMember(Value = ("worker"))] + Worker, + /// + /// violation + /// + [EnumMember(Value = ("violation"))] + Violation, + /// + /// intervention + /// + [EnumMember(Value = ("intervention"))] + Intervention, + /// + /// recommendation + /// + [EnumMember(Value = ("recommendation"))] + Recommendation, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other + } + + /// + /// Log entry severity. + /// + public enum LogEntryLevel + { + /// + /// verbose + /// + [EnumMember(Value = ("verbose"))] + Verbose, + /// + /// info + /// + [EnumMember(Value = ("info"))] + Info, + /// + /// warning + /// + [EnumMember(Value = ("warning"))] + Warning, + /// + /// error + /// + [EnumMember(Value = ("error"))] + Error + } + + /// + /// LogEntryCategory + /// + public enum LogEntryCategory + { + /// + /// cors + /// + [EnumMember(Value = ("cors"))] + Cors + } + + /// + /// Log entry. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LogEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Log entry source. + /// + public CefSharp.DevTools.Log.LogEntrySource Source + { + get + { + return (CefSharp.DevTools.Log.LogEntrySource)(StringToEnum(typeof(CefSharp.DevTools.Log.LogEntrySource), source)); + } + + set + { + this.source = (EnumToString(value)); + } + } + + /// + /// Log entry source. + /// + [DataMember(Name = ("source"), IsRequired = (true))] + internal string source + { + get; + set; + } + + /// + /// Log entry severity. + /// + public CefSharp.DevTools.Log.LogEntryLevel Level + { + get + { + return (CefSharp.DevTools.Log.LogEntryLevel)(StringToEnum(typeof(CefSharp.DevTools.Log.LogEntryLevel), level)); + } + + set + { + this.level = (EnumToString(value)); + } + } + + /// + /// Log entry severity. + /// + [DataMember(Name = ("level"), IsRequired = (true))] + internal string level + { + get; + set; + } + + /// + /// Logged text. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + + /// + /// Category + /// + public CefSharp.DevTools.Log.LogEntryCategory? Category + { + get + { + return (CefSharp.DevTools.Log.LogEntryCategory? )(StringToEnum(typeof(CefSharp.DevTools.Log.LogEntryCategory? ), category)); + } + + set + { + this.category = (EnumToString(value)); + } + } + + /// + /// Category + /// + [DataMember(Name = ("category"), IsRequired = (false))] + internal string category + { + get; + set; + } + + /// + /// Timestamp when this entry was added. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + set; + } + + /// + /// URL of the resource if known. + /// + [DataMember(Name = ("url"), IsRequired = (false))] + public string Url + { + get; + set; + } + + /// + /// Line number in the resource. + /// + [DataMember(Name = ("lineNumber"), IsRequired = (false))] + public int? LineNumber + { + get; + set; + } + + /// + /// JavaScript stack trace. + /// + [DataMember(Name = ("stackTrace"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + set; + } + + /// + /// Identifier of the network request associated with this entry. + /// + [DataMember(Name = ("networkRequestId"), IsRequired = (false))] + public string NetworkRequestId + { + get; + set; + } + + /// + /// Identifier of the worker associated with this entry. + /// + [DataMember(Name = ("workerId"), IsRequired = (false))] + public string WorkerId + { + get; + set; + } + + /// + /// Call arguments. + /// + [DataMember(Name = ("args"), IsRequired = (false))] + public System.Collections.Generic.IList Args + { + get; + set; + } + } + + /// + /// Violation type. + /// + public enum ViolationSettingName + { + /// + /// longTask + /// + [EnumMember(Value = ("longTask"))] + LongTask, + /// + /// longLayout + /// + [EnumMember(Value = ("longLayout"))] + LongLayout, + /// + /// blockedEvent + /// + [EnumMember(Value = ("blockedEvent"))] + BlockedEvent, + /// + /// blockedParser + /// + [EnumMember(Value = ("blockedParser"))] + BlockedParser, + /// + /// discouragedAPIUse + /// + [EnumMember(Value = ("discouragedAPIUse"))] + DiscouragedAPIUse, + /// + /// handler + /// + [EnumMember(Value = ("handler"))] + Handler, + /// + /// recurringHandler + /// + [EnumMember(Value = ("recurringHandler"))] + RecurringHandler + } + + /// + /// Violation configuration setting. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ViolationSetting : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Violation type. + /// + public CefSharp.DevTools.Log.ViolationSettingName Name + { + get + { + return (CefSharp.DevTools.Log.ViolationSettingName)(StringToEnum(typeof(CefSharp.DevTools.Log.ViolationSettingName), name)); + } + + set + { + this.name = (EnumToString(value)); + } + } + + /// + /// Violation type. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + internal string name + { + get; + set; + } + + /// + /// Time threshold to trigger upon. + /// + [DataMember(Name = ("threshold"), IsRequired = (true))] + public double Threshold + { + get; + set; + } + } + + /// + /// Issued when new message was logged. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class EntryAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The entry. + /// + [DataMember(Name = ("entry"), IsRequired = (true))] + public CefSharp.DevTools.Log.LogEntry Entry + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Media +{ + /// + /// Keep in sync with MediaLogMessageLevel + /// We are currently keeping the message level 'error' separate from the + /// PlayerError type because right now they represent different things, + /// this one being a DVLOG(ERROR) style log message that gets printed + /// based on what log level is selected in the UI, and the other is a + /// representation of a media::PipelineStatus object. Soon however we're + /// going to be moving away from using PipelineStatus for errors and + /// introducing a new error type which should hopefully let us integrate + /// the error log level into the PlayerError type. + /// + public enum PlayerMessageLevel + { + /// + /// error + /// + [EnumMember(Value = ("error"))] + Error, + /// + /// warning + /// + [EnumMember(Value = ("warning"))] + Warning, + /// + /// info + /// + [EnumMember(Value = ("info"))] + Info, + /// + /// debug + /// + [EnumMember(Value = ("debug"))] + Debug + } + + /// + /// Have one type per entry in MediaLogRecord::Type + /// Corresponds to kMessage + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PlayerMessage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Keep in sync with MediaLogMessageLevel + /// We are currently keeping the message level 'error' separate from the + /// PlayerError type because right now they represent different things, + /// this one being a DVLOG(ERROR) style log message that gets printed + /// based on what log level is selected in the UI, and the other is a + /// representation of a media::PipelineStatus object. Soon however we're + /// going to be moving away from using PipelineStatus for errors and + /// introducing a new error type which should hopefully let us integrate + /// the error log level into the PlayerError type. + /// + public CefSharp.DevTools.Media.PlayerMessageLevel Level + { + get + { + return (CefSharp.DevTools.Media.PlayerMessageLevel)(StringToEnum(typeof(CefSharp.DevTools.Media.PlayerMessageLevel), level)); + } + + set + { + this.level = (EnumToString(value)); + } + } + + /// + /// Keep in sync with MediaLogMessageLevel + /// We are currently keeping the message level 'error' separate from the + /// PlayerError type because right now they represent different things, + /// this one being a DVLOG(ERROR) style log message that gets printed + /// based on what log level is selected in the UI, and the other is a + /// representation of a media::PipelineStatus object. Soon however we're + /// going to be moving away from using PipelineStatus for errors and + /// introducing a new error type which should hopefully let us integrate + /// the error log level into the PlayerError type. + /// + [DataMember(Name = ("level"), IsRequired = (true))] + internal string level + { + get; + set; + } + + /// + /// Message + /// + [DataMember(Name = ("message"), IsRequired = (true))] + public string Message + { + get; + set; + } + } + + /// + /// Corresponds to kMediaPropertyChange + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PlayerProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// Corresponds to kMediaEventTriggered + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PlayerEvent : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// Represents logged source line numbers reported in an error. + /// NOTE: file and line are from chromium c++ implementation code, not js. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PlayerErrorSourceLocation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// File + /// + [DataMember(Name = ("file"), IsRequired = (true))] + public string File + { + get; + set; + } + + /// + /// Line + /// + [DataMember(Name = ("line"), IsRequired = (true))] + public int Line + { + get; + set; + } + } + + /// + /// Corresponds to kMediaError + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PlayerError : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ErrorType + /// + [DataMember(Name = ("errorType"), IsRequired = (true))] + public string ErrorType + { + get; + set; + } + + /// + /// Code is the numeric enum entry for a specific set of error codes, such + /// as PipelineStatusCodes in media/base/pipeline_status.h + /// + [DataMember(Name = ("code"), IsRequired = (true))] + public int Code + { + get; + set; + } + + /// + /// A trace of where this error was caused / where it passed through. + /// + [DataMember(Name = ("stack"), IsRequired = (true))] + public System.Collections.Generic.IList Stack + { + get; + set; + } + + /// + /// Errors potentially have a root cause error, ie, a DecoderError might be + /// caused by an WindowsError + /// + [DataMember(Name = ("cause"), IsRequired = (true))] + public System.Collections.Generic.IList Cause + { + get; + set; + } + + /// + /// Extra data attached to an error, such as an HRESULT, Video Codec, etc. + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public object Data + { + get; + set; + } + } + + /// + /// Player + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Player : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// PlayerId + /// + [DataMember(Name = ("playerId"), IsRequired = (true))] + public string PlayerId + { + get; + set; + } + + /// + /// DomNodeId + /// + [DataMember(Name = ("domNodeId"), IsRequired = (false))] + public int? DomNodeId + { + get; + set; + } + } + + /// + /// This can be called multiple times, and can be used to set / override / + /// remove player properties. A null propValue indicates removal. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PlayerPropertiesChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// PlayerId + /// + [DataMember(Name = ("playerId"), IsRequired = (true))] + public string PlayerId + { + get; + private set; + } + + /// + /// Properties + /// + [DataMember(Name = ("properties"), IsRequired = (true))] + public System.Collections.Generic.IList Properties + { + get; + private set; + } + } + + /// + /// Send events as a list, allowing them to be batched on the browser for less + /// congestion. If batched, events must ALWAYS be in chronological order. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PlayerEventsAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// PlayerId + /// + [DataMember(Name = ("playerId"), IsRequired = (true))] + public string PlayerId + { + get; + private set; + } + + /// + /// Events + /// + [DataMember(Name = ("events"), IsRequired = (true))] + public System.Collections.Generic.IList Events + { + get; + private set; + } + } + + /// + /// Send a list of any messages that need to be delivered. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PlayerMessagesLoggedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// PlayerId + /// + [DataMember(Name = ("playerId"), IsRequired = (true))] + public string PlayerId + { + get; + private set; + } + + /// + /// Messages + /// + [DataMember(Name = ("messages"), IsRequired = (true))] + public System.Collections.Generic.IList Messages + { + get; + private set; + } + } + + /// + /// Send a list of any errors that need to be delivered. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PlayerErrorsRaisedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// PlayerId + /// + [DataMember(Name = ("playerId"), IsRequired = (true))] + public string PlayerId + { + get; + private set; + } + + /// + /// Errors + /// + [DataMember(Name = ("errors"), IsRequired = (true))] + public System.Collections.Generic.IList Errors + { + get; + private set; + } + } + + /// + /// Called whenever a player is created, or when a new agent joins and receives + /// a list of active players. If an agent is restored, it will receive one + /// event for each active player. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PlayerCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Player + /// + [DataMember(Name = ("player"), IsRequired = (true))] + public CefSharp.DevTools.Media.Player Player + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// Memory pressure level. + /// + public enum PressureLevel + { + /// + /// moderate + /// + [EnumMember(Value = ("moderate"))] + Moderate, + /// + /// critical + /// + [EnumMember(Value = ("critical"))] + Critical + } + + /// + /// Heap profile sample. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SamplingProfileNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Size of the sampled allocation. + /// + [DataMember(Name = ("size"), IsRequired = (true))] + public double Size + { + get; + set; + } + + /// + /// Total bytes attributed to this sample. + /// + [DataMember(Name = ("total"), IsRequired = (true))] + public double Total + { + get; + set; + } + + /// + /// Execution stack at the point of allocation. + /// + [DataMember(Name = ("stack"), IsRequired = (true))] + public string[] Stack + { + get; + set; + } + } + + /// + /// Array of heap profile samples. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SamplingProfile : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Samples + /// + [DataMember(Name = ("samples"), IsRequired = (true))] + public System.Collections.Generic.IList Samples + { + get; + set; + } + + /// + /// Modules + /// + [DataMember(Name = ("modules"), IsRequired = (true))] + public System.Collections.Generic.IList Modules + { + get; + set; + } + } + + /// + /// Executable module information + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Module : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of the module. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// UUID of the module. + /// + [DataMember(Name = ("uuid"), IsRequired = (true))] + public string Uuid + { + get; + set; + } + + /// + /// Base address where the module is loaded into memory. Encoded as a decimal + /// or hexadecimal (0x prefixed) string. + /// + [DataMember(Name = ("baseAddress"), IsRequired = (true))] + public string BaseAddress + { + get; + set; + } + + /// + /// Size of the module in bytes. + /// + [DataMember(Name = ("size"), IsRequired = (true))] + public double Size + { + get; + set; + } + } + + /// + /// DOM object counter data. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DOMCounter : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Object name. Note: object names should be presumed volatile and clients should not expect + /// the returned names to be consistent across runs. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Object count. + /// + [DataMember(Name = ("count"), IsRequired = (true))] + public int Count + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// Resource type as it was perceived by the rendering engine. + /// + public enum ResourceType + { + /// + /// Document + /// + [EnumMember(Value = ("Document"))] + Document, + /// + /// Stylesheet + /// + [EnumMember(Value = ("Stylesheet"))] + Stylesheet, + /// + /// Image + /// + [EnumMember(Value = ("Image"))] + Image, + /// + /// Media + /// + [EnumMember(Value = ("Media"))] + Media, + /// + /// Font + /// + [EnumMember(Value = ("Font"))] + Font, + /// + /// Script + /// + [EnumMember(Value = ("Script"))] + Script, + /// + /// TextTrack + /// + [EnumMember(Value = ("TextTrack"))] + TextTrack, + /// + /// XHR + /// + [EnumMember(Value = ("XHR"))] + XHR, + /// + /// Fetch + /// + [EnumMember(Value = ("Fetch"))] + Fetch, + /// + /// Prefetch + /// + [EnumMember(Value = ("Prefetch"))] + Prefetch, + /// + /// EventSource + /// + [EnumMember(Value = ("EventSource"))] + EventSource, + /// + /// WebSocket + /// + [EnumMember(Value = ("WebSocket"))] + WebSocket, + /// + /// Manifest + /// + [EnumMember(Value = ("Manifest"))] + Manifest, + /// + /// SignedExchange + /// + [EnumMember(Value = ("SignedExchange"))] + SignedExchange, + /// + /// Ping + /// + [EnumMember(Value = ("Ping"))] + Ping, + /// + /// CSPViolationReport + /// + [EnumMember(Value = ("CSPViolationReport"))] + CSPViolationReport, + /// + /// Preflight + /// + [EnumMember(Value = ("Preflight"))] + Preflight, + /// + /// FedCM + /// + [EnumMember(Value = ("FedCM"))] + FedCM, + /// + /// Other + /// + [EnumMember(Value = ("Other"))] + Other + } + + /// + /// Network level fetch failure reason. + /// + public enum ErrorReason + { + /// + /// Failed + /// + [EnumMember(Value = ("Failed"))] + Failed, + /// + /// Aborted + /// + [EnumMember(Value = ("Aborted"))] + Aborted, + /// + /// TimedOut + /// + [EnumMember(Value = ("TimedOut"))] + TimedOut, + /// + /// AccessDenied + /// + [EnumMember(Value = ("AccessDenied"))] + AccessDenied, + /// + /// ConnectionClosed + /// + [EnumMember(Value = ("ConnectionClosed"))] + ConnectionClosed, + /// + /// ConnectionReset + /// + [EnumMember(Value = ("ConnectionReset"))] + ConnectionReset, + /// + /// ConnectionRefused + /// + [EnumMember(Value = ("ConnectionRefused"))] + ConnectionRefused, + /// + /// ConnectionAborted + /// + [EnumMember(Value = ("ConnectionAborted"))] + ConnectionAborted, + /// + /// ConnectionFailed + /// + [EnumMember(Value = ("ConnectionFailed"))] + ConnectionFailed, + /// + /// NameNotResolved + /// + [EnumMember(Value = ("NameNotResolved"))] + NameNotResolved, + /// + /// InternetDisconnected + /// + [EnumMember(Value = ("InternetDisconnected"))] + InternetDisconnected, + /// + /// AddressUnreachable + /// + [EnumMember(Value = ("AddressUnreachable"))] + AddressUnreachable, + /// + /// BlockedByClient + /// + [EnumMember(Value = ("BlockedByClient"))] + BlockedByClient, + /// + /// BlockedByResponse + /// + [EnumMember(Value = ("BlockedByResponse"))] + BlockedByResponse + } + + /// + /// The underlying connection technology that the browser is supposedly using. + /// + public enum ConnectionType + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// cellular2g + /// + [EnumMember(Value = ("cellular2g"))] + Cellular2g, + /// + /// cellular3g + /// + [EnumMember(Value = ("cellular3g"))] + Cellular3g, + /// + /// cellular4g + /// + [EnumMember(Value = ("cellular4g"))] + Cellular4g, + /// + /// bluetooth + /// + [EnumMember(Value = ("bluetooth"))] + Bluetooth, + /// + /// ethernet + /// + [EnumMember(Value = ("ethernet"))] + Ethernet, + /// + /// wifi + /// + [EnumMember(Value = ("wifi"))] + Wifi, + /// + /// wimax + /// + [EnumMember(Value = ("wimax"))] + Wimax, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other + } + + /// + /// Represents the cookie's 'SameSite' status: + /// https://tools.ietf.org/html/draft-west-first-party-cookies + /// + public enum CookieSameSite + { + /// + /// Strict + /// + [EnumMember(Value = ("Strict"))] + Strict, + /// + /// Lax + /// + [EnumMember(Value = ("Lax"))] + Lax, + /// + /// None + /// + [EnumMember(Value = ("None"))] + None + } + + /// + /// Represents the cookie's 'Priority' status: + /// https://tools.ietf.org/html/draft-west-cookie-priority-00 + /// + public enum CookiePriority + { + /// + /// Low + /// + [EnumMember(Value = ("Low"))] + Low, + /// + /// Medium + /// + [EnumMember(Value = ("Medium"))] + Medium, + /// + /// High + /// + [EnumMember(Value = ("High"))] + High + } + + /// + /// Represents the source scheme of the origin that originally set the cookie. + /// A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. + /// This is a temporary ability and it will be removed in the future. + /// + public enum CookieSourceScheme + { + /// + /// Unset + /// + [EnumMember(Value = ("Unset"))] + Unset, + /// + /// NonSecure + /// + [EnumMember(Value = ("NonSecure"))] + NonSecure, + /// + /// Secure + /// + [EnumMember(Value = ("Secure"))] + Secure + } + + /// + /// Timing information for the request. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ResourceTiming : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Timing's requestTime is a baseline in seconds, while the other numbers are ticks in + /// milliseconds relatively to this requestTime. + /// + [DataMember(Name = ("requestTime"), IsRequired = (true))] + public double RequestTime + { + get; + set; + } + + /// + /// Started resolving proxy. + /// + [DataMember(Name = ("proxyStart"), IsRequired = (true))] + public double ProxyStart + { + get; + set; + } + + /// + /// Finished resolving proxy. + /// + [DataMember(Name = ("proxyEnd"), IsRequired = (true))] + public double ProxyEnd + { + get; + set; + } + + /// + /// Started DNS address resolve. + /// + [DataMember(Name = ("dnsStart"), IsRequired = (true))] + public double DnsStart + { + get; + set; + } + + /// + /// Finished DNS address resolve. + /// + [DataMember(Name = ("dnsEnd"), IsRequired = (true))] + public double DnsEnd + { + get; + set; + } + + /// + /// Started connecting to the remote host. + /// + [DataMember(Name = ("connectStart"), IsRequired = (true))] + public double ConnectStart + { + get; + set; + } + + /// + /// Connected to the remote host. + /// + [DataMember(Name = ("connectEnd"), IsRequired = (true))] + public double ConnectEnd + { + get; + set; + } + + /// + /// Started SSL handshake. + /// + [DataMember(Name = ("sslStart"), IsRequired = (true))] + public double SslStart + { + get; + set; + } + + /// + /// Finished SSL handshake. + /// + [DataMember(Name = ("sslEnd"), IsRequired = (true))] + public double SslEnd + { + get; + set; + } + + /// + /// Started running ServiceWorker. + /// + [DataMember(Name = ("workerStart"), IsRequired = (true))] + public double WorkerStart + { + get; + set; + } + + /// + /// Finished Starting ServiceWorker. + /// + [DataMember(Name = ("workerReady"), IsRequired = (true))] + public double WorkerReady + { + get; + set; + } + + /// + /// Started fetch event. + /// + [DataMember(Name = ("workerFetchStart"), IsRequired = (true))] + public double WorkerFetchStart + { + get; + set; + } + + /// + /// Settled fetch event respondWith promise. + /// + [DataMember(Name = ("workerRespondWithSettled"), IsRequired = (true))] + public double WorkerRespondWithSettled + { + get; + set; + } + + /// + /// Started ServiceWorker static routing source evaluation. + /// + [DataMember(Name = ("workerRouterEvaluationStart"), IsRequired = (false))] + public double? WorkerRouterEvaluationStart + { + get; + set; + } + + /// + /// Started cache lookup when the source was evaluated to `cache`. + /// + [DataMember(Name = ("workerCacheLookupStart"), IsRequired = (false))] + public double? WorkerCacheLookupStart + { + get; + set; + } + + /// + /// Started sending request. + /// + [DataMember(Name = ("sendStart"), IsRequired = (true))] + public double SendStart + { + get; + set; + } + + /// + /// Finished sending request. + /// + [DataMember(Name = ("sendEnd"), IsRequired = (true))] + public double SendEnd + { + get; + set; + } + + /// + /// Time the server started pushing request. + /// + [DataMember(Name = ("pushStart"), IsRequired = (true))] + public double PushStart + { + get; + set; + } + + /// + /// Time the server finished pushing request. + /// + [DataMember(Name = ("pushEnd"), IsRequired = (true))] + public double PushEnd + { + get; + set; + } + + /// + /// Started receiving response headers. + /// + [DataMember(Name = ("receiveHeadersStart"), IsRequired = (true))] + public double ReceiveHeadersStart + { + get; + set; + } + + /// + /// Finished receiving response headers. + /// + [DataMember(Name = ("receiveHeadersEnd"), IsRequired = (true))] + public double ReceiveHeadersEnd + { + get; + set; + } + } + + /// + /// Loading priority of a resource request. + /// + public enum ResourcePriority + { + /// + /// VeryLow + /// + [EnumMember(Value = ("VeryLow"))] + VeryLow, + /// + /// Low + /// + [EnumMember(Value = ("Low"))] + Low, + /// + /// Medium + /// + [EnumMember(Value = ("Medium"))] + Medium, + /// + /// High + /// + [EnumMember(Value = ("High"))] + High, + /// + /// VeryHigh + /// + [EnumMember(Value = ("VeryHigh"))] + VeryHigh + } + + /// + /// The render blocking behavior of a resource request. + /// + public enum RenderBlockingBehavior + { + /// + /// Blocking + /// + [EnumMember(Value = ("Blocking"))] + Blocking, + /// + /// InBodyParserBlocking + /// + [EnumMember(Value = ("InBodyParserBlocking"))] + InBodyParserBlocking, + /// + /// NonBlocking + /// + [EnumMember(Value = ("NonBlocking"))] + NonBlocking, + /// + /// NonBlockingDynamic + /// + [EnumMember(Value = ("NonBlockingDynamic"))] + NonBlockingDynamic, + /// + /// PotentiallyBlocking + /// + [EnumMember(Value = ("PotentiallyBlocking"))] + PotentiallyBlocking + } + + /// + /// Post data entry for HTTP request + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PostDataEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Bytes + /// + [DataMember(Name = ("bytes"), IsRequired = (false))] + public byte[] Bytes + { + get; + set; + } + } + + /// + /// The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/ + /// + public enum RequestReferrerPolicy + { + /// + /// unsafe-url + /// + [EnumMember(Value = ("unsafe-url"))] + UnsafeUrl, + /// + /// no-referrer-when-downgrade + /// + [EnumMember(Value = ("no-referrer-when-downgrade"))] + NoReferrerWhenDowngrade, + /// + /// no-referrer + /// + [EnumMember(Value = ("no-referrer"))] + NoReferrer, + /// + /// origin + /// + [EnumMember(Value = ("origin"))] + Origin, + /// + /// origin-when-cross-origin + /// + [EnumMember(Value = ("origin-when-cross-origin"))] + OriginWhenCrossOrigin, + /// + /// same-origin + /// + [EnumMember(Value = ("same-origin"))] + SameOrigin, + /// + /// strict-origin + /// + [EnumMember(Value = ("strict-origin"))] + StrictOrigin, + /// + /// strict-origin-when-cross-origin + /// + [EnumMember(Value = ("strict-origin-when-cross-origin"))] + StrictOriginWhenCrossOrigin + } + + /// + /// HTTP request data. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Request : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Request URL (without fragment). + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Fragment of the requested URL starting with hash, if present. + /// + [DataMember(Name = ("urlFragment"), IsRequired = (false))] + public string UrlFragment + { + get; + set; + } + + /// + /// HTTP request method. + /// + [DataMember(Name = ("method"), IsRequired = (true))] + public string Method + { + get; + set; + } + + /// + /// HTTP request headers. + /// + [DataMember(Name = ("headers"), IsRequired = (true))] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + + /// + /// HTTP POST request data. + /// Use postDataEntries instead. + /// + [DataMember(Name = ("postData"), IsRequired = (false))] + public string PostData + { + get; + set; + } + + /// + /// True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long. + /// + [DataMember(Name = ("hasPostData"), IsRequired = (false))] + public bool? HasPostData + { + get; + set; + } + + /// + /// Request body elements (post data broken into individual entries). + /// + [DataMember(Name = ("postDataEntries"), IsRequired = (false))] + public System.Collections.Generic.IList PostDataEntries + { + get; + set; + } + + /// + /// The mixed content type of the request. + /// + public CefSharp.DevTools.Security.MixedContentType? MixedContentType + { + get + { + return (CefSharp.DevTools.Security.MixedContentType? )(StringToEnum(typeof(CefSharp.DevTools.Security.MixedContentType? ), mixedContentType)); + } + + set + { + this.mixedContentType = (EnumToString(value)); + } + } + + /// + /// The mixed content type of the request. + /// + [DataMember(Name = ("mixedContentType"), IsRequired = (false))] + internal string mixedContentType + { + get; + set; + } + + /// + /// Priority of the resource request at the time request is sent. + /// + public CefSharp.DevTools.Network.ResourcePriority InitialPriority + { + get + { + return (CefSharp.DevTools.Network.ResourcePriority)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourcePriority), initialPriority)); + } + + set + { + this.initialPriority = (EnumToString(value)); + } + } + + /// + /// Priority of the resource request at the time request is sent. + /// + [DataMember(Name = ("initialPriority"), IsRequired = (true))] + internal string initialPriority + { + get; + set; + } + + /// + /// The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/ + /// + public CefSharp.DevTools.Network.RequestReferrerPolicy ReferrerPolicy + { + get + { + return (CefSharp.DevTools.Network.RequestReferrerPolicy)(StringToEnum(typeof(CefSharp.DevTools.Network.RequestReferrerPolicy), referrerPolicy)); + } + + set + { + this.referrerPolicy = (EnumToString(value)); + } + } + + /// + /// The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/ + /// + [DataMember(Name = ("referrerPolicy"), IsRequired = (true))] + internal string referrerPolicy + { + get; + set; + } + + /// + /// Whether is loaded via link preload. + /// + [DataMember(Name = ("isLinkPreload"), IsRequired = (false))] + public bool? IsLinkPreload + { + get; + set; + } + + /// + /// Set for requests when the TrustToken API is used. Contains the parameters + /// passed by the developer (e.g. via "fetch") as understood by the backend. + /// + [DataMember(Name = ("trustTokenParams"), IsRequired = (false))] + public CefSharp.DevTools.Network.TrustTokenParams TrustTokenParams + { + get; + set; + } + + /// + /// True if this resource request is considered to be the 'same site' as the + /// request corresponding to the main frame. + /// + [DataMember(Name = ("isSameSite"), IsRequired = (false))] + public bool? IsSameSite + { + get; + set; + } + + /// + /// True when the resource request is ad-related. + /// + [DataMember(Name = ("isAdRelated"), IsRequired = (false))] + public bool? IsAdRelated + { + get; + set; + } + } + + /// + /// Details of a signed certificate timestamp (SCT). + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SignedCertificateTimestamp : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Validation status. + /// + [DataMember(Name = ("status"), IsRequired = (true))] + public string Status + { + get; + set; + } + + /// + /// Origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + set; + } + + /// + /// Log name / description. + /// + [DataMember(Name = ("logDescription"), IsRequired = (true))] + public string LogDescription + { + get; + set; + } + + /// + /// Log ID. + /// + [DataMember(Name = ("logId"), IsRequired = (true))] + public string LogId + { + get; + set; + } + + /// + /// Issuance date. Unlike TimeSinceEpoch, this contains the number of + /// milliseconds since January 1, 1970, UTC, not the number of seconds. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + set; + } + + /// + /// Hash algorithm. + /// + [DataMember(Name = ("hashAlgorithm"), IsRequired = (true))] + public string HashAlgorithm + { + get; + set; + } + + /// + /// Signature algorithm. + /// + [DataMember(Name = ("signatureAlgorithm"), IsRequired = (true))] + public string SignatureAlgorithm + { + get; + set; + } + + /// + /// Signature data. + /// + [DataMember(Name = ("signatureData"), IsRequired = (true))] + public string SignatureData + { + get; + set; + } + } + + /// + /// Security details about a request. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SecurityDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Protocol name (e.g. "TLS 1.2" or "QUIC"). + /// + [DataMember(Name = ("protocol"), IsRequired = (true))] + public string Protocol + { + get; + set; + } + + /// + /// Key Exchange used by the connection, or the empty string if not applicable. + /// + [DataMember(Name = ("keyExchange"), IsRequired = (true))] + public string KeyExchange + { + get; + set; + } + + /// + /// (EC)DH group used by the connection, if applicable. + /// + [DataMember(Name = ("keyExchangeGroup"), IsRequired = (false))] + public string KeyExchangeGroup + { + get; + set; + } + + /// + /// Cipher name. + /// + [DataMember(Name = ("cipher"), IsRequired = (true))] + public string Cipher + { + get; + set; + } + + /// + /// TLS MAC. Note that AEAD ciphers do not have separate MACs. + /// + [DataMember(Name = ("mac"), IsRequired = (false))] + public string Mac + { + get; + set; + } + + /// + /// Certificate ID value. + /// + [DataMember(Name = ("certificateId"), IsRequired = (true))] + public int CertificateId + { + get; + set; + } + + /// + /// Certificate subject name. + /// + [DataMember(Name = ("subjectName"), IsRequired = (true))] + public string SubjectName + { + get; + set; + } + + /// + /// Subject Alternative Name (SAN) DNS names and IP addresses. + /// + [DataMember(Name = ("sanList"), IsRequired = (true))] + public string[] SanList + { + get; + set; + } + + /// + /// Name of the issuing CA. + /// + [DataMember(Name = ("issuer"), IsRequired = (true))] + public string Issuer + { + get; + set; + } + + /// + /// Certificate valid from date. + /// + [DataMember(Name = ("validFrom"), IsRequired = (true))] + public double ValidFrom + { + get; + set; + } + + /// + /// Certificate valid to (expiration) date + /// + [DataMember(Name = ("validTo"), IsRequired = (true))] + public double ValidTo + { + get; + set; + } + + /// + /// List of signed certificate timestamps (SCTs). + /// + [DataMember(Name = ("signedCertificateTimestampList"), IsRequired = (true))] + public System.Collections.Generic.IList SignedCertificateTimestampList + { + get; + set; + } + + /// + /// Whether the request complied with Certificate Transparency policy + /// + public CefSharp.DevTools.Network.CertificateTransparencyCompliance CertificateTransparencyCompliance + { + get + { + return (CefSharp.DevTools.Network.CertificateTransparencyCompliance)(StringToEnum(typeof(CefSharp.DevTools.Network.CertificateTransparencyCompliance), certificateTransparencyCompliance)); + } + + set + { + this.certificateTransparencyCompliance = (EnumToString(value)); + } + } + + /// + /// Whether the request complied with Certificate Transparency policy + /// + [DataMember(Name = ("certificateTransparencyCompliance"), IsRequired = (true))] + internal string certificateTransparencyCompliance + { + get; + set; + } + + /// + /// The signature algorithm used by the server in the TLS server signature, + /// represented as a TLS SignatureScheme code point. Omitted if not + /// applicable or not known. + /// + [DataMember(Name = ("serverSignatureAlgorithm"), IsRequired = (false))] + public int? ServerSignatureAlgorithm + { + get; + set; + } + + /// + /// Whether the connection used Encrypted ClientHello + /// + [DataMember(Name = ("encryptedClientHello"), IsRequired = (true))] + public bool EncryptedClientHello + { + get; + set; + } + } + + /// + /// Whether the request complied with Certificate Transparency policy. + /// + public enum CertificateTransparencyCompliance + { + /// + /// unknown + /// + [EnumMember(Value = ("unknown"))] + Unknown, + /// + /// not-compliant + /// + [EnumMember(Value = ("not-compliant"))] + NotCompliant, + /// + /// compliant + /// + [EnumMember(Value = ("compliant"))] + Compliant + } + + /// + /// The reason why request was blocked. + /// + public enum BlockedReason + { + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other, + /// + /// csp + /// + [EnumMember(Value = ("csp"))] + Csp, + /// + /// mixed-content + /// + [EnumMember(Value = ("mixed-content"))] + MixedContent, + /// + /// origin + /// + [EnumMember(Value = ("origin"))] + Origin, + /// + /// inspector + /// + [EnumMember(Value = ("inspector"))] + Inspector, + /// + /// integrity + /// + [EnumMember(Value = ("integrity"))] + Integrity, + /// + /// subresource-filter + /// + [EnumMember(Value = ("subresource-filter"))] + SubresourceFilter, + /// + /// content-type + /// + [EnumMember(Value = ("content-type"))] + ContentType, + /// + /// coep-frame-resource-needs-coep-header + /// + [EnumMember(Value = ("coep-frame-resource-needs-coep-header"))] + CoepFrameResourceNeedsCoepHeader, + /// + /// coop-sandboxed-iframe-cannot-navigate-to-coop-page + /// + [EnumMember(Value = ("coop-sandboxed-iframe-cannot-navigate-to-coop-page"))] + CoopSandboxedIframeCannotNavigateToCoopPage, + /// + /// corp-not-same-origin + /// + [EnumMember(Value = ("corp-not-same-origin"))] + CorpNotSameOrigin, + /// + /// corp-not-same-origin-after-defaulted-to-same-origin-by-coep + /// + [EnumMember(Value = ("corp-not-same-origin-after-defaulted-to-same-origin-by-coep"))] + CorpNotSameOriginAfterDefaultedToSameOriginByCoep, + /// + /// corp-not-same-origin-after-defaulted-to-same-origin-by-dip + /// + [EnumMember(Value = ("corp-not-same-origin-after-defaulted-to-same-origin-by-dip"))] + CorpNotSameOriginAfterDefaultedToSameOriginByDip, + /// + /// corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip + /// + [EnumMember(Value = ("corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip"))] + CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip, + /// + /// corp-not-same-site + /// + [EnumMember(Value = ("corp-not-same-site"))] + CorpNotSameSite, + /// + /// sri-message-signature-mismatch + /// + [EnumMember(Value = ("sri-message-signature-mismatch"))] + SriMessageSignatureMismatch + } + + /// + /// The reason why request was blocked. + /// + public enum CorsError + { + /// + /// DisallowedByMode + /// + [EnumMember(Value = ("DisallowedByMode"))] + DisallowedByMode, + /// + /// InvalidResponse + /// + [EnumMember(Value = ("InvalidResponse"))] + InvalidResponse, + /// + /// WildcardOriginNotAllowed + /// + [EnumMember(Value = ("WildcardOriginNotAllowed"))] + WildcardOriginNotAllowed, + /// + /// MissingAllowOriginHeader + /// + [EnumMember(Value = ("MissingAllowOriginHeader"))] + MissingAllowOriginHeader, + /// + /// MultipleAllowOriginValues + /// + [EnumMember(Value = ("MultipleAllowOriginValues"))] + MultipleAllowOriginValues, + /// + /// InvalidAllowOriginValue + /// + [EnumMember(Value = ("InvalidAllowOriginValue"))] + InvalidAllowOriginValue, + /// + /// AllowOriginMismatch + /// + [EnumMember(Value = ("AllowOriginMismatch"))] + AllowOriginMismatch, + /// + /// InvalidAllowCredentials + /// + [EnumMember(Value = ("InvalidAllowCredentials"))] + InvalidAllowCredentials, + /// + /// CorsDisabledScheme + /// + [EnumMember(Value = ("CorsDisabledScheme"))] + CorsDisabledScheme, + /// + /// PreflightInvalidStatus + /// + [EnumMember(Value = ("PreflightInvalidStatus"))] + PreflightInvalidStatus, + /// + /// PreflightDisallowedRedirect + /// + [EnumMember(Value = ("PreflightDisallowedRedirect"))] + PreflightDisallowedRedirect, + /// + /// PreflightWildcardOriginNotAllowed + /// + [EnumMember(Value = ("PreflightWildcardOriginNotAllowed"))] + PreflightWildcardOriginNotAllowed, + /// + /// PreflightMissingAllowOriginHeader + /// + [EnumMember(Value = ("PreflightMissingAllowOriginHeader"))] + PreflightMissingAllowOriginHeader, + /// + /// PreflightMultipleAllowOriginValues + /// + [EnumMember(Value = ("PreflightMultipleAllowOriginValues"))] + PreflightMultipleAllowOriginValues, + /// + /// PreflightInvalidAllowOriginValue + /// + [EnumMember(Value = ("PreflightInvalidAllowOriginValue"))] + PreflightInvalidAllowOriginValue, + /// + /// PreflightAllowOriginMismatch + /// + [EnumMember(Value = ("PreflightAllowOriginMismatch"))] + PreflightAllowOriginMismatch, + /// + /// PreflightInvalidAllowCredentials + /// + [EnumMember(Value = ("PreflightInvalidAllowCredentials"))] + PreflightInvalidAllowCredentials, + /// + /// PreflightMissingAllowExternal + /// + [EnumMember(Value = ("PreflightMissingAllowExternal"))] + PreflightMissingAllowExternal, + /// + /// PreflightInvalidAllowExternal + /// + [EnumMember(Value = ("PreflightInvalidAllowExternal"))] + PreflightInvalidAllowExternal, + /// + /// InvalidAllowMethodsPreflightResponse + /// + [EnumMember(Value = ("InvalidAllowMethodsPreflightResponse"))] + InvalidAllowMethodsPreflightResponse, + /// + /// InvalidAllowHeadersPreflightResponse + /// + [EnumMember(Value = ("InvalidAllowHeadersPreflightResponse"))] + InvalidAllowHeadersPreflightResponse, + /// + /// MethodDisallowedByPreflightResponse + /// + [EnumMember(Value = ("MethodDisallowedByPreflightResponse"))] + MethodDisallowedByPreflightResponse, + /// + /// HeaderDisallowedByPreflightResponse + /// + [EnumMember(Value = ("HeaderDisallowedByPreflightResponse"))] + HeaderDisallowedByPreflightResponse, + /// + /// RedirectContainsCredentials + /// + [EnumMember(Value = ("RedirectContainsCredentials"))] + RedirectContainsCredentials, + /// + /// InsecureLocalNetwork + /// + [EnumMember(Value = ("InsecureLocalNetwork"))] + InsecureLocalNetwork, + /// + /// InvalidLocalNetworkAccess + /// + [EnumMember(Value = ("InvalidLocalNetworkAccess"))] + InvalidLocalNetworkAccess, + /// + /// NoCorsRedirectModeNotFollow + /// + [EnumMember(Value = ("NoCorsRedirectModeNotFollow"))] + NoCorsRedirectModeNotFollow, + /// + /// LocalNetworkAccessPermissionDenied + /// + [EnumMember(Value = ("LocalNetworkAccessPermissionDenied"))] + LocalNetworkAccessPermissionDenied + } + + /// + /// CorsErrorStatus + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CorsErrorStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CorsError + /// + public CefSharp.DevTools.Network.CorsError CorsError + { + get + { + return (CefSharp.DevTools.Network.CorsError)(StringToEnum(typeof(CefSharp.DevTools.Network.CorsError), corsError)); + } + + set + { + this.corsError = (EnumToString(value)); + } + } + + /// + /// CorsError + /// + [DataMember(Name = ("corsError"), IsRequired = (true))] + internal string corsError + { + get; + set; + } + + /// + /// FailedParameter + /// + [DataMember(Name = ("failedParameter"), IsRequired = (true))] + public string FailedParameter + { + get; + set; + } + } + + /// + /// Source of serviceworker response. + /// + public enum ServiceWorkerResponseSource + { + /// + /// cache-storage + /// + [EnumMember(Value = ("cache-storage"))] + CacheStorage, + /// + /// http-cache + /// + [EnumMember(Value = ("http-cache"))] + HttpCache, + /// + /// fallback-code + /// + [EnumMember(Value = ("fallback-code"))] + FallbackCode, + /// + /// network + /// + [EnumMember(Value = ("network"))] + Network + } + + /// + /// Only set for "token-redemption" operation and determine whether + /// to request a fresh SRR or use a still valid cached SRR. + /// + public enum TrustTokenParamsRefreshPolicy + { + /// + /// UseCached + /// + [EnumMember(Value = ("UseCached"))] + UseCached, + /// + /// Refresh + /// + [EnumMember(Value = ("Refresh"))] + Refresh + } + + /// + /// Determines what type of Trust Token operation is executed and + /// depending on the type, some additional parameters. The values + /// are specified in third_party/blink/renderer/core/fetch/trust_token.idl. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class TrustTokenParams : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Operation + /// + public CefSharp.DevTools.Network.TrustTokenOperationType Operation + { + get + { + return (CefSharp.DevTools.Network.TrustTokenOperationType)(StringToEnum(typeof(CefSharp.DevTools.Network.TrustTokenOperationType), operation)); + } + + set + { + this.operation = (EnumToString(value)); + } + } + + /// + /// Operation + /// + [DataMember(Name = ("operation"), IsRequired = (true))] + internal string operation + { + get; + set; + } + + /// + /// Only set for "token-redemption" operation and determine whether + /// to request a fresh SRR or use a still valid cached SRR. + /// + public CefSharp.DevTools.Network.TrustTokenParamsRefreshPolicy RefreshPolicy + { + get + { + return (CefSharp.DevTools.Network.TrustTokenParamsRefreshPolicy)(StringToEnum(typeof(CefSharp.DevTools.Network.TrustTokenParamsRefreshPolicy), refreshPolicy)); + } + + set + { + this.refreshPolicy = (EnumToString(value)); + } + } + + /// + /// Only set for "token-redemption" operation and determine whether + /// to request a fresh SRR or use a still valid cached SRR. + /// + [DataMember(Name = ("refreshPolicy"), IsRequired = (true))] + internal string refreshPolicy + { + get; + set; + } + + /// + /// Origins of issuers from whom to request tokens or redemption + /// records. + /// + [DataMember(Name = ("issuers"), IsRequired = (false))] + public string[] Issuers + { + get; + set; + } + } + + /// + /// TrustTokenOperationType + /// + public enum TrustTokenOperationType + { + /// + /// Issuance + /// + [EnumMember(Value = ("Issuance"))] + Issuance, + /// + /// Redemption + /// + [EnumMember(Value = ("Redemption"))] + Redemption, + /// + /// Signing + /// + [EnumMember(Value = ("Signing"))] + Signing + } + + /// + /// The reason why Chrome uses a specific transport protocol for HTTP semantics. + /// + public enum AlternateProtocolUsage + { + /// + /// alternativeJobWonWithoutRace + /// + [EnumMember(Value = ("alternativeJobWonWithoutRace"))] + AlternativeJobWonWithoutRace, + /// + /// alternativeJobWonRace + /// + [EnumMember(Value = ("alternativeJobWonRace"))] + AlternativeJobWonRace, + /// + /// mainJobWonRace + /// + [EnumMember(Value = ("mainJobWonRace"))] + MainJobWonRace, + /// + /// mappingMissing + /// + [EnumMember(Value = ("mappingMissing"))] + MappingMissing, + /// + /// broken + /// + [EnumMember(Value = ("broken"))] + Broken, + /// + /// dnsAlpnH3JobWonWithoutRace + /// + [EnumMember(Value = ("dnsAlpnH3JobWonWithoutRace"))] + DnsAlpnH3JobWonWithoutRace, + /// + /// dnsAlpnH3JobWonRace + /// + [EnumMember(Value = ("dnsAlpnH3JobWonRace"))] + DnsAlpnH3JobWonRace, + /// + /// unspecifiedReason + /// + [EnumMember(Value = ("unspecifiedReason"))] + UnspecifiedReason + } + + /// + /// Source of service worker router. + /// + public enum ServiceWorkerRouterSource + { + /// + /// network + /// + [EnumMember(Value = ("network"))] + Network, + /// + /// cache + /// + [EnumMember(Value = ("cache"))] + Cache, + /// + /// fetch-event + /// + [EnumMember(Value = ("fetch-event"))] + FetchEvent, + /// + /// race-network-and-fetch-handler + /// + [EnumMember(Value = ("race-network-and-fetch-handler"))] + RaceNetworkAndFetchHandler, + /// + /// race-network-and-cache + /// + [EnumMember(Value = ("race-network-and-cache"))] + RaceNetworkAndCache + } + + /// + /// ServiceWorkerRouterInfo + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ServiceWorkerRouterInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ID of the rule matched. If there is a matched rule, this field will + /// be set, otherwiser no value will be set. + /// + [DataMember(Name = ("ruleIdMatched"), IsRequired = (false))] + public int? RuleIdMatched + { + get; + set; + } + + /// + /// The router source of the matched rule. If there is a matched rule, this + /// field will be set, otherwise no value will be set. + /// + public CefSharp.DevTools.Network.ServiceWorkerRouterSource? MatchedSourceType + { + get + { + return (CefSharp.DevTools.Network.ServiceWorkerRouterSource? )(StringToEnum(typeof(CefSharp.DevTools.Network.ServiceWorkerRouterSource? ), matchedSourceType)); + } + + set + { + this.matchedSourceType = (EnumToString(value)); + } + } + + /// + /// The router source of the matched rule. If there is a matched rule, this + /// field will be set, otherwise no value will be set. + /// + [DataMember(Name = ("matchedSourceType"), IsRequired = (false))] + internal string matchedSourceType + { + get; + set; + } + + /// + /// The actual router source used. + /// + public CefSharp.DevTools.Network.ServiceWorkerRouterSource? ActualSourceType + { + get + { + return (CefSharp.DevTools.Network.ServiceWorkerRouterSource? )(StringToEnum(typeof(CefSharp.DevTools.Network.ServiceWorkerRouterSource? ), actualSourceType)); + } + + set + { + this.actualSourceType = (EnumToString(value)); + } + } + + /// + /// The actual router source used. + /// + [DataMember(Name = ("actualSourceType"), IsRequired = (false))] + internal string actualSourceType + { + get; + set; + } + } + + /// + /// HTTP response data. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Response : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Response URL. This URL can be different from CachedResource.url in case of redirect. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// HTTP response status code. + /// + [DataMember(Name = ("status"), IsRequired = (true))] + public int Status + { + get; + set; + } + + /// + /// HTTP response status text. + /// + [DataMember(Name = ("statusText"), IsRequired = (true))] + public string StatusText + { + get; + set; + } + + /// + /// HTTP response headers. + /// + [DataMember(Name = ("headers"), IsRequired = (true))] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + + /// + /// HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo. + /// + [DataMember(Name = ("headersText"), IsRequired = (false))] + public string HeadersText + { + get; + set; + } + + /// + /// Resource mimeType as determined by the browser. + /// + [DataMember(Name = ("mimeType"), IsRequired = (true))] + public string MimeType + { + get; + set; + } + + /// + /// Resource charset as determined by the browser (if applicable). + /// + [DataMember(Name = ("charset"), IsRequired = (true))] + public string Charset + { + get; + set; + } + + /// + /// Refined HTTP request headers that were actually transmitted over the network. + /// + [DataMember(Name = ("requestHeaders"), IsRequired = (false))] + public CefSharp.DevTools.Network.Headers RequestHeaders + { + get; + set; + } + + /// + /// HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo. + /// + [DataMember(Name = ("requestHeadersText"), IsRequired = (false))] + public string RequestHeadersText + { + get; + set; + } + + /// + /// Specifies whether physical connection was actually reused for this request. + /// + [DataMember(Name = ("connectionReused"), IsRequired = (true))] + public bool ConnectionReused + { + get; + set; + } + + /// + /// Physical connection id that was actually used for this request. + /// + [DataMember(Name = ("connectionId"), IsRequired = (true))] + public double ConnectionId + { + get; + set; + } + + /// + /// Remote IP address. + /// + [DataMember(Name = ("remoteIPAddress"), IsRequired = (false))] + public string RemoteIPAddress + { + get; + set; + } + + /// + /// Remote port. + /// + [DataMember(Name = ("remotePort"), IsRequired = (false))] + public int? RemotePort + { + get; + set; + } + + /// + /// Specifies that the request was served from the disk cache. + /// + [DataMember(Name = ("fromDiskCache"), IsRequired = (false))] + public bool? FromDiskCache + { + get; + set; + } + + /// + /// Specifies that the request was served from the ServiceWorker. + /// + [DataMember(Name = ("fromServiceWorker"), IsRequired = (false))] + public bool? FromServiceWorker + { + get; + set; + } + + /// + /// Specifies that the request was served from the prefetch cache. + /// + [DataMember(Name = ("fromPrefetchCache"), IsRequired = (false))] + public bool? FromPrefetchCache + { + get; + set; + } + + /// + /// Specifies that the request was served from the prefetch cache. + /// + [DataMember(Name = ("fromEarlyHints"), IsRequired = (false))] + public bool? FromEarlyHints + { + get; + set; + } + + /// + /// Information about how ServiceWorker Static Router API was used. If this + /// field is set with `matchedSourceType` field, a matching rule is found. + /// If this field is set without `matchedSource`, no matching rule is found. + /// Otherwise, the API is not used. + /// + [DataMember(Name = ("serviceWorkerRouterInfo"), IsRequired = (false))] + public CefSharp.DevTools.Network.ServiceWorkerRouterInfo ServiceWorkerRouterInfo + { + get; + set; + } + + /// + /// Total number of bytes received for this request so far. + /// + [DataMember(Name = ("encodedDataLength"), IsRequired = (true))] + public double EncodedDataLength + { + get; + set; + } + + /// + /// Timing information for the given request. + /// + [DataMember(Name = ("timing"), IsRequired = (false))] + public CefSharp.DevTools.Network.ResourceTiming Timing + { + get; + set; + } + + /// + /// Response source of response from ServiceWorker. + /// + public CefSharp.DevTools.Network.ServiceWorkerResponseSource? ServiceWorkerResponseSource + { + get + { + return (CefSharp.DevTools.Network.ServiceWorkerResponseSource? )(StringToEnum(typeof(CefSharp.DevTools.Network.ServiceWorkerResponseSource? ), serviceWorkerResponseSource)); + } + + set + { + this.serviceWorkerResponseSource = (EnumToString(value)); + } + } + + /// + /// Response source of response from ServiceWorker. + /// + [DataMember(Name = ("serviceWorkerResponseSource"), IsRequired = (false))] + internal string serviceWorkerResponseSource + { + get; + set; + } + + /// + /// The time at which the returned response was generated. + /// + [DataMember(Name = ("responseTime"), IsRequired = (false))] + public double? ResponseTime + { + get; + set; + } + + /// + /// Cache Storage Cache Name. + /// + [DataMember(Name = ("cacheStorageCacheName"), IsRequired = (false))] + public string CacheStorageCacheName + { + get; + set; + } + + /// + /// Protocol used to fetch this request. + /// + [DataMember(Name = ("protocol"), IsRequired = (false))] + public string Protocol + { + get; + set; + } + + /// + /// The reason why Chrome uses a specific transport protocol for HTTP semantics. + /// + public CefSharp.DevTools.Network.AlternateProtocolUsage? AlternateProtocolUsage + { + get + { + return (CefSharp.DevTools.Network.AlternateProtocolUsage? )(StringToEnum(typeof(CefSharp.DevTools.Network.AlternateProtocolUsage? ), alternateProtocolUsage)); + } + + set + { + this.alternateProtocolUsage = (EnumToString(value)); + } + } + + /// + /// The reason why Chrome uses a specific transport protocol for HTTP semantics. + /// + [DataMember(Name = ("alternateProtocolUsage"), IsRequired = (false))] + internal string alternateProtocolUsage + { + get; + set; + } + + /// + /// Security state of the request resource. + /// + public CefSharp.DevTools.Security.SecurityState SecurityState + { + get + { + return (CefSharp.DevTools.Security.SecurityState)(StringToEnum(typeof(CefSharp.DevTools.Security.SecurityState), securityState)); + } + + set + { + this.securityState = (EnumToString(value)); + } + } + + /// + /// Security state of the request resource. + /// + [DataMember(Name = ("securityState"), IsRequired = (true))] + internal string securityState + { + get; + set; + } + + /// + /// Security details for the request. + /// + [DataMember(Name = ("securityDetails"), IsRequired = (false))] + public CefSharp.DevTools.Network.SecurityDetails SecurityDetails + { + get; + set; + } + } + + /// + /// WebSocket request data. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class WebSocketRequest : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// HTTP request headers. + /// + [DataMember(Name = ("headers"), IsRequired = (true))] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + } + + /// + /// WebSocket response data. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class WebSocketResponse : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// HTTP response status code. + /// + [DataMember(Name = ("status"), IsRequired = (true))] + public int Status + { + get; + set; + } + + /// + /// HTTP response status text. + /// + [DataMember(Name = ("statusText"), IsRequired = (true))] + public string StatusText + { + get; + set; + } + + /// + /// HTTP response headers. + /// + [DataMember(Name = ("headers"), IsRequired = (true))] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + + /// + /// HTTP response headers text. + /// + [DataMember(Name = ("headersText"), IsRequired = (false))] + public string HeadersText + { + get; + set; + } + + /// + /// HTTP request headers. + /// + [DataMember(Name = ("requestHeaders"), IsRequired = (false))] + public CefSharp.DevTools.Network.Headers RequestHeaders + { + get; + set; + } + + /// + /// HTTP request headers text. + /// + [DataMember(Name = ("requestHeadersText"), IsRequired = (false))] + public string RequestHeadersText + { + get; + set; + } + } + + /// + /// WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class WebSocketFrame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// WebSocket message opcode. + /// + [DataMember(Name = ("opcode"), IsRequired = (true))] + public double Opcode + { + get; + set; + } + + /// + /// WebSocket message mask. + /// + [DataMember(Name = ("mask"), IsRequired = (true))] + public bool Mask + { + get; + set; + } + + /// + /// WebSocket message payload data. + /// If the opcode is 1, this is a text message and payloadData is a UTF-8 string. + /// If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data. + /// + [DataMember(Name = ("payloadData"), IsRequired = (true))] + public string PayloadData + { + get; + set; + } + } + + /// + /// Information about the cached resource. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CachedResource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Resource URL. This is the url of the original network request. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Type of this resource. + /// + public CefSharp.DevTools.Network.ResourceType Type + { + get + { + return (CefSharp.DevTools.Network.ResourceType)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type of this resource. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Cached response data. + /// + [DataMember(Name = ("response"), IsRequired = (false))] + public CefSharp.DevTools.Network.Response Response + { + get; + set; + } + + /// + /// Cached response body size. + /// + [DataMember(Name = ("bodySize"), IsRequired = (true))] + public double BodySize + { + get; + set; + } + } + + /// + /// Type of this initiator. + /// + public enum InitiatorType + { + /// + /// parser + /// + [EnumMember(Value = ("parser"))] + Parser, + /// + /// script + /// + [EnumMember(Value = ("script"))] + Script, + /// + /// preload + /// + [EnumMember(Value = ("preload"))] + Preload, + /// + /// SignedExchange + /// + [EnumMember(Value = ("SignedExchange"))] + SignedExchange, + /// + /// preflight + /// + [EnumMember(Value = ("preflight"))] + Preflight, + /// + /// FedCM + /// + [EnumMember(Value = ("FedCM"))] + FedCM, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other + } + + /// + /// Information about the request initiator. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Initiator : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type of this initiator. + /// + public CefSharp.DevTools.Network.InitiatorType Type + { + get + { + return (CefSharp.DevTools.Network.InitiatorType)(StringToEnum(typeof(CefSharp.DevTools.Network.InitiatorType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type of this initiator. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Initiator JavaScript stack trace, set for Script only. + /// Requires the Debugger domain to be enabled. + /// + [DataMember(Name = ("stack"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace Stack + { + get; + set; + } + + /// + /// Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type. + /// + [DataMember(Name = ("url"), IsRequired = (false))] + public string Url + { + get; + set; + } + + /// + /// Initiator line number, set for Parser type or for Script type (when script is importing + /// module) (0-based). + /// + [DataMember(Name = ("lineNumber"), IsRequired = (false))] + public double? LineNumber + { + get; + set; + } + + /// + /// Initiator column number, set for Parser type or for Script type (when script is importing + /// module) (0-based). + /// + [DataMember(Name = ("columnNumber"), IsRequired = (false))] + public double? ColumnNumber + { + get; + set; + } + + /// + /// Set if another request triggered this request (e.g. preflight). + /// + [DataMember(Name = ("requestId"), IsRequired = (false))] + public string RequestId + { + get; + set; + } + } + + /// + /// cookiePartitionKey object + /// The representation of the components of the key that are created by the cookiePartitionKey class contained in net/cookies/cookie_partition_key.h. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CookiePartitionKey : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The site of the top-level URL the browser was visiting at the start + /// of the request to the endpoint that set the cookie. + /// + [DataMember(Name = ("topLevelSite"), IsRequired = (true))] + public string TopLevelSite + { + get; + set; + } + + /// + /// Indicates if the cookie has any ancestors that are cross-site to the topLevelSite. + /// + [DataMember(Name = ("hasCrossSiteAncestor"), IsRequired = (true))] + public bool HasCrossSiteAncestor + { + get; + set; + } + } + + /// + /// Cookie object + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Cookie : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Cookie name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Cookie value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + + /// + /// Cookie domain. + /// + [DataMember(Name = ("domain"), IsRequired = (true))] + public string Domain + { + get; + set; + } + + /// + /// Cookie path. + /// + [DataMember(Name = ("path"), IsRequired = (true))] + public string Path + { + get; + set; + } + + /// + /// Cookie expiration date as the number of seconds since the UNIX epoch. + /// The value is set to -1 if the expiry date is not set. + /// The value can be null for values that cannot be represented in + /// JSON (±Inf). + /// + [DataMember(Name = ("expires"), IsRequired = (true))] + public double Expires + { + get; + set; + } + + /// + /// Cookie size. + /// + [DataMember(Name = ("size"), IsRequired = (true))] + public int Size + { + get; + set; + } + + /// + /// True if cookie is http-only. + /// + [DataMember(Name = ("httpOnly"), IsRequired = (true))] + public bool HttpOnly + { + get; + set; + } + + /// + /// True if cookie is secure. + /// + [DataMember(Name = ("secure"), IsRequired = (true))] + public bool Secure + { + get; + set; + } + + /// + /// True in case of session cookie. + /// + [DataMember(Name = ("session"), IsRequired = (true))] + public bool Session + { + get; + set; + } + + /// + /// Cookie SameSite type. + /// + public CefSharp.DevTools.Network.CookieSameSite? SameSite + { + get + { + return (CefSharp.DevTools.Network.CookieSameSite? )(StringToEnum(typeof(CefSharp.DevTools.Network.CookieSameSite? ), sameSite)); + } + + set + { + this.sameSite = (EnumToString(value)); + } + } + + /// + /// Cookie SameSite type. + /// + [DataMember(Name = ("sameSite"), IsRequired = (false))] + internal string sameSite + { + get; + set; + } + + /// + /// Cookie Priority + /// + public CefSharp.DevTools.Network.CookiePriority Priority + { + get + { + return (CefSharp.DevTools.Network.CookiePriority)(StringToEnum(typeof(CefSharp.DevTools.Network.CookiePriority), priority)); + } + + set + { + this.priority = (EnumToString(value)); + } + } + + /// + /// Cookie Priority + /// + [DataMember(Name = ("priority"), IsRequired = (true))] + internal string priority + { + get; + set; + } + + /// + /// Cookie source scheme type. + /// + public CefSharp.DevTools.Network.CookieSourceScheme SourceScheme + { + get + { + return (CefSharp.DevTools.Network.CookieSourceScheme)(StringToEnum(typeof(CefSharp.DevTools.Network.CookieSourceScheme), sourceScheme)); + } + + set + { + this.sourceScheme = (EnumToString(value)); + } + } + + /// + /// Cookie source scheme type. + /// + [DataMember(Name = ("sourceScheme"), IsRequired = (true))] + internal string sourceScheme + { + get; + set; + } + + /// + /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. + /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. + /// This is a temporary ability and it will be removed in the future. + /// + [DataMember(Name = ("sourcePort"), IsRequired = (true))] + public int SourcePort + { + get; + set; + } + + /// + /// Cookie partition key. + /// + [DataMember(Name = ("partitionKey"), IsRequired = (false))] + public CefSharp.DevTools.Network.CookiePartitionKey PartitionKey + { + get; + set; + } + + /// + /// True if cookie partition key is opaque. + /// + [DataMember(Name = ("partitionKeyOpaque"), IsRequired = (false))] + public bool? PartitionKeyOpaque + { + get; + set; + } + } + + /// + /// Types of reasons why a cookie may not be stored from a response. + /// + public enum SetCookieBlockedReason + { + /// + /// SecureOnly + /// + [EnumMember(Value = ("SecureOnly"))] + SecureOnly, + /// + /// SameSiteStrict + /// + [EnumMember(Value = ("SameSiteStrict"))] + SameSiteStrict, + /// + /// SameSiteLax + /// + [EnumMember(Value = ("SameSiteLax"))] + SameSiteLax, + /// + /// SameSiteUnspecifiedTreatedAsLax + /// + [EnumMember(Value = ("SameSiteUnspecifiedTreatedAsLax"))] + SameSiteUnspecifiedTreatedAsLax, + /// + /// SameSiteNoneInsecure + /// + [EnumMember(Value = ("SameSiteNoneInsecure"))] + SameSiteNoneInsecure, + /// + /// UserPreferences + /// + [EnumMember(Value = ("UserPreferences"))] + UserPreferences, + /// + /// ThirdPartyPhaseout + /// + [EnumMember(Value = ("ThirdPartyPhaseout"))] + ThirdPartyPhaseout, + /// + /// ThirdPartyBlockedInFirstPartySet + /// + [EnumMember(Value = ("ThirdPartyBlockedInFirstPartySet"))] + ThirdPartyBlockedInFirstPartySet, + /// + /// SyntaxError + /// + [EnumMember(Value = ("SyntaxError"))] + SyntaxError, + /// + /// SchemeNotSupported + /// + [EnumMember(Value = ("SchemeNotSupported"))] + SchemeNotSupported, + /// + /// OverwriteSecure + /// + [EnumMember(Value = ("OverwriteSecure"))] + OverwriteSecure, + /// + /// InvalidDomain + /// + [EnumMember(Value = ("InvalidDomain"))] + InvalidDomain, + /// + /// InvalidPrefix + /// + [EnumMember(Value = ("InvalidPrefix"))] + InvalidPrefix, + /// + /// UnknownError + /// + [EnumMember(Value = ("UnknownError"))] + UnknownError, + /// + /// SchemefulSameSiteStrict + /// + [EnumMember(Value = ("SchemefulSameSiteStrict"))] + SchemefulSameSiteStrict, + /// + /// SchemefulSameSiteLax + /// + [EnumMember(Value = ("SchemefulSameSiteLax"))] + SchemefulSameSiteLax, + /// + /// SchemefulSameSiteUnspecifiedTreatedAsLax + /// + [EnumMember(Value = ("SchemefulSameSiteUnspecifiedTreatedAsLax"))] + SchemefulSameSiteUnspecifiedTreatedAsLax, + /// + /// NameValuePairExceedsMaxSize + /// + [EnumMember(Value = ("NameValuePairExceedsMaxSize"))] + NameValuePairExceedsMaxSize, + /// + /// DisallowedCharacter + /// + [EnumMember(Value = ("DisallowedCharacter"))] + DisallowedCharacter, + /// + /// NoCookieContent + /// + [EnumMember(Value = ("NoCookieContent"))] + NoCookieContent + } + + /// + /// Types of reasons why a cookie may not be sent with a request. + /// + public enum CookieBlockedReason + { + /// + /// SecureOnly + /// + [EnumMember(Value = ("SecureOnly"))] + SecureOnly, + /// + /// NotOnPath + /// + [EnumMember(Value = ("NotOnPath"))] + NotOnPath, + /// + /// DomainMismatch + /// + [EnumMember(Value = ("DomainMismatch"))] + DomainMismatch, + /// + /// SameSiteStrict + /// + [EnumMember(Value = ("SameSiteStrict"))] + SameSiteStrict, + /// + /// SameSiteLax + /// + [EnumMember(Value = ("SameSiteLax"))] + SameSiteLax, + /// + /// SameSiteUnspecifiedTreatedAsLax + /// + [EnumMember(Value = ("SameSiteUnspecifiedTreatedAsLax"))] + SameSiteUnspecifiedTreatedAsLax, + /// + /// SameSiteNoneInsecure + /// + [EnumMember(Value = ("SameSiteNoneInsecure"))] + SameSiteNoneInsecure, + /// + /// UserPreferences + /// + [EnumMember(Value = ("UserPreferences"))] + UserPreferences, + /// + /// ThirdPartyPhaseout + /// + [EnumMember(Value = ("ThirdPartyPhaseout"))] + ThirdPartyPhaseout, + /// + /// ThirdPartyBlockedInFirstPartySet + /// + [EnumMember(Value = ("ThirdPartyBlockedInFirstPartySet"))] + ThirdPartyBlockedInFirstPartySet, + /// + /// UnknownError + /// + [EnumMember(Value = ("UnknownError"))] + UnknownError, + /// + /// SchemefulSameSiteStrict + /// + [EnumMember(Value = ("SchemefulSameSiteStrict"))] + SchemefulSameSiteStrict, + /// + /// SchemefulSameSiteLax + /// + [EnumMember(Value = ("SchemefulSameSiteLax"))] + SchemefulSameSiteLax, + /// + /// SchemefulSameSiteUnspecifiedTreatedAsLax + /// + [EnumMember(Value = ("SchemefulSameSiteUnspecifiedTreatedAsLax"))] + SchemefulSameSiteUnspecifiedTreatedAsLax, + /// + /// NameValuePairExceedsMaxSize + /// + [EnumMember(Value = ("NameValuePairExceedsMaxSize"))] + NameValuePairExceedsMaxSize, + /// + /// PortMismatch + /// + [EnumMember(Value = ("PortMismatch"))] + PortMismatch, + /// + /// SchemeMismatch + /// + [EnumMember(Value = ("SchemeMismatch"))] + SchemeMismatch, + /// + /// AnonymousContext + /// + [EnumMember(Value = ("AnonymousContext"))] + AnonymousContext + } + + /// + /// Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request. + /// + public enum CookieExemptionReason + { + /// + /// None + /// + [EnumMember(Value = ("None"))] + None, + /// + /// UserSetting + /// + [EnumMember(Value = ("UserSetting"))] + UserSetting, + /// + /// TPCDMetadata + /// + [EnumMember(Value = ("TPCDMetadata"))] + TPCDMetadata, + /// + /// TPCDDeprecationTrial + /// + [EnumMember(Value = ("TPCDDeprecationTrial"))] + TPCDDeprecationTrial, + /// + /// TopLevelTPCDDeprecationTrial + /// + [EnumMember(Value = ("TopLevelTPCDDeprecationTrial"))] + TopLevelTPCDDeprecationTrial, + /// + /// TPCDHeuristics + /// + [EnumMember(Value = ("TPCDHeuristics"))] + TPCDHeuristics, + /// + /// EnterprisePolicy + /// + [EnumMember(Value = ("EnterprisePolicy"))] + EnterprisePolicy, + /// + /// StorageAccess + /// + [EnumMember(Value = ("StorageAccess"))] + StorageAccess, + /// + /// TopLevelStorageAccess + /// + [EnumMember(Value = ("TopLevelStorageAccess"))] + TopLevelStorageAccess, + /// + /// Scheme + /// + [EnumMember(Value = ("Scheme"))] + Scheme, + /// + /// SameSiteNoneCookiesInSandbox + /// + [EnumMember(Value = ("SameSiteNoneCookiesInSandbox"))] + SameSiteNoneCookiesInSandbox + } + + /// + /// A cookie which was not stored from a response with the corresponding reason. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BlockedSetCookieWithReason : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The reason(s) this cookie was blocked. + /// + public CefSharp.DevTools.Network.SetCookieBlockedReason[] BlockedReasons + { + get + { + return (CefSharp.DevTools.Network.SetCookieBlockedReason[])(StringToEnum(typeof(CefSharp.DevTools.Network.SetCookieBlockedReason[]), blockedReasons)); + } + + set + { + this.blockedReasons = (EnumToString(value)); + } + } + + /// + /// The reason(s) this cookie was blocked. + /// + [DataMember(Name = ("blockedReasons"), IsRequired = (true))] + internal string blockedReasons + { + get; + set; + } + + /// + /// The string representing this individual cookie as it would appear in the header. + /// This is not the entire "cookie" or "set-cookie" header which could have multiple cookies. + /// + [DataMember(Name = ("cookieLine"), IsRequired = (true))] + public string CookieLine + { + get; + set; + } + + /// + /// The cookie object which represents the cookie which was not stored. It is optional because + /// sometimes complete cookie information is not available, such as in the case of parsing + /// errors. + /// + [DataMember(Name = ("cookie"), IsRequired = (false))] + public CefSharp.DevTools.Network.Cookie Cookie + { + get; + set; + } + } + + /// + /// A cookie should have been blocked by 3PCD but is exempted and stored from a response with the + /// corresponding reason. A cookie could only have at most one exemption reason. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ExemptedSetCookieWithReason : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The reason the cookie was exempted. + /// + public CefSharp.DevTools.Network.CookieExemptionReason ExemptionReason + { + get + { + return (CefSharp.DevTools.Network.CookieExemptionReason)(StringToEnum(typeof(CefSharp.DevTools.Network.CookieExemptionReason), exemptionReason)); + } + + set + { + this.exemptionReason = (EnumToString(value)); + } + } + + /// + /// The reason the cookie was exempted. + /// + [DataMember(Name = ("exemptionReason"), IsRequired = (true))] + internal string exemptionReason + { + get; + set; + } + + /// + /// The string representing this individual cookie as it would appear in the header. + /// + [DataMember(Name = ("cookieLine"), IsRequired = (true))] + public string CookieLine + { + get; + set; + } + + /// + /// The cookie object representing the cookie. + /// + [DataMember(Name = ("cookie"), IsRequired = (true))] + public CefSharp.DevTools.Network.Cookie Cookie + { + get; + set; + } + } + + /// + /// A cookie associated with the request which may or may not be sent with it. + /// Includes the cookies itself and reasons for blocking or exemption. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AssociatedCookie : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The cookie object representing the cookie which was not sent. + /// + [DataMember(Name = ("cookie"), IsRequired = (true))] + public CefSharp.DevTools.Network.Cookie Cookie + { + get; + set; + } + + /// + /// The reason(s) the cookie was blocked. If empty means the cookie is included. + /// + public CefSharp.DevTools.Network.CookieBlockedReason[] BlockedReasons + { + get + { + return (CefSharp.DevTools.Network.CookieBlockedReason[])(StringToEnum(typeof(CefSharp.DevTools.Network.CookieBlockedReason[]), blockedReasons)); + } + + set + { + this.blockedReasons = (EnumToString(value)); + } + } + + /// + /// The reason(s) the cookie was blocked. If empty means the cookie is included. + /// + [DataMember(Name = ("blockedReasons"), IsRequired = (true))] + internal string blockedReasons + { + get; + set; + } + + /// + /// The reason the cookie should have been blocked by 3PCD but is exempted. A cookie could + /// only have at most one exemption reason. + /// + public CefSharp.DevTools.Network.CookieExemptionReason? ExemptionReason + { + get + { + return (CefSharp.DevTools.Network.CookieExemptionReason? )(StringToEnum(typeof(CefSharp.DevTools.Network.CookieExemptionReason? ), exemptionReason)); + } + + set + { + this.exemptionReason = (EnumToString(value)); + } + } + + /// + /// The reason the cookie should have been blocked by 3PCD but is exempted. A cookie could + /// only have at most one exemption reason. + /// + [DataMember(Name = ("exemptionReason"), IsRequired = (false))] + internal string exemptionReason + { + get; + set; + } + } + + /// + /// Cookie parameter object + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CookieParam : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Cookie name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Cookie value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + + /// + /// The request-URI to associate with the setting of the cookie. This value can affect the + /// default domain, path, source port, and source scheme values of the created cookie. + /// + [DataMember(Name = ("url"), IsRequired = (false))] + public string Url + { + get; + set; + } + + /// + /// Cookie domain. + /// + [DataMember(Name = ("domain"), IsRequired = (false))] + public string Domain + { + get; + set; + } + + /// + /// Cookie path. + /// + [DataMember(Name = ("path"), IsRequired = (false))] + public string Path + { + get; + set; + } + + /// + /// True if cookie is secure. + /// + [DataMember(Name = ("secure"), IsRequired = (false))] + public bool? Secure + { + get; + set; + } + + /// + /// True if cookie is http-only. + /// + [DataMember(Name = ("httpOnly"), IsRequired = (false))] + public bool? HttpOnly + { + get; + set; + } + + /// + /// Cookie SameSite type. + /// + public CefSharp.DevTools.Network.CookieSameSite? SameSite + { + get + { + return (CefSharp.DevTools.Network.CookieSameSite? )(StringToEnum(typeof(CefSharp.DevTools.Network.CookieSameSite? ), sameSite)); + } + + set + { + this.sameSite = (EnumToString(value)); + } + } + + /// + /// Cookie SameSite type. + /// + [DataMember(Name = ("sameSite"), IsRequired = (false))] + internal string sameSite + { + get; + set; + } + + /// + /// Cookie expiration date, session cookie if not set + /// + [DataMember(Name = ("expires"), IsRequired = (false))] + public double? Expires + { + get; + set; + } + + /// + /// Cookie Priority. + /// + public CefSharp.DevTools.Network.CookiePriority? Priority + { + get + { + return (CefSharp.DevTools.Network.CookiePriority? )(StringToEnum(typeof(CefSharp.DevTools.Network.CookiePriority? ), priority)); + } + + set + { + this.priority = (EnumToString(value)); + } + } + + /// + /// Cookie Priority. + /// + [DataMember(Name = ("priority"), IsRequired = (false))] + internal string priority + { + get; + set; + } + + /// + /// Cookie source scheme type. + /// + public CefSharp.DevTools.Network.CookieSourceScheme? SourceScheme + { + get + { + return (CefSharp.DevTools.Network.CookieSourceScheme? )(StringToEnum(typeof(CefSharp.DevTools.Network.CookieSourceScheme? ), sourceScheme)); + } + + set + { + this.sourceScheme = (EnumToString(value)); + } + } + + /// + /// Cookie source scheme type. + /// + [DataMember(Name = ("sourceScheme"), IsRequired = (false))] + internal string sourceScheme + { + get; + set; + } + + /// + /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. + /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. + /// This is a temporary ability and it will be removed in the future. + /// + [DataMember(Name = ("sourcePort"), IsRequired = (false))] + public int? SourcePort + { + get; + set; + } + + /// + /// Cookie partition key. If not set, the cookie will be set as not partitioned. + /// + [DataMember(Name = ("partitionKey"), IsRequired = (false))] + public CefSharp.DevTools.Network.CookiePartitionKey PartitionKey + { + get; + set; + } + } + + /// + /// Source of the authentication challenge. + /// + public enum AuthChallengeSource + { + /// + /// Server + /// + [EnumMember(Value = ("Server"))] + Server, + /// + /// Proxy + /// + [EnumMember(Value = ("Proxy"))] + Proxy + } + + /// + /// Authorization challenge for HTTP status code 401 or 407. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AuthChallenge : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source of the authentication challenge. + /// + public CefSharp.DevTools.Network.AuthChallengeSource? Source + { + get + { + return (CefSharp.DevTools.Network.AuthChallengeSource? )(StringToEnum(typeof(CefSharp.DevTools.Network.AuthChallengeSource? ), source)); + } + + set + { + this.source = (EnumToString(value)); + } + } + + /// + /// Source of the authentication challenge. + /// + [DataMember(Name = ("source"), IsRequired = (false))] + internal string source + { + get; + set; + } + + /// + /// Origin of the challenger. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + set; + } + + /// + /// The authentication scheme used, such as basic or digest + /// + [DataMember(Name = ("scheme"), IsRequired = (true))] + public string Scheme + { + get; + set; + } + + /// + /// The realm of the challenge. May be empty. + /// + [DataMember(Name = ("realm"), IsRequired = (true))] + public string Realm + { + get; + set; + } + } + + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + public enum AuthChallengeResponseResponse + { + /// + /// Default + /// + [EnumMember(Value = ("Default"))] + Default, + /// + /// CancelAuth + /// + [EnumMember(Value = ("CancelAuth"))] + CancelAuth, + /// + /// ProvideCredentials + /// + [EnumMember(Value = ("ProvideCredentials"))] + ProvideCredentials + } + + /// + /// Response to an AuthChallenge. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AuthChallengeResponse : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + public CefSharp.DevTools.Network.AuthChallengeResponseResponse Response + { + get + { + return (CefSharp.DevTools.Network.AuthChallengeResponseResponse)(StringToEnum(typeof(CefSharp.DevTools.Network.AuthChallengeResponseResponse), response)); + } + + set + { + this.response = (EnumToString(value)); + } + } + + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + [DataMember(Name = ("response"), IsRequired = (true))] + internal string response + { + get; + set; + } + + /// + /// The username to provide, possibly empty. Should only be set if response is + /// ProvideCredentials. + /// + [DataMember(Name = ("username"), IsRequired = (false))] + public string Username + { + get; + set; + } + + /// + /// The password to provide, possibly empty. Should only be set if response is + /// ProvideCredentials. + /// + [DataMember(Name = ("password"), IsRequired = (false))] + public string Password + { + get; + set; + } + } + + /// + /// Stages of the interception to begin intercepting. Request will intercept before the request is + /// sent. Response will intercept after the response is received. + /// + public enum InterceptionStage + { + /// + /// Request + /// + [EnumMember(Value = ("Request"))] + Request, + /// + /// HeadersReceived + /// + [EnumMember(Value = ("HeadersReceived"))] + HeadersReceived + } + + /// + /// Request pattern for interception. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RequestPattern : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is + /// backslash. Omitting is equivalent to `"*"`. + /// + [DataMember(Name = ("urlPattern"), IsRequired = (false))] + public string UrlPattern + { + get; + set; + } + + /// + /// If set, only requests for matching resource types will be intercepted. + /// + public CefSharp.DevTools.Network.ResourceType? ResourceType + { + get + { + return (CefSharp.DevTools.Network.ResourceType? )(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType? ), resourceType)); + } + + set + { + this.resourceType = (EnumToString(value)); + } + } + + /// + /// If set, only requests for matching resource types will be intercepted. + /// + [DataMember(Name = ("resourceType"), IsRequired = (false))] + internal string resourceType + { + get; + set; + } + + /// + /// Stage at which to begin intercepting requests. Default is Request. + /// + public CefSharp.DevTools.Network.InterceptionStage? InterceptionStage + { + get + { + return (CefSharp.DevTools.Network.InterceptionStage? )(StringToEnum(typeof(CefSharp.DevTools.Network.InterceptionStage? ), interceptionStage)); + } + + set + { + this.interceptionStage = (EnumToString(value)); + } + } + + /// + /// Stage at which to begin intercepting requests. Default is Request. + /// + [DataMember(Name = ("interceptionStage"), IsRequired = (false))] + internal string interceptionStage + { + get; + set; + } + } + + /// + /// Information about a signed exchange signature. + /// https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1 + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SignedExchangeSignature : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Signed exchange signature label. + /// + [DataMember(Name = ("label"), IsRequired = (true))] + public string Label + { + get; + set; + } + + /// + /// The hex string of signed exchange signature. + /// + [DataMember(Name = ("signature"), IsRequired = (true))] + public string Signature + { + get; + set; + } + + /// + /// Signed exchange signature integrity. + /// + [DataMember(Name = ("integrity"), IsRequired = (true))] + public string Integrity + { + get; + set; + } + + /// + /// Signed exchange signature cert Url. + /// + [DataMember(Name = ("certUrl"), IsRequired = (false))] + public string CertUrl + { + get; + set; + } + + /// + /// The hex string of signed exchange signature cert sha256. + /// + [DataMember(Name = ("certSha256"), IsRequired = (false))] + public string CertSha256 + { + get; + set; + } + + /// + /// Signed exchange signature validity Url. + /// + [DataMember(Name = ("validityUrl"), IsRequired = (true))] + public string ValidityUrl + { + get; + set; + } + + /// + /// Signed exchange signature date. + /// + [DataMember(Name = ("date"), IsRequired = (true))] + public int Date + { + get; + set; + } + + /// + /// Signed exchange signature expires. + /// + [DataMember(Name = ("expires"), IsRequired = (true))] + public int Expires + { + get; + set; + } + + /// + /// The encoded certificates. + /// + [DataMember(Name = ("certificates"), IsRequired = (false))] + public string[] Certificates + { + get; + set; + } + } + + /// + /// Information about a signed exchange header. + /// https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SignedExchangeHeader : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Signed exchange request URL. + /// + [DataMember(Name = ("requestUrl"), IsRequired = (true))] + public string RequestUrl + { + get; + set; + } + + /// + /// Signed exchange response code. + /// + [DataMember(Name = ("responseCode"), IsRequired = (true))] + public int ResponseCode + { + get; + set; + } + + /// + /// Signed exchange response headers. + /// + [DataMember(Name = ("responseHeaders"), IsRequired = (true))] + public CefSharp.DevTools.Network.Headers ResponseHeaders + { + get; + set; + } + + /// + /// Signed exchange response signature. + /// + [DataMember(Name = ("signatures"), IsRequired = (true))] + public System.Collections.Generic.IList Signatures + { + get; + set; + } + + /// + /// Signed exchange header integrity hash in the form of `sha256-<base64-hash-value>`. + /// + [DataMember(Name = ("headerIntegrity"), IsRequired = (true))] + public string HeaderIntegrity + { + get; + set; + } + } + + /// + /// Field type for a signed exchange related error. + /// + public enum SignedExchangeErrorField + { + /// + /// signatureSig + /// + [EnumMember(Value = ("signatureSig"))] + SignatureSig, + /// + /// signatureIntegrity + /// + [EnumMember(Value = ("signatureIntegrity"))] + SignatureIntegrity, + /// + /// signatureCertUrl + /// + [EnumMember(Value = ("signatureCertUrl"))] + SignatureCertUrl, + /// + /// signatureCertSha256 + /// + [EnumMember(Value = ("signatureCertSha256"))] + SignatureCertSha256, + /// + /// signatureValidityUrl + /// + [EnumMember(Value = ("signatureValidityUrl"))] + SignatureValidityUrl, + /// + /// signatureTimestamps + /// + [EnumMember(Value = ("signatureTimestamps"))] + SignatureTimestamps + } + + /// + /// Information about a signed exchange response. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SignedExchangeError : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error message. + /// + [DataMember(Name = ("message"), IsRequired = (true))] + public string Message + { + get; + set; + } + + /// + /// The index of the signature which caused the error. + /// + [DataMember(Name = ("signatureIndex"), IsRequired = (false))] + public int? SignatureIndex + { + get; + set; + } + + /// + /// The field which caused the error. + /// + public CefSharp.DevTools.Network.SignedExchangeErrorField? ErrorField + { + get + { + return (CefSharp.DevTools.Network.SignedExchangeErrorField? )(StringToEnum(typeof(CefSharp.DevTools.Network.SignedExchangeErrorField? ), errorField)); + } + + set + { + this.errorField = (EnumToString(value)); + } + } + + /// + /// The field which caused the error. + /// + [DataMember(Name = ("errorField"), IsRequired = (false))] + internal string errorField + { + get; + set; + } + } + + /// + /// Information about a signed exchange response. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SignedExchangeInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The outer response of signed HTTP exchange which was received from network. + /// + [DataMember(Name = ("outerResponse"), IsRequired = (true))] + public CefSharp.DevTools.Network.Response OuterResponse + { + get; + set; + } + + /// + /// Whether network response for the signed exchange was accompanied by + /// extra headers. + /// + [DataMember(Name = ("hasExtraInfo"), IsRequired = (true))] + public bool HasExtraInfo + { + get; + set; + } + + /// + /// Information about the signed exchange header. + /// + [DataMember(Name = ("header"), IsRequired = (false))] + public CefSharp.DevTools.Network.SignedExchangeHeader Header + { + get; + set; + } + + /// + /// Security details for the signed exchange header. + /// + [DataMember(Name = ("securityDetails"), IsRequired = (false))] + public CefSharp.DevTools.Network.SecurityDetails SecurityDetails + { + get; + set; + } + + /// + /// Errors occurred while handling the signed exchange. + /// + [DataMember(Name = ("errors"), IsRequired = (false))] + public System.Collections.Generic.IList Errors + { + get; + set; + } + } + + /// + /// List of content encodings supported by the backend. + /// + public enum ContentEncoding + { + /// + /// deflate + /// + [EnumMember(Value = ("deflate"))] + Deflate, + /// + /// gzip + /// + [EnumMember(Value = ("gzip"))] + Gzip, + /// + /// br + /// + [EnumMember(Value = ("br"))] + Br, + /// + /// zstd + /// + [EnumMember(Value = ("zstd"))] + Zstd + } + + /// + /// NetworkConditions + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class NetworkConditions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string + /// syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are + /// matched (including p2p connections). + /// + [DataMember(Name = ("urlPattern"), IsRequired = (true))] + public string UrlPattern + { + get; + set; + } + + /// + /// Minimum latency from request sent to response headers received (ms). + /// + [DataMember(Name = ("latency"), IsRequired = (true))] + public double Latency + { + get; + set; + } + + /// + /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. + /// + [DataMember(Name = ("downloadThroughput"), IsRequired = (true))] + public double DownloadThroughput + { + get; + set; + } + + /// + /// Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. + /// + [DataMember(Name = ("uploadThroughput"), IsRequired = (true))] + public double UploadThroughput + { + get; + set; + } + + /// + /// Connection type if known. + /// + public CefSharp.DevTools.Network.ConnectionType? ConnectionType + { + get + { + return (CefSharp.DevTools.Network.ConnectionType? )(StringToEnum(typeof(CefSharp.DevTools.Network.ConnectionType? ), connectionType)); + } + + set + { + this.connectionType = (EnumToString(value)); + } + } + + /// + /// Connection type if known. + /// + [DataMember(Name = ("connectionType"), IsRequired = (false))] + internal string connectionType + { + get; + set; + } + + /// + /// WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets. + /// + [DataMember(Name = ("packetLoss"), IsRequired = (false))] + public double? PacketLoss + { + get; + set; + } + + /// + /// WebRTC packet queue length (packet). 0 removes any queue length limitations. + /// + [DataMember(Name = ("packetQueueLength"), IsRequired = (false))] + public int? PacketQueueLength + { + get; + set; + } + + /// + /// WebRTC packetReordering feature. + /// + [DataMember(Name = ("packetReordering"), IsRequired = (false))] + public bool? PacketReordering + { + get; + set; + } + } + + /// + /// BlockPattern + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BlockPattern : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// URL pattern to match. Patterns use the URLPattern constructor string syntax + /// (https://urlpattern.spec.whatwg.org/) and must be absolute. Example: `*://*:*/*.css`. + /// + [DataMember(Name = ("urlPattern"), IsRequired = (true))] + public string UrlPattern + { + get; + set; + } + + /// + /// Whether or not to block the pattern. If false, a matching request will not be blocked even if it matches a later + /// `BlockPattern`. + /// + [DataMember(Name = ("block"), IsRequired = (true))] + public bool Block + { + get; + set; + } + } + + /// + /// DirectSocketDnsQueryType + /// + public enum DirectSocketDnsQueryType + { + /// + /// ipv4 + /// + [EnumMember(Value = ("ipv4"))] + Ipv4, + /// + /// ipv6 + /// + [EnumMember(Value = ("ipv6"))] + Ipv6 + } + + /// + /// DirectTCPSocketOptions + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DirectTCPSocketOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TCP_NODELAY option + /// + [DataMember(Name = ("noDelay"), IsRequired = (true))] + public bool NoDelay + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("keepAliveDelay"), IsRequired = (false))] + public double? KeepAliveDelay + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("sendBufferSize"), IsRequired = (false))] + public double? SendBufferSize + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("receiveBufferSize"), IsRequired = (false))] + public double? ReceiveBufferSize + { + get; + set; + } + + /// + /// DnsQueryType + /// + public CefSharp.DevTools.Network.DirectSocketDnsQueryType? DnsQueryType + { + get + { + return (CefSharp.DevTools.Network.DirectSocketDnsQueryType? )(StringToEnum(typeof(CefSharp.DevTools.Network.DirectSocketDnsQueryType? ), dnsQueryType)); + } + + set + { + this.dnsQueryType = (EnumToString(value)); + } + } + + /// + /// DnsQueryType + /// + [DataMember(Name = ("dnsQueryType"), IsRequired = (false))] + internal string dnsQueryType + { + get; + set; + } + } + + /// + /// DirectUDPSocketOptions + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DirectUDPSocketOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// RemoteAddr + /// + [DataMember(Name = ("remoteAddr"), IsRequired = (false))] + public string RemoteAddr + { + get; + set; + } + + /// + /// Unsigned int 16. + /// + [DataMember(Name = ("remotePort"), IsRequired = (false))] + public int? RemotePort + { + get; + set; + } + + /// + /// LocalAddr + /// + [DataMember(Name = ("localAddr"), IsRequired = (false))] + public string LocalAddr + { + get; + set; + } + + /// + /// Unsigned int 16. + /// + [DataMember(Name = ("localPort"), IsRequired = (false))] + public int? LocalPort + { + get; + set; + } + + /// + /// DnsQueryType + /// + public CefSharp.DevTools.Network.DirectSocketDnsQueryType? DnsQueryType + { + get + { + return (CefSharp.DevTools.Network.DirectSocketDnsQueryType? )(StringToEnum(typeof(CefSharp.DevTools.Network.DirectSocketDnsQueryType? ), dnsQueryType)); + } + + set + { + this.dnsQueryType = (EnumToString(value)); + } + } + + /// + /// DnsQueryType + /// + [DataMember(Name = ("dnsQueryType"), IsRequired = (false))] + internal string dnsQueryType + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("sendBufferSize"), IsRequired = (false))] + public double? SendBufferSize + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("receiveBufferSize"), IsRequired = (false))] + public double? ReceiveBufferSize + { + get; + set; + } + + /// + /// MulticastLoopback + /// + [DataMember(Name = ("multicastLoopback"), IsRequired = (false))] + public bool? MulticastLoopback + { + get; + set; + } + + /// + /// Unsigned int 8. + /// + [DataMember(Name = ("multicastTimeToLive"), IsRequired = (false))] + public int? MulticastTimeToLive + { + get; + set; + } + + /// + /// MulticastAllowAddressSharing + /// + [DataMember(Name = ("multicastAllowAddressSharing"), IsRequired = (false))] + public bool? MulticastAllowAddressSharing + { + get; + set; + } + } + + /// + /// DirectUDPMessage + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DirectUDPMessage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + set; + } + + /// + /// Null for connected mode. + /// + [DataMember(Name = ("remoteAddr"), IsRequired = (false))] + public string RemoteAddr + { + get; + set; + } + + /// + /// Null for connected mode. + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("remotePort"), IsRequired = (false))] + public int? RemotePort + { + get; + set; + } + } + + /// + /// LocalNetworkAccessRequestPolicy + /// + public enum LocalNetworkAccessRequestPolicy + { + /// + /// Allow + /// + [EnumMember(Value = ("Allow"))] + Allow, + /// + /// BlockFromInsecureToMorePrivate + /// + [EnumMember(Value = ("BlockFromInsecureToMorePrivate"))] + BlockFromInsecureToMorePrivate, + /// + /// WarnFromInsecureToMorePrivate + /// + [EnumMember(Value = ("WarnFromInsecureToMorePrivate"))] + WarnFromInsecureToMorePrivate, + /// + /// PermissionBlock + /// + [EnumMember(Value = ("PermissionBlock"))] + PermissionBlock, + /// + /// PermissionWarn + /// + [EnumMember(Value = ("PermissionWarn"))] + PermissionWarn + } + + /// + /// IPAddressSpace + /// + public enum IPAddressSpace + { + /// + /// Loopback + /// + [EnumMember(Value = ("Loopback"))] + Loopback, + /// + /// Local + /// + [EnumMember(Value = ("Local"))] + Local, + /// + /// Public + /// + [EnumMember(Value = ("Public"))] + Public, + /// + /// Unknown + /// + [EnumMember(Value = ("Unknown"))] + Unknown + } + + /// + /// ConnectTiming + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ConnectTiming : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Timing's requestTime is a baseline in seconds, while the other numbers are ticks in + /// milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for + /// the same request (but not for redirected requests). + /// + [DataMember(Name = ("requestTime"), IsRequired = (true))] + public double RequestTime + { + get; + set; + } + } + + /// + /// ClientSecurityState + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ClientSecurityState : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// InitiatorIsSecureContext + /// + [DataMember(Name = ("initiatorIsSecureContext"), IsRequired = (true))] + public bool InitiatorIsSecureContext + { + get; + set; + } + + /// + /// InitiatorIPAddressSpace + /// + public CefSharp.DevTools.Network.IPAddressSpace InitiatorIPAddressSpace + { + get + { + return (CefSharp.DevTools.Network.IPAddressSpace)(StringToEnum(typeof(CefSharp.DevTools.Network.IPAddressSpace), initiatorIPAddressSpace)); + } + + set + { + this.initiatorIPAddressSpace = (EnumToString(value)); + } + } + + /// + /// InitiatorIPAddressSpace + /// + [DataMember(Name = ("initiatorIPAddressSpace"), IsRequired = (true))] + internal string initiatorIPAddressSpace + { + get; + set; + } + + /// + /// LocalNetworkAccessRequestPolicy + /// + public CefSharp.DevTools.Network.LocalNetworkAccessRequestPolicy LocalNetworkAccessRequestPolicy + { + get + { + return (CefSharp.DevTools.Network.LocalNetworkAccessRequestPolicy)(StringToEnum(typeof(CefSharp.DevTools.Network.LocalNetworkAccessRequestPolicy), localNetworkAccessRequestPolicy)); + } + + set + { + this.localNetworkAccessRequestPolicy = (EnumToString(value)); + } + } + + /// + /// LocalNetworkAccessRequestPolicy + /// + [DataMember(Name = ("localNetworkAccessRequestPolicy"), IsRequired = (true))] + internal string localNetworkAccessRequestPolicy + { + get; + set; + } + } + + /// + /// CrossOriginOpenerPolicyValue + /// + public enum CrossOriginOpenerPolicyValue + { + /// + /// SameOrigin + /// + [EnumMember(Value = ("SameOrigin"))] + SameOrigin, + /// + /// SameOriginAllowPopups + /// + [EnumMember(Value = ("SameOriginAllowPopups"))] + SameOriginAllowPopups, + /// + /// RestrictProperties + /// + [EnumMember(Value = ("RestrictProperties"))] + RestrictProperties, + /// + /// UnsafeNone + /// + [EnumMember(Value = ("UnsafeNone"))] + UnsafeNone, + /// + /// SameOriginPlusCoep + /// + [EnumMember(Value = ("SameOriginPlusCoep"))] + SameOriginPlusCoep, + /// + /// RestrictPropertiesPlusCoep + /// + [EnumMember(Value = ("RestrictPropertiesPlusCoep"))] + RestrictPropertiesPlusCoep, + /// + /// NoopenerAllowPopups + /// + [EnumMember(Value = ("NoopenerAllowPopups"))] + NoopenerAllowPopups + } + + /// + /// CrossOriginOpenerPolicyStatus + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CrossOriginOpenerPolicyStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Value + /// + public CefSharp.DevTools.Network.CrossOriginOpenerPolicyValue Value + { + get + { + return (CefSharp.DevTools.Network.CrossOriginOpenerPolicyValue)(StringToEnum(typeof(CefSharp.DevTools.Network.CrossOriginOpenerPolicyValue), value)); + } + + set + { + this.value = (EnumToString(value)); + } + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + internal string value + { + get; + set; + } + + /// + /// ReportOnlyValue + /// + public CefSharp.DevTools.Network.CrossOriginOpenerPolicyValue ReportOnlyValue + { + get + { + return (CefSharp.DevTools.Network.CrossOriginOpenerPolicyValue)(StringToEnum(typeof(CefSharp.DevTools.Network.CrossOriginOpenerPolicyValue), reportOnlyValue)); + } + + set + { + this.reportOnlyValue = (EnumToString(value)); + } + } + + /// + /// ReportOnlyValue + /// + [DataMember(Name = ("reportOnlyValue"), IsRequired = (true))] + internal string reportOnlyValue + { + get; + set; + } + + /// + /// ReportingEndpoint + /// + [DataMember(Name = ("reportingEndpoint"), IsRequired = (false))] + public string ReportingEndpoint + { + get; + set; + } + + /// + /// ReportOnlyReportingEndpoint + /// + [DataMember(Name = ("reportOnlyReportingEndpoint"), IsRequired = (false))] + public string ReportOnlyReportingEndpoint + { + get; + set; + } + } + + /// + /// CrossOriginEmbedderPolicyValue + /// + public enum CrossOriginEmbedderPolicyValue + { + /// + /// None + /// + [EnumMember(Value = ("None"))] + None, + /// + /// Credentialless + /// + [EnumMember(Value = ("Credentialless"))] + Credentialless, + /// + /// RequireCorp + /// + [EnumMember(Value = ("RequireCorp"))] + RequireCorp + } + + /// + /// CrossOriginEmbedderPolicyStatus + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CrossOriginEmbedderPolicyStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Value + /// + public CefSharp.DevTools.Network.CrossOriginEmbedderPolicyValue Value + { + get + { + return (CefSharp.DevTools.Network.CrossOriginEmbedderPolicyValue)(StringToEnum(typeof(CefSharp.DevTools.Network.CrossOriginEmbedderPolicyValue), value)); + } + + set + { + this.value = (EnumToString(value)); + } + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + internal string value + { + get; + set; + } + + /// + /// ReportOnlyValue + /// + public CefSharp.DevTools.Network.CrossOriginEmbedderPolicyValue ReportOnlyValue + { + get + { + return (CefSharp.DevTools.Network.CrossOriginEmbedderPolicyValue)(StringToEnum(typeof(CefSharp.DevTools.Network.CrossOriginEmbedderPolicyValue), reportOnlyValue)); + } + + set + { + this.reportOnlyValue = (EnumToString(value)); + } + } + + /// + /// ReportOnlyValue + /// + [DataMember(Name = ("reportOnlyValue"), IsRequired = (true))] + internal string reportOnlyValue + { + get; + set; + } + + /// + /// ReportingEndpoint + /// + [DataMember(Name = ("reportingEndpoint"), IsRequired = (false))] + public string ReportingEndpoint + { + get; + set; + } + + /// + /// ReportOnlyReportingEndpoint + /// + [DataMember(Name = ("reportOnlyReportingEndpoint"), IsRequired = (false))] + public string ReportOnlyReportingEndpoint + { + get; + set; + } + } + + /// + /// ContentSecurityPolicySource + /// + public enum ContentSecurityPolicySource + { + /// + /// HTTP + /// + [EnumMember(Value = ("HTTP"))] + HTTP, + /// + /// Meta + /// + [EnumMember(Value = ("Meta"))] + Meta + } + + /// + /// ContentSecurityPolicyStatus + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ContentSecurityPolicyStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// EffectiveDirectives + /// + [DataMember(Name = ("effectiveDirectives"), IsRequired = (true))] + public string EffectiveDirectives + { + get; + set; + } + + /// + /// IsEnforced + /// + [DataMember(Name = ("isEnforced"), IsRequired = (true))] + public bool IsEnforced + { + get; + set; + } + + /// + /// Source + /// + public CefSharp.DevTools.Network.ContentSecurityPolicySource Source + { + get + { + return (CefSharp.DevTools.Network.ContentSecurityPolicySource)(StringToEnum(typeof(CefSharp.DevTools.Network.ContentSecurityPolicySource), source)); + } + + set + { + this.source = (EnumToString(value)); + } + } + + /// + /// Source + /// + [DataMember(Name = ("source"), IsRequired = (true))] + internal string source + { + get; + set; + } + } + + /// + /// SecurityIsolationStatus + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SecurityIsolationStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Coop + /// + [DataMember(Name = ("coop"), IsRequired = (false))] + public CefSharp.DevTools.Network.CrossOriginOpenerPolicyStatus Coop + { + get; + set; + } + + /// + /// Coep + /// + [DataMember(Name = ("coep"), IsRequired = (false))] + public CefSharp.DevTools.Network.CrossOriginEmbedderPolicyStatus Coep + { + get; + set; + } + + /// + /// Csp + /// + [DataMember(Name = ("csp"), IsRequired = (false))] + public System.Collections.Generic.IList Csp + { + get; + set; + } + } + + /// + /// The status of a Reporting API report. + /// + public enum ReportStatus + { + /// + /// Queued + /// + [EnumMember(Value = ("Queued"))] + Queued, + /// + /// Pending + /// + [EnumMember(Value = ("Pending"))] + Pending, + /// + /// MarkedForRemoval + /// + [EnumMember(Value = ("MarkedForRemoval"))] + MarkedForRemoval, + /// + /// Success + /// + [EnumMember(Value = ("Success"))] + Success + } + + /// + /// An object representing a report generated by the Reporting API. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ReportingApiReport : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// The URL of the document that triggered the report. + /// + [DataMember(Name = ("initiatorUrl"), IsRequired = (true))] + public string InitiatorUrl + { + get; + set; + } + + /// + /// The name of the endpoint group that should be used to deliver the report. + /// + [DataMember(Name = ("destination"), IsRequired = (true))] + public string Destination + { + get; + set; + } + + /// + /// The type of the report (specifies the set of data that is contained in the report body). + /// + [DataMember(Name = ("type"), IsRequired = (true))] + public string Type + { + get; + set; + } + + /// + /// When the report was generated. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + set; + } + + /// + /// How many uploads deep the related request was. + /// + [DataMember(Name = ("depth"), IsRequired = (true))] + public int Depth + { + get; + set; + } + + /// + /// The number of delivery attempts made so far, not including an active attempt. + /// + [DataMember(Name = ("completedAttempts"), IsRequired = (true))] + public int CompletedAttempts + { + get; + set; + } + + /// + /// Body + /// + [DataMember(Name = ("body"), IsRequired = (true))] + public object Body + { + get; + set; + } + + /// + /// Status + /// + public CefSharp.DevTools.Network.ReportStatus Status + { + get + { + return (CefSharp.DevTools.Network.ReportStatus)(StringToEnum(typeof(CefSharp.DevTools.Network.ReportStatus), status)); + } + + set + { + this.status = (EnumToString(value)); + } + } + + /// + /// Status + /// + [DataMember(Name = ("status"), IsRequired = (true))] + internal string status + { + get; + set; + } + } + + /// + /// ReportingApiEndpoint + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ReportingApiEndpoint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The URL of the endpoint to which reports may be delivered. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Name of the endpoint group. + /// + [DataMember(Name = ("groupName"), IsRequired = (true))] + public string GroupName + { + get; + set; + } + } + + /// + /// Unique identifier for a device bound session. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DeviceBoundSessionKey : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The site the session is set up for. + /// + [DataMember(Name = ("site"), IsRequired = (true))] + public string Site + { + get; + set; + } + + /// + /// The id of the session. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + } + + /// + /// How the session was used (or not used). + /// + public enum DeviceBoundSessionWithUsageUsage + { + /// + /// NotInScope + /// + [EnumMember(Value = ("NotInScope"))] + NotInScope, + /// + /// InScopeRefreshNotYetNeeded + /// + [EnumMember(Value = ("InScopeRefreshNotYetNeeded"))] + InScopeRefreshNotYetNeeded, + /// + /// InScopeRefreshNotAllowed + /// + [EnumMember(Value = ("InScopeRefreshNotAllowed"))] + InScopeRefreshNotAllowed, + /// + /// ProactiveRefreshNotPossible + /// + [EnumMember(Value = ("ProactiveRefreshNotPossible"))] + ProactiveRefreshNotPossible, + /// + /// ProactiveRefreshAttempted + /// + [EnumMember(Value = ("ProactiveRefreshAttempted"))] + ProactiveRefreshAttempted, + /// + /// Deferred + /// + [EnumMember(Value = ("Deferred"))] + Deferred + } + + /// + /// How a device bound session was used during a request. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DeviceBoundSessionWithUsage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The key for the session. + /// + [DataMember(Name = ("sessionKey"), IsRequired = (true))] + public CefSharp.DevTools.Network.DeviceBoundSessionKey SessionKey + { + get; + set; + } + + /// + /// How the session was used (or not used). + /// + public CefSharp.DevTools.Network.DeviceBoundSessionWithUsageUsage Usage + { + get + { + return (CefSharp.DevTools.Network.DeviceBoundSessionWithUsageUsage)(StringToEnum(typeof(CefSharp.DevTools.Network.DeviceBoundSessionWithUsageUsage), usage)); + } + + set + { + this.usage = (EnumToString(value)); + } + } + + /// + /// How the session was used (or not used). + /// + [DataMember(Name = ("usage"), IsRequired = (true))] + internal string usage + { + get; + set; + } + } + + /// + /// A device bound session's cookie craving. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DeviceBoundSessionCookieCraving : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The name of the craving. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// The domain of the craving. + /// + [DataMember(Name = ("domain"), IsRequired = (true))] + public string Domain + { + get; + set; + } + + /// + /// The path of the craving. + /// + [DataMember(Name = ("path"), IsRequired = (true))] + public string Path + { + get; + set; + } + + /// + /// The `Secure` attribute of the craving attributes. + /// + [DataMember(Name = ("secure"), IsRequired = (true))] + public bool Secure + { + get; + set; + } + + /// + /// The `HttpOnly` attribute of the craving attributes. + /// + [DataMember(Name = ("httpOnly"), IsRequired = (true))] + public bool HttpOnly + { + get; + set; + } + + /// + /// The `SameSite` attribute of the craving attributes. + /// + public CefSharp.DevTools.Network.CookieSameSite? SameSite + { + get + { + return (CefSharp.DevTools.Network.CookieSameSite? )(StringToEnum(typeof(CefSharp.DevTools.Network.CookieSameSite? ), sameSite)); + } + + set + { + this.sameSite = (EnumToString(value)); + } + } + + /// + /// The `SameSite` attribute of the craving attributes. + /// + [DataMember(Name = ("sameSite"), IsRequired = (false))] + internal string sameSite + { + get; + set; + } + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`. + /// + public enum DeviceBoundSessionUrlRuleRuleType + { + /// + /// Exclude + /// + [EnumMember(Value = ("Exclude"))] + Exclude, + /// + /// Include + /// + [EnumMember(Value = ("Include"))] + Include + } + + /// + /// A device bound session's inclusion URL rule. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DeviceBoundSessionUrlRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`. + /// + public CefSharp.DevTools.Network.DeviceBoundSessionUrlRuleRuleType RuleType + { + get + { + return (CefSharp.DevTools.Network.DeviceBoundSessionUrlRuleRuleType)(StringToEnum(typeof(CefSharp.DevTools.Network.DeviceBoundSessionUrlRuleRuleType), ruleType)); + } + + set + { + this.ruleType = (EnumToString(value)); + } + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`. + /// + [DataMember(Name = ("ruleType"), IsRequired = (true))] + internal string ruleType + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern`. + /// + [DataMember(Name = ("hostPattern"), IsRequired = (true))] + public string HostPattern + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix`. + /// + [DataMember(Name = ("pathPrefix"), IsRequired = (true))] + public string PathPrefix + { + get; + set; + } + } + + /// + /// A device bound session's inclusion rules. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DeviceBoundSessionInclusionRules : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::origin_`. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + set; + } + + /// + /// Whether the whole site is included. See comments on + /// `net::device_bound_sessions::SessionInclusionRules::include_site_` for more + /// details; this boolean is true if that value is populated. + /// + [DataMember(Name = ("includeSite"), IsRequired = (true))] + public bool IncludeSite + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::url_rules_`. + /// + [DataMember(Name = ("urlRules"), IsRequired = (true))] + public System.Collections.Generic.IList UrlRules + { + get; + set; + } + } + + /// + /// A device bound session. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DeviceBoundSession : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The site and session ID of the session. + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public CefSharp.DevTools.Network.DeviceBoundSessionKey Key + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::refresh_url_`. + /// + [DataMember(Name = ("refreshUrl"), IsRequired = (true))] + public string RefreshUrl + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::inclusion_rules_`. + /// + [DataMember(Name = ("inclusionRules"), IsRequired = (true))] + public CefSharp.DevTools.Network.DeviceBoundSessionInclusionRules InclusionRules + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::cookie_cravings_`. + /// + [DataMember(Name = ("cookieCravings"), IsRequired = (true))] + public System.Collections.Generic.IList CookieCravings + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::expiry_date_`. + /// + [DataMember(Name = ("expiryDate"), IsRequired = (true))] + public double ExpiryDate + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::cached_challenge__`. + /// + [DataMember(Name = ("cachedChallenge"), IsRequired = (false))] + public string CachedChallenge + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::allowed_refresh_initiators_`. + /// + [DataMember(Name = ("allowedRefreshInitiators"), IsRequired = (true))] + public string[] AllowedRefreshInitiators + { + get; + set; + } + } + + /// + /// A fetch result for a device bound session creation or refresh. + /// + public enum DeviceBoundSessionFetchResult + { + /// + /// Success + /// + [EnumMember(Value = ("Success"))] + Success, + /// + /// KeyError + /// + [EnumMember(Value = ("KeyError"))] + KeyError, + /// + /// SigningError + /// + [EnumMember(Value = ("SigningError"))] + SigningError, + /// + /// ServerRequestedTermination + /// + [EnumMember(Value = ("ServerRequestedTermination"))] + ServerRequestedTermination, + /// + /// InvalidSessionId + /// + [EnumMember(Value = ("InvalidSessionId"))] + InvalidSessionId, + /// + /// InvalidChallenge + /// + [EnumMember(Value = ("InvalidChallenge"))] + InvalidChallenge, + /// + /// TooManyChallenges + /// + [EnumMember(Value = ("TooManyChallenges"))] + TooManyChallenges, + /// + /// InvalidFetcherUrl + /// + [EnumMember(Value = ("InvalidFetcherUrl"))] + InvalidFetcherUrl, + /// + /// InvalidRefreshUrl + /// + [EnumMember(Value = ("InvalidRefreshUrl"))] + InvalidRefreshUrl, + /// + /// TransientHttpError + /// + [EnumMember(Value = ("TransientHttpError"))] + TransientHttpError, + /// + /// ScopeOriginSameSiteMismatch + /// + [EnumMember(Value = ("ScopeOriginSameSiteMismatch"))] + ScopeOriginSameSiteMismatch, + /// + /// RefreshUrlSameSiteMismatch + /// + [EnumMember(Value = ("RefreshUrlSameSiteMismatch"))] + RefreshUrlSameSiteMismatch, + /// + /// MismatchedSessionId + /// + [EnumMember(Value = ("MismatchedSessionId"))] + MismatchedSessionId, + /// + /// MissingScope + /// + [EnumMember(Value = ("MissingScope"))] + MissingScope, + /// + /// NoCredentials + /// + [EnumMember(Value = ("NoCredentials"))] + NoCredentials, + /// + /// SubdomainRegistrationWellKnownUnavailable + /// + [EnumMember(Value = ("SubdomainRegistrationWellKnownUnavailable"))] + SubdomainRegistrationWellKnownUnavailable, + /// + /// SubdomainRegistrationUnauthorized + /// + [EnumMember(Value = ("SubdomainRegistrationUnauthorized"))] + SubdomainRegistrationUnauthorized, + /// + /// SubdomainRegistrationWellKnownMalformed + /// + [EnumMember(Value = ("SubdomainRegistrationWellKnownMalformed"))] + SubdomainRegistrationWellKnownMalformed, + /// + /// SessionProviderWellKnownUnavailable + /// + [EnumMember(Value = ("SessionProviderWellKnownUnavailable"))] + SessionProviderWellKnownUnavailable, + /// + /// RelyingPartyWellKnownUnavailable + /// + [EnumMember(Value = ("RelyingPartyWellKnownUnavailable"))] + RelyingPartyWellKnownUnavailable, + /// + /// FederatedKeyThumbprintMismatch + /// + [EnumMember(Value = ("FederatedKeyThumbprintMismatch"))] + FederatedKeyThumbprintMismatch, + /// + /// InvalidFederatedSessionUrl + /// + [EnumMember(Value = ("InvalidFederatedSessionUrl"))] + InvalidFederatedSessionUrl, + /// + /// InvalidFederatedKey + /// + [EnumMember(Value = ("InvalidFederatedKey"))] + InvalidFederatedKey, + /// + /// TooManyRelyingOriginLabels + /// + [EnumMember(Value = ("TooManyRelyingOriginLabels"))] + TooManyRelyingOriginLabels, + /// + /// BoundCookieSetForbidden + /// + [EnumMember(Value = ("BoundCookieSetForbidden"))] + BoundCookieSetForbidden, + /// + /// NetError + /// + [EnumMember(Value = ("NetError"))] + NetError, + /// + /// ProxyError + /// + [EnumMember(Value = ("ProxyError"))] + ProxyError, + /// + /// EmptySessionConfig + /// + [EnumMember(Value = ("EmptySessionConfig"))] + EmptySessionConfig, + /// + /// InvalidCredentialsConfig + /// + [EnumMember(Value = ("InvalidCredentialsConfig"))] + InvalidCredentialsConfig, + /// + /// InvalidCredentialsType + /// + [EnumMember(Value = ("InvalidCredentialsType"))] + InvalidCredentialsType, + /// + /// InvalidCredentialsEmptyName + /// + [EnumMember(Value = ("InvalidCredentialsEmptyName"))] + InvalidCredentialsEmptyName, + /// + /// InvalidCredentialsCookie + /// + [EnumMember(Value = ("InvalidCredentialsCookie"))] + InvalidCredentialsCookie, + /// + /// PersistentHttpError + /// + [EnumMember(Value = ("PersistentHttpError"))] + PersistentHttpError, + /// + /// RegistrationAttemptedChallenge + /// + [EnumMember(Value = ("RegistrationAttemptedChallenge"))] + RegistrationAttemptedChallenge, + /// + /// InvalidScopeOrigin + /// + [EnumMember(Value = ("InvalidScopeOrigin"))] + InvalidScopeOrigin, + /// + /// ScopeOriginContainsPath + /// + [EnumMember(Value = ("ScopeOriginContainsPath"))] + ScopeOriginContainsPath, + /// + /// RefreshInitiatorNotString + /// + [EnumMember(Value = ("RefreshInitiatorNotString"))] + RefreshInitiatorNotString, + /// + /// RefreshInitiatorInvalidHostPattern + /// + [EnumMember(Value = ("RefreshInitiatorInvalidHostPattern"))] + RefreshInitiatorInvalidHostPattern, + /// + /// InvalidScopeSpecification + /// + [EnumMember(Value = ("InvalidScopeSpecification"))] + InvalidScopeSpecification, + /// + /// MissingScopeSpecificationType + /// + [EnumMember(Value = ("MissingScopeSpecificationType"))] + MissingScopeSpecificationType, + /// + /// EmptyScopeSpecificationDomain + /// + [EnumMember(Value = ("EmptyScopeSpecificationDomain"))] + EmptyScopeSpecificationDomain, + /// + /// EmptyScopeSpecificationPath + /// + [EnumMember(Value = ("EmptyScopeSpecificationPath"))] + EmptyScopeSpecificationPath, + /// + /// InvalidScopeSpecificationType + /// + [EnumMember(Value = ("InvalidScopeSpecificationType"))] + InvalidScopeSpecificationType, + /// + /// InvalidScopeIncludeSite + /// + [EnumMember(Value = ("InvalidScopeIncludeSite"))] + InvalidScopeIncludeSite, + /// + /// MissingScopeIncludeSite + /// + [EnumMember(Value = ("MissingScopeIncludeSite"))] + MissingScopeIncludeSite, + /// + /// FederatedNotAuthorizedByProvider + /// + [EnumMember(Value = ("FederatedNotAuthorizedByProvider"))] + FederatedNotAuthorizedByProvider, + /// + /// FederatedNotAuthorizedByRelyingParty + /// + [EnumMember(Value = ("FederatedNotAuthorizedByRelyingParty"))] + FederatedNotAuthorizedByRelyingParty, + /// + /// SessionProviderWellKnownMalformed + /// + [EnumMember(Value = ("SessionProviderWellKnownMalformed"))] + SessionProviderWellKnownMalformed, + /// + /// SessionProviderWellKnownHasProviderOrigin + /// + [EnumMember(Value = ("SessionProviderWellKnownHasProviderOrigin"))] + SessionProviderWellKnownHasProviderOrigin, + /// + /// RelyingPartyWellKnownMalformed + /// + [EnumMember(Value = ("RelyingPartyWellKnownMalformed"))] + RelyingPartyWellKnownMalformed, + /// + /// RelyingPartyWellKnownHasRelyingOrigins + /// + [EnumMember(Value = ("RelyingPartyWellKnownHasRelyingOrigins"))] + RelyingPartyWellKnownHasRelyingOrigins, + /// + /// InvalidFederatedSessionProviderSessionMissing + /// + [EnumMember(Value = ("InvalidFederatedSessionProviderSessionMissing"))] + InvalidFederatedSessionProviderSessionMissing, + /// + /// InvalidFederatedSessionWrongProviderOrigin + /// + [EnumMember(Value = ("InvalidFederatedSessionWrongProviderOrigin"))] + InvalidFederatedSessionWrongProviderOrigin, + /// + /// InvalidCredentialsCookieCreationTime + /// + [EnumMember(Value = ("InvalidCredentialsCookieCreationTime"))] + InvalidCredentialsCookieCreationTime, + /// + /// InvalidCredentialsCookieName + /// + [EnumMember(Value = ("InvalidCredentialsCookieName"))] + InvalidCredentialsCookieName, + /// + /// InvalidCredentialsCookieParsing + /// + [EnumMember(Value = ("InvalidCredentialsCookieParsing"))] + InvalidCredentialsCookieParsing, + /// + /// InvalidCredentialsCookieUnpermittedAttribute + /// + [EnumMember(Value = ("InvalidCredentialsCookieUnpermittedAttribute"))] + InvalidCredentialsCookieUnpermittedAttribute, + /// + /// InvalidCredentialsCookieInvalidDomain + /// + [EnumMember(Value = ("InvalidCredentialsCookieInvalidDomain"))] + InvalidCredentialsCookieInvalidDomain, + /// + /// InvalidCredentialsCookiePrefix + /// + [EnumMember(Value = ("InvalidCredentialsCookiePrefix"))] + InvalidCredentialsCookiePrefix, + /// + /// InvalidScopeRulePath + /// + [EnumMember(Value = ("InvalidScopeRulePath"))] + InvalidScopeRulePath, + /// + /// InvalidScopeRuleHostPattern + /// + [EnumMember(Value = ("InvalidScopeRuleHostPattern"))] + InvalidScopeRuleHostPattern, + /// + /// ScopeRuleOriginScopedHostPatternMismatch + /// + [EnumMember(Value = ("ScopeRuleOriginScopedHostPatternMismatch"))] + ScopeRuleOriginScopedHostPatternMismatch, + /// + /// ScopeRuleSiteScopedHostPatternMismatch + /// + [EnumMember(Value = ("ScopeRuleSiteScopedHostPatternMismatch"))] + ScopeRuleSiteScopedHostPatternMismatch, + /// + /// SigningQuotaExceeded + /// + [EnumMember(Value = ("SigningQuotaExceeded"))] + SigningQuotaExceeded, + /// + /// InvalidConfigJson + /// + [EnumMember(Value = ("InvalidConfigJson"))] + InvalidConfigJson, + /// + /// InvalidFederatedSessionProviderFailedToRestoreKey + /// + [EnumMember(Value = ("InvalidFederatedSessionProviderFailedToRestoreKey"))] + InvalidFederatedSessionProviderFailedToRestoreKey, + /// + /// FailedToUnwrapKey + /// + [EnumMember(Value = ("FailedToUnwrapKey"))] + FailedToUnwrapKey, + /// + /// SessionDeletedDuringRefresh + /// + [EnumMember(Value = ("SessionDeletedDuringRefresh"))] + SessionDeletedDuringRefresh + } + + /// + /// Session event details specific to creation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CreationEventDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The result of the fetch attempt. + /// + public CefSharp.DevTools.Network.DeviceBoundSessionFetchResult FetchResult + { + get + { + return (CefSharp.DevTools.Network.DeviceBoundSessionFetchResult)(StringToEnum(typeof(CefSharp.DevTools.Network.DeviceBoundSessionFetchResult), fetchResult)); + } + + set + { + this.fetchResult = (EnumToString(value)); + } + } + + /// + /// The result of the fetch attempt. + /// + [DataMember(Name = ("fetchResult"), IsRequired = (true))] + internal string fetchResult + { + get; + set; + } + + /// + /// The session if there was a newly created session. This is populated for + /// all successful creation events. + /// + [DataMember(Name = ("newSession"), IsRequired = (false))] + public CefSharp.DevTools.Network.DeviceBoundSession NewSession + { + get; + set; + } + } + + /// + /// The result of a refresh. + /// + public enum RefreshEventDetailsRefreshResult + { + /// + /// Refreshed + /// + [EnumMember(Value = ("Refreshed"))] + Refreshed, + /// + /// InitializedService + /// + [EnumMember(Value = ("InitializedService"))] + InitializedService, + /// + /// Unreachable + /// + [EnumMember(Value = ("Unreachable"))] + Unreachable, + /// + /// ServerError + /// + [EnumMember(Value = ("ServerError"))] + ServerError, + /// + /// RefreshQuotaExceeded + /// + [EnumMember(Value = ("RefreshQuotaExceeded"))] + RefreshQuotaExceeded, + /// + /// FatalError + /// + [EnumMember(Value = ("FatalError"))] + FatalError, + /// + /// SigningQuotaExceeded + /// + [EnumMember(Value = ("SigningQuotaExceeded"))] + SigningQuotaExceeded + } + + /// + /// Session event details specific to refresh. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RefreshEventDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The result of a refresh. + /// + public CefSharp.DevTools.Network.RefreshEventDetailsRefreshResult RefreshResult + { + get + { + return (CefSharp.DevTools.Network.RefreshEventDetailsRefreshResult)(StringToEnum(typeof(CefSharp.DevTools.Network.RefreshEventDetailsRefreshResult), refreshResult)); + } + + set + { + this.refreshResult = (EnumToString(value)); + } + } + + /// + /// The result of a refresh. + /// + [DataMember(Name = ("refreshResult"), IsRequired = (true))] + internal string refreshResult + { + get; + set; + } + + /// + /// If there was a fetch attempt, the result of that. + /// + public CefSharp.DevTools.Network.DeviceBoundSessionFetchResult? FetchResult + { + get + { + return (CefSharp.DevTools.Network.DeviceBoundSessionFetchResult? )(StringToEnum(typeof(CefSharp.DevTools.Network.DeviceBoundSessionFetchResult? ), fetchResult)); + } + + set + { + this.fetchResult = (EnumToString(value)); + } + } + + /// + /// If there was a fetch attempt, the result of that. + /// + [DataMember(Name = ("fetchResult"), IsRequired = (false))] + internal string fetchResult + { + get; + set; + } + + /// + /// The session display if there was a newly created session. This is populated + /// for any refresh event that modifies the session config. + /// + [DataMember(Name = ("newSession"), IsRequired = (false))] + public CefSharp.DevTools.Network.DeviceBoundSession NewSession + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh`. + /// + [DataMember(Name = ("wasFullyProactiveRefresh"), IsRequired = (true))] + public bool WasFullyProactiveRefresh + { + get; + set; + } + } + + /// + /// The reason for a session being deleted. + /// + public enum TerminationEventDetailsDeletionReason + { + /// + /// Expired + /// + [EnumMember(Value = ("Expired"))] + Expired, + /// + /// FailedToRestoreKey + /// + [EnumMember(Value = ("FailedToRestoreKey"))] + FailedToRestoreKey, + /// + /// FailedToUnwrapKey + /// + [EnumMember(Value = ("FailedToUnwrapKey"))] + FailedToUnwrapKey, + /// + /// StoragePartitionCleared + /// + [EnumMember(Value = ("StoragePartitionCleared"))] + StoragePartitionCleared, + /// + /// ClearBrowsingData + /// + [EnumMember(Value = ("ClearBrowsingData"))] + ClearBrowsingData, + /// + /// ServerRequested + /// + [EnumMember(Value = ("ServerRequested"))] + ServerRequested, + /// + /// InvalidSessionParams + /// + [EnumMember(Value = ("InvalidSessionParams"))] + InvalidSessionParams, + /// + /// RefreshFatalError + /// + [EnumMember(Value = ("RefreshFatalError"))] + RefreshFatalError + } + + /// + /// Session event details specific to termination. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class TerminationEventDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The reason for a session being deleted. + /// + public CefSharp.DevTools.Network.TerminationEventDetailsDeletionReason DeletionReason + { + get + { + return (CefSharp.DevTools.Network.TerminationEventDetailsDeletionReason)(StringToEnum(typeof(CefSharp.DevTools.Network.TerminationEventDetailsDeletionReason), deletionReason)); + } + + set + { + this.deletionReason = (EnumToString(value)); + } + } + + /// + /// The reason for a session being deleted. + /// + [DataMember(Name = ("deletionReason"), IsRequired = (true))] + internal string deletionReason + { + get; + set; + } + } + + /// + /// The result of a challenge. + /// + public enum ChallengeEventDetailsChallengeResult + { + /// + /// Success + /// + [EnumMember(Value = ("Success"))] + Success, + /// + /// NoSessionId + /// + [EnumMember(Value = ("NoSessionId"))] + NoSessionId, + /// + /// NoSessionMatch + /// + [EnumMember(Value = ("NoSessionMatch"))] + NoSessionMatch, + /// + /// CantSetBoundCookie + /// + [EnumMember(Value = ("CantSetBoundCookie"))] + CantSetBoundCookie + } + + /// + /// Session event details specific to challenges. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ChallengeEventDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The result of a challenge. + /// + public CefSharp.DevTools.Network.ChallengeEventDetailsChallengeResult ChallengeResult + { + get + { + return (CefSharp.DevTools.Network.ChallengeEventDetailsChallengeResult)(StringToEnum(typeof(CefSharp.DevTools.Network.ChallengeEventDetailsChallengeResult), challengeResult)); + } + + set + { + this.challengeResult = (EnumToString(value)); + } + } + + /// + /// The result of a challenge. + /// + [DataMember(Name = ("challengeResult"), IsRequired = (true))] + internal string challengeResult + { + get; + set; + } + + /// + /// The challenge set. + /// + [DataMember(Name = ("challenge"), IsRequired = (true))] + public string Challenge + { + get; + set; + } + } + + /// + /// An object providing the result of a network resource load. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LoadNetworkResourcePageResult : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Success + /// + [DataMember(Name = ("success"), IsRequired = (true))] + public bool Success + { + get; + set; + } + + /// + /// Optional values used for error reporting. + /// + [DataMember(Name = ("netError"), IsRequired = (false))] + public double? NetError + { + get; + set; + } + + /// + /// NetErrorName + /// + [DataMember(Name = ("netErrorName"), IsRequired = (false))] + public string NetErrorName + { + get; + set; + } + + /// + /// HttpStatusCode + /// + [DataMember(Name = ("httpStatusCode"), IsRequired = (false))] + public double? HttpStatusCode + { + get; + set; + } + + /// + /// If successful, one of the following two fields holds the result. + /// + [DataMember(Name = ("stream"), IsRequired = (false))] + public string Stream + { + get; + set; + } + + /// + /// Response headers. + /// + [DataMember(Name = ("headers"), IsRequired = (false))] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + } + + /// + /// An options object that may be extended later to better support CORS, + /// CORB and streaming. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LoadNetworkResourceOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// DisableCache + /// + [DataMember(Name = ("disableCache"), IsRequired = (true))] + public bool DisableCache + { + get; + set; + } + + /// + /// IncludeCredentials + /// + [DataMember(Name = ("includeCredentials"), IsRequired = (true))] + public bool IncludeCredentials + { + get; + set; + } + } + + /// + /// Fired when data chunk was received over the network. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DataReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Data chunk length. + /// + [DataMember(Name = ("dataLength"), IsRequired = (true))] + public int DataLength + { + get; + private set; + } + + /// + /// Actual bytes received (might be less than dataLength for compressed encodings). + /// + [DataMember(Name = ("encodedDataLength"), IsRequired = (true))] + public int EncodedDataLength + { + get; + private set; + } + + /// + /// Data that was received. + /// + [DataMember(Name = ("data"), IsRequired = (false))] + public byte[] Data + { + get; + private set; + } + } + + /// + /// Fired when EventSource message is received. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class EventSourceMessageReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Message type. + /// + [DataMember(Name = ("eventName"), IsRequired = (true))] + public string EventName + { + get; + private set; + } + + /// + /// Message identifier. + /// + [DataMember(Name = ("eventId"), IsRequired = (true))] + public string EventId + { + get; + private set; + } + + /// + /// Message content. + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public string Data + { + get; + private set; + } + } + + /// + /// Fired when HTTP request has failed to load. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class LoadingFailedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Resource type. + /// + public CefSharp.DevTools.Network.ResourceType Type + { + get + { + return (CefSharp.DevTools.Network.ResourceType)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Resource type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// Error message. List of network errors: https://cs.chromium.org/chromium/src/net/base/net_error_list.h + /// + [DataMember(Name = ("errorText"), IsRequired = (true))] + public string ErrorText + { + get; + private set; + } + + /// + /// True if loading was canceled. + /// + [DataMember(Name = ("canceled"), IsRequired = (false))] + public bool? Canceled + { + get; + private set; + } + + /// + /// The reason why loading was blocked, if any. + /// + public CefSharp.DevTools.Network.BlockedReason? BlockedReason + { + get + { + return (CefSharp.DevTools.Network.BlockedReason? )(StringToEnum(typeof(CefSharp.DevTools.Network.BlockedReason? ), blockedReason)); + } + + set + { + this.blockedReason = (EnumToString(value)); + } + } + + /// + /// The reason why loading was blocked, if any. + /// + [DataMember(Name = ("blockedReason"), IsRequired = (false))] + internal string blockedReason + { + get; + private set; + } + + /// + /// The reason why loading was blocked by CORS, if any. + /// + [DataMember(Name = ("corsErrorStatus"), IsRequired = (false))] + public CefSharp.DevTools.Network.CorsErrorStatus CorsErrorStatus + { + get; + private set; + } + } + + /// + /// Fired when HTTP request has finished loading. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class LoadingFinishedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Total number of bytes received for this request. + /// + [DataMember(Name = ("encodedDataLength"), IsRequired = (true))] + public double EncodedDataLength + { + get; + private set; + } + } + + /// + /// Details of an intercepted HTTP request, which must be either allowed, blocked, modified or + /// mocked. + /// Deprecated, use Fetch.requestPaused instead. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class RequestInterceptedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Each request the page makes will have a unique id, however if any redirects are encountered + /// while processing that fetch, they will be reported with the same id as the original fetch. + /// Likewise if HTTP authentication is needed then the same fetch id will be used. + /// + [DataMember(Name = ("interceptionId"), IsRequired = (true))] + public string InterceptionId + { + get; + private set; + } + + /// + /// Request + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Network.Request Request + { + get; + private set; + } + + /// + /// The id of the frame that initiated the request. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// How the requested resource will be used. + /// + public CefSharp.DevTools.Network.ResourceType ResourceType + { + get + { + return (CefSharp.DevTools.Network.ResourceType)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType), resourceType)); + } + + set + { + this.resourceType = (EnumToString(value)); + } + } + + /// + /// How the requested resource will be used. + /// + [DataMember(Name = ("resourceType"), IsRequired = (true))] + internal string resourceType + { + get; + private set; + } + + /// + /// Whether this is a navigation request, which can abort the navigation completely. + /// + [DataMember(Name = ("isNavigationRequest"), IsRequired = (true))] + public bool IsNavigationRequest + { + get; + private set; + } + + /// + /// Set if the request is a navigation that will result in a download. + /// Only present after response is received from the server (i.e. HeadersReceived stage). + /// + [DataMember(Name = ("isDownload"), IsRequired = (false))] + public bool? IsDownload + { + get; + private set; + } + + /// + /// Redirect location, only sent if a redirect was intercepted. + /// + [DataMember(Name = ("redirectUrl"), IsRequired = (false))] + public string RedirectUrl + { + get; + private set; + } + + /// + /// Details of the Authorization Challenge encountered. If this is set then + /// continueInterceptedRequest must contain an authChallengeResponse. + /// + [DataMember(Name = ("authChallenge"), IsRequired = (false))] + public CefSharp.DevTools.Network.AuthChallenge AuthChallenge + { + get; + private set; + } + + /// + /// Response error if intercepted at response stage or if redirect occurred while intercepting + /// request. + /// + public CefSharp.DevTools.Network.ErrorReason? ResponseErrorReason + { + get + { + return (CefSharp.DevTools.Network.ErrorReason? )(StringToEnum(typeof(CefSharp.DevTools.Network.ErrorReason? ), responseErrorReason)); + } + + set + { + this.responseErrorReason = (EnumToString(value)); + } + } + + /// + /// Response error if intercepted at response stage or if redirect occurred while intercepting + /// request. + /// + [DataMember(Name = ("responseErrorReason"), IsRequired = (false))] + internal string responseErrorReason + { + get; + private set; + } + + /// + /// Response code if intercepted at response stage or if redirect occurred while intercepting + /// request or auth retry occurred. + /// + [DataMember(Name = ("responseStatusCode"), IsRequired = (false))] + public int? ResponseStatusCode + { + get; + private set; + } + + /// + /// Response headers if intercepted at the response stage or if redirect occurred while + /// intercepting request or auth retry occurred. + /// + [DataMember(Name = ("responseHeaders"), IsRequired = (false))] + public CefSharp.DevTools.Network.Headers ResponseHeaders + { + get; + private set; + } + + /// + /// If the intercepted request had a corresponding requestWillBeSent event fired for it, then + /// this requestId will be the same as the requestId present in the requestWillBeSent event. + /// + [DataMember(Name = ("requestId"), IsRequired = (false))] + public string RequestId + { + get; + private set; + } + } + + /// + /// Fired if request ended up loading from cache. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class RequestServedFromCacheEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + } + + /// + /// Fired when page is about to send HTTP request. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class RequestWillBeSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Loader identifier. Empty string if the request is fetched from worker. + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + private set; + } + + /// + /// URL of the document this request is loaded for. + /// + [DataMember(Name = ("documentURL"), IsRequired = (true))] + public string DocumentURL + { + get; + private set; + } + + /// + /// Request data. + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Network.Request Request + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("wallTime"), IsRequired = (true))] + public double WallTime + { + get; + private set; + } + + /// + /// Request initiator. + /// + [DataMember(Name = ("initiator"), IsRequired = (true))] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + + /// + /// In the case that redirectResponse is populated, this flag indicates whether + /// requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted + /// for the request which was just redirected. + /// + [DataMember(Name = ("redirectHasExtraInfo"), IsRequired = (true))] + public bool RedirectHasExtraInfo + { + get; + private set; + } + + /// + /// Redirect response data. + /// + [DataMember(Name = ("redirectResponse"), IsRequired = (false))] + public CefSharp.DevTools.Network.Response RedirectResponse + { + get; + private set; + } + + /// + /// Type of this resource. + /// + public CefSharp.DevTools.Network.ResourceType? Type + { + get + { + return (CefSharp.DevTools.Network.ResourceType? )(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType? ), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type of this resource. + /// + [DataMember(Name = ("type"), IsRequired = (false))] + internal string type + { + get; + private set; + } + + /// + /// Frame identifier. + /// + [DataMember(Name = ("frameId"), IsRequired = (false))] + public string FrameId + { + get; + private set; + } + + /// + /// Whether the request is initiated by a user gesture. Defaults to false. + /// + [DataMember(Name = ("hasUserGesture"), IsRequired = (false))] + public bool? HasUserGesture + { + get; + private set; + } + + /// + /// The render blocking behavior of the request. + /// + public CefSharp.DevTools.Network.RenderBlockingBehavior? RenderBlockingBehavior + { + get + { + return (CefSharp.DevTools.Network.RenderBlockingBehavior? )(StringToEnum(typeof(CefSharp.DevTools.Network.RenderBlockingBehavior? ), renderBlockingBehavior)); + } + + set + { + this.renderBlockingBehavior = (EnumToString(value)); + } + } + + /// + /// The render blocking behavior of the request. + /// + [DataMember(Name = ("renderBlockingBehavior"), IsRequired = (false))] + internal string renderBlockingBehavior + { + get; + private set; + } + } + + /// + /// Fired when resource loading priority is changed + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ResourceChangedPriorityEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// New priority + /// + public CefSharp.DevTools.Network.ResourcePriority NewPriority + { + get + { + return (CefSharp.DevTools.Network.ResourcePriority)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourcePriority), newPriority)); + } + + set + { + this.newPriority = (EnumToString(value)); + } + } + + /// + /// New priority + /// + [DataMember(Name = ("newPriority"), IsRequired = (true))] + internal string newPriority + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when a signed exchange was received over the network + /// + [System.Runtime.Serialization.DataContractAttribute] + public class SignedExchangeReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Information about the signed exchange response. + /// + [DataMember(Name = ("info"), IsRequired = (true))] + public CefSharp.DevTools.Network.SignedExchangeInfo Info + { + get; + private set; + } + } + + /// + /// Fired when HTTP response is available. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ResponseReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Loader identifier. Empty string if the request is fetched from worker. + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Resource type. + /// + public CefSharp.DevTools.Network.ResourceType Type + { + get + { + return (CefSharp.DevTools.Network.ResourceType)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Resource type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// Response data. + /// + [DataMember(Name = ("response"), IsRequired = (true))] + public CefSharp.DevTools.Network.Response Response + { + get; + private set; + } + + /// + /// Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be + /// or were emitted for this request. + /// + [DataMember(Name = ("hasExtraInfo"), IsRequired = (true))] + public bool HasExtraInfo + { + get; + private set; + } + + /// + /// Frame identifier. + /// + [DataMember(Name = ("frameId"), IsRequired = (false))] + public string FrameId + { + get; + private set; + } + } + + /// + /// Fired when WebSocket is closed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebSocketClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired upon WebSocket creation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebSocketCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// WebSocket request URL. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Request initiator. + /// + [DataMember(Name = ("initiator"), IsRequired = (false))] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + } + + /// + /// Fired when WebSocket message error occurs. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebSocketFrameErrorEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// WebSocket error message. + /// + [DataMember(Name = ("errorMessage"), IsRequired = (true))] + public string ErrorMessage + { + get; + private set; + } + } + + /// + /// Fired when WebSocket message is received. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebSocketFrameReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// WebSocket response data. + /// + [DataMember(Name = ("response"), IsRequired = (true))] + public CefSharp.DevTools.Network.WebSocketFrame Response + { + get; + private set; + } + } + + /// + /// Fired when WebSocket message is sent. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebSocketFrameSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// WebSocket response data. + /// + [DataMember(Name = ("response"), IsRequired = (true))] + public CefSharp.DevTools.Network.WebSocketFrame Response + { + get; + private set; + } + } + + /// + /// Fired when WebSocket handshake response becomes available. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebSocketHandshakeResponseReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// WebSocket response data. + /// + [DataMember(Name = ("response"), IsRequired = (true))] + public CefSharp.DevTools.Network.WebSocketResponse Response + { + get; + private set; + } + } + + /// + /// Fired when WebSocket is about to initiate handshake. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebSocketWillSendHandshakeRequestEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// UTC Timestamp. + /// + [DataMember(Name = ("wallTime"), IsRequired = (true))] + public double WallTime + { + get; + private set; + } + + /// + /// WebSocket request data. + /// + [DataMember(Name = ("request"), IsRequired = (true))] + public CefSharp.DevTools.Network.WebSocketRequest Request + { + get; + private set; + } + } + + /// + /// Fired upon WebTransport creation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebTransportCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// WebTransport identifier. + /// + [DataMember(Name = ("transportId"), IsRequired = (true))] + public string TransportId + { + get; + private set; + } + + /// + /// WebTransport request URL. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Request initiator. + /// + [DataMember(Name = ("initiator"), IsRequired = (false))] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + } + + /// + /// Fired when WebTransport handshake is finished. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebTransportConnectionEstablishedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// WebTransport identifier. + /// + [DataMember(Name = ("transportId"), IsRequired = (true))] + public string TransportId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when WebTransport is disposed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WebTransportClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// WebTransport identifier. + /// + [DataMember(Name = ("transportId"), IsRequired = (true))] + public string TransportId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired upon direct_socket.TCPSocket creation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectTCPSocketCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// RemoteAddr + /// + [DataMember(Name = ("remoteAddr"), IsRequired = (true))] + public string RemoteAddr + { + get; + private set; + } + + /// + /// Unsigned int 16. + /// + [DataMember(Name = ("remotePort"), IsRequired = (true))] + public int RemotePort + { + get; + private set; + } + + /// + /// Options + /// + [DataMember(Name = ("options"), IsRequired = (true))] + public CefSharp.DevTools.Network.DirectTCPSocketOptions Options + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Initiator + /// + [DataMember(Name = ("initiator"), IsRequired = (false))] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.TCPSocket connection is opened. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectTCPSocketOpenedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// RemoteAddr + /// + [DataMember(Name = ("remoteAddr"), IsRequired = (true))] + public string RemoteAddr + { + get; + private set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("remotePort"), IsRequired = (true))] + public int RemotePort + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// LocalAddr + /// + [DataMember(Name = ("localAddr"), IsRequired = (false))] + public string LocalAddr + { + get; + private set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("localPort"), IsRequired = (false))] + public int? LocalPort + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.TCPSocket is aborted. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectTCPSocketAbortedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// ErrorMessage + /// + [DataMember(Name = ("errorMessage"), IsRequired = (true))] + public string ErrorMessage + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.TCPSocket is closed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectTCPSocketClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when data is sent to tcp direct socket stream. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectTCPSocketChunkSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when data is received from tcp direct socket stream. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectTCPSocketChunkReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// directUDPSocketJoinedMulticastGroup + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectUDPSocketJoinedMulticastGroupEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// IPAddress + /// + [DataMember(Name = ("IPAddress"), IsRequired = (true))] + public string IPAddress + { + get; + private set; + } + } + + /// + /// directUDPSocketLeftMulticastGroup + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectUDPSocketLeftMulticastGroupEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// IPAddress + /// + [DataMember(Name = ("IPAddress"), IsRequired = (true))] + public string IPAddress + { + get; + private set; + } + } + + /// + /// Fired upon direct_socket.UDPSocket creation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectUDPSocketCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// Options + /// + [DataMember(Name = ("options"), IsRequired = (true))] + public CefSharp.DevTools.Network.DirectUDPSocketOptions Options + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Initiator + /// + [DataMember(Name = ("initiator"), IsRequired = (false))] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.UDPSocket connection is opened. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectUDPSocketOpenedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// LocalAddr + /// + [DataMember(Name = ("localAddr"), IsRequired = (true))] + public string LocalAddr + { + get; + private set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("localPort"), IsRequired = (true))] + public int LocalPort + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// RemoteAddr + /// + [DataMember(Name = ("remoteAddr"), IsRequired = (false))] + public string RemoteAddr + { + get; + private set; + } + + /// + /// Expected to be unsigned integer. + /// + [DataMember(Name = ("remotePort"), IsRequired = (false))] + public int? RemotePort + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.UDPSocket is aborted. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectUDPSocketAbortedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// ErrorMessage + /// + [DataMember(Name = ("errorMessage"), IsRequired = (true))] + public string ErrorMessage + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.UDPSocket is closed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectUDPSocketClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when message is sent to udp direct socket stream. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectUDPSocketChunkSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// Message + /// + [DataMember(Name = ("message"), IsRequired = (true))] + public CefSharp.DevTools.Network.DirectUDPMessage Message + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when message is received from udp direct socket stream. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DirectUDPSocketChunkReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [DataMember(Name = ("identifier"), IsRequired = (true))] + public string Identifier + { + get; + private set; + } + + /// + /// Message + /// + [DataMember(Name = ("message"), IsRequired = (true))] + public CefSharp.DevTools.Network.DirectUDPMessage Message + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when additional information about a requestWillBeSent event is available from the + /// network stack. Not every requestWillBeSent event will have an additional + /// requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent + /// or requestWillBeSentExtraInfo will be fired first for the same request. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class RequestWillBeSentExtraInfoEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. Used to match this information to an existing requestWillBeSent event. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// A list of cookies potentially associated to the requested URL. This includes both cookies sent with + /// the request and the ones not sent; the latter are distinguished by having blockedReasons field set. + /// + [DataMember(Name = ("associatedCookies"), IsRequired = (true))] + public System.Collections.Generic.IList AssociatedCookies + { + get; + private set; + } + + /// + /// Raw request headers as they will be sent over the wire. + /// + [DataMember(Name = ("headers"), IsRequired = (true))] + public CefSharp.DevTools.Network.Headers Headers + { + get; + private set; + } + + /// + /// Connection timing information for the request. + /// + [DataMember(Name = ("connectTiming"), IsRequired = (true))] + public CefSharp.DevTools.Network.ConnectTiming ConnectTiming + { + get; + private set; + } + + /// + /// How the request site's device bound sessions were used during this request. + /// + [DataMember(Name = ("deviceBoundSessionUsages"), IsRequired = (false))] + public System.Collections.Generic.IList DeviceBoundSessionUsages + { + get; + private set; + } + + /// + /// The client security state set for the request. + /// + [DataMember(Name = ("clientSecurityState"), IsRequired = (false))] + public CefSharp.DevTools.Network.ClientSecurityState ClientSecurityState + { + get; + private set; + } + + /// + /// Whether the site has partitioned cookies stored in a partition different than the current one. + /// + [DataMember(Name = ("siteHasCookieInOtherPartition"), IsRequired = (false))] + public bool? SiteHasCookieInOtherPartition + { + get; + private set; + } + + /// + /// The network conditions id if this request was affected by network conditions configured via + /// emulateNetworkConditionsByRule. + /// + [DataMember(Name = ("appliedNetworkConditionsId"), IsRequired = (false))] + public string AppliedNetworkConditionsId + { + get; + private set; + } + } + + /// + /// Fired when additional information about a responseReceived event is available from the network + /// stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for + /// it, and responseReceivedExtraInfo may be fired before or after responseReceived. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ResponseReceivedExtraInfoEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. Used to match this information to another responseReceived event. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// A list of cookies which were not stored from the response along with the corresponding + /// reasons for blocking. The cookies here may not be valid due to syntax errors, which + /// are represented by the invalid cookie line string instead of a proper cookie. + /// + [DataMember(Name = ("blockedCookies"), IsRequired = (true))] + public System.Collections.Generic.IList BlockedCookies + { + get; + private set; + } + + /// + /// Raw response headers as they were received over the wire. + /// Duplicate headers in the response are represented as a single key with their values + /// concatentated using `\n` as the separator. + /// See also `headersText` that contains verbatim text for HTTP/1.*. + /// + [DataMember(Name = ("headers"), IsRequired = (true))] + public CefSharp.DevTools.Network.Headers Headers + { + get; + private set; + } + + /// + /// The IP address space of the resource. The address space can only be determined once the transport + /// established the connection, so we can't send it in `requestWillBeSentExtraInfo`. + /// + public CefSharp.DevTools.Network.IPAddressSpace ResourceIPAddressSpace + { + get + { + return (CefSharp.DevTools.Network.IPAddressSpace)(StringToEnum(typeof(CefSharp.DevTools.Network.IPAddressSpace), resourceIPAddressSpace)); + } + + set + { + this.resourceIPAddressSpace = (EnumToString(value)); + } + } + + /// + /// The IP address space of the resource. The address space can only be determined once the transport + /// established the connection, so we can't send it in `requestWillBeSentExtraInfo`. + /// + [DataMember(Name = ("resourceIPAddressSpace"), IsRequired = (true))] + internal string resourceIPAddressSpace + { + get; + private set; + } + + /// + /// The status code of the response. This is useful in cases the request failed and no responseReceived + /// event is triggered, which is the case for, e.g., CORS errors. This is also the correct status code + /// for cached requests, where the status in responseReceived is a 200 and this will be 304. + /// + [DataMember(Name = ("statusCode"), IsRequired = (true))] + public int StatusCode + { + get; + private set; + } + + /// + /// Raw response header text as it was received over the wire. The raw text may not always be + /// available, such as in the case of HTTP/2 or QUIC. + /// + [DataMember(Name = ("headersText"), IsRequired = (false))] + public string HeadersText + { + get; + private set; + } + + /// + /// The cookie partition key that will be used to store partitioned cookies set in this response. + /// Only sent when partitioned cookies are enabled. + /// + [DataMember(Name = ("cookiePartitionKey"), IsRequired = (false))] + public CefSharp.DevTools.Network.CookiePartitionKey CookiePartitionKey + { + get; + private set; + } + + /// + /// True if partitioned cookies are enabled, but the partition key is not serializable to string. + /// + [DataMember(Name = ("cookiePartitionKeyOpaque"), IsRequired = (false))] + public bool? CookiePartitionKeyOpaque + { + get; + private set; + } + + /// + /// A list of cookies which should have been blocked by 3PCD but are exempted and stored from + /// the response with the corresponding reason. + /// + [DataMember(Name = ("exemptedCookies"), IsRequired = (false))] + public System.Collections.Generic.IList ExemptedCookies + { + get; + private set; + } + } + + /// + /// Fired when 103 Early Hints headers is received in addition to the common response. + /// Not every responseReceived event will have an responseReceivedEarlyHints fired. + /// Only one responseReceivedEarlyHints may be fired for eached responseReceived event. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ResponseReceivedEarlyHintsEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. Used to match this information to another responseReceived event. + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Raw response headers as they were received over the wire. + /// Duplicate headers in the response are represented as a single key with their values + /// concatentated using `\n` as the separator. + /// See also `headersText` that contains verbatim text for HTTP/1.*. + /// + [DataMember(Name = ("headers"), IsRequired = (true))] + public CefSharp.DevTools.Network.Headers Headers + { + get; + private set; + } + } + + /// + /// Detailed success or error status of the operation. + /// 'AlreadyExists' also signifies a successful operation, as the result + /// of the operation already exists und thus, the operation was abort + /// preemptively (e.g. a cache hit). + /// + public enum TrustTokenOperationDoneStatus + { + /// + /// Ok + /// + [EnumMember(Value = ("Ok"))] + Ok, + /// + /// InvalidArgument + /// + [EnumMember(Value = ("InvalidArgument"))] + InvalidArgument, + /// + /// MissingIssuerKeys + /// + [EnumMember(Value = ("MissingIssuerKeys"))] + MissingIssuerKeys, + /// + /// FailedPrecondition + /// + [EnumMember(Value = ("FailedPrecondition"))] + FailedPrecondition, + /// + /// ResourceExhausted + /// + [EnumMember(Value = ("ResourceExhausted"))] + ResourceExhausted, + /// + /// AlreadyExists + /// + [EnumMember(Value = ("AlreadyExists"))] + AlreadyExists, + /// + /// ResourceLimited + /// + [EnumMember(Value = ("ResourceLimited"))] + ResourceLimited, + /// + /// Unauthorized + /// + [EnumMember(Value = ("Unauthorized"))] + Unauthorized, + /// + /// BadResponse + /// + [EnumMember(Value = ("BadResponse"))] + BadResponse, + /// + /// InternalError + /// + [EnumMember(Value = ("InternalError"))] + InternalError, + /// + /// UnknownError + /// + [EnumMember(Value = ("UnknownError"))] + UnknownError, + /// + /// FulfilledLocally + /// + [EnumMember(Value = ("FulfilledLocally"))] + FulfilledLocally, + /// + /// SiteIssuerLimit + /// + [EnumMember(Value = ("SiteIssuerLimit"))] + SiteIssuerLimit + } + + /// + /// Fired exactly once for each Trust Token operation. Depending on + /// the type of the operation and whether the operation succeeded or + /// failed, the event is fired before the corresponding request was sent + /// or after the response was received. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class TrustTokenOperationDoneEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Detailed success or error status of the operation. + /// 'AlreadyExists' also signifies a successful operation, as the result + /// of the operation already exists und thus, the operation was abort + /// preemptively (e.g. a cache hit). + /// + public CefSharp.DevTools.Network.TrustTokenOperationDoneStatus Status + { + get + { + return (CefSharp.DevTools.Network.TrustTokenOperationDoneStatus)(StringToEnum(typeof(CefSharp.DevTools.Network.TrustTokenOperationDoneStatus), status)); + } + + set + { + this.status = (EnumToString(value)); + } + } + + /// + /// Detailed success or error status of the operation. + /// 'AlreadyExists' also signifies a successful operation, as the result + /// of the operation already exists und thus, the operation was abort + /// preemptively (e.g. a cache hit). + /// + [DataMember(Name = ("status"), IsRequired = (true))] + internal string status + { + get; + private set; + } + + /// + /// Type + /// + public CefSharp.DevTools.Network.TrustTokenOperationType Type + { + get + { + return (CefSharp.DevTools.Network.TrustTokenOperationType)(StringToEnum(typeof(CefSharp.DevTools.Network.TrustTokenOperationType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Top level origin. The context in which the operation was attempted. + /// + [DataMember(Name = ("topLevelOrigin"), IsRequired = (false))] + public string TopLevelOrigin + { + get; + private set; + } + + /// + /// Origin of the issuer in case of a "Issuance" or "Redemption" operation. + /// + [DataMember(Name = ("issuerOrigin"), IsRequired = (false))] + public string IssuerOrigin + { + get; + private set; + } + + /// + /// The number of obtained Trust Tokens on a successful "Issuance" operation. + /// + [DataMember(Name = ("issuedTokenCount"), IsRequired = (false))] + public int? IssuedTokenCount + { + get; + private set; + } + } + + /// + /// Is sent whenever a new report is added. + /// And after 'enableReportingApi' for all existing reports. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ReportingApiReportAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Report + /// + [DataMember(Name = ("report"), IsRequired = (true))] + public CefSharp.DevTools.Network.ReportingApiReport Report + { + get; + private set; + } + } + + /// + /// reportingApiReportUpdated + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ReportingApiReportUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Report + /// + [DataMember(Name = ("report"), IsRequired = (true))] + public CefSharp.DevTools.Network.ReportingApiReport Report + { + get; + private set; + } + } + + /// + /// reportingApiEndpointsChangedForOrigin + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ReportingApiEndpointsChangedForOriginEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin of the document(s) which configured the endpoints. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + private set; + } + + /// + /// Endpoints + /// + [DataMember(Name = ("endpoints"), IsRequired = (true))] + public System.Collections.Generic.IList Endpoints + { + get; + private set; + } + } + + /// + /// Triggered when the initial set of device bound sessions is added. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DeviceBoundSessionsAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The device bound sessions. + /// + [DataMember(Name = ("sessions"), IsRequired = (true))] + public System.Collections.Generic.IList Sessions + { + get; + private set; + } + } + + /// + /// Triggered when a device bound session event occurs. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DeviceBoundSessionEventOccurredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// A unique identifier for this session event. + /// + [DataMember(Name = ("eventId"), IsRequired = (true))] + public string EventId + { + get; + private set; + } + + /// + /// The site this session event is associated with. + /// + [DataMember(Name = ("site"), IsRequired = (true))] + public string Site + { + get; + private set; + } + + /// + /// Whether this event was considered successful. + /// + [DataMember(Name = ("succeeded"), IsRequired = (true))] + public bool Succeeded + { + get; + private set; + } + + /// + /// The session ID this event is associated with. May not be populated for + /// failed events. + /// + [DataMember(Name = ("sessionId"), IsRequired = (false))] + public string SessionId + { + get; + private set; + } + + /// + /// The below are the different session event type details. Exactly one is populated. + /// + [DataMember(Name = ("creationEventDetails"), IsRequired = (false))] + public CefSharp.DevTools.Network.CreationEventDetails CreationEventDetails + { + get; + private set; + } + + /// + /// RefreshEventDetails + /// + [DataMember(Name = ("refreshEventDetails"), IsRequired = (false))] + public CefSharp.DevTools.Network.RefreshEventDetails RefreshEventDetails + { + get; + private set; + } + + /// + /// TerminationEventDetails + /// + [DataMember(Name = ("terminationEventDetails"), IsRequired = (false))] + public CefSharp.DevTools.Network.TerminationEventDetails TerminationEventDetails + { + get; + private set; + } + + /// + /// ChallengeEventDetails + /// + [DataMember(Name = ("challengeEventDetails"), IsRequired = (false))] + public CefSharp.DevTools.Network.ChallengeEventDetails ChallengeEventDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + /// + /// Configuration data for drawing the source order of an elements children. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SourceOrderConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// the color to outline the given element in. + /// + [DataMember(Name = ("parentOutlineColor"), IsRequired = (true))] + public CefSharp.DevTools.DOM.RGBA ParentOutlineColor + { + get; + set; + } + + /// + /// the color to outline the child elements in. + /// + [DataMember(Name = ("childOutlineColor"), IsRequired = (true))] + public CefSharp.DevTools.DOM.RGBA ChildOutlineColor + { + get; + set; + } + } + + /// + /// Configuration data for the highlighting of Grid elements. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class GridHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Whether the extension lines from grid cells to the rulers should be shown (default: false). + /// + [DataMember(Name = ("showGridExtensionLines"), IsRequired = (false))] + public bool? ShowGridExtensionLines + { + get; + set; + } + + /// + /// Show Positive line number labels (default: false). + /// + [DataMember(Name = ("showPositiveLineNumbers"), IsRequired = (false))] + public bool? ShowPositiveLineNumbers + { + get; + set; + } + + /// + /// Show Negative line number labels (default: false). + /// + [DataMember(Name = ("showNegativeLineNumbers"), IsRequired = (false))] + public bool? ShowNegativeLineNumbers + { + get; + set; + } + + /// + /// Show area name labels (default: false). + /// + [DataMember(Name = ("showAreaNames"), IsRequired = (false))] + public bool? ShowAreaNames + { + get; + set; + } + + /// + /// Show line name labels (default: false). + /// + [DataMember(Name = ("showLineNames"), IsRequired = (false))] + public bool? ShowLineNames + { + get; + set; + } + + /// + /// Show track size labels (default: false). + /// + [DataMember(Name = ("showTrackSizes"), IsRequired = (false))] + public bool? ShowTrackSizes + { + get; + set; + } + + /// + /// The grid container border highlight color (default: transparent). + /// + [DataMember(Name = ("gridBorderColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA GridBorderColor + { + get; + set; + } + + /// + /// The cell border color (default: transparent). Deprecated, please use rowLineColor and columnLineColor instead. + /// + [DataMember(Name = ("cellBorderColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA CellBorderColor + { + get; + set; + } + + /// + /// The row line color (default: transparent). + /// + [DataMember(Name = ("rowLineColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA RowLineColor + { + get; + set; + } + + /// + /// The column line color (default: transparent). + /// + [DataMember(Name = ("columnLineColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ColumnLineColor + { + get; + set; + } + + /// + /// Whether the grid border is dashed (default: false). + /// + [DataMember(Name = ("gridBorderDash"), IsRequired = (false))] + public bool? GridBorderDash + { + get; + set; + } + + /// + /// Whether the cell border is dashed (default: false). Deprecated, please us rowLineDash and columnLineDash instead. + /// + [DataMember(Name = ("cellBorderDash"), IsRequired = (false))] + public bool? CellBorderDash + { + get; + set; + } + + /// + /// Whether row lines are dashed (default: false). + /// + [DataMember(Name = ("rowLineDash"), IsRequired = (false))] + public bool? RowLineDash + { + get; + set; + } + + /// + /// Whether column lines are dashed (default: false). + /// + [DataMember(Name = ("columnLineDash"), IsRequired = (false))] + public bool? ColumnLineDash + { + get; + set; + } + + /// + /// The row gap highlight fill color (default: transparent). + /// + [DataMember(Name = ("rowGapColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA RowGapColor + { + get; + set; + } + + /// + /// The row gap hatching fill color (default: transparent). + /// + [DataMember(Name = ("rowHatchColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA RowHatchColor + { + get; + set; + } + + /// + /// The column gap highlight fill color (default: transparent). + /// + [DataMember(Name = ("columnGapColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ColumnGapColor + { + get; + set; + } + + /// + /// The column gap hatching fill color (default: transparent). + /// + [DataMember(Name = ("columnHatchColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ColumnHatchColor + { + get; + set; + } + + /// + /// The named grid areas border color (Default: transparent). + /// + [DataMember(Name = ("areaBorderColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA AreaBorderColor + { + get; + set; + } + + /// + /// The grid container background color (Default: transparent). + /// + [DataMember(Name = ("gridBackgroundColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA GridBackgroundColor + { + get; + set; + } + } + + /// + /// Configuration data for the highlighting of Flex container elements. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FlexContainerHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The style of the container border + /// + [DataMember(Name = ("containerBorder"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle ContainerBorder + { + get; + set; + } + + /// + /// The style of the separator between lines + /// + [DataMember(Name = ("lineSeparator"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle LineSeparator + { + get; + set; + } + + /// + /// The style of the separator between items + /// + [DataMember(Name = ("itemSeparator"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle ItemSeparator + { + get; + set; + } + + /// + /// Style of content-distribution space on the main axis (justify-content). + /// + [DataMember(Name = ("mainDistributedSpace"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.BoxStyle MainDistributedSpace + { + get; + set; + } + + /// + /// Style of content-distribution space on the cross axis (align-content). + /// + [DataMember(Name = ("crossDistributedSpace"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.BoxStyle CrossDistributedSpace + { + get; + set; + } + + /// + /// Style of empty space caused by row gaps (gap/row-gap). + /// + [DataMember(Name = ("rowGapSpace"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.BoxStyle RowGapSpace + { + get; + set; + } + + /// + /// Style of empty space caused by columns gaps (gap/column-gap). + /// + [DataMember(Name = ("columnGapSpace"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.BoxStyle ColumnGapSpace + { + get; + set; + } + + /// + /// Style of the self-alignment line (align-items). + /// + [DataMember(Name = ("crossAlignment"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle CrossAlignment + { + get; + set; + } + } + + /// + /// Configuration data for the highlighting of Flex item elements. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FlexItemHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Style of the box representing the item's base size + /// + [DataMember(Name = ("baseSizeBox"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.BoxStyle BaseSizeBox + { + get; + set; + } + + /// + /// Style of the border around the box representing the item's base size + /// + [DataMember(Name = ("baseSizeBorder"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle BaseSizeBorder + { + get; + set; + } + + /// + /// Style of the arrow representing if the item grew or shrank + /// + [DataMember(Name = ("flexibilityArrow"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle FlexibilityArrow + { + get; + set; + } + } + + /// + /// The line pattern (default: solid) + /// + public enum LineStylePattern + { + /// + /// dashed + /// + [EnumMember(Value = ("dashed"))] + Dashed, + /// + /// dotted + /// + [EnumMember(Value = ("dotted"))] + Dotted + } + + /// + /// Style information for drawing a line. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LineStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The color of the line (default: transparent) + /// + [DataMember(Name = ("color"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA Color + { + get; + set; + } + + /// + /// The line pattern (default: solid) + /// + public CefSharp.DevTools.Overlay.LineStylePattern? Pattern + { + get + { + return (CefSharp.DevTools.Overlay.LineStylePattern? )(StringToEnum(typeof(CefSharp.DevTools.Overlay.LineStylePattern? ), pattern)); + } + + set + { + this.pattern = (EnumToString(value)); + } + } + + /// + /// The line pattern (default: solid) + /// + [DataMember(Name = ("pattern"), IsRequired = (false))] + internal string pattern + { + get; + set; + } + } + + /// + /// Style information for drawing a box. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BoxStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The background color for the box (default: transparent) + /// + [DataMember(Name = ("fillColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA FillColor + { + get; + set; + } + + /// + /// The hatching color for the box (default: transparent) + /// + [DataMember(Name = ("hatchColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA HatchColor + { + get; + set; + } + } + + /// + /// ContrastAlgorithm + /// + public enum ContrastAlgorithm + { + /// + /// aa + /// + [EnumMember(Value = ("aa"))] + Aa, + /// + /// aaa + /// + [EnumMember(Value = ("aaa"))] + Aaa, + /// + /// apca + /// + [EnumMember(Value = ("apca"))] + Apca + } + + /// + /// Configuration data for the highlighting of page elements. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class HighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Whether the node info tooltip should be shown (default: false). + /// + [DataMember(Name = ("showInfo"), IsRequired = (false))] + public bool? ShowInfo + { + get; + set; + } + + /// + /// Whether the node styles in the tooltip (default: false). + /// + [DataMember(Name = ("showStyles"), IsRequired = (false))] + public bool? ShowStyles + { + get; + set; + } + + /// + /// Whether the rulers should be shown (default: false). + /// + [DataMember(Name = ("showRulers"), IsRequired = (false))] + public bool? ShowRulers + { + get; + set; + } + + /// + /// Whether the a11y info should be shown (default: true). + /// + [DataMember(Name = ("showAccessibilityInfo"), IsRequired = (false))] + public bool? ShowAccessibilityInfo + { + get; + set; + } + + /// + /// Whether the extension lines from node to the rulers should be shown (default: false). + /// + [DataMember(Name = ("showExtensionLines"), IsRequired = (false))] + public bool? ShowExtensionLines + { + get; + set; + } + + /// + /// The content box highlight fill color (default: transparent). + /// + [DataMember(Name = ("contentColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ContentColor + { + get; + set; + } + + /// + /// The padding highlight fill color (default: transparent). + /// + [DataMember(Name = ("paddingColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA PaddingColor + { + get; + set; + } + + /// + /// The border highlight fill color (default: transparent). + /// + [DataMember(Name = ("borderColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA BorderColor + { + get; + set; + } + + /// + /// The margin highlight fill color (default: transparent). + /// + [DataMember(Name = ("marginColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA MarginColor + { + get; + set; + } + + /// + /// The event target element highlight fill color (default: transparent). + /// + [DataMember(Name = ("eventTargetColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA EventTargetColor + { + get; + set; + } + + /// + /// The shape outside fill color (default: transparent). + /// + [DataMember(Name = ("shapeColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ShapeColor + { + get; + set; + } + + /// + /// The shape margin fill color (default: transparent). + /// + [DataMember(Name = ("shapeMarginColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ShapeMarginColor + { + get; + set; + } + + /// + /// The grid layout color (default: transparent). + /// + [DataMember(Name = ("cssGridColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA CssGridColor + { + get; + set; + } + + /// + /// The color format used to format color styles (default: hex). + /// + public CefSharp.DevTools.Overlay.ColorFormat? ColorFormat + { + get + { + return (CefSharp.DevTools.Overlay.ColorFormat? )(StringToEnum(typeof(CefSharp.DevTools.Overlay.ColorFormat? ), colorFormat)); + } + + set + { + this.colorFormat = (EnumToString(value)); + } + } + + /// + /// The color format used to format color styles (default: hex). + /// + [DataMember(Name = ("colorFormat"), IsRequired = (false))] + internal string colorFormat + { + get; + set; + } + + /// + /// The grid layout highlight configuration (default: all transparent). + /// + [DataMember(Name = ("gridHighlightConfig"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.GridHighlightConfig GridHighlightConfig + { + get; + set; + } + + /// + /// The flex container highlight configuration (default: all transparent). + /// + [DataMember(Name = ("flexContainerHighlightConfig"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.FlexContainerHighlightConfig FlexContainerHighlightConfig + { + get; + set; + } + + /// + /// The flex item highlight configuration (default: all transparent). + /// + [DataMember(Name = ("flexItemHighlightConfig"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.FlexItemHighlightConfig FlexItemHighlightConfig + { + get; + set; + } + + /// + /// The contrast algorithm to use for the contrast ratio (default: aa). + /// + public CefSharp.DevTools.Overlay.ContrastAlgorithm? ContrastAlgorithm + { + get + { + return (CefSharp.DevTools.Overlay.ContrastAlgorithm? )(StringToEnum(typeof(CefSharp.DevTools.Overlay.ContrastAlgorithm? ), contrastAlgorithm)); + } + + set + { + this.contrastAlgorithm = (EnumToString(value)); + } + } + + /// + /// The contrast algorithm to use for the contrast ratio (default: aa). + /// + [DataMember(Name = ("contrastAlgorithm"), IsRequired = (false))] + internal string contrastAlgorithm + { + get; + set; + } + + /// + /// The container query container highlight configuration (default: all transparent). + /// + [DataMember(Name = ("containerQueryContainerHighlightConfig"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.ContainerQueryContainerHighlightConfig ContainerQueryContainerHighlightConfig + { + get; + set; + } + } + + /// + /// ColorFormat + /// + public enum ColorFormat + { + /// + /// rgb + /// + [EnumMember(Value = ("rgb"))] + Rgb, + /// + /// hsl + /// + [EnumMember(Value = ("hsl"))] + Hsl, + /// + /// hwb + /// + [EnumMember(Value = ("hwb"))] + Hwb, + /// + /// hex + /// + [EnumMember(Value = ("hex"))] + Hex + } + + /// + /// Configurations for Persistent Grid Highlight + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class GridNodeHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance. + /// + [DataMember(Name = ("gridHighlightConfig"), IsRequired = (true))] + public CefSharp.DevTools.Overlay.GridHighlightConfig GridHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the node to highlight. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + set; + } + } + + /// + /// FlexNodeHighlightConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FlexNodeHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance of flex containers. + /// + [DataMember(Name = ("flexContainerHighlightConfig"), IsRequired = (true))] + public CefSharp.DevTools.Overlay.FlexContainerHighlightConfig FlexContainerHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the node to highlight. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + set; + } + } + + /// + /// ScrollSnapContainerHighlightConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScrollSnapContainerHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The style of the snapport border (default: transparent) + /// + [DataMember(Name = ("snapportBorder"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle SnapportBorder + { + get; + set; + } + + /// + /// The style of the snap area border (default: transparent) + /// + [DataMember(Name = ("snapAreaBorder"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle SnapAreaBorder + { + get; + set; + } + + /// + /// The margin highlight fill color (default: transparent). + /// + [DataMember(Name = ("scrollMarginColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ScrollMarginColor + { + get; + set; + } + + /// + /// The padding highlight fill color (default: transparent). + /// + [DataMember(Name = ("scrollPaddingColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ScrollPaddingColor + { + get; + set; + } + } + + /// + /// ScrollSnapHighlightConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScrollSnapHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance of scroll snap containers. + /// + [DataMember(Name = ("scrollSnapContainerHighlightConfig"), IsRequired = (true))] + public CefSharp.DevTools.Overlay.ScrollSnapContainerHighlightConfig ScrollSnapContainerHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the node to highlight. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + set; + } + } + + /// + /// Configuration for dual screen hinge + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class HingeConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A rectangle represent hinge + /// + [DataMember(Name = ("rect"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect Rect + { + get; + set; + } + + /// + /// The content box highlight fill color (default: a dark color). + /// + [DataMember(Name = ("contentColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ContentColor + { + get; + set; + } + + /// + /// The content box highlight outline color (default: transparent). + /// + [DataMember(Name = ("outlineColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA OutlineColor + { + get; + set; + } + } + + /// + /// Configuration for Window Controls Overlay + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class WindowControlsOverlayConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Whether the title bar CSS should be shown when emulating the Window Controls Overlay. + /// + [DataMember(Name = ("showCSS"), IsRequired = (true))] + public bool ShowCSS + { + get; + set; + } + + /// + /// Selected platforms to show the overlay. + /// + [DataMember(Name = ("selectedPlatform"), IsRequired = (true))] + public string SelectedPlatform + { + get; + set; + } + + /// + /// The theme color defined in app manifest. + /// + [DataMember(Name = ("themeColor"), IsRequired = (true))] + public string ThemeColor + { + get; + set; + } + } + + /// + /// ContainerQueryHighlightConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ContainerQueryHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance of container query containers. + /// + [DataMember(Name = ("containerQueryContainerHighlightConfig"), IsRequired = (true))] + public CefSharp.DevTools.Overlay.ContainerQueryContainerHighlightConfig ContainerQueryContainerHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the container node to highlight. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + set; + } + } + + /// + /// ContainerQueryContainerHighlightConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ContainerQueryContainerHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The style of the container border. + /// + [DataMember(Name = ("containerBorder"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle ContainerBorder + { + get; + set; + } + + /// + /// The style of the descendants' borders. + /// + [DataMember(Name = ("descendantBorder"), IsRequired = (false))] + public CefSharp.DevTools.Overlay.LineStyle DescendantBorder + { + get; + set; + } + } + + /// + /// IsolatedElementHighlightConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class IsolatedElementHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance of an element in isolation mode. + /// + [DataMember(Name = ("isolationModeHighlightConfig"), IsRequired = (true))] + public CefSharp.DevTools.Overlay.IsolationModeHighlightConfig IsolationModeHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the isolated element to highlight. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + set; + } + } + + /// + /// IsolationModeHighlightConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class IsolationModeHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The fill color of the resizers (default: transparent). + /// + [DataMember(Name = ("resizerColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ResizerColor + { + get; + set; + } + + /// + /// The fill color for resizer handles (default: transparent). + /// + [DataMember(Name = ("resizerHandleColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA ResizerHandleColor + { + get; + set; + } + + /// + /// The fill color for the mask covering non-isolated elements (default: transparent). + /// + [DataMember(Name = ("maskColor"), IsRequired = (false))] + public CefSharp.DevTools.DOM.RGBA MaskColor + { + get; + set; + } + } + + /// + /// InspectMode + /// + public enum InspectMode + { + /// + /// searchForNode + /// + [EnumMember(Value = ("searchForNode"))] + SearchForNode, + /// + /// searchForUAShadowDOM + /// + [EnumMember(Value = ("searchForUAShadowDOM"))] + SearchForUAShadowDOM, + /// + /// captureAreaScreenshot + /// + [EnumMember(Value = ("captureAreaScreenshot"))] + CaptureAreaScreenshot, + /// + /// none + /// + [EnumMember(Value = ("none"))] + None + } + + /// + /// InspectedElementAnchorConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InspectedElementAnchorConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Identifier of the node to highlight. + /// + [DataMember(Name = ("nodeId"), IsRequired = (false))] + public int? NodeId + { + get; + set; + } + + /// + /// Identifier of the backend node to highlight. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (false))] + public int? BackendNodeId + { + get; + set; + } + } + + /// + /// Fired when the node should be inspected. This happens after call to `setInspectMode` or when + /// user manually inspects an element. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class InspectNodeRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node to inspect. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (true))] + public int BackendNodeId + { + get; + private set; + } + } + + /// + /// Fired when the node should be highlighted. This happens after call to `setInspectMode`. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class NodeHighlightRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// NodeId + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + private set; + } + } + + /// + /// Fired when user asks to capture screenshot of some area on the page. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ScreenshotRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Viewport to capture, in device independent pixels (dip). + /// + [DataMember(Name = ("viewport"), IsRequired = (true))] + public CefSharp.DevTools.Page.Viewport Viewport + { + get; + private set; + } + } + + /// + /// Fired when user asks to show the Inspect panel. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class InspectPanelShowRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node to show in the panel. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (true))] + public int BackendNodeId + { + get; + private set; + } + } + + /// + /// Fired when user asks to restore the Inspected Element floating window. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class InspectedElementWindowRestoredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node to restore the floating window for. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (true))] + public int BackendNodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.PWA +{ + /// + /// The following types are the replica of + /// https://crsrc.org/c/chrome/browser/web_applications/proto/web_app_os_integration_state.proto;drc=9910d3be894c8f142c977ba1023f30a656bc13fc;l=67 + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FileHandlerAccept : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// New name of the mimetype according to + /// https://www.iana.org/assignments/media-types/media-types.xhtml + /// + [DataMember(Name = ("mediaType"), IsRequired = (true))] + public string MediaType + { + get; + set; + } + + /// + /// FileExtensions + /// + [DataMember(Name = ("fileExtensions"), IsRequired = (true))] + public string[] FileExtensions + { + get; + set; + } + } + + /// + /// FileHandler + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FileHandler : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Action + /// + [DataMember(Name = ("action"), IsRequired = (true))] + public string Action + { + get; + set; + } + + /// + /// Accepts + /// + [DataMember(Name = ("accepts"), IsRequired = (true))] + public System.Collections.Generic.IList Accepts + { + get; + set; + } + + /// + /// DisplayName + /// + [DataMember(Name = ("displayName"), IsRequired = (true))] + public string DisplayName + { + get; + set; + } + } + + /// + /// If user prefers opening the app in browser or an app window. + /// + public enum DisplayMode + { + /// + /// standalone + /// + [EnumMember(Value = ("standalone"))] + Standalone, + /// + /// browser + /// + [EnumMember(Value = ("browser"))] + Browser + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// Indicates whether a frame has been identified as an ad. + /// + public enum AdFrameType + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// child + /// + [EnumMember(Value = ("child"))] + Child, + /// + /// root + /// + [EnumMember(Value = ("root"))] + Root + } + + /// + /// AdFrameExplanation + /// + public enum AdFrameExplanation + { + /// + /// ParentIsAd + /// + [EnumMember(Value = ("ParentIsAd"))] + ParentIsAd, + /// + /// CreatedByAdScript + /// + [EnumMember(Value = ("CreatedByAdScript"))] + CreatedByAdScript, + /// + /// MatchedBlockingRule + /// + [EnumMember(Value = ("MatchedBlockingRule"))] + MatchedBlockingRule + } + + /// + /// Indicates whether a frame has been identified as an ad and why. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AdFrameStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// AdFrameType + /// + public CefSharp.DevTools.Page.AdFrameType AdFrameType + { + get + { + return (CefSharp.DevTools.Page.AdFrameType)(StringToEnum(typeof(CefSharp.DevTools.Page.AdFrameType), adFrameType)); + } + + set + { + this.adFrameType = (EnumToString(value)); + } + } + + /// + /// AdFrameType + /// + [DataMember(Name = ("adFrameType"), IsRequired = (true))] + internal string adFrameType + { + get; + set; + } + + /// + /// Explanations + /// + public CefSharp.DevTools.Page.AdFrameExplanation[] Explanations + { + get + { + return (CefSharp.DevTools.Page.AdFrameExplanation[])(StringToEnum(typeof(CefSharp.DevTools.Page.AdFrameExplanation[]), explanations)); + } + + set + { + this.explanations = (EnumToString(value)); + } + } + + /// + /// Explanations + /// + [DataMember(Name = ("explanations"), IsRequired = (false))] + internal string explanations + { + get; + set; + } + } + + /// + /// Identifies the script which caused a script or frame to be labelled as an + /// ad. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AdScriptId : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Script Id of the script which caused a script or frame to be labelled as + /// an ad. + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + set; + } + + /// + /// Id of scriptId's debugger. + /// + [DataMember(Name = ("debuggerId"), IsRequired = (true))] + public string DebuggerId + { + get; + set; + } + } + + /// + /// Encapsulates the script ancestry and the root script filterlist rule that + /// caused the frame to be labelled as an ad. Only created when `ancestryChain` + /// is not empty. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AdScriptAncestry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A chain of `AdScriptId`s representing the ancestry of an ad script that + /// led to the creation of a frame. The chain is ordered from the script + /// itself (lower level) up to its root ancestor that was flagged by + /// filterlist. + /// + [DataMember(Name = ("ancestryChain"), IsRequired = (true))] + public System.Collections.Generic.IList AncestryChain + { + get; + set; + } + + /// + /// The filterlist rule that caused the root (last) script in + /// `ancestryChain` to be ad-tagged. Only populated if the rule is + /// available. + /// + [DataMember(Name = ("rootScriptFilterlistRule"), IsRequired = (false))] + public string RootScriptFilterlistRule + { + get; + set; + } + } + + /// + /// Indicates whether the frame is a secure context and why it is the case. + /// + public enum SecureContextType + { + /// + /// Secure + /// + [EnumMember(Value = ("Secure"))] + Secure, + /// + /// SecureLocalhost + /// + [EnumMember(Value = ("SecureLocalhost"))] + SecureLocalhost, + /// + /// InsecureScheme + /// + [EnumMember(Value = ("InsecureScheme"))] + InsecureScheme, + /// + /// InsecureAncestor + /// + [EnumMember(Value = ("InsecureAncestor"))] + InsecureAncestor + } + + /// + /// Indicates whether the frame is cross-origin isolated and why it is the case. + /// + public enum CrossOriginIsolatedContextType + { + /// + /// Isolated + /// + [EnumMember(Value = ("Isolated"))] + Isolated, + /// + /// NotIsolated + /// + [EnumMember(Value = ("NotIsolated"))] + NotIsolated, + /// + /// NotIsolatedFeatureDisabled + /// + [EnumMember(Value = ("NotIsolatedFeatureDisabled"))] + NotIsolatedFeatureDisabled + } + + /// + /// GatedAPIFeatures + /// + public enum GatedAPIFeatures + { + /// + /// SharedArrayBuffers + /// + [EnumMember(Value = ("SharedArrayBuffers"))] + SharedArrayBuffers, + /// + /// SharedArrayBuffersTransferAllowed + /// + [EnumMember(Value = ("SharedArrayBuffersTransferAllowed"))] + SharedArrayBuffersTransferAllowed, + /// + /// PerformanceMeasureMemory + /// + [EnumMember(Value = ("PerformanceMeasureMemory"))] + PerformanceMeasureMemory, + /// + /// PerformanceProfile + /// + [EnumMember(Value = ("PerformanceProfile"))] + PerformanceProfile + } + + /// + /// All Permissions Policy features. This enum should match the one defined + /// in services/network/public/cpp/permissions_policy/permissions_policy_features.json5. + /// LINT.IfChange(PermissionsPolicyFeature) + /// + public enum PermissionsPolicyFeature + { + /// + /// accelerometer + /// + [EnumMember(Value = ("accelerometer"))] + Accelerometer, + /// + /// all-screens-capture + /// + [EnumMember(Value = ("all-screens-capture"))] + AllScreensCapture, + /// + /// ambient-light-sensor + /// + [EnumMember(Value = ("ambient-light-sensor"))] + AmbientLightSensor, + /// + /// aria-notify + /// + [EnumMember(Value = ("aria-notify"))] + AriaNotify, + /// + /// attribution-reporting + /// + [EnumMember(Value = ("attribution-reporting"))] + AttributionReporting, + /// + /// autofill + /// + [EnumMember(Value = ("autofill"))] + Autofill, + /// + /// autoplay + /// + [EnumMember(Value = ("autoplay"))] + Autoplay, + /// + /// bluetooth + /// + [EnumMember(Value = ("bluetooth"))] + Bluetooth, + /// + /// browsing-topics + /// + [EnumMember(Value = ("browsing-topics"))] + BrowsingTopics, + /// + /// camera + /// + [EnumMember(Value = ("camera"))] + Camera, + /// + /// captured-surface-control + /// + [EnumMember(Value = ("captured-surface-control"))] + CapturedSurfaceControl, + /// + /// ch-dpr + /// + [EnumMember(Value = ("ch-dpr"))] + ChDpr, + /// + /// ch-device-memory + /// + [EnumMember(Value = ("ch-device-memory"))] + ChDeviceMemory, + /// + /// ch-downlink + /// + [EnumMember(Value = ("ch-downlink"))] + ChDownlink, + /// + /// ch-ect + /// + [EnumMember(Value = ("ch-ect"))] + ChEct, + /// + /// ch-prefers-color-scheme + /// + [EnumMember(Value = ("ch-prefers-color-scheme"))] + ChPrefersColorScheme, + /// + /// ch-prefers-reduced-motion + /// + [EnumMember(Value = ("ch-prefers-reduced-motion"))] + ChPrefersReducedMotion, + /// + /// ch-prefers-reduced-transparency + /// + [EnumMember(Value = ("ch-prefers-reduced-transparency"))] + ChPrefersReducedTransparency, + /// + /// ch-rtt + /// + [EnumMember(Value = ("ch-rtt"))] + ChRtt, + /// + /// ch-save-data + /// + [EnumMember(Value = ("ch-save-data"))] + ChSaveData, + /// + /// ch-ua + /// + [EnumMember(Value = ("ch-ua"))] + ChUa, + /// + /// ch-ua-arch + /// + [EnumMember(Value = ("ch-ua-arch"))] + ChUaArch, + /// + /// ch-ua-bitness + /// + [EnumMember(Value = ("ch-ua-bitness"))] + ChUaBitness, + /// + /// ch-ua-high-entropy-values + /// + [EnumMember(Value = ("ch-ua-high-entropy-values"))] + ChUaHighEntropyValues, + /// + /// ch-ua-platform + /// + [EnumMember(Value = ("ch-ua-platform"))] + ChUaPlatform, + /// + /// ch-ua-model + /// + [EnumMember(Value = ("ch-ua-model"))] + ChUaModel, + /// + /// ch-ua-mobile + /// + [EnumMember(Value = ("ch-ua-mobile"))] + ChUaMobile, + /// + /// ch-ua-form-factors + /// + [EnumMember(Value = ("ch-ua-form-factors"))] + ChUaFormFactors, + /// + /// ch-ua-full-version + /// + [EnumMember(Value = ("ch-ua-full-version"))] + ChUaFullVersion, + /// + /// ch-ua-full-version-list + /// + [EnumMember(Value = ("ch-ua-full-version-list"))] + ChUaFullVersionList, + /// + /// ch-ua-platform-version + /// + [EnumMember(Value = ("ch-ua-platform-version"))] + ChUaPlatformVersion, + /// + /// ch-ua-wow64 + /// + [EnumMember(Value = ("ch-ua-wow64"))] + ChUaWow64, + /// + /// ch-viewport-height + /// + [EnumMember(Value = ("ch-viewport-height"))] + ChViewportHeight, + /// + /// ch-viewport-width + /// + [EnumMember(Value = ("ch-viewport-width"))] + ChViewportWidth, + /// + /// ch-width + /// + [EnumMember(Value = ("ch-width"))] + ChWidth, + /// + /// clipboard-read + /// + [EnumMember(Value = ("clipboard-read"))] + ClipboardRead, + /// + /// clipboard-write + /// + [EnumMember(Value = ("clipboard-write"))] + ClipboardWrite, + /// + /// compute-pressure + /// + [EnumMember(Value = ("compute-pressure"))] + ComputePressure, + /// + /// controlled-frame + /// + [EnumMember(Value = ("controlled-frame"))] + ControlledFrame, + /// + /// cross-origin-isolated + /// + [EnumMember(Value = ("cross-origin-isolated"))] + CrossOriginIsolated, + /// + /// deferred-fetch + /// + [EnumMember(Value = ("deferred-fetch"))] + DeferredFetch, + /// + /// deferred-fetch-minimal + /// + [EnumMember(Value = ("deferred-fetch-minimal"))] + DeferredFetchMinimal, + /// + /// device-attributes + /// + [EnumMember(Value = ("device-attributes"))] + DeviceAttributes, + /// + /// digital-credentials-create + /// + [EnumMember(Value = ("digital-credentials-create"))] + DigitalCredentialsCreate, + /// + /// digital-credentials-get + /// + [EnumMember(Value = ("digital-credentials-get"))] + DigitalCredentialsGet, + /// + /// direct-sockets + /// + [EnumMember(Value = ("direct-sockets"))] + DirectSockets, + /// + /// direct-sockets-multicast + /// + [EnumMember(Value = ("direct-sockets-multicast"))] + DirectSocketsMulticast, + /// + /// direct-sockets-private + /// + [EnumMember(Value = ("direct-sockets-private"))] + DirectSocketsPrivate, + /// + /// display-capture + /// + [EnumMember(Value = ("display-capture"))] + DisplayCapture, + /// + /// document-domain + /// + [EnumMember(Value = ("document-domain"))] + DocumentDomain, + /// + /// encrypted-media + /// + [EnumMember(Value = ("encrypted-media"))] + EncryptedMedia, + /// + /// execution-while-out-of-viewport + /// + [EnumMember(Value = ("execution-while-out-of-viewport"))] + ExecutionWhileOutOfViewport, + /// + /// execution-while-not-rendered + /// + [EnumMember(Value = ("execution-while-not-rendered"))] + ExecutionWhileNotRendered, + /// + /// fenced-unpartitioned-storage-read + /// + [EnumMember(Value = ("fenced-unpartitioned-storage-read"))] + FencedUnpartitionedStorageRead, + /// + /// focus-without-user-activation + /// + [EnumMember(Value = ("focus-without-user-activation"))] + FocusWithoutUserActivation, + /// + /// fullscreen + /// + [EnumMember(Value = ("fullscreen"))] + Fullscreen, + /// + /// frobulate + /// + [EnumMember(Value = ("frobulate"))] + Frobulate, + /// + /// gamepad + /// + [EnumMember(Value = ("gamepad"))] + Gamepad, + /// + /// geolocation + /// + [EnumMember(Value = ("geolocation"))] + Geolocation, + /// + /// gyroscope + /// + [EnumMember(Value = ("gyroscope"))] + Gyroscope, + /// + /// hid + /// + [EnumMember(Value = ("hid"))] + Hid, + /// + /// identity-credentials-get + /// + [EnumMember(Value = ("identity-credentials-get"))] + IdentityCredentialsGet, + /// + /// idle-detection + /// + [EnumMember(Value = ("idle-detection"))] + IdleDetection, + /// + /// interest-cohort + /// + [EnumMember(Value = ("interest-cohort"))] + InterestCohort, + /// + /// join-ad-interest-group + /// + [EnumMember(Value = ("join-ad-interest-group"))] + JoinAdInterestGroup, + /// + /// keyboard-map + /// + [EnumMember(Value = ("keyboard-map"))] + KeyboardMap, + /// + /// language-detector + /// + [EnumMember(Value = ("language-detector"))] + LanguageDetector, + /// + /// language-model + /// + [EnumMember(Value = ("language-model"))] + LanguageModel, + /// + /// local-fonts + /// + [EnumMember(Value = ("local-fonts"))] + LocalFonts, + /// + /// local-network + /// + [EnumMember(Value = ("local-network"))] + LocalNetwork, + /// + /// local-network-access + /// + [EnumMember(Value = ("local-network-access"))] + LocalNetworkAccess, + /// + /// loopback-network + /// + [EnumMember(Value = ("loopback-network"))] + LoopbackNetwork, + /// + /// magnetometer + /// + [EnumMember(Value = ("magnetometer"))] + Magnetometer, + /// + /// manual-text + /// + [EnumMember(Value = ("manual-text"))] + ManualText, + /// + /// media-playback-while-not-visible + /// + [EnumMember(Value = ("media-playback-while-not-visible"))] + MediaPlaybackWhileNotVisible, + /// + /// microphone + /// + [EnumMember(Value = ("microphone"))] + Microphone, + /// + /// midi + /// + [EnumMember(Value = ("midi"))] + Midi, + /// + /// on-device-speech-recognition + /// + [EnumMember(Value = ("on-device-speech-recognition"))] + OnDeviceSpeechRecognition, + /// + /// otp-credentials + /// + [EnumMember(Value = ("otp-credentials"))] + OtpCredentials, + /// + /// payment + /// + [EnumMember(Value = ("payment"))] + Payment, + /// + /// picture-in-picture + /// + [EnumMember(Value = ("picture-in-picture"))] + PictureInPicture, + /// + /// private-aggregation + /// + [EnumMember(Value = ("private-aggregation"))] + PrivateAggregation, + /// + /// private-state-token-issuance + /// + [EnumMember(Value = ("private-state-token-issuance"))] + PrivateStateTokenIssuance, + /// + /// private-state-token-redemption + /// + [EnumMember(Value = ("private-state-token-redemption"))] + PrivateStateTokenRedemption, + /// + /// publickey-credentials-create + /// + [EnumMember(Value = ("publickey-credentials-create"))] + PublickeyCredentialsCreate, + /// + /// publickey-credentials-get + /// + [EnumMember(Value = ("publickey-credentials-get"))] + PublickeyCredentialsGet, + /// + /// record-ad-auction-events + /// + [EnumMember(Value = ("record-ad-auction-events"))] + RecordAdAuctionEvents, + /// + /// rewriter + /// + [EnumMember(Value = ("rewriter"))] + Rewriter, + /// + /// run-ad-auction + /// + [EnumMember(Value = ("run-ad-auction"))] + RunAdAuction, + /// + /// screen-wake-lock + /// + [EnumMember(Value = ("screen-wake-lock"))] + ScreenWakeLock, + /// + /// serial + /// + [EnumMember(Value = ("serial"))] + Serial, + /// + /// shared-storage + /// + [EnumMember(Value = ("shared-storage"))] + SharedStorage, + /// + /// shared-storage-select-url + /// + [EnumMember(Value = ("shared-storage-select-url"))] + SharedStorageSelectUrl, + /// + /// smart-card + /// + [EnumMember(Value = ("smart-card"))] + SmartCard, + /// + /// speaker-selection + /// + [EnumMember(Value = ("speaker-selection"))] + SpeakerSelection, + /// + /// storage-access + /// + [EnumMember(Value = ("storage-access"))] + StorageAccess, + /// + /// sub-apps + /// + [EnumMember(Value = ("sub-apps"))] + SubApps, + /// + /// summarizer + /// + [EnumMember(Value = ("summarizer"))] + Summarizer, + /// + /// sync-xhr + /// + [EnumMember(Value = ("sync-xhr"))] + SyncXhr, + /// + /// translator + /// + [EnumMember(Value = ("translator"))] + Translator, + /// + /// unload + /// + [EnumMember(Value = ("unload"))] + Unload, + /// + /// usb + /// + [EnumMember(Value = ("usb"))] + Usb, + /// + /// usb-unrestricted + /// + [EnumMember(Value = ("usb-unrestricted"))] + UsbUnrestricted, + /// + /// vertical-scroll + /// + [EnumMember(Value = ("vertical-scroll"))] + VerticalScroll, + /// + /// web-app-installation + /// + [EnumMember(Value = ("web-app-installation"))] + WebAppInstallation, + /// + /// web-printing + /// + [EnumMember(Value = ("web-printing"))] + WebPrinting, + /// + /// web-share + /// + [EnumMember(Value = ("web-share"))] + WebShare, + /// + /// window-management + /// + [EnumMember(Value = ("window-management"))] + WindowManagement, + /// + /// writer + /// + [EnumMember(Value = ("writer"))] + Writer, + /// + /// xr-spatial-tracking + /// + [EnumMember(Value = ("xr-spatial-tracking"))] + XrSpatialTracking + } + + /// + /// Reason for a permissions policy feature to be disabled. + /// + public enum PermissionsPolicyBlockReason + { + /// + /// Header + /// + [EnumMember(Value = ("Header"))] + Header, + /// + /// IframeAttribute + /// + [EnumMember(Value = ("IframeAttribute"))] + IframeAttribute, + /// + /// InFencedFrameTree + /// + [EnumMember(Value = ("InFencedFrameTree"))] + InFencedFrameTree, + /// + /// InIsolatedApp + /// + [EnumMember(Value = ("InIsolatedApp"))] + InIsolatedApp + } + + /// + /// PermissionsPolicyBlockLocator + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PermissionsPolicyBlockLocator : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FrameId + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + set; + } + + /// + /// BlockReason + /// + public CefSharp.DevTools.Page.PermissionsPolicyBlockReason BlockReason + { + get + { + return (CefSharp.DevTools.Page.PermissionsPolicyBlockReason)(StringToEnum(typeof(CefSharp.DevTools.Page.PermissionsPolicyBlockReason), blockReason)); + } + + set + { + this.blockReason = (EnumToString(value)); + } + } + + /// + /// BlockReason + /// + [DataMember(Name = ("blockReason"), IsRequired = (true))] + internal string blockReason + { + get; + set; + } + } + + /// + /// PermissionsPolicyFeatureState + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PermissionsPolicyFeatureState : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Feature + /// + public CefSharp.DevTools.Page.PermissionsPolicyFeature Feature + { + get + { + return (CefSharp.DevTools.Page.PermissionsPolicyFeature)(StringToEnum(typeof(CefSharp.DevTools.Page.PermissionsPolicyFeature), feature)); + } + + set + { + this.feature = (EnumToString(value)); + } + } + + /// + /// Feature + /// + [DataMember(Name = ("feature"), IsRequired = (true))] + internal string feature + { + get; + set; + } + + /// + /// Allowed + /// + [DataMember(Name = ("allowed"), IsRequired = (true))] + public bool Allowed + { + get; + set; + } + + /// + /// Locator + /// + [DataMember(Name = ("locator"), IsRequired = (false))] + public CefSharp.DevTools.Page.PermissionsPolicyBlockLocator Locator + { + get; + set; + } + } + + /// + /// Origin Trial(https://www.chromium.org/blink/origin-trials) support. + /// Status for an Origin Trial token. + /// + public enum OriginTrialTokenStatus + { + /// + /// Success + /// + [EnumMember(Value = ("Success"))] + Success, + /// + /// NotSupported + /// + [EnumMember(Value = ("NotSupported"))] + NotSupported, + /// + /// Insecure + /// + [EnumMember(Value = ("Insecure"))] + Insecure, + /// + /// Expired + /// + [EnumMember(Value = ("Expired"))] + Expired, + /// + /// WrongOrigin + /// + [EnumMember(Value = ("WrongOrigin"))] + WrongOrigin, + /// + /// InvalidSignature + /// + [EnumMember(Value = ("InvalidSignature"))] + InvalidSignature, + /// + /// Malformed + /// + [EnumMember(Value = ("Malformed"))] + Malformed, + /// + /// WrongVersion + /// + [EnumMember(Value = ("WrongVersion"))] + WrongVersion, + /// + /// FeatureDisabled + /// + [EnumMember(Value = ("FeatureDisabled"))] + FeatureDisabled, + /// + /// TokenDisabled + /// + [EnumMember(Value = ("TokenDisabled"))] + TokenDisabled, + /// + /// FeatureDisabledForUser + /// + [EnumMember(Value = ("FeatureDisabledForUser"))] + FeatureDisabledForUser, + /// + /// UnknownTrial + /// + [EnumMember(Value = ("UnknownTrial"))] + UnknownTrial + } + + /// + /// Status for an Origin Trial. + /// + public enum OriginTrialStatus + { + /// + /// Enabled + /// + [EnumMember(Value = ("Enabled"))] + Enabled, + /// + /// ValidTokenNotProvided + /// + [EnumMember(Value = ("ValidTokenNotProvided"))] + ValidTokenNotProvided, + /// + /// OSNotSupported + /// + [EnumMember(Value = ("OSNotSupported"))] + OSNotSupported, + /// + /// TrialNotAllowed + /// + [EnumMember(Value = ("TrialNotAllowed"))] + TrialNotAllowed + } + + /// + /// OriginTrialUsageRestriction + /// + public enum OriginTrialUsageRestriction + { + /// + /// None + /// + [EnumMember(Value = ("None"))] + None, + /// + /// Subset + /// + [EnumMember(Value = ("Subset"))] + Subset + } + + /// + /// OriginTrialToken + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class OriginTrialToken : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Origin + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + set; + } + + /// + /// MatchSubDomains + /// + [DataMember(Name = ("matchSubDomains"), IsRequired = (true))] + public bool MatchSubDomains + { + get; + set; + } + + /// + /// TrialName + /// + [DataMember(Name = ("trialName"), IsRequired = (true))] + public string TrialName + { + get; + set; + } + + /// + /// ExpiryTime + /// + [DataMember(Name = ("expiryTime"), IsRequired = (true))] + public double ExpiryTime + { + get; + set; + } + + /// + /// IsThirdParty + /// + [DataMember(Name = ("isThirdParty"), IsRequired = (true))] + public bool IsThirdParty + { + get; + set; + } + + /// + /// UsageRestriction + /// + public CefSharp.DevTools.Page.OriginTrialUsageRestriction UsageRestriction + { + get + { + return (CefSharp.DevTools.Page.OriginTrialUsageRestriction)(StringToEnum(typeof(CefSharp.DevTools.Page.OriginTrialUsageRestriction), usageRestriction)); + } + + set + { + this.usageRestriction = (EnumToString(value)); + } + } + + /// + /// UsageRestriction + /// + [DataMember(Name = ("usageRestriction"), IsRequired = (true))] + internal string usageRestriction + { + get; + set; + } + } + + /// + /// OriginTrialTokenWithStatus + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class OriginTrialTokenWithStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// RawTokenText + /// + [DataMember(Name = ("rawTokenText"), IsRequired = (true))] + public string RawTokenText + { + get; + set; + } + + /// + /// `parsedToken` is present only when the token is extractable and + /// parsable. + /// + [DataMember(Name = ("parsedToken"), IsRequired = (false))] + public CefSharp.DevTools.Page.OriginTrialToken ParsedToken + { + get; + set; + } + + /// + /// Status + /// + public CefSharp.DevTools.Page.OriginTrialTokenStatus Status + { + get + { + return (CefSharp.DevTools.Page.OriginTrialTokenStatus)(StringToEnum(typeof(CefSharp.DevTools.Page.OriginTrialTokenStatus), status)); + } + + set + { + this.status = (EnumToString(value)); + } + } + + /// + /// Status + /// + [DataMember(Name = ("status"), IsRequired = (true))] + internal string status + { + get; + set; + } + } + + /// + /// OriginTrial + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class OriginTrial : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TrialName + /// + [DataMember(Name = ("trialName"), IsRequired = (true))] + public string TrialName + { + get; + set; + } + + /// + /// Status + /// + public CefSharp.DevTools.Page.OriginTrialStatus Status + { + get + { + return (CefSharp.DevTools.Page.OriginTrialStatus)(StringToEnum(typeof(CefSharp.DevTools.Page.OriginTrialStatus), status)); + } + + set + { + this.status = (EnumToString(value)); + } + } + + /// + /// Status + /// + [DataMember(Name = ("status"), IsRequired = (true))] + internal string status + { + get; + set; + } + + /// + /// TokensWithStatus + /// + [DataMember(Name = ("tokensWithStatus"), IsRequired = (true))] + public System.Collections.Generic.IList TokensWithStatus + { + get; + set; + } + } + + /// + /// Additional information about the frame document's security origin. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SecurityOriginDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Indicates whether the frame document's security origin is one + /// of the local hostnames (e.g. "localhost") or IP addresses (IPv4 + /// 127.0.0.0/8 or IPv6 ::1). + /// + [DataMember(Name = ("isLocalhost"), IsRequired = (true))] + public bool IsLocalhost + { + get; + set; + } + } + + /// + /// Information about the Frame on the page. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Frame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Frame unique identifier. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// Parent frame identifier. + /// + [DataMember(Name = ("parentId"), IsRequired = (false))] + public string ParentId + { + get; + set; + } + + /// + /// Identifier of the loader associated with this frame. + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + set; + } + + /// + /// Frame's name as specified in the tag. + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// Frame document's URL without fragment. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Frame document's URL fragment including the '#'. + /// + [DataMember(Name = ("urlFragment"), IsRequired = (false))] + public string UrlFragment + { + get; + set; + } + + /// + /// Frame document's registered domain, taking the public suffixes list into account. + /// Extracted from the Frame's url. + /// Example URLs: http://www.google.com/file.html -> "google.com" + /// http://a.b.co.uk/file.html -> "b.co.uk" + /// + [DataMember(Name = ("domainAndRegistry"), IsRequired = (true))] + public string DomainAndRegistry + { + get; + set; + } + + /// + /// Frame document's security origin. + /// + [DataMember(Name = ("securityOrigin"), IsRequired = (true))] + public string SecurityOrigin + { + get; + set; + } + + /// + /// Additional details about the frame document's security origin. + /// + [DataMember(Name = ("securityOriginDetails"), IsRequired = (false))] + public CefSharp.DevTools.Page.SecurityOriginDetails SecurityOriginDetails + { + get; + set; + } + + /// + /// Frame document's mimeType as determined by the browser. + /// + [DataMember(Name = ("mimeType"), IsRequired = (true))] + public string MimeType + { + get; + set; + } + + /// + /// If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment. + /// + [DataMember(Name = ("unreachableUrl"), IsRequired = (false))] + public string UnreachableUrl + { + get; + set; + } + + /// + /// Indicates whether this frame was tagged as an ad and why. + /// + [DataMember(Name = ("adFrameStatus"), IsRequired = (false))] + public CefSharp.DevTools.Page.AdFrameStatus AdFrameStatus + { + get; + set; + } + + /// + /// Indicates whether the main document is a secure context and explains why that is the case. + /// + public CefSharp.DevTools.Page.SecureContextType SecureContextType + { + get + { + return (CefSharp.DevTools.Page.SecureContextType)(StringToEnum(typeof(CefSharp.DevTools.Page.SecureContextType), secureContextType)); + } + + set + { + this.secureContextType = (EnumToString(value)); + } + } + + /// + /// Indicates whether the main document is a secure context and explains why that is the case. + /// + [DataMember(Name = ("secureContextType"), IsRequired = (true))] + internal string secureContextType + { + get; + set; + } + + /// + /// Indicates whether this is a cross origin isolated context. + /// + public CefSharp.DevTools.Page.CrossOriginIsolatedContextType CrossOriginIsolatedContextType + { + get + { + return (CefSharp.DevTools.Page.CrossOriginIsolatedContextType)(StringToEnum(typeof(CefSharp.DevTools.Page.CrossOriginIsolatedContextType), crossOriginIsolatedContextType)); + } + + set + { + this.crossOriginIsolatedContextType = (EnumToString(value)); + } + } + + /// + /// Indicates whether this is a cross origin isolated context. + /// + [DataMember(Name = ("crossOriginIsolatedContextType"), IsRequired = (true))] + internal string crossOriginIsolatedContextType + { + get; + set; + } + + /// + /// Indicated which gated APIs / features are available. + /// + public CefSharp.DevTools.Page.GatedAPIFeatures[] GatedAPIFeatures + { + get + { + return (CefSharp.DevTools.Page.GatedAPIFeatures[])(StringToEnum(typeof(CefSharp.DevTools.Page.GatedAPIFeatures[]), gatedAPIFeatures)); + } + + set + { + this.gatedAPIFeatures = (EnumToString(value)); + } + } + + /// + /// Indicated which gated APIs / features are available. + /// + [DataMember(Name = ("gatedAPIFeatures"), IsRequired = (true))] + internal string gatedAPIFeatures + { + get; + set; + } + } + + /// + /// Information about the Resource on the page. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FrameResource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Resource URL. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Type of this resource. + /// + public CefSharp.DevTools.Network.ResourceType Type + { + get + { + return (CefSharp.DevTools.Network.ResourceType)(StringToEnum(typeof(CefSharp.DevTools.Network.ResourceType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type of this resource. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Resource mimeType as determined by the browser. + /// + [DataMember(Name = ("mimeType"), IsRequired = (true))] + public string MimeType + { + get; + set; + } + + /// + /// last-modified timestamp as reported by server. + /// + [DataMember(Name = ("lastModified"), IsRequired = (false))] + public double? LastModified + { + get; + set; + } + + /// + /// Resource content size. + /// + [DataMember(Name = ("contentSize"), IsRequired = (false))] + public double? ContentSize + { + get; + set; + } + + /// + /// True if the resource failed to load. + /// + [DataMember(Name = ("failed"), IsRequired = (false))] + public bool? Failed + { + get; + set; + } + + /// + /// True if the resource was canceled during loading. + /// + [DataMember(Name = ("canceled"), IsRequired = (false))] + public bool? Canceled + { + get; + set; + } + } + + /// + /// Information about the Frame hierarchy along with their cached resources. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FrameResourceTree : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Frame information for this tree item. + /// + [DataMember(Name = ("frame"), IsRequired = (true))] + public CefSharp.DevTools.Page.Frame Frame + { + get; + set; + } + + /// + /// Child frames. + /// + [DataMember(Name = ("childFrames"), IsRequired = (false))] + public System.Collections.Generic.IList ChildFrames + { + get; + set; + } + + /// + /// Information about frame resources. + /// + [DataMember(Name = ("resources"), IsRequired = (true))] + public System.Collections.Generic.IList Resources + { + get; + set; + } + } + + /// + /// Information about the Frame hierarchy. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FrameTree : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Frame information for this tree item. + /// + [DataMember(Name = ("frame"), IsRequired = (true))] + public CefSharp.DevTools.Page.Frame Frame + { + get; + set; + } + + /// + /// Child frames. + /// + [DataMember(Name = ("childFrames"), IsRequired = (false))] + public System.Collections.Generic.IList ChildFrames + { + get; + set; + } + } + + /// + /// Transition type. + /// + public enum TransitionType + { + /// + /// link + /// + [EnumMember(Value = ("link"))] + Link, + /// + /// typed + /// + [EnumMember(Value = ("typed"))] + Typed, + /// + /// address_bar + /// + [EnumMember(Value = ("address_bar"))] + AddressBar, + /// + /// auto_bookmark + /// + [EnumMember(Value = ("auto_bookmark"))] + AutoBookmark, + /// + /// auto_subframe + /// + [EnumMember(Value = ("auto_subframe"))] + AutoSubframe, + /// + /// manual_subframe + /// + [EnumMember(Value = ("manual_subframe"))] + ManualSubframe, + /// + /// generated + /// + [EnumMember(Value = ("generated"))] + Generated, + /// + /// auto_toplevel + /// + [EnumMember(Value = ("auto_toplevel"))] + AutoToplevel, + /// + /// form_submit + /// + [EnumMember(Value = ("form_submit"))] + FormSubmit, + /// + /// reload + /// + [EnumMember(Value = ("reload"))] + Reload, + /// + /// keyword + /// + [EnumMember(Value = ("keyword"))] + Keyword, + /// + /// keyword_generated + /// + [EnumMember(Value = ("keyword_generated"))] + KeywordGenerated, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other + } + + /// + /// Navigation history entry. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class NavigationEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unique id of the navigation history entry. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public int Id + { + get; + set; + } + + /// + /// URL of the navigation history entry. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// URL that the user typed in the url bar. + /// + [DataMember(Name = ("userTypedURL"), IsRequired = (true))] + public string UserTypedURL + { + get; + set; + } + + /// + /// Title of the navigation history entry. + /// + [DataMember(Name = ("title"), IsRequired = (true))] + public string Title + { + get; + set; + } + + /// + /// Transition type. + /// + public CefSharp.DevTools.Page.TransitionType TransitionType + { + get + { + return (CefSharp.DevTools.Page.TransitionType)(StringToEnum(typeof(CefSharp.DevTools.Page.TransitionType), transitionType)); + } + + set + { + this.transitionType = (EnumToString(value)); + } + } + + /// + /// Transition type. + /// + [DataMember(Name = ("transitionType"), IsRequired = (true))] + internal string transitionType + { + get; + set; + } + } + + /// + /// Screencast frame metadata. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScreencastFrameMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Top offset in DIP. + /// + [DataMember(Name = ("offsetTop"), IsRequired = (true))] + public double OffsetTop + { + get; + set; + } + + /// + /// Page scale factor. + /// + [DataMember(Name = ("pageScaleFactor"), IsRequired = (true))] + public double PageScaleFactor + { + get; + set; + } + + /// + /// Device screen width in DIP. + /// + [DataMember(Name = ("deviceWidth"), IsRequired = (true))] + public double DeviceWidth + { + get; + set; + } + + /// + /// Device screen height in DIP. + /// + [DataMember(Name = ("deviceHeight"), IsRequired = (true))] + public double DeviceHeight + { + get; + set; + } + + /// + /// Position of horizontal scroll in CSS pixels. + /// + [DataMember(Name = ("scrollOffsetX"), IsRequired = (true))] + public double ScrollOffsetX + { + get; + set; + } + + /// + /// Position of vertical scroll in CSS pixels. + /// + [DataMember(Name = ("scrollOffsetY"), IsRequired = (true))] + public double ScrollOffsetY + { + get; + set; + } + + /// + /// Frame swap timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (false))] + public double? Timestamp + { + get; + set; + } + } + + /// + /// Javascript dialog type. + /// + public enum DialogType + { + /// + /// alert + /// + [EnumMember(Value = ("alert"))] + Alert, + /// + /// confirm + /// + [EnumMember(Value = ("confirm"))] + Confirm, + /// + /// prompt + /// + [EnumMember(Value = ("prompt"))] + Prompt, + /// + /// beforeunload + /// + [EnumMember(Value = ("beforeunload"))] + Beforeunload + } + + /// + /// Error while paring app manifest. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AppManifestError : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error message. + /// + [DataMember(Name = ("message"), IsRequired = (true))] + public string Message + { + get; + set; + } + + /// + /// If critical, this is a non-recoverable parse error. + /// + [DataMember(Name = ("critical"), IsRequired = (true))] + public int Critical + { + get; + set; + } + + /// + /// Error line. + /// + [DataMember(Name = ("line"), IsRequired = (true))] + public int Line + { + get; + set; + } + + /// + /// Error column. + /// + [DataMember(Name = ("column"), IsRequired = (true))] + public int Column + { + get; + set; + } + } + + /// + /// Parsed app manifest properties. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AppManifestParsedProperties : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Computed scope value + /// + [DataMember(Name = ("scope"), IsRequired = (true))] + public string Scope + { + get; + set; + } + } + + /// + /// Layout viewport position and dimensions. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LayoutViewport : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Horizontal offset relative to the document (CSS pixels). + /// + [DataMember(Name = ("pageX"), IsRequired = (true))] + public int PageX + { + get; + set; + } + + /// + /// Vertical offset relative to the document (CSS pixels). + /// + [DataMember(Name = ("pageY"), IsRequired = (true))] + public int PageY + { + get; + set; + } + + /// + /// Width (CSS pixels), excludes scrollbar if present. + /// + [DataMember(Name = ("clientWidth"), IsRequired = (true))] + public int ClientWidth + { + get; + set; + } + + /// + /// Height (CSS pixels), excludes scrollbar if present. + /// + [DataMember(Name = ("clientHeight"), IsRequired = (true))] + public int ClientHeight + { + get; + set; + } + } + + /// + /// Visual viewport position, dimensions, and scale. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class VisualViewport : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Horizontal offset relative to the layout viewport (CSS pixels). + /// + [DataMember(Name = ("offsetX"), IsRequired = (true))] + public double OffsetX + { + get; + set; + } + + /// + /// Vertical offset relative to the layout viewport (CSS pixels). + /// + [DataMember(Name = ("offsetY"), IsRequired = (true))] + public double OffsetY + { + get; + set; + } + + /// + /// Horizontal offset relative to the document (CSS pixels). + /// + [DataMember(Name = ("pageX"), IsRequired = (true))] + public double PageX + { + get; + set; + } + + /// + /// Vertical offset relative to the document (CSS pixels). + /// + [DataMember(Name = ("pageY"), IsRequired = (true))] + public double PageY + { + get; + set; + } + + /// + /// Width (CSS pixels), excludes scrollbar if present. + /// + [DataMember(Name = ("clientWidth"), IsRequired = (true))] + public double ClientWidth + { + get; + set; + } + + /// + /// Height (CSS pixels), excludes scrollbar if present. + /// + [DataMember(Name = ("clientHeight"), IsRequired = (true))] + public double ClientHeight + { + get; + set; + } + + /// + /// Scale relative to the ideal viewport (size at width=device-width). + /// + [DataMember(Name = ("scale"), IsRequired = (true))] + public double Scale + { + get; + set; + } + + /// + /// Page zoom factor (CSS to device independent pixels ratio). + /// + [DataMember(Name = ("zoom"), IsRequired = (false))] + public double? Zoom + { + get; + set; + } + } + + /// + /// Viewport for capturing screenshot. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Viewport : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X offset in device independent pixels (dip). + /// + [DataMember(Name = ("x"), IsRequired = (true))] + public double X + { + get; + set; + } + + /// + /// Y offset in device independent pixels (dip). + /// + [DataMember(Name = ("y"), IsRequired = (true))] + public double Y + { + get; + set; + } + + /// + /// Rectangle width in device independent pixels (dip). + /// + [DataMember(Name = ("width"), IsRequired = (true))] + public double Width + { + get; + set; + } + + /// + /// Rectangle height in device independent pixels (dip). + /// + [DataMember(Name = ("height"), IsRequired = (true))] + public double Height + { + get; + set; + } + + /// + /// Page scale factor. + /// + [DataMember(Name = ("scale"), IsRequired = (true))] + public double Scale + { + get; + set; + } + } + + /// + /// Generic font families collection. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FontFamilies : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The standard font-family. + /// + [DataMember(Name = ("standard"), IsRequired = (false))] + public string Standard + { + get; + set; + } + + /// + /// The fixed font-family. + /// + [DataMember(Name = ("fixed"), IsRequired = (false))] + public string Fixed + { + get; + set; + } + + /// + /// The serif font-family. + /// + [DataMember(Name = ("serif"), IsRequired = (false))] + public string Serif + { + get; + set; + } + + /// + /// The sansSerif font-family. + /// + [DataMember(Name = ("sansSerif"), IsRequired = (false))] + public string SansSerif + { + get; + set; + } + + /// + /// The cursive font-family. + /// + [DataMember(Name = ("cursive"), IsRequired = (false))] + public string Cursive + { + get; + set; + } + + /// + /// The fantasy font-family. + /// + [DataMember(Name = ("fantasy"), IsRequired = (false))] + public string Fantasy + { + get; + set; + } + + /// + /// The math font-family. + /// + [DataMember(Name = ("math"), IsRequired = (false))] + public string Math + { + get; + set; + } + } + + /// + /// Font families collection for a script. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScriptFontFamilies : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of the script which these font families are defined for. + /// + [DataMember(Name = ("script"), IsRequired = (true))] + public string Script + { + get; + set; + } + + /// + /// Generic font families collection for the script. + /// + [DataMember(Name = ("fontFamilies"), IsRequired = (true))] + public CefSharp.DevTools.Page.FontFamilies FontFamilies + { + get; + set; + } + } + + /// + /// Default font sizes. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FontSizes : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Default standard font size. + /// + [DataMember(Name = ("standard"), IsRequired = (false))] + public int? Standard + { + get; + set; + } + + /// + /// Default fixed font size. + /// + [DataMember(Name = ("fixed"), IsRequired = (false))] + public int? Fixed + { + get; + set; + } + } + + /// + /// ClientNavigationReason + /// + public enum ClientNavigationReason + { + /// + /// anchorClick + /// + [EnumMember(Value = ("anchorClick"))] + AnchorClick, + /// + /// formSubmissionGet + /// + [EnumMember(Value = ("formSubmissionGet"))] + FormSubmissionGet, + /// + /// formSubmissionPost + /// + [EnumMember(Value = ("formSubmissionPost"))] + FormSubmissionPost, + /// + /// httpHeaderRefresh + /// + [EnumMember(Value = ("httpHeaderRefresh"))] + HttpHeaderRefresh, + /// + /// initialFrameNavigation + /// + [EnumMember(Value = ("initialFrameNavigation"))] + InitialFrameNavigation, + /// + /// metaTagRefresh + /// + [EnumMember(Value = ("metaTagRefresh"))] + MetaTagRefresh, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other, + /// + /// pageBlockInterstitial + /// + [EnumMember(Value = ("pageBlockInterstitial"))] + PageBlockInterstitial, + /// + /// reload + /// + [EnumMember(Value = ("reload"))] + Reload, + /// + /// scriptInitiated + /// + [EnumMember(Value = ("scriptInitiated"))] + ScriptInitiated + } + + /// + /// ClientNavigationDisposition + /// + public enum ClientNavigationDisposition + { + /// + /// currentTab + /// + [EnumMember(Value = ("currentTab"))] + CurrentTab, + /// + /// newTab + /// + [EnumMember(Value = ("newTab"))] + NewTab, + /// + /// newWindow + /// + [EnumMember(Value = ("newWindow"))] + NewWindow, + /// + /// download + /// + [EnumMember(Value = ("download"))] + Download + } + + /// + /// InstallabilityErrorArgument + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InstallabilityErrorArgument : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Argument name (e.g. name:'minimum-icon-size-in-pixels'). + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Argument value (e.g. value:'64'). + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// The installability error + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InstallabilityError : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The error id (e.g. 'manifest-missing-suitable-icon'). + /// + [DataMember(Name = ("errorId"), IsRequired = (true))] + public string ErrorId + { + get; + set; + } + + /// + /// The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels', value:'64'}). + /// + [DataMember(Name = ("errorArguments"), IsRequired = (true))] + public System.Collections.Generic.IList ErrorArguments + { + get; + set; + } + } + + /// + /// The referring-policy used for the navigation. + /// + public enum ReferrerPolicy + { + /// + /// noReferrer + /// + [EnumMember(Value = ("noReferrer"))] + NoReferrer, + /// + /// noReferrerWhenDowngrade + /// + [EnumMember(Value = ("noReferrerWhenDowngrade"))] + NoReferrerWhenDowngrade, + /// + /// origin + /// + [EnumMember(Value = ("origin"))] + Origin, + /// + /// originWhenCrossOrigin + /// + [EnumMember(Value = ("originWhenCrossOrigin"))] + OriginWhenCrossOrigin, + /// + /// sameOrigin + /// + [EnumMember(Value = ("sameOrigin"))] + SameOrigin, + /// + /// strictOrigin + /// + [EnumMember(Value = ("strictOrigin"))] + StrictOrigin, + /// + /// strictOriginWhenCrossOrigin + /// + [EnumMember(Value = ("strictOriginWhenCrossOrigin"))] + StrictOriginWhenCrossOrigin, + /// + /// unsafeUrl + /// + [EnumMember(Value = ("unsafeUrl"))] + UnsafeUrl + } + + /// + /// Per-script compilation cache parameters for `Page.produceCompilationCache` + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CompilationCacheParams : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The URL of the script to produce a compilation cache entry for. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// A hint to the backend whether eager compilation is recommended. + /// (the actual compilation mode used is upon backend discretion). + /// + [DataMember(Name = ("eager"), IsRequired = (false))] + public bool? Eager + { + get; + set; + } + } + + /// + /// FileFilter + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FileFilter : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// Accepts + /// + [DataMember(Name = ("accepts"), IsRequired = (false))] + public string[] Accepts + { + get; + set; + } + } + + /// + /// FileHandler + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FileHandler : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Action + /// + [DataMember(Name = ("action"), IsRequired = (true))] + public string Action + { + get; + set; + } + + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Icons + /// + [DataMember(Name = ("icons"), IsRequired = (false))] + public System.Collections.Generic.IList Icons + { + get; + set; + } + + /// + /// Mimic a map, name is the key, accepts is the value. + /// + [DataMember(Name = ("accepts"), IsRequired = (false))] + public System.Collections.Generic.IList Accepts + { + get; + set; + } + + /// + /// Won't repeat the enums, using string for easy comparison. Same as the + /// other enums below. + /// + [DataMember(Name = ("launchType"), IsRequired = (true))] + public string LaunchType + { + get; + set; + } + } + + /// + /// The image definition used in both icon and screenshot. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ImageResource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The src field in the definition, but changing to url in favor of + /// consistency. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Sizes + /// + [DataMember(Name = ("sizes"), IsRequired = (false))] + public string Sizes + { + get; + set; + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (false))] + public string Type + { + get; + set; + } + } + + /// + /// LaunchHandler + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LaunchHandler : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ClientMode + /// + [DataMember(Name = ("clientMode"), IsRequired = (true))] + public string ClientMode + { + get; + set; + } + } + + /// + /// ProtocolHandler + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ProtocolHandler : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Protocol + /// + [DataMember(Name = ("protocol"), IsRequired = (true))] + public string Protocol + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + } + + /// + /// RelatedApplication + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RelatedApplication : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (false))] + public string Id + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + } + + /// + /// ScopeExtension + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScopeExtension : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Instead of using tuple, this field always returns the serialized string + /// for easy understanding and comparison. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + set; + } + + /// + /// HasOriginWildcard + /// + [DataMember(Name = ("hasOriginWildcard"), IsRequired = (true))] + public bool HasOriginWildcard + { + get; + set; + } + } + + /// + /// Screenshot + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Screenshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Image + /// + [DataMember(Name = ("image"), IsRequired = (true))] + public CefSharp.DevTools.Page.ImageResource Image + { + get; + set; + } + + /// + /// FormFactor + /// + [DataMember(Name = ("formFactor"), IsRequired = (true))] + public string FormFactor + { + get; + set; + } + + /// + /// Label + /// + [DataMember(Name = ("label"), IsRequired = (false))] + public string Label + { + get; + set; + } + } + + /// + /// ShareTarget + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ShareTarget : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Action + /// + [DataMember(Name = ("action"), IsRequired = (true))] + public string Action + { + get; + set; + } + + /// + /// Method + /// + [DataMember(Name = ("method"), IsRequired = (true))] + public string Method + { + get; + set; + } + + /// + /// Enctype + /// + [DataMember(Name = ("enctype"), IsRequired = (true))] + public string Enctype + { + get; + set; + } + + /// + /// Embed the ShareTargetParams + /// + [DataMember(Name = ("title"), IsRequired = (false))] + public string Title + { + get; + set; + } + + /// + /// Text + /// + [DataMember(Name = ("text"), IsRequired = (false))] + public string Text + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (false))] + public string Url + { + get; + set; + } + + /// + /// Files + /// + [DataMember(Name = ("files"), IsRequired = (false))] + public System.Collections.Generic.IList Files + { + get; + set; + } + } + + /// + /// Shortcut + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Shortcut : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + } + + /// + /// WebAppManifest + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class WebAppManifest : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// BackgroundColor + /// + [DataMember(Name = ("backgroundColor"), IsRequired = (false))] + public string BackgroundColor + { + get; + set; + } + + /// + /// The extra description provided by the manifest. + /// + [DataMember(Name = ("description"), IsRequired = (false))] + public string Description + { + get; + set; + } + + /// + /// Dir + /// + [DataMember(Name = ("dir"), IsRequired = (false))] + public string Dir + { + get; + set; + } + + /// + /// Display + /// + [DataMember(Name = ("display"), IsRequired = (false))] + public string Display + { + get; + set; + } + + /// + /// The overrided display mode controlled by the user. + /// + [DataMember(Name = ("displayOverrides"), IsRequired = (false))] + public string[] DisplayOverrides + { + get; + set; + } + + /// + /// The handlers to open files. + /// + [DataMember(Name = ("fileHandlers"), IsRequired = (false))] + public System.Collections.Generic.IList FileHandlers + { + get; + set; + } + + /// + /// Icons + /// + [DataMember(Name = ("icons"), IsRequired = (false))] + public System.Collections.Generic.IList Icons + { + get; + set; + } + + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (false))] + public string Id + { + get; + set; + } + + /// + /// Lang + /// + [DataMember(Name = ("lang"), IsRequired = (false))] + public string Lang + { + get; + set; + } + + /// + /// TODO(crbug.com/1231886): This field is non-standard and part of a Chrome + /// experiment. See: + /// https://github.com/WICG/web-app-launch/blob/main/launch_handler.md + /// + [DataMember(Name = ("launchHandler"), IsRequired = (false))] + public CefSharp.DevTools.Page.LaunchHandler LaunchHandler + { + get; + set; + } + + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// Orientation + /// + [DataMember(Name = ("orientation"), IsRequired = (false))] + public string Orientation + { + get; + set; + } + + /// + /// PreferRelatedApplications + /// + [DataMember(Name = ("preferRelatedApplications"), IsRequired = (false))] + public bool? PreferRelatedApplications + { + get; + set; + } + + /// + /// The handlers to open protocols. + /// + [DataMember(Name = ("protocolHandlers"), IsRequired = (false))] + public System.Collections.Generic.IList ProtocolHandlers + { + get; + set; + } + + /// + /// RelatedApplications + /// + [DataMember(Name = ("relatedApplications"), IsRequired = (false))] + public System.Collections.Generic.IList RelatedApplications + { + get; + set; + } + + /// + /// Scope + /// + [DataMember(Name = ("scope"), IsRequired = (false))] + public string Scope + { + get; + set; + } + + /// + /// Non-standard, see + /// https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md + /// + [DataMember(Name = ("scopeExtensions"), IsRequired = (false))] + public System.Collections.Generic.IList ScopeExtensions + { + get; + set; + } + + /// + /// The screenshots used by chromium. + /// + [DataMember(Name = ("screenshots"), IsRequired = (false))] + public System.Collections.Generic.IList Screenshots + { + get; + set; + } + + /// + /// ShareTarget + /// + [DataMember(Name = ("shareTarget"), IsRequired = (false))] + public CefSharp.DevTools.Page.ShareTarget ShareTarget + { + get; + set; + } + + /// + /// ShortName + /// + [DataMember(Name = ("shortName"), IsRequired = (false))] + public string ShortName + { + get; + set; + } + + /// + /// Shortcuts + /// + [DataMember(Name = ("shortcuts"), IsRequired = (false))] + public System.Collections.Generic.IList Shortcuts + { + get; + set; + } + + /// + /// StartUrl + /// + [DataMember(Name = ("startUrl"), IsRequired = (false))] + public string StartUrl + { + get; + set; + } + + /// + /// ThemeColor + /// + [DataMember(Name = ("themeColor"), IsRequired = (false))] + public string ThemeColor + { + get; + set; + } + } + + /// + /// The type of a frameNavigated event. + /// + public enum NavigationType + { + /// + /// Navigation + /// + [EnumMember(Value = ("Navigation"))] + Navigation, + /// + /// BackForwardCacheRestore + /// + [EnumMember(Value = ("BackForwardCacheRestore"))] + BackForwardCacheRestore + } + + /// + /// List of not restored reasons for back-forward cache. + /// + public enum BackForwardCacheNotRestoredReason + { + /// + /// NotPrimaryMainFrame + /// + [EnumMember(Value = ("NotPrimaryMainFrame"))] + NotPrimaryMainFrame, + /// + /// BackForwardCacheDisabled + /// + [EnumMember(Value = ("BackForwardCacheDisabled"))] + BackForwardCacheDisabled, + /// + /// RelatedActiveContentsExist + /// + [EnumMember(Value = ("RelatedActiveContentsExist"))] + RelatedActiveContentsExist, + /// + /// HTTPStatusNotOK + /// + [EnumMember(Value = ("HTTPStatusNotOK"))] + HTTPStatusNotOK, + /// + /// SchemeNotHTTPOrHTTPS + /// + [EnumMember(Value = ("SchemeNotHTTPOrHTTPS"))] + SchemeNotHTTPOrHTTPS, + /// + /// Loading + /// + [EnumMember(Value = ("Loading"))] + Loading, + /// + /// WasGrantedMediaAccess + /// + [EnumMember(Value = ("WasGrantedMediaAccess"))] + WasGrantedMediaAccess, + /// + /// DisableForRenderFrameHostCalled + /// + [EnumMember(Value = ("DisableForRenderFrameHostCalled"))] + DisableForRenderFrameHostCalled, + /// + /// DomainNotAllowed + /// + [EnumMember(Value = ("DomainNotAllowed"))] + DomainNotAllowed, + /// + /// HTTPMethodNotGET + /// + [EnumMember(Value = ("HTTPMethodNotGET"))] + HTTPMethodNotGET, + /// + /// SubframeIsNavigating + /// + [EnumMember(Value = ("SubframeIsNavigating"))] + SubframeIsNavigating, + /// + /// Timeout + /// + [EnumMember(Value = ("Timeout"))] + Timeout, + /// + /// CacheLimit + /// + [EnumMember(Value = ("CacheLimit"))] + CacheLimit, + /// + /// JavaScriptExecution + /// + [EnumMember(Value = ("JavaScriptExecution"))] + JavaScriptExecution, + /// + /// RendererProcessKilled + /// + [EnumMember(Value = ("RendererProcessKilled"))] + RendererProcessKilled, + /// + /// RendererProcessCrashed + /// + [EnumMember(Value = ("RendererProcessCrashed"))] + RendererProcessCrashed, + /// + /// SchedulerTrackedFeatureUsed + /// + [EnumMember(Value = ("SchedulerTrackedFeatureUsed"))] + SchedulerTrackedFeatureUsed, + /// + /// ConflictingBrowsingInstance + /// + [EnumMember(Value = ("ConflictingBrowsingInstance"))] + ConflictingBrowsingInstance, + /// + /// CacheFlushed + /// + [EnumMember(Value = ("CacheFlushed"))] + CacheFlushed, + /// + /// ServiceWorkerVersionActivation + /// + [EnumMember(Value = ("ServiceWorkerVersionActivation"))] + ServiceWorkerVersionActivation, + /// + /// SessionRestored + /// + [EnumMember(Value = ("SessionRestored"))] + SessionRestored, + /// + /// ServiceWorkerPostMessage + /// + [EnumMember(Value = ("ServiceWorkerPostMessage"))] + ServiceWorkerPostMessage, + /// + /// EnteredBackForwardCacheBeforeServiceWorkerHostAdded + /// + [EnumMember(Value = ("EnteredBackForwardCacheBeforeServiceWorkerHostAdded"))] + EnteredBackForwardCacheBeforeServiceWorkerHostAdded, + /// + /// RenderFrameHostReused_SameSite + /// + [EnumMember(Value = ("RenderFrameHostReused_SameSite"))] + RenderFrameHostReusedSameSite, + /// + /// RenderFrameHostReused_CrossSite + /// + [EnumMember(Value = ("RenderFrameHostReused_CrossSite"))] + RenderFrameHostReusedCrossSite, + /// + /// ServiceWorkerClaim + /// + [EnumMember(Value = ("ServiceWorkerClaim"))] + ServiceWorkerClaim, + /// + /// IgnoreEventAndEvict + /// + [EnumMember(Value = ("IgnoreEventAndEvict"))] + IgnoreEventAndEvict, + /// + /// HaveInnerContents + /// + [EnumMember(Value = ("HaveInnerContents"))] + HaveInnerContents, + /// + /// TimeoutPuttingInCache + /// + [EnumMember(Value = ("TimeoutPuttingInCache"))] + TimeoutPuttingInCache, + /// + /// BackForwardCacheDisabledByLowMemory + /// + [EnumMember(Value = ("BackForwardCacheDisabledByLowMemory"))] + BackForwardCacheDisabledByLowMemory, + /// + /// BackForwardCacheDisabledByCommandLine + /// + [EnumMember(Value = ("BackForwardCacheDisabledByCommandLine"))] + BackForwardCacheDisabledByCommandLine, + /// + /// NetworkRequestDatapipeDrainedAsBytesConsumer + /// + [EnumMember(Value = ("NetworkRequestDatapipeDrainedAsBytesConsumer"))] + NetworkRequestDatapipeDrainedAsBytesConsumer, + /// + /// NetworkRequestRedirected + /// + [EnumMember(Value = ("NetworkRequestRedirected"))] + NetworkRequestRedirected, + /// + /// NetworkRequestTimeout + /// + [EnumMember(Value = ("NetworkRequestTimeout"))] + NetworkRequestTimeout, + /// + /// NetworkExceedsBufferLimit + /// + [EnumMember(Value = ("NetworkExceedsBufferLimit"))] + NetworkExceedsBufferLimit, + /// + /// NavigationCancelledWhileRestoring + /// + [EnumMember(Value = ("NavigationCancelledWhileRestoring"))] + NavigationCancelledWhileRestoring, + /// + /// NotMostRecentNavigationEntry + /// + [EnumMember(Value = ("NotMostRecentNavigationEntry"))] + NotMostRecentNavigationEntry, + /// + /// BackForwardCacheDisabledForPrerender + /// + [EnumMember(Value = ("BackForwardCacheDisabledForPrerender"))] + BackForwardCacheDisabledForPrerender, + /// + /// UserAgentOverrideDiffers + /// + [EnumMember(Value = ("UserAgentOverrideDiffers"))] + UserAgentOverrideDiffers, + /// + /// ForegroundCacheLimit + /// + [EnumMember(Value = ("ForegroundCacheLimit"))] + ForegroundCacheLimit, + /// + /// BrowsingInstanceNotSwapped + /// + [EnumMember(Value = ("BrowsingInstanceNotSwapped"))] + BrowsingInstanceNotSwapped, + /// + /// BackForwardCacheDisabledForDelegate + /// + [EnumMember(Value = ("BackForwardCacheDisabledForDelegate"))] + BackForwardCacheDisabledForDelegate, + /// + /// UnloadHandlerExistsInMainFrame + /// + [EnumMember(Value = ("UnloadHandlerExistsInMainFrame"))] + UnloadHandlerExistsInMainFrame, + /// + /// UnloadHandlerExistsInSubFrame + /// + [EnumMember(Value = ("UnloadHandlerExistsInSubFrame"))] + UnloadHandlerExistsInSubFrame, + /// + /// ServiceWorkerUnregistration + /// + [EnumMember(Value = ("ServiceWorkerUnregistration"))] + ServiceWorkerUnregistration, + /// + /// CacheControlNoStore + /// + [EnumMember(Value = ("CacheControlNoStore"))] + CacheControlNoStore, + /// + /// CacheControlNoStoreCookieModified + /// + [EnumMember(Value = ("CacheControlNoStoreCookieModified"))] + CacheControlNoStoreCookieModified, + /// + /// CacheControlNoStoreHTTPOnlyCookieModified + /// + [EnumMember(Value = ("CacheControlNoStoreHTTPOnlyCookieModified"))] + CacheControlNoStoreHTTPOnlyCookieModified, + /// + /// NoResponseHead + /// + [EnumMember(Value = ("NoResponseHead"))] + NoResponseHead, + /// + /// Unknown + /// + [EnumMember(Value = ("Unknown"))] + Unknown, + /// + /// ActivationNavigationsDisallowedForBug1234857 + /// + [EnumMember(Value = ("ActivationNavigationsDisallowedForBug1234857"))] + ActivationNavigationsDisallowedForBug1234857, + /// + /// ErrorDocument + /// + [EnumMember(Value = ("ErrorDocument"))] + ErrorDocument, + /// + /// FencedFramesEmbedder + /// + [EnumMember(Value = ("FencedFramesEmbedder"))] + FencedFramesEmbedder, + /// + /// CookieDisabled + /// + [EnumMember(Value = ("CookieDisabled"))] + CookieDisabled, + /// + /// HTTPAuthRequired + /// + [EnumMember(Value = ("HTTPAuthRequired"))] + HTTPAuthRequired, + /// + /// CookieFlushed + /// + [EnumMember(Value = ("CookieFlushed"))] + CookieFlushed, + /// + /// BroadcastChannelOnMessage + /// + [EnumMember(Value = ("BroadcastChannelOnMessage"))] + BroadcastChannelOnMessage, + /// + /// WebViewSettingsChanged + /// + [EnumMember(Value = ("WebViewSettingsChanged"))] + WebViewSettingsChanged, + /// + /// WebViewJavaScriptObjectChanged + /// + [EnumMember(Value = ("WebViewJavaScriptObjectChanged"))] + WebViewJavaScriptObjectChanged, + /// + /// WebViewMessageListenerInjected + /// + [EnumMember(Value = ("WebViewMessageListenerInjected"))] + WebViewMessageListenerInjected, + /// + /// WebViewSafeBrowsingAllowlistChanged + /// + [EnumMember(Value = ("WebViewSafeBrowsingAllowlistChanged"))] + WebViewSafeBrowsingAllowlistChanged, + /// + /// WebViewDocumentStartJavascriptChanged + /// + [EnumMember(Value = ("WebViewDocumentStartJavascriptChanged"))] + WebViewDocumentStartJavascriptChanged, + /// + /// WebSocket + /// + [EnumMember(Value = ("WebSocket"))] + WebSocket, + /// + /// WebTransport + /// + [EnumMember(Value = ("WebTransport"))] + WebTransport, + /// + /// WebRTC + /// + [EnumMember(Value = ("WebRTC"))] + WebRTC, + /// + /// MainResourceHasCacheControlNoStore + /// + [EnumMember(Value = ("MainResourceHasCacheControlNoStore"))] + MainResourceHasCacheControlNoStore, + /// + /// MainResourceHasCacheControlNoCache + /// + [EnumMember(Value = ("MainResourceHasCacheControlNoCache"))] + MainResourceHasCacheControlNoCache, + /// + /// SubresourceHasCacheControlNoStore + /// + [EnumMember(Value = ("SubresourceHasCacheControlNoStore"))] + SubresourceHasCacheControlNoStore, + /// + /// SubresourceHasCacheControlNoCache + /// + [EnumMember(Value = ("SubresourceHasCacheControlNoCache"))] + SubresourceHasCacheControlNoCache, + /// + /// ContainsPlugins + /// + [EnumMember(Value = ("ContainsPlugins"))] + ContainsPlugins, + /// + /// DocumentLoaded + /// + [EnumMember(Value = ("DocumentLoaded"))] + DocumentLoaded, + /// + /// OutstandingNetworkRequestOthers + /// + [EnumMember(Value = ("OutstandingNetworkRequestOthers"))] + OutstandingNetworkRequestOthers, + /// + /// RequestedMIDIPermission + /// + [EnumMember(Value = ("RequestedMIDIPermission"))] + RequestedMIDIPermission, + /// + /// RequestedAudioCapturePermission + /// + [EnumMember(Value = ("RequestedAudioCapturePermission"))] + RequestedAudioCapturePermission, + /// + /// RequestedVideoCapturePermission + /// + [EnumMember(Value = ("RequestedVideoCapturePermission"))] + RequestedVideoCapturePermission, + /// + /// RequestedBackForwardCacheBlockedSensors + /// + [EnumMember(Value = ("RequestedBackForwardCacheBlockedSensors"))] + RequestedBackForwardCacheBlockedSensors, + /// + /// RequestedBackgroundWorkPermission + /// + [EnumMember(Value = ("RequestedBackgroundWorkPermission"))] + RequestedBackgroundWorkPermission, + /// + /// BroadcastChannel + /// + [EnumMember(Value = ("BroadcastChannel"))] + BroadcastChannel, + /// + /// WebXR + /// + [EnumMember(Value = ("WebXR"))] + WebXR, + /// + /// SharedWorker + /// + [EnumMember(Value = ("SharedWorker"))] + SharedWorker, + /// + /// SharedWorkerMessage + /// + [EnumMember(Value = ("SharedWorkerMessage"))] + SharedWorkerMessage, + /// + /// SharedWorkerWithNoActiveClient + /// + [EnumMember(Value = ("SharedWorkerWithNoActiveClient"))] + SharedWorkerWithNoActiveClient, + /// + /// WebLocks + /// + [EnumMember(Value = ("WebLocks"))] + WebLocks, + /// + /// WebLocksContention + /// + [EnumMember(Value = ("WebLocksContention"))] + WebLocksContention, + /// + /// WebHID + /// + [EnumMember(Value = ("WebHID"))] + WebHID, + /// + /// WebBluetooth + /// + [EnumMember(Value = ("WebBluetooth"))] + WebBluetooth, + /// + /// WebShare + /// + [EnumMember(Value = ("WebShare"))] + WebShare, + /// + /// RequestedStorageAccessGrant + /// + [EnumMember(Value = ("RequestedStorageAccessGrant"))] + RequestedStorageAccessGrant, + /// + /// WebNfc + /// + [EnumMember(Value = ("WebNfc"))] + WebNfc, + /// + /// OutstandingNetworkRequestFetch + /// + [EnumMember(Value = ("OutstandingNetworkRequestFetch"))] + OutstandingNetworkRequestFetch, + /// + /// OutstandingNetworkRequestXHR + /// + [EnumMember(Value = ("OutstandingNetworkRequestXHR"))] + OutstandingNetworkRequestXHR, + /// + /// AppBanner + /// + [EnumMember(Value = ("AppBanner"))] + AppBanner, + /// + /// Printing + /// + [EnumMember(Value = ("Printing"))] + Printing, + /// + /// WebDatabase + /// + [EnumMember(Value = ("WebDatabase"))] + WebDatabase, + /// + /// PictureInPicture + /// + [EnumMember(Value = ("PictureInPicture"))] + PictureInPicture, + /// + /// SpeechRecognizer + /// + [EnumMember(Value = ("SpeechRecognizer"))] + SpeechRecognizer, + /// + /// IdleManager + /// + [EnumMember(Value = ("IdleManager"))] + IdleManager, + /// + /// PaymentManager + /// + [EnumMember(Value = ("PaymentManager"))] + PaymentManager, + /// + /// SpeechSynthesis + /// + [EnumMember(Value = ("SpeechSynthesis"))] + SpeechSynthesis, + /// + /// KeyboardLock + /// + [EnumMember(Value = ("KeyboardLock"))] + KeyboardLock, + /// + /// WebOTPService + /// + [EnumMember(Value = ("WebOTPService"))] + WebOTPService, + /// + /// OutstandingNetworkRequestDirectSocket + /// + [EnumMember(Value = ("OutstandingNetworkRequestDirectSocket"))] + OutstandingNetworkRequestDirectSocket, + /// + /// InjectedJavascript + /// + [EnumMember(Value = ("InjectedJavascript"))] + InjectedJavascript, + /// + /// InjectedStyleSheet + /// + [EnumMember(Value = ("InjectedStyleSheet"))] + InjectedStyleSheet, + /// + /// KeepaliveRequest + /// + [EnumMember(Value = ("KeepaliveRequest"))] + KeepaliveRequest, + /// + /// IndexedDBEvent + /// + [EnumMember(Value = ("IndexedDBEvent"))] + IndexedDBEvent, + /// + /// Dummy + /// + [EnumMember(Value = ("Dummy"))] + Dummy, + /// + /// JsNetworkRequestReceivedCacheControlNoStoreResource + /// + [EnumMember(Value = ("JsNetworkRequestReceivedCacheControlNoStoreResource"))] + JsNetworkRequestReceivedCacheControlNoStoreResource, + /// + /// WebRTCUsedWithCCNS + /// + [EnumMember(Value = ("WebRTCUsedWithCCNS"))] + WebRTCUsedWithCCNS, + /// + /// WebTransportUsedWithCCNS + /// + [EnumMember(Value = ("WebTransportUsedWithCCNS"))] + WebTransportUsedWithCCNS, + /// + /// WebSocketUsedWithCCNS + /// + [EnumMember(Value = ("WebSocketUsedWithCCNS"))] + WebSocketUsedWithCCNS, + /// + /// SmartCard + /// + [EnumMember(Value = ("SmartCard"))] + SmartCard, + /// + /// LiveMediaStreamTrack + /// + [EnumMember(Value = ("LiveMediaStreamTrack"))] + LiveMediaStreamTrack, + /// + /// UnloadHandler + /// + [EnumMember(Value = ("UnloadHandler"))] + UnloadHandler, + /// + /// ParserAborted + /// + [EnumMember(Value = ("ParserAborted"))] + ParserAborted, + /// + /// ContentSecurityHandler + /// + [EnumMember(Value = ("ContentSecurityHandler"))] + ContentSecurityHandler, + /// + /// ContentWebAuthenticationAPI + /// + [EnumMember(Value = ("ContentWebAuthenticationAPI"))] + ContentWebAuthenticationAPI, + /// + /// ContentFileChooser + /// + [EnumMember(Value = ("ContentFileChooser"))] + ContentFileChooser, + /// + /// ContentSerial + /// + [EnumMember(Value = ("ContentSerial"))] + ContentSerial, + /// + /// ContentFileSystemAccess + /// + [EnumMember(Value = ("ContentFileSystemAccess"))] + ContentFileSystemAccess, + /// + /// ContentMediaDevicesDispatcherHost + /// + [EnumMember(Value = ("ContentMediaDevicesDispatcherHost"))] + ContentMediaDevicesDispatcherHost, + /// + /// ContentWebBluetooth + /// + [EnumMember(Value = ("ContentWebBluetooth"))] + ContentWebBluetooth, + /// + /// ContentWebUSB + /// + [EnumMember(Value = ("ContentWebUSB"))] + ContentWebUSB, + /// + /// ContentMediaSessionService + /// + [EnumMember(Value = ("ContentMediaSessionService"))] + ContentMediaSessionService, + /// + /// ContentScreenReader + /// + [EnumMember(Value = ("ContentScreenReader"))] + ContentScreenReader, + /// + /// ContentDiscarded + /// + [EnumMember(Value = ("ContentDiscarded"))] + ContentDiscarded, + /// + /// EmbedderPopupBlockerTabHelper + /// + [EnumMember(Value = ("EmbedderPopupBlockerTabHelper"))] + EmbedderPopupBlockerTabHelper, + /// + /// EmbedderSafeBrowsingTriggeredPopupBlocker + /// + [EnumMember(Value = ("EmbedderSafeBrowsingTriggeredPopupBlocker"))] + EmbedderSafeBrowsingTriggeredPopupBlocker, + /// + /// EmbedderSafeBrowsingThreatDetails + /// + [EnumMember(Value = ("EmbedderSafeBrowsingThreatDetails"))] + EmbedderSafeBrowsingThreatDetails, + /// + /// EmbedderAppBannerManager + /// + [EnumMember(Value = ("EmbedderAppBannerManager"))] + EmbedderAppBannerManager, + /// + /// EmbedderDomDistillerViewerSource + /// + [EnumMember(Value = ("EmbedderDomDistillerViewerSource"))] + EmbedderDomDistillerViewerSource, + /// + /// EmbedderDomDistillerSelfDeletingRequestDelegate + /// + [EnumMember(Value = ("EmbedderDomDistillerSelfDeletingRequestDelegate"))] + EmbedderDomDistillerSelfDeletingRequestDelegate, + /// + /// EmbedderOomInterventionTabHelper + /// + [EnumMember(Value = ("EmbedderOomInterventionTabHelper"))] + EmbedderOomInterventionTabHelper, + /// + /// EmbedderOfflinePage + /// + [EnumMember(Value = ("EmbedderOfflinePage"))] + EmbedderOfflinePage, + /// + /// EmbedderChromePasswordManagerClientBindCredentialManager + /// + [EnumMember(Value = ("EmbedderChromePasswordManagerClientBindCredentialManager"))] + EmbedderChromePasswordManagerClientBindCredentialManager, + /// + /// EmbedderPermissionRequestManager + /// + [EnumMember(Value = ("EmbedderPermissionRequestManager"))] + EmbedderPermissionRequestManager, + /// + /// EmbedderModalDialog + /// + [EnumMember(Value = ("EmbedderModalDialog"))] + EmbedderModalDialog, + /// + /// EmbedderExtensions + /// + [EnumMember(Value = ("EmbedderExtensions"))] + EmbedderExtensions, + /// + /// EmbedderExtensionMessaging + /// + [EnumMember(Value = ("EmbedderExtensionMessaging"))] + EmbedderExtensionMessaging, + /// + /// EmbedderExtensionMessagingForOpenPort + /// + [EnumMember(Value = ("EmbedderExtensionMessagingForOpenPort"))] + EmbedderExtensionMessagingForOpenPort, + /// + /// EmbedderExtensionSentMessageToCachedFrame + /// + [EnumMember(Value = ("EmbedderExtensionSentMessageToCachedFrame"))] + EmbedderExtensionSentMessageToCachedFrame, + /// + /// RequestedByWebViewClient + /// + [EnumMember(Value = ("RequestedByWebViewClient"))] + RequestedByWebViewClient, + /// + /// PostMessageByWebViewClient + /// + [EnumMember(Value = ("PostMessageByWebViewClient"))] + PostMessageByWebViewClient, + /// + /// CacheControlNoStoreDeviceBoundSessionTerminated + /// + [EnumMember(Value = ("CacheControlNoStoreDeviceBoundSessionTerminated"))] + CacheControlNoStoreDeviceBoundSessionTerminated, + /// + /// CacheLimitPrunedOnModerateMemoryPressure + /// + [EnumMember(Value = ("CacheLimitPrunedOnModerateMemoryPressure"))] + CacheLimitPrunedOnModerateMemoryPressure, + /// + /// CacheLimitPrunedOnCriticalMemoryPressure + /// + [EnumMember(Value = ("CacheLimitPrunedOnCriticalMemoryPressure"))] + CacheLimitPrunedOnCriticalMemoryPressure + } + + /// + /// Types of not restored reasons for back-forward cache. + /// + public enum BackForwardCacheNotRestoredReasonType + { + /// + /// SupportPending + /// + [EnumMember(Value = ("SupportPending"))] + SupportPending, + /// + /// PageSupportNeeded + /// + [EnumMember(Value = ("PageSupportNeeded"))] + PageSupportNeeded, + /// + /// Circumstantial + /// + [EnumMember(Value = ("Circumstantial"))] + Circumstantial + } + + /// + /// BackForwardCacheBlockingDetails + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BackForwardCacheBlockingDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Url of the file where blockage happened. Optional because of tests. + /// + [DataMember(Name = ("url"), IsRequired = (false))] + public string Url + { + get; + set; + } + + /// + /// Function name where blockage happened. Optional because of anonymous functions and tests. + /// + [DataMember(Name = ("function"), IsRequired = (false))] + public string Function + { + get; + set; + } + + /// + /// Line number in the script (0-based). + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// Column number in the script (0-based). + /// + [DataMember(Name = ("columnNumber"), IsRequired = (true))] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// BackForwardCacheNotRestoredExplanation + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BackForwardCacheNotRestoredExplanation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type of the reason + /// + public CefSharp.DevTools.Page.BackForwardCacheNotRestoredReasonType Type + { + get + { + return (CefSharp.DevTools.Page.BackForwardCacheNotRestoredReasonType)(StringToEnum(typeof(CefSharp.DevTools.Page.BackForwardCacheNotRestoredReasonType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type of the reason + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Not restored reason + /// + public CefSharp.DevTools.Page.BackForwardCacheNotRestoredReason Reason + { + get + { + return (CefSharp.DevTools.Page.BackForwardCacheNotRestoredReason)(StringToEnum(typeof(CefSharp.DevTools.Page.BackForwardCacheNotRestoredReason), reason)); + } + + set + { + this.reason = (EnumToString(value)); + } + } + + /// + /// Not restored reason + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + internal string reason + { + get; + set; + } + + /// + /// Context associated with the reason. The meaning of this context is + /// dependent on the reason: + /// - EmbedderExtensionSentMessageToCachedFrame: the extension ID. + /// + [DataMember(Name = ("context"), IsRequired = (false))] + public string Context + { + get; + set; + } + + /// + /// Details + /// + [DataMember(Name = ("details"), IsRequired = (false))] + public System.Collections.Generic.IList Details + { + get; + set; + } + } + + /// + /// BackForwardCacheNotRestoredExplanationTree + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BackForwardCacheNotRestoredExplanationTree : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// URL of each frame + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Not restored reasons of each frame + /// + [DataMember(Name = ("explanations"), IsRequired = (true))] + public System.Collections.Generic.IList Explanations + { + get; + set; + } + + /// + /// Array of children frame + /// + [DataMember(Name = ("children"), IsRequired = (true))] + public System.Collections.Generic.IList Children + { + get; + set; + } + } + + /// + /// domContentEventFired + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DomContentEventFiredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Input mode. + /// + public enum FileChooserOpenedMode + { + /// + /// selectSingle + /// + [EnumMember(Value = ("selectSingle"))] + SelectSingle, + /// + /// selectMultiple + /// + [EnumMember(Value = ("selectMultiple"))] + SelectMultiple + } + + /// + /// Emitted only when `page.interceptFileChooser` is enabled. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FileChooserOpenedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame containing input node. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Input mode. + /// + public CefSharp.DevTools.Page.FileChooserOpenedMode Mode + { + get + { + return (CefSharp.DevTools.Page.FileChooserOpenedMode)(StringToEnum(typeof(CefSharp.DevTools.Page.FileChooserOpenedMode), mode)); + } + + set + { + this.mode = (EnumToString(value)); + } + } + + /// + /// Input mode. + /// + [DataMember(Name = ("mode"), IsRequired = (true))] + internal string mode + { + get; + private set; + } + + /// + /// Input node id. Only present for file choosers opened via an `<input type="file" >` element. + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (false))] + public int? BackendNodeId + { + get; + private set; + } + } + + /// + /// Fired when frame has been attached to its parent. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameAttachedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has been attached. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Parent frame identifier. + /// + [DataMember(Name = ("parentFrameId"), IsRequired = (true))] + public string ParentFrameId + { + get; + private set; + } + + /// + /// JavaScript stack trace of when frame was attached, only set if frame initiated from script. + /// + [DataMember(Name = ("stack"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace Stack + { + get; + private set; + } + } + + /// + /// Fired when frame no longer has a scheduled navigation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameClearedScheduledNavigationEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has cleared its scheduled navigation. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + } + + /// + /// FrameDetachedReason + /// + public enum FrameDetachedReason + { + /// + /// remove + /// + [EnumMember(Value = ("remove"))] + Remove, + /// + /// swap + /// + [EnumMember(Value = ("swap"))] + Swap + } + + /// + /// Fired when frame has been detached from its parent. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameDetachedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has been detached. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Reason + /// + public CefSharp.DevTools.Page.FrameDetachedReason Reason + { + get + { + return (CefSharp.DevTools.Page.FrameDetachedReason)(StringToEnum(typeof(CefSharp.DevTools.Page.FrameDetachedReason), reason)); + } + + set + { + this.reason = (EnumToString(value)); + } + } + + /// + /// Reason + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + internal string reason + { + get; + private set; + } + } + + /// + /// Fired before frame subtree is detached. Emitted before any frame of the + /// subtree is actually detached. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameSubtreeWillBeDetachedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that is the root of the subtree that will be detached. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + } + + /// + /// Fired once navigation of the frame has completed. Frame is now associated with the new loader. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameNavigatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Frame object. + /// + [DataMember(Name = ("frame"), IsRequired = (true))] + public CefSharp.DevTools.Page.Frame Frame + { + get; + private set; + } + + /// + /// Type + /// + public CefSharp.DevTools.Page.NavigationType Type + { + get + { + return (CefSharp.DevTools.Page.NavigationType)(StringToEnum(typeof(CefSharp.DevTools.Page.NavigationType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + } + + /// + /// Fired when opening document to write to. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DocumentOpenedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Frame object. + /// + [DataMember(Name = ("frame"), IsRequired = (true))] + public CefSharp.DevTools.Page.Frame Frame + { + get; + private set; + } + } + + /// + /// FrameStartedNavigatingNavigationType + /// + public enum FrameStartedNavigatingNavigationType + { + /// + /// reload + /// + [EnumMember(Value = ("reload"))] + Reload, + /// + /// reloadBypassingCache + /// + [EnumMember(Value = ("reloadBypassingCache"))] + ReloadBypassingCache, + /// + /// restore + /// + [EnumMember(Value = ("restore"))] + Restore, + /// + /// restoreWithPost + /// + [EnumMember(Value = ("restoreWithPost"))] + RestoreWithPost, + /// + /// historySameDocument + /// + [EnumMember(Value = ("historySameDocument"))] + HistorySameDocument, + /// + /// historyDifferentDocument + /// + [EnumMember(Value = ("historyDifferentDocument"))] + HistoryDifferentDocument, + /// + /// sameDocument + /// + [EnumMember(Value = ("sameDocument"))] + SameDocument, + /// + /// differentDocument + /// + [EnumMember(Value = ("differentDocument"))] + DifferentDocument + } + + /// + /// Fired when a navigation starts. This event is fired for both + /// renderer-initiated and browser-initiated navigations. For renderer-initiated + /// navigations, the event is fired after `frameRequestedNavigation`. + /// Navigation may still be cancelled after the event is issued. Multiple events + /// can be fired for a single navigation, for example, when a same-document + /// navigation becomes a cross-document navigation (such as in the case of a + /// frameset). + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameStartedNavigatingEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ID of the frame that is being navigated. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// The URL the navigation started with. The final URL can be different. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Loader identifier. Even though it is present in case of same-document + /// navigation, the previously committed loaderId would not change unless + /// the navigation changes from a same-document to a cross-document + /// navigation. + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + private set; + } + + /// + /// NavigationType + /// + public CefSharp.DevTools.Page.FrameStartedNavigatingNavigationType NavigationType + { + get + { + return (CefSharp.DevTools.Page.FrameStartedNavigatingNavigationType)(StringToEnum(typeof(CefSharp.DevTools.Page.FrameStartedNavigatingNavigationType), navigationType)); + } + + set + { + this.navigationType = (EnumToString(value)); + } + } + + /// + /// NavigationType + /// + [DataMember(Name = ("navigationType"), IsRequired = (true))] + internal string navigationType + { + get; + private set; + } + } + + /// + /// Fired when a renderer-initiated navigation is requested. + /// Navigation may still be cancelled after the event is issued. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameRequestedNavigationEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that is being navigated. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// The reason for the navigation. + /// + public CefSharp.DevTools.Page.ClientNavigationReason Reason + { + get + { + return (CefSharp.DevTools.Page.ClientNavigationReason)(StringToEnum(typeof(CefSharp.DevTools.Page.ClientNavigationReason), reason)); + } + + set + { + this.reason = (EnumToString(value)); + } + } + + /// + /// The reason for the navigation. + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + internal string reason + { + get; + private set; + } + + /// + /// The destination URL for the requested navigation. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// The disposition for the navigation. + /// + public CefSharp.DevTools.Page.ClientNavigationDisposition Disposition + { + get + { + return (CefSharp.DevTools.Page.ClientNavigationDisposition)(StringToEnum(typeof(CefSharp.DevTools.Page.ClientNavigationDisposition), disposition)); + } + + set + { + this.disposition = (EnumToString(value)); + } + } + + /// + /// The disposition for the navigation. + /// + [DataMember(Name = ("disposition"), IsRequired = (true))] + internal string disposition + { + get; + private set; + } + } + + /// + /// Fired when frame schedules a potential navigation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameScheduledNavigationEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has scheduled a navigation. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Delay (in seconds) until the navigation is scheduled to begin. The navigation is not + /// guaranteed to start. + /// + [DataMember(Name = ("delay"), IsRequired = (true))] + public double Delay + { + get; + private set; + } + + /// + /// The reason for the navigation. + /// + public CefSharp.DevTools.Page.ClientNavigationReason Reason + { + get + { + return (CefSharp.DevTools.Page.ClientNavigationReason)(StringToEnum(typeof(CefSharp.DevTools.Page.ClientNavigationReason), reason)); + } + + set + { + this.reason = (EnumToString(value)); + } + } + + /// + /// The reason for the navigation. + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + internal string reason + { + get; + private set; + } + + /// + /// The destination URL for the scheduled navigation. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + } + + /// + /// Fired when frame has started loading. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameStartedLoadingEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has started loading. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + } + + /// + /// Fired when frame has stopped loading. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class FrameStoppedLoadingEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has stopped loading. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + } + + /// + /// Fired when page is about to start a download. + /// Deprecated. Use Browser.downloadWillBegin instead. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DownloadWillBeginEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that caused download to begin. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Global unique identifier of the download. + /// + [DataMember(Name = ("guid"), IsRequired = (true))] + public string Guid + { + get; + private set; + } + + /// + /// URL of the resource being downloaded. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Suggested file name of the resource (the actual name of the file saved on disk may differ). + /// + [DataMember(Name = ("suggestedFilename"), IsRequired = (true))] + public string SuggestedFilename + { + get; + private set; + } + } + + /// + /// Download status. + /// + public enum DownloadProgressState + { + /// + /// inProgress + /// + [EnumMember(Value = ("inProgress"))] + InProgress, + /// + /// completed + /// + [EnumMember(Value = ("completed"))] + Completed, + /// + /// canceled + /// + [EnumMember(Value = ("canceled"))] + Canceled + } + + /// + /// Fired when download makes progress. Last call has |done| == true. + /// Deprecated. Use Browser.downloadProgress instead. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DownloadProgressEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Global unique identifier of the download. + /// + [DataMember(Name = ("guid"), IsRequired = (true))] + public string Guid + { + get; + private set; + } + + /// + /// Total expected bytes to download. + /// + [DataMember(Name = ("totalBytes"), IsRequired = (true))] + public double TotalBytes + { + get; + private set; + } + + /// + /// Total bytes received. + /// + [DataMember(Name = ("receivedBytes"), IsRequired = (true))] + public double ReceivedBytes + { + get; + private set; + } + + /// + /// Download status. + /// + public CefSharp.DevTools.Page.DownloadProgressState State + { + get + { + return (CefSharp.DevTools.Page.DownloadProgressState)(StringToEnum(typeof(CefSharp.DevTools.Page.DownloadProgressState), state)); + } + + set + { + this.state = (EnumToString(value)); + } + } + + /// + /// Download status. + /// + [DataMember(Name = ("state"), IsRequired = (true))] + internal string state + { + get; + private set; + } + } + + /// + /// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been + /// closed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class JavascriptDialogClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Frame id. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Whether dialog was confirmed. + /// + [DataMember(Name = ("result"), IsRequired = (true))] + public bool Result + { + get; + private set; + } + + /// + /// User input in case of prompt. + /// + [DataMember(Name = ("userInput"), IsRequired = (true))] + public string UserInput + { + get; + private set; + } + } + + /// + /// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to + /// open. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class JavascriptDialogOpeningEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Frame url. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Frame id. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Message that will be displayed by the dialog. + /// + [DataMember(Name = ("message"), IsRequired = (true))] + public string Message + { + get; + private set; + } + + /// + /// Dialog type. + /// + public CefSharp.DevTools.Page.DialogType Type + { + get + { + return (CefSharp.DevTools.Page.DialogType)(StringToEnum(typeof(CefSharp.DevTools.Page.DialogType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Dialog type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// True iff browser is capable showing or acting on the given dialog. When browser has no + /// dialog handler for given target, calling alert while Page domain is engaged will stall + /// the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog. + /// + [DataMember(Name = ("hasBrowserHandler"), IsRequired = (true))] + public bool HasBrowserHandler + { + get; + private set; + } + + /// + /// Default dialog prompt. + /// + [DataMember(Name = ("defaultPrompt"), IsRequired = (false))] + public string DefaultPrompt + { + get; + private set; + } + } + + /// + /// Fired for lifecycle events (navigation, load, paint, etc) in the current + /// target (including local frames). + /// + [System.Runtime.Serialization.DataContractAttribute] + public class LifecycleEventEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Loader identifier. Empty string if the request is fetched from worker. + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + private set; + } + + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do + /// not assume any ordering with the Page.frameNavigated event. This event is fired only for + /// main-frame history navigation where the document changes (non-same-document navigations), + /// when bfcache navigation fails. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class BackForwardCacheNotUsedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The loader id for the associated navigation. + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + private set; + } + + /// + /// The frame id of the associated frame. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Array of reasons why the page could not be cached. This must not be empty. + /// + [DataMember(Name = ("notRestoredExplanations"), IsRequired = (true))] + public System.Collections.Generic.IList NotRestoredExplanations + { + get; + private set; + } + + /// + /// Tree structure of reasons why the page could not be cached for each frame. + /// + [DataMember(Name = ("notRestoredExplanationsTree"), IsRequired = (false))] + public CefSharp.DevTools.Page.BackForwardCacheNotRestoredExplanationTree NotRestoredExplanationsTree + { + get; + private set; + } + } + + /// + /// loadEventFired + /// + [System.Runtime.Serialization.DataContractAttribute] + public class LoadEventFiredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Navigation type + /// + public enum NavigatedWithinDocumentNavigationType + { + /// + /// fragment + /// + [EnumMember(Value = ("fragment"))] + Fragment, + /// + /// historyApi + /// + [EnumMember(Value = ("historyApi"))] + HistoryApi, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other + } + + /// + /// Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class NavigatedWithinDocumentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + private set; + } + + /// + /// Frame's new url. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Navigation type + /// + public CefSharp.DevTools.Page.NavigatedWithinDocumentNavigationType NavigationType + { + get + { + return (CefSharp.DevTools.Page.NavigatedWithinDocumentNavigationType)(StringToEnum(typeof(CefSharp.DevTools.Page.NavigatedWithinDocumentNavigationType), navigationType)); + } + + set + { + this.navigationType = (EnumToString(value)); + } + } + + /// + /// Navigation type + /// + [DataMember(Name = ("navigationType"), IsRequired = (true))] + internal string navigationType + { + get; + private set; + } + } + + /// + /// Compressed image data requested by the `startScreencast`. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ScreencastFrameEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Base64-encoded compressed image. + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + private set; + } + + /// + /// Screencast frame metadata. + /// + [DataMember(Name = ("metadata"), IsRequired = (true))] + public CefSharp.DevTools.Page.ScreencastFrameMetadata Metadata + { + get; + private set; + } + + /// + /// Frame number. + /// + [DataMember(Name = ("sessionId"), IsRequired = (true))] + public int SessionId + { + get; + private set; + } + } + + /// + /// Fired when the page with currently enabled screencast was shown or hidden `. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ScreencastVisibilityChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// True if the page is visible. + /// + [DataMember(Name = ("visible"), IsRequired = (true))] + public bool Visible + { + get; + private set; + } + } + + /// + /// Fired when a new window is going to be opened, via window.open(), link click, form submission, + /// etc. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WindowOpenEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The URL for the new window. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Window name. + /// + [DataMember(Name = ("windowName"), IsRequired = (true))] + public string WindowName + { + get; + private set; + } + + /// + /// An array of enabled window features. + /// + [DataMember(Name = ("windowFeatures"), IsRequired = (true))] + public string[] WindowFeatures + { + get; + private set; + } + + /// + /// Whether or not it was triggered by user gesture. + /// + [DataMember(Name = ("userGesture"), IsRequired = (true))] + public bool UserGesture + { + get; + private set; + } + } + + /// + /// Issued for every compilation cache generated. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CompilationCacheProducedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Base64-encoded data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Performance +{ + /// + /// Run-time execution metric. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Metric : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Metric name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Metric value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public double Value + { + get; + set; + } + } + + /// + /// Current values of the metrics. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class MetricsEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Current values of the metrics. + /// + [DataMember(Name = ("metrics"), IsRequired = (true))] + public System.Collections.Generic.IList Metrics + { + get; + private set; + } + + /// + /// Timestamp title. + /// + [DataMember(Name = ("title"), IsRequired = (true))] + public string Title + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.PerformanceTimeline +{ + /// + /// See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LargestContentfulPaint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// RenderTime + /// + [DataMember(Name = ("renderTime"), IsRequired = (true))] + public double RenderTime + { + get; + set; + } + + /// + /// LoadTime + /// + [DataMember(Name = ("loadTime"), IsRequired = (true))] + public double LoadTime + { + get; + set; + } + + /// + /// The number of pixels being painted. + /// + [DataMember(Name = ("size"), IsRequired = (true))] + public double Size + { + get; + set; + } + + /// + /// The id attribute of the element, if available. + /// + [DataMember(Name = ("elementId"), IsRequired = (false))] + public string ElementId + { + get; + set; + } + + /// + /// The URL of the image (may be trimmed). + /// + [DataMember(Name = ("url"), IsRequired = (false))] + public string Url + { + get; + set; + } + + /// + /// NodeId + /// + [DataMember(Name = ("nodeId"), IsRequired = (false))] + public int? NodeId + { + get; + set; + } + } + + /// + /// LayoutShiftAttribution + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LayoutShiftAttribution : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// PreviousRect + /// + [DataMember(Name = ("previousRect"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect PreviousRect + { + get; + set; + } + + /// + /// CurrentRect + /// + [DataMember(Name = ("currentRect"), IsRequired = (true))] + public CefSharp.DevTools.DOM.Rect CurrentRect + { + get; + set; + } + + /// + /// NodeId + /// + [DataMember(Name = ("nodeId"), IsRequired = (false))] + public int? NodeId + { + get; + set; + } + } + + /// + /// See https://wicg.github.io/layout-instability/#sec-layout-shift and layout_shift.idl + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LayoutShift : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Score increment produced by this event. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public double Value + { + get; + set; + } + + /// + /// HadRecentInput + /// + [DataMember(Name = ("hadRecentInput"), IsRequired = (true))] + public bool HadRecentInput + { + get; + set; + } + + /// + /// LastInputTime + /// + [DataMember(Name = ("lastInputTime"), IsRequired = (true))] + public double LastInputTime + { + get; + set; + } + + /// + /// Sources + /// + [DataMember(Name = ("sources"), IsRequired = (true))] + public System.Collections.Generic.IList Sources + { + get; + set; + } + } + + /// + /// TimelineEvent + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class TimelineEvent : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Identifies the frame that this event is related to. Empty for non-frame targets. + /// + [DataMember(Name = ("frameId"), IsRequired = (true))] + public string FrameId + { + get; + set; + } + + /// + /// The event type, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype + /// This determines which of the optional "details" fields is present. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + public string Type + { + get; + set; + } + + /// + /// Name may be empty depending on the type. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Time in seconds since Epoch, monotonically increasing within document lifetime. + /// + [DataMember(Name = ("time"), IsRequired = (true))] + public double Time + { + get; + set; + } + + /// + /// Event duration, if applicable. + /// + [DataMember(Name = ("duration"), IsRequired = (false))] + public double? Duration + { + get; + set; + } + + /// + /// LcpDetails + /// + [DataMember(Name = ("lcpDetails"), IsRequired = (false))] + public CefSharp.DevTools.PerformanceTimeline.LargestContentfulPaint LcpDetails + { + get; + set; + } + + /// + /// LayoutShiftDetails + /// + [DataMember(Name = ("layoutShiftDetails"), IsRequired = (false))] + public CefSharp.DevTools.PerformanceTimeline.LayoutShift LayoutShiftDetails + { + get; + set; + } + } + + /// + /// Sent when a performance timeline event is added. See reportPerformanceTimeline method. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class TimelineEventAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Event + /// + [DataMember(Name = ("event"), IsRequired = (true))] + public CefSharp.DevTools.PerformanceTimeline.TimelineEvent Event + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Preload +{ + /// + /// Corresponds to SpeculationRuleSet + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RuleSet : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// Identifies a document which the rule set is associated with. + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + set; + } + + /// + /// Source text of JSON representing the rule set. If it comes from + /// `<script>` tag, it is the textContent of the node. Note that it is + /// a JSON for valid case. + /// + /// See also: + /// - https://wicg.github.io/nav-speculation/speculation-rules.html + /// - https://github.com/WICG/nav-speculation/blob/main/triggers.md + /// + [DataMember(Name = ("sourceText"), IsRequired = (true))] + public string SourceText + { + get; + set; + } + + /// + /// A speculation rule set is either added through an inline + /// `<script>` tag or through an external resource via the + /// 'Speculation-Rules' HTTP header. For the first case, we include + /// the BackendNodeId of the relevant `<script>` tag. For the second + /// case, we include the external URL where the rule set was loaded + /// from, and also RequestId if Network domain is enabled. + /// + /// See also: + /// - https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-script + /// - https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-header + /// + [DataMember(Name = ("backendNodeId"), IsRequired = (false))] + public int? BackendNodeId + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (false))] + public string Url + { + get; + set; + } + + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (false))] + public string RequestId + { + get; + set; + } + + /// + /// Error information + /// `errorMessage` is null iff `errorType` is null. + /// + public CefSharp.DevTools.Preload.RuleSetErrorType? ErrorType + { + get + { + return (CefSharp.DevTools.Preload.RuleSetErrorType? )(StringToEnum(typeof(CefSharp.DevTools.Preload.RuleSetErrorType? ), errorType)); + } + + set + { + this.errorType = (EnumToString(value)); + } + } + + /// + /// Error information + /// `errorMessage` is null iff `errorType` is null. + /// + [DataMember(Name = ("errorType"), IsRequired = (false))] + internal string errorType + { + get; + set; + } + + /// + /// TODO(https://crbug.com/1425354): Replace this property with structured error. + /// + [DataMember(Name = ("errorMessage"), IsRequired = (false))] + public string ErrorMessage + { + get; + set; + } + + /// + /// For more details, see: + /// https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md + /// + [DataMember(Name = ("tag"), IsRequired = (false))] + public string Tag + { + get; + set; + } + } + + /// + /// RuleSetErrorType + /// + public enum RuleSetErrorType + { + /// + /// SourceIsNotJsonObject + /// + [EnumMember(Value = ("SourceIsNotJsonObject"))] + SourceIsNotJsonObject, + /// + /// InvalidRulesSkipped + /// + [EnumMember(Value = ("InvalidRulesSkipped"))] + InvalidRulesSkipped, + /// + /// InvalidRulesetLevelTag + /// + [EnumMember(Value = ("InvalidRulesetLevelTag"))] + InvalidRulesetLevelTag + } + + /// + /// The type of preloading attempted. It corresponds to + /// mojom::SpeculationAction (although PrefetchWithSubresources is omitted as it + /// isn't being used by clients). + /// + public enum SpeculationAction + { + /// + /// Prefetch + /// + [EnumMember(Value = ("Prefetch"))] + Prefetch, + /// + /// Prerender + /// + [EnumMember(Value = ("Prerender"))] + Prerender, + /// + /// PrerenderUntilScript + /// + [EnumMember(Value = ("PrerenderUntilScript"))] + PrerenderUntilScript + } + + /// + /// Corresponds to mojom::SpeculationTargetHint. + /// See https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints + /// + public enum SpeculationTargetHint + { + /// + /// Blank + /// + [EnumMember(Value = ("Blank"))] + Blank, + /// + /// Self + /// + [EnumMember(Value = ("Self"))] + Self + } + + /// + /// A key that identifies a preloading attempt. + /// + /// The url used is the url specified by the trigger (i.e. the initial URL), and + /// not the final url that is navigated to. For example, prerendering allows + /// same-origin main frame navigations during the attempt, but the attempt is + /// still keyed with the initial URL. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PreloadingAttemptKey : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// LoaderId + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + set; + } + + /// + /// Action + /// + public CefSharp.DevTools.Preload.SpeculationAction Action + { + get + { + return (CefSharp.DevTools.Preload.SpeculationAction)(StringToEnum(typeof(CefSharp.DevTools.Preload.SpeculationAction), action)); + } + + set + { + this.action = (EnumToString(value)); + } + } + + /// + /// Action + /// + [DataMember(Name = ("action"), IsRequired = (true))] + internal string action + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// TargetHint + /// + public CefSharp.DevTools.Preload.SpeculationTargetHint? TargetHint + { + get + { + return (CefSharp.DevTools.Preload.SpeculationTargetHint? )(StringToEnum(typeof(CefSharp.DevTools.Preload.SpeculationTargetHint? ), targetHint)); + } + + set + { + this.targetHint = (EnumToString(value)); + } + } + + /// + /// TargetHint + /// + [DataMember(Name = ("targetHint"), IsRequired = (false))] + internal string targetHint + { + get; + set; + } + } + + /// + /// Lists sources for a preloading attempt, specifically the ids of rule sets + /// that had a speculation rule that triggered the attempt, and the + /// BackendNodeIds of <a href> or <area href> elements that triggered the + /// attempt (in the case of attempts triggered by a document rule). It is + /// possible for multiple rule sets and links to trigger a single attempt. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PreloadingAttemptSource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public CefSharp.DevTools.Preload.PreloadingAttemptKey Key + { + get; + set; + } + + /// + /// RuleSetIds + /// + [DataMember(Name = ("ruleSetIds"), IsRequired = (true))] + public string[] RuleSetIds + { + get; + set; + } + + /// + /// NodeIds + /// + [DataMember(Name = ("nodeIds"), IsRequired = (true))] + public int[] NodeIds + { + get; + set; + } + } + + /// + /// List of FinalStatus reasons for Prerender2. + /// + public enum PrerenderFinalStatus + { + /// + /// Activated + /// + [EnumMember(Value = ("Activated"))] + Activated, + /// + /// Destroyed + /// + [EnumMember(Value = ("Destroyed"))] + Destroyed, + /// + /// LowEndDevice + /// + [EnumMember(Value = ("LowEndDevice"))] + LowEndDevice, + /// + /// InvalidSchemeRedirect + /// + [EnumMember(Value = ("InvalidSchemeRedirect"))] + InvalidSchemeRedirect, + /// + /// InvalidSchemeNavigation + /// + [EnumMember(Value = ("InvalidSchemeNavigation"))] + InvalidSchemeNavigation, + /// + /// NavigationRequestBlockedByCsp + /// + [EnumMember(Value = ("NavigationRequestBlockedByCsp"))] + NavigationRequestBlockedByCsp, + /// + /// MojoBinderPolicy + /// + [EnumMember(Value = ("MojoBinderPolicy"))] + MojoBinderPolicy, + /// + /// RendererProcessCrashed + /// + [EnumMember(Value = ("RendererProcessCrashed"))] + RendererProcessCrashed, + /// + /// RendererProcessKilled + /// + [EnumMember(Value = ("RendererProcessKilled"))] + RendererProcessKilled, + /// + /// Download + /// + [EnumMember(Value = ("Download"))] + Download, + /// + /// TriggerDestroyed + /// + [EnumMember(Value = ("TriggerDestroyed"))] + TriggerDestroyed, + /// + /// NavigationNotCommitted + /// + [EnumMember(Value = ("NavigationNotCommitted"))] + NavigationNotCommitted, + /// + /// NavigationBadHttpStatus + /// + [EnumMember(Value = ("NavigationBadHttpStatus"))] + NavigationBadHttpStatus, + /// + /// ClientCertRequested + /// + [EnumMember(Value = ("ClientCertRequested"))] + ClientCertRequested, + /// + /// NavigationRequestNetworkError + /// + [EnumMember(Value = ("NavigationRequestNetworkError"))] + NavigationRequestNetworkError, + /// + /// CancelAllHostsForTesting + /// + [EnumMember(Value = ("CancelAllHostsForTesting"))] + CancelAllHostsForTesting, + /// + /// DidFailLoad + /// + [EnumMember(Value = ("DidFailLoad"))] + DidFailLoad, + /// + /// Stop + /// + [EnumMember(Value = ("Stop"))] + Stop, + /// + /// SslCertificateError + /// + [EnumMember(Value = ("SslCertificateError"))] + SslCertificateError, + /// + /// LoginAuthRequested + /// + [EnumMember(Value = ("LoginAuthRequested"))] + LoginAuthRequested, + /// + /// UaChangeRequiresReload + /// + [EnumMember(Value = ("UaChangeRequiresReload"))] + UaChangeRequiresReload, + /// + /// BlockedByClient + /// + [EnumMember(Value = ("BlockedByClient"))] + BlockedByClient, + /// + /// AudioOutputDeviceRequested + /// + [EnumMember(Value = ("AudioOutputDeviceRequested"))] + AudioOutputDeviceRequested, + /// + /// MixedContent + /// + [EnumMember(Value = ("MixedContent"))] + MixedContent, + /// + /// TriggerBackgrounded + /// + [EnumMember(Value = ("TriggerBackgrounded"))] + TriggerBackgrounded, + /// + /// MemoryLimitExceeded + /// + [EnumMember(Value = ("MemoryLimitExceeded"))] + MemoryLimitExceeded, + /// + /// DataSaverEnabled + /// + [EnumMember(Value = ("DataSaverEnabled"))] + DataSaverEnabled, + /// + /// TriggerUrlHasEffectiveUrl + /// + [EnumMember(Value = ("TriggerUrlHasEffectiveUrl"))] + TriggerUrlHasEffectiveUrl, + /// + /// ActivatedBeforeStarted + /// + [EnumMember(Value = ("ActivatedBeforeStarted"))] + ActivatedBeforeStarted, + /// + /// InactivePageRestriction + /// + [EnumMember(Value = ("InactivePageRestriction"))] + InactivePageRestriction, + /// + /// StartFailed + /// + [EnumMember(Value = ("StartFailed"))] + StartFailed, + /// + /// TimeoutBackgrounded + /// + [EnumMember(Value = ("TimeoutBackgrounded"))] + TimeoutBackgrounded, + /// + /// CrossSiteRedirectInInitialNavigation + /// + [EnumMember(Value = ("CrossSiteRedirectInInitialNavigation"))] + CrossSiteRedirectInInitialNavigation, + /// + /// CrossSiteNavigationInInitialNavigation + /// + [EnumMember(Value = ("CrossSiteNavigationInInitialNavigation"))] + CrossSiteNavigationInInitialNavigation, + /// + /// SameSiteCrossOriginRedirectNotOptInInInitialNavigation + /// + [EnumMember(Value = ("SameSiteCrossOriginRedirectNotOptInInInitialNavigation"))] + SameSiteCrossOriginRedirectNotOptInInInitialNavigation, + /// + /// SameSiteCrossOriginNavigationNotOptInInInitialNavigation + /// + [EnumMember(Value = ("SameSiteCrossOriginNavigationNotOptInInInitialNavigation"))] + SameSiteCrossOriginNavigationNotOptInInInitialNavigation, + /// + /// ActivationNavigationParameterMismatch + /// + [EnumMember(Value = ("ActivationNavigationParameterMismatch"))] + ActivationNavigationParameterMismatch, + /// + /// ActivatedInBackground + /// + [EnumMember(Value = ("ActivatedInBackground"))] + ActivatedInBackground, + /// + /// EmbedderHostDisallowed + /// + [EnumMember(Value = ("EmbedderHostDisallowed"))] + EmbedderHostDisallowed, + /// + /// ActivationNavigationDestroyedBeforeSuccess + /// + [EnumMember(Value = ("ActivationNavigationDestroyedBeforeSuccess"))] + ActivationNavigationDestroyedBeforeSuccess, + /// + /// TabClosedByUserGesture + /// + [EnumMember(Value = ("TabClosedByUserGesture"))] + TabClosedByUserGesture, + /// + /// TabClosedWithoutUserGesture + /// + [EnumMember(Value = ("TabClosedWithoutUserGesture"))] + TabClosedWithoutUserGesture, + /// + /// PrimaryMainFrameRendererProcessCrashed + /// + [EnumMember(Value = ("PrimaryMainFrameRendererProcessCrashed"))] + PrimaryMainFrameRendererProcessCrashed, + /// + /// PrimaryMainFrameRendererProcessKilled + /// + [EnumMember(Value = ("PrimaryMainFrameRendererProcessKilled"))] + PrimaryMainFrameRendererProcessKilled, + /// + /// ActivationFramePolicyNotCompatible + /// + [EnumMember(Value = ("ActivationFramePolicyNotCompatible"))] + ActivationFramePolicyNotCompatible, + /// + /// PreloadingDisabled + /// + [EnumMember(Value = ("PreloadingDisabled"))] + PreloadingDisabled, + /// + /// BatterySaverEnabled + /// + [EnumMember(Value = ("BatterySaverEnabled"))] + BatterySaverEnabled, + /// + /// ActivatedDuringMainFrameNavigation + /// + [EnumMember(Value = ("ActivatedDuringMainFrameNavigation"))] + ActivatedDuringMainFrameNavigation, + /// + /// PreloadingUnsupportedByWebContents + /// + [EnumMember(Value = ("PreloadingUnsupportedByWebContents"))] + PreloadingUnsupportedByWebContents, + /// + /// CrossSiteRedirectInMainFrameNavigation + /// + [EnumMember(Value = ("CrossSiteRedirectInMainFrameNavigation"))] + CrossSiteRedirectInMainFrameNavigation, + /// + /// CrossSiteNavigationInMainFrameNavigation + /// + [EnumMember(Value = ("CrossSiteNavigationInMainFrameNavigation"))] + CrossSiteNavigationInMainFrameNavigation, + /// + /// SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation + /// + [EnumMember(Value = ("SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation"))] + SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation, + /// + /// SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation + /// + [EnumMember(Value = ("SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation"))] + SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation, + /// + /// MemoryPressureOnTrigger + /// + [EnumMember(Value = ("MemoryPressureOnTrigger"))] + MemoryPressureOnTrigger, + /// + /// MemoryPressureAfterTriggered + /// + [EnumMember(Value = ("MemoryPressureAfterTriggered"))] + MemoryPressureAfterTriggered, + /// + /// PrerenderingDisabledByDevTools + /// + [EnumMember(Value = ("PrerenderingDisabledByDevTools"))] + PrerenderingDisabledByDevTools, + /// + /// SpeculationRuleRemoved + /// + [EnumMember(Value = ("SpeculationRuleRemoved"))] + SpeculationRuleRemoved, + /// + /// ActivatedWithAuxiliaryBrowsingContexts + /// + [EnumMember(Value = ("ActivatedWithAuxiliaryBrowsingContexts"))] + ActivatedWithAuxiliaryBrowsingContexts, + /// + /// MaxNumOfRunningEagerPrerendersExceeded + /// + [EnumMember(Value = ("MaxNumOfRunningEagerPrerendersExceeded"))] + MaxNumOfRunningEagerPrerendersExceeded, + /// + /// MaxNumOfRunningNonEagerPrerendersExceeded + /// + [EnumMember(Value = ("MaxNumOfRunningNonEagerPrerendersExceeded"))] + MaxNumOfRunningNonEagerPrerendersExceeded, + /// + /// MaxNumOfRunningEmbedderPrerendersExceeded + /// + [EnumMember(Value = ("MaxNumOfRunningEmbedderPrerendersExceeded"))] + MaxNumOfRunningEmbedderPrerendersExceeded, + /// + /// PrerenderingUrlHasEffectiveUrl + /// + [EnumMember(Value = ("PrerenderingUrlHasEffectiveUrl"))] + PrerenderingUrlHasEffectiveUrl, + /// + /// RedirectedPrerenderingUrlHasEffectiveUrl + /// + [EnumMember(Value = ("RedirectedPrerenderingUrlHasEffectiveUrl"))] + RedirectedPrerenderingUrlHasEffectiveUrl, + /// + /// ActivationUrlHasEffectiveUrl + /// + [EnumMember(Value = ("ActivationUrlHasEffectiveUrl"))] + ActivationUrlHasEffectiveUrl, + /// + /// JavaScriptInterfaceAdded + /// + [EnumMember(Value = ("JavaScriptInterfaceAdded"))] + JavaScriptInterfaceAdded, + /// + /// JavaScriptInterfaceRemoved + /// + [EnumMember(Value = ("JavaScriptInterfaceRemoved"))] + JavaScriptInterfaceRemoved, + /// + /// AllPrerenderingCanceled + /// + [EnumMember(Value = ("AllPrerenderingCanceled"))] + AllPrerenderingCanceled, + /// + /// WindowClosed + /// + [EnumMember(Value = ("WindowClosed"))] + WindowClosed, + /// + /// SlowNetwork + /// + [EnumMember(Value = ("SlowNetwork"))] + SlowNetwork, + /// + /// OtherPrerenderedPageActivated + /// + [EnumMember(Value = ("OtherPrerenderedPageActivated"))] + OtherPrerenderedPageActivated, + /// + /// V8OptimizerDisabled + /// + [EnumMember(Value = ("V8OptimizerDisabled"))] + V8OptimizerDisabled, + /// + /// PrerenderFailedDuringPrefetch + /// + [EnumMember(Value = ("PrerenderFailedDuringPrefetch"))] + PrerenderFailedDuringPrefetch, + /// + /// BrowsingDataRemoved + /// + [EnumMember(Value = ("BrowsingDataRemoved"))] + BrowsingDataRemoved, + /// + /// PrerenderHostReused + /// + [EnumMember(Value = ("PrerenderHostReused"))] + PrerenderHostReused + } + + /// + /// Preloading status values, see also PreloadingTriggeringOutcome. This + /// status is shared by prefetchStatusUpdated and prerenderStatusUpdated. + /// + public enum PreloadingStatus + { + /// + /// Pending + /// + [EnumMember(Value = ("Pending"))] + Pending, + /// + /// Running + /// + [EnumMember(Value = ("Running"))] + Running, + /// + /// Ready + /// + [EnumMember(Value = ("Ready"))] + Ready, + /// + /// Success + /// + [EnumMember(Value = ("Success"))] + Success, + /// + /// Failure + /// + [EnumMember(Value = ("Failure"))] + Failure, + /// + /// NotSupported + /// + [EnumMember(Value = ("NotSupported"))] + NotSupported + } + + /// + /// TODO(https://crbug.com/1384419): revisit the list of PrefetchStatus and + /// filter out the ones that aren't necessary to the developers. + /// + public enum PrefetchStatus + { + /// + /// PrefetchAllowed + /// + [EnumMember(Value = ("PrefetchAllowed"))] + PrefetchAllowed, + /// + /// PrefetchFailedIneligibleRedirect + /// + [EnumMember(Value = ("PrefetchFailedIneligibleRedirect"))] + PrefetchFailedIneligibleRedirect, + /// + /// PrefetchFailedInvalidRedirect + /// + [EnumMember(Value = ("PrefetchFailedInvalidRedirect"))] + PrefetchFailedInvalidRedirect, + /// + /// PrefetchFailedMIMENotSupported + /// + [EnumMember(Value = ("PrefetchFailedMIMENotSupported"))] + PrefetchFailedMIMENotSupported, + /// + /// PrefetchFailedNetError + /// + [EnumMember(Value = ("PrefetchFailedNetError"))] + PrefetchFailedNetError, + /// + /// PrefetchFailedNon2XX + /// + [EnumMember(Value = ("PrefetchFailedNon2XX"))] + PrefetchFailedNon2XX, + /// + /// PrefetchEvictedAfterBrowsingDataRemoved + /// + [EnumMember(Value = ("PrefetchEvictedAfterBrowsingDataRemoved"))] + PrefetchEvictedAfterBrowsingDataRemoved, + /// + /// PrefetchEvictedAfterCandidateRemoved + /// + [EnumMember(Value = ("PrefetchEvictedAfterCandidateRemoved"))] + PrefetchEvictedAfterCandidateRemoved, + /// + /// PrefetchEvictedForNewerPrefetch + /// + [EnumMember(Value = ("PrefetchEvictedForNewerPrefetch"))] + PrefetchEvictedForNewerPrefetch, + /// + /// PrefetchHeldback + /// + [EnumMember(Value = ("PrefetchHeldback"))] + PrefetchHeldback, + /// + /// PrefetchIneligibleRetryAfter + /// + [EnumMember(Value = ("PrefetchIneligibleRetryAfter"))] + PrefetchIneligibleRetryAfter, + /// + /// PrefetchIsPrivacyDecoy + /// + [EnumMember(Value = ("PrefetchIsPrivacyDecoy"))] + PrefetchIsPrivacyDecoy, + /// + /// PrefetchIsStale + /// + [EnumMember(Value = ("PrefetchIsStale"))] + PrefetchIsStale, + /// + /// PrefetchNotEligibleBrowserContextOffTheRecord + /// + [EnumMember(Value = ("PrefetchNotEligibleBrowserContextOffTheRecord"))] + PrefetchNotEligibleBrowserContextOffTheRecord, + /// + /// PrefetchNotEligibleDataSaverEnabled + /// + [EnumMember(Value = ("PrefetchNotEligibleDataSaverEnabled"))] + PrefetchNotEligibleDataSaverEnabled, + /// + /// PrefetchNotEligibleExistingProxy + /// + [EnumMember(Value = ("PrefetchNotEligibleExistingProxy"))] + PrefetchNotEligibleExistingProxy, + /// + /// PrefetchNotEligibleHostIsNonUnique + /// + [EnumMember(Value = ("PrefetchNotEligibleHostIsNonUnique"))] + PrefetchNotEligibleHostIsNonUnique, + /// + /// PrefetchNotEligibleNonDefaultStoragePartition + /// + [EnumMember(Value = ("PrefetchNotEligibleNonDefaultStoragePartition"))] + PrefetchNotEligibleNonDefaultStoragePartition, + /// + /// PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy + /// + [EnumMember(Value = ("PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy"))] + PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy, + /// + /// PrefetchNotEligibleSchemeIsNotHttps + /// + [EnumMember(Value = ("PrefetchNotEligibleSchemeIsNotHttps"))] + PrefetchNotEligibleSchemeIsNotHttps, + /// + /// PrefetchNotEligibleUserHasCookies + /// + [EnumMember(Value = ("PrefetchNotEligibleUserHasCookies"))] + PrefetchNotEligibleUserHasCookies, + /// + /// PrefetchNotEligibleUserHasServiceWorker + /// + [EnumMember(Value = ("PrefetchNotEligibleUserHasServiceWorker"))] + PrefetchNotEligibleUserHasServiceWorker, + /// + /// PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler + /// + [EnumMember(Value = ("PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler"))] + PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler, + /// + /// PrefetchNotEligibleRedirectFromServiceWorker + /// + [EnumMember(Value = ("PrefetchNotEligibleRedirectFromServiceWorker"))] + PrefetchNotEligibleRedirectFromServiceWorker, + /// + /// PrefetchNotEligibleRedirectToServiceWorker + /// + [EnumMember(Value = ("PrefetchNotEligibleRedirectToServiceWorker"))] + PrefetchNotEligibleRedirectToServiceWorker, + /// + /// PrefetchNotEligibleBatterySaverEnabled + /// + [EnumMember(Value = ("PrefetchNotEligibleBatterySaverEnabled"))] + PrefetchNotEligibleBatterySaverEnabled, + /// + /// PrefetchNotEligiblePreloadingDisabled + /// + [EnumMember(Value = ("PrefetchNotEligiblePreloadingDisabled"))] + PrefetchNotEligiblePreloadingDisabled, + /// + /// PrefetchNotFinishedInTime + /// + [EnumMember(Value = ("PrefetchNotFinishedInTime"))] + PrefetchNotFinishedInTime, + /// + /// PrefetchNotStarted + /// + [EnumMember(Value = ("PrefetchNotStarted"))] + PrefetchNotStarted, + /// + /// PrefetchNotUsedCookiesChanged + /// + [EnumMember(Value = ("PrefetchNotUsedCookiesChanged"))] + PrefetchNotUsedCookiesChanged, + /// + /// PrefetchProxyNotAvailable + /// + [EnumMember(Value = ("PrefetchProxyNotAvailable"))] + PrefetchProxyNotAvailable, + /// + /// PrefetchResponseUsed + /// + [EnumMember(Value = ("PrefetchResponseUsed"))] + PrefetchResponseUsed, + /// + /// PrefetchSuccessfulButNotUsed + /// + [EnumMember(Value = ("PrefetchSuccessfulButNotUsed"))] + PrefetchSuccessfulButNotUsed, + /// + /// PrefetchNotUsedProbeFailed + /// + [EnumMember(Value = ("PrefetchNotUsedProbeFailed"))] + PrefetchNotUsedProbeFailed + } + + /// + /// Information of headers to be displayed when the header mismatch occurred. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PrerenderMismatchedHeaders : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// HeaderName + /// + [DataMember(Name = ("headerName"), IsRequired = (true))] + public string HeaderName + { + get; + set; + } + + /// + /// InitialValue + /// + [DataMember(Name = ("initialValue"), IsRequired = (false))] + public string InitialValue + { + get; + set; + } + + /// + /// ActivationValue + /// + [DataMember(Name = ("activationValue"), IsRequired = (false))] + public string ActivationValue + { + get; + set; + } + } + + /// + /// Upsert. Currently, it is only emitted when a rule set added. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class RuleSetUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RuleSet + /// + [DataMember(Name = ("ruleSet"), IsRequired = (true))] + public CefSharp.DevTools.Preload.RuleSet RuleSet + { + get; + private set; + } + } + + /// + /// ruleSetRemoved + /// + [System.Runtime.Serialization.DataContractAttribute] + public class RuleSetRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + private set; + } + } + + /// + /// Fired when a preload enabled state is updated. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PreloadEnabledStateUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// DisabledByPreference + /// + [DataMember(Name = ("disabledByPreference"), IsRequired = (true))] + public bool DisabledByPreference + { + get; + private set; + } + + /// + /// DisabledByDataSaver + /// + [DataMember(Name = ("disabledByDataSaver"), IsRequired = (true))] + public bool DisabledByDataSaver + { + get; + private set; + } + + /// + /// DisabledByBatterySaver + /// + [DataMember(Name = ("disabledByBatterySaver"), IsRequired = (true))] + public bool DisabledByBatterySaver + { + get; + private set; + } + + /// + /// DisabledByHoldbackPrefetchSpeculationRules + /// + [DataMember(Name = ("disabledByHoldbackPrefetchSpeculationRules"), IsRequired = (true))] + public bool DisabledByHoldbackPrefetchSpeculationRules + { + get; + private set; + } + + /// + /// DisabledByHoldbackPrerenderSpeculationRules + /// + [DataMember(Name = ("disabledByHoldbackPrerenderSpeculationRules"), IsRequired = (true))] + public bool DisabledByHoldbackPrerenderSpeculationRules + { + get; + private set; + } + } + + /// + /// Fired when a prefetch attempt is updated. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PrefetchStatusUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public CefSharp.DevTools.Preload.PreloadingAttemptKey Key + { + get; + private set; + } + + /// + /// PipelineId + /// + [DataMember(Name = ("pipelineId"), IsRequired = (true))] + public string PipelineId + { + get; + private set; + } + + /// + /// The frame id of the frame initiating prefetch. + /// + [DataMember(Name = ("initiatingFrameId"), IsRequired = (true))] + public string InitiatingFrameId + { + get; + private set; + } + + /// + /// PrefetchUrl + /// + [DataMember(Name = ("prefetchUrl"), IsRequired = (true))] + public string PrefetchUrl + { + get; + private set; + } + + /// + /// Status + /// + public CefSharp.DevTools.Preload.PreloadingStatus Status + { + get + { + return (CefSharp.DevTools.Preload.PreloadingStatus)(StringToEnum(typeof(CefSharp.DevTools.Preload.PreloadingStatus), status)); + } + + set + { + this.status = (EnumToString(value)); + } + } + + /// + /// Status + /// + [DataMember(Name = ("status"), IsRequired = (true))] + internal string status + { + get; + private set; + } + + /// + /// PrefetchStatus + /// + public CefSharp.DevTools.Preload.PrefetchStatus PrefetchStatus + { + get + { + return (CefSharp.DevTools.Preload.PrefetchStatus)(StringToEnum(typeof(CefSharp.DevTools.Preload.PrefetchStatus), prefetchStatus)); + } + + set + { + this.prefetchStatus = (EnumToString(value)); + } + } + + /// + /// PrefetchStatus + /// + [DataMember(Name = ("prefetchStatus"), IsRequired = (true))] + internal string prefetchStatus + { + get; + private set; + } + + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + } + + /// + /// Fired when a prerender attempt is updated. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PrerenderStatusUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public CefSharp.DevTools.Preload.PreloadingAttemptKey Key + { + get; + private set; + } + + /// + /// PipelineId + /// + [DataMember(Name = ("pipelineId"), IsRequired = (true))] + public string PipelineId + { + get; + private set; + } + + /// + /// Status + /// + public CefSharp.DevTools.Preload.PreloadingStatus Status + { + get + { + return (CefSharp.DevTools.Preload.PreloadingStatus)(StringToEnum(typeof(CefSharp.DevTools.Preload.PreloadingStatus), status)); + } + + set + { + this.status = (EnumToString(value)); + } + } + + /// + /// Status + /// + [DataMember(Name = ("status"), IsRequired = (true))] + internal string status + { + get; + private set; + } + + /// + /// PrerenderStatus + /// + public CefSharp.DevTools.Preload.PrerenderFinalStatus? PrerenderStatus + { + get + { + return (CefSharp.DevTools.Preload.PrerenderFinalStatus? )(StringToEnum(typeof(CefSharp.DevTools.Preload.PrerenderFinalStatus? ), prerenderStatus)); + } + + set + { + this.prerenderStatus = (EnumToString(value)); + } + } + + /// + /// PrerenderStatus + /// + [DataMember(Name = ("prerenderStatus"), IsRequired = (false))] + internal string prerenderStatus + { + get; + private set; + } + + /// + /// This is used to give users more information about the name of Mojo interface + /// that is incompatible with prerender and has caused the cancellation of the attempt. + /// + [DataMember(Name = ("disallowedMojoInterface"), IsRequired = (false))] + public string DisallowedMojoInterface + { + get; + private set; + } + + /// + /// MismatchedHeaders + /// + [DataMember(Name = ("mismatchedHeaders"), IsRequired = (false))] + public System.Collections.Generic.IList MismatchedHeaders + { + get; + private set; + } + } + + /// + /// Send a list of sources for all preloading attempts in a document. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PreloadingAttemptSourcesUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// LoaderId + /// + [DataMember(Name = ("loaderId"), IsRequired = (true))] + public string LoaderId + { + get; + private set; + } + + /// + /// PreloadingAttemptSources + /// + [DataMember(Name = ("preloadingAttemptSources"), IsRequired = (true))] + public System.Collections.Generic.IList PreloadingAttemptSources + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Security +{ + /// + /// A description of mixed content (HTTP resources on HTTPS pages), as defined by + /// https://www.w3.org/TR/mixed-content/#categories + /// + public enum MixedContentType + { + /// + /// blockable + /// + [EnumMember(Value = ("blockable"))] + Blockable, + /// + /// optionally-blockable + /// + [EnumMember(Value = ("optionally-blockable"))] + OptionallyBlockable, + /// + /// none + /// + [EnumMember(Value = ("none"))] + None + } + + /// + /// The security level of a page or resource. + /// + public enum SecurityState + { + /// + /// unknown + /// + [EnumMember(Value = ("unknown"))] + Unknown, + /// + /// neutral + /// + [EnumMember(Value = ("neutral"))] + Neutral, + /// + /// insecure + /// + [EnumMember(Value = ("insecure"))] + Insecure, + /// + /// secure + /// + [EnumMember(Value = ("secure"))] + Secure, + /// + /// info + /// + [EnumMember(Value = ("info"))] + Info, + /// + /// insecure-broken + /// + [EnumMember(Value = ("insecure-broken"))] + InsecureBroken + } + + /// + /// Details about the security state of the page certificate. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CertificateSecurityState : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Protocol name (e.g. "TLS 1.2" or "QUIC"). + /// + [DataMember(Name = ("protocol"), IsRequired = (true))] + public string Protocol + { + get; + set; + } + + /// + /// Key Exchange used by the connection, or the empty string if not applicable. + /// + [DataMember(Name = ("keyExchange"), IsRequired = (true))] + public string KeyExchange + { + get; + set; + } + + /// + /// (EC)DH group used by the connection, if applicable. + /// + [DataMember(Name = ("keyExchangeGroup"), IsRequired = (false))] + public string KeyExchangeGroup + { + get; + set; + } + + /// + /// Cipher name. + /// + [DataMember(Name = ("cipher"), IsRequired = (true))] + public string Cipher + { + get; + set; + } + + /// + /// TLS MAC. Note that AEAD ciphers do not have separate MACs. + /// + [DataMember(Name = ("mac"), IsRequired = (false))] + public string Mac + { + get; + set; + } + + /// + /// Page certificate. + /// + [DataMember(Name = ("certificate"), IsRequired = (true))] + public string[] Certificate + { + get; + set; + } + + /// + /// Certificate subject name. + /// + [DataMember(Name = ("subjectName"), IsRequired = (true))] + public string SubjectName + { + get; + set; + } + + /// + /// Name of the issuing CA. + /// + [DataMember(Name = ("issuer"), IsRequired = (true))] + public string Issuer + { + get; + set; + } + + /// + /// Certificate valid from date. + /// + [DataMember(Name = ("validFrom"), IsRequired = (true))] + public double ValidFrom + { + get; + set; + } + + /// + /// Certificate valid to (expiration) date + /// + [DataMember(Name = ("validTo"), IsRequired = (true))] + public double ValidTo + { + get; + set; + } + + /// + /// The highest priority network error code, if the certificate has an error. + /// + [DataMember(Name = ("certificateNetworkError"), IsRequired = (false))] + public string CertificateNetworkError + { + get; + set; + } + + /// + /// True if the certificate uses a weak signature algorithm. + /// + [DataMember(Name = ("certificateHasWeakSignature"), IsRequired = (true))] + public bool CertificateHasWeakSignature + { + get; + set; + } + + /// + /// True if the certificate has a SHA1 signature in the chain. + /// + [DataMember(Name = ("certificateHasSha1Signature"), IsRequired = (true))] + public bool CertificateHasSha1Signature + { + get; + set; + } + + /// + /// True if modern SSL + /// + [DataMember(Name = ("modernSSL"), IsRequired = (true))] + public bool ModernSSL + { + get; + set; + } + + /// + /// True if the connection is using an obsolete SSL protocol. + /// + [DataMember(Name = ("obsoleteSslProtocol"), IsRequired = (true))] + public bool ObsoleteSslProtocol + { + get; + set; + } + + /// + /// True if the connection is using an obsolete SSL key exchange. + /// + [DataMember(Name = ("obsoleteSslKeyExchange"), IsRequired = (true))] + public bool ObsoleteSslKeyExchange + { + get; + set; + } + + /// + /// True if the connection is using an obsolete SSL cipher. + /// + [DataMember(Name = ("obsoleteSslCipher"), IsRequired = (true))] + public bool ObsoleteSslCipher + { + get; + set; + } + + /// + /// True if the connection is using an obsolete SSL signature. + /// + [DataMember(Name = ("obsoleteSslSignature"), IsRequired = (true))] + public bool ObsoleteSslSignature + { + get; + set; + } + } + + /// + /// SafetyTipStatus + /// + public enum SafetyTipStatus + { + /// + /// badReputation + /// + [EnumMember(Value = ("badReputation"))] + BadReputation, + /// + /// lookalike + /// + [EnumMember(Value = ("lookalike"))] + Lookalike + } + + /// + /// SafetyTipInfo + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SafetyTipInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Describes whether the page triggers any safety tips or reputation warnings. Default is unknown. + /// + public CefSharp.DevTools.Security.SafetyTipStatus SafetyTipStatus + { + get + { + return (CefSharp.DevTools.Security.SafetyTipStatus)(StringToEnum(typeof(CefSharp.DevTools.Security.SafetyTipStatus), safetyTipStatus)); + } + + set + { + this.safetyTipStatus = (EnumToString(value)); + } + } + + /// + /// Describes whether the page triggers any safety tips or reputation warnings. Default is unknown. + /// + [DataMember(Name = ("safetyTipStatus"), IsRequired = (true))] + internal string safetyTipStatus + { + get; + set; + } + + /// + /// The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches. + /// + [DataMember(Name = ("safeUrl"), IsRequired = (false))] + public string SafeUrl + { + get; + set; + } + } + + /// + /// Security state information about the page. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class VisibleSecurityState : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The security level of the page. + /// + public CefSharp.DevTools.Security.SecurityState SecurityState + { + get + { + return (CefSharp.DevTools.Security.SecurityState)(StringToEnum(typeof(CefSharp.DevTools.Security.SecurityState), securityState)); + } + + set + { + this.securityState = (EnumToString(value)); + } + } + + /// + /// The security level of the page. + /// + [DataMember(Name = ("securityState"), IsRequired = (true))] + internal string securityState + { + get; + set; + } + + /// + /// Security state details about the page certificate. + /// + [DataMember(Name = ("certificateSecurityState"), IsRequired = (false))] + public CefSharp.DevTools.Security.CertificateSecurityState CertificateSecurityState + { + get; + set; + } + + /// + /// The type of Safety Tip triggered on the page. Note that this field will be set even if the Safety Tip UI was not actually shown. + /// + [DataMember(Name = ("safetyTipInfo"), IsRequired = (false))] + public CefSharp.DevTools.Security.SafetyTipInfo SafetyTipInfo + { + get; + set; + } + + /// + /// Array of security state issues ids. + /// + [DataMember(Name = ("securityStateIssueIds"), IsRequired = (true))] + public string[] SecurityStateIssueIds + { + get; + set; + } + } + + /// + /// An explanation of an factor contributing to the security state. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SecurityStateExplanation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Security state representing the severity of the factor being explained. + /// + public CefSharp.DevTools.Security.SecurityState SecurityState + { + get + { + return (CefSharp.DevTools.Security.SecurityState)(StringToEnum(typeof(CefSharp.DevTools.Security.SecurityState), securityState)); + } + + set + { + this.securityState = (EnumToString(value)); + } + } + + /// + /// Security state representing the severity of the factor being explained. + /// + [DataMember(Name = ("securityState"), IsRequired = (true))] + internal string securityState + { + get; + set; + } + + /// + /// Title describing the type of factor. + /// + [DataMember(Name = ("title"), IsRequired = (true))] + public string Title + { + get; + set; + } + + /// + /// Short phrase describing the type of factor. + /// + [DataMember(Name = ("summary"), IsRequired = (true))] + public string Summary + { + get; + set; + } + + /// + /// Full text explanation of the factor. + /// + [DataMember(Name = ("description"), IsRequired = (true))] + public string Description + { + get; + set; + } + + /// + /// The type of mixed content described by the explanation. + /// + public CefSharp.DevTools.Security.MixedContentType MixedContentType + { + get + { + return (CefSharp.DevTools.Security.MixedContentType)(StringToEnum(typeof(CefSharp.DevTools.Security.MixedContentType), mixedContentType)); + } + + set + { + this.mixedContentType = (EnumToString(value)); + } + } + + /// + /// The type of mixed content described by the explanation. + /// + [DataMember(Name = ("mixedContentType"), IsRequired = (true))] + internal string mixedContentType + { + get; + set; + } + + /// + /// Page certificate. + /// + [DataMember(Name = ("certificate"), IsRequired = (true))] + public string[] Certificate + { + get; + set; + } + + /// + /// Recommendations to fix any issues. + /// + [DataMember(Name = ("recommendations"), IsRequired = (false))] + public string[] Recommendations + { + get; + set; + } + } + + /// + /// Information about insecure content on the page. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InsecureContentStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Always false. + /// + [DataMember(Name = ("ranMixedContent"), IsRequired = (true))] + public bool RanMixedContent + { + get; + set; + } + + /// + /// Always false. + /// + [DataMember(Name = ("displayedMixedContent"), IsRequired = (true))] + public bool DisplayedMixedContent + { + get; + set; + } + + /// + /// Always false. + /// + [DataMember(Name = ("containedMixedForm"), IsRequired = (true))] + public bool ContainedMixedForm + { + get; + set; + } + + /// + /// Always false. + /// + [DataMember(Name = ("ranContentWithCertErrors"), IsRequired = (true))] + public bool RanContentWithCertErrors + { + get; + set; + } + + /// + /// Always false. + /// + [DataMember(Name = ("displayedContentWithCertErrors"), IsRequired = (true))] + public bool DisplayedContentWithCertErrors + { + get; + set; + } + + /// + /// Always set to unknown. + /// + public CefSharp.DevTools.Security.SecurityState RanInsecureContentStyle + { + get + { + return (CefSharp.DevTools.Security.SecurityState)(StringToEnum(typeof(CefSharp.DevTools.Security.SecurityState), ranInsecureContentStyle)); + } + + set + { + this.ranInsecureContentStyle = (EnumToString(value)); + } + } + + /// + /// Always set to unknown. + /// + [DataMember(Name = ("ranInsecureContentStyle"), IsRequired = (true))] + internal string ranInsecureContentStyle + { + get; + set; + } + + /// + /// Always set to unknown. + /// + public CefSharp.DevTools.Security.SecurityState DisplayedInsecureContentStyle + { + get + { + return (CefSharp.DevTools.Security.SecurityState)(StringToEnum(typeof(CefSharp.DevTools.Security.SecurityState), displayedInsecureContentStyle)); + } + + set + { + this.displayedInsecureContentStyle = (EnumToString(value)); + } + } + + /// + /// Always set to unknown. + /// + [DataMember(Name = ("displayedInsecureContentStyle"), IsRequired = (true))] + internal string displayedInsecureContentStyle + { + get; + set; + } + } + + /// + /// The action to take when a certificate error occurs. continue will continue processing the + /// request and cancel will cancel the request. + /// + public enum CertificateErrorAction + { + /// + /// continue + /// + [EnumMember(Value = ("continue"))] + Continue, + /// + /// cancel + /// + [EnumMember(Value = ("cancel"))] + Cancel + } + + /// + /// There is a certificate error. If overriding certificate errors is enabled, then it should be + /// handled with the `handleCertificateError` command. Note: this event does not fire if the + /// certificate error has been allowed internally. Only one client per target should override + /// certificate errors at the same time. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CertificateErrorEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The ID of the event. + /// + [DataMember(Name = ("eventId"), IsRequired = (true))] + public int EventId + { + get; + private set; + } + + /// + /// The type of the error. + /// + [DataMember(Name = ("errorType"), IsRequired = (true))] + public string ErrorType + { + get; + private set; + } + + /// + /// The url that was requested. + /// + [DataMember(Name = ("requestURL"), IsRequired = (true))] + public string RequestURL + { + get; + private set; + } + } + + /// + /// The security state of the page changed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class VisibleSecurityStateChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Security state information about the page. + /// + [DataMember(Name = ("visibleSecurityState"), IsRequired = (true))] + public CefSharp.DevTools.Security.VisibleSecurityState VisibleSecurityState + { + get; + private set; + } + } + + /// + /// The security state of the page changed. No longer being sent. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class SecurityStateChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Security state. + /// + public CefSharp.DevTools.Security.SecurityState SecurityState + { + get + { + return (CefSharp.DevTools.Security.SecurityState)(StringToEnum(typeof(CefSharp.DevTools.Security.SecurityState), securityState)); + } + + set + { + this.securityState = (EnumToString(value)); + } + } + + /// + /// Security state. + /// + [DataMember(Name = ("securityState"), IsRequired = (true))] + internal string securityState + { + get; + private set; + } + + /// + /// True if the page was loaded over cryptographic transport such as HTTPS. + /// + [DataMember(Name = ("schemeIsCryptographic"), IsRequired = (true))] + public bool SchemeIsCryptographic + { + get; + private set; + } + + /// + /// Previously a list of explanations for the security state. Now always + /// empty. + /// + [DataMember(Name = ("explanations"), IsRequired = (true))] + public System.Collections.Generic.IList Explanations + { + get; + private set; + } + + /// + /// Information about insecure content on the page. + /// + [DataMember(Name = ("insecureContentStatus"), IsRequired = (true))] + public CefSharp.DevTools.Security.InsecureContentStatus InsecureContentStatus + { + get; + private set; + } + + /// + /// Overrides user-visible description of the state. Always omitted. + /// + [DataMember(Name = ("summary"), IsRequired = (false))] + public string Summary + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.ServiceWorker +{ + /// + /// ServiceWorker registration. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ServiceWorkerRegistration : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// RegistrationId + /// + [DataMember(Name = ("registrationId"), IsRequired = (true))] + public string RegistrationId + { + get; + set; + } + + /// + /// ScopeURL + /// + [DataMember(Name = ("scopeURL"), IsRequired = (true))] + public string ScopeURL + { + get; + set; + } + + /// + /// IsDeleted + /// + [DataMember(Name = ("isDeleted"), IsRequired = (true))] + public bool IsDeleted + { + get; + set; + } + } + + /// + /// ServiceWorkerVersionRunningStatus + /// + public enum ServiceWorkerVersionRunningStatus + { + /// + /// stopped + /// + [EnumMember(Value = ("stopped"))] + Stopped, + /// + /// starting + /// + [EnumMember(Value = ("starting"))] + Starting, + /// + /// running + /// + [EnumMember(Value = ("running"))] + Running, + /// + /// stopping + /// + [EnumMember(Value = ("stopping"))] + Stopping + } + + /// + /// ServiceWorkerVersionStatus + /// + public enum ServiceWorkerVersionStatus + { + /// + /// new + /// + [EnumMember(Value = ("new"))] + New, + /// + /// installing + /// + [EnumMember(Value = ("installing"))] + Installing, + /// + /// installed + /// + [EnumMember(Value = ("installed"))] + Installed, + /// + /// activating + /// + [EnumMember(Value = ("activating"))] + Activating, + /// + /// activated + /// + [EnumMember(Value = ("activated"))] + Activated, + /// + /// redundant + /// + [EnumMember(Value = ("redundant"))] + Redundant + } + + /// + /// ServiceWorker version. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ServiceWorkerVersion : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// VersionId + /// + [DataMember(Name = ("versionId"), IsRequired = (true))] + public string VersionId + { + get; + set; + } + + /// + /// RegistrationId + /// + [DataMember(Name = ("registrationId"), IsRequired = (true))] + public string RegistrationId + { + get; + set; + } + + /// + /// ScriptURL + /// + [DataMember(Name = ("scriptURL"), IsRequired = (true))] + public string ScriptURL + { + get; + set; + } + + /// + /// RunningStatus + /// + public CefSharp.DevTools.ServiceWorker.ServiceWorkerVersionRunningStatus RunningStatus + { + get + { + return (CefSharp.DevTools.ServiceWorker.ServiceWorkerVersionRunningStatus)(StringToEnum(typeof(CefSharp.DevTools.ServiceWorker.ServiceWorkerVersionRunningStatus), runningStatus)); + } + + set + { + this.runningStatus = (EnumToString(value)); + } + } + + /// + /// RunningStatus + /// + [DataMember(Name = ("runningStatus"), IsRequired = (true))] + internal string runningStatus + { + get; + set; + } + + /// + /// Status + /// + public CefSharp.DevTools.ServiceWorker.ServiceWorkerVersionStatus Status + { + get + { + return (CefSharp.DevTools.ServiceWorker.ServiceWorkerVersionStatus)(StringToEnum(typeof(CefSharp.DevTools.ServiceWorker.ServiceWorkerVersionStatus), status)); + } + + set + { + this.status = (EnumToString(value)); + } + } + + /// + /// Status + /// + [DataMember(Name = ("status"), IsRequired = (true))] + internal string status + { + get; + set; + } + + /// + /// The Last-Modified header value of the main script. + /// + [DataMember(Name = ("scriptLastModified"), IsRequired = (false))] + public double? ScriptLastModified + { + get; + set; + } + + /// + /// The time at which the response headers of the main script were received from the server. + /// For cached script it is the last time the cache entry was validated. + /// + [DataMember(Name = ("scriptResponseTime"), IsRequired = (false))] + public double? ScriptResponseTime + { + get; + set; + } + + /// + /// ControlledClients + /// + [DataMember(Name = ("controlledClients"), IsRequired = (false))] + public string[] ControlledClients + { + get; + set; + } + + /// + /// TargetId + /// + [DataMember(Name = ("targetId"), IsRequired = (false))] + public string TargetId + { + get; + set; + } + + /// + /// RouterRules + /// + [DataMember(Name = ("routerRules"), IsRequired = (false))] + public string RouterRules + { + get; + set; + } + } + + /// + /// ServiceWorker error message. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ServiceWorkerErrorMessage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ErrorMessage + /// + [DataMember(Name = ("errorMessage"), IsRequired = (true))] + public string ErrorMessage + { + get; + set; + } + + /// + /// RegistrationId + /// + [DataMember(Name = ("registrationId"), IsRequired = (true))] + public string RegistrationId + { + get; + set; + } + + /// + /// VersionId + /// + [DataMember(Name = ("versionId"), IsRequired = (true))] + public string VersionId + { + get; + set; + } + + /// + /// SourceURL + /// + [DataMember(Name = ("sourceURL"), IsRequired = (true))] + public string SourceURL + { + get; + set; + } + + /// + /// LineNumber + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// ColumnNumber + /// + [DataMember(Name = ("columnNumber"), IsRequired = (true))] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// workerErrorReported + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WorkerErrorReportedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ErrorMessage + /// + [DataMember(Name = ("errorMessage"), IsRequired = (true))] + public CefSharp.DevTools.ServiceWorker.ServiceWorkerErrorMessage ErrorMessage + { + get; + private set; + } + } + + /// + /// workerRegistrationUpdated + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WorkerRegistrationUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Registrations + /// + [DataMember(Name = ("registrations"), IsRequired = (true))] + public System.Collections.Generic.IList Registrations + { + get; + private set; + } + } + + /// + /// workerVersionUpdated + /// + [System.Runtime.Serialization.DataContractAttribute] + public class WorkerVersionUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Versions + /// + [DataMember(Name = ("versions"), IsRequired = (true))] + public System.Collections.Generic.IList Versions + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.SmartCardEmulation +{ + /// + /// Indicates the PC/SC error code. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__ErrorCodes.html + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/secauthn/authentication-return-values + /// + public enum ResultCode + { + /// + /// success + /// + [EnumMember(Value = ("success"))] + Success, + /// + /// removed-card + /// + [EnumMember(Value = ("removed-card"))] + RemovedCard, + /// + /// reset-card + /// + [EnumMember(Value = ("reset-card"))] + ResetCard, + /// + /// unpowered-card + /// + [EnumMember(Value = ("unpowered-card"))] + UnpoweredCard, + /// + /// unresponsive-card + /// + [EnumMember(Value = ("unresponsive-card"))] + UnresponsiveCard, + /// + /// unsupported-card + /// + [EnumMember(Value = ("unsupported-card"))] + UnsupportedCard, + /// + /// reader-unavailable + /// + [EnumMember(Value = ("reader-unavailable"))] + ReaderUnavailable, + /// + /// sharing-violation + /// + [EnumMember(Value = ("sharing-violation"))] + SharingViolation, + /// + /// not-transacted + /// + [EnumMember(Value = ("not-transacted"))] + NotTransacted, + /// + /// no-smartcard + /// + [EnumMember(Value = ("no-smartcard"))] + NoSmartcard, + /// + /// proto-mismatch + /// + [EnumMember(Value = ("proto-mismatch"))] + ProtoMismatch, + /// + /// system-cancelled + /// + [EnumMember(Value = ("system-cancelled"))] + SystemCancelled, + /// + /// not-ready + /// + [EnumMember(Value = ("not-ready"))] + NotReady, + /// + /// cancelled + /// + [EnumMember(Value = ("cancelled"))] + Cancelled, + /// + /// insufficient-buffer + /// + [EnumMember(Value = ("insufficient-buffer"))] + InsufficientBuffer, + /// + /// invalid-handle + /// + [EnumMember(Value = ("invalid-handle"))] + InvalidHandle, + /// + /// invalid-parameter + /// + [EnumMember(Value = ("invalid-parameter"))] + InvalidParameter, + /// + /// invalid-value + /// + [EnumMember(Value = ("invalid-value"))] + InvalidValue, + /// + /// no-memory + /// + [EnumMember(Value = ("no-memory"))] + NoMemory, + /// + /// timeout + /// + [EnumMember(Value = ("timeout"))] + Timeout, + /// + /// unknown-reader + /// + [EnumMember(Value = ("unknown-reader"))] + UnknownReader, + /// + /// unsupported-feature + /// + [EnumMember(Value = ("unsupported-feature"))] + UnsupportedFeature, + /// + /// no-readers-available + /// + [EnumMember(Value = ("no-readers-available"))] + NoReadersAvailable, + /// + /// service-stopped + /// + [EnumMember(Value = ("service-stopped"))] + ServiceStopped, + /// + /// no-service + /// + [EnumMember(Value = ("no-service"))] + NoService, + /// + /// comm-error + /// + [EnumMember(Value = ("comm-error"))] + CommError, + /// + /// internal-error + /// + [EnumMember(Value = ("internal-error"))] + InternalError, + /// + /// server-too-busy + /// + [EnumMember(Value = ("server-too-busy"))] + ServerTooBusy, + /// + /// unexpected + /// + [EnumMember(Value = ("unexpected"))] + Unexpected, + /// + /// shutdown + /// + [EnumMember(Value = ("shutdown"))] + Shutdown, + /// + /// unknown-card + /// + [EnumMember(Value = ("unknown-card"))] + UnknownCard, + /// + /// unknown + /// + [EnumMember(Value = ("unknown"))] + Unknown + } + + /// + /// Maps to the |SCARD_SHARE_*| values. + /// + public enum ShareMode + { + /// + /// shared + /// + [EnumMember(Value = ("shared"))] + Shared, + /// + /// exclusive + /// + [EnumMember(Value = ("exclusive"))] + Exclusive, + /// + /// direct + /// + [EnumMember(Value = ("direct"))] + Direct + } + + /// + /// Indicates what the reader should do with the card. + /// + public enum Disposition + { + /// + /// leave-card + /// + [EnumMember(Value = ("leave-card"))] + LeaveCard, + /// + /// reset-card + /// + [EnumMember(Value = ("reset-card"))] + ResetCard, + /// + /// unpower-card + /// + [EnumMember(Value = ("unpower-card"))] + UnpowerCard, + /// + /// eject-card + /// + [EnumMember(Value = ("eject-card"))] + EjectCard + } + + /// + /// Maps to |SCARD_*| connection state values. + /// + public enum ConnectionState + { + /// + /// absent + /// + [EnumMember(Value = ("absent"))] + Absent, + /// + /// present + /// + [EnumMember(Value = ("present"))] + Present, + /// + /// swallowed + /// + [EnumMember(Value = ("swallowed"))] + Swallowed, + /// + /// powered + /// + [EnumMember(Value = ("powered"))] + Powered, + /// + /// negotiable + /// + [EnumMember(Value = ("negotiable"))] + Negotiable, + /// + /// specific + /// + [EnumMember(Value = ("specific"))] + Specific + } + + /// + /// Maps to the |SCARD_STATE_*| flags. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ReaderStateFlags : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unaware + /// + [DataMember(Name = ("unaware"), IsRequired = (false))] + public bool? Unaware + { + get; + set; + } + + /// + /// Ignore + /// + [DataMember(Name = ("ignore"), IsRequired = (false))] + public bool? Ignore + { + get; + set; + } + + /// + /// Changed + /// + [DataMember(Name = ("changed"), IsRequired = (false))] + public bool? Changed + { + get; + set; + } + + /// + /// Unknown + /// + [DataMember(Name = ("unknown"), IsRequired = (false))] + public bool? Unknown + { + get; + set; + } + + /// + /// Unavailable + /// + [DataMember(Name = ("unavailable"), IsRequired = (false))] + public bool? Unavailable + { + get; + set; + } + + /// + /// Empty + /// + [DataMember(Name = ("empty"), IsRequired = (false))] + public bool? Empty + { + get; + set; + } + + /// + /// Present + /// + [DataMember(Name = ("present"), IsRequired = (false))] + public bool? Present + { + get; + set; + } + + /// + /// Exclusive + /// + [DataMember(Name = ("exclusive"), IsRequired = (false))] + public bool? Exclusive + { + get; + set; + } + + /// + /// Inuse + /// + [DataMember(Name = ("inuse"), IsRequired = (false))] + public bool? Inuse + { + get; + set; + } + + /// + /// Mute + /// + [DataMember(Name = ("mute"), IsRequired = (false))] + public bool? Mute + { + get; + set; + } + + /// + /// Unpowered + /// + [DataMember(Name = ("unpowered"), IsRequired = (false))] + public bool? Unpowered + { + get; + set; + } + } + + /// + /// Maps to the |SCARD_PROTOCOL_*| flags. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ProtocolSet : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// T0 + /// + [DataMember(Name = ("t0"), IsRequired = (false))] + public bool? T0 + { + get; + set; + } + + /// + /// T1 + /// + [DataMember(Name = ("t1"), IsRequired = (false))] + public bool? T1 + { + get; + set; + } + + /// + /// Raw + /// + [DataMember(Name = ("raw"), IsRequired = (false))] + public bool? Raw + { + get; + set; + } + } + + /// + /// Maps to the |SCARD_PROTOCOL_*| values. + /// + public enum Protocol + { + /// + /// t0 + /// + [EnumMember(Value = ("t0"))] + T0, + /// + /// t1 + /// + [EnumMember(Value = ("t1"))] + T1, + /// + /// raw + /// + [EnumMember(Value = ("raw"))] + Raw + } + + /// + /// ReaderStateIn + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ReaderStateIn : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Reader + /// + [DataMember(Name = ("reader"), IsRequired = (true))] + public string Reader + { + get; + set; + } + + /// + /// CurrentState + /// + [DataMember(Name = ("currentState"), IsRequired = (true))] + public CefSharp.DevTools.SmartCardEmulation.ReaderStateFlags CurrentState + { + get; + set; + } + + /// + /// CurrentInsertionCount + /// + [DataMember(Name = ("currentInsertionCount"), IsRequired = (true))] + public int CurrentInsertionCount + { + get; + set; + } + } + + /// + /// ReaderStateOut + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ReaderStateOut : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Reader + /// + [DataMember(Name = ("reader"), IsRequired = (true))] + public string Reader + { + get; + set; + } + + /// + /// EventState + /// + [DataMember(Name = ("eventState"), IsRequired = (true))] + public CefSharp.DevTools.SmartCardEmulation.ReaderStateFlags EventState + { + get; + set; + } + + /// + /// EventCount + /// + [DataMember(Name = ("eventCount"), IsRequired = (true))] + public int EventCount + { + get; + set; + } + + /// + /// Atr + /// + [DataMember(Name = ("atr"), IsRequired = (true))] + public byte[] Atr + { + get; + set; + } + } + + /// + /// Fired when |SCardEstablishContext| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext + /// + [System.Runtime.Serialization.DataContractAttribute] + public class EstablishContextRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + } + + /// + /// Fired when |SCardReleaseContext| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ReleaseContextRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public int ContextId + { + get; + private set; + } + } + + /// + /// Fired when |SCardListReaders| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ListReadersRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public int ContextId + { + get; + private set; + } + } + + /// + /// Fired when |SCardGetStatusChange| is called. Timeout is specified in milliseconds. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea + /// + [System.Runtime.Serialization.DataContractAttribute] + public class GetStatusChangeRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public int ContextId + { + get; + private set; + } + + /// + /// ReaderStates + /// + [DataMember(Name = ("readerStates"), IsRequired = (true))] + public System.Collections.Generic.IList ReaderStates + { + get; + private set; + } + + /// + /// in milliseconds, if absent, it means "infinite" + /// + [DataMember(Name = ("timeout"), IsRequired = (false))] + public int? Timeout + { + get; + private set; + } + } + + /// + /// Fired when |SCardCancel| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CancelRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public int ContextId + { + get; + private set; + } + } + + /// + /// Fired when |SCardConnect| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ConnectRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public int ContextId + { + get; + private set; + } + + /// + /// Reader + /// + [DataMember(Name = ("reader"), IsRequired = (true))] + public string Reader + { + get; + private set; + } + + /// + /// ShareMode + /// + public CefSharp.DevTools.SmartCardEmulation.ShareMode ShareMode + { + get + { + return (CefSharp.DevTools.SmartCardEmulation.ShareMode)(StringToEnum(typeof(CefSharp.DevTools.SmartCardEmulation.ShareMode), shareMode)); + } + + set + { + this.shareMode = (EnumToString(value)); + } + } + + /// + /// ShareMode + /// + [DataMember(Name = ("shareMode"), IsRequired = (true))] + internal string shareMode + { + get; + private set; + } + + /// + /// PreferredProtocols + /// + [DataMember(Name = ("preferredProtocols"), IsRequired = (true))] + public CefSharp.DevTools.SmartCardEmulation.ProtocolSet PreferredProtocols + { + get; + private set; + } + } + + /// + /// Fired when |SCardDisconnect| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DisconnectRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [DataMember(Name = ("handle"), IsRequired = (true))] + public int Handle + { + get; + private set; + } + + /// + /// Disposition + /// + public CefSharp.DevTools.SmartCardEmulation.Disposition Disposition + { + get + { + return (CefSharp.DevTools.SmartCardEmulation.Disposition)(StringToEnum(typeof(CefSharp.DevTools.SmartCardEmulation.Disposition), disposition)); + } + + set + { + this.disposition = (EnumToString(value)); + } + } + + /// + /// Disposition + /// + [DataMember(Name = ("disposition"), IsRequired = (true))] + internal string disposition + { + get; + private set; + } + } + + /// + /// Fired when |SCardTransmit| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit + /// + [System.Runtime.Serialization.DataContractAttribute] + public class TransmitRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [DataMember(Name = ("handle"), IsRequired = (true))] + public int Handle + { + get; + private set; + } + + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + private set; + } + + /// + /// Protocol + /// + public CefSharp.DevTools.SmartCardEmulation.Protocol? Protocol + { + get + { + return (CefSharp.DevTools.SmartCardEmulation.Protocol? )(StringToEnum(typeof(CefSharp.DevTools.SmartCardEmulation.Protocol? ), protocol)); + } + + set + { + this.protocol = (EnumToString(value)); + } + } + + /// + /// Protocol + /// + [DataMember(Name = ("protocol"), IsRequired = (false))] + internal string protocol + { + get; + private set; + } + } + + /// + /// Fired when |SCardControl| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ControlRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [DataMember(Name = ("handle"), IsRequired = (true))] + public int Handle + { + get; + private set; + } + + /// + /// ControlCode + /// + [DataMember(Name = ("controlCode"), IsRequired = (true))] + public int ControlCode + { + get; + private set; + } + + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + private set; + } + } + + /// + /// Fired when |SCardGetAttrib| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib + /// + [System.Runtime.Serialization.DataContractAttribute] + public class GetAttribRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [DataMember(Name = ("handle"), IsRequired = (true))] + public int Handle + { + get; + private set; + } + + /// + /// AttribId + /// + [DataMember(Name = ("attribId"), IsRequired = (true))] + public int AttribId + { + get; + private set; + } + } + + /// + /// Fired when |SCardSetAttrib| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib + /// + [System.Runtime.Serialization.DataContractAttribute] + public class SetAttribRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [DataMember(Name = ("handle"), IsRequired = (true))] + public int Handle + { + get; + private set; + } + + /// + /// AttribId + /// + [DataMember(Name = ("attribId"), IsRequired = (true))] + public int AttribId + { + get; + private set; + } + + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public byte[] Data + { + get; + private set; + } + } + + /// + /// Fired when |SCardStatus| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa + /// + [System.Runtime.Serialization.DataContractAttribute] + public class StatusRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [DataMember(Name = ("handle"), IsRequired = (true))] + public int Handle + { + get; + private set; + } + } + + /// + /// Fired when |SCardBeginTransaction| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction + /// + [System.Runtime.Serialization.DataContractAttribute] + public class BeginTransactionRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [DataMember(Name = ("handle"), IsRequired = (true))] + public int Handle + { + get; + private set; + } + } + + /// + /// Fired when |SCardEndTransaction| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction + /// + [System.Runtime.Serialization.DataContractAttribute] + public class EndTransactionRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [DataMember(Name = ("handle"), IsRequired = (true))] + public int Handle + { + get; + private set; + } + + /// + /// Disposition + /// + public CefSharp.DevTools.SmartCardEmulation.Disposition Disposition + { + get + { + return (CefSharp.DevTools.SmartCardEmulation.Disposition)(StringToEnum(typeof(CefSharp.DevTools.SmartCardEmulation.Disposition), disposition)); + } + + set + { + this.disposition = (EnumToString(value)); + } + } + + /// + /// Disposition + /// + [DataMember(Name = ("disposition"), IsRequired = (true))] + internal string disposition + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// Enum of possible storage types. + /// + public enum StorageType + { + /// + /// cookies + /// + [EnumMember(Value = ("cookies"))] + Cookies, + /// + /// file_systems + /// + [EnumMember(Value = ("file_systems"))] + FileSystems, + /// + /// indexeddb + /// + [EnumMember(Value = ("indexeddb"))] + Indexeddb, + /// + /// local_storage + /// + [EnumMember(Value = ("local_storage"))] + LocalStorage, + /// + /// shader_cache + /// + [EnumMember(Value = ("shader_cache"))] + ShaderCache, + /// + /// websql + /// + [EnumMember(Value = ("websql"))] + Websql, + /// + /// service_workers + /// + [EnumMember(Value = ("service_workers"))] + ServiceWorkers, + /// + /// cache_storage + /// + [EnumMember(Value = ("cache_storage"))] + CacheStorage, + /// + /// interest_groups + /// + [EnumMember(Value = ("interest_groups"))] + InterestGroups, + /// + /// shared_storage + /// + [EnumMember(Value = ("shared_storage"))] + SharedStorage, + /// + /// storage_buckets + /// + [EnumMember(Value = ("storage_buckets"))] + StorageBuckets, + /// + /// all + /// + [EnumMember(Value = ("all"))] + All, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other + } + + /// + /// Usage for a storage type. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class UsageForType : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of storage type. + /// + public CefSharp.DevTools.Storage.StorageType StorageType + { + get + { + return (CefSharp.DevTools.Storage.StorageType)(StringToEnum(typeof(CefSharp.DevTools.Storage.StorageType), storageType)); + } + + set + { + this.storageType = (EnumToString(value)); + } + } + + /// + /// Name of storage type. + /// + [DataMember(Name = ("storageType"), IsRequired = (true))] + internal string storageType + { + get; + set; + } + + /// + /// Storage usage (bytes). + /// + [DataMember(Name = ("usage"), IsRequired = (true))] + public double Usage + { + get; + set; + } + } + + /// + /// Pair of issuer origin and number of available (signed, but not used) Trust + /// Tokens from that issuer. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class TrustTokens : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// IssuerOrigin + /// + [DataMember(Name = ("issuerOrigin"), IsRequired = (true))] + public string IssuerOrigin + { + get; + set; + } + + /// + /// Count + /// + [DataMember(Name = ("count"), IsRequired = (true))] + public double Count + { + get; + set; + } + } + + /// + /// Enum of interest group access types. + /// + public enum InterestGroupAccessType + { + /// + /// join + /// + [EnumMember(Value = ("join"))] + Join, + /// + /// leave + /// + [EnumMember(Value = ("leave"))] + Leave, + /// + /// update + /// + [EnumMember(Value = ("update"))] + Update, + /// + /// loaded + /// + [EnumMember(Value = ("loaded"))] + Loaded, + /// + /// bid + /// + [EnumMember(Value = ("bid"))] + Bid, + /// + /// win + /// + [EnumMember(Value = ("win"))] + Win, + /// + /// additionalBid + /// + [EnumMember(Value = ("additionalBid"))] + AdditionalBid, + /// + /// additionalBidWin + /// + [EnumMember(Value = ("additionalBidWin"))] + AdditionalBidWin, + /// + /// topLevelBid + /// + [EnumMember(Value = ("topLevelBid"))] + TopLevelBid, + /// + /// topLevelAdditionalBid + /// + [EnumMember(Value = ("topLevelAdditionalBid"))] + TopLevelAdditionalBid, + /// + /// clear + /// + [EnumMember(Value = ("clear"))] + Clear + } + + /// + /// Enum of auction events. + /// + public enum InterestGroupAuctionEventType + { + /// + /// started + /// + [EnumMember(Value = ("started"))] + Started, + /// + /// configResolved + /// + [EnumMember(Value = ("configResolved"))] + ConfigResolved + } + + /// + /// Enum of network fetches auctions can do. + /// + public enum InterestGroupAuctionFetchType + { + /// + /// bidderJs + /// + [EnumMember(Value = ("bidderJs"))] + BidderJs, + /// + /// bidderWasm + /// + [EnumMember(Value = ("bidderWasm"))] + BidderWasm, + /// + /// sellerJs + /// + [EnumMember(Value = ("sellerJs"))] + SellerJs, + /// + /// bidderTrustedSignals + /// + [EnumMember(Value = ("bidderTrustedSignals"))] + BidderTrustedSignals, + /// + /// sellerTrustedSignals + /// + [EnumMember(Value = ("sellerTrustedSignals"))] + SellerTrustedSignals + } + + /// + /// Enum of shared storage access scopes. + /// + public enum SharedStorageAccessScope + { + /// + /// window + /// + [EnumMember(Value = ("window"))] + Window, + /// + /// sharedStorageWorklet + /// + [EnumMember(Value = ("sharedStorageWorklet"))] + SharedStorageWorklet, + /// + /// protectedAudienceWorklet + /// + [EnumMember(Value = ("protectedAudienceWorklet"))] + ProtectedAudienceWorklet, + /// + /// header + /// + [EnumMember(Value = ("header"))] + Header + } + + /// + /// Enum of shared storage access methods. + /// + public enum SharedStorageAccessMethod + { + /// + /// addModule + /// + [EnumMember(Value = ("addModule"))] + AddModule, + /// + /// createWorklet + /// + [EnumMember(Value = ("createWorklet"))] + CreateWorklet, + /// + /// selectURL + /// + [EnumMember(Value = ("selectURL"))] + SelectURL, + /// + /// run + /// + [EnumMember(Value = ("run"))] + Run, + /// + /// batchUpdate + /// + [EnumMember(Value = ("batchUpdate"))] + BatchUpdate, + /// + /// set + /// + [EnumMember(Value = ("set"))] + Set, + /// + /// append + /// + [EnumMember(Value = ("append"))] + Append, + /// + /// delete + /// + [EnumMember(Value = ("delete"))] + Delete, + /// + /// clear + /// + [EnumMember(Value = ("clear"))] + Clear, + /// + /// get + /// + [EnumMember(Value = ("get"))] + Get, + /// + /// keys + /// + [EnumMember(Value = ("keys"))] + Keys, + /// + /// values + /// + [EnumMember(Value = ("values"))] + Values, + /// + /// entries + /// + [EnumMember(Value = ("entries"))] + Entries, + /// + /// length + /// + [EnumMember(Value = ("length"))] + Length, + /// + /// remainingBudget + /// + [EnumMember(Value = ("remainingBudget"))] + RemainingBudget + } + + /// + /// Struct for a single key-value pair in an origin's shared storage. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SharedStorageEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public string Key + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// Details for an origin's shared storage. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SharedStorageMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Time when the origin's shared storage was last created. + /// + [DataMember(Name = ("creationTime"), IsRequired = (true))] + public double CreationTime + { + get; + set; + } + + /// + /// Number of key-value pairs stored in origin's shared storage. + /// + [DataMember(Name = ("length"), IsRequired = (true))] + public int Length + { + get; + set; + } + + /// + /// Current amount of bits of entropy remaining in the navigation budget. + /// + [DataMember(Name = ("remainingBudget"), IsRequired = (true))] + public double RemainingBudget + { + get; + set; + } + + /// + /// Total number of bytes stored as key-value pairs in origin's shared + /// storage. + /// + [DataMember(Name = ("bytesUsed"), IsRequired = (true))] + public int BytesUsed + { + get; + set; + } + } + + /// + /// Represents a dictionary object passed in as privateAggregationConfig to + /// run or selectURL. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SharedStoragePrivateAggregationConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The chosen aggregation service deployment. + /// + [DataMember(Name = ("aggregationCoordinatorOrigin"), IsRequired = (false))] + public string AggregationCoordinatorOrigin + { + get; + set; + } + + /// + /// The context ID provided. + /// + [DataMember(Name = ("contextId"), IsRequired = (false))] + public string ContextId + { + get; + set; + } + + /// + /// Configures the maximum size allowed for filtering IDs. + /// + [DataMember(Name = ("filteringIdMaxBytes"), IsRequired = (true))] + public int FilteringIdMaxBytes + { + get; + set; + } + + /// + /// The limit on the number of contributions in the final report. + /// + [DataMember(Name = ("maxContributions"), IsRequired = (false))] + public int? MaxContributions + { + get; + set; + } + } + + /// + /// Pair of reporting metadata details for a candidate URL for `selectURL()`. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SharedStorageReportingMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// EventType + /// + [DataMember(Name = ("eventType"), IsRequired = (true))] + public string EventType + { + get; + set; + } + + /// + /// ReportingUrl + /// + [DataMember(Name = ("reportingUrl"), IsRequired = (true))] + public string ReportingUrl + { + get; + set; + } + } + + /// + /// Bundles a candidate URL with its reporting metadata. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SharedStorageUrlWithMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Spec of candidate URL. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Any associated reporting metadata. + /// + [DataMember(Name = ("reportingMetadata"), IsRequired = (true))] + public System.Collections.Generic.IList ReportingMetadata + { + get; + set; + } + } + + /// + /// Bundles the parameters for shared storage access events whose + /// presence/absence can vary according to SharedStorageAccessType. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SharedStorageAccessParams : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Spec of the module script URL. + /// Present only for SharedStorageAccessMethods: addModule and + /// createWorklet. + /// + [DataMember(Name = ("scriptSourceUrl"), IsRequired = (false))] + public string ScriptSourceUrl + { + get; + set; + } + + /// + /// String denoting "context-origin", "script-origin", or a custom + /// origin to be used as the worklet's data origin. + /// Present only for SharedStorageAccessMethod: createWorklet. + /// + [DataMember(Name = ("dataOrigin"), IsRequired = (false))] + public string DataOrigin + { + get; + set; + } + + /// + /// Name of the registered operation to be run. + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// + [DataMember(Name = ("operationName"), IsRequired = (false))] + public string OperationName + { + get; + set; + } + + /// + /// ID of the operation call. + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// + [DataMember(Name = ("operationId"), IsRequired = (false))] + public string OperationId + { + get; + set; + } + + /// + /// Whether or not to keep the worket alive for future run or selectURL + /// calls. + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// + [DataMember(Name = ("keepAlive"), IsRequired = (false))] + public bool? KeepAlive + { + get; + set; + } + + /// + /// Configures the private aggregation options. + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// + [DataMember(Name = ("privateAggregationConfig"), IsRequired = (false))] + public CefSharp.DevTools.Storage.SharedStoragePrivateAggregationConfig PrivateAggregationConfig + { + get; + set; + } + + /// + /// The operation's serialized data in bytes (converted to a string). + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// TODO(crbug.com/401011862): Consider updating this parameter to binary. + /// + [DataMember(Name = ("serializedData"), IsRequired = (false))] + public string SerializedData + { + get; + set; + } + + /// + /// Array of candidate URLs' specs, along with any associated metadata. + /// Present only for SharedStorageAccessMethod: selectURL. + /// + [DataMember(Name = ("urlsWithMetadata"), IsRequired = (false))] + public System.Collections.Generic.IList UrlsWithMetadata + { + get; + set; + } + + /// + /// Spec of the URN:UUID generated for a selectURL call. + /// Present only for SharedStorageAccessMethod: selectURL. + /// + [DataMember(Name = ("urnUuid"), IsRequired = (false))] + public string UrnUuid + { + get; + set; + } + + /// + /// Key for a specific entry in an origin's shared storage. + /// Present only for SharedStorageAccessMethods: set, append, delete, and + /// get. + /// + [DataMember(Name = ("key"), IsRequired = (false))] + public string Key + { + get; + set; + } + + /// + /// Value for a specific entry in an origin's shared storage. + /// Present only for SharedStorageAccessMethods: set and append. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public string Value + { + get; + set; + } + + /// + /// Whether or not to set an entry for a key if that key is already present. + /// Present only for SharedStorageAccessMethod: set. + /// + [DataMember(Name = ("ignoreIfPresent"), IsRequired = (false))] + public bool? IgnoreIfPresent + { + get; + set; + } + + /// + /// A number denoting the (0-based) order of the worklet's + /// creation relative to all other shared storage worklets created by + /// documents using the current storage partition. + /// Present only for SharedStorageAccessMethods: addModule, createWorklet. + /// + [DataMember(Name = ("workletOrdinal"), IsRequired = (false))] + public int? WorkletOrdinal + { + get; + set; + } + + /// + /// Hex representation of the DevTools token used as the TargetID for the + /// associated shared storage worklet. + /// Present only for SharedStorageAccessMethods: addModule, createWorklet, + /// run, selectURL, and any other SharedStorageAccessMethod when the + /// SharedStorageAccessScope is sharedStorageWorklet. + /// + [DataMember(Name = ("workletTargetId"), IsRequired = (false))] + public string WorkletTargetId + { + get; + set; + } + + /// + /// Name of the lock to be acquired, if present. + /// Optionally present only for SharedStorageAccessMethods: batchUpdate, + /// set, append, delete, and clear. + /// + [DataMember(Name = ("withLock"), IsRequired = (false))] + public string WithLock + { + get; + set; + } + + /// + /// If the method has been called as part of a batchUpdate, then this + /// number identifies the batch to which it belongs. + /// Optionally present only for SharedStorageAccessMethods: + /// batchUpdate (required), set, append, delete, and clear. + /// + [DataMember(Name = ("batchUpdateId"), IsRequired = (false))] + public string BatchUpdateId + { + get; + set; + } + + /// + /// Number of modifier methods sent in batch. + /// Present only for SharedStorageAccessMethod: batchUpdate. + /// + [DataMember(Name = ("batchSize"), IsRequired = (false))] + public int? BatchSize + { + get; + set; + } + } + + /// + /// StorageBucketsDurability + /// + public enum StorageBucketsDurability + { + /// + /// relaxed + /// + [EnumMember(Value = ("relaxed"))] + Relaxed, + /// + /// strict + /// + [EnumMember(Value = ("strict"))] + Strict + } + + /// + /// StorageBucket + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class StorageBucket : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// StorageKey + /// + [DataMember(Name = ("storageKey"), IsRequired = (true))] + public string StorageKey + { + get; + set; + } + + /// + /// If not specified, it is the default bucket of the storageKey. + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + } + + /// + /// StorageBucketInfo + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class StorageBucketInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Bucket + /// + [DataMember(Name = ("bucket"), IsRequired = (true))] + public CefSharp.DevTools.Storage.StorageBucket Bucket + { + get; + set; + } + + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// Expiration + /// + [DataMember(Name = ("expiration"), IsRequired = (true))] + public double Expiration + { + get; + set; + } + + /// + /// Storage quota (bytes). + /// + [DataMember(Name = ("quota"), IsRequired = (true))] + public double Quota + { + get; + set; + } + + /// + /// Persistent + /// + [DataMember(Name = ("persistent"), IsRequired = (true))] + public bool Persistent + { + get; + set; + } + + /// + /// Durability + /// + public CefSharp.DevTools.Storage.StorageBucketsDurability Durability + { + get + { + return (CefSharp.DevTools.Storage.StorageBucketsDurability)(StringToEnum(typeof(CefSharp.DevTools.Storage.StorageBucketsDurability), durability)); + } + + set + { + this.durability = (EnumToString(value)); + } + } + + /// + /// Durability + /// + [DataMember(Name = ("durability"), IsRequired = (true))] + internal string durability + { + get; + set; + } + } + + /// + /// AttributionReportingSourceType + /// + public enum AttributionReportingSourceType + { + /// + /// navigation + /// + [EnumMember(Value = ("navigation"))] + Navigation, + /// + /// event + /// + [EnumMember(Value = ("event"))] + Event + } + + /// + /// AttributionReportingFilterDataEntry + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingFilterDataEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public string Key + { + get; + set; + } + + /// + /// Values + /// + [DataMember(Name = ("values"), IsRequired = (true))] + public string[] Values + { + get; + set; + } + } + + /// + /// AttributionReportingFilterConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingFilterConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FilterValues + /// + [DataMember(Name = ("filterValues"), IsRequired = (true))] + public System.Collections.Generic.IList FilterValues + { + get; + set; + } + + /// + /// duration in seconds + /// + [DataMember(Name = ("lookbackWindow"), IsRequired = (false))] + public int? LookbackWindow + { + get; + set; + } + } + + /// + /// AttributionReportingFilterPair + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingFilterPair : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Filters + /// + [DataMember(Name = ("filters"), IsRequired = (true))] + public System.Collections.Generic.IList Filters + { + get; + set; + } + + /// + /// NotFilters + /// + [DataMember(Name = ("notFilters"), IsRequired = (true))] + public System.Collections.Generic.IList NotFilters + { + get; + set; + } + } + + /// + /// AttributionReportingAggregationKeysEntry + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingAggregationKeysEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public string Key + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public string Value + { + get; + set; + } + } + + /// + /// AttributionReportingEventReportWindows + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingEventReportWindows : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// duration in seconds + /// + [DataMember(Name = ("start"), IsRequired = (true))] + public int Start + { + get; + set; + } + + /// + /// duration in seconds + /// + [DataMember(Name = ("ends"), IsRequired = (true))] + public int[] Ends + { + get; + set; + } + } + + /// + /// AttributionReportingTriggerDataMatching + /// + public enum AttributionReportingTriggerDataMatching + { + /// + /// exact + /// + [EnumMember(Value = ("exact"))] + Exact, + /// + /// modulus + /// + [EnumMember(Value = ("modulus"))] + Modulus + } + + /// + /// AttributionReportingAggregatableDebugReportingData + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingAggregatableDebugReportingData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// KeyPiece + /// + [DataMember(Name = ("keyPiece"), IsRequired = (true))] + public string KeyPiece + { + get; + set; + } + + /// + /// number instead of integer because not all uint32 can be represented by + /// int + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public double Value + { + get; + set; + } + + /// + /// Types + /// + [DataMember(Name = ("types"), IsRequired = (true))] + public string[] Types + { + get; + set; + } + } + + /// + /// AttributionReportingAggregatableDebugReportingConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingAggregatableDebugReportingConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// number instead of integer because not all uint32 can be represented by + /// int, only present for source registrations + /// + [DataMember(Name = ("budget"), IsRequired = (false))] + public double? Budget + { + get; + set; + } + + /// + /// KeyPiece + /// + [DataMember(Name = ("keyPiece"), IsRequired = (true))] + public string KeyPiece + { + get; + set; + } + + /// + /// DebugData + /// + [DataMember(Name = ("debugData"), IsRequired = (true))] + public System.Collections.Generic.IList DebugData + { + get; + set; + } + + /// + /// AggregationCoordinatorOrigin + /// + [DataMember(Name = ("aggregationCoordinatorOrigin"), IsRequired = (false))] + public string AggregationCoordinatorOrigin + { + get; + set; + } + } + + /// + /// AttributionScopesData + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionScopesData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Values + /// + [DataMember(Name = ("values"), IsRequired = (true))] + public string[] Values + { + get; + set; + } + + /// + /// number instead of integer because not all uint32 can be represented by + /// int + /// + [DataMember(Name = ("limit"), IsRequired = (true))] + public double Limit + { + get; + set; + } + + /// + /// MaxEventStates + /// + [DataMember(Name = ("maxEventStates"), IsRequired = (true))] + public double MaxEventStates + { + get; + set; + } + } + + /// + /// AttributionReportingNamedBudgetDef + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingNamedBudgetDef : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Budget + /// + [DataMember(Name = ("budget"), IsRequired = (true))] + public int Budget + { + get; + set; + } + } + + /// + /// AttributionReportingSourceRegistration + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingSourceRegistration : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Time + /// + [DataMember(Name = ("time"), IsRequired = (true))] + public double Time + { + get; + set; + } + + /// + /// duration in seconds + /// + [DataMember(Name = ("expiry"), IsRequired = (true))] + public int Expiry + { + get; + set; + } + + /// + /// number instead of integer because not all uint32 can be represented by + /// int + /// + [DataMember(Name = ("triggerData"), IsRequired = (true))] + public double[] TriggerData + { + get; + set; + } + + /// + /// EventReportWindows + /// + [DataMember(Name = ("eventReportWindows"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingEventReportWindows EventReportWindows + { + get; + set; + } + + /// + /// duration in seconds + /// + [DataMember(Name = ("aggregatableReportWindow"), IsRequired = (true))] + public int AggregatableReportWindow + { + get; + set; + } + + /// + /// Type + /// + public CefSharp.DevTools.Storage.AttributionReportingSourceType Type + { + get + { + return (CefSharp.DevTools.Storage.AttributionReportingSourceType)(StringToEnum(typeof(CefSharp.DevTools.Storage.AttributionReportingSourceType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// SourceOrigin + /// + [DataMember(Name = ("sourceOrigin"), IsRequired = (true))] + public string SourceOrigin + { + get; + set; + } + + /// + /// ReportingOrigin + /// + [DataMember(Name = ("reportingOrigin"), IsRequired = (true))] + public string ReportingOrigin + { + get; + set; + } + + /// + /// DestinationSites + /// + [DataMember(Name = ("destinationSites"), IsRequired = (true))] + public string[] DestinationSites + { + get; + set; + } + + /// + /// EventId + /// + [DataMember(Name = ("eventId"), IsRequired = (true))] + public string EventId + { + get; + set; + } + + /// + /// Priority + /// + [DataMember(Name = ("priority"), IsRequired = (true))] + public string Priority + { + get; + set; + } + + /// + /// FilterData + /// + [DataMember(Name = ("filterData"), IsRequired = (true))] + public System.Collections.Generic.IList FilterData + { + get; + set; + } + + /// + /// AggregationKeys + /// + [DataMember(Name = ("aggregationKeys"), IsRequired = (true))] + public System.Collections.Generic.IList AggregationKeys + { + get; + set; + } + + /// + /// DebugKey + /// + [DataMember(Name = ("debugKey"), IsRequired = (false))] + public string DebugKey + { + get; + set; + } + + /// + /// TriggerDataMatching + /// + public CefSharp.DevTools.Storage.AttributionReportingTriggerDataMatching TriggerDataMatching + { + get + { + return (CefSharp.DevTools.Storage.AttributionReportingTriggerDataMatching)(StringToEnum(typeof(CefSharp.DevTools.Storage.AttributionReportingTriggerDataMatching), triggerDataMatching)); + } + + set + { + this.triggerDataMatching = (EnumToString(value)); + } + } + + /// + /// TriggerDataMatching + /// + [DataMember(Name = ("triggerDataMatching"), IsRequired = (true))] + internal string triggerDataMatching + { + get; + set; + } + + /// + /// DestinationLimitPriority + /// + [DataMember(Name = ("destinationLimitPriority"), IsRequired = (true))] + public string DestinationLimitPriority + { + get; + set; + } + + /// + /// AggregatableDebugReportingConfig + /// + [DataMember(Name = ("aggregatableDebugReportingConfig"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingAggregatableDebugReportingConfig AggregatableDebugReportingConfig + { + get; + set; + } + + /// + /// ScopesData + /// + [DataMember(Name = ("scopesData"), IsRequired = (false))] + public CefSharp.DevTools.Storage.AttributionScopesData ScopesData + { + get; + set; + } + + /// + /// MaxEventLevelReports + /// + [DataMember(Name = ("maxEventLevelReports"), IsRequired = (true))] + public int MaxEventLevelReports + { + get; + set; + } + + /// + /// NamedBudgets + /// + [DataMember(Name = ("namedBudgets"), IsRequired = (true))] + public System.Collections.Generic.IList NamedBudgets + { + get; + set; + } + + /// + /// DebugReporting + /// + [DataMember(Name = ("debugReporting"), IsRequired = (true))] + public bool DebugReporting + { + get; + set; + } + + /// + /// EventLevelEpsilon + /// + [DataMember(Name = ("eventLevelEpsilon"), IsRequired = (true))] + public double EventLevelEpsilon + { + get; + set; + } + } + + /// + /// AttributionReportingSourceRegistrationResult + /// + public enum AttributionReportingSourceRegistrationResult + { + /// + /// success + /// + [EnumMember(Value = ("success"))] + Success, + /// + /// internalError + /// + [EnumMember(Value = ("internalError"))] + InternalError, + /// + /// insufficientSourceCapacity + /// + [EnumMember(Value = ("insufficientSourceCapacity"))] + InsufficientSourceCapacity, + /// + /// insufficientUniqueDestinationCapacity + /// + [EnumMember(Value = ("insufficientUniqueDestinationCapacity"))] + InsufficientUniqueDestinationCapacity, + /// + /// excessiveReportingOrigins + /// + [EnumMember(Value = ("excessiveReportingOrigins"))] + ExcessiveReportingOrigins, + /// + /// prohibitedByBrowserPolicy + /// + [EnumMember(Value = ("prohibitedByBrowserPolicy"))] + ProhibitedByBrowserPolicy, + /// + /// successNoised + /// + [EnumMember(Value = ("successNoised"))] + SuccessNoised, + /// + /// destinationReportingLimitReached + /// + [EnumMember(Value = ("destinationReportingLimitReached"))] + DestinationReportingLimitReached, + /// + /// destinationGlobalLimitReached + /// + [EnumMember(Value = ("destinationGlobalLimitReached"))] + DestinationGlobalLimitReached, + /// + /// destinationBothLimitsReached + /// + [EnumMember(Value = ("destinationBothLimitsReached"))] + DestinationBothLimitsReached, + /// + /// reportingOriginsPerSiteLimitReached + /// + [EnumMember(Value = ("reportingOriginsPerSiteLimitReached"))] + ReportingOriginsPerSiteLimitReached, + /// + /// exceedsMaxChannelCapacity + /// + [EnumMember(Value = ("exceedsMaxChannelCapacity"))] + ExceedsMaxChannelCapacity, + /// + /// exceedsMaxScopesChannelCapacity + /// + [EnumMember(Value = ("exceedsMaxScopesChannelCapacity"))] + ExceedsMaxScopesChannelCapacity, + /// + /// exceedsMaxTriggerStateCardinality + /// + [EnumMember(Value = ("exceedsMaxTriggerStateCardinality"))] + ExceedsMaxTriggerStateCardinality, + /// + /// exceedsMaxEventStatesLimit + /// + [EnumMember(Value = ("exceedsMaxEventStatesLimit"))] + ExceedsMaxEventStatesLimit, + /// + /// destinationPerDayReportingLimitReached + /// + [EnumMember(Value = ("destinationPerDayReportingLimitReached"))] + DestinationPerDayReportingLimitReached + } + + /// + /// AttributionReportingSourceRegistrationTimeConfig + /// + public enum AttributionReportingSourceRegistrationTimeConfig + { + /// + /// include + /// + [EnumMember(Value = ("include"))] + Include, + /// + /// exclude + /// + [EnumMember(Value = ("exclude"))] + Exclude + } + + /// + /// AttributionReportingAggregatableValueDictEntry + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingAggregatableValueDictEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [DataMember(Name = ("key"), IsRequired = (true))] + public string Key + { + get; + set; + } + + /// + /// number instead of integer because not all uint32 can be represented by + /// int + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public double Value + { + get; + set; + } + + /// + /// FilteringId + /// + [DataMember(Name = ("filteringId"), IsRequired = (true))] + public string FilteringId + { + get; + set; + } + } + + /// + /// AttributionReportingAggregatableValueEntry + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingAggregatableValueEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Values + /// + [DataMember(Name = ("values"), IsRequired = (true))] + public System.Collections.Generic.IList Values + { + get; + set; + } + + /// + /// Filters + /// + [DataMember(Name = ("filters"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingEventTriggerData + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingEventTriggerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Data + /// + [DataMember(Name = ("data"), IsRequired = (true))] + public string Data + { + get; + set; + } + + /// + /// Priority + /// + [DataMember(Name = ("priority"), IsRequired = (true))] + public string Priority + { + get; + set; + } + + /// + /// DedupKey + /// + [DataMember(Name = ("dedupKey"), IsRequired = (false))] + public string DedupKey + { + get; + set; + } + + /// + /// Filters + /// + [DataMember(Name = ("filters"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingAggregatableTriggerData + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingAggregatableTriggerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// KeyPiece + /// + [DataMember(Name = ("keyPiece"), IsRequired = (true))] + public string KeyPiece + { + get; + set; + } + + /// + /// SourceKeys + /// + [DataMember(Name = ("sourceKeys"), IsRequired = (true))] + public string[] SourceKeys + { + get; + set; + } + + /// + /// Filters + /// + [DataMember(Name = ("filters"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingAggregatableDedupKey + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingAggregatableDedupKey : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// DedupKey + /// + [DataMember(Name = ("dedupKey"), IsRequired = (false))] + public string DedupKey + { + get; + set; + } + + /// + /// Filters + /// + [DataMember(Name = ("filters"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingNamedBudgetCandidate + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingNamedBudgetCandidate : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// Filters + /// + [DataMember(Name = ("filters"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingTriggerRegistration + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AttributionReportingTriggerRegistration : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Filters + /// + [DataMember(Name = ("filters"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + + /// + /// DebugKey + /// + [DataMember(Name = ("debugKey"), IsRequired = (false))] + public string DebugKey + { + get; + set; + } + + /// + /// AggregatableDedupKeys + /// + [DataMember(Name = ("aggregatableDedupKeys"), IsRequired = (true))] + public System.Collections.Generic.IList AggregatableDedupKeys + { + get; + set; + } + + /// + /// EventTriggerData + /// + [DataMember(Name = ("eventTriggerData"), IsRequired = (true))] + public System.Collections.Generic.IList EventTriggerData + { + get; + set; + } + + /// + /// AggregatableTriggerData + /// + [DataMember(Name = ("aggregatableTriggerData"), IsRequired = (true))] + public System.Collections.Generic.IList AggregatableTriggerData + { + get; + set; + } + + /// + /// AggregatableValues + /// + [DataMember(Name = ("aggregatableValues"), IsRequired = (true))] + public System.Collections.Generic.IList AggregatableValues + { + get; + set; + } + + /// + /// AggregatableFilteringIdMaxBytes + /// + [DataMember(Name = ("aggregatableFilteringIdMaxBytes"), IsRequired = (true))] + public int AggregatableFilteringIdMaxBytes + { + get; + set; + } + + /// + /// DebugReporting + /// + [DataMember(Name = ("debugReporting"), IsRequired = (true))] + public bool DebugReporting + { + get; + set; + } + + /// + /// AggregationCoordinatorOrigin + /// + [DataMember(Name = ("aggregationCoordinatorOrigin"), IsRequired = (false))] + public string AggregationCoordinatorOrigin + { + get; + set; + } + + /// + /// SourceRegistrationTimeConfig + /// + public CefSharp.DevTools.Storage.AttributionReportingSourceRegistrationTimeConfig SourceRegistrationTimeConfig + { + get + { + return (CefSharp.DevTools.Storage.AttributionReportingSourceRegistrationTimeConfig)(StringToEnum(typeof(CefSharp.DevTools.Storage.AttributionReportingSourceRegistrationTimeConfig), sourceRegistrationTimeConfig)); + } + + set + { + this.sourceRegistrationTimeConfig = (EnumToString(value)); + } + } + + /// + /// SourceRegistrationTimeConfig + /// + [DataMember(Name = ("sourceRegistrationTimeConfig"), IsRequired = (true))] + internal string sourceRegistrationTimeConfig + { + get; + set; + } + + /// + /// TriggerContextId + /// + [DataMember(Name = ("triggerContextId"), IsRequired = (false))] + public string TriggerContextId + { + get; + set; + } + + /// + /// AggregatableDebugReportingConfig + /// + [DataMember(Name = ("aggregatableDebugReportingConfig"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingAggregatableDebugReportingConfig AggregatableDebugReportingConfig + { + get; + set; + } + + /// + /// Scopes + /// + [DataMember(Name = ("scopes"), IsRequired = (true))] + public string[] Scopes + { + get; + set; + } + + /// + /// NamedBudgets + /// + [DataMember(Name = ("namedBudgets"), IsRequired = (true))] + public System.Collections.Generic.IList NamedBudgets + { + get; + set; + } + } + + /// + /// AttributionReportingEventLevelResult + /// + public enum AttributionReportingEventLevelResult + { + /// + /// success + /// + [EnumMember(Value = ("success"))] + Success, + /// + /// successDroppedLowerPriority + /// + [EnumMember(Value = ("successDroppedLowerPriority"))] + SuccessDroppedLowerPriority, + /// + /// internalError + /// + [EnumMember(Value = ("internalError"))] + InternalError, + /// + /// noCapacityForAttributionDestination + /// + [EnumMember(Value = ("noCapacityForAttributionDestination"))] + NoCapacityForAttributionDestination, + /// + /// noMatchingSources + /// + [EnumMember(Value = ("noMatchingSources"))] + NoMatchingSources, + /// + /// deduplicated + /// + [EnumMember(Value = ("deduplicated"))] + Deduplicated, + /// + /// excessiveAttributions + /// + [EnumMember(Value = ("excessiveAttributions"))] + ExcessiveAttributions, + /// + /// priorityTooLow + /// + [EnumMember(Value = ("priorityTooLow"))] + PriorityTooLow, + /// + /// neverAttributedSource + /// + [EnumMember(Value = ("neverAttributedSource"))] + NeverAttributedSource, + /// + /// excessiveReportingOrigins + /// + [EnumMember(Value = ("excessiveReportingOrigins"))] + ExcessiveReportingOrigins, + /// + /// noMatchingSourceFilterData + /// + [EnumMember(Value = ("noMatchingSourceFilterData"))] + NoMatchingSourceFilterData, + /// + /// prohibitedByBrowserPolicy + /// + [EnumMember(Value = ("prohibitedByBrowserPolicy"))] + ProhibitedByBrowserPolicy, + /// + /// noMatchingConfigurations + /// + [EnumMember(Value = ("noMatchingConfigurations"))] + NoMatchingConfigurations, + /// + /// excessiveReports + /// + [EnumMember(Value = ("excessiveReports"))] + ExcessiveReports, + /// + /// falselyAttributedSource + /// + [EnumMember(Value = ("falselyAttributedSource"))] + FalselyAttributedSource, + /// + /// reportWindowPassed + /// + [EnumMember(Value = ("reportWindowPassed"))] + ReportWindowPassed, + /// + /// notRegistered + /// + [EnumMember(Value = ("notRegistered"))] + NotRegistered, + /// + /// reportWindowNotStarted + /// + [EnumMember(Value = ("reportWindowNotStarted"))] + ReportWindowNotStarted, + /// + /// noMatchingTriggerData + /// + [EnumMember(Value = ("noMatchingTriggerData"))] + NoMatchingTriggerData + } + + /// + /// AttributionReportingAggregatableResult + /// + public enum AttributionReportingAggregatableResult + { + /// + /// success + /// + [EnumMember(Value = ("success"))] + Success, + /// + /// internalError + /// + [EnumMember(Value = ("internalError"))] + InternalError, + /// + /// noCapacityForAttributionDestination + /// + [EnumMember(Value = ("noCapacityForAttributionDestination"))] + NoCapacityForAttributionDestination, + /// + /// noMatchingSources + /// + [EnumMember(Value = ("noMatchingSources"))] + NoMatchingSources, + /// + /// excessiveAttributions + /// + [EnumMember(Value = ("excessiveAttributions"))] + ExcessiveAttributions, + /// + /// excessiveReportingOrigins + /// + [EnumMember(Value = ("excessiveReportingOrigins"))] + ExcessiveReportingOrigins, + /// + /// noHistograms + /// + [EnumMember(Value = ("noHistograms"))] + NoHistograms, + /// + /// insufficientBudget + /// + [EnumMember(Value = ("insufficientBudget"))] + InsufficientBudget, + /// + /// insufficientNamedBudget + /// + [EnumMember(Value = ("insufficientNamedBudget"))] + InsufficientNamedBudget, + /// + /// noMatchingSourceFilterData + /// + [EnumMember(Value = ("noMatchingSourceFilterData"))] + NoMatchingSourceFilterData, + /// + /// notRegistered + /// + [EnumMember(Value = ("notRegistered"))] + NotRegistered, + /// + /// prohibitedByBrowserPolicy + /// + [EnumMember(Value = ("prohibitedByBrowserPolicy"))] + ProhibitedByBrowserPolicy, + /// + /// deduplicated + /// + [EnumMember(Value = ("deduplicated"))] + Deduplicated, + /// + /// reportWindowPassed + /// + [EnumMember(Value = ("reportWindowPassed"))] + ReportWindowPassed, + /// + /// excessiveReports + /// + [EnumMember(Value = ("excessiveReports"))] + ExcessiveReports + } + + /// + /// AttributionReportingReportResult + /// + public enum AttributionReportingReportResult + { + /// + /// sent + /// + [EnumMember(Value = ("sent"))] + Sent, + /// + /// prohibited + /// + [EnumMember(Value = ("prohibited"))] + Prohibited, + /// + /// failedToAssemble + /// + [EnumMember(Value = ("failedToAssemble"))] + FailedToAssemble, + /// + /// expired + /// + [EnumMember(Value = ("expired"))] + Expired + } + + /// + /// A single Related Website Set object. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RelatedWebsiteSet : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The primary site of this set, along with the ccTLDs if there is any. + /// + [DataMember(Name = ("primarySites"), IsRequired = (true))] + public string[] PrimarySites + { + get; + set; + } + + /// + /// The associated sites of this set, along with the ccTLDs if there is any. + /// + [DataMember(Name = ("associatedSites"), IsRequired = (true))] + public string[] AssociatedSites + { + get; + set; + } + + /// + /// The service sites of this set, along with the ccTLDs if there is any. + /// + [DataMember(Name = ("serviceSites"), IsRequired = (true))] + public string[] ServiceSites + { + get; + set; + } + } + + /// + /// A cache's contents have been modified. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CacheStorageContentUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin to update. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + private set; + } + + /// + /// Storage key to update. + /// + [DataMember(Name = ("storageKey"), IsRequired = (true))] + public string StorageKey + { + get; + private set; + } + + /// + /// Storage bucket to update. + /// + [DataMember(Name = ("bucketId"), IsRequired = (true))] + public string BucketId + { + get; + private set; + } + + /// + /// Name of cache in origin. + /// + [DataMember(Name = ("cacheName"), IsRequired = (true))] + public string CacheName + { + get; + private set; + } + } + + /// + /// A cache has been added/deleted. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CacheStorageListUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin to update. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + private set; + } + + /// + /// Storage key to update. + /// + [DataMember(Name = ("storageKey"), IsRequired = (true))] + public string StorageKey + { + get; + private set; + } + + /// + /// Storage bucket to update. + /// + [DataMember(Name = ("bucketId"), IsRequired = (true))] + public string BucketId + { + get; + private set; + } + } + + /// + /// The origin's IndexedDB object store has been modified. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class IndexedDBContentUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin to update. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + private set; + } + + /// + /// Storage key to update. + /// + [DataMember(Name = ("storageKey"), IsRequired = (true))] + public string StorageKey + { + get; + private set; + } + + /// + /// Storage bucket to update. + /// + [DataMember(Name = ("bucketId"), IsRequired = (true))] + public string BucketId + { + get; + private set; + } + + /// + /// Database to update. + /// + [DataMember(Name = ("databaseName"), IsRequired = (true))] + public string DatabaseName + { + get; + private set; + } + + /// + /// ObjectStore to update. + /// + [DataMember(Name = ("objectStoreName"), IsRequired = (true))] + public string ObjectStoreName + { + get; + private set; + } + } + + /// + /// The origin's IndexedDB database list has been modified. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class IndexedDBListUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin to update. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + private set; + } + + /// + /// Storage key to update. + /// + [DataMember(Name = ("storageKey"), IsRequired = (true))] + public string StorageKey + { + get; + private set; + } + + /// + /// Storage bucket to update. + /// + [DataMember(Name = ("bucketId"), IsRequired = (true))] + public string BucketId + { + get; + private set; + } + } + + /// + /// One of the interest groups was accessed. Note that these events are global + /// to all targets sharing an interest group store. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class InterestGroupAccessedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AccessTime + /// + [DataMember(Name = ("accessTime"), IsRequired = (true))] + public double AccessTime + { + get; + private set; + } + + /// + /// Type + /// + public CefSharp.DevTools.Storage.InterestGroupAccessType Type + { + get + { + return (CefSharp.DevTools.Storage.InterestGroupAccessType)(StringToEnum(typeof(CefSharp.DevTools.Storage.InterestGroupAccessType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// OwnerOrigin + /// + [DataMember(Name = ("ownerOrigin"), IsRequired = (true))] + public string OwnerOrigin + { + get; + private set; + } + + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + private set; + } + + /// + /// For topLevelBid/topLevelAdditionalBid, and when appropriate, + /// win and additionalBidWin + /// + [DataMember(Name = ("componentSellerOrigin"), IsRequired = (false))] + public string ComponentSellerOrigin + { + get; + private set; + } + + /// + /// For bid or somethingBid event, if done locally and not on a server. + /// + [DataMember(Name = ("bid"), IsRequired = (false))] + public double? Bid + { + get; + private set; + } + + /// + /// BidCurrency + /// + [DataMember(Name = ("bidCurrency"), IsRequired = (false))] + public string BidCurrency + { + get; + private set; + } + + /// + /// For non-global events --- links to interestGroupAuctionEvent + /// + [DataMember(Name = ("uniqueAuctionId"), IsRequired = (false))] + public string UniqueAuctionId + { + get; + private set; + } + } + + /// + /// An auction involving interest groups is taking place. These events are + /// target-specific. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class InterestGroupAuctionEventOccurredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// EventTime + /// + [DataMember(Name = ("eventTime"), IsRequired = (true))] + public double EventTime + { + get; + private set; + } + + /// + /// Type + /// + public CefSharp.DevTools.Storage.InterestGroupAuctionEventType Type + { + get + { + return (CefSharp.DevTools.Storage.InterestGroupAuctionEventType)(StringToEnum(typeof(CefSharp.DevTools.Storage.InterestGroupAuctionEventType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// UniqueAuctionId + /// + [DataMember(Name = ("uniqueAuctionId"), IsRequired = (true))] + public string UniqueAuctionId + { + get; + private set; + } + + /// + /// Set for child auctions. + /// + [DataMember(Name = ("parentAuctionId"), IsRequired = (false))] + public string ParentAuctionId + { + get; + private set; + } + + /// + /// Set for started and configResolved + /// + [DataMember(Name = ("auctionConfig"), IsRequired = (false))] + public object AuctionConfig + { + get; + private set; + } + } + + /// + /// Specifies which auctions a particular network fetch may be related to, and + /// in what role. Note that it is not ordered with respect to + /// Network.requestWillBeSent (but will happen before loadingFinished + /// loadingFailed). + /// + [System.Runtime.Serialization.DataContractAttribute] + public class InterestGroupAuctionNetworkRequestCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Type + /// + public CefSharp.DevTools.Storage.InterestGroupAuctionFetchType Type + { + get + { + return (CefSharp.DevTools.Storage.InterestGroupAuctionFetchType)(StringToEnum(typeof(CefSharp.DevTools.Storage.InterestGroupAuctionFetchType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// RequestId + /// + [DataMember(Name = ("requestId"), IsRequired = (true))] + public string RequestId + { + get; + private set; + } + + /// + /// This is the set of the auctions using the worklet that issued this + /// request. In the case of trusted signals, it's possible that only some of + /// them actually care about the keys being queried. + /// + [DataMember(Name = ("auctions"), IsRequired = (true))] + public string[] Auctions + { + get; + private set; + } + } + + /// + /// Shared storage was accessed by the associated page. + /// The following parameters are included in all events. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class SharedStorageAccessedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Time of the access. + /// + [DataMember(Name = ("accessTime"), IsRequired = (true))] + public double AccessTime + { + get; + private set; + } + + /// + /// Enum value indicating the access scope. + /// + public CefSharp.DevTools.Storage.SharedStorageAccessScope Scope + { + get + { + return (CefSharp.DevTools.Storage.SharedStorageAccessScope)(StringToEnum(typeof(CefSharp.DevTools.Storage.SharedStorageAccessScope), scope)); + } + + set + { + this.scope = (EnumToString(value)); + } + } + + /// + /// Enum value indicating the access scope. + /// + [DataMember(Name = ("scope"), IsRequired = (true))] + internal string scope + { + get; + private set; + } + + /// + /// Enum value indicating the Shared Storage API method invoked. + /// + public CefSharp.DevTools.Storage.SharedStorageAccessMethod Method + { + get + { + return (CefSharp.DevTools.Storage.SharedStorageAccessMethod)(StringToEnum(typeof(CefSharp.DevTools.Storage.SharedStorageAccessMethod), method)); + } + + set + { + this.method = (EnumToString(value)); + } + } + + /// + /// Enum value indicating the Shared Storage API method invoked. + /// + [DataMember(Name = ("method"), IsRequired = (true))] + internal string method + { + get; + private set; + } + + /// + /// DevTools Frame Token for the primary frame tree's root. + /// + [DataMember(Name = ("mainFrameId"), IsRequired = (true))] + public string MainFrameId + { + get; + private set; + } + + /// + /// Serialization of the origin owning the Shared Storage data. + /// + [DataMember(Name = ("ownerOrigin"), IsRequired = (true))] + public string OwnerOrigin + { + get; + private set; + } + + /// + /// Serialization of the site owning the Shared Storage data. + /// + [DataMember(Name = ("ownerSite"), IsRequired = (true))] + public string OwnerSite + { + get; + private set; + } + + /// + /// The sub-parameters wrapped by `params` are all optional and their + /// presence/absence depends on `type`. + /// + [DataMember(Name = ("params"), IsRequired = (true))] + public CefSharp.DevTools.Storage.SharedStorageAccessParams Params + { + get; + private set; + } + } + + /// + /// A shared storage run or selectURL operation finished its execution. + /// The following parameters are included in all events. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class SharedStorageWorkletOperationExecutionFinishedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Time that the operation finished. + /// + [DataMember(Name = ("finishedTime"), IsRequired = (true))] + public double FinishedTime + { + get; + private set; + } + + /// + /// Time, in microseconds, from start of shared storage JS API call until + /// end of operation execution in the worklet. + /// + [DataMember(Name = ("executionTime"), IsRequired = (true))] + public int ExecutionTime + { + get; + private set; + } + + /// + /// Enum value indicating the Shared Storage API method invoked. + /// + public CefSharp.DevTools.Storage.SharedStorageAccessMethod Method + { + get + { + return (CefSharp.DevTools.Storage.SharedStorageAccessMethod)(StringToEnum(typeof(CefSharp.DevTools.Storage.SharedStorageAccessMethod), method)); + } + + set + { + this.method = (EnumToString(value)); + } + } + + /// + /// Enum value indicating the Shared Storage API method invoked. + /// + [DataMember(Name = ("method"), IsRequired = (true))] + internal string method + { + get; + private set; + } + + /// + /// ID of the operation call. + /// + [DataMember(Name = ("operationId"), IsRequired = (true))] + public string OperationId + { + get; + private set; + } + + /// + /// Hex representation of the DevTools token used as the TargetID for the + /// associated shared storage worklet. + /// + [DataMember(Name = ("workletTargetId"), IsRequired = (true))] + public string WorkletTargetId + { + get; + private set; + } + + /// + /// DevTools Frame Token for the primary frame tree's root. + /// + [DataMember(Name = ("mainFrameId"), IsRequired = (true))] + public string MainFrameId + { + get; + private set; + } + + /// + /// Serialization of the origin owning the Shared Storage data. + /// + [DataMember(Name = ("ownerOrigin"), IsRequired = (true))] + public string OwnerOrigin + { + get; + private set; + } + } + + /// + /// storageBucketCreatedOrUpdated + /// + [System.Runtime.Serialization.DataContractAttribute] + public class StorageBucketCreatedOrUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// BucketInfo + /// + [DataMember(Name = ("bucketInfo"), IsRequired = (true))] + public CefSharp.DevTools.Storage.StorageBucketInfo BucketInfo + { + get; + private set; + } + } + + /// + /// storageBucketDeleted + /// + [System.Runtime.Serialization.DataContractAttribute] + public class StorageBucketDeletedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// BucketId + /// + [DataMember(Name = ("bucketId"), IsRequired = (true))] + public string BucketId + { + get; + private set; + } + } + + /// + /// attributionReportingSourceRegistered + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AttributionReportingSourceRegisteredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Registration + /// + [DataMember(Name = ("registration"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingSourceRegistration Registration + { + get; + private set; + } + + /// + /// Result + /// + public CefSharp.DevTools.Storage.AttributionReportingSourceRegistrationResult Result + { + get + { + return (CefSharp.DevTools.Storage.AttributionReportingSourceRegistrationResult)(StringToEnum(typeof(CefSharp.DevTools.Storage.AttributionReportingSourceRegistrationResult), result)); + } + + set + { + this.result = (EnumToString(value)); + } + } + + /// + /// Result + /// + [DataMember(Name = ("result"), IsRequired = (true))] + internal string result + { + get; + private set; + } + } + + /// + /// attributionReportingTriggerRegistered + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AttributionReportingTriggerRegisteredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Registration + /// + [DataMember(Name = ("registration"), IsRequired = (true))] + public CefSharp.DevTools.Storage.AttributionReportingTriggerRegistration Registration + { + get; + private set; + } + + /// + /// EventLevel + /// + public CefSharp.DevTools.Storage.AttributionReportingEventLevelResult EventLevel + { + get + { + return (CefSharp.DevTools.Storage.AttributionReportingEventLevelResult)(StringToEnum(typeof(CefSharp.DevTools.Storage.AttributionReportingEventLevelResult), eventLevel)); + } + + set + { + this.eventLevel = (EnumToString(value)); + } + } + + /// + /// EventLevel + /// + [DataMember(Name = ("eventLevel"), IsRequired = (true))] + internal string eventLevel + { + get; + private set; + } + + /// + /// Aggregatable + /// + public CefSharp.DevTools.Storage.AttributionReportingAggregatableResult Aggregatable + { + get + { + return (CefSharp.DevTools.Storage.AttributionReportingAggregatableResult)(StringToEnum(typeof(CefSharp.DevTools.Storage.AttributionReportingAggregatableResult), aggregatable)); + } + + set + { + this.aggregatable = (EnumToString(value)); + } + } + + /// + /// Aggregatable + /// + [DataMember(Name = ("aggregatable"), IsRequired = (true))] + internal string aggregatable + { + get; + private set; + } + } + + /// + /// attributionReportingReportSent + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AttributionReportingReportSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Body + /// + [DataMember(Name = ("body"), IsRequired = (true))] + public object Body + { + get; + private set; + } + + /// + /// Result + /// + public CefSharp.DevTools.Storage.AttributionReportingReportResult Result + { + get + { + return (CefSharp.DevTools.Storage.AttributionReportingReportResult)(StringToEnum(typeof(CefSharp.DevTools.Storage.AttributionReportingReportResult), result)); + } + + set + { + this.result = (EnumToString(value)); + } + } + + /// + /// Result + /// + [DataMember(Name = ("result"), IsRequired = (true))] + internal string result + { + get; + private set; + } + + /// + /// If result is `sent`, populated with net/HTTP status. + /// + [DataMember(Name = ("netError"), IsRequired = (false))] + public int? NetError + { + get; + private set; + } + + /// + /// NetErrorName + /// + [DataMember(Name = ("netErrorName"), IsRequired = (false))] + public string NetErrorName + { + get; + private set; + } + + /// + /// HttpStatusCode + /// + [DataMember(Name = ("httpStatusCode"), IsRequired = (false))] + public int? HttpStatusCode + { + get; + private set; + } + } + + /// + /// attributionReportingVerboseDebugReportSent + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AttributionReportingVerboseDebugReportSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Body + /// + [DataMember(Name = ("body"), IsRequired = (false))] + public System.Collections.Generic.IList Body + { + get; + private set; + } + + /// + /// NetError + /// + [DataMember(Name = ("netError"), IsRequired = (false))] + public int? NetError + { + get; + private set; + } + + /// + /// NetErrorName + /// + [DataMember(Name = ("netErrorName"), IsRequired = (false))] + public string NetErrorName + { + get; + private set; + } + + /// + /// HttpStatusCode + /// + [DataMember(Name = ("httpStatusCode"), IsRequired = (false))] + public int? HttpStatusCode + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + /// + /// Describes a single graphics processor (GPU). + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class GPUDevice : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// PCI ID of the GPU vendor, if available; 0 otherwise. + /// + [DataMember(Name = ("vendorId"), IsRequired = (true))] + public double VendorId + { + get; + set; + } + + /// + /// PCI ID of the GPU device, if available; 0 otherwise. + /// + [DataMember(Name = ("deviceId"), IsRequired = (true))] + public double DeviceId + { + get; + set; + } + + /// + /// Sub sys ID of the GPU, only available on Windows. + /// + [DataMember(Name = ("subSysId"), IsRequired = (false))] + public double? SubSysId + { + get; + set; + } + + /// + /// Revision of the GPU, only available on Windows. + /// + [DataMember(Name = ("revision"), IsRequired = (false))] + public double? Revision + { + get; + set; + } + + /// + /// String description of the GPU vendor, if the PCI ID is not available. + /// + [DataMember(Name = ("vendorString"), IsRequired = (true))] + public string VendorString + { + get; + set; + } + + /// + /// String description of the GPU device, if the PCI ID is not available. + /// + [DataMember(Name = ("deviceString"), IsRequired = (true))] + public string DeviceString + { + get; + set; + } + + /// + /// String description of the GPU driver vendor. + /// + [DataMember(Name = ("driverVendor"), IsRequired = (true))] + public string DriverVendor + { + get; + set; + } + + /// + /// String description of the GPU driver version. + /// + [DataMember(Name = ("driverVersion"), IsRequired = (true))] + public string DriverVersion + { + get; + set; + } + } + + /// + /// Describes the width and height dimensions of an entity. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Size : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Width in pixels. + /// + [DataMember(Name = ("width"), IsRequired = (true))] + public int Width + { + get; + set; + } + + /// + /// Height in pixels. + /// + [DataMember(Name = ("height"), IsRequired = (true))] + public int Height + { + get; + set; + } + } + + /// + /// Describes a supported video decoding profile with its associated minimum and + /// maximum resolutions. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class VideoDecodeAcceleratorCapability : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Video codec profile that is supported, e.g. VP9 Profile 2. + /// + [DataMember(Name = ("profile"), IsRequired = (true))] + public string Profile + { + get; + set; + } + + /// + /// Maximum video dimensions in pixels supported for this |profile|. + /// + [DataMember(Name = ("maxResolution"), IsRequired = (true))] + public CefSharp.DevTools.SystemInfo.Size MaxResolution + { + get; + set; + } + + /// + /// Minimum video dimensions in pixels supported for this |profile|. + /// + [DataMember(Name = ("minResolution"), IsRequired = (true))] + public CefSharp.DevTools.SystemInfo.Size MinResolution + { + get; + set; + } + } + + /// + /// Describes a supported video encoding profile with its associated maximum + /// resolution and maximum framerate. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class VideoEncodeAcceleratorCapability : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Video codec profile that is supported, e.g H264 Main. + /// + [DataMember(Name = ("profile"), IsRequired = (true))] + public string Profile + { + get; + set; + } + + /// + /// Maximum video dimensions in pixels supported for this |profile|. + /// + [DataMember(Name = ("maxResolution"), IsRequired = (true))] + public CefSharp.DevTools.SystemInfo.Size MaxResolution + { + get; + set; + } + + /// + /// Maximum encoding framerate in frames per second supported for this + /// |profile|, as fraction's numerator and denominator, e.g. 24/1 fps, + /// 24000/1001 fps, etc. + /// + [DataMember(Name = ("maxFramerateNumerator"), IsRequired = (true))] + public int MaxFramerateNumerator + { + get; + set; + } + + /// + /// MaxFramerateDenominator + /// + [DataMember(Name = ("maxFramerateDenominator"), IsRequired = (true))] + public int MaxFramerateDenominator + { + get; + set; + } + } + + /// + /// YUV subsampling type of the pixels of a given image. + /// + public enum SubsamplingFormat + { + /// + /// yuv420 + /// + [EnumMember(Value = ("yuv420"))] + Yuv420, + /// + /// yuv422 + /// + [EnumMember(Value = ("yuv422"))] + Yuv422, + /// + /// yuv444 + /// + [EnumMember(Value = ("yuv444"))] + Yuv444 + } + + /// + /// Image format of a given image. + /// + public enum ImageType + { + /// + /// jpeg + /// + [EnumMember(Value = ("jpeg"))] + Jpeg, + /// + /// webp + /// + [EnumMember(Value = ("webp"))] + Webp, + /// + /// unknown + /// + [EnumMember(Value = ("unknown"))] + Unknown + } + + /// + /// Provides information about the GPU(s) on the system. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class GPUInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The graphics devices on the system. Element 0 is the primary GPU. + /// + [DataMember(Name = ("devices"), IsRequired = (true))] + public System.Collections.Generic.IList Devices + { + get; + set; + } + + /// + /// An optional dictionary of additional GPU related attributes. + /// + [DataMember(Name = ("auxAttributes"), IsRequired = (false))] + public object AuxAttributes + { + get; + set; + } + + /// + /// An optional dictionary of graphics features and their status. + /// + [DataMember(Name = ("featureStatus"), IsRequired = (false))] + public object FeatureStatus + { + get; + set; + } + + /// + /// An optional array of GPU driver bug workarounds. + /// + [DataMember(Name = ("driverBugWorkarounds"), IsRequired = (true))] + public string[] DriverBugWorkarounds + { + get; + set; + } + + /// + /// Supported accelerated video decoding capabilities. + /// + [DataMember(Name = ("videoDecoding"), IsRequired = (true))] + public System.Collections.Generic.IList VideoDecoding + { + get; + set; + } + + /// + /// Supported accelerated video encoding capabilities. + /// + [DataMember(Name = ("videoEncoding"), IsRequired = (true))] + public System.Collections.Generic.IList VideoEncoding + { + get; + set; + } + } + + /// + /// Represents process info. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ProcessInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Specifies process type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + public string Type + { + get; + set; + } + + /// + /// Specifies process id. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public int Id + { + get; + set; + } + + /// + /// Specifies cumulative CPU usage in seconds across all threads of the + /// process since the process start. + /// + [DataMember(Name = ("cpuTime"), IsRequired = (true))] + public double CpuTime + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// TargetInfo + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class TargetInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TargetId + /// + [DataMember(Name = ("targetId"), IsRequired = (true))] + public string TargetId + { + get; + set; + } + + /// + /// List of types: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_agent_host_impl.cc?ss=chromium&q=f:devtools%20-f:out%20%22::kTypeTab%5B%5D%22 + /// + [DataMember(Name = ("type"), IsRequired = (true))] + public string Type + { + get; + set; + } + + /// + /// Title + /// + [DataMember(Name = ("title"), IsRequired = (true))] + public string Title + { + get; + set; + } + + /// + /// Url + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Whether the target has an attached client. + /// + [DataMember(Name = ("attached"), IsRequired = (true))] + public bool Attached + { + get; + set; + } + + /// + /// Opener target Id + /// + [DataMember(Name = ("openerId"), IsRequired = (false))] + public string OpenerId + { + get; + set; + } + + /// + /// Whether the target has access to the originating window. + /// + [DataMember(Name = ("canAccessOpener"), IsRequired = (true))] + public bool CanAccessOpener + { + get; + set; + } + + /// + /// Frame id of originating window (is only set if target has an opener). + /// + [DataMember(Name = ("openerFrameId"), IsRequired = (false))] + public string OpenerFrameId + { + get; + set; + } + + /// + /// Id of the parent frame, only present for the "iframe" targets. + /// + [DataMember(Name = ("parentFrameId"), IsRequired = (false))] + public string ParentFrameId + { + get; + set; + } + + /// + /// BrowserContextId + /// + [DataMember(Name = ("browserContextId"), IsRequired = (false))] + public string BrowserContextId + { + get; + set; + } + + /// + /// Provides additional details for specific target types. For example, for + /// the type of "page", this may be set to "prerender". + /// + [DataMember(Name = ("subtype"), IsRequired = (false))] + public string Subtype + { + get; + set; + } + } + + /// + /// A filter used by target query/discovery/auto-attach operations. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FilterEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// If set, causes exclusion of matching targets from the list. + /// + [DataMember(Name = ("exclude"), IsRequired = (false))] + public bool? Exclude + { + get; + set; + } + + /// + /// If not present, matches any type. + /// + [DataMember(Name = ("type"), IsRequired = (false))] + public string Type + { + get; + set; + } + } + + /// + /// RemoteLocation + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RemoteLocation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Host + /// + [DataMember(Name = ("host"), IsRequired = (true))] + public string Host + { + get; + set; + } + + /// + /// Port + /// + [DataMember(Name = ("port"), IsRequired = (true))] + public int Port + { + get; + set; + } + } + + /// + /// The state of the target window. + /// + public enum WindowState + { + /// + /// normal + /// + [EnumMember(Value = ("normal"))] + Normal, + /// + /// minimized + /// + [EnumMember(Value = ("minimized"))] + Minimized, + /// + /// maximized + /// + [EnumMember(Value = ("maximized"))] + Maximized, + /// + /// fullscreen + /// + [EnumMember(Value = ("fullscreen"))] + Fullscreen + } + + /// + /// Issued when attached to target because of auto-attach or `attachToTarget` command. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AttachedToTargetEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier assigned to the session used to send/receive messages. + /// + [DataMember(Name = ("sessionId"), IsRequired = (true))] + public string SessionId + { + get; + private set; + } + + /// + /// TargetInfo + /// + [DataMember(Name = ("targetInfo"), IsRequired = (true))] + public CefSharp.DevTools.Target.TargetInfo TargetInfo + { + get; + private set; + } + + /// + /// WaitingForDebugger + /// + [DataMember(Name = ("waitingForDebugger"), IsRequired = (true))] + public bool WaitingForDebugger + { + get; + private set; + } + } + + /// + /// Issued when detached from target for any reason (including `detachFromTarget` command). Can be + /// issued multiple times per target if multiple sessions have been attached to it. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DetachedFromTargetEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Detached session identifier. + /// + [DataMember(Name = ("sessionId"), IsRequired = (true))] + public string SessionId + { + get; + private set; + } + + /// + /// Deprecated. + /// + [DataMember(Name = ("targetId"), IsRequired = (false))] + public string TargetId + { + get; + private set; + } + } + + /// + /// Notifies about a new protocol message received from the session (as reported in + /// `attachedToTarget` event). + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ReceivedMessageFromTargetEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier of a session which sends a message. + /// + [DataMember(Name = ("sessionId"), IsRequired = (true))] + public string SessionId + { + get; + private set; + } + + /// + /// Message + /// + [DataMember(Name = ("message"), IsRequired = (true))] + public string Message + { + get; + private set; + } + + /// + /// Deprecated. + /// + [DataMember(Name = ("targetId"), IsRequired = (false))] + public string TargetId + { + get; + private set; + } + } + + /// + /// Issued when a possible inspection target is created. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class TargetCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// TargetInfo + /// + [DataMember(Name = ("targetInfo"), IsRequired = (true))] + public CefSharp.DevTools.Target.TargetInfo TargetInfo + { + get; + private set; + } + } + + /// + /// Issued when a target is destroyed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class TargetDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// TargetId + /// + [DataMember(Name = ("targetId"), IsRequired = (true))] + public string TargetId + { + get; + private set; + } + } + + /// + /// Issued when a target has crashed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class TargetCrashedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// TargetId + /// + [DataMember(Name = ("targetId"), IsRequired = (true))] + public string TargetId + { + get; + private set; + } + + /// + /// Termination status type. + /// + [DataMember(Name = ("status"), IsRequired = (true))] + public string Status + { + get; + private set; + } + + /// + /// Termination error code. + /// + [DataMember(Name = ("errorCode"), IsRequired = (true))] + public int ErrorCode + { + get; + private set; + } + } + + /// + /// Issued when some information about a target has changed. This only happens between + /// `targetCreated` and `targetDestroyed`. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class TargetInfoChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// TargetInfo + /// + [DataMember(Name = ("targetInfo"), IsRequired = (true))] + public CefSharp.DevTools.Target.TargetInfo TargetInfo + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Tethering +{ + /// + /// Informs that port was successfully bound and got a specified connection id. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AcceptedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Port number that was successfully bound. + /// + [DataMember(Name = ("port"), IsRequired = (true))] + public int Port + { + get; + private set; + } + + /// + /// Connection id to be used. + /// + [DataMember(Name = ("connectionId"), IsRequired = (true))] + public string ConnectionId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + /// + /// Controls how the trace buffer stores data. The default is `recordUntilFull`. + /// + public enum TraceConfigRecordMode + { + /// + /// recordUntilFull + /// + [EnumMember(Value = ("recordUntilFull"))] + RecordUntilFull, + /// + /// recordContinuously + /// + [EnumMember(Value = ("recordContinuously"))] + RecordContinuously, + /// + /// recordAsMuchAsPossible + /// + [EnumMember(Value = ("recordAsMuchAsPossible"))] + RecordAsMuchAsPossible, + /// + /// echoToConsole + /// + [EnumMember(Value = ("echoToConsole"))] + EchoToConsole + } + + /// + /// TraceConfig + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class TraceConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Controls how the trace buffer stores data. The default is `recordUntilFull`. + /// + public CefSharp.DevTools.Tracing.TraceConfigRecordMode? RecordMode + { + get + { + return (CefSharp.DevTools.Tracing.TraceConfigRecordMode? )(StringToEnum(typeof(CefSharp.DevTools.Tracing.TraceConfigRecordMode? ), recordMode)); + } + + set + { + this.recordMode = (EnumToString(value)); + } + } + + /// + /// Controls how the trace buffer stores data. The default is `recordUntilFull`. + /// + [DataMember(Name = ("recordMode"), IsRequired = (false))] + internal string recordMode + { + get; + set; + } + + /// + /// Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value + /// of 200 MB would be used. + /// + [DataMember(Name = ("traceBufferSizeInKb"), IsRequired = (false))] + public double? TraceBufferSizeInKb + { + get; + set; + } + + /// + /// Turns on JavaScript stack sampling. + /// + [DataMember(Name = ("enableSampling"), IsRequired = (false))] + public bool? EnableSampling + { + get; + set; + } + + /// + /// Turns on system tracing. + /// + [DataMember(Name = ("enableSystrace"), IsRequired = (false))] + public bool? EnableSystrace + { + get; + set; + } + + /// + /// Turns on argument filter. + /// + [DataMember(Name = ("enableArgumentFilter"), IsRequired = (false))] + public bool? EnableArgumentFilter + { + get; + set; + } + + /// + /// Included category filters. + /// + [DataMember(Name = ("includedCategories"), IsRequired = (false))] + public string[] IncludedCategories + { + get; + set; + } + + /// + /// Excluded category filters. + /// + [DataMember(Name = ("excludedCategories"), IsRequired = (false))] + public string[] ExcludedCategories + { + get; + set; + } + + /// + /// Configuration to synthesize the delays in tracing. + /// + [DataMember(Name = ("syntheticDelays"), IsRequired = (false))] + public string[] SyntheticDelays + { + get; + set; + } + + /// + /// Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. + /// + [DataMember(Name = ("memoryDumpConfig"), IsRequired = (false))] + public CefSharp.DevTools.Tracing.MemoryDumpConfig MemoryDumpConfig + { + get; + set; + } + } + + /// + /// Data format of a trace. Can be either the legacy JSON format or the + /// protocol buffer format. Note that the JSON format will be deprecated soon. + /// + public enum StreamFormat + { + /// + /// json + /// + [EnumMember(Value = ("json"))] + Json, + /// + /// proto + /// + [EnumMember(Value = ("proto"))] + Proto + } + + /// + /// Compression type to use for traces returned via streams. + /// + public enum StreamCompression + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// gzip + /// + [EnumMember(Value = ("gzip"))] + Gzip + } + + /// + /// Details exposed when memory request explicitly declared. + /// Keep consistent with memory_dump_request_args.h and + /// memory_instrumentation.mojom + /// + public enum MemoryDumpLevelOfDetail + { + /// + /// background + /// + [EnumMember(Value = ("background"))] + Background, + /// + /// light + /// + [EnumMember(Value = ("light"))] + Light, + /// + /// detailed + /// + [EnumMember(Value = ("detailed"))] + Detailed + } + + /// + /// Backend type to use for tracing. `chrome` uses the Chrome-integrated + /// tracing service and is supported on all platforms. `system` is only + /// supported on Chrome OS and uses the Perfetto system tracing service. + /// `auto` chooses `system` when the perfettoConfig provided to Tracing.start + /// specifies at least one non-Chrome data source; otherwise uses `chrome`. + /// + public enum TracingBackend + { + /// + /// auto + /// + [EnumMember(Value = ("auto"))] + Auto, + /// + /// chrome + /// + [EnumMember(Value = ("chrome"))] + Chrome, + /// + /// system + /// + [EnumMember(Value = ("system"))] + System + } + + /// + /// bufferUsage + /// + [System.Runtime.Serialization.DataContractAttribute] + public class BufferUsageEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// A number in range [0..1] that indicates the used size of event buffer as a fraction of its + /// total size. + /// + [DataMember(Name = ("percentFull"), IsRequired = (false))] + public double? PercentFull + { + get; + private set; + } + + /// + /// An approximate number of events in the trace log. + /// + [DataMember(Name = ("eventCount"), IsRequired = (false))] + public double? EventCount + { + get; + private set; + } + + /// + /// A number in range [0..1] that indicates the used size of event buffer as a fraction of its + /// total size. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public double? Value + { + get; + private set; + } + } + + /// + /// Contains a bucket of collected trace events. When tracing is stopped collected events will be + /// sent as a sequence of dataCollected events followed by tracingComplete event. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class DataCollectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public System.Collections.Generic.IList Value + { + get; + private set; + } + } + + /// + /// Signals that tracing is stopped and there is no trace buffers pending flush, all data were + /// delivered via dataCollected events. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class TracingCompleteEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Indicates whether some trace data is known to have been lost, e.g. because the trace ring + /// buffer wrapped around. + /// + [DataMember(Name = ("dataLossOccurred"), IsRequired = (true))] + public bool DataLossOccurred + { + get; + private set; + } + + /// + /// A handle of the stream that holds resulting trace data. + /// + [DataMember(Name = ("stream"), IsRequired = (false))] + public string Stream + { + get; + private set; + } + + /// + /// Trace data format of returned stream. + /// + public CefSharp.DevTools.Tracing.StreamFormat? TraceFormat + { + get + { + return (CefSharp.DevTools.Tracing.StreamFormat? )(StringToEnum(typeof(CefSharp.DevTools.Tracing.StreamFormat? ), traceFormat)); + } + + set + { + this.traceFormat = (EnumToString(value)); + } + } + + /// + /// Trace data format of returned stream. + /// + [DataMember(Name = ("traceFormat"), IsRequired = (false))] + internal string traceFormat + { + get; + private set; + } + + /// + /// Compression format of returned stream. + /// + public CefSharp.DevTools.Tracing.StreamCompression? StreamCompression + { + get + { + return (CefSharp.DevTools.Tracing.StreamCompression? )(StringToEnum(typeof(CefSharp.DevTools.Tracing.StreamCompression? ), streamCompression)); + } + + set + { + this.streamCompression = (EnumToString(value)); + } + } + + /// + /// Compression format of returned stream. + /// + [DataMember(Name = ("streamCompression"), IsRequired = (false))] + internal string streamCompression + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.WebAudio +{ + /// + /// Enum of BaseAudioContext types + /// + public enum ContextType + { + /// + /// realtime + /// + [EnumMember(Value = ("realtime"))] + Realtime, + /// + /// offline + /// + [EnumMember(Value = ("offline"))] + Offline + } + + /// + /// Enum of AudioContextState from the spec + /// + public enum ContextState + { + /// + /// suspended + /// + [EnumMember(Value = ("suspended"))] + Suspended, + /// + /// running + /// + [EnumMember(Value = ("running"))] + Running, + /// + /// closed + /// + [EnumMember(Value = ("closed"))] + Closed, + /// + /// interrupted + /// + [EnumMember(Value = ("interrupted"))] + Interrupted + } + + /// + /// Enum of AudioNode::ChannelCountMode from the spec + /// + public enum ChannelCountMode + { + /// + /// clamped-max + /// + [EnumMember(Value = ("clamped-max"))] + ClampedMax, + /// + /// explicit + /// + [EnumMember(Value = ("explicit"))] + Explicit, + /// + /// max + /// + [EnumMember(Value = ("max"))] + Max + } + + /// + /// Enum of AudioNode::ChannelInterpretation from the spec + /// + public enum ChannelInterpretation + { + /// + /// discrete + /// + [EnumMember(Value = ("discrete"))] + Discrete, + /// + /// speakers + /// + [EnumMember(Value = ("speakers"))] + Speakers + } + + /// + /// Enum of AudioParam::AutomationRate from the spec + /// + public enum AutomationRate + { + /// + /// a-rate + /// + [EnumMember(Value = ("a-rate"))] + ARate, + /// + /// k-rate + /// + [EnumMember(Value = ("k-rate"))] + KRate + } + + /// + /// Fields in AudioContext that change in real-time. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ContextRealtimeData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The current context time in second in BaseAudioContext. + /// + [DataMember(Name = ("currentTime"), IsRequired = (true))] + public double CurrentTime + { + get; + set; + } + + /// + /// The time spent on rendering graph divided by render quantum duration, + /// and multiplied by 100. 100 means the audio renderer reached the full + /// capacity and glitch may occur. + /// + [DataMember(Name = ("renderCapacity"), IsRequired = (true))] + public double RenderCapacity + { + get; + set; + } + + /// + /// A running mean of callback interval. + /// + [DataMember(Name = ("callbackIntervalMean"), IsRequired = (true))] + public double CallbackIntervalMean + { + get; + set; + } + + /// + /// A running variance of callback interval. + /// + [DataMember(Name = ("callbackIntervalVariance"), IsRequired = (true))] + public double CallbackIntervalVariance + { + get; + set; + } + } + + /// + /// Protocol object for BaseAudioContext + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BaseAudioContext : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + set; + } + + /// + /// ContextType + /// + public CefSharp.DevTools.WebAudio.ContextType ContextType + { + get + { + return (CefSharp.DevTools.WebAudio.ContextType)(StringToEnum(typeof(CefSharp.DevTools.WebAudio.ContextType), contextType)); + } + + set + { + this.contextType = (EnumToString(value)); + } + } + + /// + /// ContextType + /// + [DataMember(Name = ("contextType"), IsRequired = (true))] + internal string contextType + { + get; + set; + } + + /// + /// ContextState + /// + public CefSharp.DevTools.WebAudio.ContextState ContextState + { + get + { + return (CefSharp.DevTools.WebAudio.ContextState)(StringToEnum(typeof(CefSharp.DevTools.WebAudio.ContextState), contextState)); + } + + set + { + this.contextState = (EnumToString(value)); + } + } + + /// + /// ContextState + /// + [DataMember(Name = ("contextState"), IsRequired = (true))] + internal string contextState + { + get; + set; + } + + /// + /// RealtimeData + /// + [DataMember(Name = ("realtimeData"), IsRequired = (false))] + public CefSharp.DevTools.WebAudio.ContextRealtimeData RealtimeData + { + get; + set; + } + + /// + /// Platform-dependent callback buffer size. + /// + [DataMember(Name = ("callbackBufferSize"), IsRequired = (true))] + public double CallbackBufferSize + { + get; + set; + } + + /// + /// Number of output channels supported by audio hardware in use. + /// + [DataMember(Name = ("maxOutputChannelCount"), IsRequired = (true))] + public double MaxOutputChannelCount + { + get; + set; + } + + /// + /// Context sample rate. + /// + [DataMember(Name = ("sampleRate"), IsRequired = (true))] + public double SampleRate + { + get; + set; + } + } + + /// + /// Protocol object for AudioListener + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AudioListener : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ListenerId + /// + [DataMember(Name = ("listenerId"), IsRequired = (true))] + public string ListenerId + { + get; + set; + } + + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + set; + } + } + + /// + /// Protocol object for AudioNode + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AudioNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// NodeId + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public string NodeId + { + get; + set; + } + + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + set; + } + + /// + /// NodeType + /// + [DataMember(Name = ("nodeType"), IsRequired = (true))] + public string NodeType + { + get; + set; + } + + /// + /// NumberOfInputs + /// + [DataMember(Name = ("numberOfInputs"), IsRequired = (true))] + public double NumberOfInputs + { + get; + set; + } + + /// + /// NumberOfOutputs + /// + [DataMember(Name = ("numberOfOutputs"), IsRequired = (true))] + public double NumberOfOutputs + { + get; + set; + } + + /// + /// ChannelCount + /// + [DataMember(Name = ("channelCount"), IsRequired = (true))] + public double ChannelCount + { + get; + set; + } + + /// + /// ChannelCountMode + /// + public CefSharp.DevTools.WebAudio.ChannelCountMode ChannelCountMode + { + get + { + return (CefSharp.DevTools.WebAudio.ChannelCountMode)(StringToEnum(typeof(CefSharp.DevTools.WebAudio.ChannelCountMode), channelCountMode)); + } + + set + { + this.channelCountMode = (EnumToString(value)); + } + } + + /// + /// ChannelCountMode + /// + [DataMember(Name = ("channelCountMode"), IsRequired = (true))] + internal string channelCountMode + { + get; + set; + } + + /// + /// ChannelInterpretation + /// + public CefSharp.DevTools.WebAudio.ChannelInterpretation ChannelInterpretation + { + get + { + return (CefSharp.DevTools.WebAudio.ChannelInterpretation)(StringToEnum(typeof(CefSharp.DevTools.WebAudio.ChannelInterpretation), channelInterpretation)); + } + + set + { + this.channelInterpretation = (EnumToString(value)); + } + } + + /// + /// ChannelInterpretation + /// + [DataMember(Name = ("channelInterpretation"), IsRequired = (true))] + internal string channelInterpretation + { + get; + set; + } + } + + /// + /// Protocol object for AudioParam + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class AudioParam : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ParamId + /// + [DataMember(Name = ("paramId"), IsRequired = (true))] + public string ParamId + { + get; + set; + } + + /// + /// NodeId + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public string NodeId + { + get; + set; + } + + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + set; + } + + /// + /// ParamType + /// + [DataMember(Name = ("paramType"), IsRequired = (true))] + public string ParamType + { + get; + set; + } + + /// + /// Rate + /// + public CefSharp.DevTools.WebAudio.AutomationRate Rate + { + get + { + return (CefSharp.DevTools.WebAudio.AutomationRate)(StringToEnum(typeof(CefSharp.DevTools.WebAudio.AutomationRate), rate)); + } + + set + { + this.rate = (EnumToString(value)); + } + } + + /// + /// Rate + /// + [DataMember(Name = ("rate"), IsRequired = (true))] + internal string rate + { + get; + set; + } + + /// + /// DefaultValue + /// + [DataMember(Name = ("defaultValue"), IsRequired = (true))] + public double DefaultValue + { + get; + set; + } + + /// + /// MinValue + /// + [DataMember(Name = ("minValue"), IsRequired = (true))] + public double MinValue + { + get; + set; + } + + /// + /// MaxValue + /// + [DataMember(Name = ("maxValue"), IsRequired = (true))] + public double MaxValue + { + get; + set; + } + } + + /// + /// Notifies that a new BaseAudioContext has been created. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ContextCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Context + /// + [DataMember(Name = ("context"), IsRequired = (true))] + public CefSharp.DevTools.WebAudio.BaseAudioContext Context + { + get; + private set; + } + } + + /// + /// Notifies that an existing BaseAudioContext will be destroyed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ContextWillBeDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + private set; + } + } + + /// + /// Notifies that existing BaseAudioContext has changed some properties (id stays the same).. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ContextChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Context + /// + [DataMember(Name = ("context"), IsRequired = (true))] + public CefSharp.DevTools.WebAudio.BaseAudioContext Context + { + get; + private set; + } + } + + /// + /// Notifies that the construction of an AudioListener has finished. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AudioListenerCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Listener + /// + [DataMember(Name = ("listener"), IsRequired = (true))] + public CefSharp.DevTools.WebAudio.AudioListener Listener + { + get; + private set; + } + } + + /// + /// Notifies that a new AudioListener has been created. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AudioListenerWillBeDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + private set; + } + + /// + /// ListenerId + /// + [DataMember(Name = ("listenerId"), IsRequired = (true))] + public string ListenerId + { + get; + private set; + } + } + + /// + /// Notifies that a new AudioNode has been created. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AudioNodeCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Node + /// + [DataMember(Name = ("node"), IsRequired = (true))] + public CefSharp.DevTools.WebAudio.AudioNode Node + { + get; + private set; + } + } + + /// + /// Notifies that an existing AudioNode has been destroyed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AudioNodeWillBeDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + private set; + } + + /// + /// NodeId + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public string NodeId + { + get; + private set; + } + } + + /// + /// Notifies that a new AudioParam has been created. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AudioParamCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Param + /// + [DataMember(Name = ("param"), IsRequired = (true))] + public CefSharp.DevTools.WebAudio.AudioParam Param + { + get; + private set; + } + } + + /// + /// Notifies that an existing AudioParam has been destroyed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AudioParamWillBeDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + private set; + } + + /// + /// NodeId + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public string NodeId + { + get; + private set; + } + + /// + /// ParamId + /// + [DataMember(Name = ("paramId"), IsRequired = (true))] + public string ParamId + { + get; + private set; + } + } + + /// + /// Notifies that two AudioNodes are connected. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class NodesConnectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + private set; + } + + /// + /// SourceId + /// + [DataMember(Name = ("sourceId"), IsRequired = (true))] + public string SourceId + { + get; + private set; + } + + /// + /// DestinationId + /// + [DataMember(Name = ("destinationId"), IsRequired = (true))] + public string DestinationId + { + get; + private set; + } + + /// + /// SourceOutputIndex + /// + [DataMember(Name = ("sourceOutputIndex"), IsRequired = (false))] + public double? SourceOutputIndex + { + get; + private set; + } + + /// + /// DestinationInputIndex + /// + [DataMember(Name = ("destinationInputIndex"), IsRequired = (false))] + public double? DestinationInputIndex + { + get; + private set; + } + } + + /// + /// Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class NodesDisconnectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + private set; + } + + /// + /// SourceId + /// + [DataMember(Name = ("sourceId"), IsRequired = (true))] + public string SourceId + { + get; + private set; + } + + /// + /// DestinationId + /// + [DataMember(Name = ("destinationId"), IsRequired = (true))] + public string DestinationId + { + get; + private set; + } + + /// + /// SourceOutputIndex + /// + [DataMember(Name = ("sourceOutputIndex"), IsRequired = (false))] + public double? SourceOutputIndex + { + get; + private set; + } + + /// + /// DestinationInputIndex + /// + [DataMember(Name = ("destinationInputIndex"), IsRequired = (false))] + public double? DestinationInputIndex + { + get; + private set; + } + } + + /// + /// Notifies that an AudioNode is connected to an AudioParam. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class NodeParamConnectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + private set; + } + + /// + /// SourceId + /// + [DataMember(Name = ("sourceId"), IsRequired = (true))] + public string SourceId + { + get; + private set; + } + + /// + /// DestinationId + /// + [DataMember(Name = ("destinationId"), IsRequired = (true))] + public string DestinationId + { + get; + private set; + } + + /// + /// SourceOutputIndex + /// + [DataMember(Name = ("sourceOutputIndex"), IsRequired = (false))] + public double? SourceOutputIndex + { + get; + private set; + } + } + + /// + /// Notifies that an AudioNode is disconnected to an AudioParam. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class NodeParamDisconnectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [DataMember(Name = ("contextId"), IsRequired = (true))] + public string ContextId + { + get; + private set; + } + + /// + /// SourceId + /// + [DataMember(Name = ("sourceId"), IsRequired = (true))] + public string SourceId + { + get; + private set; + } + + /// + /// DestinationId + /// + [DataMember(Name = ("destinationId"), IsRequired = (true))] + public string DestinationId + { + get; + private set; + } + + /// + /// SourceOutputIndex + /// + [DataMember(Name = ("sourceOutputIndex"), IsRequired = (false))] + public double? SourceOutputIndex + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + /// + /// AuthenticatorProtocol + /// + public enum AuthenticatorProtocol + { + /// + /// u2f + /// + [EnumMember(Value = ("u2f"))] + U2f, + /// + /// ctap2 + /// + [EnumMember(Value = ("ctap2"))] + Ctap2 + } + + /// + /// Ctap2Version + /// + public enum Ctap2Version + { + /// + /// ctap2_0 + /// + [EnumMember(Value = ("ctap2_0"))] + Ctap20, + /// + /// ctap2_1 + /// + [EnumMember(Value = ("ctap2_1"))] + Ctap21 + } + + /// + /// AuthenticatorTransport + /// + public enum AuthenticatorTransport + { + /// + /// usb + /// + [EnumMember(Value = ("usb"))] + Usb, + /// + /// nfc + /// + [EnumMember(Value = ("nfc"))] + Nfc, + /// + /// ble + /// + [EnumMember(Value = ("ble"))] + Ble, + /// + /// cable + /// + [EnumMember(Value = ("cable"))] + Cable, + /// + /// internal + /// + [EnumMember(Value = ("internal"))] + Internal + } + + /// + /// VirtualAuthenticatorOptions + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class VirtualAuthenticatorOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Protocol + /// + public CefSharp.DevTools.WebAuthn.AuthenticatorProtocol Protocol + { + get + { + return (CefSharp.DevTools.WebAuthn.AuthenticatorProtocol)(StringToEnum(typeof(CefSharp.DevTools.WebAuthn.AuthenticatorProtocol), protocol)); + } + + set + { + this.protocol = (EnumToString(value)); + } + } + + /// + /// Protocol + /// + [DataMember(Name = ("protocol"), IsRequired = (true))] + internal string protocol + { + get; + set; + } + + /// + /// Defaults to ctap2_0. Ignored if |protocol| == u2f. + /// + public CefSharp.DevTools.WebAuthn.Ctap2Version? Ctap2Version + { + get + { + return (CefSharp.DevTools.WebAuthn.Ctap2Version? )(StringToEnum(typeof(CefSharp.DevTools.WebAuthn.Ctap2Version? ), ctap2Version)); + } + + set + { + this.ctap2Version = (EnumToString(value)); + } + } + + /// + /// Defaults to ctap2_0. Ignored if |protocol| == u2f. + /// + [DataMember(Name = ("ctap2Version"), IsRequired = (false))] + internal string ctap2Version + { + get; + set; + } + + /// + /// Transport + /// + public CefSharp.DevTools.WebAuthn.AuthenticatorTransport Transport + { + get + { + return (CefSharp.DevTools.WebAuthn.AuthenticatorTransport)(StringToEnum(typeof(CefSharp.DevTools.WebAuthn.AuthenticatorTransport), transport)); + } + + set + { + this.transport = (EnumToString(value)); + } + } + + /// + /// Transport + /// + [DataMember(Name = ("transport"), IsRequired = (true))] + internal string transport + { + get; + set; + } + + /// + /// Defaults to false. + /// + [DataMember(Name = ("hasResidentKey"), IsRequired = (false))] + public bool? HasResidentKey + { + get; + set; + } + + /// + /// Defaults to false. + /// + [DataMember(Name = ("hasUserVerification"), IsRequired = (false))] + public bool? HasUserVerification + { + get; + set; + } + + /// + /// If set to true, the authenticator will support the largeBlob extension. + /// https://w3c.github.io/webauthn#largeBlob + /// Defaults to false. + /// + [DataMember(Name = ("hasLargeBlob"), IsRequired = (false))] + public bool? HasLargeBlob + { + get; + set; + } + + /// + /// If set to true, the authenticator will support the credBlob extension. + /// https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension + /// Defaults to false. + /// + [DataMember(Name = ("hasCredBlob"), IsRequired = (false))] + public bool? HasCredBlob + { + get; + set; + } + + /// + /// If set to true, the authenticator will support the minPinLength extension. + /// https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension + /// Defaults to false. + /// + [DataMember(Name = ("hasMinPinLength"), IsRequired = (false))] + public bool? HasMinPinLength + { + get; + set; + } + + /// + /// If set to true, the authenticator will support the prf extension. + /// https://w3c.github.io/webauthn/#prf-extension + /// Defaults to false. + /// + [DataMember(Name = ("hasPrf"), IsRequired = (false))] + public bool? HasPrf + { + get; + set; + } + + /// + /// If set to true, tests of user presence will succeed immediately. + /// Otherwise, they will not be resolved. Defaults to true. + /// + [DataMember(Name = ("automaticPresenceSimulation"), IsRequired = (false))] + public bool? AutomaticPresenceSimulation + { + get; + set; + } + + /// + /// Sets whether User Verification succeeds or fails for an authenticator. + /// Defaults to false. + /// + [DataMember(Name = ("isUserVerified"), IsRequired = (false))] + public bool? IsUserVerified + { + get; + set; + } + + /// + /// Credentials created by this authenticator will have the backup + /// eligibility (BE) flag set to this value. Defaults to false. + /// https://w3c.github.io/webauthn/#sctn-credential-backup + /// + [DataMember(Name = ("defaultBackupEligibility"), IsRequired = (false))] + public bool? DefaultBackupEligibility + { + get; + set; + } + + /// + /// Credentials created by this authenticator will have the backup state + /// (BS) flag set to this value. Defaults to false. + /// https://w3c.github.io/webauthn/#sctn-credential-backup + /// + [DataMember(Name = ("defaultBackupState"), IsRequired = (false))] + public bool? DefaultBackupState + { + get; + set; + } + } + + /// + /// Credential + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Credential : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CredentialId + /// + [DataMember(Name = ("credentialId"), IsRequired = (true))] + public byte[] CredentialId + { + get; + set; + } + + /// + /// IsResidentCredential + /// + [DataMember(Name = ("isResidentCredential"), IsRequired = (true))] + public bool IsResidentCredential + { + get; + set; + } + + /// + /// Relying Party ID the credential is scoped to. Must be set when adding a + /// credential. + /// + [DataMember(Name = ("rpId"), IsRequired = (false))] + public string RpId + { + get; + set; + } + + /// + /// The ECDSA P-256 private key in PKCS#8 format. + /// + [DataMember(Name = ("privateKey"), IsRequired = (true))] + public byte[] PrivateKey + { + get; + set; + } + + /// + /// An opaque byte sequence with a maximum size of 64 bytes mapping the + /// credential to a specific user. + /// + [DataMember(Name = ("userHandle"), IsRequired = (false))] + public byte[] UserHandle + { + get; + set; + } + + /// + /// Signature counter. This is incremented by one for each successful + /// assertion. + /// See https://w3c.github.io/webauthn/#signature-counter + /// + [DataMember(Name = ("signCount"), IsRequired = (true))] + public int SignCount + { + get; + set; + } + + /// + /// The large blob associated with the credential. + /// See https://w3c.github.io/webauthn/#sctn-large-blob-extension + /// + [DataMember(Name = ("largeBlob"), IsRequired = (false))] + public byte[] LargeBlob + { + get; + set; + } + + /// + /// Assertions returned by this credential will have the backup eligibility + /// (BE) flag set to this value. Defaults to the authenticator's + /// defaultBackupEligibility value. + /// + [DataMember(Name = ("backupEligibility"), IsRequired = (false))] + public bool? BackupEligibility + { + get; + set; + } + + /// + /// Assertions returned by this credential will have the backup state (BS) + /// flag set to this value. Defaults to the authenticator's + /// defaultBackupState value. + /// + [DataMember(Name = ("backupState"), IsRequired = (false))] + public bool? BackupState + { + get; + set; + } + + /// + /// The credential's user.name property. Equivalent to empty if not set. + /// https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name + /// + [DataMember(Name = ("userName"), IsRequired = (false))] + public string UserName + { + get; + set; + } + + /// + /// The credential's user.displayName property. Equivalent to empty if + /// not set. + /// https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname + /// + [DataMember(Name = ("userDisplayName"), IsRequired = (false))] + public string UserDisplayName + { + get; + set; + } + } + + /// + /// Triggered when a credential is added to an authenticator. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CredentialAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AuthenticatorId + /// + [DataMember(Name = ("authenticatorId"), IsRequired = (true))] + public string AuthenticatorId + { + get; + private set; + } + + /// + /// Credential + /// + [DataMember(Name = ("credential"), IsRequired = (true))] + public CefSharp.DevTools.WebAuthn.Credential Credential + { + get; + private set; + } + } + + /// + /// Triggered when a credential is deleted, e.g. through + /// PublicKeyCredential.signalUnknownCredential(). + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CredentialDeletedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AuthenticatorId + /// + [DataMember(Name = ("authenticatorId"), IsRequired = (true))] + public string AuthenticatorId + { + get; + private set; + } + + /// + /// CredentialId + /// + [DataMember(Name = ("credentialId"), IsRequired = (true))] + public byte[] CredentialId + { + get; + private set; + } + } + + /// + /// Triggered when a credential is updated, e.g. through + /// PublicKeyCredential.signalCurrentUserDetails(). + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CredentialUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AuthenticatorId + /// + [DataMember(Name = ("authenticatorId"), IsRequired = (true))] + public string AuthenticatorId + { + get; + private set; + } + + /// + /// Credential + /// + [DataMember(Name = ("credential"), IsRequired = (true))] + public CefSharp.DevTools.WebAuthn.Credential Credential + { + get; + private set; + } + } + + /// + /// Triggered when a credential is used in a webauthn assertion. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class CredentialAssertedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AuthenticatorId + /// + [DataMember(Name = ("authenticatorId"), IsRequired = (true))] + public string AuthenticatorId + { + get; + private set; + } + + /// + /// Credential + /// + [DataMember(Name = ("credential"), IsRequired = (true))] + public CefSharp.DevTools.WebAuthn.Credential Credential + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// Location in the source code. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Location : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Script identifier as reported in the `Debugger.scriptParsed`. + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + set; + } + + /// + /// Line number in the script (0-based). + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// Column number in the script (0-based). + /// + [DataMember(Name = ("columnNumber"), IsRequired = (false))] + public int? ColumnNumber + { + get; + set; + } + } + + /// + /// Location in the source code. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScriptPosition : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// LineNumber + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// ColumnNumber + /// + [DataMember(Name = ("columnNumber"), IsRequired = (true))] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// Location range within one script. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class LocationRange : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ScriptId + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + set; + } + + /// + /// Start + /// + [DataMember(Name = ("start"), IsRequired = (true))] + public CefSharp.DevTools.Debugger.ScriptPosition Start + { + get; + set; + } + + /// + /// End + /// + [DataMember(Name = ("end"), IsRequired = (true))] + public CefSharp.DevTools.Debugger.ScriptPosition End + { + get; + set; + } + } + + /// + /// JavaScript call frame. Array of call frames form the call stack. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CallFrame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Call frame identifier. This identifier is only valid while the virtual machine is paused. + /// + [DataMember(Name = ("callFrameId"), IsRequired = (true))] + public string CallFrameId + { + get; + set; + } + + /// + /// Name of the JavaScript function called on this call frame. + /// + [DataMember(Name = ("functionName"), IsRequired = (true))] + public string FunctionName + { + get; + set; + } + + /// + /// Location in the source code. + /// + [DataMember(Name = ("functionLocation"), IsRequired = (false))] + public CefSharp.DevTools.Debugger.Location FunctionLocation + { + get; + set; + } + + /// + /// Location in the source code. + /// + [DataMember(Name = ("location"), IsRequired = (true))] + public CefSharp.DevTools.Debugger.Location Location + { + get; + set; + } + + /// + /// JavaScript script name or url. + /// Deprecated in favor of using the `location.scriptId` to resolve the URL via a previously + /// sent `Debugger.scriptParsed` event. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Scope chain for this call frame. + /// + [DataMember(Name = ("scopeChain"), IsRequired = (true))] + public System.Collections.Generic.IList ScopeChain + { + get; + set; + } + + /// + /// `this` object for this call frame. + /// + [DataMember(Name = ("this"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.RemoteObject This + { + get; + set; + } + + /// + /// The value being returned, if the function is at return point. + /// + [DataMember(Name = ("returnValue"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject ReturnValue + { + get; + set; + } + + /// + /// Valid only while the VM is paused and indicates whether this frame + /// can be restarted or not. Note that a `true` value here does not + /// guarantee that Debugger#restartFrame with this CallFrameId will be + /// successful, but it is very likely. + /// + [DataMember(Name = ("canBeRestarted"), IsRequired = (false))] + public bool? CanBeRestarted + { + get; + set; + } + } + + /// + /// Scope type. + /// + public enum ScopeType + { + /// + /// global + /// + [EnumMember(Value = ("global"))] + Global, + /// + /// local + /// + [EnumMember(Value = ("local"))] + Local, + /// + /// with + /// + [EnumMember(Value = ("with"))] + With, + /// + /// closure + /// + [EnumMember(Value = ("closure"))] + Closure, + /// + /// catch + /// + [EnumMember(Value = ("catch"))] + Catch, + /// + /// block + /// + [EnumMember(Value = ("block"))] + Block, + /// + /// script + /// + [EnumMember(Value = ("script"))] + Script, + /// + /// eval + /// + [EnumMember(Value = ("eval"))] + Eval, + /// + /// module + /// + [EnumMember(Value = ("module"))] + Module, + /// + /// wasm-expression-stack + /// + [EnumMember(Value = ("wasm-expression-stack"))] + WasmExpressionStack + } + + /// + /// Scope description. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Scope : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Scope type. + /// + public CefSharp.DevTools.Debugger.ScopeType Type + { + get + { + return (CefSharp.DevTools.Debugger.ScopeType)(StringToEnum(typeof(CefSharp.DevTools.Debugger.ScopeType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Scope type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Object representing the scope. For `global` and `with` scopes it represents the actual + /// object; for the rest of the scopes, it is artificial transient object enumerating scope + /// variables as its properties. + /// + [DataMember(Name = ("object"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.RemoteObject Object + { + get; + set; + } + + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (false))] + public string Name + { + get; + set; + } + + /// + /// Location in the source code where scope starts + /// + [DataMember(Name = ("startLocation"), IsRequired = (false))] + public CefSharp.DevTools.Debugger.Location StartLocation + { + get; + set; + } + + /// + /// Location in the source code where scope ends + /// + [DataMember(Name = ("endLocation"), IsRequired = (false))] + public CefSharp.DevTools.Debugger.Location EndLocation + { + get; + set; + } + } + + /// + /// Search match for resource. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SearchMatch : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Line number in resource content. + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public double LineNumber + { + get; + set; + } + + /// + /// Line with match content. + /// + [DataMember(Name = ("lineContent"), IsRequired = (true))] + public string LineContent + { + get; + set; + } + } + + /// + /// BreakLocationType + /// + public enum BreakLocationType + { + /// + /// debuggerStatement + /// + [EnumMember(Value = ("debuggerStatement"))] + DebuggerStatement, + /// + /// call + /// + [EnumMember(Value = ("call"))] + Call, + /// + /// return + /// + [EnumMember(Value = ("return"))] + Return + } + + /// + /// BreakLocation + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class BreakLocation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Script identifier as reported in the `Debugger.scriptParsed`. + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + set; + } + + /// + /// Line number in the script (0-based). + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// Column number in the script (0-based). + /// + [DataMember(Name = ("columnNumber"), IsRequired = (false))] + public int? ColumnNumber + { + get; + set; + } + + /// + /// Type + /// + public CefSharp.DevTools.Debugger.BreakLocationType? Type + { + get + { + return (CefSharp.DevTools.Debugger.BreakLocationType? )(StringToEnum(typeof(CefSharp.DevTools.Debugger.BreakLocationType? ), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (false))] + internal string type + { + get; + set; + } + } + + /// + /// WasmDisassemblyChunk + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class WasmDisassemblyChunk : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The next chunk of disassembled lines. + /// + [DataMember(Name = ("lines"), IsRequired = (true))] + public string[] Lines + { + get; + set; + } + + /// + /// The bytecode offsets describing the start of each line. + /// + [DataMember(Name = ("bytecodeOffsets"), IsRequired = (true))] + public int[] BytecodeOffsets + { + get; + set; + } + } + + /// + /// Enum of possible script languages. + /// + public enum ScriptLanguage + { + /// + /// JavaScript + /// + [EnumMember(Value = ("JavaScript"))] + JavaScript, + /// + /// WebAssembly + /// + [EnumMember(Value = ("WebAssembly"))] + WebAssembly + } + + /// + /// Type of the debug symbols. + /// + public enum DebugSymbolsType + { + /// + /// SourceMap + /// + [EnumMember(Value = ("SourceMap"))] + SourceMap, + /// + /// EmbeddedDWARF + /// + [EnumMember(Value = ("EmbeddedDWARF"))] + EmbeddedDWARF, + /// + /// ExternalDWARF + /// + [EnumMember(Value = ("ExternalDWARF"))] + ExternalDWARF + } + + /// + /// Debug symbols available for a wasm script. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DebugSymbols : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type of the debug symbols. + /// + public CefSharp.DevTools.Debugger.DebugSymbolsType Type + { + get + { + return (CefSharp.DevTools.Debugger.DebugSymbolsType)(StringToEnum(typeof(CefSharp.DevTools.Debugger.DebugSymbolsType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type of the debug symbols. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// URL of the external symbol source. + /// + [DataMember(Name = ("externalURL"), IsRequired = (false))] + public string ExternalURL + { + get; + set; + } + } + + /// + /// ResolvedBreakpoint + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ResolvedBreakpoint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Breakpoint unique identifier. + /// + [DataMember(Name = ("breakpointId"), IsRequired = (true))] + public string BreakpointId + { + get; + set; + } + + /// + /// Actual breakpoint location. + /// + [DataMember(Name = ("location"), IsRequired = (true))] + public CefSharp.DevTools.Debugger.Location Location + { + get; + set; + } + } + + /// + /// Fired when breakpoint is resolved to an actual script and location. + /// Deprecated in favor of `resolvedBreakpoints` in the `scriptParsed` event. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class BreakpointResolvedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Breakpoint unique identifier. + /// + [DataMember(Name = ("breakpointId"), IsRequired = (true))] + public string BreakpointId + { + get; + private set; + } + + /// + /// Actual breakpoint location. + /// + [DataMember(Name = ("location"), IsRequired = (true))] + public CefSharp.DevTools.Debugger.Location Location + { + get; + private set; + } + } + + /// + /// Pause reason. + /// + public enum PausedReason + { + /// + /// ambiguous + /// + [EnumMember(Value = ("ambiguous"))] + Ambiguous, + /// + /// assert + /// + [EnumMember(Value = ("assert"))] + Assert, + /// + /// CSPViolation + /// + [EnumMember(Value = ("CSPViolation"))] + CSPViolation, + /// + /// debugCommand + /// + [EnumMember(Value = ("debugCommand"))] + DebugCommand, + /// + /// DOM + /// + [EnumMember(Value = ("DOM"))] + DOM, + /// + /// EventListener + /// + [EnumMember(Value = ("EventListener"))] + EventListener, + /// + /// exception + /// + [EnumMember(Value = ("exception"))] + Exception, + /// + /// instrumentation + /// + [EnumMember(Value = ("instrumentation"))] + Instrumentation, + /// + /// OOM + /// + [EnumMember(Value = ("OOM"))] + OOM, + /// + /// other + /// + [EnumMember(Value = ("other"))] + Other, + /// + /// promiseRejection + /// + [EnumMember(Value = ("promiseRejection"))] + PromiseRejection, + /// + /// XHR + /// + [EnumMember(Value = ("XHR"))] + XHR, + /// + /// step + /// + [EnumMember(Value = ("step"))] + Step + } + + /// + /// Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PausedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Call stack the virtual machine stopped on. + /// + [DataMember(Name = ("callFrames"), IsRequired = (true))] + public System.Collections.Generic.IList CallFrames + { + get; + private set; + } + + /// + /// Pause reason. + /// + public CefSharp.DevTools.Debugger.PausedReason Reason + { + get + { + return (CefSharp.DevTools.Debugger.PausedReason)(StringToEnum(typeof(CefSharp.DevTools.Debugger.PausedReason), reason)); + } + + set + { + this.reason = (EnumToString(value)); + } + } + + /// + /// Pause reason. + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + internal string reason + { + get; + private set; + } + + /// + /// Object containing break-specific auxiliary properties. + /// + [DataMember(Name = ("data"), IsRequired = (false))] + public object Data + { + get; + private set; + } + + /// + /// Hit breakpoints IDs + /// + [DataMember(Name = ("hitBreakpoints"), IsRequired = (false))] + public string[] HitBreakpoints + { + get; + private set; + } + + /// + /// Async stack trace, if any. + /// + [DataMember(Name = ("asyncStackTrace"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace AsyncStackTrace + { + get; + private set; + } + + /// + /// Async stack trace, if any. + /// + [DataMember(Name = ("asyncStackTraceId"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTraceId AsyncStackTraceId + { + get; + private set; + } + + /// + /// Never present, will be removed. + /// + [DataMember(Name = ("asyncCallStackTraceId"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTraceId AsyncCallStackTraceId + { + get; + private set; + } + } + + /// + /// Fired when virtual machine fails to parse the script. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ScriptFailedToParseEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier of the script parsed. + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + private set; + } + + /// + /// URL or name of the script parsed (if any). + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Line offset of the script within the resource with given URL (for script tags). + /// + [DataMember(Name = ("startLine"), IsRequired = (true))] + public int StartLine + { + get; + private set; + } + + /// + /// Column offset of the script within the resource with given URL. + /// + [DataMember(Name = ("startColumn"), IsRequired = (true))] + public int StartColumn + { + get; + private set; + } + + /// + /// Last line of the script. + /// + [DataMember(Name = ("endLine"), IsRequired = (true))] + public int EndLine + { + get; + private set; + } + + /// + /// Length of the last line of the script. + /// + [DataMember(Name = ("endColumn"), IsRequired = (true))] + public int EndColumn + { + get; + private set; + } + + /// + /// Specifies script creation context. + /// + [DataMember(Name = ("executionContextId"), IsRequired = (true))] + public int ExecutionContextId + { + get; + private set; + } + + /// + /// Content hash of the script, SHA-256. + /// + [DataMember(Name = ("hash"), IsRequired = (true))] + public string Hash + { + get; + private set; + } + + /// + /// For Wasm modules, the content of the `build_id` custom section. For JavaScript the `debugId` magic comment. + /// + [DataMember(Name = ("buildId"), IsRequired = (true))] + public string BuildId + { + get; + private set; + } + + /// + /// Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string} + /// + [DataMember(Name = ("executionContextAuxData"), IsRequired = (false))] + public object ExecutionContextAuxData + { + get; + private set; + } + + /// + /// URL of source map associated with script (if any). + /// + [DataMember(Name = ("sourceMapURL"), IsRequired = (false))] + public string SourceMapURL + { + get; + private set; + } + + /// + /// True, if this script has sourceURL. + /// + [DataMember(Name = ("hasSourceURL"), IsRequired = (false))] + public bool? HasSourceURL + { + get; + private set; + } + + /// + /// True, if this script is ES6 module. + /// + [DataMember(Name = ("isModule"), IsRequired = (false))] + public bool? IsModule + { + get; + private set; + } + + /// + /// This script length. + /// + [DataMember(Name = ("length"), IsRequired = (false))] + public int? Length + { + get; + private set; + } + + /// + /// JavaScript top stack frame of where the script parsed event was triggered if available. + /// + [DataMember(Name = ("stackTrace"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + private set; + } + + /// + /// If the scriptLanguage is WebAssembly, the code section offset in the module. + /// + [DataMember(Name = ("codeOffset"), IsRequired = (false))] + public int? CodeOffset + { + get; + private set; + } + + /// + /// The language of the script. + /// + public CefSharp.DevTools.Debugger.ScriptLanguage? ScriptLanguage + { + get + { + return (CefSharp.DevTools.Debugger.ScriptLanguage? )(StringToEnum(typeof(CefSharp.DevTools.Debugger.ScriptLanguage? ), scriptLanguage)); + } + + set + { + this.scriptLanguage = (EnumToString(value)); + } + } + + /// + /// The language of the script. + /// + [DataMember(Name = ("scriptLanguage"), IsRequired = (false))] + internal string scriptLanguage + { + get; + private set; + } + + /// + /// The name the embedder supplied for this script. + /// + [DataMember(Name = ("embedderName"), IsRequired = (false))] + public string EmbedderName + { + get; + private set; + } + } + + /// + /// Fired when virtual machine parses script. This event is also fired for all known and uncollected + /// scripts upon enabling debugger. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ScriptParsedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier of the script parsed. + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + private set; + } + + /// + /// URL or name of the script parsed (if any). + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + private set; + } + + /// + /// Line offset of the script within the resource with given URL (for script tags). + /// + [DataMember(Name = ("startLine"), IsRequired = (true))] + public int StartLine + { + get; + private set; + } + + /// + /// Column offset of the script within the resource with given URL. + /// + [DataMember(Name = ("startColumn"), IsRequired = (true))] + public int StartColumn + { + get; + private set; + } + + /// + /// Last line of the script. + /// + [DataMember(Name = ("endLine"), IsRequired = (true))] + public int EndLine + { + get; + private set; + } + + /// + /// Length of the last line of the script. + /// + [DataMember(Name = ("endColumn"), IsRequired = (true))] + public int EndColumn + { + get; + private set; + } + + /// + /// Specifies script creation context. + /// + [DataMember(Name = ("executionContextId"), IsRequired = (true))] + public int ExecutionContextId + { + get; + private set; + } + + /// + /// Content hash of the script, SHA-256. + /// + [DataMember(Name = ("hash"), IsRequired = (true))] + public string Hash + { + get; + private set; + } + + /// + /// For Wasm modules, the content of the `build_id` custom section. For JavaScript the `debugId` magic comment. + /// + [DataMember(Name = ("buildId"), IsRequired = (true))] + public string BuildId + { + get; + private set; + } + + /// + /// Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string} + /// + [DataMember(Name = ("executionContextAuxData"), IsRequired = (false))] + public object ExecutionContextAuxData + { + get; + private set; + } + + /// + /// True, if this script is generated as a result of the live edit operation. + /// + [DataMember(Name = ("isLiveEdit"), IsRequired = (false))] + public bool? IsLiveEdit + { + get; + private set; + } + + /// + /// URL of source map associated with script (if any). + /// + [DataMember(Name = ("sourceMapURL"), IsRequired = (false))] + public string SourceMapURL + { + get; + private set; + } + + /// + /// True, if this script has sourceURL. + /// + [DataMember(Name = ("hasSourceURL"), IsRequired = (false))] + public bool? HasSourceURL + { + get; + private set; + } + + /// + /// True, if this script is ES6 module. + /// + [DataMember(Name = ("isModule"), IsRequired = (false))] + public bool? IsModule + { + get; + private set; + } + + /// + /// This script length. + /// + [DataMember(Name = ("length"), IsRequired = (false))] + public int? Length + { + get; + private set; + } + + /// + /// JavaScript top stack frame of where the script parsed event was triggered if available. + /// + [DataMember(Name = ("stackTrace"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + private set; + } + + /// + /// If the scriptLanguage is WebAssembly, the code section offset in the module. + /// + [DataMember(Name = ("codeOffset"), IsRequired = (false))] + public int? CodeOffset + { + get; + private set; + } + + /// + /// The language of the script. + /// + public CefSharp.DevTools.Debugger.ScriptLanguage? ScriptLanguage + { + get + { + return (CefSharp.DevTools.Debugger.ScriptLanguage? )(StringToEnum(typeof(CefSharp.DevTools.Debugger.ScriptLanguage? ), scriptLanguage)); + } + + set + { + this.scriptLanguage = (EnumToString(value)); + } + } + + /// + /// The language of the script. + /// + [DataMember(Name = ("scriptLanguage"), IsRequired = (false))] + internal string scriptLanguage + { + get; + private set; + } + + /// + /// If the scriptLanguage is WebAssembly, the source of debug symbols for the module. + /// + [DataMember(Name = ("debugSymbols"), IsRequired = (false))] + public System.Collections.Generic.IList DebugSymbols + { + get; + private set; + } + + /// + /// The name the embedder supplied for this script. + /// + [DataMember(Name = ("embedderName"), IsRequired = (false))] + public string EmbedderName + { + get; + private set; + } + + /// + /// The list of set breakpoints in this script if calls to `setBreakpointByUrl` + /// matches this script's URL or hash. Clients that use this list can ignore the + /// `breakpointResolved` event. They are equivalent. + /// + [DataMember(Name = ("resolvedBreakpoints"), IsRequired = (false))] + public System.Collections.Generic.IList ResolvedBreakpoints + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SamplingHeapProfileNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Function location. + /// + [DataMember(Name = ("callFrame"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.CallFrame CallFrame + { + get; + set; + } + + /// + /// Allocations size in bytes for the node excluding children. + /// + [DataMember(Name = ("selfSize"), IsRequired = (true))] + public double SelfSize + { + get; + set; + } + + /// + /// Node id. Ids are unique across all profiles collected between startSampling and stopSampling. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public int Id + { + get; + set; + } + + /// + /// Child nodes. + /// + [DataMember(Name = ("children"), IsRequired = (true))] + public System.Collections.Generic.IList Children + { + get; + set; + } + } + + /// + /// A single sample from a sampling profile. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SamplingHeapProfileSample : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Allocation size in bytes attributed to the sample. + /// + [DataMember(Name = ("size"), IsRequired = (true))] + public double Size + { + get; + set; + } + + /// + /// Id of the corresponding profile tree node. + /// + [DataMember(Name = ("nodeId"), IsRequired = (true))] + public int NodeId + { + get; + set; + } + + /// + /// Time-ordered sample ordinal number. It is unique across all profiles retrieved + /// between startSampling and stopSampling. + /// + [DataMember(Name = ("ordinal"), IsRequired = (true))] + public double Ordinal + { + get; + set; + } + } + + /// + /// Sampling profile. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SamplingHeapProfile : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Head + /// + [DataMember(Name = ("head"), IsRequired = (true))] + public CefSharp.DevTools.HeapProfiler.SamplingHeapProfileNode Head + { + get; + set; + } + + /// + /// Samples + /// + [DataMember(Name = ("samples"), IsRequired = (true))] + public System.Collections.Generic.IList Samples + { + get; + set; + } + } + + /// + /// addHeapSnapshotChunk + /// + [System.Runtime.Serialization.DataContractAttribute] + public class AddHeapSnapshotChunkEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Chunk + /// + [DataMember(Name = ("chunk"), IsRequired = (true))] + public string Chunk + { + get; + private set; + } + } + + /// + /// If heap objects tracking has been started then backend may send update for one or more fragments + /// + [System.Runtime.Serialization.DataContractAttribute] + public class HeapStatsUpdateEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// An array of triplets. Each triplet describes a fragment. The first integer is the fragment + /// index, the second integer is a total count of objects for the fragment, the third integer is + /// a total size of the objects for the fragment. + /// + [DataMember(Name = ("statsUpdate"), IsRequired = (true))] + public int[] StatsUpdate + { + get; + private set; + } + } + + /// + /// If heap objects tracking has been started then backend regularly sends a current value for last + /// seen object id and corresponding timestamp. If the were changes in the heap since last event + /// then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class LastSeenObjectIdEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// LastSeenObjectId + /// + [DataMember(Name = ("lastSeenObjectId"), IsRequired = (true))] + public int LastSeenObjectId + { + get; + private set; + } + + /// + /// Timestamp + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + } + + /// + /// reportHeapSnapshotProgress + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ReportHeapSnapshotProgressEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Done + /// + [DataMember(Name = ("done"), IsRequired = (true))] + public int Done + { + get; + private set; + } + + /// + /// Total + /// + [DataMember(Name = ("total"), IsRequired = (true))] + public int Total + { + get; + private set; + } + + /// + /// Finished + /// + [DataMember(Name = ("finished"), IsRequired = (false))] + public bool? Finished + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// Profile node. Holds callsite information, execution statistics and child nodes. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ProfileNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unique id of the node. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public int Id + { + get; + set; + } + + /// + /// Function location. + /// + [DataMember(Name = ("callFrame"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.CallFrame CallFrame + { + get; + set; + } + + /// + /// Number of samples where this node was on top of the call stack. + /// + [DataMember(Name = ("hitCount"), IsRequired = (false))] + public int? HitCount + { + get; + set; + } + + /// + /// Child node ids. + /// + [DataMember(Name = ("children"), IsRequired = (false))] + public int[] Children + { + get; + set; + } + + /// + /// The reason of being not optimized. The function may be deoptimized or marked as don't + /// optimize. + /// + [DataMember(Name = ("deoptReason"), IsRequired = (false))] + public string DeoptReason + { + get; + set; + } + + /// + /// An array of source position ticks. + /// + [DataMember(Name = ("positionTicks"), IsRequired = (false))] + public System.Collections.Generic.IList PositionTicks + { + get; + set; + } + } + + /// + /// Profile. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class Profile : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The list of profile nodes. First item is the root node. + /// + [DataMember(Name = ("nodes"), IsRequired = (true))] + public System.Collections.Generic.IList Nodes + { + get; + set; + } + + /// + /// Profiling start timestamp in microseconds. + /// + [DataMember(Name = ("startTime"), IsRequired = (true))] + public double StartTime + { + get; + set; + } + + /// + /// Profiling end timestamp in microseconds. + /// + [DataMember(Name = ("endTime"), IsRequired = (true))] + public double EndTime + { + get; + set; + } + + /// + /// Ids of samples top nodes. + /// + [DataMember(Name = ("samples"), IsRequired = (false))] + public int[] Samples + { + get; + set; + } + + /// + /// Time intervals between adjacent samples in microseconds. The first delta is relative to the + /// profile startTime. + /// + [DataMember(Name = ("timeDeltas"), IsRequired = (false))] + public int[] TimeDeltas + { + get; + set; + } + } + + /// + /// Specifies a number of samples attributed to a certain source position. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PositionTickInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source line number (1-based). + /// + [DataMember(Name = ("line"), IsRequired = (true))] + public int Line + { + get; + set; + } + + /// + /// Number of samples attributed to the source line. + /// + [DataMember(Name = ("ticks"), IsRequired = (true))] + public int Ticks + { + get; + set; + } + } + + /// + /// Coverage data for a source range. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CoverageRange : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// JavaScript script source offset for the range start. + /// + [DataMember(Name = ("startOffset"), IsRequired = (true))] + public int StartOffset + { + get; + set; + } + + /// + /// JavaScript script source offset for the range end. + /// + [DataMember(Name = ("endOffset"), IsRequired = (true))] + public int EndOffset + { + get; + set; + } + + /// + /// Collected execution count of the source range. + /// + [DataMember(Name = ("count"), IsRequired = (true))] + public int Count + { + get; + set; + } + } + + /// + /// Coverage data for a JavaScript function. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class FunctionCoverage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// JavaScript function name. + /// + [DataMember(Name = ("functionName"), IsRequired = (true))] + public string FunctionName + { + get; + set; + } + + /// + /// Source ranges inside the function with coverage data. + /// + [DataMember(Name = ("ranges"), IsRequired = (true))] + public System.Collections.Generic.IList Ranges + { + get; + set; + } + + /// + /// Whether coverage data for this function has block granularity. + /// + [DataMember(Name = ("isBlockCoverage"), IsRequired = (true))] + public bool IsBlockCoverage + { + get; + set; + } + } + + /// + /// Coverage data for a JavaScript script. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ScriptCoverage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// JavaScript script id. + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + set; + } + + /// + /// JavaScript script name or url. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// Functions contained in the script that has coverage data. + /// + [DataMember(Name = ("functions"), IsRequired = (true))] + public System.Collections.Generic.IList Functions + { + get; + set; + } + } + + /// + /// consoleProfileFinished + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ConsoleProfileFinishedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + private set; + } + + /// + /// Location of console.profileEnd(). + /// + [DataMember(Name = ("location"), IsRequired = (true))] + public CefSharp.DevTools.Debugger.Location Location + { + get; + private set; + } + + /// + /// Profile + /// + [DataMember(Name = ("profile"), IsRequired = (true))] + public CefSharp.DevTools.Profiler.Profile Profile + { + get; + private set; + } + + /// + /// Profile title passed as an argument to console.profile(). + /// + [DataMember(Name = ("title"), IsRequired = (false))] + public string Title + { + get; + private set; + } + } + + /// + /// Sent when new profile recording is started using console.profile() call. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ConsoleProfileStartedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + private set; + } + + /// + /// Location of console.profile(). + /// + [DataMember(Name = ("location"), IsRequired = (true))] + public CefSharp.DevTools.Debugger.Location Location + { + get; + private set; + } + + /// + /// Profile title passed as an argument to console.profile(). + /// + [DataMember(Name = ("title"), IsRequired = (false))] + public string Title + { + get; + private set; + } + } + + /// + /// Reports coverage delta since the last poll (either from an event like this, or from + /// `takePreciseCoverage` for the current isolate. May only be sent if precise code + /// coverage has been started. This event can be trigged by the embedder to, for example, + /// trigger collection of coverage data immediately at a certain point in time. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class PreciseCoverageDeltaUpdateEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Identifier for distinguishing coverage events. + /// + [DataMember(Name = ("occasion"), IsRequired = (true))] + public string Occasion + { + get; + private set; + } + + /// + /// Coverage data for the current isolate. + /// + [DataMember(Name = ("result"), IsRequired = (true))] + public System.Collections.Generic.IList Result + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// SerializationOptionsSerialization + /// + public enum SerializationOptionsSerialization + { + /// + /// deep + /// + [EnumMember(Value = ("deep"))] + Deep, + /// + /// json + /// + [EnumMember(Value = ("json"))] + Json, + /// + /// idOnly + /// + [EnumMember(Value = ("idOnly"))] + IdOnly + } + + /// + /// Represents options for serialization. Overrides `generatePreview` and `returnByValue`. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class SerializationOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Serialization + /// + public CefSharp.DevTools.Runtime.SerializationOptionsSerialization Serialization + { + get + { + return (CefSharp.DevTools.Runtime.SerializationOptionsSerialization)(StringToEnum(typeof(CefSharp.DevTools.Runtime.SerializationOptionsSerialization), serialization)); + } + + set + { + this.serialization = (EnumToString(value)); + } + } + + /// + /// Serialization + /// + [DataMember(Name = ("serialization"), IsRequired = (true))] + internal string serialization + { + get; + set; + } + + /// + /// Deep serialization depth. Default is full depth. Respected only in `deep` serialization mode. + /// + [DataMember(Name = ("maxDepth"), IsRequired = (false))] + public int? MaxDepth + { + get; + set; + } + + /// + /// Embedder-specific parameters. For example if connected to V8 in Chrome these control DOM + /// serialization via `maxNodeDepth: integer` and `includeShadowTree: "none" | "open" | "all"`. + /// Values can be only of type string or integer. + /// + [DataMember(Name = ("additionalParameters"), IsRequired = (false))] + public object AdditionalParameters + { + get; + set; + } + } + + /// + /// DeepSerializedValueType + /// + public enum DeepSerializedValueType + { + /// + /// undefined + /// + [EnumMember(Value = ("undefined"))] + Undefined, + /// + /// null + /// + [EnumMember(Value = ("null"))] + Null, + /// + /// string + /// + [EnumMember(Value = ("string"))] + String, + /// + /// number + /// + [EnumMember(Value = ("number"))] + Number, + /// + /// boolean + /// + [EnumMember(Value = ("boolean"))] + Boolean, + /// + /// bigint + /// + [EnumMember(Value = ("bigint"))] + Bigint, + /// + /// regexp + /// + [EnumMember(Value = ("regexp"))] + Regexp, + /// + /// date + /// + [EnumMember(Value = ("date"))] + Date, + /// + /// symbol + /// + [EnumMember(Value = ("symbol"))] + Symbol, + /// + /// array + /// + [EnumMember(Value = ("array"))] + Array, + /// + /// object + /// + [EnumMember(Value = ("object"))] + Object, + /// + /// function + /// + [EnumMember(Value = ("function"))] + Function, + /// + /// map + /// + [EnumMember(Value = ("map"))] + Map, + /// + /// set + /// + [EnumMember(Value = ("set"))] + Set, + /// + /// weakmap + /// + [EnumMember(Value = ("weakmap"))] + Weakmap, + /// + /// weakset + /// + [EnumMember(Value = ("weakset"))] + Weakset, + /// + /// error + /// + [EnumMember(Value = ("error"))] + Error, + /// + /// proxy + /// + [EnumMember(Value = ("proxy"))] + Proxy, + /// + /// promise + /// + [EnumMember(Value = ("promise"))] + Promise, + /// + /// typedarray + /// + [EnumMember(Value = ("typedarray"))] + Typedarray, + /// + /// arraybuffer + /// + [EnumMember(Value = ("arraybuffer"))] + Arraybuffer, + /// + /// node + /// + [EnumMember(Value = ("node"))] + Node, + /// + /// window + /// + [EnumMember(Value = ("window"))] + Window, + /// + /// generator + /// + [EnumMember(Value = ("generator"))] + Generator + } + + /// + /// Represents deep serialized value. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class DeepSerializedValue : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type + /// + public CefSharp.DevTools.Runtime.DeepSerializedValueType Type + { + get + { + return (CefSharp.DevTools.Runtime.DeepSerializedValueType)(StringToEnum(typeof(CefSharp.DevTools.Runtime.DeepSerializedValueType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Value + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public object Value + { + get; + set; + } + + /// + /// ObjectId + /// + [DataMember(Name = ("objectId"), IsRequired = (false))] + public string ObjectId + { + get; + set; + } + + /// + /// Set if value reference met more then once during serialization. In such + /// case, value is provided only to one of the serialized values. Unique + /// per value in the scope of one CDP call. + /// + [DataMember(Name = ("weakLocalObjectReference"), IsRequired = (false))] + public int? WeakLocalObjectReference + { + get; + set; + } + } + + /// + /// Object type. + /// + public enum RemoteObjectType + { + /// + /// object + /// + [EnumMember(Value = ("object"))] + Object, + /// + /// function + /// + [EnumMember(Value = ("function"))] + Function, + /// + /// undefined + /// + [EnumMember(Value = ("undefined"))] + Undefined, + /// + /// string + /// + [EnumMember(Value = ("string"))] + String, + /// + /// number + /// + [EnumMember(Value = ("number"))] + Number, + /// + /// boolean + /// + [EnumMember(Value = ("boolean"))] + Boolean, + /// + /// symbol + /// + [EnumMember(Value = ("symbol"))] + Symbol, + /// + /// bigint + /// + [EnumMember(Value = ("bigint"))] + Bigint + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// NOTE: If you change anything here, make sure to also update + /// `subtype` in `ObjectPreview` and `PropertyPreview` below. + /// + public enum RemoteObjectSubtype + { + /// + /// array + /// + [EnumMember(Value = ("array"))] + Array, + /// + /// null + /// + [EnumMember(Value = ("null"))] + Null, + /// + /// node + /// + [EnumMember(Value = ("node"))] + Node, + /// + /// regexp + /// + [EnumMember(Value = ("regexp"))] + Regexp, + /// + /// date + /// + [EnumMember(Value = ("date"))] + Date, + /// + /// map + /// + [EnumMember(Value = ("map"))] + Map, + /// + /// set + /// + [EnumMember(Value = ("set"))] + Set, + /// + /// weakmap + /// + [EnumMember(Value = ("weakmap"))] + Weakmap, + /// + /// weakset + /// + [EnumMember(Value = ("weakset"))] + Weakset, + /// + /// iterator + /// + [EnumMember(Value = ("iterator"))] + Iterator, + /// + /// generator + /// + [EnumMember(Value = ("generator"))] + Generator, + /// + /// error + /// + [EnumMember(Value = ("error"))] + Error, + /// + /// proxy + /// + [EnumMember(Value = ("proxy"))] + Proxy, + /// + /// promise + /// + [EnumMember(Value = ("promise"))] + Promise, + /// + /// typedarray + /// + [EnumMember(Value = ("typedarray"))] + Typedarray, + /// + /// arraybuffer + /// + [EnumMember(Value = ("arraybuffer"))] + Arraybuffer, + /// + /// dataview + /// + [EnumMember(Value = ("dataview"))] + Dataview, + /// + /// webassemblymemory + /// + [EnumMember(Value = ("webassemblymemory"))] + Webassemblymemory, + /// + /// wasmvalue + /// + [EnumMember(Value = ("wasmvalue"))] + Wasmvalue, + /// + /// trustedtype + /// + [EnumMember(Value = ("trustedtype"))] + Trustedtype + } + + /// + /// Mirror object referencing original JavaScript object. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class RemoteObject : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Object type. + /// + public CefSharp.DevTools.Runtime.RemoteObjectType Type + { + get + { + return (CefSharp.DevTools.Runtime.RemoteObjectType)(StringToEnum(typeof(CefSharp.DevTools.Runtime.RemoteObjectType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Object type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// NOTE: If you change anything here, make sure to also update + /// `subtype` in `ObjectPreview` and `PropertyPreview` below. + /// + public CefSharp.DevTools.Runtime.RemoteObjectSubtype? Subtype + { + get + { + return (CefSharp.DevTools.Runtime.RemoteObjectSubtype? )(StringToEnum(typeof(CefSharp.DevTools.Runtime.RemoteObjectSubtype? ), subtype)); + } + + set + { + this.subtype = (EnumToString(value)); + } + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// NOTE: If you change anything here, make sure to also update + /// `subtype` in `ObjectPreview` and `PropertyPreview` below. + /// + [DataMember(Name = ("subtype"), IsRequired = (false))] + internal string subtype + { + get; + set; + } + + /// + /// Object class (constructor) name. Specified for `object` type values only. + /// + [DataMember(Name = ("className"), IsRequired = (false))] + public string ClassName + { + get; + set; + } + + /// + /// Remote object value in case of primitive values or JSON values (if it was requested). + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public object Value + { + get; + set; + } + + /// + /// Primitive value which can not be JSON-stringified does not have `value`, but gets this + /// property. + /// + [DataMember(Name = ("unserializableValue"), IsRequired = (false))] + public string UnserializableValue + { + get; + set; + } + + /// + /// String representation of the object. + /// + [DataMember(Name = ("description"), IsRequired = (false))] + public string Description + { + get; + set; + } + + /// + /// Deep serialized value. + /// + [DataMember(Name = ("deepSerializedValue"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.DeepSerializedValue DeepSerializedValue + { + get; + set; + } + + /// + /// Unique object identifier (for non-primitive values). + /// + [DataMember(Name = ("objectId"), IsRequired = (false))] + public string ObjectId + { + get; + set; + } + + /// + /// Preview containing abbreviated property values. Specified for `object` type values only. + /// + [DataMember(Name = ("preview"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.ObjectPreview Preview + { + get; + set; + } + + /// + /// CustomPreview + /// + [DataMember(Name = ("customPreview"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.CustomPreview CustomPreview + { + get; + set; + } + } + + /// + /// CustomPreview + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CustomPreview : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The JSON-stringified result of formatter.header(object, config) call. + /// It contains json ML array that represents RemoteObject. + /// + [DataMember(Name = ("header"), IsRequired = (true))] + public string Header + { + get; + set; + } + + /// + /// If formatter returns true as a result of formatter.hasBody call then bodyGetterId will + /// contain RemoteObjectId for the function that returns result of formatter.body(object, config) call. + /// The result value is json ML array. + /// + [DataMember(Name = ("bodyGetterId"), IsRequired = (false))] + public string BodyGetterId + { + get; + set; + } + } + + /// + /// Object type. + /// + public enum ObjectPreviewType + { + /// + /// object + /// + [EnumMember(Value = ("object"))] + Object, + /// + /// function + /// + [EnumMember(Value = ("function"))] + Function, + /// + /// undefined + /// + [EnumMember(Value = ("undefined"))] + Undefined, + /// + /// string + /// + [EnumMember(Value = ("string"))] + String, + /// + /// number + /// + [EnumMember(Value = ("number"))] + Number, + /// + /// boolean + /// + [EnumMember(Value = ("boolean"))] + Boolean, + /// + /// symbol + /// + [EnumMember(Value = ("symbol"))] + Symbol, + /// + /// bigint + /// + [EnumMember(Value = ("bigint"))] + Bigint + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + public enum ObjectPreviewSubtype + { + /// + /// array + /// + [EnumMember(Value = ("array"))] + Array, + /// + /// null + /// + [EnumMember(Value = ("null"))] + Null, + /// + /// node + /// + [EnumMember(Value = ("node"))] + Node, + /// + /// regexp + /// + [EnumMember(Value = ("regexp"))] + Regexp, + /// + /// date + /// + [EnumMember(Value = ("date"))] + Date, + /// + /// map + /// + [EnumMember(Value = ("map"))] + Map, + /// + /// set + /// + [EnumMember(Value = ("set"))] + Set, + /// + /// weakmap + /// + [EnumMember(Value = ("weakmap"))] + Weakmap, + /// + /// weakset + /// + [EnumMember(Value = ("weakset"))] + Weakset, + /// + /// iterator + /// + [EnumMember(Value = ("iterator"))] + Iterator, + /// + /// generator + /// + [EnumMember(Value = ("generator"))] + Generator, + /// + /// error + /// + [EnumMember(Value = ("error"))] + Error, + /// + /// proxy + /// + [EnumMember(Value = ("proxy"))] + Proxy, + /// + /// promise + /// + [EnumMember(Value = ("promise"))] + Promise, + /// + /// typedarray + /// + [EnumMember(Value = ("typedarray"))] + Typedarray, + /// + /// arraybuffer + /// + [EnumMember(Value = ("arraybuffer"))] + Arraybuffer, + /// + /// dataview + /// + [EnumMember(Value = ("dataview"))] + Dataview, + /// + /// webassemblymemory + /// + [EnumMember(Value = ("webassemblymemory"))] + Webassemblymemory, + /// + /// wasmvalue + /// + [EnumMember(Value = ("wasmvalue"))] + Wasmvalue, + /// + /// trustedtype + /// + [EnumMember(Value = ("trustedtype"))] + Trustedtype + } + + /// + /// Object containing abbreviated remote object value. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ObjectPreview : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Object type. + /// + public CefSharp.DevTools.Runtime.ObjectPreviewType Type + { + get + { + return (CefSharp.DevTools.Runtime.ObjectPreviewType)(StringToEnum(typeof(CefSharp.DevTools.Runtime.ObjectPreviewType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Object type. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + public CefSharp.DevTools.Runtime.ObjectPreviewSubtype? Subtype + { + get + { + return (CefSharp.DevTools.Runtime.ObjectPreviewSubtype? )(StringToEnum(typeof(CefSharp.DevTools.Runtime.ObjectPreviewSubtype? ), subtype)); + } + + set + { + this.subtype = (EnumToString(value)); + } + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + [DataMember(Name = ("subtype"), IsRequired = (false))] + internal string subtype + { + get; + set; + } + + /// + /// String representation of the object. + /// + [DataMember(Name = ("description"), IsRequired = (false))] + public string Description + { + get; + set; + } + + /// + /// True iff some of the properties or entries of the original object did not fit. + /// + [DataMember(Name = ("overflow"), IsRequired = (true))] + public bool Overflow + { + get; + set; + } + + /// + /// List of the properties. + /// + [DataMember(Name = ("properties"), IsRequired = (true))] + public System.Collections.Generic.IList Properties + { + get; + set; + } + + /// + /// List of the entries. Specified for `map` and `set` subtype values only. + /// + [DataMember(Name = ("entries"), IsRequired = (false))] + public System.Collections.Generic.IList Entries + { + get; + set; + } + } + + /// + /// Object type. Accessor means that the property itself is an accessor property. + /// + public enum PropertyPreviewType + { + /// + /// object + /// + [EnumMember(Value = ("object"))] + Object, + /// + /// function + /// + [EnumMember(Value = ("function"))] + Function, + /// + /// undefined + /// + [EnumMember(Value = ("undefined"))] + Undefined, + /// + /// string + /// + [EnumMember(Value = ("string"))] + String, + /// + /// number + /// + [EnumMember(Value = ("number"))] + Number, + /// + /// boolean + /// + [EnumMember(Value = ("boolean"))] + Boolean, + /// + /// symbol + /// + [EnumMember(Value = ("symbol"))] + Symbol, + /// + /// accessor + /// + [EnumMember(Value = ("accessor"))] + Accessor, + /// + /// bigint + /// + [EnumMember(Value = ("bigint"))] + Bigint + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + public enum PropertyPreviewSubtype + { + /// + /// array + /// + [EnumMember(Value = ("array"))] + Array, + /// + /// null + /// + [EnumMember(Value = ("null"))] + Null, + /// + /// node + /// + [EnumMember(Value = ("node"))] + Node, + /// + /// regexp + /// + [EnumMember(Value = ("regexp"))] + Regexp, + /// + /// date + /// + [EnumMember(Value = ("date"))] + Date, + /// + /// map + /// + [EnumMember(Value = ("map"))] + Map, + /// + /// set + /// + [EnumMember(Value = ("set"))] + Set, + /// + /// weakmap + /// + [EnumMember(Value = ("weakmap"))] + Weakmap, + /// + /// weakset + /// + [EnumMember(Value = ("weakset"))] + Weakset, + /// + /// iterator + /// + [EnumMember(Value = ("iterator"))] + Iterator, + /// + /// generator + /// + [EnumMember(Value = ("generator"))] + Generator, + /// + /// error + /// + [EnumMember(Value = ("error"))] + Error, + /// + /// proxy + /// + [EnumMember(Value = ("proxy"))] + Proxy, + /// + /// promise + /// + [EnumMember(Value = ("promise"))] + Promise, + /// + /// typedarray + /// + [EnumMember(Value = ("typedarray"))] + Typedarray, + /// + /// arraybuffer + /// + [EnumMember(Value = ("arraybuffer"))] + Arraybuffer, + /// + /// dataview + /// + [EnumMember(Value = ("dataview"))] + Dataview, + /// + /// webassemblymemory + /// + [EnumMember(Value = ("webassemblymemory"))] + Webassemblymemory, + /// + /// wasmvalue + /// + [EnumMember(Value = ("wasmvalue"))] + Wasmvalue, + /// + /// trustedtype + /// + [EnumMember(Value = ("trustedtype"))] + Trustedtype + } + + /// + /// PropertyPreview + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PropertyPreview : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Property name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// Object type. Accessor means that the property itself is an accessor property. + /// + public CefSharp.DevTools.Runtime.PropertyPreviewType Type + { + get + { + return (CefSharp.DevTools.Runtime.PropertyPreviewType)(StringToEnum(typeof(CefSharp.DevTools.Runtime.PropertyPreviewType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Object type. Accessor means that the property itself is an accessor property. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + set; + } + + /// + /// User-friendly property value string. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public string Value + { + get; + set; + } + + /// + /// Nested value preview. + /// + [DataMember(Name = ("valuePreview"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.ObjectPreview ValuePreview + { + get; + set; + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + public CefSharp.DevTools.Runtime.PropertyPreviewSubtype? Subtype + { + get + { + return (CefSharp.DevTools.Runtime.PropertyPreviewSubtype? )(StringToEnum(typeof(CefSharp.DevTools.Runtime.PropertyPreviewSubtype? ), subtype)); + } + + set + { + this.subtype = (EnumToString(value)); + } + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + [DataMember(Name = ("subtype"), IsRequired = (false))] + internal string subtype + { + get; + set; + } + } + + /// + /// EntryPreview + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class EntryPreview : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Preview of the key. Specified for map-like collection entries. + /// + [DataMember(Name = ("key"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.ObjectPreview Key + { + get; + set; + } + + /// + /// Preview of the value. + /// + [DataMember(Name = ("value"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.ObjectPreview Value + { + get; + set; + } + } + + /// + /// Object property descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PropertyDescriptor : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Property name or symbol description. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// The value associated with the property. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Value + { + get; + set; + } + + /// + /// True if the value associated with the property may be changed (data descriptors only). + /// + [DataMember(Name = ("writable"), IsRequired = (false))] + public bool? Writable + { + get; + set; + } + + /// + /// A function which serves as a getter for the property, or `undefined` if there is no getter + /// (accessor descriptors only). + /// + [DataMember(Name = ("get"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Get + { + get; + set; + } + + /// + /// A function which serves as a setter for the property, or `undefined` if there is no setter + /// (accessor descriptors only). + /// + [DataMember(Name = ("set"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Set + { + get; + set; + } + + /// + /// True if the type of this property descriptor may be changed and if the property may be + /// deleted from the corresponding object. + /// + [DataMember(Name = ("configurable"), IsRequired = (true))] + public bool Configurable + { + get; + set; + } + + /// + /// True if this property shows up during enumeration of the properties on the corresponding + /// object. + /// + [DataMember(Name = ("enumerable"), IsRequired = (true))] + public bool Enumerable + { + get; + set; + } + + /// + /// True if the result was thrown during the evaluation. + /// + [DataMember(Name = ("wasThrown"), IsRequired = (false))] + public bool? WasThrown + { + get; + set; + } + + /// + /// True if the property is owned for the object. + /// + [DataMember(Name = ("isOwn"), IsRequired = (false))] + public bool? IsOwn + { + get; + set; + } + + /// + /// Property symbol object, if the property is of the `symbol` type. + /// + [DataMember(Name = ("symbol"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Symbol + { + get; + set; + } + } + + /// + /// Object internal property descriptor. This property isn't normally visible in JavaScript code. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class InternalPropertyDescriptor : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Conventional property name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// The value associated with the property. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Value + { + get; + set; + } + } + + /// + /// Object private field descriptor. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class PrivatePropertyDescriptor : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Private property name. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// The value associated with the private property. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Value + { + get; + set; + } + + /// + /// A function which serves as a getter for the private property, + /// or `undefined` if there is no getter (accessor descriptors only). + /// + [DataMember(Name = ("get"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Get + { + get; + set; + } + + /// + /// A function which serves as a setter for the private property, + /// or `undefined` if there is no setter (accessor descriptors only). + /// + [DataMember(Name = ("set"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Set + { + get; + set; + } + } + + /// + /// Represents function call argument. Either remote object id `objectId`, primitive `value`, + /// unserializable primitive value or neither of (for undefined) them should be specified. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CallArgument : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Primitive value or serializable javascript object. + /// + [DataMember(Name = ("value"), IsRequired = (false))] + public object Value + { + get; + set; + } + + /// + /// Primitive value which can not be JSON-stringified. + /// + [DataMember(Name = ("unserializableValue"), IsRequired = (false))] + public string UnserializableValue + { + get; + set; + } + + /// + /// Remote object handle. + /// + [DataMember(Name = ("objectId"), IsRequired = (false))] + public string ObjectId + { + get; + set; + } + } + + /// + /// Description of an isolated world. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ExecutionContextDescription : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unique id of the execution context. It can be used to specify in which execution context + /// script evaluation should be performed. + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public int Id + { + get; + set; + } + + /// + /// Execution context origin. + /// + [DataMember(Name = ("origin"), IsRequired = (true))] + public string Origin + { + get; + set; + } + + /// + /// Human readable name describing given context. + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + set; + } + + /// + /// A system-unique execution context identifier. Unlike the id, this is unique across + /// multiple processes, so can be reliably used to identify specific context while backend + /// performs a cross-process navigation. + /// + [DataMember(Name = ("uniqueId"), IsRequired = (true))] + public string UniqueId + { + get; + set; + } + + /// + /// Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string} + /// + [DataMember(Name = ("auxData"), IsRequired = (false))] + public object AuxData + { + get; + set; + } + } + + /// + /// Detailed information about exception (or error) that was thrown during script compilation or + /// execution. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class ExceptionDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Exception id. + /// + [DataMember(Name = ("exceptionId"), IsRequired = (true))] + public int ExceptionId + { + get; + set; + } + + /// + /// Exception text, which should be used together with exception object when available. + /// + [DataMember(Name = ("text"), IsRequired = (true))] + public string Text + { + get; + set; + } + + /// + /// Line number of the exception location (0-based). + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// Column number of the exception location (0-based). + /// + [DataMember(Name = ("columnNumber"), IsRequired = (true))] + public int ColumnNumber + { + get; + set; + } + + /// + /// Script ID of the exception location. + /// + [DataMember(Name = ("scriptId"), IsRequired = (false))] + public string ScriptId + { + get; + set; + } + + /// + /// URL of the exception location, to be used when the script was not reported. + /// + [DataMember(Name = ("url"), IsRequired = (false))] + public string Url + { + get; + set; + } + + /// + /// JavaScript stack trace if available. + /// + [DataMember(Name = ("stackTrace"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + set; + } + + /// + /// Exception object if available. + /// + [DataMember(Name = ("exception"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.RemoteObject Exception + { + get; + set; + } + + /// + /// Identifier of the context where exception happened. + /// + [DataMember(Name = ("executionContextId"), IsRequired = (false))] + public int? ExecutionContextId + { + get; + set; + } + + /// + /// Dictionary with entries of meta data that the client associated + /// with this exception, such as information about associated network + /// requests, etc. + /// + [DataMember(Name = ("exceptionMetaData"), IsRequired = (false))] + public object ExceptionMetaData + { + get; + set; + } + } + + /// + /// Stack entry for runtime errors and assertions. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class CallFrame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// JavaScript function name. + /// + [DataMember(Name = ("functionName"), IsRequired = (true))] + public string FunctionName + { + get; + set; + } + + /// + /// JavaScript script id. + /// + [DataMember(Name = ("scriptId"), IsRequired = (true))] + public string ScriptId + { + get; + set; + } + + /// + /// JavaScript script name or url. + /// + [DataMember(Name = ("url"), IsRequired = (true))] + public string Url + { + get; + set; + } + + /// + /// JavaScript script line number (0-based). + /// + [DataMember(Name = ("lineNumber"), IsRequired = (true))] + public int LineNumber + { + get; + set; + } + + /// + /// JavaScript script column number (0-based). + /// + [DataMember(Name = ("columnNumber"), IsRequired = (true))] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// Call frames for assertions or error messages. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class StackTrace : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// String label of this stack trace. For async traces this may be a name of the function that + /// initiated the async call. + /// + [DataMember(Name = ("description"), IsRequired = (false))] + public string Description + { + get; + set; + } + + /// + /// JavaScript function name. + /// + [DataMember(Name = ("callFrames"), IsRequired = (true))] + public System.Collections.Generic.IList CallFrames + { + get; + set; + } + + /// + /// Asynchronous JavaScript stack trace that preceded this stack, if available. + /// + [DataMember(Name = ("parent"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace Parent + { + get; + set; + } + + /// + /// Asynchronous JavaScript stack trace that preceded this stack, if available. + /// + [DataMember(Name = ("parentId"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTraceId ParentId + { + get; + set; + } + } + + /// + /// If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This + /// allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages. + /// + [System.Runtime.Serialization.DataContractAttribute] + public partial class StackTraceId : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [DataMember(Name = ("id"), IsRequired = (true))] + public string Id + { + get; + set; + } + + /// + /// DebuggerId + /// + [DataMember(Name = ("debuggerId"), IsRequired = (false))] + public string DebuggerId + { + get; + set; + } + } + + /// + /// Notification is issued every time when binding is called. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class BindingCalledEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Name + /// + [DataMember(Name = ("name"), IsRequired = (true))] + public string Name + { + get; + private set; + } + + /// + /// Payload + /// + [DataMember(Name = ("payload"), IsRequired = (true))] + public string Payload + { + get; + private set; + } + + /// + /// Identifier of the context where the call was made. + /// + [DataMember(Name = ("executionContextId"), IsRequired = (true))] + public int ExecutionContextId + { + get; + private set; + } + } + + /// + /// Type of the call. + /// + public enum ConsoleAPICalledType + { + /// + /// log + /// + [EnumMember(Value = ("log"))] + Log, + /// + /// debug + /// + [EnumMember(Value = ("debug"))] + Debug, + /// + /// info + /// + [EnumMember(Value = ("info"))] + Info, + /// + /// error + /// + [EnumMember(Value = ("error"))] + Error, + /// + /// warning + /// + [EnumMember(Value = ("warning"))] + Warning, + /// + /// dir + /// + [EnumMember(Value = ("dir"))] + Dir, + /// + /// dirxml + /// + [EnumMember(Value = ("dirxml"))] + Dirxml, + /// + /// table + /// + [EnumMember(Value = ("table"))] + Table, + /// + /// trace + /// + [EnumMember(Value = ("trace"))] + Trace, + /// + /// clear + /// + [EnumMember(Value = ("clear"))] + Clear, + /// + /// startGroup + /// + [EnumMember(Value = ("startGroup"))] + StartGroup, + /// + /// startGroupCollapsed + /// + [EnumMember(Value = ("startGroupCollapsed"))] + StartGroupCollapsed, + /// + /// endGroup + /// + [EnumMember(Value = ("endGroup"))] + EndGroup, + /// + /// assert + /// + [EnumMember(Value = ("assert"))] + Assert, + /// + /// profile + /// + [EnumMember(Value = ("profile"))] + Profile, + /// + /// profileEnd + /// + [EnumMember(Value = ("profileEnd"))] + ProfileEnd, + /// + /// count + /// + [EnumMember(Value = ("count"))] + Count, + /// + /// timeEnd + /// + [EnumMember(Value = ("timeEnd"))] + TimeEnd + } + + /// + /// Issued when console API was called. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ConsoleAPICalledEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Type of the call. + /// + public CefSharp.DevTools.Runtime.ConsoleAPICalledType Type + { + get + { + return (CefSharp.DevTools.Runtime.ConsoleAPICalledType)(StringToEnum(typeof(CefSharp.DevTools.Runtime.ConsoleAPICalledType), type)); + } + + set + { + this.type = (EnumToString(value)); + } + } + + /// + /// Type of the call. + /// + [DataMember(Name = ("type"), IsRequired = (true))] + internal string type + { + get; + private set; + } + + /// + /// Call arguments. + /// + [DataMember(Name = ("args"), IsRequired = (true))] + public System.Collections.Generic.IList Args + { + get; + private set; + } + + /// + /// Identifier of the context where the call was made. + /// + [DataMember(Name = ("executionContextId"), IsRequired = (true))] + public int ExecutionContextId + { + get; + private set; + } + + /// + /// Call timestamp. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// Stack trace captured when the call was made. The async stack chain is automatically reported for + /// the following call types: `assert`, `error`, `trace`, `warning`. For other types the async call + /// chain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field. + /// + [DataMember(Name = ("stackTrace"), IsRequired = (false))] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + private set; + } + + /// + /// Console context descriptor for calls on non-default console context (not console.*): + /// 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call + /// on named context. + /// + [DataMember(Name = ("context"), IsRequired = (false))] + public string Context + { + get; + private set; + } + } + + /// + /// Issued when unhandled exception was revoked. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ExceptionRevokedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Reason describing why exception was revoked. + /// + [DataMember(Name = ("reason"), IsRequired = (true))] + public string Reason + { + get; + private set; + } + + /// + /// The id of revoked exception, as reported in `exceptionThrown`. + /// + [DataMember(Name = ("exceptionId"), IsRequired = (true))] + public int ExceptionId + { + get; + private set; + } + } + + /// + /// Issued when exception was thrown and unhandled. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ExceptionThrownEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Timestamp of the exception. + /// + [DataMember(Name = ("timestamp"), IsRequired = (true))] + public double Timestamp + { + get; + private set; + } + + /// + /// ExceptionDetails + /// + [DataMember(Name = ("exceptionDetails"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } + + /// + /// Issued when new execution context is created. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ExecutionContextCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// A newly created execution context. + /// + [DataMember(Name = ("context"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.ExecutionContextDescription Context + { + get; + private set; + } + } + + /// + /// Issued when execution context is destroyed. + /// + [System.Runtime.Serialization.DataContractAttribute] + public class ExecutionContextDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the destroyed context + /// + [DataMember(Name = ("executionContextId"), IsRequired = (true))] + public int ExecutionContextId + { + get; + private set; + } + + /// + /// Unique Id of the destroyed context + /// + [DataMember(Name = ("executionContextUniqueId"), IsRequired = (true))] + public string ExecutionContextUniqueId + { + get; + private set; + } + } + + /// + /// Issued when object should be inspected (for example, as a result of inspect() command line API + /// call). + /// + [System.Runtime.Serialization.DataContractAttribute] + public class InspectRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Object + /// + [DataMember(Name = ("object"), IsRequired = (true))] + public CefSharp.DevTools.Runtime.RemoteObject Object + { + get; + private set; + } + + /// + /// Hints + /// + [DataMember(Name = ("hints"), IsRequired = (true))] + public object Hints + { + get; + private set; + } + + /// + /// Identifier of the context where the call was made. + /// + [DataMember(Name = ("executionContextId"), IsRequired = (false))] + public int? ExecutionContextId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetPartialAXTreeResponse + /// + [DataContract] + public class GetPartialAXTreeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList nodes + { + get; + set; + } + + /// + /// nodes + /// + public System.Collections.Generic.IList Nodes + { + get + { + return nodes; + } + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetFullAXTreeResponse + /// + [DataContract] + public class GetFullAXTreeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList nodes + { + get; + set; + } + + /// + /// nodes + /// + public System.Collections.Generic.IList Nodes + { + get + { + return nodes; + } + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetRootAXNodeResponse + /// + [DataContract] + public class GetRootAXNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Accessibility.AXNode node + { + get; + set; + } + + /// + /// node + /// + public CefSharp.DevTools.Accessibility.AXNode Node + { + get + { + return node; + } + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetAXNodeAndAncestorsResponse + /// + [DataContract] + public class GetAXNodeAndAncestorsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList nodes + { + get; + set; + } + + /// + /// nodes + /// + public System.Collections.Generic.IList Nodes + { + get + { + return nodes; + } + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetChildAXNodesResponse + /// + [DataContract] + public class GetChildAXNodesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList nodes + { + get; + set; + } + + /// + /// nodes + /// + public System.Collections.Generic.IList Nodes + { + get + { + return nodes; + } + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// QueryAXTreeResponse + /// + [DataContract] + public class QueryAXTreeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList nodes + { + get; + set; + } + + /// + /// nodes + /// + public System.Collections.Generic.IList Nodes + { + get + { + return nodes; + } + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + using System.Linq; + + /// + /// Accessibility + /// + public partial class AccessibilityClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Accessibility + /// + /// DevToolsClient + public AccessibilityClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// The loadComplete event mirrors the load complete event sent by the browser to assistive + /// technology when the web page has finished loading. + /// + public event System.EventHandler LoadComplete + { + add + { + _client.AddEventHandler("Accessibility.loadComplete", value); + } + + remove + { + _client.RemoveEventHandler("Accessibility.loadComplete", value); + } + } + + /// + /// The nodesUpdated event is sent every time a previously requested node has changed the in tree. + /// + public event System.EventHandler NodesUpdated + { + add + { + _client.AddEventHandler("Accessibility.nodesUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Accessibility.nodesUpdated", value); + } + } + + /// + /// Disables the accessibility domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Accessibility.disable", dict); + } + + /// + /// Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls. + /// This turns on accessibility for the page, which can impact performance until accessibility is disabled. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Accessibility.enable", dict); + } + + partial void ValidateGetPartialAXTree(int? nodeId = null, int? backendNodeId = null, string objectId = null, bool? fetchRelatives = null); + /// + /// Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists. + /// + /// Identifier of the node to get the partial accessibility tree for. + /// Identifier of the backend node to get the partial accessibility tree for. + /// JavaScript object id of the node wrapper to get the partial accessibility tree for. + /// Whether to fetch this node's ancestors, siblings and children. Defaults to true. + /// returns System.Threading.Tasks.Task<GetPartialAXTreeResponse> + public System.Threading.Tasks.Task GetPartialAXTreeAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, bool? fetchRelatives = null) + { + ValidateGetPartialAXTree(nodeId, backendNodeId, objectId, fetchRelatives); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (fetchRelatives.HasValue) + { + dict.Add("fetchRelatives", fetchRelatives.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getPartialAXTree", dict); + } + + partial void ValidateGetFullAXTree(int? depth = null, string frameId = null); + /// + /// Fetches the entire accessibility tree for the root Document + /// + /// The maximum depth at which descendants of the root node should be retrieved.If omitted, the full tree is returned. + /// The frame for whose document the AX tree should be retrieved.If omitted, the root frame is used. + /// returns System.Threading.Tasks.Task<GetFullAXTreeResponse> + public System.Threading.Tasks.Task GetFullAXTreeAsync(int? depth = null, string frameId = null) + { + ValidateGetFullAXTree(depth, frameId); + var dict = new System.Collections.Generic.Dictionary(); + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getFullAXTree", dict); + } + + partial void ValidateGetRootAXNode(string frameId = null); + /// + /// Fetches the root node. + /// Requires `enable()` to have been called previously. + /// + /// The frame in whose document the node resides.If omitted, the root frame is used. + /// returns System.Threading.Tasks.Task<GetRootAXNodeResponse> + public System.Threading.Tasks.Task GetRootAXNodeAsync(string frameId = null) + { + ValidateGetRootAXNode(frameId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getRootAXNode", dict); + } + + partial void ValidateGetAXNodeAndAncestors(int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Fetches a node and all ancestors up to and including the root. + /// Requires `enable()` to have been called previously. + /// + /// Identifier of the node to get. + /// Identifier of the backend node to get. + /// JavaScript object id of the node wrapper to get. + /// returns System.Threading.Tasks.Task<GetAXNodeAndAncestorsResponse> + public System.Threading.Tasks.Task GetAXNodeAndAncestorsAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateGetAXNodeAndAncestors(nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getAXNodeAndAncestors", dict); + } + + partial void ValidateGetChildAXNodes(string id, string frameId = null); + /// + /// Fetches a particular accessibility node by AXNodeId. + /// Requires `enable()` to have been called previously. + /// + /// id + /// The frame in whose document the node resides.If omitted, the root frame is used. + /// returns System.Threading.Tasks.Task<GetChildAXNodesResponse> + public System.Threading.Tasks.Task GetChildAXNodesAsync(string id, string frameId = null) + { + ValidateGetChildAXNodes(id, frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getChildAXNodes", dict); + } + + partial void ValidateQueryAXTree(int? nodeId = null, int? backendNodeId = null, string objectId = null, string accessibleName = null, string role = null); + /// + /// Query a DOM node's accessibility subtree for accessible name and role. + /// This command computes the name and role for all nodes in the subtree, including those that are + /// ignored for accessibility, and returns those that match the specified name and role. If no DOM + /// node is specified, or the DOM node does not exist, the command returns an error. If neither + /// `accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree. + /// + /// Identifier of the node for the root to query. + /// Identifier of the backend node for the root to query. + /// JavaScript object id of the node wrapper for the root to query. + /// Find nodes with this computed name. + /// Find nodes with this computed role. + /// returns System.Threading.Tasks.Task<QueryAXTreeResponse> + public System.Threading.Tasks.Task QueryAXTreeAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, string accessibleName = null, string role = null) + { + ValidateQueryAXTree(nodeId, backendNodeId, objectId, accessibleName, role); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (!(string.IsNullOrEmpty(accessibleName))) + { + dict.Add("accessibleName", accessibleName); + } + + if (!(string.IsNullOrEmpty(role))) + { + dict.Add("role", role); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.queryAXTree", dict); + } + } +} + +namespace CefSharp.DevTools.Animation +{ + /// + /// GetCurrentTimeResponse + /// + [DataContract] + public class GetCurrentTimeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double currentTime + { + get; + set; + } + + /// + /// currentTime + /// + public double CurrentTime + { + get + { + return currentTime; + } + } + } +} + +namespace CefSharp.DevTools.Animation +{ + /// + /// GetPlaybackRateResponse + /// + [DataContract] + public class GetPlaybackRateResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double playbackRate + { + get; + set; + } + + /// + /// playbackRate + /// + public double PlaybackRate + { + get + { + return playbackRate; + } + } + } +} + +namespace CefSharp.DevTools.Animation +{ + /// + /// ResolveAnimationResponse + /// + [DataContract] + public class ResolveAnimationResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject remoteObject + { + get; + set; + } + + /// + /// remoteObject + /// + public CefSharp.DevTools.Runtime.RemoteObject RemoteObject + { + get + { + return remoteObject; + } + } + } +} + +namespace CefSharp.DevTools.Animation +{ + using System.Linq; + + /// + /// Animation + /// + public partial class AnimationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Animation + /// + /// DevToolsClient + public AnimationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Event for when an animation has been cancelled. + /// + public event System.EventHandler AnimationCanceled + { + add + { + _client.AddEventHandler("Animation.animationCanceled", value); + } + + remove + { + _client.RemoveEventHandler("Animation.animationCanceled", value); + } + } + + /// + /// Event for each animation that has been created. + /// + public event System.EventHandler AnimationCreated + { + add + { + _client.AddEventHandler("Animation.animationCreated", value); + } + + remove + { + _client.RemoveEventHandler("Animation.animationCreated", value); + } + } + + /// + /// Event for animation that has been started. + /// + public event System.EventHandler AnimationStarted + { + add + { + _client.AddEventHandler("Animation.animationStarted", value); + } + + remove + { + _client.RemoveEventHandler("Animation.animationStarted", value); + } + } + + /// + /// Event for animation that has been updated. + /// + public event System.EventHandler AnimationUpdated + { + add + { + _client.AddEventHandler("Animation.animationUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Animation.animationUpdated", value); + } + } + + /// + /// Disables animation domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Animation.disable", dict); + } + + /// + /// Enables animation domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Animation.enable", dict); + } + + partial void ValidateGetCurrentTime(string id); + /// + /// Returns the current time of the an animation. + /// + /// Id of animation. + /// returns System.Threading.Tasks.Task<GetCurrentTimeResponse> + public System.Threading.Tasks.Task GetCurrentTimeAsync(string id) + { + ValidateGetCurrentTime(id); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + return _client.ExecuteDevToolsMethodAsync("Animation.getCurrentTime", dict); + } + + /// + /// Gets the playback rate of the document timeline. + /// + /// returns System.Threading.Tasks.Task<GetPlaybackRateResponse> + public System.Threading.Tasks.Task GetPlaybackRateAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Animation.getPlaybackRate", dict); + } + + partial void ValidateReleaseAnimations(string[] animations); + /// + /// Releases a set of animations to no longer be manipulated. + /// + /// List of animation ids to seek. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReleaseAnimationsAsync(string[] animations) + { + ValidateReleaseAnimations(animations); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animations", animations); + return _client.ExecuteDevToolsMethodAsync("Animation.releaseAnimations", dict); + } + + partial void ValidateResolveAnimation(string animationId); + /// + /// Gets the remote object of the Animation. + /// + /// Animation id. + /// returns System.Threading.Tasks.Task<ResolveAnimationResponse> + public System.Threading.Tasks.Task ResolveAnimationAsync(string animationId) + { + ValidateResolveAnimation(animationId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animationId", animationId); + return _client.ExecuteDevToolsMethodAsync("Animation.resolveAnimation", dict); + } + + partial void ValidateSeekAnimations(string[] animations, double currentTime); + /// + /// Seek a set of animations to a particular time within each animation. + /// + /// List of animation ids to seek. + /// Set the current time of each animation. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SeekAnimationsAsync(string[] animations, double currentTime) + { + ValidateSeekAnimations(animations, currentTime); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animations", animations); + dict.Add("currentTime", currentTime); + return _client.ExecuteDevToolsMethodAsync("Animation.seekAnimations", dict); + } + + partial void ValidateSetPaused(string[] animations, bool paused); + /// + /// Sets the paused state of a set of animations. + /// + /// Animations to set the pause state of. + /// Paused state to set to. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPausedAsync(string[] animations, bool paused) + { + ValidateSetPaused(animations, paused); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animations", animations); + dict.Add("paused", paused); + return _client.ExecuteDevToolsMethodAsync("Animation.setPaused", dict); + } + + partial void ValidateSetPlaybackRate(double playbackRate); + /// + /// Sets the playback rate of the document timeline. + /// + /// Playback rate for animations on page + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPlaybackRateAsync(double playbackRate) + { + ValidateSetPlaybackRate(playbackRate); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("playbackRate", playbackRate); + return _client.ExecuteDevToolsMethodAsync("Animation.setPlaybackRate", dict); + } + + partial void ValidateSetTiming(string animationId, double duration, double delay); + /// + /// Sets the timing of an animation node. + /// + /// Animation id. + /// Duration of the animation. + /// Delay of the animation. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetTimingAsync(string animationId, double duration, double delay) + { + ValidateSetTiming(animationId, duration, delay); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animationId", animationId); + dict.Add("duration", duration); + dict.Add("delay", delay); + return _client.ExecuteDevToolsMethodAsync("Animation.setTiming", dict); + } + } +} + +namespace CefSharp.DevTools.Audits +{ + /// + /// GetEncodedResponseResponse + /// + [DataContract] + public class GetEncodedResponseResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string body + { + get; + set; + } + + /// + /// body + /// + public byte[] Body + { + get + { + return Convert(body); + } + } + + [DataMember] + internal int originalSize + { + get; + set; + } + + /// + /// originalSize + /// + public int OriginalSize + { + get + { + return originalSize; + } + } + + [DataMember] + internal int encodedSize + { + get; + set; + } + + /// + /// encodedSize + /// + public int EncodedSize + { + get + { + return encodedSize; + } + } + } +} + +namespace CefSharp.DevTools.Audits +{ + /// + /// CheckFormsIssuesResponse + /// + [DataContract] + public class CheckFormsIssuesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList formIssues + { + get; + set; + } + + /// + /// formIssues + /// + public System.Collections.Generic.IList FormIssues + { + get + { + return formIssues; + } + } + } +} + +namespace CefSharp.DevTools.Audits +{ + using System.Linq; + + /// + /// The encoding to use. + /// + public enum GetEncodedResponseEncoding + { + /// + /// webp + /// + [EnumMember(Value = ("webp"))] + Webp, + /// + /// jpeg + /// + [EnumMember(Value = ("jpeg"))] + Jpeg, + /// + /// png + /// + [EnumMember(Value = ("png"))] + Png + } + + /// + /// Audits domain allows investigation of page violations and possible improvements. + /// + public partial class AuditsClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Audits + /// + /// DevToolsClient + public AuditsClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// IssueAdded + /// + public event System.EventHandler IssueAdded + { + add + { + _client.AddEventHandler("Audits.issueAdded", value); + } + + remove + { + _client.RemoveEventHandler("Audits.issueAdded", value); + } + } + + partial void ValidateGetEncodedResponse(string requestId, CefSharp.DevTools.Audits.GetEncodedResponseEncoding encoding, double? quality = null, bool? sizeOnly = null); + /// + /// Returns the response body and size if it were re-encoded with the specified settings. Only + /// applies to images. + /// + /// Identifier of the network request to get content for. + /// The encoding to use. + /// The quality of the encoding (0-1). (defaults to 1) + /// Whether to only return the size information (defaults to false). + /// returns System.Threading.Tasks.Task<GetEncodedResponseResponse> + public System.Threading.Tasks.Task GetEncodedResponseAsync(string requestId, CefSharp.DevTools.Audits.GetEncodedResponseEncoding encoding, double? quality = null, bool? sizeOnly = null) + { + ValidateGetEncodedResponse(requestId, encoding, quality, sizeOnly); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("encoding", EnumToString(encoding)); + if (quality.HasValue) + { + dict.Add("quality", quality.Value); + } + + if (sizeOnly.HasValue) + { + dict.Add("sizeOnly", sizeOnly.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Audits.getEncodedResponse", dict); + } + + /// + /// Disables issues domain, prevents further issues from being reported to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Audits.disable", dict); + } + + /// + /// Enables issues domain, sends the issues collected so far to the client by means of the + /// `issueAdded` event. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Audits.enable", dict); + } + + partial void ValidateCheckContrast(bool? reportAAA = null); + /// + /// Runs the contrast check for the target page. Found issues are reported + /// using Audits.issueAdded event. + /// + /// Whether to report WCAG AAA level issues. Default is false. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CheckContrastAsync(bool? reportAAA = null) + { + ValidateCheckContrast(reportAAA); + var dict = new System.Collections.Generic.Dictionary(); + if (reportAAA.HasValue) + { + dict.Add("reportAAA", reportAAA.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Audits.checkContrast", dict); + } + + /// + /// Runs the form issues check for the target page. Found issues are reported + /// using Audits.issueAdded event. + /// + /// returns System.Threading.Tasks.Task<CheckFormsIssuesResponse> + public System.Threading.Tasks.Task CheckFormsIssuesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Audits.checkFormsIssues", dict); + } + } +} + +namespace CefSharp.DevTools.Autofill +{ + using System.Linq; + + /// + /// Defines commands and events for Autofill. + /// + public partial class AutofillClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Autofill + /// + /// DevToolsClient + public AutofillClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Emitted when an address form is filled. + /// + public event System.EventHandler AddressFormFilled + { + add + { + _client.AddEventHandler("Autofill.addressFormFilled", value); + } + + remove + { + _client.RemoveEventHandler("Autofill.addressFormFilled", value); + } + } + + partial void ValidateTrigger(int fieldId, string frameId = null, CefSharp.DevTools.Autofill.CreditCard card = null, CefSharp.DevTools.Autofill.Address address = null); + /// + /// Trigger autofill on a form identified by the fieldId. + /// If the field and related form cannot be autofilled, returns an error. + /// + /// Identifies a field that serves as an anchor for autofill. + /// Identifies the frame that field belongs to. + /// Credit card information to fill out the form. Credit card data is not saved. Mutually exclusive with `address`. + /// Address to fill out the form. Address data is not saved. Mutually exclusive with `card`. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TriggerAsync(int fieldId, string frameId = null, CefSharp.DevTools.Autofill.CreditCard card = null, CefSharp.DevTools.Autofill.Address address = null) + { + ValidateTrigger(fieldId, frameId, card, address); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("fieldId", fieldId); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + if ((card) != (null)) + { + dict.Add("card", card.ToDictionary()); + } + + if ((address) != (null)) + { + dict.Add("address", address.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Autofill.trigger", dict); + } + + partial void ValidateSetAddresses(System.Collections.Generic.IList addresses); + /// + /// Set addresses so that developers can verify their forms implementation. + /// + /// addresses + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAddressesAsync(System.Collections.Generic.IList addresses) + { + ValidateSetAddresses(addresses); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("addresses", addresses.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Autofill.setAddresses", dict); + } + + /// + /// Disables autofill domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Autofill.disable", dict); + } + + /// + /// Enables autofill domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Autofill.enable", dict); + } + } +} + +namespace CefSharp.DevTools.BackgroundService +{ + using System.Linq; + + /// + /// Defines events for background web platform features. + /// + public partial class BackgroundServiceClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// BackgroundService + /// + /// DevToolsClient + public BackgroundServiceClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Called when the recording state for the service has been updated. + /// + public event System.EventHandler RecordingStateChanged + { + add + { + _client.AddEventHandler("BackgroundService.recordingStateChanged", value); + } + + remove + { + _client.RemoveEventHandler("BackgroundService.recordingStateChanged", value); + } + } + + /// + /// Called with all existing backgroundServiceEvents when enabled, and all new + /// events afterwards if enabled and recording. + /// + public event System.EventHandler BackgroundServiceEventReceived + { + add + { + _client.AddEventHandler("BackgroundService.backgroundServiceEventReceived", value); + } + + remove + { + _client.RemoveEventHandler("BackgroundService.backgroundServiceEventReceived", value); + } + } + + partial void ValidateStartObserving(CefSharp.DevTools.BackgroundService.ServiceName service); + /// + /// Enables event updates for the service. + /// + /// service + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartObservingAsync(CefSharp.DevTools.BackgroundService.ServiceName service) + { + ValidateStartObserving(service); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("service", EnumToString(service)); + return _client.ExecuteDevToolsMethodAsync("BackgroundService.startObserving", dict); + } + + partial void ValidateStopObserving(CefSharp.DevTools.BackgroundService.ServiceName service); + /// + /// Disables event updates for the service. + /// + /// service + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopObservingAsync(CefSharp.DevTools.BackgroundService.ServiceName service) + { + ValidateStopObserving(service); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("service", EnumToString(service)); + return _client.ExecuteDevToolsMethodAsync("BackgroundService.stopObserving", dict); + } + + partial void ValidateSetRecording(bool shouldRecord, CefSharp.DevTools.BackgroundService.ServiceName service); + /// + /// Set the recording state for the service. + /// + /// shouldRecord + /// service + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetRecordingAsync(bool shouldRecord, CefSharp.DevTools.BackgroundService.ServiceName service) + { + ValidateSetRecording(shouldRecord, service); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("shouldRecord", shouldRecord); + dict.Add("service", EnumToString(service)); + return _client.ExecuteDevToolsMethodAsync("BackgroundService.setRecording", dict); + } + + partial void ValidateClearEvents(CefSharp.DevTools.BackgroundService.ServiceName service); + /// + /// Clears all stored data for the service. + /// + /// service + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearEventsAsync(CefSharp.DevTools.BackgroundService.ServiceName service) + { + ValidateClearEvents(service); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("service", EnumToString(service)); + return _client.ExecuteDevToolsMethodAsync("BackgroundService.clearEvents", dict); + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + /// + /// AddServiceResponse + /// + [DataContract] + public class AddServiceResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string serviceId + { + get; + set; + } + + /// + /// serviceId + /// + public string ServiceId + { + get + { + return serviceId; + } + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + /// + /// AddCharacteristicResponse + /// + [DataContract] + public class AddCharacteristicResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string characteristicId + { + get; + set; + } + + /// + /// characteristicId + /// + public string CharacteristicId + { + get + { + return characteristicId; + } + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + /// + /// AddDescriptorResponse + /// + [DataContract] + public class AddDescriptorResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string descriptorId + { + get; + set; + } + + /// + /// descriptorId + /// + public string DescriptorId + { + get + { + return descriptorId; + } + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + using System.Linq; + + /// + /// This domain allows configuring virtual Bluetooth devices to test + /// the web-bluetooth API. + /// + public partial class BluetoothEmulationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// BluetoothEmulation + /// + /// DevToolsClient + public BluetoothEmulationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Event for when a GATT operation of |type| to the peripheral with |address| + /// happened. + /// + public event System.EventHandler GattOperationReceived + { + add + { + _client.AddEventHandler("BluetoothEmulation.gattOperationReceived", value); + } + + remove + { + _client.RemoveEventHandler("BluetoothEmulation.gattOperationReceived", value); + } + } + + /// + /// Event for when a characteristic operation of |type| to the characteristic + /// respresented by |characteristicId| happened. |data| and |writeType| is + /// expected to exist when |type| is write. + /// + public event System.EventHandler CharacteristicOperationReceived + { + add + { + _client.AddEventHandler("BluetoothEmulation.characteristicOperationReceived", value); + } + + remove + { + _client.RemoveEventHandler("BluetoothEmulation.characteristicOperationReceived", value); + } + } + + /// + /// Event for when a descriptor operation of |type| to the descriptor + /// respresented by |descriptorId| happened. |data| is expected to exist when + /// |type| is write. + /// + public event System.EventHandler DescriptorOperationReceived + { + add + { + _client.AddEventHandler("BluetoothEmulation.descriptorOperationReceived", value); + } + + remove + { + _client.RemoveEventHandler("BluetoothEmulation.descriptorOperationReceived", value); + } + } + + partial void ValidateEnable(CefSharp.DevTools.BluetoothEmulation.CentralState state, bool leSupported); + /// + /// Enable the BluetoothEmulation domain. + /// + /// State of the simulated central. + /// If the simulated central supports low-energy. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(CefSharp.DevTools.BluetoothEmulation.CentralState state, bool leSupported) + { + ValidateEnable(state, leSupported); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("state", EnumToString(state)); + dict.Add("leSupported", leSupported); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.enable", dict); + } + + partial void ValidateSetSimulatedCentralState(CefSharp.DevTools.BluetoothEmulation.CentralState state); + /// + /// Set the state of the simulated central. + /// + /// State of the simulated central. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSimulatedCentralStateAsync(CefSharp.DevTools.BluetoothEmulation.CentralState state) + { + ValidateSetSimulatedCentralState(state); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("state", EnumToString(state)); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.setSimulatedCentralState", dict); + } + + /// + /// Disable the BluetoothEmulation domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.disable", dict); + } + + partial void ValidateSimulatePreconnectedPeripheral(string address, string name, System.Collections.Generic.IList manufacturerData, string[] knownServiceUuids); + /// + /// Simulates a peripheral with |address|, |name| and |knownServiceUuids| + /// that has already been connected to the system. + /// + /// address + /// name + /// manufacturerData + /// knownServiceUuids + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulatePreconnectedPeripheralAsync(string address, string name, System.Collections.Generic.IList manufacturerData, string[] knownServiceUuids) + { + ValidateSimulatePreconnectedPeripheral(address, name, manufacturerData, knownServiceUuids); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("address", address); + dict.Add("name", name); + dict.Add("manufacturerData", manufacturerData.Select(x => x.ToDictionary())); + dict.Add("knownServiceUuids", knownServiceUuids); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulatePreconnectedPeripheral", dict); + } + + partial void ValidateSimulateAdvertisement(CefSharp.DevTools.BluetoothEmulation.ScanEntry entry); + /// + /// Simulates an advertisement packet described in |entry| being received by + /// the central. + /// + /// entry + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateAdvertisementAsync(CefSharp.DevTools.BluetoothEmulation.ScanEntry entry) + { + ValidateSimulateAdvertisement(entry); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("entry", entry.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateAdvertisement", dict); + } + + partial void ValidateSimulateGATTOperationResponse(string address, CefSharp.DevTools.BluetoothEmulation.GATTOperationType type, int code); + /// + /// Simulates the response code from the peripheral with |address| for a + /// GATT operation of |type|. The |code| value follows the HCI Error Codes from + /// Bluetooth Core Specification Vol 2 Part D 1.3 List Of Error Codes. + /// + /// address + /// type + /// code + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateGATTOperationResponseAsync(string address, CefSharp.DevTools.BluetoothEmulation.GATTOperationType type, int code) + { + ValidateSimulateGATTOperationResponse(address, type, code); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("address", address); + dict.Add("type", EnumToString(type)); + dict.Add("code", code); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateGATTOperationResponse", dict); + } + + partial void ValidateSimulateCharacteristicOperationResponse(string characteristicId, CefSharp.DevTools.BluetoothEmulation.CharacteristicOperationType type, int code, byte[] data = null); + /// + /// Simulates the response from the characteristic with |characteristicId| for a + /// characteristic operation of |type|. The |code| value follows the Error + /// Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. + /// The |data| is expected to exist when simulating a successful read operation + /// response. + /// + /// characteristicId + /// type + /// code + /// data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateCharacteristicOperationResponseAsync(string characteristicId, CefSharp.DevTools.BluetoothEmulation.CharacteristicOperationType type, int code, byte[] data = null) + { + ValidateSimulateCharacteristicOperationResponse(characteristicId, type, code, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("characteristicId", characteristicId); + dict.Add("type", EnumToString(type)); + dict.Add("code", code); + if ((data) != (null)) + { + dict.Add("data", ToBase64String(data)); + } + + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateCharacteristicOperationResponse", dict); + } + + partial void ValidateSimulateDescriptorOperationResponse(string descriptorId, CefSharp.DevTools.BluetoothEmulation.DescriptorOperationType type, int code, byte[] data = null); + /// + /// Simulates the response from the descriptor with |descriptorId| for a + /// descriptor operation of |type|. The |code| value follows the Error + /// Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. + /// The |data| is expected to exist when simulating a successful read operation + /// response. + /// + /// descriptorId + /// type + /// code + /// data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateDescriptorOperationResponseAsync(string descriptorId, CefSharp.DevTools.BluetoothEmulation.DescriptorOperationType type, int code, byte[] data = null) + { + ValidateSimulateDescriptorOperationResponse(descriptorId, type, code, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("descriptorId", descriptorId); + dict.Add("type", EnumToString(type)); + dict.Add("code", code); + if ((data) != (null)) + { + dict.Add("data", ToBase64String(data)); + } + + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateDescriptorOperationResponse", dict); + } + + partial void ValidateAddService(string address, string serviceUuid); + /// + /// Adds a service with |serviceUuid| to the peripheral with |address|. + /// + /// address + /// serviceUuid + /// returns System.Threading.Tasks.Task<AddServiceResponse> + public System.Threading.Tasks.Task AddServiceAsync(string address, string serviceUuid) + { + ValidateAddService(address, serviceUuid); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("address", address); + dict.Add("serviceUuid", serviceUuid); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.addService", dict); + } + + partial void ValidateRemoveService(string serviceId); + /// + /// Removes the service respresented by |serviceId| from the simulated central. + /// + /// serviceId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveServiceAsync(string serviceId) + { + ValidateRemoveService(serviceId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("serviceId", serviceId); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.removeService", dict); + } + + partial void ValidateAddCharacteristic(string serviceId, string characteristicUuid, CefSharp.DevTools.BluetoothEmulation.CharacteristicProperties properties); + /// + /// Adds a characteristic with |characteristicUuid| and |properties| to the + /// service represented by |serviceId|. + /// + /// serviceId + /// characteristicUuid + /// properties + /// returns System.Threading.Tasks.Task<AddCharacteristicResponse> + public System.Threading.Tasks.Task AddCharacteristicAsync(string serviceId, string characteristicUuid, CefSharp.DevTools.BluetoothEmulation.CharacteristicProperties properties) + { + ValidateAddCharacteristic(serviceId, characteristicUuid, properties); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("serviceId", serviceId); + dict.Add("characteristicUuid", characteristicUuid); + dict.Add("properties", properties.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.addCharacteristic", dict); + } + + partial void ValidateRemoveCharacteristic(string characteristicId); + /// + /// Removes the characteristic respresented by |characteristicId| from the + /// simulated central. + /// + /// characteristicId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveCharacteristicAsync(string characteristicId) + { + ValidateRemoveCharacteristic(characteristicId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("characteristicId", characteristicId); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.removeCharacteristic", dict); + } + + partial void ValidateAddDescriptor(string characteristicId, string descriptorUuid); + /// + /// Adds a descriptor with |descriptorUuid| to the characteristic respresented + /// by |characteristicId|. + /// + /// characteristicId + /// descriptorUuid + /// returns System.Threading.Tasks.Task<AddDescriptorResponse> + public System.Threading.Tasks.Task AddDescriptorAsync(string characteristicId, string descriptorUuid) + { + ValidateAddDescriptor(characteristicId, descriptorUuid); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("characteristicId", characteristicId); + dict.Add("descriptorUuid", descriptorUuid); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.addDescriptor", dict); + } + + partial void ValidateRemoveDescriptor(string descriptorId); + /// + /// Removes the descriptor with |descriptorId| from the simulated central. + /// + /// descriptorId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveDescriptorAsync(string descriptorId) + { + ValidateRemoveDescriptor(descriptorId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("descriptorId", descriptorId); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.removeDescriptor", dict); + } + + partial void ValidateSimulateGATTDisconnection(string address); + /// + /// Simulates a GATT disconnection from the peripheral with |address|. + /// + /// address + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateGATTDisconnectionAsync(string address) + { + ValidateSimulateGATTDisconnection(address); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("address", address); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateGATTDisconnection", dict); + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetVersionResponse + /// + [DataContract] + public class GetVersionResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string protocolVersion + { + get; + set; + } + + /// + /// protocolVersion + /// + public string ProtocolVersion + { + get + { + return protocolVersion; + } + } + + [DataMember] + internal string product + { + get; + set; + } + + /// + /// product + /// + public string Product + { + get + { + return product; + } + } + + [DataMember] + internal string revision + { + get; + set; + } + + /// + /// revision + /// + public string Revision + { + get + { + return revision; + } + } + + [DataMember] + internal string userAgent + { + get; + set; + } + + /// + /// userAgent + /// + public string UserAgent + { + get + { + return userAgent; + } + } + + [DataMember] + internal string jsVersion + { + get; + set; + } + + /// + /// jsVersion + /// + public string JsVersion + { + get + { + return jsVersion; + } + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetBrowserCommandLineResponse + /// + [DataContract] + public class GetBrowserCommandLineResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] arguments + { + get; + set; + } + + /// + /// arguments + /// + public string[] Arguments + { + get + { + return arguments; + } + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetHistogramsResponse + /// + [DataContract] + public class GetHistogramsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList histograms + { + get; + set; + } + + /// + /// histograms + /// + public System.Collections.Generic.IList Histograms + { + get + { + return histograms; + } + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetHistogramResponse + /// + [DataContract] + public class GetHistogramResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Browser.Histogram histogram + { + get; + set; + } + + /// + /// histogram + /// + public CefSharp.DevTools.Browser.Histogram Histogram + { + get + { + return histogram; + } + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetWindowBoundsResponse + /// + [DataContract] + public class GetWindowBoundsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Browser.Bounds bounds + { + get; + set; + } + + /// + /// bounds + /// + public CefSharp.DevTools.Browser.Bounds Bounds + { + get + { + return bounds; + } + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetWindowForTargetResponse + /// + [DataContract] + public class GetWindowForTargetResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int windowId + { + get; + set; + } + + /// + /// windowId + /// + public int WindowId + { + get + { + return windowId; + } + } + + [DataMember] + internal CefSharp.DevTools.Browser.Bounds bounds + { + get; + set; + } + + /// + /// bounds + /// + public CefSharp.DevTools.Browser.Bounds Bounds + { + get + { + return bounds; + } + } + } +} + +namespace CefSharp.DevTools.Browser +{ + using System.Linq; + + /// + /// Whether to allow all or deny all download requests, or use default Chrome behavior if + /// available (otherwise deny). |allowAndName| allows download and names files according to + /// their download guids. + /// + public enum SetDownloadBehaviorBehavior + { + /// + /// deny + /// + [EnumMember(Value = ("deny"))] + Deny, + /// + /// allow + /// + [EnumMember(Value = ("allow"))] + Allow, + /// + /// allowAndName + /// + [EnumMember(Value = ("allowAndName"))] + AllowAndName, + /// + /// default + /// + [EnumMember(Value = ("default"))] + Default + } + + /// + /// The Browser domain defines methods and events for browser managing. + /// + public partial class BrowserClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Browser + /// + /// DevToolsClient + public BrowserClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when page is about to start a download. + /// + public event System.EventHandler DownloadWillBegin + { + add + { + _client.AddEventHandler("Browser.downloadWillBegin", value); + } + + remove + { + _client.RemoveEventHandler("Browser.downloadWillBegin", value); + } + } + + /// + /// Fired when download makes progress. Last call has |done| == true. + /// + public event System.EventHandler DownloadProgress + { + add + { + _client.AddEventHandler("Browser.downloadProgress", value); + } + + remove + { + _client.RemoveEventHandler("Browser.downloadProgress", value); + } + } + + partial void ValidateSetPermission(CefSharp.DevTools.Browser.PermissionDescriptor permission, CefSharp.DevTools.Browser.PermissionSetting setting, string origin = null, string embeddedOrigin = null, string browserContextId = null); + /// + /// Set permission settings for given embedding and embedded origins. + /// + /// Descriptor of permission to override. + /// Setting of the permission. + /// Embedding origin the permission applies to, all origins if not specified. + /// Embedded origin the permission applies to. It is ignored unless the embedding origin ispresent and valid. If the embedding origin is provided but the embedded origin isn't, theembedding origin is used as the embedded origin. + /// Context to override. When omitted, default browser context is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPermissionAsync(CefSharp.DevTools.Browser.PermissionDescriptor permission, CefSharp.DevTools.Browser.PermissionSetting setting, string origin = null, string embeddedOrigin = null, string browserContextId = null) + { + ValidateSetPermission(permission, setting, origin, embeddedOrigin, browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("permission", permission.ToDictionary()); + dict.Add("setting", EnumToString(setting)); + if (!(string.IsNullOrEmpty(origin))) + { + dict.Add("origin", origin); + } + + if (!(string.IsNullOrEmpty(embeddedOrigin))) + { + dict.Add("embeddedOrigin", embeddedOrigin); + } + + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.setPermission", dict); + } + + partial void ValidateResetPermissions(string browserContextId = null); + /// + /// Reset all permission management for all origins. + /// + /// BrowserContext to reset permissions. When omitted, default browser context is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetPermissionsAsync(string browserContextId = null) + { + ValidateResetPermissions(browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.resetPermissions", dict); + } + + partial void ValidateSetDownloadBehavior(CefSharp.DevTools.Browser.SetDownloadBehaviorBehavior behavior, string browserContextId = null, string downloadPath = null, bool? eventsEnabled = null); + /// + /// Set the behavior when downloading a file. + /// + /// Whether to allow all or deny all download requests, or use default Chrome behavior ifavailable (otherwise deny). |allowAndName| allows download and names files according totheir download guids. + /// BrowserContext to set download behavior. When omitted, default browser context is used. + /// The default path to save downloaded files to. This is required if behavior is set to 'allow'or 'allowAndName'. + /// Whether to emit download events (defaults to false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDownloadBehaviorAsync(CefSharp.DevTools.Browser.SetDownloadBehaviorBehavior behavior, string browserContextId = null, string downloadPath = null, bool? eventsEnabled = null) + { + ValidateSetDownloadBehavior(behavior, browserContextId, downloadPath, eventsEnabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("behavior", EnumToString(behavior)); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + if (!(string.IsNullOrEmpty(downloadPath))) + { + dict.Add("downloadPath", downloadPath); + } + + if (eventsEnabled.HasValue) + { + dict.Add("eventsEnabled", eventsEnabled.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.setDownloadBehavior", dict); + } + + partial void ValidateCancelDownload(string guid, string browserContextId = null); + /// + /// Cancel a download if in progress + /// + /// Global unique identifier of the download. + /// BrowserContext to perform the action in. When omitted, default browser context is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CancelDownloadAsync(string guid, string browserContextId = null) + { + ValidateCancelDownload(guid, browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("guid", guid); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.cancelDownload", dict); + } + + /// + /// Close browser gracefully. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CloseAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.close", dict); + } + + /// + /// Crashes browser on the main thread. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CrashAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.crash", dict); + } + + /// + /// Crashes GPU process. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CrashGpuProcessAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.crashGpuProcess", dict); + } + + /// + /// Returns version information. + /// + /// returns System.Threading.Tasks.Task<GetVersionResponse> + public System.Threading.Tasks.Task GetVersionAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.getVersion", dict); + } + + /// + /// Returns the command line switches for the browser process if, and only if + /// --enable-automation is on the commandline. + /// + /// returns System.Threading.Tasks.Task<GetBrowserCommandLineResponse> + public System.Threading.Tasks.Task GetBrowserCommandLineAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.getBrowserCommandLine", dict); + } + + partial void ValidateGetHistograms(string query = null, bool? delta = null); + /// + /// Get Chrome histograms. + /// + /// Requested substring in name. Only histograms which have query as asubstring in their name are extracted. An empty or absent query returnsall histograms. + /// If true, retrieve delta since last delta call. + /// returns System.Threading.Tasks.Task<GetHistogramsResponse> + public System.Threading.Tasks.Task GetHistogramsAsync(string query = null, bool? delta = null) + { + ValidateGetHistograms(query, delta); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(query))) + { + dict.Add("query", query); + } + + if (delta.HasValue) + { + dict.Add("delta", delta.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.getHistograms", dict); + } + + partial void ValidateGetHistogram(string name, bool? delta = null); + /// + /// Get a Chrome histogram by name. + /// + /// Requested histogram name. + /// If true, retrieve delta since last delta call. + /// returns System.Threading.Tasks.Task<GetHistogramResponse> + public System.Threading.Tasks.Task GetHistogramAsync(string name, bool? delta = null) + { + ValidateGetHistogram(name, delta); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + if (delta.HasValue) + { + dict.Add("delta", delta.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.getHistogram", dict); + } + + partial void ValidateGetWindowBounds(int windowId); + /// + /// Get position and size of the browser window. + /// + /// Browser window id. + /// returns System.Threading.Tasks.Task<GetWindowBoundsResponse> + public System.Threading.Tasks.Task GetWindowBoundsAsync(int windowId) + { + ValidateGetWindowBounds(windowId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("windowId", windowId); + return _client.ExecuteDevToolsMethodAsync("Browser.getWindowBounds", dict); + } + + partial void ValidateGetWindowForTarget(string targetId = null); + /// + /// Get the browser window that contains the devtools target. + /// + /// Devtools agent host id. If called as a part of the session, associated targetId is used. + /// returns System.Threading.Tasks.Task<GetWindowForTargetResponse> + public System.Threading.Tasks.Task GetWindowForTargetAsync(string targetId = null) + { + ValidateGetWindowForTarget(targetId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(targetId))) + { + dict.Add("targetId", targetId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.getWindowForTarget", dict); + } + + partial void ValidateSetWindowBounds(int windowId, CefSharp.DevTools.Browser.Bounds bounds); + /// + /// Set position and/or size of the browser window. + /// + /// Browser window id. + /// New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combinedwith 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetWindowBoundsAsync(int windowId, CefSharp.DevTools.Browser.Bounds bounds) + { + ValidateSetWindowBounds(windowId, bounds); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("windowId", windowId); + dict.Add("bounds", bounds.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Browser.setWindowBounds", dict); + } + + partial void ValidateSetContentsSize(int windowId, int? width = null, int? height = null); + /// + /// Set size of the browser contents resizing browser window as necessary. + /// + /// Browser window id. + /// The window contents width in DIP. Assumes current width if omitted.Must be specified if 'height' is omitted. + /// The window contents height in DIP. Assumes current height if omitted.Must be specified if 'width' is omitted. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetContentsSizeAsync(int windowId, int? width = null, int? height = null) + { + ValidateSetContentsSize(windowId, width, height); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("windowId", windowId); + if (width.HasValue) + { + dict.Add("width", width.Value); + } + + if (height.HasValue) + { + dict.Add("height", height.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.setContentsSize", dict); + } + + partial void ValidateSetDockTile(string badgeLabel = null, byte[] image = null); + /// + /// Set dock tile details, platform-specific. + /// + /// badgeLabel + /// Png encoded image. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDockTileAsync(string badgeLabel = null, byte[] image = null) + { + ValidateSetDockTile(badgeLabel, image); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(badgeLabel))) + { + dict.Add("badgeLabel", badgeLabel); + } + + if ((image) != (null)) + { + dict.Add("image", ToBase64String(image)); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.setDockTile", dict); + } + + partial void ValidateExecuteBrowserCommand(CefSharp.DevTools.Browser.BrowserCommandId commandId); + /// + /// Invoke custom browser commands used by telemetry. + /// + /// commandId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ExecuteBrowserCommandAsync(CefSharp.DevTools.Browser.BrowserCommandId commandId) + { + ValidateExecuteBrowserCommand(commandId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("commandId", EnumToString(commandId)); + return _client.ExecuteDevToolsMethodAsync("Browser.executeBrowserCommand", dict); + } + + partial void ValidateAddPrivacySandboxEnrollmentOverride(string url); + /// + /// Allows a site to use privacy sandbox features that require enrollment + /// without the site actually being enrolled. Only supported on page targets. + /// + /// url + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddPrivacySandboxEnrollmentOverrideAsync(string url) + { + ValidateAddPrivacySandboxEnrollmentOverride(url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + return _client.ExecuteDevToolsMethodAsync("Browser.addPrivacySandboxEnrollmentOverride", dict); + } + + partial void ValidateAddPrivacySandboxCoordinatorKeyConfig(CefSharp.DevTools.Browser.PrivacySandboxAPI api, string coordinatorOrigin, string keyConfig, string browserContextId = null); + /// + /// Configures encryption keys used with a given privacy sandbox API to talk + /// to a trusted coordinator. Since this is intended for test automation only, + /// coordinatorOrigin must be a .test domain. No existing coordinator + /// configuration for the origin may exist. + /// + /// api + /// coordinatorOrigin + /// keyConfig + /// BrowserContext to perform the action in. When omitted, default browsercontext is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddPrivacySandboxCoordinatorKeyConfigAsync(CefSharp.DevTools.Browser.PrivacySandboxAPI api, string coordinatorOrigin, string keyConfig, string browserContextId = null) + { + ValidateAddPrivacySandboxCoordinatorKeyConfig(api, coordinatorOrigin, keyConfig, browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("api", EnumToString(api)); + dict.Add("coordinatorOrigin", coordinatorOrigin); + dict.Add("keyConfig", keyConfig); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.addPrivacySandboxCoordinatorKeyConfig", dict); + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// AddRuleResponse + /// + [DataContract] + public class AddRuleResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.CSSRule rule + { + get; + set; + } + + /// + /// rule + /// + public CefSharp.DevTools.CSS.CSSRule Rule + { + get + { + return rule; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// CollectClassNamesResponse + /// + [DataContract] + public class CollectClassNamesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] classNames + { + get; + set; + } + + /// + /// classNames + /// + public string[] ClassNames + { + get + { + return classNames; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// CreateStyleSheetResponse + /// + [DataContract] + public class CreateStyleSheetResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string styleSheetId + { + get; + set; + } + + /// + /// styleSheetId + /// + public string StyleSheetId + { + get + { + return styleSheetId; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetBackgroundColorsResponse + /// + [DataContract] + public class GetBackgroundColorsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] backgroundColors + { + get; + set; + } + + /// + /// backgroundColors + /// + public string[] BackgroundColors + { + get + { + return backgroundColors; + } + } + + [DataMember] + internal string computedFontSize + { + get; + set; + } + + /// + /// computedFontSize + /// + public string ComputedFontSize + { + get + { + return computedFontSize; + } + } + + [DataMember] + internal string computedFontWeight + { + get; + set; + } + + /// + /// computedFontWeight + /// + public string ComputedFontWeight + { + get + { + return computedFontWeight; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetComputedStyleForNodeResponse + /// + [DataContract] + public class GetComputedStyleForNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList computedStyle + { + get; + set; + } + + /// + /// computedStyle + /// + public System.Collections.Generic.IList ComputedStyle + { + get + { + return computedStyle; + } + } + + [DataMember] + internal CefSharp.DevTools.CSS.ComputedStyleExtraFields extraFields + { + get; + set; + } + + /// + /// extraFields + /// + public CefSharp.DevTools.CSS.ComputedStyleExtraFields ExtraFields + { + get + { + return extraFields; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// ResolveValuesResponse + /// + [DataContract] + public class ResolveValuesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] results + { + get; + set; + } + + /// + /// results + /// + public string[] Results + { + get + { + return results; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetLonghandPropertiesResponse + /// + [DataContract] + public class GetLonghandPropertiesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList longhandProperties + { + get; + set; + } + + /// + /// longhandProperties + /// + public System.Collections.Generic.IList LonghandProperties + { + get + { + return longhandProperties; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetInlineStylesForNodeResponse + /// + [DataContract] + public class GetInlineStylesForNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.CSSStyle inlineStyle + { + get; + set; + } + + /// + /// inlineStyle + /// + public CefSharp.DevTools.CSS.CSSStyle InlineStyle + { + get + { + return inlineStyle; + } + } + + [DataMember] + internal CefSharp.DevTools.CSS.CSSStyle attributesStyle + { + get; + set; + } + + /// + /// attributesStyle + /// + public CefSharp.DevTools.CSS.CSSStyle AttributesStyle + { + get + { + return attributesStyle; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetAnimatedStylesForNodeResponse + /// + [DataContract] + public class GetAnimatedStylesForNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList animationStyles + { + get; + set; + } + + /// + /// animationStyles + /// + public System.Collections.Generic.IList AnimationStyles + { + get + { + return animationStyles; + } + } + + [DataMember] + internal CefSharp.DevTools.CSS.CSSStyle transitionsStyle + { + get; + set; + } + + /// + /// transitionsStyle + /// + public CefSharp.DevTools.CSS.CSSStyle TransitionsStyle + { + get + { + return transitionsStyle; + } + } + + [DataMember] + internal System.Collections.Generic.IList inherited + { + get; + set; + } + + /// + /// inherited + /// + public System.Collections.Generic.IList Inherited + { + get + { + return inherited; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetMatchedStylesForNodeResponse + /// + [DataContract] + public class GetMatchedStylesForNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.CSSStyle inlineStyle + { + get; + set; + } + + /// + /// inlineStyle + /// + public CefSharp.DevTools.CSS.CSSStyle InlineStyle + { + get + { + return inlineStyle; + } + } + + [DataMember] + internal CefSharp.DevTools.CSS.CSSStyle attributesStyle + { + get; + set; + } + + /// + /// attributesStyle + /// + public CefSharp.DevTools.CSS.CSSStyle AttributesStyle + { + get + { + return attributesStyle; + } + } + + [DataMember] + internal System.Collections.Generic.IList matchedCSSRules + { + get; + set; + } + + /// + /// matchedCSSRules + /// + public System.Collections.Generic.IList MatchedCSSRules + { + get + { + return matchedCSSRules; + } + } + + [DataMember] + internal System.Collections.Generic.IList pseudoElements + { + get; + set; + } + + /// + /// pseudoElements + /// + public System.Collections.Generic.IList PseudoElements + { + get + { + return pseudoElements; + } + } + + [DataMember] + internal System.Collections.Generic.IList inherited + { + get; + set; + } + + /// + /// inherited + /// + public System.Collections.Generic.IList Inherited + { + get + { + return inherited; + } + } + + [DataMember] + internal System.Collections.Generic.IList inheritedPseudoElements + { + get; + set; + } + + /// + /// inheritedPseudoElements + /// + public System.Collections.Generic.IList InheritedPseudoElements + { + get + { + return inheritedPseudoElements; + } + } + + [DataMember] + internal System.Collections.Generic.IList cssKeyframesRules + { + get; + set; + } + + /// + /// cssKeyframesRules + /// + public System.Collections.Generic.IList CssKeyframesRules + { + get + { + return cssKeyframesRules; + } + } + + [DataMember] + internal System.Collections.Generic.IList cssPositionTryRules + { + get; + set; + } + + /// + /// cssPositionTryRules + /// + public System.Collections.Generic.IList CssPositionTryRules + { + get + { + return cssPositionTryRules; + } + } + + [DataMember] + internal int? activePositionFallbackIndex + { + get; + set; + } + + /// + /// activePositionFallbackIndex + /// + public int? ActivePositionFallbackIndex + { + get + { + return activePositionFallbackIndex; + } + } + + [DataMember] + internal System.Collections.Generic.IList cssPropertyRules + { + get; + set; + } + + /// + /// cssPropertyRules + /// + public System.Collections.Generic.IList CssPropertyRules + { + get + { + return cssPropertyRules; + } + } + + [DataMember] + internal System.Collections.Generic.IList cssPropertyRegistrations + { + get; + set; + } + + /// + /// cssPropertyRegistrations + /// + public System.Collections.Generic.IList CssPropertyRegistrations + { + get + { + return cssPropertyRegistrations; + } + } + + [DataMember] + internal System.Collections.Generic.IList cssAtRules + { + get; + set; + } + + /// + /// cssAtRules + /// + public System.Collections.Generic.IList CssAtRules + { + get + { + return cssAtRules; + } + } + + [DataMember] + internal int? parentLayoutNodeId + { + get; + set; + } + + /// + /// parentLayoutNodeId + /// + public int? ParentLayoutNodeId + { + get + { + return parentLayoutNodeId; + } + } + + [DataMember] + internal System.Collections.Generic.IList cssFunctionRules + { + get; + set; + } + + /// + /// cssFunctionRules + /// + public System.Collections.Generic.IList CssFunctionRules + { + get + { + return cssFunctionRules; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetEnvironmentVariablesResponse + /// + [DataContract] + public class GetEnvironmentVariablesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal object environmentVariables + { + get; + set; + } + + /// + /// environmentVariables + /// + public object EnvironmentVariables + { + get + { + return environmentVariables; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetMediaQueriesResponse + /// + [DataContract] + public class GetMediaQueriesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList medias + { + get; + set; + } + + /// + /// medias + /// + public System.Collections.Generic.IList Medias + { + get + { + return medias; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetPlatformFontsForNodeResponse + /// + [DataContract] + public class GetPlatformFontsForNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList fonts + { + get; + set; + } + + /// + /// fonts + /// + public System.Collections.Generic.IList Fonts + { + get + { + return fonts; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetStyleSheetTextResponse + /// + [DataContract] + public class GetStyleSheetTextResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string text + { + get; + set; + } + + /// + /// text + /// + public string Text + { + get + { + return text; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetLayersForNodeResponse + /// + [DataContract] + public class GetLayersForNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.CSSLayerData rootLayer + { + get; + set; + } + + /// + /// rootLayer + /// + public CefSharp.DevTools.CSS.CSSLayerData RootLayer + { + get + { + return rootLayer; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetLocationForSelectorResponse + /// + [DataContract] + public class GetLocationForSelectorResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList ranges + { + get; + set; + } + + /// + /// ranges + /// + public System.Collections.Generic.IList Ranges + { + get + { + return ranges; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// TakeComputedStyleUpdatesResponse + /// + [DataContract] + public class TakeComputedStyleUpdatesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int[] nodeIds + { + get; + set; + } + + /// + /// nodeIds + /// + public int[] NodeIds + { + get + { + return nodeIds; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetPropertyRulePropertyNameResponse + /// + [DataContract] + public class SetPropertyRulePropertyNameResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.Value propertyName + { + get; + set; + } + + /// + /// propertyName + /// + public CefSharp.DevTools.CSS.Value PropertyName + { + get + { + return propertyName; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetKeyframeKeyResponse + /// + [DataContract] + public class SetKeyframeKeyResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.Value keyText + { + get; + set; + } + + /// + /// keyText + /// + public CefSharp.DevTools.CSS.Value KeyText + { + get + { + return keyText; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetMediaTextResponse + /// + [DataContract] + public class SetMediaTextResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.CSSMedia media + { + get; + set; + } + + /// + /// media + /// + public CefSharp.DevTools.CSS.CSSMedia Media + { + get + { + return media; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetContainerQueryTextResponse + /// + [DataContract] + public class SetContainerQueryTextResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.CSSContainerQuery containerQuery + { + get; + set; + } + + /// + /// containerQuery + /// + public CefSharp.DevTools.CSS.CSSContainerQuery ContainerQuery + { + get + { + return containerQuery; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetSupportsTextResponse + /// + [DataContract] + public class SetSupportsTextResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.CSSSupports supports + { + get; + set; + } + + /// + /// supports + /// + public CefSharp.DevTools.CSS.CSSSupports Supports + { + get + { + return supports; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetScopeTextResponse + /// + [DataContract] + public class SetScopeTextResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.CSSScope scope + { + get; + set; + } + + /// + /// scope + /// + public CefSharp.DevTools.CSS.CSSScope Scope + { + get + { + return scope; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetRuleSelectorResponse + /// + [DataContract] + public class SetRuleSelectorResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CSS.SelectorList selectorList + { + get; + set; + } + + /// + /// selectorList + /// + public CefSharp.DevTools.CSS.SelectorList SelectorList + { + get + { + return selectorList; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetStyleSheetTextResponse + /// + [DataContract] + public class SetStyleSheetTextResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string sourceMapURL + { + get; + set; + } + + /// + /// sourceMapURL + /// + public string SourceMapURL + { + get + { + return sourceMapURL; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetStyleTextsResponse + /// + [DataContract] + public class SetStyleTextsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList styles + { + get; + set; + } + + /// + /// styles + /// + public System.Collections.Generic.IList Styles + { + get + { + return styles; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// StopRuleUsageTrackingResponse + /// + [DataContract] + public class StopRuleUsageTrackingResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList ruleUsage + { + get; + set; + } + + /// + /// ruleUsage + /// + public System.Collections.Generic.IList RuleUsage + { + get + { + return ruleUsage; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// TakeCoverageDeltaResponse + /// + [DataContract] + public class TakeCoverageDeltaResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList coverage + { + get; + set; + } + + /// + /// coverage + /// + public System.Collections.Generic.IList Coverage + { + get + { + return coverage; + } + } + + [DataMember] + internal double timestamp + { + get; + set; + } + + /// + /// timestamp + /// + public double Timestamp + { + get + { + return timestamp; + } + } + } +} + +namespace CefSharp.DevTools.CSS +{ + using System.Linq; + + /// + /// This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) + /// have an associated `id` used in subsequent operations on the related object. Each object type has + /// a specific `id` structure, and those are not interchangeable between objects of different kinds. + /// CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client + /// can also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and + /// subsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods. + /// + public partial class CSSClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// CSS + /// + /// DevToolsClient + public CSSClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded + /// web font. + /// + public event System.EventHandler FontsUpdated + { + add + { + _client.AddEventHandler("CSS.fontsUpdated", value); + } + + remove + { + _client.RemoveEventHandler("CSS.fontsUpdated", value); + } + } + + /// + /// Fires whenever a MediaQuery result changes (for example, after a browser window has been + /// resized.) The current implementation considers only viewport-dependent media features. + /// + public event System.EventHandler MediaQueryResultChanged + { + add + { + _client.AddEventHandler("CSS.mediaQueryResultChanged", value); + } + + remove + { + _client.RemoveEventHandler("CSS.mediaQueryResultChanged", value); + } + } + + /// + /// Fired whenever an active document stylesheet is added. + /// + public event System.EventHandler StyleSheetAdded + { + add + { + _client.AddEventHandler("CSS.styleSheetAdded", value); + } + + remove + { + _client.RemoveEventHandler("CSS.styleSheetAdded", value); + } + } + + /// + /// Fired whenever a stylesheet is changed as a result of the client operation. + /// + public event System.EventHandler StyleSheetChanged + { + add + { + _client.AddEventHandler("CSS.styleSheetChanged", value); + } + + remove + { + _client.RemoveEventHandler("CSS.styleSheetChanged", value); + } + } + + /// + /// Fired whenever an active document stylesheet is removed. + /// + public event System.EventHandler StyleSheetRemoved + { + add + { + _client.AddEventHandler("CSS.styleSheetRemoved", value); + } + + remove + { + _client.RemoveEventHandler("CSS.styleSheetRemoved", value); + } + } + + /// + /// ComputedStyleUpdated + /// + public event System.EventHandler ComputedStyleUpdated + { + add + { + _client.AddEventHandler("CSS.computedStyleUpdated", value); + } + + remove + { + _client.RemoveEventHandler("CSS.computedStyleUpdated", value); + } + } + + partial void ValidateAddRule(string styleSheetId, string ruleText, CefSharp.DevTools.CSS.SourceRange location, int? nodeForPropertySyntaxValidation = null); + /// + /// Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the + /// position specified by `location`. + /// + /// The css style sheet identifier where a new rule should be inserted. + /// The text of a new rule. + /// Text position of a new rule in the target style sheet. + /// NodeId for the DOM node in whose context custom property declarations for registered properties should bevalidated. If omitted, declarations in the new rule text can only be validated statically, which may produceincorrect results if the declaration contains a var() for example. + /// returns System.Threading.Tasks.Task<AddRuleResponse> + public System.Threading.Tasks.Task AddRuleAsync(string styleSheetId, string ruleText, CefSharp.DevTools.CSS.SourceRange location, int? nodeForPropertySyntaxValidation = null) + { + ValidateAddRule(styleSheetId, ruleText, location, nodeForPropertySyntaxValidation); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("ruleText", ruleText); + dict.Add("location", location.ToDictionary()); + if (nodeForPropertySyntaxValidation.HasValue) + { + dict.Add("nodeForPropertySyntaxValidation", nodeForPropertySyntaxValidation.Value); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.addRule", dict); + } + + partial void ValidateCollectClassNames(string styleSheetId); + /// + /// Returns all class names from specified stylesheet. + /// + /// styleSheetId + /// returns System.Threading.Tasks.Task<CollectClassNamesResponse> + public System.Threading.Tasks.Task CollectClassNamesAsync(string styleSheetId) + { + ValidateCollectClassNames(styleSheetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + return _client.ExecuteDevToolsMethodAsync("CSS.collectClassNames", dict); + } + + partial void ValidateCreateStyleSheet(string frameId, bool? force = null); + /// + /// Creates a new special "via-inspector" stylesheet in the frame with given `frameId`. + /// + /// Identifier of the frame where "via-inspector" stylesheet should be created. + /// If true, creates a new stylesheet for every call. If false,returns a stylesheet previously created by a call with force=falsefor the frame's document if it exists or creates a new stylesheet(default: false). + /// returns System.Threading.Tasks.Task<CreateStyleSheetResponse> + public System.Threading.Tasks.Task CreateStyleSheetAsync(string frameId, bool? force = null) + { + ValidateCreateStyleSheet(frameId, force); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + if (force.HasValue) + { + dict.Add("force", force.Value); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.createStyleSheet", dict); + } + + /// + /// Disables the CSS agent for the given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.disable", dict); + } + + /// + /// Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been + /// enabled until the result of this command is received. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.enable", dict); + } + + partial void ValidateForcePseudoState(int nodeId, string[] forcedPseudoClasses); + /// + /// Ensures that the given node will have specified pseudo-classes whenever its style is computed by + /// the browser. + /// + /// The element id for which to force the pseudo state. + /// Element pseudo classes to force when computing the element's style. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ForcePseudoStateAsync(int nodeId, string[] forcedPseudoClasses) + { + ValidateForcePseudoState(nodeId, forcedPseudoClasses); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("forcedPseudoClasses", forcedPseudoClasses); + return _client.ExecuteDevToolsMethodAsync("CSS.forcePseudoState", dict); + } + + partial void ValidateForceStartingStyle(int nodeId, bool forced); + /// + /// Ensures that the given node is in its starting-style state. + /// + /// The element id for which to force the starting-style state. + /// Boolean indicating if this is on or off. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ForceStartingStyleAsync(int nodeId, bool forced) + { + ValidateForceStartingStyle(nodeId, forced); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("forced", forced); + return _client.ExecuteDevToolsMethodAsync("CSS.forceStartingStyle", dict); + } + + partial void ValidateGetBackgroundColors(int nodeId); + /// + /// GetBackgroundColors + /// + /// Id of the node to get background colors for. + /// returns System.Threading.Tasks.Task<GetBackgroundColorsResponse> + public System.Threading.Tasks.Task GetBackgroundColorsAsync(int nodeId) + { + ValidateGetBackgroundColors(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getBackgroundColors", dict); + } + + partial void ValidateGetComputedStyleForNode(int nodeId); + /// + /// Returns the computed style for a DOM node identified by `nodeId`. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetComputedStyleForNodeResponse> + public System.Threading.Tasks.Task GetComputedStyleForNodeAsync(int nodeId) + { + ValidateGetComputedStyleForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getComputedStyleForNode", dict); + } + + partial void ValidateResolveValues(string[] values, int nodeId, string propertyName = null, CefSharp.DevTools.DOM.PseudoType? pseudoType = null, string pseudoIdentifier = null); + /// + /// Resolve the specified values in the context of the provided element. + /// For example, a value of '1em' is evaluated according to the computed + /// 'font-size' of the element and a value 'calc(1px + 2px)' will be + /// resolved to '3px'. + /// If the `propertyName` was specified the `values` are resolved as if + /// they were property's declaration. If a value cannot be parsed according + /// to the provided property syntax, the value is parsed using combined + /// syntax as if null `propertyName` was provided. If the value cannot be + /// resolved even then, return the provided value without any changes. + /// Note: this function currently does not resolve CSS random() function, + /// it returns unmodified random() function parts.` + /// + /// Cascade-dependent keywords (revert/revert-layer) do not work. + /// Id of the node in whose context the expression is evaluated + /// Only longhands and custom property names are accepted. + /// Pseudo element type, only works for pseudo elements that generateelements in the tree, such as ::before and ::after. + /// Pseudo element custom ident. + /// returns System.Threading.Tasks.Task<ResolveValuesResponse> + public System.Threading.Tasks.Task ResolveValuesAsync(string[] values, int nodeId, string propertyName = null, CefSharp.DevTools.DOM.PseudoType? pseudoType = null, string pseudoIdentifier = null) + { + ValidateResolveValues(values, nodeId, propertyName, pseudoType, pseudoIdentifier); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("values", values); + dict.Add("nodeId", nodeId); + if (!(string.IsNullOrEmpty(propertyName))) + { + dict.Add("propertyName", propertyName); + } + + if (pseudoType.HasValue) + { + dict.Add("pseudoType", EnumToString(pseudoType)); + } + + if (!(string.IsNullOrEmpty(pseudoIdentifier))) + { + dict.Add("pseudoIdentifier", pseudoIdentifier); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.resolveValues", dict); + } + + partial void ValidateGetLonghandProperties(string shorthandName, string value); + /// + /// GetLonghandProperties + /// + /// shorthandName + /// value + /// returns System.Threading.Tasks.Task<GetLonghandPropertiesResponse> + public System.Threading.Tasks.Task GetLonghandPropertiesAsync(string shorthandName, string value) + { + ValidateGetLonghandProperties(shorthandName, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("shorthandName", shorthandName); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("CSS.getLonghandProperties", dict); + } + + partial void ValidateGetInlineStylesForNode(int nodeId); + /// + /// Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM + /// attributes) for a DOM node identified by `nodeId`. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetInlineStylesForNodeResponse> + public System.Threading.Tasks.Task GetInlineStylesForNodeAsync(int nodeId) + { + ValidateGetInlineStylesForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getInlineStylesForNode", dict); + } + + partial void ValidateGetAnimatedStylesForNode(int nodeId); + /// + /// Returns the styles coming from animations & transitions + /// including the animation & transition styles coming from inheritance chain. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetAnimatedStylesForNodeResponse> + public System.Threading.Tasks.Task GetAnimatedStylesForNodeAsync(int nodeId) + { + ValidateGetAnimatedStylesForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getAnimatedStylesForNode", dict); + } + + partial void ValidateGetMatchedStylesForNode(int nodeId); + /// + /// Returns requested styles for a DOM node identified by `nodeId`. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetMatchedStylesForNodeResponse> + public System.Threading.Tasks.Task GetMatchedStylesForNodeAsync(int nodeId) + { + ValidateGetMatchedStylesForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getMatchedStylesForNode", dict); + } + + /// + /// Returns the values of the default UA-defined environment variables used in env() + /// + /// returns System.Threading.Tasks.Task<GetEnvironmentVariablesResponse> + public System.Threading.Tasks.Task GetEnvironmentVariablesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.getEnvironmentVariables", dict); + } + + /// + /// Returns all media queries parsed by the rendering engine. + /// + /// returns System.Threading.Tasks.Task<GetMediaQueriesResponse> + public System.Threading.Tasks.Task GetMediaQueriesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.getMediaQueries", dict); + } + + partial void ValidateGetPlatformFontsForNode(int nodeId); + /// + /// Requests information about platform fonts which we used to render child TextNodes in the given + /// node. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetPlatformFontsForNodeResponse> + public System.Threading.Tasks.Task GetPlatformFontsForNodeAsync(int nodeId) + { + ValidateGetPlatformFontsForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getPlatformFontsForNode", dict); + } + + partial void ValidateGetStyleSheetText(string styleSheetId); + /// + /// Returns the current textual content for a stylesheet. + /// + /// styleSheetId + /// returns System.Threading.Tasks.Task<GetStyleSheetTextResponse> + public System.Threading.Tasks.Task GetStyleSheetTextAsync(string styleSheetId) + { + ValidateGetStyleSheetText(styleSheetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + return _client.ExecuteDevToolsMethodAsync("CSS.getStyleSheetText", dict); + } + + partial void ValidateGetLayersForNode(int nodeId); + /// + /// Returns all layers parsed by the rendering engine for the tree scope of a node. + /// Given a DOM element identified by nodeId, getLayersForNode returns the root + /// layer for the nearest ancestor document or shadow root. The layer root contains + /// the full layer tree for the tree scope and their ordering. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetLayersForNodeResponse> + public System.Threading.Tasks.Task GetLayersForNodeAsync(int nodeId) + { + ValidateGetLayersForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getLayersForNode", dict); + } + + partial void ValidateGetLocationForSelector(string styleSheetId, string selectorText); + /// + /// Given a CSS selector text and a style sheet ID, getLocationForSelector + /// returns an array of locations of the CSS selector in the style sheet. + /// + /// styleSheetId + /// selectorText + /// returns System.Threading.Tasks.Task<GetLocationForSelectorResponse> + public System.Threading.Tasks.Task GetLocationForSelectorAsync(string styleSheetId, string selectorText) + { + ValidateGetLocationForSelector(styleSheetId, selectorText); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("selectorText", selectorText); + return _client.ExecuteDevToolsMethodAsync("CSS.getLocationForSelector", dict); + } + + partial void ValidateTrackComputedStyleUpdatesForNode(int? nodeId = null); + /// + /// Starts tracking the given node for the computed style updates + /// and whenever the computed style is updated for node, it queues + /// a `computedStyleUpdated` event with throttling. + /// There can only be 1 node tracked for computed style updates + /// so passing a new node id removes tracking from the previous node. + /// Pass `undefined` to disable tracking. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackComputedStyleUpdatesForNodeAsync(int? nodeId = null) + { + ValidateTrackComputedStyleUpdatesForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.trackComputedStyleUpdatesForNode", dict); + } + + partial void ValidateTrackComputedStyleUpdates(System.Collections.Generic.IList propertiesToTrack); + /// + /// Starts tracking the given computed styles for updates. The specified array of properties + /// replaces the one previously specified. Pass empty array to disable tracking. + /// Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified. + /// The changes to computed style properties are only tracked for nodes pushed to the front-end + /// by the DOM agent. If no changes to the tracked properties occur after the node has been pushed + /// to the front-end, no updates will be issued for the node. + /// + /// propertiesToTrack + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackComputedStyleUpdatesAsync(System.Collections.Generic.IList propertiesToTrack) + { + ValidateTrackComputedStyleUpdates(propertiesToTrack); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("propertiesToTrack", propertiesToTrack.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("CSS.trackComputedStyleUpdates", dict); + } + + /// + /// Polls the next batch of computed style updates. + /// + /// returns System.Threading.Tasks.Task<TakeComputedStyleUpdatesResponse> + public System.Threading.Tasks.Task TakeComputedStyleUpdatesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.takeComputedStyleUpdates", dict); + } + + partial void ValidateSetEffectivePropertyValueForNode(int nodeId, string propertyName, string value); + /// + /// Find a rule with the given active property for the given node and set the new value for this + /// property + /// + /// The element id for which to set property. + /// propertyName + /// value + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEffectivePropertyValueForNodeAsync(int nodeId, string propertyName, string value) + { + ValidateSetEffectivePropertyValueForNode(nodeId, propertyName, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("propertyName", propertyName); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("CSS.setEffectivePropertyValueForNode", dict); + } + + partial void ValidateSetPropertyRulePropertyName(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string propertyName); + /// + /// Modifies the property rule property name. + /// + /// styleSheetId + /// range + /// propertyName + /// returns System.Threading.Tasks.Task<SetPropertyRulePropertyNameResponse> + public System.Threading.Tasks.Task SetPropertyRulePropertyNameAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string propertyName) + { + ValidateSetPropertyRulePropertyName(styleSheetId, range, propertyName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("propertyName", propertyName); + return _client.ExecuteDevToolsMethodAsync("CSS.setPropertyRulePropertyName", dict); + } + + partial void ValidateSetKeyframeKey(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string keyText); + /// + /// Modifies the keyframe rule key text. + /// + /// styleSheetId + /// range + /// keyText + /// returns System.Threading.Tasks.Task<SetKeyframeKeyResponse> + public System.Threading.Tasks.Task SetKeyframeKeyAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string keyText) + { + ValidateSetKeyframeKey(styleSheetId, range, keyText); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("keyText", keyText); + return _client.ExecuteDevToolsMethodAsync("CSS.setKeyframeKey", dict); + } + + partial void ValidateSetMediaText(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text); + /// + /// Modifies the rule selector. + /// + /// styleSheetId + /// range + /// text + /// returns System.Threading.Tasks.Task<SetMediaTextResponse> + public System.Threading.Tasks.Task SetMediaTextAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text) + { + ValidateSetMediaText(styleSheetId, range, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setMediaText", dict); + } + + partial void ValidateSetContainerQueryText(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text); + /// + /// Modifies the expression of a container query. + /// + /// styleSheetId + /// range + /// text + /// returns System.Threading.Tasks.Task<SetContainerQueryTextResponse> + public System.Threading.Tasks.Task SetContainerQueryTextAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text) + { + ValidateSetContainerQueryText(styleSheetId, range, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setContainerQueryText", dict); + } + + partial void ValidateSetSupportsText(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text); + /// + /// Modifies the expression of a supports at-rule. + /// + /// styleSheetId + /// range + /// text + /// returns System.Threading.Tasks.Task<SetSupportsTextResponse> + public System.Threading.Tasks.Task SetSupportsTextAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text) + { + ValidateSetSupportsText(styleSheetId, range, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setSupportsText", dict); + } + + partial void ValidateSetScopeText(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text); + /// + /// Modifies the expression of a scope at-rule. + /// + /// styleSheetId + /// range + /// text + /// returns System.Threading.Tasks.Task<SetScopeTextResponse> + public System.Threading.Tasks.Task SetScopeTextAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text) + { + ValidateSetScopeText(styleSheetId, range, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setScopeText", dict); + } + + partial void ValidateSetRuleSelector(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string selector); + /// + /// Modifies the rule selector. + /// + /// styleSheetId + /// range + /// selector + /// returns System.Threading.Tasks.Task<SetRuleSelectorResponse> + public System.Threading.Tasks.Task SetRuleSelectorAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string selector) + { + ValidateSetRuleSelector(styleSheetId, range, selector); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("selector", selector); + return _client.ExecuteDevToolsMethodAsync("CSS.setRuleSelector", dict); + } + + partial void ValidateSetStyleSheetText(string styleSheetId, string text); + /// + /// Sets the new stylesheet text. + /// + /// styleSheetId + /// text + /// returns System.Threading.Tasks.Task<SetStyleSheetTextResponse> + public System.Threading.Tasks.Task SetStyleSheetTextAsync(string styleSheetId, string text) + { + ValidateSetStyleSheetText(styleSheetId, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setStyleSheetText", dict); + } + + partial void ValidateSetStyleTexts(System.Collections.Generic.IList edits, int? nodeForPropertySyntaxValidation = null); + /// + /// Applies specified style edits one after another in the given order. + /// + /// edits + /// NodeId for the DOM node in whose context custom property declarations for registered properties should bevalidated. If omitted, declarations in the new rule text can only be validated statically, which may produceincorrect results if the declaration contains a var() for example. + /// returns System.Threading.Tasks.Task<SetStyleTextsResponse> + public System.Threading.Tasks.Task SetStyleTextsAsync(System.Collections.Generic.IList edits, int? nodeForPropertySyntaxValidation = null) + { + ValidateSetStyleTexts(edits, nodeForPropertySyntaxValidation); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("edits", edits.Select(x => x.ToDictionary())); + if (nodeForPropertySyntaxValidation.HasValue) + { + dict.Add("nodeForPropertySyntaxValidation", nodeForPropertySyntaxValidation.Value); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.setStyleTexts", dict); + } + + /// + /// Enables the selector recording. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartRuleUsageTrackingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.startRuleUsageTracking", dict); + } + + /// + /// Stop tracking rule usage and return the list of rules that were used since last call to + /// `takeCoverageDelta` (or since start of coverage instrumentation). + /// + /// returns System.Threading.Tasks.Task<StopRuleUsageTrackingResponse> + public System.Threading.Tasks.Task StopRuleUsageTrackingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.stopRuleUsageTracking", dict); + } + + /// + /// Obtain list of rules that became used since last call to this method (or since start of coverage + /// instrumentation). + /// + /// returns System.Threading.Tasks.Task<TakeCoverageDeltaResponse> + public System.Threading.Tasks.Task TakeCoverageDeltaAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.takeCoverageDelta", dict); + } + + partial void ValidateSetLocalFontsEnabled(bool enabled); + /// + /// Enables/disables rendering of local CSS fonts (enabled by default). + /// + /// Whether rendering of local fonts is enabled. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetLocalFontsEnabledAsync(bool enabled) + { + ValidateSetLocalFontsEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("CSS.setLocalFontsEnabled", dict); + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + /// + /// RequestCacheNamesResponse + /// + [DataContract] + public class RequestCacheNamesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList caches + { + get; + set; + } + + /// + /// caches + /// + public System.Collections.Generic.IList Caches + { + get + { + return caches; + } + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + /// + /// RequestCachedResponseResponse + /// + [DataContract] + public class RequestCachedResponseResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.CacheStorage.CachedResponse response + { + get; + set; + } + + /// + /// response + /// + public CefSharp.DevTools.CacheStorage.CachedResponse Response + { + get + { + return response; + } + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + /// + /// RequestEntriesResponse + /// + [DataContract] + public class RequestEntriesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList cacheDataEntries + { + get; + set; + } + + /// + /// cacheDataEntries + /// + public System.Collections.Generic.IList CacheDataEntries + { + get + { + return cacheDataEntries; + } + } + + [DataMember] + internal double returnCount + { + get; + set; + } + + /// + /// returnCount + /// + public double ReturnCount + { + get + { + return returnCount; + } + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + using System.Linq; + + /// + /// CacheStorage + /// + public partial class CacheStorageClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// CacheStorage + /// + /// DevToolsClient + public CacheStorageClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateDeleteCache(string cacheId); + /// + /// Deletes a cache. + /// + /// Id of cache for deletion. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteCacheAsync(string cacheId) + { + ValidateDeleteCache(cacheId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheId", cacheId); + return _client.ExecuteDevToolsMethodAsync("CacheStorage.deleteCache", dict); + } + + partial void ValidateDeleteEntry(string cacheId, string request); + /// + /// Deletes a cache entry. + /// + /// Id of cache where the entry will be deleted. + /// URL spec of the request. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteEntryAsync(string cacheId, string request) + { + ValidateDeleteEntry(cacheId, request); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheId", cacheId); + dict.Add("request", request); + return _client.ExecuteDevToolsMethodAsync("CacheStorage.deleteEntry", dict); + } + + partial void ValidateRequestCacheNames(string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Requests cache names. + /// + /// At least and at most one of securityOrigin, storageKey, storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<RequestCacheNamesResponse> + public System.Threading.Tasks.Task RequestCacheNamesAsync(string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateRequestCacheNames(securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("CacheStorage.requestCacheNames", dict); + } + + partial void ValidateRequestCachedResponse(string cacheId, string requestURL, System.Collections.Generic.IList requestHeaders); + /// + /// Fetches cache entry. + /// + /// Id of cache that contains the entry. + /// URL spec of the request. + /// headers of the request. + /// returns System.Threading.Tasks.Task<RequestCachedResponseResponse> + public System.Threading.Tasks.Task RequestCachedResponseAsync(string cacheId, string requestURL, System.Collections.Generic.IList requestHeaders) + { + ValidateRequestCachedResponse(cacheId, requestURL, requestHeaders); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheId", cacheId); + dict.Add("requestURL", requestURL); + dict.Add("requestHeaders", requestHeaders.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("CacheStorage.requestCachedResponse", dict); + } + + partial void ValidateRequestEntries(string cacheId, int? skipCount = null, int? pageSize = null, string pathFilter = null); + /// + /// Requests data from cache. + /// + /// ID of cache to get entries from. + /// Number of records to skip. + /// Number of records to fetch. + /// If present, only return the entries containing this substring in the path + /// returns System.Threading.Tasks.Task<RequestEntriesResponse> + public System.Threading.Tasks.Task RequestEntriesAsync(string cacheId, int? skipCount = null, int? pageSize = null, string pathFilter = null) + { + ValidateRequestEntries(cacheId, skipCount, pageSize, pathFilter); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheId", cacheId); + if (skipCount.HasValue) + { + dict.Add("skipCount", skipCount.Value); + } + + if (pageSize.HasValue) + { + dict.Add("pageSize", pageSize.Value); + } + + if (!(string.IsNullOrEmpty(pathFilter))) + { + dict.Add("pathFilter", pathFilter); + } + + return _client.ExecuteDevToolsMethodAsync("CacheStorage.requestEntries", dict); + } + } +} + +namespace CefSharp.DevTools.Cast +{ + using System.Linq; + + /// + /// A domain for interacting with Cast, Presentation API, and Remote Playback API + /// functionalities. + /// + public partial class CastClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Cast + /// + /// DevToolsClient + public CastClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// This is fired whenever the list of available sinks changes. A sink is a + /// device or a software surface that you can cast to. + /// + public event System.EventHandler SinksUpdated + { + add + { + _client.AddEventHandler("Cast.sinksUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Cast.sinksUpdated", value); + } + } + + /// + /// This is fired whenever the outstanding issue/error message changes. + /// |issueMessage| is empty if there is no issue. + /// + public event System.EventHandler IssueUpdated + { + add + { + _client.AddEventHandler("Cast.issueUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Cast.issueUpdated", value); + } + } + + partial void ValidateEnable(string presentationUrl = null); + /// + /// Starts observing for sinks that can be used for tab mirroring, and if set, + /// sinks compatible with |presentationUrl| as well. When sinks are found, a + /// |sinksUpdated| event is fired. + /// Also starts observing for issue messages. When an issue is added or removed, + /// an |issueUpdated| event is fired. + /// + /// presentationUrl + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(string presentationUrl = null) + { + ValidateEnable(presentationUrl); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(presentationUrl))) + { + dict.Add("presentationUrl", presentationUrl); + } + + return _client.ExecuteDevToolsMethodAsync("Cast.enable", dict); + } + + /// + /// Stops observing for sinks and issues. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Cast.disable", dict); + } + + partial void ValidateSetSinkToUse(string sinkName); + /// + /// Sets a sink to be used when the web page requests the browser to choose a + /// sink via Presentation API, Remote Playback API, or Cast SDK. + /// + /// sinkName + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSinkToUseAsync(string sinkName) + { + ValidateSetSinkToUse(sinkName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sinkName", sinkName); + return _client.ExecuteDevToolsMethodAsync("Cast.setSinkToUse", dict); + } + + partial void ValidateStartDesktopMirroring(string sinkName); + /// + /// Starts mirroring the desktop to the sink. + /// + /// sinkName + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartDesktopMirroringAsync(string sinkName) + { + ValidateStartDesktopMirroring(sinkName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sinkName", sinkName); + return _client.ExecuteDevToolsMethodAsync("Cast.startDesktopMirroring", dict); + } + + partial void ValidateStartTabMirroring(string sinkName); + /// + /// Starts mirroring the tab to the sink. + /// + /// sinkName + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartTabMirroringAsync(string sinkName) + { + ValidateStartTabMirroring(sinkName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sinkName", sinkName); + return _client.ExecuteDevToolsMethodAsync("Cast.startTabMirroring", dict); + } + + partial void ValidateStopCasting(string sinkName); + /// + /// Stops the active Cast session on the sink. + /// + /// sinkName + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopCastingAsync(string sinkName) + { + ValidateStopCasting(sinkName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sinkName", sinkName); + return _client.ExecuteDevToolsMethodAsync("Cast.stopCasting", dict); + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// CollectClassNamesFromSubtreeResponse + /// + [DataContract] + public class CollectClassNamesFromSubtreeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] classNames + { + get; + set; + } + + /// + /// classNames + /// + public string[] ClassNames + { + get + { + return classNames; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// CopyToResponse + /// + [DataContract] + public class CopyToResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// DescribeNodeResponse + /// + [DataContract] + public class DescribeNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.DOM.Node node + { + get; + set; + } + + /// + /// node + /// + public CefSharp.DevTools.DOM.Node Node + { + get + { + return node; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetAttributesResponse + /// + [DataContract] + public class GetAttributesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] attributes + { + get; + set; + } + + /// + /// attributes + /// + public string[] Attributes + { + get + { + return attributes; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetBoxModelResponse + /// + [DataContract] + public class GetBoxModelResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.DOM.BoxModel model + { + get; + set; + } + + /// + /// model + /// + public CefSharp.DevTools.DOM.BoxModel Model + { + get + { + return model; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetContentQuadsResponse + /// + [DataContract] + public class GetContentQuadsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double[] quads + { + get; + set; + } + + /// + /// quads + /// + public double[] Quads + { + get + { + return quads; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetDocumentResponse + /// + [DataContract] + public class GetDocumentResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.DOM.Node root + { + get; + set; + } + + /// + /// root + /// + public CefSharp.DevTools.DOM.Node Root + { + get + { + return root; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetNodesForSubtreeByStyleResponse + /// + [DataContract] + public class GetNodesForSubtreeByStyleResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int[] nodeIds + { + get; + set; + } + + /// + /// nodeIds + /// + public int[] NodeIds + { + get + { + return nodeIds; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetNodeForLocationResponse + /// + [DataContract] + public class GetNodeForLocationResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int backendNodeId + { + get; + set; + } + + /// + /// backendNodeId + /// + public int BackendNodeId + { + get + { + return backendNodeId; + } + } + + [DataMember] + internal string frameId + { + get; + set; + } + + /// + /// frameId + /// + public string FrameId + { + get + { + return frameId; + } + } + + [DataMember] + internal int? nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int? NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetOuterHTMLResponse + /// + [DataContract] + public class GetOuterHTMLResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string outerHTML + { + get; + set; + } + + /// + /// outerHTML + /// + public string OuterHTML + { + get + { + return outerHTML; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetRelayoutBoundaryResponse + /// + [DataContract] + public class GetRelayoutBoundaryResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetSearchResultsResponse + /// + [DataContract] + public class GetSearchResultsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int[] nodeIds + { + get; + set; + } + + /// + /// nodeIds + /// + public int[] NodeIds + { + get + { + return nodeIds; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// MoveToResponse + /// + [DataContract] + public class MoveToResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// PerformSearchResponse + /// + [DataContract] + public class PerformSearchResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string searchId + { + get; + set; + } + + /// + /// searchId + /// + public string SearchId + { + get + { + return searchId; + } + } + + [DataMember] + internal int resultCount + { + get; + set; + } + + /// + /// resultCount + /// + public int ResultCount + { + get + { + return resultCount; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// PushNodeByPathToFrontendResponse + /// + [DataContract] + public class PushNodeByPathToFrontendResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// PushNodesByBackendIdsToFrontendResponse + /// + [DataContract] + public class PushNodesByBackendIdsToFrontendResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int[] nodeIds + { + get; + set; + } + + /// + /// nodeIds + /// + public int[] NodeIds + { + get + { + return nodeIds; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// QuerySelectorResponse + /// + [DataContract] + public class QuerySelectorResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// QuerySelectorAllResponse + /// + [DataContract] + public class QuerySelectorAllResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int[] nodeIds + { + get; + set; + } + + /// + /// nodeIds + /// + public int[] NodeIds + { + get + { + return nodeIds; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetTopLayerElementsResponse + /// + [DataContract] + public class GetTopLayerElementsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int[] nodeIds + { + get; + set; + } + + /// + /// nodeIds + /// + public int[] NodeIds + { + get + { + return nodeIds; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetElementByRelationResponse + /// + [DataContract] + public class GetElementByRelationResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// RequestNodeResponse + /// + [DataContract] + public class RequestNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// ResolveNodeResponse + /// + [DataContract] + public class ResolveNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject @object + { + get; + set; + } + + /// + /// object + /// + public CefSharp.DevTools.Runtime.RemoteObject Object + { + get + { + return @object; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetNodeStackTracesResponse + /// + [DataContract] + public class GetNodeStackTracesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.StackTrace creation + { + get; + set; + } + + /// + /// creation + /// + public CefSharp.DevTools.Runtime.StackTrace Creation + { + get + { + return creation; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetFileInfoResponse + /// + [DataContract] + public class GetFileInfoResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string path + { + get; + set; + } + + /// + /// path + /// + public string Path + { + get + { + return path; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetDetachedDomNodesResponse + /// + [DataContract] + public class GetDetachedDomNodesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList detachedNodes + { + get; + set; + } + + /// + /// detachedNodes + /// + public System.Collections.Generic.IList DetachedNodes + { + get + { + return detachedNodes; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// SetNodeNameResponse + /// + [DataContract] + public class SetNodeNameResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetFrameOwnerResponse + /// + [DataContract] + public class GetFrameOwnerResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int backendNodeId + { + get; + set; + } + + /// + /// backendNodeId + /// + public int BackendNodeId + { + get + { + return backendNodeId; + } + } + + [DataMember] + internal int? nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int? NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetContainerForNodeResponse + /// + [DataContract] + public class GetContainerForNodeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int? nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int? NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetQueryingDescendantsForContainerResponse + /// + [DataContract] + public class GetQueryingDescendantsForContainerResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int[] nodeIds + { + get; + set; + } + + /// + /// nodeIds + /// + public int[] NodeIds + { + get + { + return nodeIds; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetAnchorElementResponse + /// + [DataContract] + public class GetAnchorElementResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int nodeId + { + get; + set; + } + + /// + /// nodeId + /// + public int NodeId + { + get + { + return nodeId; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// ForceShowPopoverResponse + /// + [DataContract] + public class ForceShowPopoverResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int[] nodeIds + { + get; + set; + } + + /// + /// nodeIds + /// + public int[] NodeIds + { + get + { + return nodeIds; + } + } + } +} + +namespace CefSharp.DevTools.DOM +{ + using System.Linq; + + /// + /// Whether to include whitespaces in the children array of returned Nodes. + /// + public enum EnableIncludeWhitespace + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// all + /// + [EnumMember(Value = ("all"))] + All + } + + /// + /// Type of relation to get. + /// + public enum GetElementByRelationRelation + { + /// + /// PopoverTarget + /// + [EnumMember(Value = ("PopoverTarget"))] + PopoverTarget, + /// + /// InterestTarget + /// + [EnumMember(Value = ("InterestTarget"))] + InterestTarget, + /// + /// CommandFor + /// + [EnumMember(Value = ("CommandFor"))] + CommandFor + } + + /// + /// This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object + /// that has an `id`. This `id` can be used to get additional information on the Node, resolve it into + /// the JavaScript object wrapper, etc. It is important that client receives DOM events only for the + /// nodes that are known to the client. Backend keeps track of the nodes that were sent to the client + /// and never sends the same node twice. It is client's responsibility to collect information about + /// the nodes that were sent to the client. Note that `iframe` owner elements will return + /// corresponding document elements as their child nodes. + /// + public partial class DOMClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DOM + /// + /// DevToolsClient + public DOMClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when `Element`'s attribute is modified. + /// + public event System.EventHandler AttributeModified + { + add + { + _client.AddEventHandler("DOM.attributeModified", value); + } + + remove + { + _client.RemoveEventHandler("DOM.attributeModified", value); + } + } + + /// + /// Fired when `Element`'s adoptedStyleSheets are modified. + /// + public event System.EventHandler AdoptedStyleSheetsModified + { + add + { + _client.AddEventHandler("DOM.adoptedStyleSheetsModified", value); + } + + remove + { + _client.RemoveEventHandler("DOM.adoptedStyleSheetsModified", value); + } + } + + /// + /// Fired when `Element`'s attribute is removed. + /// + public event System.EventHandler AttributeRemoved + { + add + { + _client.AddEventHandler("DOM.attributeRemoved", value); + } + + remove + { + _client.RemoveEventHandler("DOM.attributeRemoved", value); + } + } + + /// + /// Mirrors `DOMCharacterDataModified` event. + /// + public event System.EventHandler CharacterDataModified + { + add + { + _client.AddEventHandler("DOM.characterDataModified", value); + } + + remove + { + _client.RemoveEventHandler("DOM.characterDataModified", value); + } + } + + /// + /// Fired when `Container`'s child node count has changed. + /// + public event System.EventHandler ChildNodeCountUpdated + { + add + { + _client.AddEventHandler("DOM.childNodeCountUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.childNodeCountUpdated", value); + } + } + + /// + /// Mirrors `DOMNodeInserted` event. + /// + public event System.EventHandler ChildNodeInserted + { + add + { + _client.AddEventHandler("DOM.childNodeInserted", value); + } + + remove + { + _client.RemoveEventHandler("DOM.childNodeInserted", value); + } + } + + /// + /// Mirrors `DOMNodeRemoved` event. + /// + public event System.EventHandler ChildNodeRemoved + { + add + { + _client.AddEventHandler("DOM.childNodeRemoved", value); + } + + remove + { + _client.RemoveEventHandler("DOM.childNodeRemoved", value); + } + } + + /// + /// Called when distribution is changed. + /// + public event System.EventHandler DistributedNodesUpdated + { + add + { + _client.AddEventHandler("DOM.distributedNodesUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.distributedNodesUpdated", value); + } + } + + /// + /// Fired when `Document` has been totally updated. Node ids are no longer valid. + /// + public event System.EventHandler DocumentUpdated + { + add + { + _client.AddEventHandler("DOM.documentUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.documentUpdated", value); + } + } + + /// + /// Fired when `Element`'s inline style is modified via a CSS property modification. + /// + public event System.EventHandler InlineStyleInvalidated + { + add + { + _client.AddEventHandler("DOM.inlineStyleInvalidated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.inlineStyleInvalidated", value); + } + } + + /// + /// Called when a pseudo element is added to an element. + /// + public event System.EventHandler PseudoElementAdded + { + add + { + _client.AddEventHandler("DOM.pseudoElementAdded", value); + } + + remove + { + _client.RemoveEventHandler("DOM.pseudoElementAdded", value); + } + } + + /// + /// Called when top layer elements are changed. + /// + public event System.EventHandler TopLayerElementsUpdated + { + add + { + _client.AddEventHandler("DOM.topLayerElementsUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.topLayerElementsUpdated", value); + } + } + + /// + /// Fired when a node's scrollability state changes. + /// + public event System.EventHandler ScrollableFlagUpdated + { + add + { + _client.AddEventHandler("DOM.scrollableFlagUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.scrollableFlagUpdated", value); + } + } + + /// + /// Fired when a node's starting styles changes. + /// + public event System.EventHandler AffectedByStartingStylesFlagUpdated + { + add + { + _client.AddEventHandler("DOM.affectedByStartingStylesFlagUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.affectedByStartingStylesFlagUpdated", value); + } + } + + /// + /// Called when a pseudo element is removed from an element. + /// + public event System.EventHandler PseudoElementRemoved + { + add + { + _client.AddEventHandler("DOM.pseudoElementRemoved", value); + } + + remove + { + _client.RemoveEventHandler("DOM.pseudoElementRemoved", value); + } + } + + /// + /// Fired when backend wants to provide client with the missing DOM structure. This happens upon + /// most of the calls requesting node ids. + /// + public event System.EventHandler SetChildNodes + { + add + { + _client.AddEventHandler("DOM.setChildNodes", value); + } + + remove + { + _client.RemoveEventHandler("DOM.setChildNodes", value); + } + } + + /// + /// Called when shadow root is popped from the element. + /// + public event System.EventHandler ShadowRootPopped + { + add + { + _client.AddEventHandler("DOM.shadowRootPopped", value); + } + + remove + { + _client.RemoveEventHandler("DOM.shadowRootPopped", value); + } + } + + /// + /// Called when shadow root is pushed into the element. + /// + public event System.EventHandler ShadowRootPushed + { + add + { + _client.AddEventHandler("DOM.shadowRootPushed", value); + } + + remove + { + _client.RemoveEventHandler("DOM.shadowRootPushed", value); + } + } + + partial void ValidateCollectClassNamesFromSubtree(int nodeId); + /// + /// Collects class names for the node with given id and all of it's child nodes. + /// + /// Id of the node to collect class names. + /// returns System.Threading.Tasks.Task<CollectClassNamesFromSubtreeResponse> + public System.Threading.Tasks.Task CollectClassNamesFromSubtreeAsync(int nodeId) + { + ValidateCollectClassNamesFromSubtree(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.collectClassNamesFromSubtree", dict); + } + + partial void ValidateCopyTo(int nodeId, int targetNodeId, int? insertBeforeNodeId = null); + /// + /// Creates a deep copy of the specified node and places it into the target container before the + /// given anchor. + /// + /// Id of the node to copy. + /// Id of the element to drop the copy into. + /// Drop the copy before this node (if absent, the copy becomes the last child of`targetNodeId`). + /// returns System.Threading.Tasks.Task<CopyToResponse> + public System.Threading.Tasks.Task CopyToAsync(int nodeId, int targetNodeId, int? insertBeforeNodeId = null) + { + ValidateCopyTo(nodeId, targetNodeId, insertBeforeNodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("targetNodeId", targetNodeId); + if (insertBeforeNodeId.HasValue) + { + dict.Add("insertBeforeNodeId", insertBeforeNodeId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.copyTo", dict); + } + + partial void ValidateDescribeNode(int? nodeId = null, int? backendNodeId = null, string objectId = null, int? depth = null, bool? pierce = null); + /// + /// Describes node given its id, does not require domain to be enabled. Does not start tracking any + /// objects, can be used for automation. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for theentire subtree or provide an integer larger than 0. + /// Whether or not iframes and shadow roots should be traversed when returning the subtree(default is false). + /// returns System.Threading.Tasks.Task<DescribeNodeResponse> + public System.Threading.Tasks.Task DescribeNodeAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, int? depth = null, bool? pierce = null) + { + ValidateDescribeNode(nodeId, backendNodeId, objectId, depth, pierce); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.describeNode", dict); + } + + partial void ValidateScrollIntoViewIfNeeded(int? nodeId = null, int? backendNodeId = null, string objectId = null, CefSharp.DevTools.DOM.Rect rect = null); + /// + /// Scrolls the specified rect of the given node into view if not already visible. + /// Note: exactly one between nodeId, backendNodeId and objectId should be passed + /// to identify the node. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// The rect to be scrolled into view, relative to the node's border box, in CSS pixels.When omitted, center of the node will be used, similar to Element.scrollIntoView. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ScrollIntoViewIfNeededAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, CefSharp.DevTools.DOM.Rect rect = null) + { + ValidateScrollIntoViewIfNeeded(nodeId, backendNodeId, objectId, rect); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if ((rect) != (null)) + { + dict.Add("rect", rect.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.scrollIntoViewIfNeeded", dict); + } + + /// + /// Disables DOM agent for the given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.disable", dict); + } + + partial void ValidateDiscardSearchResults(string searchId); + /// + /// Discards search results from the session with the given id. `getSearchResults` should no longer + /// be called for that search. + /// + /// Unique search session identifier. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DiscardSearchResultsAsync(string searchId) + { + ValidateDiscardSearchResults(searchId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("searchId", searchId); + return _client.ExecuteDevToolsMethodAsync("DOM.discardSearchResults", dict); + } + + partial void ValidateEnable(CefSharp.DevTools.DOM.EnableIncludeWhitespace? includeWhitespace = null); + /// + /// Enables DOM agent for the given page. + /// + /// Whether to include whitespaces in the children array of returned Nodes. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(CefSharp.DevTools.DOM.EnableIncludeWhitespace? includeWhitespace = null) + { + ValidateEnable(includeWhitespace); + var dict = new System.Collections.Generic.Dictionary(); + if (includeWhitespace.HasValue) + { + dict.Add("includeWhitespace", EnumToString(includeWhitespace)); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.enable", dict); + } + + partial void ValidateFocus(int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Focuses the given element. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task FocusAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateFocus(nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.focus", dict); + } + + partial void ValidateGetAttributes(int nodeId); + /// + /// Returns attributes for the specified node. + /// + /// Id of the node to retrieve attributes for. + /// returns System.Threading.Tasks.Task<GetAttributesResponse> + public System.Threading.Tasks.Task GetAttributesAsync(int nodeId) + { + ValidateGetAttributes(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.getAttributes", dict); + } + + partial void ValidateGetBoxModel(int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Returns boxes for the given node. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<GetBoxModelResponse> + public System.Threading.Tasks.Task GetBoxModelAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateGetBoxModel(nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getBoxModel", dict); + } + + partial void ValidateGetContentQuads(int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Returns quads that describe node position on the page. This method + /// might return multiple quads for inline nodes. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<GetContentQuadsResponse> + public System.Threading.Tasks.Task GetContentQuadsAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateGetContentQuads(nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getContentQuads", dict); + } + + partial void ValidateGetDocument(int? depth = null, bool? pierce = null); + /// + /// Returns the root DOM node (and optionally the subtree) to the caller. + /// Implicitly enables the DOM domain events for the current target. + /// + /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for theentire subtree or provide an integer larger than 0. + /// Whether or not iframes and shadow roots should be traversed when returning the subtree(default is false). + /// returns System.Threading.Tasks.Task<GetDocumentResponse> + public System.Threading.Tasks.Task GetDocumentAsync(int? depth = null, bool? pierce = null) + { + ValidateGetDocument(depth, pierce); + var dict = new System.Collections.Generic.Dictionary(); + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getDocument", dict); + } + + partial void ValidateGetNodesForSubtreeByStyle(int nodeId, System.Collections.Generic.IList computedStyles, bool? pierce = null); + /// + /// Finds nodes with a given computed style in a subtree. + /// + /// Node ID pointing to the root of a subtree. + /// The style to filter nodes by (includes nodes if any of properties matches). + /// Whether or not iframes and shadow roots in the same target should be traversed when returning theresults (default is false). + /// returns System.Threading.Tasks.Task<GetNodesForSubtreeByStyleResponse> + public System.Threading.Tasks.Task GetNodesForSubtreeByStyleAsync(int nodeId, System.Collections.Generic.IList computedStyles, bool? pierce = null) + { + ValidateGetNodesForSubtreeByStyle(nodeId, computedStyles, pierce); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("computedStyles", computedStyles.Select(x => x.ToDictionary())); + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getNodesForSubtreeByStyle", dict); + } + + partial void ValidateGetNodeForLocation(int x, int y, bool? includeUserAgentShadowDOM = null, bool? ignorePointerEventsNone = null); + /// + /// Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is + /// either returned or not. + /// + /// X coordinate. + /// Y coordinate. + /// False to skip to the nearest non-UA shadow root ancestor (default: false). + /// Whether to ignore pointer-events: none on elements and hit test them. + /// returns System.Threading.Tasks.Task<GetNodeForLocationResponse> + public System.Threading.Tasks.Task GetNodeForLocationAsync(int x, int y, bool? includeUserAgentShadowDOM = null, bool? ignorePointerEventsNone = null) + { + ValidateGetNodeForLocation(x, y, includeUserAgentShadowDOM, ignorePointerEventsNone); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + if (includeUserAgentShadowDOM.HasValue) + { + dict.Add("includeUserAgentShadowDOM", includeUserAgentShadowDOM.Value); + } + + if (ignorePointerEventsNone.HasValue) + { + dict.Add("ignorePointerEventsNone", ignorePointerEventsNone.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getNodeForLocation", dict); + } + + partial void ValidateGetOuterHTML(int? nodeId = null, int? backendNodeId = null, string objectId = null, bool? includeShadowDOM = null); + /// + /// Returns node's HTML markup. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// Include all shadow roots. Equals to false if not specified. + /// returns System.Threading.Tasks.Task<GetOuterHTMLResponse> + public System.Threading.Tasks.Task GetOuterHTMLAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, bool? includeShadowDOM = null) + { + ValidateGetOuterHTML(nodeId, backendNodeId, objectId, includeShadowDOM); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (includeShadowDOM.HasValue) + { + dict.Add("includeShadowDOM", includeShadowDOM.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getOuterHTML", dict); + } + + partial void ValidateGetRelayoutBoundary(int nodeId); + /// + /// Returns the id of the nearest ancestor that is a relayout boundary. + /// + /// Id of the node. + /// returns System.Threading.Tasks.Task<GetRelayoutBoundaryResponse> + public System.Threading.Tasks.Task GetRelayoutBoundaryAsync(int nodeId) + { + ValidateGetRelayoutBoundary(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.getRelayoutBoundary", dict); + } + + partial void ValidateGetSearchResults(string searchId, int fromIndex, int toIndex); + /// + /// Returns search results from given `fromIndex` to given `toIndex` from the search with the given + /// identifier. + /// + /// Unique search session identifier. + /// Start index of the search result to be returned. + /// End index of the search result to be returned. + /// returns System.Threading.Tasks.Task<GetSearchResultsResponse> + public System.Threading.Tasks.Task GetSearchResultsAsync(string searchId, int fromIndex, int toIndex) + { + ValidateGetSearchResults(searchId, fromIndex, toIndex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("searchId", searchId); + dict.Add("fromIndex", fromIndex); + dict.Add("toIndex", toIndex); + return _client.ExecuteDevToolsMethodAsync("DOM.getSearchResults", dict); + } + + /// + /// Hides any highlight. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HideHighlightAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.hideHighlight", dict); + } + + /// + /// Highlights DOM node. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightNodeAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.highlightNode", dict); + } + + /// + /// Highlights given rectangle. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightRectAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.highlightRect", dict); + } + + /// + /// Marks last undoable state. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task MarkUndoableStateAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.markUndoableState", dict); + } + + partial void ValidateMoveTo(int nodeId, int targetNodeId, int? insertBeforeNodeId = null); + /// + /// Moves node into the new container, places it before the given anchor. + /// + /// Id of the node to move. + /// Id of the element to drop the moved node into. + /// Drop node before this one (if absent, the moved node becomes the last child of`targetNodeId`). + /// returns System.Threading.Tasks.Task<MoveToResponse> + public System.Threading.Tasks.Task MoveToAsync(int nodeId, int targetNodeId, int? insertBeforeNodeId = null) + { + ValidateMoveTo(nodeId, targetNodeId, insertBeforeNodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("targetNodeId", targetNodeId); + if (insertBeforeNodeId.HasValue) + { + dict.Add("insertBeforeNodeId", insertBeforeNodeId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.moveTo", dict); + } + + partial void ValidatePerformSearch(string query, bool? includeUserAgentShadowDOM = null); + /// + /// Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or + /// `cancelSearch` to end this search session. + /// + /// Plain text or query selector or XPath search query. + /// True to search in user agent shadow DOM. + /// returns System.Threading.Tasks.Task<PerformSearchResponse> + public System.Threading.Tasks.Task PerformSearchAsync(string query, bool? includeUserAgentShadowDOM = null) + { + ValidatePerformSearch(query, includeUserAgentShadowDOM); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("query", query); + if (includeUserAgentShadowDOM.HasValue) + { + dict.Add("includeUserAgentShadowDOM", includeUserAgentShadowDOM.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.performSearch", dict); + } + + partial void ValidatePushNodeByPathToFrontend(string path); + /// + /// Requests that the node is sent to the caller given its path. // FIXME, use XPath + /// + /// Path to node in the proprietary format. + /// returns System.Threading.Tasks.Task<PushNodeByPathToFrontendResponse> + public System.Threading.Tasks.Task PushNodeByPathToFrontendAsync(string path) + { + ValidatePushNodeByPathToFrontend(path); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("path", path); + return _client.ExecuteDevToolsMethodAsync("DOM.pushNodeByPathToFrontend", dict); + } + + partial void ValidatePushNodesByBackendIdsToFrontend(int[] backendNodeIds); + /// + /// Requests that a batch of nodes is sent to the caller given their backend node ids. + /// + /// The array of backend node ids. + /// returns System.Threading.Tasks.Task<PushNodesByBackendIdsToFrontendResponse> + public System.Threading.Tasks.Task PushNodesByBackendIdsToFrontendAsync(int[] backendNodeIds) + { + ValidatePushNodesByBackendIdsToFrontend(backendNodeIds); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("backendNodeIds", backendNodeIds); + return _client.ExecuteDevToolsMethodAsync("DOM.pushNodesByBackendIdsToFrontend", dict); + } + + partial void ValidateQuerySelector(int nodeId, string selector); + /// + /// Executes `querySelector` on a given node. + /// + /// Id of the node to query upon. + /// Selector string. + /// returns System.Threading.Tasks.Task<QuerySelectorResponse> + public System.Threading.Tasks.Task QuerySelectorAsync(int nodeId, string selector) + { + ValidateQuerySelector(nodeId, selector); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("selector", selector); + return _client.ExecuteDevToolsMethodAsync("DOM.querySelector", dict); + } + + partial void ValidateQuerySelectorAll(int nodeId, string selector); + /// + /// Executes `querySelectorAll` on a given node. + /// + /// Id of the node to query upon. + /// Selector string. + /// returns System.Threading.Tasks.Task<QuerySelectorAllResponse> + public System.Threading.Tasks.Task QuerySelectorAllAsync(int nodeId, string selector) + { + ValidateQuerySelectorAll(nodeId, selector); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("selector", selector); + return _client.ExecuteDevToolsMethodAsync("DOM.querySelectorAll", dict); + } + + /// + /// Returns NodeIds of current top layer elements. + /// Top layer is rendered closest to the user within a viewport, therefore its elements always + /// appear on top of all other content. + /// + /// returns System.Threading.Tasks.Task<GetTopLayerElementsResponse> + public System.Threading.Tasks.Task GetTopLayerElementsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.getTopLayerElements", dict); + } + + partial void ValidateGetElementByRelation(int nodeId, CefSharp.DevTools.DOM.GetElementByRelationRelation relation); + /// + /// Returns the NodeId of the matched element according to certain relations. + /// + /// Id of the node from which to query the relation. + /// Type of relation to get. + /// returns System.Threading.Tasks.Task<GetElementByRelationResponse> + public System.Threading.Tasks.Task GetElementByRelationAsync(int nodeId, CefSharp.DevTools.DOM.GetElementByRelationRelation relation) + { + ValidateGetElementByRelation(nodeId, relation); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("relation", EnumToString(relation)); + return _client.ExecuteDevToolsMethodAsync("DOM.getElementByRelation", dict); + } + + /// + /// Re-does the last undone action. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RedoAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.redo", dict); + } + + partial void ValidateRemoveAttribute(int nodeId, string name); + /// + /// Removes attribute with given name from an element with given id. + /// + /// Id of the element to remove attribute from. + /// Name of the attribute to remove. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveAttributeAsync(int nodeId, string name) + { + ValidateRemoveAttribute(nodeId, name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("name", name); + return _client.ExecuteDevToolsMethodAsync("DOM.removeAttribute", dict); + } + + partial void ValidateRemoveNode(int nodeId); + /// + /// Removes node with given id. + /// + /// Id of the node to remove. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveNodeAsync(int nodeId) + { + ValidateRemoveNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.removeNode", dict); + } + + partial void ValidateRequestChildNodes(int nodeId, int? depth = null, bool? pierce = null); + /// + /// Requests that children of the node with given id are returned to the caller in form of + /// `setChildNodes` events where not only immediate children are retrieved, but all children down to + /// the specified depth. + /// + /// Id of the node to get children for. + /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for theentire subtree or provide an integer larger than 0. + /// Whether or not iframes and shadow roots should be traversed when returning the sub-tree(default is false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RequestChildNodesAsync(int nodeId, int? depth = null, bool? pierce = null) + { + ValidateRequestChildNodes(nodeId, depth, pierce); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.requestChildNodes", dict); + } + + partial void ValidateRequestNode(string objectId); + /// + /// Requests that the node is sent to the caller given the JavaScript node object reference. All + /// nodes that form the path from the node to the root are also sent to the client as a series of + /// `setChildNodes` notifications. + /// + /// JavaScript object id to convert into node. + /// returns System.Threading.Tasks.Task<RequestNodeResponse> + public System.Threading.Tasks.Task RequestNodeAsync(string objectId) + { + ValidateRequestNode(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("DOM.requestNode", dict); + } + + partial void ValidateResolveNode(int? nodeId = null, int? backendNodeId = null, string objectGroup = null, int? executionContextId = null); + /// + /// Resolves the JavaScript node object for a given NodeId or BackendNodeId. + /// + /// Id of the node to resolve. + /// Backend identifier of the node to resolve. + /// Symbolic group name that can be used to release multiple objects. + /// Execution context in which to resolve the node. + /// returns System.Threading.Tasks.Task<ResolveNodeResponse> + public System.Threading.Tasks.Task ResolveNodeAsync(int? nodeId = null, int? backendNodeId = null, string objectGroup = null, int? executionContextId = null) + { + ValidateResolveNode(nodeId, backendNodeId, objectGroup, executionContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.resolveNode", dict); + } + + partial void ValidateSetAttributeValue(int nodeId, string name, string value); + /// + /// Sets attribute for an element with given id. + /// + /// Id of the element to set attribute for. + /// Attribute name. + /// Attribute value. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttributeValueAsync(int nodeId, string name, string value) + { + ValidateSetAttributeValue(nodeId, name, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("name", name); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("DOM.setAttributeValue", dict); + } + + partial void ValidateSetAttributesAsText(int nodeId, string text, string name = null); + /// + /// Sets attributes on element with given id. This method is useful when user edits some existing + /// attribute value and types in several attribute name/value pairs. + /// + /// Id of the element to set attributes for. + /// Text with a number of attributes. Will parse this text using HTML parser. + /// Attribute name to replace with new attributes derived from text in case text parsedsuccessfully. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttributesAsTextAsync(int nodeId, string text, string name = null) + { + ValidateSetAttributesAsText(nodeId, text, name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("text", text); + if (!(string.IsNullOrEmpty(name))) + { + dict.Add("name", name); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.setAttributesAsText", dict); + } + + partial void ValidateSetFileInputFiles(string[] files, int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Sets files for the given file input element. + /// + /// Array of file paths to set. + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetFileInputFilesAsync(string[] files, int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateSetFileInputFiles(files, nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("files", files); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.setFileInputFiles", dict); + } + + partial void ValidateSetNodeStackTracesEnabled(bool enable); + /// + /// Sets if stack traces should be captured for Nodes. See `Node.getNodeStackTraces`. Default is disabled. + /// + /// Enable or disable. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetNodeStackTracesEnabledAsync(bool enable) + { + ValidateSetNodeStackTracesEnabled(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("DOM.setNodeStackTracesEnabled", dict); + } + + partial void ValidateGetNodeStackTraces(int nodeId); + /// + /// Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation. + /// + /// Id of the node to get stack traces for. + /// returns System.Threading.Tasks.Task<GetNodeStackTracesResponse> + public System.Threading.Tasks.Task GetNodeStackTracesAsync(int nodeId) + { + ValidateGetNodeStackTraces(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.getNodeStackTraces", dict); + } + + partial void ValidateGetFileInfo(string objectId); + /// + /// Returns file information for the given + /// File wrapper. + /// + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<GetFileInfoResponse> + public System.Threading.Tasks.Task GetFileInfoAsync(string objectId) + { + ValidateGetFileInfo(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("DOM.getFileInfo", dict); + } + + /// + /// Returns list of detached nodes + /// + /// returns System.Threading.Tasks.Task<GetDetachedDomNodesResponse> + public System.Threading.Tasks.Task GetDetachedDomNodesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.getDetachedDomNodes", dict); + } + + partial void ValidateSetInspectedNode(int nodeId); + /// + /// Enables console to refer to the node with given id via $x (see Command Line API for more details + /// $x functions). + /// + /// DOM node id to be accessible by means of $x command line API. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInspectedNodeAsync(int nodeId) + { + ValidateSetInspectedNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.setInspectedNode", dict); + } + + partial void ValidateSetNodeName(int nodeId, string name); + /// + /// Sets node name for a node with given id. + /// + /// Id of the node to set name for. + /// New node's name. + /// returns System.Threading.Tasks.Task<SetNodeNameResponse> + public System.Threading.Tasks.Task SetNodeNameAsync(int nodeId, string name) + { + ValidateSetNodeName(nodeId, name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("name", name); + return _client.ExecuteDevToolsMethodAsync("DOM.setNodeName", dict); + } + + partial void ValidateSetNodeValue(int nodeId, string value); + /// + /// Sets node value for a node with given id. + /// + /// Id of the node to set value for. + /// New node's value. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetNodeValueAsync(int nodeId, string value) + { + ValidateSetNodeValue(nodeId, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("DOM.setNodeValue", dict); + } + + partial void ValidateSetOuterHTML(int nodeId, string outerHTML); + /// + /// Sets node HTML markup, returns new node id. + /// + /// Id of the node to set markup for. + /// Outer HTML markup to set. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetOuterHTMLAsync(int nodeId, string outerHTML) + { + ValidateSetOuterHTML(nodeId, outerHTML); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("outerHTML", outerHTML); + return _client.ExecuteDevToolsMethodAsync("DOM.setOuterHTML", dict); + } + + /// + /// Undoes the last performed action. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UndoAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.undo", dict); + } + + partial void ValidateGetFrameOwner(string frameId); + /// + /// Returns iframe node that owns iframe with the given domain. + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetFrameOwnerResponse> + public System.Threading.Tasks.Task GetFrameOwnerAsync(string frameId) + { + ValidateGetFrameOwner(frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + return _client.ExecuteDevToolsMethodAsync("DOM.getFrameOwner", dict); + } + + partial void ValidateGetContainerForNode(int nodeId, string containerName = null, CefSharp.DevTools.DOM.PhysicalAxes? physicalAxes = null, CefSharp.DevTools.DOM.LogicalAxes? logicalAxes = null, bool? queriesScrollState = null, bool? queriesAnchored = null); + /// + /// Returns the query container of the given node based on container query + /// conditions: containerName, physical and logical axes, and whether it queries + /// scroll-state or anchored elements. If no axes are provided and + /// queriesScrollState is false, the style container is returned, which is the + /// direct parent or the closest element with a matching container-name. + /// + /// nodeId + /// containerName + /// physicalAxes + /// logicalAxes + /// queriesScrollState + /// queriesAnchored + /// returns System.Threading.Tasks.Task<GetContainerForNodeResponse> + public System.Threading.Tasks.Task GetContainerForNodeAsync(int nodeId, string containerName = null, CefSharp.DevTools.DOM.PhysicalAxes? physicalAxes = null, CefSharp.DevTools.DOM.LogicalAxes? logicalAxes = null, bool? queriesScrollState = null, bool? queriesAnchored = null) + { + ValidateGetContainerForNode(nodeId, containerName, physicalAxes, logicalAxes, queriesScrollState, queriesAnchored); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + if (!(string.IsNullOrEmpty(containerName))) + { + dict.Add("containerName", containerName); + } + + if (physicalAxes.HasValue) + { + dict.Add("physicalAxes", EnumToString(physicalAxes)); + } + + if (logicalAxes.HasValue) + { + dict.Add("logicalAxes", EnumToString(logicalAxes)); + } + + if (queriesScrollState.HasValue) + { + dict.Add("queriesScrollState", queriesScrollState.Value); + } + + if (queriesAnchored.HasValue) + { + dict.Add("queriesAnchored", queriesAnchored.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getContainerForNode", dict); + } + + partial void ValidateGetQueryingDescendantsForContainer(int nodeId); + /// + /// Returns the descendants of a container query container that have + /// container queries against this container. + /// + /// Id of the container node to find querying descendants from. + /// returns System.Threading.Tasks.Task<GetQueryingDescendantsForContainerResponse> + public System.Threading.Tasks.Task GetQueryingDescendantsForContainerAsync(int nodeId) + { + ValidateGetQueryingDescendantsForContainer(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.getQueryingDescendantsForContainer", dict); + } + + partial void ValidateGetAnchorElement(int nodeId, string anchorSpecifier = null); + /// + /// Returns the target anchor element of the given anchor query according to + /// https://www.w3.org/TR/css-anchor-position-1/#target. + /// + /// Id of the positioned element from which to find the anchor. + /// An optional anchor specifier, as defined inhttps://www.w3.org/TR/css-anchor-position-1/#anchor-specifier.If not provided, it will return the implicit anchor element forthe given positioned element. + /// returns System.Threading.Tasks.Task<GetAnchorElementResponse> + public System.Threading.Tasks.Task GetAnchorElementAsync(int nodeId, string anchorSpecifier = null) + { + ValidateGetAnchorElement(nodeId, anchorSpecifier); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + if (!(string.IsNullOrEmpty(anchorSpecifier))) + { + dict.Add("anchorSpecifier", anchorSpecifier); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getAnchorElement", dict); + } + + partial void ValidateForceShowPopover(int nodeId, bool enable); + /// + /// When enabling, this API force-opens the popover identified by nodeId + /// and keeps it open until disabled. + /// + /// Id of the popover HTMLElement + /// If true, opens the popover and keeps it open. If false, closes thepopover if it was previously force-opened. + /// returns System.Threading.Tasks.Task<ForceShowPopoverResponse> + public System.Threading.Tasks.Task ForceShowPopoverAsync(int nodeId, bool enable) + { + ValidateForceShowPopover(nodeId, enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("DOM.forceShowPopover", dict); + } + } +} + +namespace CefSharp.DevTools.DOMDebugger +{ + /// + /// GetEventListenersResponse + /// + [DataContract] + public class GetEventListenersResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList listeners + { + get; + set; + } + + /// + /// listeners + /// + public System.Collections.Generic.IList Listeners + { + get + { + return listeners; + } + } + } +} + +namespace CefSharp.DevTools.DOMDebugger +{ + using System.Linq; + + /// + /// DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript + /// execution will stop on these operations as if there was a regular breakpoint set. + /// + public partial class DOMDebuggerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DOMDebugger + /// + /// DevToolsClient + public DOMDebuggerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateGetEventListeners(string objectId, int? depth = null, bool? pierce = null); + /// + /// Returns event listeners of the given object. + /// + /// Identifier of the object to return listeners for. + /// The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for theentire subtree or provide an integer larger than 0. + /// Whether or not iframes and shadow roots should be traversed when returning the subtree(default is false). Reports listeners for all contexts if pierce is enabled. + /// returns System.Threading.Tasks.Task<GetEventListenersResponse> + public System.Threading.Tasks.Task GetEventListenersAsync(string objectId, int? depth = null, bool? pierce = null) + { + ValidateGetEventListeners(objectId, depth, pierce); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.getEventListeners", dict); + } + + partial void ValidateRemoveDOMBreakpoint(int nodeId, CefSharp.DevTools.DOMDebugger.DOMBreakpointType type); + /// + /// Removes DOM breakpoint that was set using `setDOMBreakpoint`. + /// + /// Identifier of the node to remove breakpoint from. + /// Type of the breakpoint to remove. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveDOMBreakpointAsync(int nodeId, CefSharp.DevTools.DOMDebugger.DOMBreakpointType type) + { + ValidateRemoveDOMBreakpoint(nodeId, type); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("type", EnumToString(type)); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.removeDOMBreakpoint", dict); + } + + partial void ValidateRemoveEventListenerBreakpoint(string eventName, string targetName = null); + /// + /// Removes breakpoint on particular DOM event. + /// + /// Event name. + /// EventTarget interface name. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveEventListenerBreakpointAsync(string eventName, string targetName = null) + { + ValidateRemoveEventListenerBreakpoint(eventName, targetName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventName", eventName); + if (!(string.IsNullOrEmpty(targetName))) + { + dict.Add("targetName", targetName); + } + + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.removeEventListenerBreakpoint", dict); + } + + partial void ValidateRemoveXHRBreakpoint(string url); + /// + /// Removes breakpoint from XMLHttpRequest. + /// + /// Resource URL substring. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveXHRBreakpointAsync(string url) + { + ValidateRemoveXHRBreakpoint(url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.removeXHRBreakpoint", dict); + } + + partial void ValidateSetBreakOnCSPViolation(CefSharp.DevTools.DOMDebugger.CSPViolationType[] violationTypes); + /// + /// Sets breakpoint on particular CSP violations. + /// + /// CSP Violations to stop upon. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBreakOnCSPViolationAsync(CefSharp.DevTools.DOMDebugger.CSPViolationType[] violationTypes) + { + ValidateSetBreakOnCSPViolation(violationTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("violationTypes", EnumToString(violationTypes)); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.setBreakOnCSPViolation", dict); + } + + partial void ValidateSetDOMBreakpoint(int nodeId, CefSharp.DevTools.DOMDebugger.DOMBreakpointType type); + /// + /// Sets breakpoint on particular operation with DOM. + /// + /// Identifier of the node to set breakpoint on. + /// Type of the operation to stop upon. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDOMBreakpointAsync(int nodeId, CefSharp.DevTools.DOMDebugger.DOMBreakpointType type) + { + ValidateSetDOMBreakpoint(nodeId, type); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("type", EnumToString(type)); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.setDOMBreakpoint", dict); + } + + partial void ValidateSetEventListenerBreakpoint(string eventName, string targetName = null); + /// + /// Sets breakpoint on particular DOM event. + /// + /// DOM Event name to stop on (any DOM event will do). + /// EventTarget interface name to stop on. If equal to `"*"` or not provided, will stop on anyEventTarget. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEventListenerBreakpointAsync(string eventName, string targetName = null) + { + ValidateSetEventListenerBreakpoint(eventName, targetName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventName", eventName); + if (!(string.IsNullOrEmpty(targetName))) + { + dict.Add("targetName", targetName); + } + + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.setEventListenerBreakpoint", dict); + } + + partial void ValidateSetXHRBreakpoint(string url); + /// + /// Sets breakpoint on XMLHttpRequest. + /// + /// Resource URL substring. All XHRs having this substring in the URL will get stopped upon. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetXHRBreakpointAsync(string url) + { + ValidateSetXHRBreakpoint(url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.setXHRBreakpoint", dict); + } + } +} + +namespace CefSharp.DevTools.DOMSnapshot +{ + /// + /// CaptureSnapshotResponse + /// + [DataContract] + public class CaptureSnapshotResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList documents + { + get; + set; + } + + /// + /// documents + /// + public System.Collections.Generic.IList Documents + { + get + { + return documents; + } + } + + [DataMember] + internal string[] strings + { + get; + set; + } + + /// + /// strings + /// + public string[] Strings + { + get + { + return strings; + } + } + } +} + +namespace CefSharp.DevTools.DOMSnapshot +{ + using System.Linq; + + /// + /// This domain facilitates obtaining document snapshots with DOM, layout, and style information. + /// + public partial class DOMSnapshotClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DOMSnapshot + /// + /// DevToolsClient + public DOMSnapshotClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Disables DOM snapshot agent for the given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOMSnapshot.disable", dict); + } + + /// + /// Enables DOM snapshot agent for the given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOMSnapshot.enable", dict); + } + + partial void ValidateCaptureSnapshot(string[] computedStyles, bool? includePaintOrder = null, bool? includeDOMRects = null, bool? includeBlendedBackgroundColors = null, bool? includeTextColorOpacities = null); + /// + /// Returns a document snapshot, including the full DOM tree of the root node (including iframes, + /// template contents, and imported documents) in a flattened array, as well as layout and + /// white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is + /// flattened. + /// + /// Whitelist of computed styles to return. + /// Whether to include layout object paint orders into the snapshot. + /// Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot + /// Whether to include blended background colors in the snapshot (default: false).Blended background color is achieved by blending background colors of all elementsthat overlap with the current element. + /// Whether to include text color opacity in the snapshot (default: false).An element might have the opacity property set that affects the text color of the element.The final text color opacity is computed based on the opacity of all overlapping elements. + /// returns System.Threading.Tasks.Task<CaptureSnapshotResponse> + public System.Threading.Tasks.Task CaptureSnapshotAsync(string[] computedStyles, bool? includePaintOrder = null, bool? includeDOMRects = null, bool? includeBlendedBackgroundColors = null, bool? includeTextColorOpacities = null) + { + ValidateCaptureSnapshot(computedStyles, includePaintOrder, includeDOMRects, includeBlendedBackgroundColors, includeTextColorOpacities); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("computedStyles", computedStyles); + if (includePaintOrder.HasValue) + { + dict.Add("includePaintOrder", includePaintOrder.Value); + } + + if (includeDOMRects.HasValue) + { + dict.Add("includeDOMRects", includeDOMRects.Value); + } + + if (includeBlendedBackgroundColors.HasValue) + { + dict.Add("includeBlendedBackgroundColors", includeBlendedBackgroundColors.Value); + } + + if (includeTextColorOpacities.HasValue) + { + dict.Add("includeTextColorOpacities", includeTextColorOpacities.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOMSnapshot.captureSnapshot", dict); + } + } +} + +namespace CefSharp.DevTools.DOMStorage +{ + /// + /// GetDOMStorageItemsResponse + /// + [DataContract] + public class GetDOMStorageItemsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] entries + { + get; + set; + } + + /// + /// entries + /// + public string[] Entries + { + get + { + return entries; + } + } + } +} + +namespace CefSharp.DevTools.DOMStorage +{ + using System.Linq; + + /// + /// Query and modify DOM storage. + /// + public partial class DOMStorageClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DOMStorage + /// + /// DevToolsClient + public DOMStorageClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// DomStorageItemAdded + /// + public event System.EventHandler DomStorageItemAdded + { + add + { + _client.AddEventHandler("DOMStorage.domStorageItemAdded", value); + } + + remove + { + _client.RemoveEventHandler("DOMStorage.domStorageItemAdded", value); + } + } + + /// + /// DomStorageItemRemoved + /// + public event System.EventHandler DomStorageItemRemoved + { + add + { + _client.AddEventHandler("DOMStorage.domStorageItemRemoved", value); + } + + remove + { + _client.RemoveEventHandler("DOMStorage.domStorageItemRemoved", value); + } + } + + /// + /// DomStorageItemUpdated + /// + public event System.EventHandler DomStorageItemUpdated + { + add + { + _client.AddEventHandler("DOMStorage.domStorageItemUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOMStorage.domStorageItemUpdated", value); + } + } + + /// + /// DomStorageItemsCleared + /// + public event System.EventHandler DomStorageItemsCleared + { + add + { + _client.AddEventHandler("DOMStorage.domStorageItemsCleared", value); + } + + remove + { + _client.RemoveEventHandler("DOMStorage.domStorageItemsCleared", value); + } + } + + partial void ValidateClear(CefSharp.DevTools.DOMStorage.StorageId storageId); + /// + /// Clear + /// + /// storageId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearAsync(CefSharp.DevTools.DOMStorage.StorageId storageId) + { + ValidateClear(storageId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageId", storageId.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("DOMStorage.clear", dict); + } + + /// + /// Disables storage tracking, prevents storage events from being sent to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOMStorage.disable", dict); + } + + /// + /// Enables storage tracking, storage events will now be delivered to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOMStorage.enable", dict); + } + + partial void ValidateGetDOMStorageItems(CefSharp.DevTools.DOMStorage.StorageId storageId); + /// + /// GetDOMStorageItems + /// + /// storageId + /// returns System.Threading.Tasks.Task<GetDOMStorageItemsResponse> + public System.Threading.Tasks.Task GetDOMStorageItemsAsync(CefSharp.DevTools.DOMStorage.StorageId storageId) + { + ValidateGetDOMStorageItems(storageId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageId", storageId.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("DOMStorage.getDOMStorageItems", dict); + } + + partial void ValidateRemoveDOMStorageItem(CefSharp.DevTools.DOMStorage.StorageId storageId, string key); + /// + /// RemoveDOMStorageItem + /// + /// storageId + /// key + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveDOMStorageItemAsync(CefSharp.DevTools.DOMStorage.StorageId storageId, string key) + { + ValidateRemoveDOMStorageItem(storageId, key); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageId", storageId.ToDictionary()); + dict.Add("key", key); + return _client.ExecuteDevToolsMethodAsync("DOMStorage.removeDOMStorageItem", dict); + } + + partial void ValidateSetDOMStorageItem(CefSharp.DevTools.DOMStorage.StorageId storageId, string key, string value); + /// + /// SetDOMStorageItem + /// + /// storageId + /// key + /// value + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDOMStorageItemAsync(CefSharp.DevTools.DOMStorage.StorageId storageId, string key, string value) + { + ValidateSetDOMStorageItem(storageId, key, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageId", storageId.ToDictionary()); + dict.Add("key", key); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("DOMStorage.setDOMStorageItem", dict); + } + } +} + +namespace CefSharp.DevTools.DeviceAccess +{ + using System.Linq; + + /// + /// DeviceAccess + /// + public partial class DeviceAccessClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DeviceAccess + /// + /// DevToolsClient + public DeviceAccessClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// A device request opened a user prompt to select a device. Respond with the + /// selectPrompt or cancelPrompt command. + /// + public event System.EventHandler DeviceRequestPrompted + { + add + { + _client.AddEventHandler("DeviceAccess.deviceRequestPrompted", value); + } + + remove + { + _client.RemoveEventHandler("DeviceAccess.deviceRequestPrompted", value); + } + } + + /// + /// Enable events in this domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DeviceAccess.enable", dict); + } + + /// + /// Disable events in this domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DeviceAccess.disable", dict); + } + + partial void ValidateSelectPrompt(string id, string deviceId); + /// + /// Select a device in response to a DeviceAccess.deviceRequestPrompted event. + /// + /// id + /// deviceId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SelectPromptAsync(string id, string deviceId) + { + ValidateSelectPrompt(id, deviceId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("deviceId", deviceId); + return _client.ExecuteDevToolsMethodAsync("DeviceAccess.selectPrompt", dict); + } + + partial void ValidateCancelPrompt(string id); + /// + /// Cancel a prompt in response to a DeviceAccess.deviceRequestPrompted event. + /// + /// id + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CancelPromptAsync(string id) + { + ValidateCancelPrompt(id); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + return _client.ExecuteDevToolsMethodAsync("DeviceAccess.cancelPrompt", dict); + } + } +} + +namespace CefSharp.DevTools.DeviceOrientation +{ + using System.Linq; + + /// + /// DeviceOrientation + /// + public partial class DeviceOrientationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DeviceOrientation + /// + /// DevToolsClient + public DeviceOrientationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Clears the overridden Device Orientation. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDeviceOrientationOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DeviceOrientation.clearDeviceOrientationOverride", dict); + } + + partial void ValidateSetDeviceOrientationOverride(double alpha, double beta, double gamma); + /// + /// Overrides the Device Orientation. + /// + /// Mock alpha + /// Mock beta + /// Mock gamma + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDeviceOrientationOverrideAsync(double alpha, double beta, double gamma) + { + ValidateSetDeviceOrientationOverride(alpha, beta, gamma); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("alpha", alpha); + dict.Add("beta", beta); + dict.Add("gamma", gamma); + return _client.ExecuteDevToolsMethodAsync("DeviceOrientation.setDeviceOrientationOverride", dict); + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// GetOverriddenSensorInformationResponse + /// + [DataContract] + public class GetOverriddenSensorInformationResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double requestedSamplingFrequency + { + get; + set; + } + + /// + /// requestedSamplingFrequency + /// + public double RequestedSamplingFrequency + { + get + { + return requestedSamplingFrequency; + } + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// SetVirtualTimePolicyResponse + /// + [DataContract] + public class SetVirtualTimePolicyResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double virtualTimeTicksBase + { + get; + set; + } + + /// + /// virtualTimeTicksBase + /// + public double VirtualTimeTicksBase + { + get + { + return virtualTimeTicksBase; + } + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// GetScreenInfosResponse + /// + [DataContract] + public class GetScreenInfosResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList screenInfos + { + get; + set; + } + + /// + /// screenInfos + /// + public System.Collections.Generic.IList ScreenInfos + { + get + { + return screenInfos; + } + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// AddScreenResponse + /// + [DataContract] + public class AddScreenResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Emulation.ScreenInfo screenInfo + { + get; + set; + } + + /// + /// screenInfo + /// + public CefSharp.DevTools.Emulation.ScreenInfo ScreenInfo + { + get + { + return screenInfo; + } + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + using System.Linq; + + /// + /// Touch/gesture events configuration. Default: current platform. + /// + public enum SetEmitTouchEventsForMouseConfiguration + { + /// + /// mobile + /// + [EnumMember(Value = ("mobile"))] + Mobile, + /// + /// desktop + /// + [EnumMember(Value = ("desktop"))] + Desktop + } + + /// + /// Vision deficiency to emulate. Order: best-effort emulations come first, followed by any + /// physiologically accurate emulations for medically recognized color vision deficiencies. + /// + public enum SetEmulatedVisionDeficiencyType + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// blurredVision + /// + [EnumMember(Value = ("blurredVision"))] + BlurredVision, + /// + /// reducedContrast + /// + [EnumMember(Value = ("reducedContrast"))] + ReducedContrast, + /// + /// achromatopsia + /// + [EnumMember(Value = ("achromatopsia"))] + Achromatopsia, + /// + /// deuteranopia + /// + [EnumMember(Value = ("deuteranopia"))] + Deuteranopia, + /// + /// protanopia + /// + [EnumMember(Value = ("protanopia"))] + Protanopia, + /// + /// tritanopia + /// + [EnumMember(Value = ("tritanopia"))] + Tritanopia + } + + /// + /// This domain emulates different environments for the page. + /// + public partial class EmulationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Emulation + /// + /// DevToolsClient + public EmulationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Notification sent after the virtual time budget for the current VirtualTimePolicy has run out. + /// + public event System.EventHandler VirtualTimeBudgetExpired + { + add + { + _client.AddEventHandler("Emulation.virtualTimeBudgetExpired", value); + } + + remove + { + _client.RemoveEventHandler("Emulation.virtualTimeBudgetExpired", value); + } + } + + /// + /// Clears the overridden device metrics. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDeviceMetricsOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearDeviceMetricsOverride", dict); + } + + /// + /// Clears the overridden Geolocation Position and Error. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearGeolocationOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearGeolocationOverride", dict); + } + + /// + /// Requests that page scale factor is reset to initial values. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetPageScaleFactorAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.resetPageScaleFactor", dict); + } + + partial void ValidateSetFocusEmulationEnabled(bool enabled); + /// + /// Enables or disables simulating a focused and active page. + /// + /// Whether to enable to disable focus emulation. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetFocusEmulationEnabledAsync(bool enabled) + { + ValidateSetFocusEmulationEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Emulation.setFocusEmulationEnabled", dict); + } + + partial void ValidateSetAutoDarkModeOverride(bool? enabled = null); + /// + /// Automatically render all web contents using a dark theme. + /// + /// Whether to enable or disable automatic dark mode.If not specified, any existing override will be cleared. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAutoDarkModeOverrideAsync(bool? enabled = null) + { + ValidateSetAutoDarkModeOverride(enabled); + var dict = new System.Collections.Generic.Dictionary(); + if (enabled.HasValue) + { + dict.Add("enabled", enabled.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setAutoDarkModeOverride", dict); + } + + partial void ValidateSetCPUThrottlingRate(double rate); + /// + /// Enables CPU throttling to emulate slow CPUs. + /// + /// Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCPUThrottlingRateAsync(double rate) + { + ValidateSetCPUThrottlingRate(rate); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("rate", rate); + return _client.ExecuteDevToolsMethodAsync("Emulation.setCPUThrottlingRate", dict); + } + + partial void ValidateSetDefaultBackgroundColorOverride(CefSharp.DevTools.DOM.RGBA color = null); + /// + /// Sets or clears an override of the default background color of the frame. This override is used + /// if the content does not specify one. + /// + /// RGBA of the default background color. If not specified, any existing override will becleared. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDefaultBackgroundColorOverrideAsync(CefSharp.DevTools.DOM.RGBA color = null) + { + ValidateSetDefaultBackgroundColorOverride(color); + var dict = new System.Collections.Generic.Dictionary(); + if ((color) != (null)) + { + dict.Add("color", color.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setDefaultBackgroundColorOverride", dict); + } + + partial void ValidateSetSafeAreaInsetsOverride(CefSharp.DevTools.Emulation.SafeAreaInsets insets); + /// + /// Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the + /// respective variables to be undefined, even if previously overridden. + /// + /// insets + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSafeAreaInsetsOverrideAsync(CefSharp.DevTools.Emulation.SafeAreaInsets insets) + { + ValidateSetSafeAreaInsetsOverride(insets); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("insets", insets.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Emulation.setSafeAreaInsetsOverride", dict); + } + + partial void ValidateSetDeviceMetricsOverride(int width, int height, double deviceScaleFactor, bool mobile, double? scale = null, int? screenWidth = null, int? screenHeight = null, int? positionX = null, int? positionY = null, bool? dontSetVisibleSize = null, CefSharp.DevTools.Emulation.ScreenOrientation screenOrientation = null, CefSharp.DevTools.Page.Viewport viewport = null, CefSharp.DevTools.Emulation.DisplayFeature displayFeature = null, CefSharp.DevTools.Emulation.DevicePosture devicePosture = null); + /// + /// Overrides the values of device screen dimensions (window.screen.width, window.screen.height, + /// window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media + /// query results). + /// + /// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. + /// Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override. + /// Overriding device scale factor value. 0 disables the override. + /// Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, textautosizing and more. + /// Scale to apply to resulting view image. + /// Overriding screen width value in pixels (minimum 0, maximum 10000000). + /// Overriding screen height value in pixels (minimum 0, maximum 10000000). + /// Overriding view X position on screen in pixels (minimum 0, maximum 10000000). + /// Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). + /// Do not set visible view size, rely upon explicit setVisibleSize call. + /// Screen orientation override. + /// If set, the visible area of the page will be overridden to this viewport. This viewportchange is not observed by the page, e.g. viewport-relative elements do not change positions. + /// If set, the display feature of a multi-segment screen. If not set, multi-segment supportis turned-off.Deprecated, use Emulation.setDisplayFeaturesOverride. + /// If set, the posture of a foldable device. If not set the posture is setto continuous.Deprecated, use Emulation.setDevicePostureOverride. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDeviceMetricsOverrideAsync(int width, int height, double deviceScaleFactor, bool mobile, double? scale = null, int? screenWidth = null, int? screenHeight = null, int? positionX = null, int? positionY = null, bool? dontSetVisibleSize = null, CefSharp.DevTools.Emulation.ScreenOrientation screenOrientation = null, CefSharp.DevTools.Page.Viewport viewport = null, CefSharp.DevTools.Emulation.DisplayFeature displayFeature = null, CefSharp.DevTools.Emulation.DevicePosture devicePosture = null) + { + ValidateSetDeviceMetricsOverride(width, height, deviceScaleFactor, mobile, scale, screenWidth, screenHeight, positionX, positionY, dontSetVisibleSize, screenOrientation, viewport, displayFeature, devicePosture); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("width", width); + dict.Add("height", height); + dict.Add("deviceScaleFactor", deviceScaleFactor); + dict.Add("mobile", mobile); + if (scale.HasValue) + { + dict.Add("scale", scale.Value); + } + + if (screenWidth.HasValue) + { + dict.Add("screenWidth", screenWidth.Value); + } + + if (screenHeight.HasValue) + { + dict.Add("screenHeight", screenHeight.Value); + } + + if (positionX.HasValue) + { + dict.Add("positionX", positionX.Value); + } + + if (positionY.HasValue) + { + dict.Add("positionY", positionY.Value); + } + + if (dontSetVisibleSize.HasValue) + { + dict.Add("dontSetVisibleSize", dontSetVisibleSize.Value); + } + + if ((screenOrientation) != (null)) + { + dict.Add("screenOrientation", screenOrientation.ToDictionary()); + } + + if ((viewport) != (null)) + { + dict.Add("viewport", viewport.ToDictionary()); + } + + if ((displayFeature) != (null)) + { + dict.Add("displayFeature", displayFeature.ToDictionary()); + } + + if ((devicePosture) != (null)) + { + dict.Add("devicePosture", devicePosture.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setDeviceMetricsOverride", dict); + } + + partial void ValidateSetDevicePostureOverride(CefSharp.DevTools.Emulation.DevicePosture posture); + /// + /// Start reporting the given posture value to the Device Posture API. + /// This override can also be set in setDeviceMetricsOverride(). + /// + /// posture + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDevicePostureOverrideAsync(CefSharp.DevTools.Emulation.DevicePosture posture) + { + ValidateSetDevicePostureOverride(posture); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("posture", posture.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Emulation.setDevicePostureOverride", dict); + } + + /// + /// Clears a device posture override set with either setDeviceMetricsOverride() + /// or setDevicePostureOverride() and starts using posture information from the + /// platform again. + /// Does nothing if no override is set. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDevicePostureOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearDevicePostureOverride", dict); + } + + partial void ValidateSetDisplayFeaturesOverride(System.Collections.Generic.IList features); + /// + /// Start using the given display features to pupulate the Viewport Segments API. + /// This override can also be set in setDeviceMetricsOverride(). + /// + /// features + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDisplayFeaturesOverrideAsync(System.Collections.Generic.IList features) + { + ValidateSetDisplayFeaturesOverride(features); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("features", features.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Emulation.setDisplayFeaturesOverride", dict); + } + + /// + /// Clears the display features override set with either setDeviceMetricsOverride() + /// or setDisplayFeaturesOverride() and starts using display features from the + /// platform again. + /// Does nothing if no override is set. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDisplayFeaturesOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearDisplayFeaturesOverride", dict); + } + + partial void ValidateSetScrollbarsHidden(bool hidden); + /// + /// SetScrollbarsHidden + /// + /// Whether scrollbars should be always hidden. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetScrollbarsHiddenAsync(bool hidden) + { + ValidateSetScrollbarsHidden(hidden); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("hidden", hidden); + return _client.ExecuteDevToolsMethodAsync("Emulation.setScrollbarsHidden", dict); + } + + partial void ValidateSetDocumentCookieDisabled(bool disabled); + /// + /// SetDocumentCookieDisabled + /// + /// Whether document.coookie API should be disabled. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDocumentCookieDisabledAsync(bool disabled) + { + ValidateSetDocumentCookieDisabled(disabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("disabled", disabled); + return _client.ExecuteDevToolsMethodAsync("Emulation.setDocumentCookieDisabled", dict); + } + + partial void ValidateSetEmitTouchEventsForMouse(bool enabled, CefSharp.DevTools.Emulation.SetEmitTouchEventsForMouseConfiguration? configuration = null); + /// + /// SetEmitTouchEventsForMouse + /// + /// Whether touch emulation based on mouse input should be enabled. + /// Touch/gesture events configuration. Default: current platform. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEmitTouchEventsForMouseAsync(bool enabled, CefSharp.DevTools.Emulation.SetEmitTouchEventsForMouseConfiguration? configuration = null) + { + ValidateSetEmitTouchEventsForMouse(enabled, configuration); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + if (configuration.HasValue) + { + dict.Add("configuration", EnumToString(configuration)); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setEmitTouchEventsForMouse", dict); + } + + partial void ValidateSetEmulatedMedia(string media = null, System.Collections.Generic.IList features = null); + /// + /// Emulates the given media type or media feature for CSS media queries. + /// + /// Media type to emulate. Empty string disables the override. + /// Media features to emulate. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEmulatedMediaAsync(string media = null, System.Collections.Generic.IList features = null) + { + ValidateSetEmulatedMedia(media, features); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(media))) + { + dict.Add("media", media); + } + + if ((features) != (null)) + { + dict.Add("features", features.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setEmulatedMedia", dict); + } + + partial void ValidateSetEmulatedVisionDeficiency(CefSharp.DevTools.Emulation.SetEmulatedVisionDeficiencyType type); + /// + /// Emulates the given vision deficiency. + /// + /// Vision deficiency to emulate. Order: best-effort emulations come first, followed by anyphysiologically accurate emulations for medically recognized color vision deficiencies. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEmulatedVisionDeficiencyAsync(CefSharp.DevTools.Emulation.SetEmulatedVisionDeficiencyType type) + { + ValidateSetEmulatedVisionDeficiency(type); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + return _client.ExecuteDevToolsMethodAsync("Emulation.setEmulatedVisionDeficiency", dict); + } + + partial void ValidateSetEmulatedOSTextScale(double? scale = null); + /// + /// Emulates the given OS text scale. + /// + /// scale + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEmulatedOSTextScaleAsync(double? scale = null) + { + ValidateSetEmulatedOSTextScale(scale); + var dict = new System.Collections.Generic.Dictionary(); + if (scale.HasValue) + { + dict.Add("scale", scale.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setEmulatedOSTextScale", dict); + } + + partial void ValidateSetGeolocationOverride(double? latitude = null, double? longitude = null, double? accuracy = null, double? altitude = null, double? altitudeAccuracy = null, double? heading = null, double? speed = null); + /// + /// Overrides the Geolocation Position or Error. Omitting latitude, longitude or + /// accuracy emulates position unavailable. + /// + /// Mock latitude + /// Mock longitude + /// Mock accuracy + /// Mock altitude + /// Mock altitudeAccuracy + /// Mock heading + /// Mock speed + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetGeolocationOverrideAsync(double? latitude = null, double? longitude = null, double? accuracy = null, double? altitude = null, double? altitudeAccuracy = null, double? heading = null, double? speed = null) + { + ValidateSetGeolocationOverride(latitude, longitude, accuracy, altitude, altitudeAccuracy, heading, speed); + var dict = new System.Collections.Generic.Dictionary(); + if (latitude.HasValue) + { + dict.Add("latitude", latitude.Value); + } + + if (longitude.HasValue) + { + dict.Add("longitude", longitude.Value); + } + + if (accuracy.HasValue) + { + dict.Add("accuracy", accuracy.Value); + } + + if (altitude.HasValue) + { + dict.Add("altitude", altitude.Value); + } + + if (altitudeAccuracy.HasValue) + { + dict.Add("altitudeAccuracy", altitudeAccuracy.Value); + } + + if (heading.HasValue) + { + dict.Add("heading", heading.Value); + } + + if (speed.HasValue) + { + dict.Add("speed", speed.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setGeolocationOverride", dict); + } + + partial void ValidateGetOverriddenSensorInformation(CefSharp.DevTools.Emulation.SensorType type); + /// + /// GetOverriddenSensorInformation + /// + /// type + /// returns System.Threading.Tasks.Task<GetOverriddenSensorInformationResponse> + public System.Threading.Tasks.Task GetOverriddenSensorInformationAsync(CefSharp.DevTools.Emulation.SensorType type) + { + ValidateGetOverriddenSensorInformation(type); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + return _client.ExecuteDevToolsMethodAsync("Emulation.getOverriddenSensorInformation", dict); + } + + partial void ValidateSetSensorOverrideEnabled(bool enabled, CefSharp.DevTools.Emulation.SensorType type, CefSharp.DevTools.Emulation.SensorMetadata metadata = null); + /// + /// Overrides a platform sensor of a given type. If |enabled| is true, calls to + /// Sensor.start() will use a virtual sensor as backend rather than fetching + /// data from a real hardware sensor. Otherwise, existing virtual + /// sensor-backend Sensor objects will fire an error event and new calls to + /// Sensor.start() will attempt to use a real sensor instead. + /// + /// enabled + /// type + /// metadata + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSensorOverrideEnabledAsync(bool enabled, CefSharp.DevTools.Emulation.SensorType type, CefSharp.DevTools.Emulation.SensorMetadata metadata = null) + { + ValidateSetSensorOverrideEnabled(enabled, type, metadata); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + dict.Add("type", EnumToString(type)); + if ((metadata) != (null)) + { + dict.Add("metadata", metadata.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setSensorOverrideEnabled", dict); + } + + partial void ValidateSetSensorOverrideReadings(CefSharp.DevTools.Emulation.SensorType type, CefSharp.DevTools.Emulation.SensorReading reading); + /// + /// Updates the sensor readings reported by a sensor type previously overridden + /// by setSensorOverrideEnabled. + /// + /// type + /// reading + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSensorOverrideReadingsAsync(CefSharp.DevTools.Emulation.SensorType type, CefSharp.DevTools.Emulation.SensorReading reading) + { + ValidateSetSensorOverrideReadings(type, reading); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("reading", reading.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Emulation.setSensorOverrideReadings", dict); + } + + partial void ValidateSetPressureSourceOverrideEnabled(bool enabled, CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureMetadata metadata = null); + /// + /// Overrides a pressure source of a given type, as used by the Compute + /// Pressure API, so that updates to PressureObserver.observe() are provided + /// via setPressureStateOverride instead of being retrieved from + /// platform-provided telemetry data. + /// + /// enabled + /// source + /// metadata + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPressureSourceOverrideEnabledAsync(bool enabled, CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureMetadata metadata = null) + { + ValidateSetPressureSourceOverrideEnabled(enabled, source, metadata); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + dict.Add("source", EnumToString(source)); + if ((metadata) != (null)) + { + dict.Add("metadata", metadata.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setPressureSourceOverrideEnabled", dict); + } + + partial void ValidateSetPressureStateOverride(CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureState state); + /// + /// TODO: OBSOLETE: To remove when setPressureDataOverride is merged. + /// Provides a given pressure state that will be processed and eventually be + /// delivered to PressureObserver users. |source| must have been previously + /// overridden by setPressureSourceOverrideEnabled. + /// + /// source + /// state + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPressureStateOverrideAsync(CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureState state) + { + ValidateSetPressureStateOverride(source, state); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("source", EnumToString(source)); + dict.Add("state", EnumToString(state)); + return _client.ExecuteDevToolsMethodAsync("Emulation.setPressureStateOverride", dict); + } + + partial void ValidateSetPressureDataOverride(CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureState state, double? ownContributionEstimate = null); + /// + /// Provides a given pressure data set that will be processed and eventually be + /// delivered to PressureObserver users. |source| must have been previously + /// overridden by setPressureSourceOverrideEnabled. + /// + /// source + /// state + /// ownContributionEstimate + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPressureDataOverrideAsync(CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureState state, double? ownContributionEstimate = null) + { + ValidateSetPressureDataOverride(source, state, ownContributionEstimate); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("source", EnumToString(source)); + dict.Add("state", EnumToString(state)); + if (ownContributionEstimate.HasValue) + { + dict.Add("ownContributionEstimate", ownContributionEstimate.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setPressureDataOverride", dict); + } + + partial void ValidateSetIdleOverride(bool isUserActive, bool isScreenUnlocked); + /// + /// Overrides the Idle state. + /// + /// Mock isUserActive + /// Mock isScreenUnlocked + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetIdleOverrideAsync(bool isUserActive, bool isScreenUnlocked) + { + ValidateSetIdleOverride(isUserActive, isScreenUnlocked); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("isUserActive", isUserActive); + dict.Add("isScreenUnlocked", isScreenUnlocked); + return _client.ExecuteDevToolsMethodAsync("Emulation.setIdleOverride", dict); + } + + /// + /// Clears Idle state overrides. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearIdleOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearIdleOverride", dict); + } + + partial void ValidateSetPageScaleFactor(double pageScaleFactor); + /// + /// Sets a specified page scale factor. + /// + /// Page scale factor. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPageScaleFactorAsync(double pageScaleFactor) + { + ValidateSetPageScaleFactor(pageScaleFactor); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("pageScaleFactor", pageScaleFactor); + return _client.ExecuteDevToolsMethodAsync("Emulation.setPageScaleFactor", dict); + } + + partial void ValidateSetScriptExecutionDisabled(bool value); + /// + /// Switches script execution in the page. + /// + /// Whether script execution should be disabled in the page. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetScriptExecutionDisabledAsync(bool value) + { + ValidateSetScriptExecutionDisabled(value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("Emulation.setScriptExecutionDisabled", dict); + } + + partial void ValidateSetTouchEmulationEnabled(bool enabled, int? maxTouchPoints = null); + /// + /// Enables touch on platforms which do not support them. + /// + /// Whether the touch event emulation should be enabled. + /// Maximum touch points supported. Defaults to one. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetTouchEmulationEnabledAsync(bool enabled, int? maxTouchPoints = null) + { + ValidateSetTouchEmulationEnabled(enabled, maxTouchPoints); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + if (maxTouchPoints.HasValue) + { + dict.Add("maxTouchPoints", maxTouchPoints.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setTouchEmulationEnabled", dict); + } + + partial void ValidateSetVirtualTimePolicy(CefSharp.DevTools.Emulation.VirtualTimePolicy policy, double? budget = null, int? maxVirtualTimeTaskStarvationCount = null, double? initialVirtualTime = null); + /// + /// Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets + /// the current virtual time policy. Note this supersedes any previous time budget. + /// + /// policy + /// If set, after this many virtual milliseconds have elapsed virtual time will be paused and avirtualTimeBudgetExpired event is sent. + /// If set this specifies the maximum number of tasks that can be run before virtual is forcedforwards to prevent deadlock. + /// If set, base::Time::Now will be overridden to initially return this value. + /// returns System.Threading.Tasks.Task<SetVirtualTimePolicyResponse> + public System.Threading.Tasks.Task SetVirtualTimePolicyAsync(CefSharp.DevTools.Emulation.VirtualTimePolicy policy, double? budget = null, int? maxVirtualTimeTaskStarvationCount = null, double? initialVirtualTime = null) + { + ValidateSetVirtualTimePolicy(policy, budget, maxVirtualTimeTaskStarvationCount, initialVirtualTime); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("policy", EnumToString(policy)); + if (budget.HasValue) + { + dict.Add("budget", budget.Value); + } + + if (maxVirtualTimeTaskStarvationCount.HasValue) + { + dict.Add("maxVirtualTimeTaskStarvationCount", maxVirtualTimeTaskStarvationCount.Value); + } + + if (initialVirtualTime.HasValue) + { + dict.Add("initialVirtualTime", initialVirtualTime.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setVirtualTimePolicy", dict); + } + + partial void ValidateSetLocaleOverride(string locale = null); + /// + /// Overrides default host system locale with the specified one. + /// + /// ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override andrestores default host system locale. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetLocaleOverrideAsync(string locale = null) + { + ValidateSetLocaleOverride(locale); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(locale))) + { + dict.Add("locale", locale); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setLocaleOverride", dict); + } + + partial void ValidateSetTimezoneOverride(string timezoneId); + /// + /// Overrides default host system timezone with the specified one. + /// + /// The timezone identifier. List of supported timezones:https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txtIf empty, disables the override and restores default host system timezone. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetTimezoneOverrideAsync(string timezoneId) + { + ValidateSetTimezoneOverride(timezoneId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("timezoneId", timezoneId); + return _client.ExecuteDevToolsMethodAsync("Emulation.setTimezoneOverride", dict); + } + + partial void ValidateSetDisabledImageTypes(CefSharp.DevTools.Emulation.DisabledImageType[] imageTypes); + /// + /// SetDisabledImageTypes + /// + /// Image types to disable. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDisabledImageTypesAsync(CefSharp.DevTools.Emulation.DisabledImageType[] imageTypes) + { + ValidateSetDisabledImageTypes(imageTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("imageTypes", EnumToString(imageTypes)); + return _client.ExecuteDevToolsMethodAsync("Emulation.setDisabledImageTypes", dict); + } + + partial void ValidateSetDataSaverOverride(bool? dataSaverEnabled = null); + /// + /// Override the value of navigator.connection.saveData + /// + /// Override value. Omitting the parameter disables the override. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDataSaverOverrideAsync(bool? dataSaverEnabled = null) + { + ValidateSetDataSaverOverride(dataSaverEnabled); + var dict = new System.Collections.Generic.Dictionary(); + if (dataSaverEnabled.HasValue) + { + dict.Add("dataSaverEnabled", dataSaverEnabled.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setDataSaverOverride", dict); + } + + partial void ValidateSetHardwareConcurrencyOverride(int hardwareConcurrency); + /// + /// SetHardwareConcurrencyOverride + /// + /// Hardware concurrency to report + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetHardwareConcurrencyOverrideAsync(int hardwareConcurrency) + { + ValidateSetHardwareConcurrencyOverride(hardwareConcurrency); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("hardwareConcurrency", hardwareConcurrency); + return _client.ExecuteDevToolsMethodAsync("Emulation.setHardwareConcurrencyOverride", dict); + } + + partial void ValidateSetUserAgentOverride(string userAgent, string acceptLanguage = null, string platform = null, CefSharp.DevTools.Emulation.UserAgentMetadata userAgentMetadata = null); + /// + /// Allows overriding user agent with the given string. + /// `userAgentMetadata` must be set for Client Hint headers to be sent. + /// + /// User agent to use. + /// Browser language to emulate. + /// The platform navigator.platform should return. + /// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetUserAgentOverrideAsync(string userAgent, string acceptLanguage = null, string platform = null, CefSharp.DevTools.Emulation.UserAgentMetadata userAgentMetadata = null) + { + ValidateSetUserAgentOverride(userAgent, acceptLanguage, platform, userAgentMetadata); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("userAgent", userAgent); + if (!(string.IsNullOrEmpty(acceptLanguage))) + { + dict.Add("acceptLanguage", acceptLanguage); + } + + if (!(string.IsNullOrEmpty(platform))) + { + dict.Add("platform", platform); + } + + if ((userAgentMetadata) != (null)) + { + dict.Add("userAgentMetadata", userAgentMetadata.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setUserAgentOverride", dict); + } + + partial void ValidateSetAutomationOverride(bool enabled); + /// + /// Allows overriding the automation flag. + /// + /// Whether the override should be enabled. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAutomationOverrideAsync(bool enabled) + { + ValidateSetAutomationOverride(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Emulation.setAutomationOverride", dict); + } + + partial void ValidateSetSmallViewportHeightDifferenceOverride(int difference); + /// + /// Allows overriding the difference between the small and large viewport sizes, which determine the + /// value of the `svh` and `lvh` unit, respectively. Only supported for top-level frames. + /// + /// This will cause an element of size 100svh to be `difference` pixels smaller than an elementof size 100lvh. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSmallViewportHeightDifferenceOverrideAsync(int difference) + { + ValidateSetSmallViewportHeightDifferenceOverride(difference); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("difference", difference); + return _client.ExecuteDevToolsMethodAsync("Emulation.setSmallViewportHeightDifferenceOverride", dict); + } + + /// + /// Returns device's screen configuration. + /// + /// returns System.Threading.Tasks.Task<GetScreenInfosResponse> + public System.Threading.Tasks.Task GetScreenInfosAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.getScreenInfos", dict); + } + + partial void ValidateAddScreen(int left, int top, int width, int height, CefSharp.DevTools.Emulation.WorkAreaInsets workAreaInsets = null, double? devicePixelRatio = null, int? rotation = null, int? colorDepth = null, string label = null, bool? isInternal = null); + /// + /// Add a new screen to the device. Only supported in headless mode. + /// + /// Offset of the left edge of the screen in pixels. + /// Offset of the top edge of the screen in pixels. + /// The width of the screen in pixels. + /// The height of the screen in pixels. + /// Specifies the screen's work area. Default is entire screen. + /// Specifies the screen's device pixel ratio. Default is 1. + /// Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0. + /// Specifies the screen's color depth in bits. Default is 24. + /// Specifies the descriptive label for the screen. Default is none. + /// Indicates whether the screen is internal to the device or external, attached to the device. Default is false. + /// returns System.Threading.Tasks.Task<AddScreenResponse> + public System.Threading.Tasks.Task AddScreenAsync(int left, int top, int width, int height, CefSharp.DevTools.Emulation.WorkAreaInsets workAreaInsets = null, double? devicePixelRatio = null, int? rotation = null, int? colorDepth = null, string label = null, bool? isInternal = null) + { + ValidateAddScreen(left, top, width, height, workAreaInsets, devicePixelRatio, rotation, colorDepth, label, isInternal); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("left", left); + dict.Add("top", top); + dict.Add("width", width); + dict.Add("height", height); + if ((workAreaInsets) != (null)) + { + dict.Add("workAreaInsets", workAreaInsets.ToDictionary()); + } + + if (devicePixelRatio.HasValue) + { + dict.Add("devicePixelRatio", devicePixelRatio.Value); + } + + if (rotation.HasValue) + { + dict.Add("rotation", rotation.Value); + } + + if (colorDepth.HasValue) + { + dict.Add("colorDepth", colorDepth.Value); + } + + if (!(string.IsNullOrEmpty(label))) + { + dict.Add("label", label); + } + + if (isInternal.HasValue) + { + dict.Add("isInternal", isInternal.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.addScreen", dict); + } + + partial void ValidateRemoveScreen(string screenId); + /// + /// Remove screen from the device. Only supported in headless mode. + /// + /// screenId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveScreenAsync(string screenId) + { + ValidateRemoveScreen(screenId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("screenId", screenId); + return _client.ExecuteDevToolsMethodAsync("Emulation.removeScreen", dict); + } + } +} + +namespace CefSharp.DevTools.EventBreakpoints +{ + using System.Linq; + + /// + /// EventBreakpoints permits setting JavaScript breakpoints on operations and events + /// occurring in native code invoked from JavaScript. Once breakpoint is hit, it is + /// reported through Debugger domain, similarly to regular breakpoints being hit. + /// + public partial class EventBreakpointsClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// EventBreakpoints + /// + /// DevToolsClient + public EventBreakpointsClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateSetInstrumentationBreakpoint(string eventName); + /// + /// Sets breakpoint on particular native event. + /// + /// Instrumentation name to stop on. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInstrumentationBreakpointAsync(string eventName) + { + ValidateSetInstrumentationBreakpoint(eventName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventName", eventName); + return _client.ExecuteDevToolsMethodAsync("EventBreakpoints.setInstrumentationBreakpoint", dict); + } + + partial void ValidateRemoveInstrumentationBreakpoint(string eventName); + /// + /// Removes breakpoint on particular native event. + /// + /// Instrumentation name to stop on. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveInstrumentationBreakpointAsync(string eventName) + { + ValidateRemoveInstrumentationBreakpoint(eventName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventName", eventName); + return _client.ExecuteDevToolsMethodAsync("EventBreakpoints.removeInstrumentationBreakpoint", dict); + } + + /// + /// Removes all breakpoints + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("EventBreakpoints.disable", dict); + } + } +} + +namespace CefSharp.DevTools.Extensions +{ + /// + /// LoadUnpackedResponse + /// + [DataContract] + public class LoadUnpackedResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string id + { + get; + set; + } + + /// + /// id + /// + public string Id + { + get + { + return id; + } + } + } +} + +namespace CefSharp.DevTools.Extensions +{ + /// + /// GetStorageItemsResponse + /// + [DataContract] + public class GetStorageItemsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal object data + { + get; + set; + } + + /// + /// data + /// + public object Data + { + get + { + return data; + } + } + } +} + +namespace CefSharp.DevTools.Extensions +{ + using System.Linq; + + /// + /// Defines commands and events for browser extensions. + /// + public partial class ExtensionsClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Extensions + /// + /// DevToolsClient + public ExtensionsClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateTriggerAction(string id, string targetId); + /// + /// Runs an extension default action. + /// Available if the client is connected using the --remote-debugging-pipe + /// flag and the --enable-unsafe-extension-debugging flag is set. + /// + /// Extension id. + /// A tab target ID to trigger the default extension action on. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TriggerActionAsync(string id, string targetId) + { + ValidateTriggerAction(id, targetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("targetId", targetId); + return _client.ExecuteDevToolsMethodAsync("Extensions.triggerAction", dict); + } + + partial void ValidateLoadUnpacked(string path, bool? enableInIncognito = null); + /// + /// Installs an unpacked extension from the filesystem similar to + /// --load-extension CLI flags. Returns extension ID once the extension + /// has been installed. Available if the client is connected using the + /// --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging + /// flag is set. + /// + /// Absolute file path. + /// Enable the extension in incognito + /// returns System.Threading.Tasks.Task<LoadUnpackedResponse> + public System.Threading.Tasks.Task LoadUnpackedAsync(string path, bool? enableInIncognito = null) + { + ValidateLoadUnpacked(path, enableInIncognito); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("path", path); + if (enableInIncognito.HasValue) + { + dict.Add("enableInIncognito", enableInIncognito.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Extensions.loadUnpacked", dict); + } + + partial void ValidateUninstall(string id); + /// + /// Uninstalls an unpacked extension (others not supported) from the profile. + /// Available if the client is connected using the --remote-debugging-pipe flag + /// and the --enable-unsafe-extension-debugging. + /// + /// Extension id. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UninstallAsync(string id) + { + ValidateUninstall(id); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + return _client.ExecuteDevToolsMethodAsync("Extensions.uninstall", dict); + } + + partial void ValidateGetStorageItems(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, string[] keys = null); + /// + /// Gets data from extension storage in the given `storageArea`. If `keys` is + /// specified, these are used to filter the result. + /// + /// ID of extension. + /// StorageArea to retrieve data from. + /// Keys to retrieve. + /// returns System.Threading.Tasks.Task<GetStorageItemsResponse> + public System.Threading.Tasks.Task GetStorageItemsAsync(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, string[] keys = null) + { + ValidateGetStorageItems(id, storageArea, keys); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("storageArea", EnumToString(storageArea)); + if ((keys) != (null)) + { + dict.Add("keys", keys); + } + + return _client.ExecuteDevToolsMethodAsync("Extensions.getStorageItems", dict); + } + + partial void ValidateRemoveStorageItems(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, string[] keys); + /// + /// Removes `keys` from extension storage in the given `storageArea`. + /// + /// ID of extension. + /// StorageArea to remove data from. + /// Keys to remove. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveStorageItemsAsync(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, string[] keys) + { + ValidateRemoveStorageItems(id, storageArea, keys); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("storageArea", EnumToString(storageArea)); + dict.Add("keys", keys); + return _client.ExecuteDevToolsMethodAsync("Extensions.removeStorageItems", dict); + } + + partial void ValidateClearStorageItems(string id, CefSharp.DevTools.Extensions.StorageArea storageArea); + /// + /// Clears extension storage in the given `storageArea`. + /// + /// ID of extension. + /// StorageArea to remove data from. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearStorageItemsAsync(string id, CefSharp.DevTools.Extensions.StorageArea storageArea) + { + ValidateClearStorageItems(id, storageArea); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("storageArea", EnumToString(storageArea)); + return _client.ExecuteDevToolsMethodAsync("Extensions.clearStorageItems", dict); + } + + partial void ValidateSetStorageItems(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, object values); + /// + /// Sets `values` in extension storage in the given `storageArea`. The provided `values` + /// will be merged with existing values in the storage area. + /// + /// ID of extension. + /// StorageArea to set data in. + /// Values to set. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetStorageItemsAsync(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, object values) + { + ValidateSetStorageItems(id, storageArea, values); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("storageArea", EnumToString(storageArea)); + dict.Add("values", values); + return _client.ExecuteDevToolsMethodAsync("Extensions.setStorageItems", dict); + } + } +} + +namespace CefSharp.DevTools.FedCm +{ + using System.Linq; + + /// + /// This domain allows interacting with the FedCM dialog. + /// + public partial class FedCmClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// FedCm + /// + /// DevToolsClient + public FedCmClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// DialogShown + /// + public event System.EventHandler DialogShown + { + add + { + _client.AddEventHandler("FedCm.dialogShown", value); + } + + remove + { + _client.RemoveEventHandler("FedCm.dialogShown", value); + } + } + + /// + /// Triggered when a dialog is closed, either by user action, JS abort, + /// or a command below. + /// + public event System.EventHandler DialogClosed + { + add + { + _client.AddEventHandler("FedCm.dialogClosed", value); + } + + remove + { + _client.RemoveEventHandler("FedCm.dialogClosed", value); + } + } + + partial void ValidateEnable(bool? disableRejectionDelay = null); + /// + /// Enable + /// + /// Allows callers to disable the promise rejection delay that wouldnormally happen, if this is unimportant to what's being tested.(step 4 of https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in) + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(bool? disableRejectionDelay = null) + { + ValidateEnable(disableRejectionDelay); + var dict = new System.Collections.Generic.Dictionary(); + if (disableRejectionDelay.HasValue) + { + dict.Add("disableRejectionDelay", disableRejectionDelay.Value); + } + + return _client.ExecuteDevToolsMethodAsync("FedCm.enable", dict); + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("FedCm.disable", dict); + } + + partial void ValidateSelectAccount(string dialogId, int accountIndex); + /// + /// SelectAccount + /// + /// dialogId + /// accountIndex + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SelectAccountAsync(string dialogId, int accountIndex) + { + ValidateSelectAccount(dialogId, accountIndex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("dialogId", dialogId); + dict.Add("accountIndex", accountIndex); + return _client.ExecuteDevToolsMethodAsync("FedCm.selectAccount", dict); + } + + partial void ValidateClickDialogButton(string dialogId, CefSharp.DevTools.FedCm.DialogButton dialogButton); + /// + /// ClickDialogButton + /// + /// dialogId + /// dialogButton + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClickDialogButtonAsync(string dialogId, CefSharp.DevTools.FedCm.DialogButton dialogButton) + { + ValidateClickDialogButton(dialogId, dialogButton); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("dialogId", dialogId); + dict.Add("dialogButton", EnumToString(dialogButton)); + return _client.ExecuteDevToolsMethodAsync("FedCm.clickDialogButton", dict); + } + + partial void ValidateOpenUrl(string dialogId, int accountIndex, CefSharp.DevTools.FedCm.AccountUrlType accountUrlType); + /// + /// OpenUrl + /// + /// dialogId + /// accountIndex + /// accountUrlType + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task OpenUrlAsync(string dialogId, int accountIndex, CefSharp.DevTools.FedCm.AccountUrlType accountUrlType) + { + ValidateOpenUrl(dialogId, accountIndex, accountUrlType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("dialogId", dialogId); + dict.Add("accountIndex", accountIndex); + dict.Add("accountUrlType", EnumToString(accountUrlType)); + return _client.ExecuteDevToolsMethodAsync("FedCm.openUrl", dict); + } + + partial void ValidateDismissDialog(string dialogId, bool? triggerCooldown = null); + /// + /// DismissDialog + /// + /// dialogId + /// triggerCooldown + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DismissDialogAsync(string dialogId, bool? triggerCooldown = null) + { + ValidateDismissDialog(dialogId, triggerCooldown); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("dialogId", dialogId); + if (triggerCooldown.HasValue) + { + dict.Add("triggerCooldown", triggerCooldown.Value); + } + + return _client.ExecuteDevToolsMethodAsync("FedCm.dismissDialog", dict); + } + + /// + /// Resets the cooldown time, if any, to allow the next FedCM call to show + /// a dialog even if one was recently dismissed by the user. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetCooldownAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("FedCm.resetCooldown", dict); + } + } +} + +namespace CefSharp.DevTools.Fetch +{ + /// + /// GetResponseBodyResponse + /// + [DataContract] + public class GetResponseBodyResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string body + { + get; + set; + } + + /// + /// body + /// + public string Body + { + get + { + return body; + } + } + + [DataMember] + internal bool base64Encoded + { + get; + set; + } + + /// + /// base64Encoded + /// + public bool Base64Encoded + { + get + { + return base64Encoded; + } + } + } +} + +namespace CefSharp.DevTools.Fetch +{ + /// + /// TakeResponseBodyAsStreamResponse + /// + [DataContract] + public class TakeResponseBodyAsStreamResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string stream + { + get; + set; + } + + /// + /// stream + /// + public string Stream + { + get + { + return stream; + } + } + } +} + +namespace CefSharp.DevTools.Fetch +{ + using System.Linq; + + /// + /// A domain for letting clients substitute browser's network layer with client code. + /// + public partial class FetchClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Fetch + /// + /// DevToolsClient + public FetchClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Issued when the domain is enabled and the request URL matches the + /// specified filter. The request is paused until the client responds + /// with one of continueRequest, failRequest or fulfillRequest. + /// The stage of the request can be determined by presence of responseErrorReason + /// and responseStatusCode -- the request is at the response stage if either + /// of these fields is present and in the request stage otherwise. + /// Redirect responses and subsequent requests are reported similarly to regular + /// responses and requests. Redirect responses may be distinguished by the value + /// of `responseStatusCode` (which is one of 301, 302, 303, 307, 308) along with + /// presence of the `location` header. Requests resulting from a redirect will + /// have `redirectedRequestId` field set. + /// + public event System.EventHandler RequestPaused + { + add + { + _client.AddEventHandler("Fetch.requestPaused", value); + } + + remove + { + _client.RemoveEventHandler("Fetch.requestPaused", value); + } + } + + /// + /// Issued when the domain is enabled with handleAuthRequests set to true. + /// The request is paused until client responds with continueWithAuth. + /// + public event System.EventHandler AuthRequired + { + add + { + _client.AddEventHandler("Fetch.authRequired", value); + } + + remove + { + _client.RemoveEventHandler("Fetch.authRequired", value); + } + } + + /// + /// Disables the fetch domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Fetch.disable", dict); + } + + partial void ValidateEnable(System.Collections.Generic.IList patterns = null, bool? handleAuthRequests = null); + /// + /// Enables issuing of requestPaused events. A request will be paused until client + /// calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth. + /// + /// If specified, only requests matching any of these patterns will producefetchRequested event and will be paused until clients response. If not set,all requests will be affected. + /// If true, authRequired events will be issued and requests will be pausedexpecting a call to continueWithAuth. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(System.Collections.Generic.IList patterns = null, bool? handleAuthRequests = null) + { + ValidateEnable(patterns, handleAuthRequests); + var dict = new System.Collections.Generic.Dictionary(); + if ((patterns) != (null)) + { + dict.Add("patterns", patterns.Select(x => x.ToDictionary())); + } + + if (handleAuthRequests.HasValue) + { + dict.Add("handleAuthRequests", handleAuthRequests.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Fetch.enable", dict); + } + + partial void ValidateFailRequest(string requestId, CefSharp.DevTools.Network.ErrorReason errorReason); + /// + /// Causes the request to fail with specified reason. + /// + /// An id the client received in requestPaused event. + /// Causes the request to fail with the given reason. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task FailRequestAsync(string requestId, CefSharp.DevTools.Network.ErrorReason errorReason) + { + ValidateFailRequest(requestId, errorReason); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("errorReason", EnumToString(errorReason)); + return _client.ExecuteDevToolsMethodAsync("Fetch.failRequest", dict); + } + + partial void ValidateFulfillRequest(string requestId, int responseCode, System.Collections.Generic.IList responseHeaders = null, byte[] binaryResponseHeaders = null, byte[] body = null, string responsePhrase = null); + /// + /// Provides response to the request. + /// + /// An id the client received in requestPaused event. + /// An HTTP response code. + /// Response headers. + /// Alternative way of specifying response headers as a \0-separatedseries of name: value pairs. Prefer the above method unless youneed to represent some non-UTF8 values that can't be transmittedover the protocol as text. + /// A response body. If absent, original response body will be used ifthe request is intercepted at the response stage and empty bodywill be used if the request is intercepted at the request stage. + /// A textual representation of responseCode.If absent, a standard phrase matching responseCode is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task FulfillRequestAsync(string requestId, int responseCode, System.Collections.Generic.IList responseHeaders = null, byte[] binaryResponseHeaders = null, byte[] body = null, string responsePhrase = null) + { + ValidateFulfillRequest(requestId, responseCode, responseHeaders, binaryResponseHeaders, body, responsePhrase); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("responseCode", responseCode); + if ((responseHeaders) != (null)) + { + dict.Add("responseHeaders", responseHeaders.Select(x => x.ToDictionary())); + } + + if ((binaryResponseHeaders) != (null)) + { + dict.Add("binaryResponseHeaders", ToBase64String(binaryResponseHeaders)); + } + + if ((body) != (null)) + { + dict.Add("body", ToBase64String(body)); + } + + if (!(string.IsNullOrEmpty(responsePhrase))) + { + dict.Add("responsePhrase", responsePhrase); + } + + return _client.ExecuteDevToolsMethodAsync("Fetch.fulfillRequest", dict); + } + + partial void ValidateContinueRequest(string requestId, string url = null, string method = null, byte[] postData = null, System.Collections.Generic.IList headers = null, bool? interceptResponse = null); + /// + /// Continues the request, optionally modifying some of its parameters. + /// + /// An id the client received in requestPaused event. + /// If set, the request url will be modified in a way that's not observable by page. + /// If set, the request method is overridden. + /// If set, overrides the post data in the request. + /// If set, overrides the request headers. Note that the overrides do notextend to subsequent redirect hops, if a redirect happens. Another overridemay be applied to a different request produced by a redirect. + /// If set, overrides response interception behavior for this request. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ContinueRequestAsync(string requestId, string url = null, string method = null, byte[] postData = null, System.Collections.Generic.IList headers = null, bool? interceptResponse = null) + { + ValidateContinueRequest(requestId, url, method, postData, headers, interceptResponse); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + if (!(string.IsNullOrEmpty(method))) + { + dict.Add("method", method); + } + + if ((postData) != (null)) + { + dict.Add("postData", ToBase64String(postData)); + } + + if ((headers) != (null)) + { + dict.Add("headers", headers.Select(x => x.ToDictionary())); + } + + if (interceptResponse.HasValue) + { + dict.Add("interceptResponse", interceptResponse.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Fetch.continueRequest", dict); + } + + partial void ValidateContinueWithAuth(string requestId, CefSharp.DevTools.Fetch.AuthChallengeResponse authChallengeResponse); + /// + /// Continues a request supplying authChallengeResponse following authRequired event. + /// + /// An id the client received in authRequired event. + /// Response to with an authChallenge. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ContinueWithAuthAsync(string requestId, CefSharp.DevTools.Fetch.AuthChallengeResponse authChallengeResponse) + { + ValidateContinueWithAuth(requestId, authChallengeResponse); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("authChallengeResponse", authChallengeResponse.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Fetch.continueWithAuth", dict); + } + + partial void ValidateContinueResponse(string requestId, int? responseCode = null, string responsePhrase = null, System.Collections.Generic.IList responseHeaders = null, byte[] binaryResponseHeaders = null); + /// + /// Continues loading of the paused response, optionally modifying the + /// response headers. If either responseCode or headers are modified, all of them + /// must be present. + /// + /// An id the client received in requestPaused event. + /// An HTTP response code. If absent, original response code will be used. + /// A textual representation of responseCode.If absent, a standard phrase matching responseCode is used. + /// Response headers. If absent, original response headers will be used. + /// Alternative way of specifying response headers as a \0-separatedseries of name: value pairs. Prefer the above method unless youneed to represent some non-UTF8 values that can't be transmittedover the protocol as text. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ContinueResponseAsync(string requestId, int? responseCode = null, string responsePhrase = null, System.Collections.Generic.IList responseHeaders = null, byte[] binaryResponseHeaders = null) + { + ValidateContinueResponse(requestId, responseCode, responsePhrase, responseHeaders, binaryResponseHeaders); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + if (responseCode.HasValue) + { + dict.Add("responseCode", responseCode.Value); + } + + if (!(string.IsNullOrEmpty(responsePhrase))) + { + dict.Add("responsePhrase", responsePhrase); + } + + if ((responseHeaders) != (null)) + { + dict.Add("responseHeaders", responseHeaders.Select(x => x.ToDictionary())); + } + + if ((binaryResponseHeaders) != (null)) + { + dict.Add("binaryResponseHeaders", ToBase64String(binaryResponseHeaders)); + } + + return _client.ExecuteDevToolsMethodAsync("Fetch.continueResponse", dict); + } + + partial void ValidateGetResponseBody(string requestId); + /// + /// Causes the body of the response to be received from the server and + /// returned as a single string. May only be issued for a request that + /// is paused in the Response stage and is mutually exclusive with + /// takeResponseBodyForInterceptionAsStream. Calling other methods that + /// affect the request or disabling fetch domain before body is received + /// results in an undefined behavior. + /// Note that the response body is not available for redirects. Requests + /// paused in the _redirect received_ state may be differentiated by + /// `responseCode` and presence of `location` response header, see + /// comments to `requestPaused` for details. + /// + /// Identifier for the intercepted request to get body for. + /// returns System.Threading.Tasks.Task<GetResponseBodyResponse> + public System.Threading.Tasks.Task GetResponseBodyAsync(string requestId) + { + ValidateGetResponseBody(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Fetch.getResponseBody", dict); + } + + partial void ValidateTakeResponseBodyAsStream(string requestId); + /// + /// Returns a handle to the stream representing the response body. + /// The request must be paused in the HeadersReceived stage. + /// Note that after this command the request can't be continued + /// as is -- client either needs to cancel it or to provide the + /// response body. + /// The stream only supports sequential read, IO.read will fail if the position + /// is specified. + /// This method is mutually exclusive with getResponseBody. + /// Calling other methods that affect the request or disabling fetch + /// domain before body is received results in an undefined behavior. + /// + /// requestId + /// returns System.Threading.Tasks.Task<TakeResponseBodyAsStreamResponse> + public System.Threading.Tasks.Task TakeResponseBodyAsStreamAsync(string requestId) + { + ValidateTakeResponseBodyAsStream(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Fetch.takeResponseBodyAsStream", dict); + } + } +} + +namespace CefSharp.DevTools.FileSystem +{ + /// + /// GetDirectoryResponse + /// + [DataContract] + public class GetDirectoryResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.FileSystem.Directory directory + { + get; + set; + } + + /// + /// directory + /// + public CefSharp.DevTools.FileSystem.Directory Directory + { + get + { + return directory; + } + } + } +} + +namespace CefSharp.DevTools.FileSystem +{ + using System.Linq; + + /// + /// FileSystem + /// + public partial class FileSystemClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// FileSystem + /// + /// DevToolsClient + public FileSystemClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateGetDirectory(CefSharp.DevTools.FileSystem.BucketFileSystemLocator bucketFileSystemLocator); + /// + /// GetDirectory + /// + /// bucketFileSystemLocator + /// returns System.Threading.Tasks.Task<GetDirectoryResponse> + public System.Threading.Tasks.Task GetDirectoryAsync(CefSharp.DevTools.FileSystem.BucketFileSystemLocator bucketFileSystemLocator) + { + ValidateGetDirectory(bucketFileSystemLocator); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("bucketFileSystemLocator", bucketFileSystemLocator.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("FileSystem.getDirectory", dict); + } + } +} + +namespace CefSharp.DevTools.HeadlessExperimental +{ + /// + /// BeginFrameResponse + /// + [DataContract] + public class BeginFrameResponse : DevToolsDomainResponseBase + { + [DataMember] + internal bool hasDamage + { + get; + set; + } + + /// + /// hasDamage + /// + public bool HasDamage + { + get + { + return hasDamage; + } + } + + [DataMember] + internal string screenshotData + { + get; + set; + } + + /// + /// screenshotData + /// + public byte[] ScreenshotData + { + get + { + return Convert(screenshotData); + } + } + } +} + +namespace CefSharp.DevTools.HeadlessExperimental +{ + using System.Linq; + + /// + /// This domain provides experimental commands only supported in headless mode. + /// + public partial class HeadlessExperimentalClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// HeadlessExperimental + /// + /// DevToolsClient + public HeadlessExperimentalClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateBeginFrame(double? frameTimeTicks = null, double? interval = null, bool? noDisplayUpdates = null, CefSharp.DevTools.HeadlessExperimental.ScreenshotParams screenshot = null); + /// + /// Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a + /// screenshot from the resulting frame. Requires that the target was created with enabled + /// BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also + /// https://goo.gle/chrome-headless-rendering for more background. + /// + /// Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set,the current time will be used. + /// The interval between BeginFrames that is reported to the compositor, in milliseconds.Defaults to a 60 frames/second interval, i.e. about 16.666 milliseconds. + /// Whether updates should not be committed and drawn onto the display. False by default. Iftrue, only side effects of the BeginFrame will be run, such as layout and animations, butany visual updates may not be visible on the display or in screenshots. + /// If set, a screenshot of the frame will be captured and returned in the response. Otherwise,no screenshot will be captured. Note that capturing a screenshot can fail, for example,during renderer initialization. In such a case, no screenshot data will be returned. + /// returns System.Threading.Tasks.Task<BeginFrameResponse> + public System.Threading.Tasks.Task BeginFrameAsync(double? frameTimeTicks = null, double? interval = null, bool? noDisplayUpdates = null, CefSharp.DevTools.HeadlessExperimental.ScreenshotParams screenshot = null) + { + ValidateBeginFrame(frameTimeTicks, interval, noDisplayUpdates, screenshot); + var dict = new System.Collections.Generic.Dictionary(); + if (frameTimeTicks.HasValue) + { + dict.Add("frameTimeTicks", frameTimeTicks.Value); + } + + if (interval.HasValue) + { + dict.Add("interval", interval.Value); + } + + if (noDisplayUpdates.HasValue) + { + dict.Add("noDisplayUpdates", noDisplayUpdates.Value); + } + + if ((screenshot) != (null)) + { + dict.Add("screenshot", screenshot.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("HeadlessExperimental.beginFrame", dict); + } + } +} + +namespace CefSharp.DevTools.IO +{ + /// + /// ReadResponse + /// + [DataContract] + public class ReadResponse : DevToolsDomainResponseBase + { + [DataMember] + internal bool? base64Encoded + { + get; + set; + } + + /// + /// base64Encoded + /// + public bool? Base64Encoded + { + get + { + return base64Encoded; + } + } + + [DataMember] + internal string data + { + get; + set; + } + + /// + /// data + /// + public string Data + { + get + { + return data; + } + } + + [DataMember] + internal bool eof + { + get; + set; + } + + /// + /// eof + /// + public bool Eof + { + get + { + return eof; + } + } + } +} + +namespace CefSharp.DevTools.IO +{ + /// + /// ResolveBlobResponse + /// + [DataContract] + public class ResolveBlobResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string uuid + { + get; + set; + } + + /// + /// uuid + /// + public string Uuid + { + get + { + return uuid; + } + } + } +} + +namespace CefSharp.DevTools.IO +{ + using System.Linq; + + /// + /// Input/Output operations for streams produced by DevTools. + /// + public partial class IOClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// IO + /// + /// DevToolsClient + public IOClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateClose(string handle); + /// + /// Close the stream, discard any temporary backing storage. + /// + /// Handle of the stream to close. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CloseAsync(string handle) + { + ValidateClose(handle); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("handle", handle); + return _client.ExecuteDevToolsMethodAsync("IO.close", dict); + } + + partial void ValidateRead(string handle, int? offset = null, int? size = null); + /// + /// Read a chunk of the stream + /// + /// Handle of the stream to read. + /// Seek to the specified offset before reading (if not specified, proceed with offsetfollowing the last read). Some types of streams may only support sequential reads. + /// Maximum number of bytes to read (left upon the agent discretion if not specified). + /// returns System.Threading.Tasks.Task<ReadResponse> + public System.Threading.Tasks.Task ReadAsync(string handle, int? offset = null, int? size = null) + { + ValidateRead(handle, offset, size); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("handle", handle); + if (offset.HasValue) + { + dict.Add("offset", offset.Value); + } + + if (size.HasValue) + { + dict.Add("size", size.Value); + } + + return _client.ExecuteDevToolsMethodAsync("IO.read", dict); + } + + partial void ValidateResolveBlob(string objectId); + /// + /// Return UUID of Blob object specified by a remote object id. + /// + /// Object id of a Blob object wrapper. + /// returns System.Threading.Tasks.Task<ResolveBlobResponse> + public System.Threading.Tasks.Task ResolveBlobAsync(string objectId) + { + ValidateResolveBlob(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("IO.resolveBlob", dict); + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// RequestDataResponse + /// + [DataContract] + public class RequestDataResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList objectStoreDataEntries + { + get; + set; + } + + /// + /// objectStoreDataEntries + /// + public System.Collections.Generic.IList ObjectStoreDataEntries + { + get + { + return objectStoreDataEntries; + } + } + + [DataMember] + internal bool hasMore + { + get; + set; + } + + /// + /// hasMore + /// + public bool HasMore + { + get + { + return hasMore; + } + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// GetMetadataResponse + /// + [DataContract] + public class GetMetadataResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double entriesCount + { + get; + set; + } + + /// + /// entriesCount + /// + public double EntriesCount + { + get + { + return entriesCount; + } + } + + [DataMember] + internal double keyGeneratorValue + { + get; + set; + } + + /// + /// keyGeneratorValue + /// + public double KeyGeneratorValue + { + get + { + return keyGeneratorValue; + } + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// RequestDatabaseResponse + /// + [DataContract] + public class RequestDatabaseResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.IndexedDB.DatabaseWithObjectStores databaseWithObjectStores + { + get; + set; + } + + /// + /// databaseWithObjectStores + /// + public CefSharp.DevTools.IndexedDB.DatabaseWithObjectStores DatabaseWithObjectStores + { + get + { + return databaseWithObjectStores; + } + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// RequestDatabaseNamesResponse + /// + [DataContract] + public class RequestDatabaseNamesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] databaseNames + { + get; + set; + } + + /// + /// databaseNames + /// + public string[] DatabaseNames + { + get + { + return databaseNames; + } + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + using System.Linq; + + /// + /// IndexedDB + /// + public partial class IndexedDBClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// IndexedDB + /// + /// DevToolsClient + public IndexedDBClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateClearObjectStore(string databaseName, string objectStoreName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Clears all entries from an object store. + /// + /// Database name. + /// Object store name. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearObjectStoreAsync(string databaseName, string objectStoreName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateClearObjectStore(databaseName, objectStoreName, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + dict.Add("objectStoreName", objectStoreName); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.clearObjectStore", dict); + } + + partial void ValidateDeleteDatabase(string databaseName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Deletes a database. + /// + /// Database name. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteDatabaseAsync(string databaseName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateDeleteDatabase(databaseName, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.deleteDatabase", dict); + } + + partial void ValidateDeleteObjectStoreEntries(string databaseName, string objectStoreName, CefSharp.DevTools.IndexedDB.KeyRange keyRange, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Delete a range of entries from an object store + /// + /// databaseName + /// objectStoreName + /// Range of entry keys to delete + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteObjectStoreEntriesAsync(string databaseName, string objectStoreName, CefSharp.DevTools.IndexedDB.KeyRange keyRange, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateDeleteObjectStoreEntries(databaseName, objectStoreName, keyRange, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + dict.Add("objectStoreName", objectStoreName); + dict.Add("keyRange", keyRange.ToDictionary()); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.deleteObjectStoreEntries", dict); + } + + /// + /// Disables events from backend. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("IndexedDB.disable", dict); + } + + /// + /// Enables events from backend. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("IndexedDB.enable", dict); + } + + partial void ValidateRequestData(string databaseName, string objectStoreName, int skipCount, int pageSize, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null, string indexName = null, CefSharp.DevTools.IndexedDB.KeyRange keyRange = null); + /// + /// Requests data from object store or index. + /// + /// Database name. + /// Object store name. + /// Number of records to skip. + /// Number of records to fetch. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// Index name. If not specified, it performs an object store data request. + /// Key range. + /// returns System.Threading.Tasks.Task<RequestDataResponse> + public System.Threading.Tasks.Task RequestDataAsync(string databaseName, string objectStoreName, int skipCount, int pageSize, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null, string indexName = null, CefSharp.DevTools.IndexedDB.KeyRange keyRange = null) + { + ValidateRequestData(databaseName, objectStoreName, skipCount, pageSize, securityOrigin, storageKey, storageBucket, indexName, keyRange); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + dict.Add("objectStoreName", objectStoreName); + dict.Add("skipCount", skipCount); + dict.Add("pageSize", pageSize); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + if (!(string.IsNullOrEmpty(indexName))) + { + dict.Add("indexName", indexName); + } + + if ((keyRange) != (null)) + { + dict.Add("keyRange", keyRange.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.requestData", dict); + } + + partial void ValidateGetMetadata(string databaseName, string objectStoreName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Gets metadata of an object store. + /// + /// Database name. + /// Object store name. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<GetMetadataResponse> + public System.Threading.Tasks.Task GetMetadataAsync(string databaseName, string objectStoreName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateGetMetadata(databaseName, objectStoreName, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + dict.Add("objectStoreName", objectStoreName); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.getMetadata", dict); + } + + partial void ValidateRequestDatabase(string databaseName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Requests database with given name in given frame. + /// + /// Database name. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<RequestDatabaseResponse> + public System.Threading.Tasks.Task RequestDatabaseAsync(string databaseName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateRequestDatabase(databaseName, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.requestDatabase", dict); + } + + partial void ValidateRequestDatabaseNames(string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Requests database names for given security origin. + /// + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<RequestDatabaseNamesResponse> + public System.Threading.Tasks.Task RequestDatabaseNamesAsync(string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateRequestDatabaseNames(securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.requestDatabaseNames", dict); + } + } +} + +namespace CefSharp.DevTools.Input +{ + using System.Linq; + + /// + /// Type of the drag event. + /// + public enum DispatchDragEventType + { + /// + /// dragEnter + /// + [EnumMember(Value = ("dragEnter"))] + DragEnter, + /// + /// dragOver + /// + [EnumMember(Value = ("dragOver"))] + DragOver, + /// + /// drop + /// + [EnumMember(Value = ("drop"))] + Drop, + /// + /// dragCancel + /// + [EnumMember(Value = ("dragCancel"))] + DragCancel + } + + /// + /// Type of the key event. + /// + public enum DispatchKeyEventType + { + /// + /// keyDown + /// + [EnumMember(Value = ("keyDown"))] + KeyDown, + /// + /// keyUp + /// + [EnumMember(Value = ("keyUp"))] + KeyUp, + /// + /// rawKeyDown + /// + [EnumMember(Value = ("rawKeyDown"))] + RawKeyDown, + /// + /// char + /// + [EnumMember(Value = ("char"))] + Char + } + + /// + /// Type of the mouse event. + /// + public enum DispatchMouseEventType + { + /// + /// mousePressed + /// + [EnumMember(Value = ("mousePressed"))] + MousePressed, + /// + /// mouseReleased + /// + [EnumMember(Value = ("mouseReleased"))] + MouseReleased, + /// + /// mouseMoved + /// + [EnumMember(Value = ("mouseMoved"))] + MouseMoved, + /// + /// mouseWheel + /// + [EnumMember(Value = ("mouseWheel"))] + MouseWheel + } + + /// + /// Pointer type (default: "mouse"). + /// + public enum DispatchMouseEventPointerType + { + /// + /// mouse + /// + [EnumMember(Value = ("mouse"))] + Mouse, + /// + /// pen + /// + [EnumMember(Value = ("pen"))] + Pen + } + + /// + /// Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while + /// TouchStart and TouchMove must contains at least one. + /// + public enum DispatchTouchEventType + { + /// + /// touchStart + /// + [EnumMember(Value = ("touchStart"))] + TouchStart, + /// + /// touchEnd + /// + [EnumMember(Value = ("touchEnd"))] + TouchEnd, + /// + /// touchMove + /// + [EnumMember(Value = ("touchMove"))] + TouchMove, + /// + /// touchCancel + /// + [EnumMember(Value = ("touchCancel"))] + TouchCancel + } + + /// + /// Type of the mouse event. + /// + public enum EmulateTouchFromMouseEventType + { + /// + /// mousePressed + /// + [EnumMember(Value = ("mousePressed"))] + MousePressed, + /// + /// mouseReleased + /// + [EnumMember(Value = ("mouseReleased"))] + MouseReleased, + /// + /// mouseMoved + /// + [EnumMember(Value = ("mouseMoved"))] + MouseMoved, + /// + /// mouseWheel + /// + [EnumMember(Value = ("mouseWheel"))] + MouseWheel + } + + /// + /// Input + /// + public partial class InputClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Input + /// + /// DevToolsClient + public InputClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to + /// restore normal drag and drop behavior. + /// + public event System.EventHandler DragIntercepted + { + add + { + _client.AddEventHandler("Input.dragIntercepted", value); + } + + remove + { + _client.RemoveEventHandler("Input.dragIntercepted", value); + } + } + + partial void ValidateDispatchDragEvent(CefSharp.DevTools.Input.DispatchDragEventType type, double x, double y, CefSharp.DevTools.Input.DragData data, int? modifiers = null); + /// + /// Dispatches a drag event into the page. + /// + /// Type of the drag event. + /// X coordinate of the event relative to the main frame's viewport in CSS pixels. + /// Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers tothe top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + /// data + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchDragEventAsync(CefSharp.DevTools.Input.DispatchDragEventType type, double x, double y, CefSharp.DevTools.Input.DragData data, int? modifiers = null) + { + ValidateDispatchDragEvent(type, x, y, data, modifiers); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("x", x); + dict.Add("y", y); + dict.Add("data", data.ToDictionary()); + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Input.dispatchDragEvent", dict); + } + + partial void ValidateDispatchKeyEvent(CefSharp.DevTools.Input.DispatchKeyEventType type, int? modifiers = null, double? timestamp = null, string text = null, string unmodifiedText = null, string keyIdentifier = null, string code = null, string key = null, int? windowsVirtualKeyCode = null, int? nativeVirtualKeyCode = null, bool? autoRepeat = null, bool? isKeypad = null, bool? isSystemKey = null, int? location = null, string[] commands = null); + /// + /// Dispatches a key event to the page. + /// + /// Type of the key event. + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// Time at which the event occurred. + /// Text as generated by processing a virtual key code with a keyboard layout. Not needed forfor `keyUp` and `rawKeyDown` events (default: "") + /// Text that would have been generated by the keyboard if no modifiers were pressed (except forshift). Useful for shortcut (accelerator) key handling (default: ""). + /// Unique key identifier (e.g., 'U+0041') (default: ""). + /// Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: ""). + /// Unique DOM defined string value describing the meaning of the key in the context of activemodifiers, keyboard layout, etc (e.g., 'AltGr') (default: ""). + /// Windows virtual key code (default: 0). + /// Native virtual key code (default: 0). + /// Whether the event was generated from auto repeat (default: false). + /// Whether the event was generated from the keypad (default: false). + /// Whether the event was a system key event (default: false). + /// Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default:0). + /// Editing commands to send with the key event (e.g., 'selectAll') (default: []).These are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding.See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchKeyEventAsync(CefSharp.DevTools.Input.DispatchKeyEventType type, int? modifiers = null, double? timestamp = null, string text = null, string unmodifiedText = null, string keyIdentifier = null, string code = null, string key = null, int? windowsVirtualKeyCode = null, int? nativeVirtualKeyCode = null, bool? autoRepeat = null, bool? isKeypad = null, bool? isSystemKey = null, int? location = null, string[] commands = null) + { + ValidateDispatchKeyEvent(type, modifiers, timestamp, text, unmodifiedText, keyIdentifier, code, key, windowsVirtualKeyCode, nativeVirtualKeyCode, autoRepeat, isKeypad, isSystemKey, location, commands); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + if (timestamp.HasValue) + { + dict.Add("timestamp", timestamp.Value); + } + + if (!(string.IsNullOrEmpty(text))) + { + dict.Add("text", text); + } + + if (!(string.IsNullOrEmpty(unmodifiedText))) + { + dict.Add("unmodifiedText", unmodifiedText); + } + + if (!(string.IsNullOrEmpty(keyIdentifier))) + { + dict.Add("keyIdentifier", keyIdentifier); + } + + if (!(string.IsNullOrEmpty(code))) + { + dict.Add("code", code); + } + + if (!(string.IsNullOrEmpty(key))) + { + dict.Add("key", key); + } + + if (windowsVirtualKeyCode.HasValue) + { + dict.Add("windowsVirtualKeyCode", windowsVirtualKeyCode.Value); + } + + if (nativeVirtualKeyCode.HasValue) + { + dict.Add("nativeVirtualKeyCode", nativeVirtualKeyCode.Value); + } + + if (autoRepeat.HasValue) + { + dict.Add("autoRepeat", autoRepeat.Value); + } + + if (isKeypad.HasValue) + { + dict.Add("isKeypad", isKeypad.Value); + } + + if (isSystemKey.HasValue) + { + dict.Add("isSystemKey", isSystemKey.Value); + } + + if (location.HasValue) + { + dict.Add("location", location.Value); + } + + if ((commands) != (null)) + { + dict.Add("commands", commands); + } + + return _client.ExecuteDevToolsMethodAsync("Input.dispatchKeyEvent", dict); + } + + partial void ValidateInsertText(string text); + /// + /// This method emulates inserting text that doesn't come from a key press, + /// for example an emoji keyboard or an IME. + /// + /// The text to insert. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task InsertTextAsync(string text) + { + ValidateInsertText(text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("Input.insertText", dict); + } + + partial void ValidateImeSetComposition(string text, int selectionStart, int selectionEnd, int? replacementStart = null, int? replacementEnd = null); + /// + /// This method sets the current candidate text for IME. + /// Use imeCommitComposition to commit the final text. + /// Use imeSetComposition with empty string as text to cancel composition. + /// + /// The text to insert + /// selection start + /// selection end + /// replacement start + /// replacement end + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ImeSetCompositionAsync(string text, int selectionStart, int selectionEnd, int? replacementStart = null, int? replacementEnd = null) + { + ValidateImeSetComposition(text, selectionStart, selectionEnd, replacementStart, replacementEnd); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("text", text); + dict.Add("selectionStart", selectionStart); + dict.Add("selectionEnd", selectionEnd); + if (replacementStart.HasValue) + { + dict.Add("replacementStart", replacementStart.Value); + } + + if (replacementEnd.HasValue) + { + dict.Add("replacementEnd", replacementEnd.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Input.imeSetComposition", dict); + } + + partial void ValidateDispatchMouseEvent(CefSharp.DevTools.Input.DispatchMouseEventType type, double x, double y, int? modifiers = null, double? timestamp = null, CefSharp.DevTools.Input.MouseButton? button = null, int? buttons = null, int? clickCount = null, double? force = null, double? tangentialPressure = null, double? tiltX = null, double? tiltY = null, int? twist = null, double? deltaX = null, double? deltaY = null, CefSharp.DevTools.Input.DispatchMouseEventPointerType? pointerType = null); + /// + /// Dispatches a mouse event to the page. + /// + /// Type of the mouse event. + /// X coordinate of the event relative to the main frame's viewport in CSS pixels. + /// Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers tothe top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// Time at which the event occurred. + /// Mouse button (default: "none"). + /// A number indicating which buttons are pressed on the mouse when a mouse event is triggered.Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0. + /// Number of times the mouse button was clicked (default: 0). + /// The normalized pressure, which has a range of [0,1] (default: 0). + /// The normalized tangential pressure, which has a range of [-1,1] (default: 0). + /// The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0). + /// The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0). + /// The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0). + /// X delta in CSS pixels for mouse wheel event (default: 0). + /// Y delta in CSS pixels for mouse wheel event (default: 0). + /// Pointer type (default: "mouse"). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchMouseEventAsync(CefSharp.DevTools.Input.DispatchMouseEventType type, double x, double y, int? modifiers = null, double? timestamp = null, CefSharp.DevTools.Input.MouseButton? button = null, int? buttons = null, int? clickCount = null, double? force = null, double? tangentialPressure = null, double? tiltX = null, double? tiltY = null, int? twist = null, double? deltaX = null, double? deltaY = null, CefSharp.DevTools.Input.DispatchMouseEventPointerType? pointerType = null) + { + ValidateDispatchMouseEvent(type, x, y, modifiers, timestamp, button, buttons, clickCount, force, tangentialPressure, tiltX, tiltY, twist, deltaX, deltaY, pointerType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("x", x); + dict.Add("y", y); + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + if (timestamp.HasValue) + { + dict.Add("timestamp", timestamp.Value); + } + + if (button.HasValue) + { + dict.Add("button", EnumToString(button)); + } + + if (buttons.HasValue) + { + dict.Add("buttons", buttons.Value); + } + + if (clickCount.HasValue) + { + dict.Add("clickCount", clickCount.Value); + } + + if (force.HasValue) + { + dict.Add("force", force.Value); + } + + if (tangentialPressure.HasValue) + { + dict.Add("tangentialPressure", tangentialPressure.Value); + } + + if (tiltX.HasValue) + { + dict.Add("tiltX", tiltX.Value); + } + + if (tiltY.HasValue) + { + dict.Add("tiltY", tiltY.Value); + } + + if (twist.HasValue) + { + dict.Add("twist", twist.Value); + } + + if (deltaX.HasValue) + { + dict.Add("deltaX", deltaX.Value); + } + + if (deltaY.HasValue) + { + dict.Add("deltaY", deltaY.Value); + } + + if (pointerType.HasValue) + { + dict.Add("pointerType", EnumToString(pointerType)); + } + + return _client.ExecuteDevToolsMethodAsync("Input.dispatchMouseEvent", dict); + } + + partial void ValidateDispatchTouchEvent(CefSharp.DevTools.Input.DispatchTouchEventType type, System.Collections.Generic.IList touchPoints, int? modifiers = null, double? timestamp = null); + /// + /// Dispatches a touch event to the page. + /// + /// Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, whileTouchStart and TouchMove must contains at least one. + /// Active touch points on the touch device. One event per any changed point (compared toprevious touch event in a sequence) is generated, emulating pressing/moving/releasing pointsone by one. + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// Time at which the event occurred. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchTouchEventAsync(CefSharp.DevTools.Input.DispatchTouchEventType type, System.Collections.Generic.IList touchPoints, int? modifiers = null, double? timestamp = null) + { + ValidateDispatchTouchEvent(type, touchPoints, modifiers, timestamp); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("touchPoints", touchPoints.Select(x => x.ToDictionary())); + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + if (timestamp.HasValue) + { + dict.Add("timestamp", timestamp.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Input.dispatchTouchEvent", dict); + } + + /// + /// Cancels any active dragging in the page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CancelDraggingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Input.cancelDragging", dict); + } + + partial void ValidateEmulateTouchFromMouseEvent(CefSharp.DevTools.Input.EmulateTouchFromMouseEventType type, int x, int y, CefSharp.DevTools.Input.MouseButton button, double? timestamp = null, double? deltaX = null, double? deltaY = null, int? modifiers = null, int? clickCount = null); + /// + /// Emulates touch event from the mouse event parameters. + /// + /// Type of the mouse event. + /// X coordinate of the mouse pointer in DIP. + /// Y coordinate of the mouse pointer in DIP. + /// Mouse button. Only "none", "left", "right" are supported. + /// Time at which the event occurred (default: current time). + /// X delta in DIP for mouse wheel event (default: 0). + /// Y delta in DIP for mouse wheel event (default: 0). + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// Number of times the mouse button was clicked (default: 0). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EmulateTouchFromMouseEventAsync(CefSharp.DevTools.Input.EmulateTouchFromMouseEventType type, int x, int y, CefSharp.DevTools.Input.MouseButton button, double? timestamp = null, double? deltaX = null, double? deltaY = null, int? modifiers = null, int? clickCount = null) + { + ValidateEmulateTouchFromMouseEvent(type, x, y, button, timestamp, deltaX, deltaY, modifiers, clickCount); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("x", x); + dict.Add("y", y); + dict.Add("button", EnumToString(button)); + if (timestamp.HasValue) + { + dict.Add("timestamp", timestamp.Value); + } + + if (deltaX.HasValue) + { + dict.Add("deltaX", deltaX.Value); + } + + if (deltaY.HasValue) + { + dict.Add("deltaY", deltaY.Value); + } + + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + if (clickCount.HasValue) + { + dict.Add("clickCount", clickCount.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Input.emulateTouchFromMouseEvent", dict); + } + + partial void ValidateSetIgnoreInputEvents(bool ignore); + /// + /// Ignores input events (useful while auditing page). + /// + /// Ignores input events processing when set to true. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetIgnoreInputEventsAsync(bool ignore) + { + ValidateSetIgnoreInputEvents(ignore); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ignore", ignore); + return _client.ExecuteDevToolsMethodAsync("Input.setIgnoreInputEvents", dict); + } + + partial void ValidateSetInterceptDrags(bool enabled); + /// + /// Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events. + /// Drag and drop behavior can be directly controlled via `Input.dispatchDragEvent`. + /// + /// enabled + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInterceptDragsAsync(bool enabled) + { + ValidateSetInterceptDrags(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Input.setInterceptDrags", dict); + } + + partial void ValidateSynthesizePinchGesture(double x, double y, double scaleFactor, int? relativeSpeed = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null); + /// + /// Synthesizes a pinch gesture over a time period by issuing appropriate touch events. + /// + /// X coordinate of the start of the gesture in CSS pixels. + /// Y coordinate of the start of the gesture in CSS pixels. + /// Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out). + /// Relative pointer speed in pixels per second (default: 800). + /// Which type of input events to be generated (default: 'default', which queries the platformfor the preferred input type). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SynthesizePinchGestureAsync(double x, double y, double scaleFactor, int? relativeSpeed = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null) + { + ValidateSynthesizePinchGesture(x, y, scaleFactor, relativeSpeed, gestureSourceType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + dict.Add("scaleFactor", scaleFactor); + if (relativeSpeed.HasValue) + { + dict.Add("relativeSpeed", relativeSpeed.Value); + } + + if (gestureSourceType.HasValue) + { + dict.Add("gestureSourceType", EnumToString(gestureSourceType)); + } + + return _client.ExecuteDevToolsMethodAsync("Input.synthesizePinchGesture", dict); + } + + partial void ValidateSynthesizeScrollGesture(double x, double y, double? xDistance = null, double? yDistance = null, double? xOverscroll = null, double? yOverscroll = null, bool? preventFling = null, int? speed = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null, int? repeatCount = null, int? repeatDelayMs = null, string interactionMarkerName = null); + /// + /// Synthesizes a scroll gesture over a time period by issuing appropriate touch events. + /// + /// X coordinate of the start of the gesture in CSS pixels. + /// Y coordinate of the start of the gesture in CSS pixels. + /// The distance to scroll along the X axis (positive to scroll left). + /// The distance to scroll along the Y axis (positive to scroll up). + /// The number of additional pixels to scroll back along the X axis, in addition to the givendistance. + /// The number of additional pixels to scroll back along the Y axis, in addition to the givendistance. + /// Prevent fling (default: true). + /// Swipe speed in pixels per second (default: 800). + /// Which type of input events to be generated (default: 'default', which queries the platformfor the preferred input type). + /// The number of times to repeat the gesture (default: 0). + /// The number of milliseconds delay between each repeat. (default: 250). + /// The name of the interaction markers to generate, if not empty (default: ""). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SynthesizeScrollGestureAsync(double x, double y, double? xDistance = null, double? yDistance = null, double? xOverscroll = null, double? yOverscroll = null, bool? preventFling = null, int? speed = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null, int? repeatCount = null, int? repeatDelayMs = null, string interactionMarkerName = null) + { + ValidateSynthesizeScrollGesture(x, y, xDistance, yDistance, xOverscroll, yOverscroll, preventFling, speed, gestureSourceType, repeatCount, repeatDelayMs, interactionMarkerName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + if (xDistance.HasValue) + { + dict.Add("xDistance", xDistance.Value); + } + + if (yDistance.HasValue) + { + dict.Add("yDistance", yDistance.Value); + } + + if (xOverscroll.HasValue) + { + dict.Add("xOverscroll", xOverscroll.Value); + } + + if (yOverscroll.HasValue) + { + dict.Add("yOverscroll", yOverscroll.Value); + } + + if (preventFling.HasValue) + { + dict.Add("preventFling", preventFling.Value); + } + + if (speed.HasValue) + { + dict.Add("speed", speed.Value); + } + + if (gestureSourceType.HasValue) + { + dict.Add("gestureSourceType", EnumToString(gestureSourceType)); + } + + if (repeatCount.HasValue) + { + dict.Add("repeatCount", repeatCount.Value); + } + + if (repeatDelayMs.HasValue) + { + dict.Add("repeatDelayMs", repeatDelayMs.Value); + } + + if (!(string.IsNullOrEmpty(interactionMarkerName))) + { + dict.Add("interactionMarkerName", interactionMarkerName); + } + + return _client.ExecuteDevToolsMethodAsync("Input.synthesizeScrollGesture", dict); + } + + partial void ValidateSynthesizeTapGesture(double x, double y, int? duration = null, int? tapCount = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null); + /// + /// Synthesizes a tap gesture over a time period by issuing appropriate touch events. + /// + /// X coordinate of the start of the gesture in CSS pixels. + /// Y coordinate of the start of the gesture in CSS pixels. + /// Duration between touchdown and touchup events in ms (default: 50). + /// Number of times to perform the tap (e.g. 2 for double tap, default: 1). + /// Which type of input events to be generated (default: 'default', which queries the platformfor the preferred input type). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SynthesizeTapGestureAsync(double x, double y, int? duration = null, int? tapCount = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null) + { + ValidateSynthesizeTapGesture(x, y, duration, tapCount, gestureSourceType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + if (duration.HasValue) + { + dict.Add("duration", duration.Value); + } + + if (tapCount.HasValue) + { + dict.Add("tapCount", tapCount.Value); + } + + if (gestureSourceType.HasValue) + { + dict.Add("gestureSourceType", EnumToString(gestureSourceType)); + } + + return _client.ExecuteDevToolsMethodAsync("Input.synthesizeTapGesture", dict); + } + } +} + +namespace CefSharp.DevTools.Inspector +{ + using System.Linq; + + /// + /// Inspector + /// + public partial class InspectorClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Inspector + /// + /// DevToolsClient + public InspectorClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when remote debugging connection is about to be terminated. Contains detach reason. + /// + public event System.EventHandler Detached + { + add + { + _client.AddEventHandler("Inspector.detached", value); + } + + remove + { + _client.RemoveEventHandler("Inspector.detached", value); + } + } + + /// + /// Fired when debugging target has crashed + /// + public event System.EventHandler TargetCrashed + { + add + { + _client.AddEventHandler("Inspector.targetCrashed", value); + } + + remove + { + _client.RemoveEventHandler("Inspector.targetCrashed", value); + } + } + + /// + /// Fired when debugging target has reloaded after crash + /// + public event System.EventHandler TargetReloadedAfterCrash + { + add + { + _client.AddEventHandler("Inspector.targetReloadedAfterCrash", value); + } + + remove + { + _client.RemoveEventHandler("Inspector.targetReloadedAfterCrash", value); + } + } + + /// + /// Fired on worker targets when main worker script and any imported scripts have been evaluated. + /// + public event System.EventHandler WorkerScriptLoaded + { + add + { + _client.AddEventHandler("Inspector.workerScriptLoaded", value); + } + + remove + { + _client.RemoveEventHandler("Inspector.workerScriptLoaded", value); + } + } + + /// + /// Disables inspector domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Inspector.disable", dict); + } + + /// + /// Enables inspector domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Inspector.enable", dict); + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// CompositingReasonsResponse + /// + [DataContract] + public class CompositingReasonsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] compositingReasons + { + get; + set; + } + + /// + /// compositingReasons + /// + public string[] CompositingReasons + { + get + { + return compositingReasons; + } + } + + [DataMember] + internal string[] compositingReasonIds + { + get; + set; + } + + /// + /// compositingReasonIds + /// + public string[] CompositingReasonIds + { + get + { + return compositingReasonIds; + } + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// LoadSnapshotResponse + /// + [DataContract] + public class LoadSnapshotResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string snapshotId + { + get; + set; + } + + /// + /// snapshotId + /// + public string SnapshotId + { + get + { + return snapshotId; + } + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// MakeSnapshotResponse + /// + [DataContract] + public class MakeSnapshotResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string snapshotId + { + get; + set; + } + + /// + /// snapshotId + /// + public string SnapshotId + { + get + { + return snapshotId; + } + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// ProfileSnapshotResponse + /// + [DataContract] + public class ProfileSnapshotResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double[] timings + { + get; + set; + } + + /// + /// timings + /// + public double[] Timings + { + get + { + return timings; + } + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// ReplaySnapshotResponse + /// + [DataContract] + public class ReplaySnapshotResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string dataURL + { + get; + set; + } + + /// + /// dataURL + /// + public string DataURL + { + get + { + return dataURL; + } + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// SnapshotCommandLogResponse + /// + [DataContract] + public class SnapshotCommandLogResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList commandLog + { + get; + set; + } + + /// + /// commandLog + /// + public System.Collections.Generic.IList CommandLog + { + get + { + return commandLog; + } + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + using System.Linq; + + /// + /// LayerTree + /// + public partial class LayerTreeClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// LayerTree + /// + /// DevToolsClient + public LayerTreeClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// LayerPainted + /// + public event System.EventHandler LayerPainted + { + add + { + _client.AddEventHandler("LayerTree.layerPainted", value); + } + + remove + { + _client.RemoveEventHandler("LayerTree.layerPainted", value); + } + } + + /// + /// LayerTreeDidChange + /// + public event System.EventHandler LayerTreeDidChange + { + add + { + _client.AddEventHandler("LayerTree.layerTreeDidChange", value); + } + + remove + { + _client.RemoveEventHandler("LayerTree.layerTreeDidChange", value); + } + } + + partial void ValidateCompositingReasons(string layerId); + /// + /// Provides the reasons why the given layer was composited. + /// + /// The id of the layer for which we want to get the reasons it was composited. + /// returns System.Threading.Tasks.Task<CompositingReasonsResponse> + public System.Threading.Tasks.Task CompositingReasonsAsync(string layerId) + { + ValidateCompositingReasons(layerId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("layerId", layerId); + return _client.ExecuteDevToolsMethodAsync("LayerTree.compositingReasons", dict); + } + + /// + /// Disables compositing tree inspection. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("LayerTree.disable", dict); + } + + /// + /// Enables compositing tree inspection. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("LayerTree.enable", dict); + } + + partial void ValidateLoadSnapshot(System.Collections.Generic.IList tiles); + /// + /// Returns the snapshot identifier. + /// + /// An array of tiles composing the snapshot. + /// returns System.Threading.Tasks.Task<LoadSnapshotResponse> + public System.Threading.Tasks.Task LoadSnapshotAsync(System.Collections.Generic.IList tiles) + { + ValidateLoadSnapshot(tiles); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("tiles", tiles.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("LayerTree.loadSnapshot", dict); + } + + partial void ValidateMakeSnapshot(string layerId); + /// + /// Returns the layer snapshot identifier. + /// + /// The id of the layer. + /// returns System.Threading.Tasks.Task<MakeSnapshotResponse> + public System.Threading.Tasks.Task MakeSnapshotAsync(string layerId) + { + ValidateMakeSnapshot(layerId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("layerId", layerId); + return _client.ExecuteDevToolsMethodAsync("LayerTree.makeSnapshot", dict); + } + + partial void ValidateProfileSnapshot(string snapshotId, int? minRepeatCount = null, double? minDuration = null, CefSharp.DevTools.DOM.Rect clipRect = null); + /// + /// ProfileSnapshot + /// + /// The id of the layer snapshot. + /// The maximum number of times to replay the snapshot (1, if not specified). + /// The minimum duration (in seconds) to replay the snapshot. + /// The clip rectangle to apply when replaying the snapshot. + /// returns System.Threading.Tasks.Task<ProfileSnapshotResponse> + public System.Threading.Tasks.Task ProfileSnapshotAsync(string snapshotId, int? minRepeatCount = null, double? minDuration = null, CefSharp.DevTools.DOM.Rect clipRect = null) + { + ValidateProfileSnapshot(snapshotId, minRepeatCount, minDuration, clipRect); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("snapshotId", snapshotId); + if (minRepeatCount.HasValue) + { + dict.Add("minRepeatCount", minRepeatCount.Value); + } + + if (minDuration.HasValue) + { + dict.Add("minDuration", minDuration.Value); + } + + if ((clipRect) != (null)) + { + dict.Add("clipRect", clipRect.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("LayerTree.profileSnapshot", dict); + } + + partial void ValidateReleaseSnapshot(string snapshotId); + /// + /// Releases layer snapshot captured by the back-end. + /// + /// The id of the layer snapshot. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReleaseSnapshotAsync(string snapshotId) + { + ValidateReleaseSnapshot(snapshotId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("snapshotId", snapshotId); + return _client.ExecuteDevToolsMethodAsync("LayerTree.releaseSnapshot", dict); + } + + partial void ValidateReplaySnapshot(string snapshotId, int? fromStep = null, int? toStep = null, double? scale = null); + /// + /// Replays the layer snapshot and returns the resulting bitmap. + /// + /// The id of the layer snapshot. + /// The first step to replay from (replay from the very start if not specified). + /// The last step to replay to (replay till the end if not specified). + /// The scale to apply while replaying (defaults to 1). + /// returns System.Threading.Tasks.Task<ReplaySnapshotResponse> + public System.Threading.Tasks.Task ReplaySnapshotAsync(string snapshotId, int? fromStep = null, int? toStep = null, double? scale = null) + { + ValidateReplaySnapshot(snapshotId, fromStep, toStep, scale); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("snapshotId", snapshotId); + if (fromStep.HasValue) + { + dict.Add("fromStep", fromStep.Value); + } + + if (toStep.HasValue) + { + dict.Add("toStep", toStep.Value); + } + + if (scale.HasValue) + { + dict.Add("scale", scale.Value); + } + + return _client.ExecuteDevToolsMethodAsync("LayerTree.replaySnapshot", dict); + } + + partial void ValidateSnapshotCommandLog(string snapshotId); + /// + /// Replays the layer snapshot and returns canvas log. + /// + /// The id of the layer snapshot. + /// returns System.Threading.Tasks.Task<SnapshotCommandLogResponse> + public System.Threading.Tasks.Task SnapshotCommandLogAsync(string snapshotId) + { + ValidateSnapshotCommandLog(snapshotId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("snapshotId", snapshotId); + return _client.ExecuteDevToolsMethodAsync("LayerTree.snapshotCommandLog", dict); + } + } +} + +namespace CefSharp.DevTools.Log +{ + using System.Linq; + + /// + /// Provides access to log entries. + /// + public partial class LogClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Log + /// + /// DevToolsClient + public LogClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Issued when new message was logged. + /// + public event System.EventHandler EntryAdded + { + add + { + _client.AddEventHandler("Log.entryAdded", value); + } + + remove + { + _client.RemoveEventHandler("Log.entryAdded", value); + } + } + + /// + /// Clears the log. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Log.clear", dict); + } + + /// + /// Disables log domain, prevents further log entries from being reported to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Log.disable", dict); + } + + /// + /// Enables log domain, sends the entries collected so far to the client by means of the + /// `entryAdded` notification. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Log.enable", dict); + } + + partial void ValidateStartViolationsReport(System.Collections.Generic.IList config); + /// + /// start violation reporting. + /// + /// Configuration for violations. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartViolationsReportAsync(System.Collections.Generic.IList config) + { + ValidateStartViolationsReport(config); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("config", config.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Log.startViolationsReport", dict); + } + + /// + /// Stop violation reporting. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopViolationsReportAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Log.stopViolationsReport", dict); + } + } +} + +namespace CefSharp.DevTools.Media +{ + using System.Linq; + + /// + /// This domain allows detailed inspection of media elements. + /// + public partial class MediaClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Media + /// + /// DevToolsClient + public MediaClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// This can be called multiple times, and can be used to set / override / + /// remove player properties. A null propValue indicates removal. + /// + public event System.EventHandler PlayerPropertiesChanged + { + add + { + _client.AddEventHandler("Media.playerPropertiesChanged", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerPropertiesChanged", value); + } + } + + /// + /// Send events as a list, allowing them to be batched on the browser for less + /// congestion. If batched, events must ALWAYS be in chronological order. + /// + public event System.EventHandler PlayerEventsAdded + { + add + { + _client.AddEventHandler("Media.playerEventsAdded", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerEventsAdded", value); + } + } + + /// + /// Send a list of any messages that need to be delivered. + /// + public event System.EventHandler PlayerMessagesLogged + { + add + { + _client.AddEventHandler("Media.playerMessagesLogged", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerMessagesLogged", value); + } + } + + /// + /// Send a list of any errors that need to be delivered. + /// + public event System.EventHandler PlayerErrorsRaised + { + add + { + _client.AddEventHandler("Media.playerErrorsRaised", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerErrorsRaised", value); + } + } + + /// + /// Called whenever a player is created, or when a new agent joins and receives + /// a list of active players. If an agent is restored, it will receive one + /// event for each active player. + /// + public event System.EventHandler PlayerCreated + { + add + { + _client.AddEventHandler("Media.playerCreated", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerCreated", value); + } + } + + /// + /// Enables the Media domain + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Media.enable", dict); + } + + /// + /// Disables the Media domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Media.disable", dict); + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetDOMCountersResponse + /// + [DataContract] + public class GetDOMCountersResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int documents + { + get; + set; + } + + /// + /// documents + /// + public int Documents + { + get + { + return documents; + } + } + + [DataMember] + internal int nodes + { + get; + set; + } + + /// + /// nodes + /// + public int Nodes + { + get + { + return nodes; + } + } + + [DataMember] + internal int jsEventListeners + { + get; + set; + } + + /// + /// jsEventListeners + /// + public int JsEventListeners + { + get + { + return jsEventListeners; + } + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetDOMCountersForLeakDetectionResponse + /// + [DataContract] + public class GetDOMCountersForLeakDetectionResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList counters + { + get; + set; + } + + /// + /// counters + /// + public System.Collections.Generic.IList Counters + { + get + { + return counters; + } + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetAllTimeSamplingProfileResponse + /// + [DataContract] + public class GetAllTimeSamplingProfileResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Memory.SamplingProfile profile + { + get; + set; + } + + /// + /// profile + /// + public CefSharp.DevTools.Memory.SamplingProfile Profile + { + get + { + return profile; + } + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetBrowserSamplingProfileResponse + /// + [DataContract] + public class GetBrowserSamplingProfileResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Memory.SamplingProfile profile + { + get; + set; + } + + /// + /// profile + /// + public CefSharp.DevTools.Memory.SamplingProfile Profile + { + get + { + return profile; + } + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetSamplingProfileResponse + /// + [DataContract] + public class GetSamplingProfileResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Memory.SamplingProfile profile + { + get; + set; + } + + /// + /// profile + /// + public CefSharp.DevTools.Memory.SamplingProfile Profile + { + get + { + return profile; + } + } + } +} + +namespace CefSharp.DevTools.Memory +{ + using System.Linq; + + /// + /// Memory + /// + public partial class MemoryClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Memory + /// + /// DevToolsClient + public MemoryClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Retruns current DOM object counters. + /// + /// returns System.Threading.Tasks.Task<GetDOMCountersResponse> + public System.Threading.Tasks.Task GetDOMCountersAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getDOMCounters", dict); + } + + /// + /// Retruns DOM object counters after preparing renderer for leak detection. + /// + /// returns System.Threading.Tasks.Task<GetDOMCountersForLeakDetectionResponse> + public System.Threading.Tasks.Task GetDOMCountersForLeakDetectionAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getDOMCountersForLeakDetection", dict); + } + + /// + /// Prepares for leak detection by terminating workers, stopping spellcheckers, + /// dropping non-essential internal caches, running garbage collections, etc. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task PrepareForLeakDetectionAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.prepareForLeakDetection", dict); + } + + /// + /// Simulate OomIntervention by purging V8 memory. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ForciblyPurgeJavaScriptMemoryAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.forciblyPurgeJavaScriptMemory", dict); + } + + partial void ValidateSetPressureNotificationsSuppressed(bool suppressed); + /// + /// Enable/disable suppressing memory pressure notifications in all processes. + /// + /// If true, memory pressure notifications will be suppressed. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPressureNotificationsSuppressedAsync(bool suppressed) + { + ValidateSetPressureNotificationsSuppressed(suppressed); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("suppressed", suppressed); + return _client.ExecuteDevToolsMethodAsync("Memory.setPressureNotificationsSuppressed", dict); + } + + partial void ValidateSimulatePressureNotification(CefSharp.DevTools.Memory.PressureLevel level); + /// + /// Simulate a memory pressure notification in all processes. + /// + /// Memory pressure level of the notification. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulatePressureNotificationAsync(CefSharp.DevTools.Memory.PressureLevel level) + { + ValidateSimulatePressureNotification(level); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("level", EnumToString(level)); + return _client.ExecuteDevToolsMethodAsync("Memory.simulatePressureNotification", dict); + } + + partial void ValidateStartSampling(int? samplingInterval = null, bool? suppressRandomness = null); + /// + /// Start collecting native memory profile. + /// + /// Average number of bytes between samples. + /// Do not randomize intervals between samples. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartSamplingAsync(int? samplingInterval = null, bool? suppressRandomness = null) + { + ValidateStartSampling(samplingInterval, suppressRandomness); + var dict = new System.Collections.Generic.Dictionary(); + if (samplingInterval.HasValue) + { + dict.Add("samplingInterval", samplingInterval.Value); + } + + if (suppressRandomness.HasValue) + { + dict.Add("suppressRandomness", suppressRandomness.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Memory.startSampling", dict); + } + + /// + /// Stop collecting native memory profile. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopSamplingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.stopSampling", dict); + } + + /// + /// Retrieve native memory allocations profile + /// collected since renderer process startup. + /// + /// returns System.Threading.Tasks.Task<GetAllTimeSamplingProfileResponse> + public System.Threading.Tasks.Task GetAllTimeSamplingProfileAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getAllTimeSamplingProfile", dict); + } + + /// + /// Retrieve native memory allocations profile + /// collected since browser process startup. + /// + /// returns System.Threading.Tasks.Task<GetBrowserSamplingProfileResponse> + public System.Threading.Tasks.Task GetBrowserSamplingProfileAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getBrowserSamplingProfile", dict); + } + + /// + /// Retrieve native memory allocations profile collected since last + /// `startSampling` call. + /// + /// returns System.Threading.Tasks.Task<GetSamplingProfileResponse> + public System.Threading.Tasks.Task GetSamplingProfileAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getSamplingProfile", dict); + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// EmulateNetworkConditionsByRuleResponse + /// + [DataContract] + public class EmulateNetworkConditionsByRuleResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] ruleIds + { + get; + set; + } + + /// + /// ruleIds + /// + public string[] RuleIds + { + get + { + return ruleIds; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetCertificateResponse + /// + [DataContract] + public class GetCertificateResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] tableNames + { + get; + set; + } + + /// + /// tableNames + /// + public string[] TableNames + { + get + { + return tableNames; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetCookiesResponse + /// + [DataContract] + public class GetCookiesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList cookies + { + get; + set; + } + + /// + /// cookies + /// + public System.Collections.Generic.IList Cookies + { + get + { + return cookies; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetResponseBodyResponse + /// + [DataContract] + public class GetResponseBodyResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string body + { + get; + set; + } + + /// + /// body + /// + public string Body + { + get + { + return body; + } + } + + [DataMember] + internal bool base64Encoded + { + get; + set; + } + + /// + /// base64Encoded + /// + public bool Base64Encoded + { + get + { + return base64Encoded; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetRequestPostDataResponse + /// + [DataContract] + public class GetRequestPostDataResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string postData + { + get; + set; + } + + /// + /// postData + /// + public string PostData + { + get + { + return postData; + } + } + + [DataMember] + internal bool base64Encoded + { + get; + set; + } + + /// + /// base64Encoded + /// + public bool Base64Encoded + { + get + { + return base64Encoded; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetResponseBodyForInterceptionResponse + /// + [DataContract] + public class GetResponseBodyForInterceptionResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string body + { + get; + set; + } + + /// + /// body + /// + public string Body + { + get + { + return body; + } + } + + [DataMember] + internal bool base64Encoded + { + get; + set; + } + + /// + /// base64Encoded + /// + public bool Base64Encoded + { + get + { + return base64Encoded; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// TakeResponseBodyForInterceptionAsStreamResponse + /// + [DataContract] + public class TakeResponseBodyForInterceptionAsStreamResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string stream + { + get; + set; + } + + /// + /// stream + /// + public string Stream + { + get + { + return stream; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// SearchInResponseBodyResponse + /// + [DataContract] + public class SearchInResponseBodyResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList result + { + get; + set; + } + + /// + /// result + /// + public System.Collections.Generic.IList Result + { + get + { + return result; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// SetCookieResponse + /// + [DataContract] + public class SetCookieResponse : DevToolsDomainResponseBase + { + [DataMember] + internal bool success + { + get; + set; + } + + /// + /// success + /// + public bool Success + { + get + { + return success; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// StreamResourceContentResponse + /// + [DataContract] + public class StreamResourceContentResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string bufferedData + { + get; + set; + } + + /// + /// bufferedData + /// + public byte[] BufferedData + { + get + { + return Convert(bufferedData); + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetSecurityIsolationStatusResponse + /// + [DataContract] + public class GetSecurityIsolationStatusResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Network.SecurityIsolationStatus status + { + get; + set; + } + + /// + /// status + /// + public CefSharp.DevTools.Network.SecurityIsolationStatus Status + { + get + { + return status; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// FetchSchemefulSiteResponse + /// + [DataContract] + public class FetchSchemefulSiteResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string schemefulSite + { + get; + set; + } + + /// + /// schemefulSite + /// + public string SchemefulSite + { + get + { + return schemefulSite; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// LoadNetworkResourceResponse + /// + [DataContract] + public class LoadNetworkResourceResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Network.LoadNetworkResourcePageResult resource + { + get; + set; + } + + /// + /// resource + /// + public CefSharp.DevTools.Network.LoadNetworkResourcePageResult Resource + { + get + { + return resource; + } + } + } +} + +namespace CefSharp.DevTools.Network +{ + using System.Linq; + + /// + /// Network domain allows tracking network activities of the page. It exposes information about http, + /// file, data and other requests and responses, their headers, bodies, timing, etc. + /// + public partial class NetworkClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Network + /// + /// DevToolsClient + public NetworkClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when data chunk was received over the network. + /// + public event System.EventHandler DataReceived + { + add + { + _client.AddEventHandler("Network.dataReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.dataReceived", value); + } + } + + /// + /// Fired when EventSource message is received. + /// + public event System.EventHandler EventSourceMessageReceived + { + add + { + _client.AddEventHandler("Network.eventSourceMessageReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.eventSourceMessageReceived", value); + } + } + + /// + /// Fired when HTTP request has failed to load. + /// + public event System.EventHandler LoadingFailed + { + add + { + _client.AddEventHandler("Network.loadingFailed", value); + } + + remove + { + _client.RemoveEventHandler("Network.loadingFailed", value); + } + } + + /// + /// Fired when HTTP request has finished loading. + /// + public event System.EventHandler LoadingFinished + { + add + { + _client.AddEventHandler("Network.loadingFinished", value); + } + + remove + { + _client.RemoveEventHandler("Network.loadingFinished", value); + } + } + + /// + /// Fired if request ended up loading from cache. + /// + public event System.EventHandler RequestServedFromCache + { + add + { + _client.AddEventHandler("Network.requestServedFromCache", value); + } + + remove + { + _client.RemoveEventHandler("Network.requestServedFromCache", value); + } + } + + /// + /// Fired when page is about to send HTTP request. + /// + public event System.EventHandler RequestWillBeSent + { + add + { + _client.AddEventHandler("Network.requestWillBeSent", value); + } + + remove + { + _client.RemoveEventHandler("Network.requestWillBeSent", value); + } + } + + /// + /// Fired when resource loading priority is changed + /// + public event System.EventHandler ResourceChangedPriority + { + add + { + _client.AddEventHandler("Network.resourceChangedPriority", value); + } + + remove + { + _client.RemoveEventHandler("Network.resourceChangedPriority", value); + } + } + + /// + /// Fired when a signed exchange was received over the network + /// + public event System.EventHandler SignedExchangeReceived + { + add + { + _client.AddEventHandler("Network.signedExchangeReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.signedExchangeReceived", value); + } + } + + /// + /// Fired when HTTP response is available. + /// + public event System.EventHandler ResponseReceived + { + add + { + _client.AddEventHandler("Network.responseReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.responseReceived", value); + } + } + + /// + /// Fired when WebSocket is closed. + /// + public event System.EventHandler WebSocketClosed + { + add + { + _client.AddEventHandler("Network.webSocketClosed", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketClosed", value); + } + } + + /// + /// Fired upon WebSocket creation. + /// + public event System.EventHandler WebSocketCreated + { + add + { + _client.AddEventHandler("Network.webSocketCreated", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketCreated", value); + } + } + + /// + /// Fired when WebSocket message error occurs. + /// + public event System.EventHandler WebSocketFrameError + { + add + { + _client.AddEventHandler("Network.webSocketFrameError", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketFrameError", value); + } + } + + /// + /// Fired when WebSocket message is received. + /// + public event System.EventHandler WebSocketFrameReceived + { + add + { + _client.AddEventHandler("Network.webSocketFrameReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketFrameReceived", value); + } + } + + /// + /// Fired when WebSocket message is sent. + /// + public event System.EventHandler WebSocketFrameSent + { + add + { + _client.AddEventHandler("Network.webSocketFrameSent", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketFrameSent", value); + } + } + + /// + /// Fired when WebSocket handshake response becomes available. + /// + public event System.EventHandler WebSocketHandshakeResponseReceived + { + add + { + _client.AddEventHandler("Network.webSocketHandshakeResponseReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketHandshakeResponseReceived", value); + } + } + + /// + /// Fired when WebSocket is about to initiate handshake. + /// + public event System.EventHandler WebSocketWillSendHandshakeRequest + { + add + { + _client.AddEventHandler("Network.webSocketWillSendHandshakeRequest", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketWillSendHandshakeRequest", value); + } + } + + /// + /// Fired upon WebTransport creation. + /// + public event System.EventHandler WebTransportCreated + { + add + { + _client.AddEventHandler("Network.webTransportCreated", value); + } + + remove + { + _client.RemoveEventHandler("Network.webTransportCreated", value); + } + } + + /// + /// Fired when WebTransport handshake is finished. + /// + public event System.EventHandler WebTransportConnectionEstablished + { + add + { + _client.AddEventHandler("Network.webTransportConnectionEstablished", value); + } + + remove + { + _client.RemoveEventHandler("Network.webTransportConnectionEstablished", value); + } + } + + /// + /// Fired when WebTransport is disposed. + /// + public event System.EventHandler WebTransportClosed + { + add + { + _client.AddEventHandler("Network.webTransportClosed", value); + } + + remove + { + _client.RemoveEventHandler("Network.webTransportClosed", value); + } + } + + /// + /// Fired upon direct_socket.TCPSocket creation. + /// + public event System.EventHandler DirectTCPSocketCreated + { + add + { + _client.AddEventHandler("Network.directTCPSocketCreated", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketCreated", value); + } + } + + /// + /// Fired when direct_socket.TCPSocket connection is opened. + /// + public event System.EventHandler DirectTCPSocketOpened + { + add + { + _client.AddEventHandler("Network.directTCPSocketOpened", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketOpened", value); + } + } + + /// + /// Fired when direct_socket.TCPSocket is aborted. + /// + public event System.EventHandler DirectTCPSocketAborted + { + add + { + _client.AddEventHandler("Network.directTCPSocketAborted", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketAborted", value); + } + } + + /// + /// Fired when direct_socket.TCPSocket is closed. + /// + public event System.EventHandler DirectTCPSocketClosed + { + add + { + _client.AddEventHandler("Network.directTCPSocketClosed", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketClosed", value); + } + } + + /// + /// Fired when data is sent to tcp direct socket stream. + /// + public event System.EventHandler DirectTCPSocketChunkSent + { + add + { + _client.AddEventHandler("Network.directTCPSocketChunkSent", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketChunkSent", value); + } + } + + /// + /// Fired when data is received from tcp direct socket stream. + /// + public event System.EventHandler DirectTCPSocketChunkReceived + { + add + { + _client.AddEventHandler("Network.directTCPSocketChunkReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketChunkReceived", value); + } + } + + /// + /// DirectUDPSocketJoinedMulticastGroup + /// + public event System.EventHandler DirectUDPSocketJoinedMulticastGroup + { + add + { + _client.AddEventHandler("Network.directUDPSocketJoinedMulticastGroup", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketJoinedMulticastGroup", value); + } + } + + /// + /// DirectUDPSocketLeftMulticastGroup + /// + public event System.EventHandler DirectUDPSocketLeftMulticastGroup + { + add + { + _client.AddEventHandler("Network.directUDPSocketLeftMulticastGroup", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketLeftMulticastGroup", value); + } + } + + /// + /// Fired upon direct_socket.UDPSocket creation. + /// + public event System.EventHandler DirectUDPSocketCreated + { + add + { + _client.AddEventHandler("Network.directUDPSocketCreated", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketCreated", value); + } + } + + /// + /// Fired when direct_socket.UDPSocket connection is opened. + /// + public event System.EventHandler DirectUDPSocketOpened + { + add + { + _client.AddEventHandler("Network.directUDPSocketOpened", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketOpened", value); + } + } + + /// + /// Fired when direct_socket.UDPSocket is aborted. + /// + public event System.EventHandler DirectUDPSocketAborted + { + add + { + _client.AddEventHandler("Network.directUDPSocketAborted", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketAborted", value); + } + } + + /// + /// Fired when direct_socket.UDPSocket is closed. + /// + public event System.EventHandler DirectUDPSocketClosed + { + add + { + _client.AddEventHandler("Network.directUDPSocketClosed", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketClosed", value); + } + } + + /// + /// Fired when message is sent to udp direct socket stream. + /// + public event System.EventHandler DirectUDPSocketChunkSent + { + add + { + _client.AddEventHandler("Network.directUDPSocketChunkSent", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketChunkSent", value); + } + } + + /// + /// Fired when message is received from udp direct socket stream. + /// + public event System.EventHandler DirectUDPSocketChunkReceived + { + add + { + _client.AddEventHandler("Network.directUDPSocketChunkReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketChunkReceived", value); + } + } + + /// + /// Fired when additional information about a requestWillBeSent event is available from the + /// network stack. Not every requestWillBeSent event will have an additional + /// requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent + /// or requestWillBeSentExtraInfo will be fired first for the same request. + /// + public event System.EventHandler RequestWillBeSentExtraInfo + { + add + { + _client.AddEventHandler("Network.requestWillBeSentExtraInfo", value); + } + + remove + { + _client.RemoveEventHandler("Network.requestWillBeSentExtraInfo", value); + } + } + + /// + /// Fired when additional information about a responseReceived event is available from the network + /// stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for + /// it, and responseReceivedExtraInfo may be fired before or after responseReceived. + /// + public event System.EventHandler ResponseReceivedExtraInfo + { + add + { + _client.AddEventHandler("Network.responseReceivedExtraInfo", value); + } + + remove + { + _client.RemoveEventHandler("Network.responseReceivedExtraInfo", value); + } + } + + /// + /// Fired when 103 Early Hints headers is received in addition to the common response. + /// Not every responseReceived event will have an responseReceivedEarlyHints fired. + /// Only one responseReceivedEarlyHints may be fired for eached responseReceived event. + /// + public event System.EventHandler ResponseReceivedEarlyHints + { + add + { + _client.AddEventHandler("Network.responseReceivedEarlyHints", value); + } + + remove + { + _client.RemoveEventHandler("Network.responseReceivedEarlyHints", value); + } + } + + /// + /// Fired exactly once for each Trust Token operation. Depending on + /// the type of the operation and whether the operation succeeded or + /// failed, the event is fired before the corresponding request was sent + /// or after the response was received. + /// + public event System.EventHandler TrustTokenOperationDone + { + add + { + _client.AddEventHandler("Network.trustTokenOperationDone", value); + } + + remove + { + _client.RemoveEventHandler("Network.trustTokenOperationDone", value); + } + } + + /// + /// Fired once security policy has been updated. + /// + public event System.EventHandler PolicyUpdated + { + add + { + _client.AddEventHandler("Network.policyUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Network.policyUpdated", value); + } + } + + /// + /// Is sent whenever a new report is added. + /// And after 'enableReportingApi' for all existing reports. + /// + public event System.EventHandler ReportingApiReportAdded + { + add + { + _client.AddEventHandler("Network.reportingApiReportAdded", value); + } + + remove + { + _client.RemoveEventHandler("Network.reportingApiReportAdded", value); + } + } + + /// + /// ReportingApiReportUpdated + /// + public event System.EventHandler ReportingApiReportUpdated + { + add + { + _client.AddEventHandler("Network.reportingApiReportUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Network.reportingApiReportUpdated", value); + } + } + + /// + /// ReportingApiEndpointsChangedForOrigin + /// + public event System.EventHandler ReportingApiEndpointsChangedForOrigin + { + add + { + _client.AddEventHandler("Network.reportingApiEndpointsChangedForOrigin", value); + } + + remove + { + _client.RemoveEventHandler("Network.reportingApiEndpointsChangedForOrigin", value); + } + } + + /// + /// Triggered when the initial set of device bound sessions is added. + /// + public event System.EventHandler DeviceBoundSessionsAdded + { + add + { + _client.AddEventHandler("Network.deviceBoundSessionsAdded", value); + } + + remove + { + _client.RemoveEventHandler("Network.deviceBoundSessionsAdded", value); + } + } + + /// + /// Triggered when a device bound session event occurs. + /// + public event System.EventHandler DeviceBoundSessionEventOccurred + { + add + { + _client.AddEventHandler("Network.deviceBoundSessionEventOccurred", value); + } + + remove + { + _client.RemoveEventHandler("Network.deviceBoundSessionEventOccurred", value); + } + } + + partial void ValidateSetAcceptedEncodings(CefSharp.DevTools.Network.ContentEncoding[] encodings); + /// + /// Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted. + /// + /// List of accepted content encodings. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAcceptedEncodingsAsync(CefSharp.DevTools.Network.ContentEncoding[] encodings) + { + ValidateSetAcceptedEncodings(encodings); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("encodings", EnumToString(encodings)); + return _client.ExecuteDevToolsMethodAsync("Network.setAcceptedEncodings", dict); + } + + /// + /// Clears accepted encodings set by setAcceptedEncodings + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearAcceptedEncodingsOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Network.clearAcceptedEncodingsOverride", dict); + } + + /// + /// Clears browser cache. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearBrowserCacheAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Network.clearBrowserCache", dict); + } + + /// + /// Clears browser cookies. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearBrowserCookiesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Network.clearBrowserCookies", dict); + } + + partial void ValidateDeleteCookies(string name, string url = null, string domain = null, string path = null, CefSharp.DevTools.Network.CookiePartitionKey partitionKey = null); + /// + /// Deletes browser cookies with matching name and url or domain/path/partitionKey pair. + /// + /// Name of the cookies to remove. + /// If specified, deletes all the cookies with the given name where domain and path matchprovided URL. + /// If specified, deletes only cookies with the exact domain. + /// If specified, deletes only cookies with the exact path. + /// If specified, deletes only cookies with the the given name and partitionKey whereall partition key attributes match the cookie partition key attribute. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteCookiesAsync(string name, string url = null, string domain = null, string path = null, CefSharp.DevTools.Network.CookiePartitionKey partitionKey = null) + { + ValidateDeleteCookies(name, url, domain, path, partitionKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + if (!(string.IsNullOrEmpty(domain))) + { + dict.Add("domain", domain); + } + + if (!(string.IsNullOrEmpty(path))) + { + dict.Add("path", path); + } + + if ((partitionKey) != (null)) + { + dict.Add("partitionKey", partitionKey.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Network.deleteCookies", dict); + } + + /// + /// Disables network tracking, prevents network events from being sent to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Network.disable", dict); + } + + partial void ValidateEmulateNetworkConditionsByRule(bool offline, System.Collections.Generic.IList matchedNetworkConditions); + /// + /// Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated + /// Network.emulateNetworkConditions this method does not affect `navigator` state. Use Network.overrideNetworkState to + /// explicitly modify `navigator` behavior. + /// + /// True to emulate internet disconnection. + /// Configure conditions for matching requests. If multiple entries match a request, the first entry wins. Globalconditions can be configured by leaving the urlPattern for the conditions empty. These global conditions arealso applied for throttling of p2p connections. + /// returns System.Threading.Tasks.Task<EmulateNetworkConditionsByRuleResponse> + public System.Threading.Tasks.Task EmulateNetworkConditionsByRuleAsync(bool offline, System.Collections.Generic.IList matchedNetworkConditions) + { + ValidateEmulateNetworkConditionsByRule(offline, matchedNetworkConditions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("offline", offline); + dict.Add("matchedNetworkConditions", matchedNetworkConditions.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Network.emulateNetworkConditionsByRule", dict); + } + + partial void ValidateOverrideNetworkState(bool offline, double latency, double downloadThroughput, double uploadThroughput, CefSharp.DevTools.Network.ConnectionType? connectionType = null); + /// + /// Override the state of navigator.onLine and navigator.connection. + /// + /// True to emulate internet disconnection. + /// Minimum latency from request sent to response headers received (ms). + /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. + /// Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. + /// Connection type if known. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task OverrideNetworkStateAsync(bool offline, double latency, double downloadThroughput, double uploadThroughput, CefSharp.DevTools.Network.ConnectionType? connectionType = null) + { + ValidateOverrideNetworkState(offline, latency, downloadThroughput, uploadThroughput, connectionType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("offline", offline); + dict.Add("latency", latency); + dict.Add("downloadThroughput", downloadThroughput); + dict.Add("uploadThroughput", uploadThroughput); + if (connectionType.HasValue) + { + dict.Add("connectionType", EnumToString(connectionType)); + } + + return _client.ExecuteDevToolsMethodAsync("Network.overrideNetworkState", dict); + } + + partial void ValidateEnable(int? maxTotalBufferSize = null, int? maxResourceBufferSize = null, int? maxPostDataSize = null, bool? reportDirectSocketTraffic = null, bool? enableDurableMessages = null); + /// + /// Enables network tracking, network events will now be delivered to the client. + /// + /// Buffer size in bytes to use when preserving network payloads (XHRs, etc). + /// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). + /// Longest post body size (in bytes) that would be included in requestWillBeSent notification + /// Whether DirectSocket chunk send/receive events should be reported. + /// Enable storing response bodies outside of renderer, so that these survivea cross-process navigation. Requires maxTotalBufferSize to be set.Currently defaults to false. This field is being deprecated in favor of the dedicatedconfigureDurableMessages command, due to the possibility of deadlocks when awaitingNetwork.enable before issuing Runtime.runIfWaitingForDebugger. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(int? maxTotalBufferSize = null, int? maxResourceBufferSize = null, int? maxPostDataSize = null, bool? reportDirectSocketTraffic = null, bool? enableDurableMessages = null) + { + ValidateEnable(maxTotalBufferSize, maxResourceBufferSize, maxPostDataSize, reportDirectSocketTraffic, enableDurableMessages); + var dict = new System.Collections.Generic.Dictionary(); + if (maxTotalBufferSize.HasValue) + { + dict.Add("maxTotalBufferSize", maxTotalBufferSize.Value); + } + + if (maxResourceBufferSize.HasValue) + { + dict.Add("maxResourceBufferSize", maxResourceBufferSize.Value); + } + + if (maxPostDataSize.HasValue) + { + dict.Add("maxPostDataSize", maxPostDataSize.Value); + } + + if (reportDirectSocketTraffic.HasValue) + { + dict.Add("reportDirectSocketTraffic", reportDirectSocketTraffic.Value); + } + + if (enableDurableMessages.HasValue) + { + dict.Add("enableDurableMessages", enableDurableMessages.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Network.enable", dict); + } + + partial void ValidateConfigureDurableMessages(int? maxTotalBufferSize = null, int? maxResourceBufferSize = null); + /// + /// Configures storing response bodies outside of renderer, so that these survive + /// a cross-process navigation. + /// If maxTotalBufferSize is not set, durable messages are disabled. + /// + /// Buffer size in bytes to use when preserving network payloads (XHRs, etc). + /// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ConfigureDurableMessagesAsync(int? maxTotalBufferSize = null, int? maxResourceBufferSize = null) + { + ValidateConfigureDurableMessages(maxTotalBufferSize, maxResourceBufferSize); + var dict = new System.Collections.Generic.Dictionary(); + if (maxTotalBufferSize.HasValue) + { + dict.Add("maxTotalBufferSize", maxTotalBufferSize.Value); + } + + if (maxResourceBufferSize.HasValue) + { + dict.Add("maxResourceBufferSize", maxResourceBufferSize.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Network.configureDurableMessages", dict); + } + + partial void ValidateGetCertificate(string origin); + /// + /// Returns the DER-encoded certificate. + /// + /// Origin to get certificate for. + /// returns System.Threading.Tasks.Task<GetCertificateResponse> + public System.Threading.Tasks.Task GetCertificateAsync(string origin) + { + ValidateGetCertificate(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Network.getCertificate", dict); + } + + partial void ValidateGetCookies(string[] urls = null); + /// + /// Returns all browser cookies for the current URL. Depending on the backend support, will return + /// detailed cookie information in the `cookies` field. + /// + /// The list of URLs for which applicable cookies will be fetched.If not specified, it's assumed to be set to the list containingthe URLs of the page and all of its subframes. + /// returns System.Threading.Tasks.Task<GetCookiesResponse> + public System.Threading.Tasks.Task GetCookiesAsync(string[] urls = null) + { + ValidateGetCookies(urls); + var dict = new System.Collections.Generic.Dictionary(); + if ((urls) != (null)) + { + dict.Add("urls", urls); + } + + return _client.ExecuteDevToolsMethodAsync("Network.getCookies", dict); + } + + partial void ValidateGetResponseBody(string requestId); + /// + /// Returns content served for the given request. + /// + /// Identifier of the network request to get content for. + /// returns System.Threading.Tasks.Task<GetResponseBodyResponse> + public System.Threading.Tasks.Task GetResponseBodyAsync(string requestId) + { + ValidateGetResponseBody(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Network.getResponseBody", dict); + } + + partial void ValidateGetRequestPostData(string requestId); + /// + /// Returns post data sent with the request. Returns an error when no data was sent with the request. + /// + /// Identifier of the network request to get content for. + /// returns System.Threading.Tasks.Task<GetRequestPostDataResponse> + public System.Threading.Tasks.Task GetRequestPostDataAsync(string requestId) + { + ValidateGetRequestPostData(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Network.getRequestPostData", dict); + } + + partial void ValidateGetResponseBodyForInterception(string interceptionId); + /// + /// Returns content served for the given currently intercepted request. + /// + /// Identifier for the intercepted request to get body for. + /// returns System.Threading.Tasks.Task<GetResponseBodyForInterceptionResponse> + public System.Threading.Tasks.Task GetResponseBodyForInterceptionAsync(string interceptionId) + { + ValidateGetResponseBodyForInterception(interceptionId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("interceptionId", interceptionId); + return _client.ExecuteDevToolsMethodAsync("Network.getResponseBodyForInterception", dict); + } + + partial void ValidateTakeResponseBodyForInterceptionAsStream(string interceptionId); + /// + /// Returns a handle to the stream representing the response body. Note that after this command, + /// the intercepted request can't be continued as is -- you either need to cancel it or to provide + /// the response body. The stream only supports sequential read, IO.read will fail if the position + /// is specified. + /// + /// interceptionId + /// returns System.Threading.Tasks.Task<TakeResponseBodyForInterceptionAsStreamResponse> + public System.Threading.Tasks.Task TakeResponseBodyForInterceptionAsStreamAsync(string interceptionId) + { + ValidateTakeResponseBodyForInterceptionAsStream(interceptionId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("interceptionId", interceptionId); + return _client.ExecuteDevToolsMethodAsync("Network.takeResponseBodyForInterceptionAsStream", dict); + } + + partial void ValidateReplayXHR(string requestId); + /// + /// This method sends a new XMLHttpRequest which is identical to the original one. The following + /// parameters should be identical: method, url, async, request body, extra headers, withCredentials + /// attribute, user, password. + /// + /// Identifier of XHR to replay. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReplayXHRAsync(string requestId) + { + ValidateReplayXHR(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Network.replayXHR", dict); + } + + partial void ValidateSearchInResponseBody(string requestId, string query, bool? caseSensitive = null, bool? isRegex = null); + /// + /// Searches for given string in response content. + /// + /// Identifier of the network response to search. + /// String to search for. + /// If true, search is case sensitive. + /// If true, treats string parameter as regex. + /// returns System.Threading.Tasks.Task<SearchInResponseBodyResponse> + public System.Threading.Tasks.Task SearchInResponseBodyAsync(string requestId, string query, bool? caseSensitive = null, bool? isRegex = null) + { + ValidateSearchInResponseBody(requestId, query, caseSensitive, isRegex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("query", query); + if (caseSensitive.HasValue) + { + dict.Add("caseSensitive", caseSensitive.Value); + } + + if (isRegex.HasValue) + { + dict.Add("isRegex", isRegex.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Network.searchInResponseBody", dict); + } + + partial void ValidateSetBlockedURLs(System.Collections.Generic.IList urlPatterns = null, string[] urls = null); + /// + /// Blocks URLs from loading. + /// + /// Patterns to match in the order in which they are given. These patternsalso take precedence over any wildcard patterns defined in `urls`. + /// URL patterns to block. Wildcards ('*') are allowed. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBlockedURLsAsync(System.Collections.Generic.IList urlPatterns = null, string[] urls = null) + { + ValidateSetBlockedURLs(urlPatterns, urls); + var dict = new System.Collections.Generic.Dictionary(); + if ((urlPatterns) != (null)) + { + dict.Add("urlPatterns", urlPatterns.Select(x => x.ToDictionary())); + } + + if ((urls) != (null)) + { + dict.Add("urls", urls); + } + + return _client.ExecuteDevToolsMethodAsync("Network.setBlockedURLs", dict); + } + + partial void ValidateSetBypassServiceWorker(bool bypass); + /// + /// Toggles ignoring of service worker for each request. + /// + /// Bypass service worker and load from network. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBypassServiceWorkerAsync(bool bypass) + { + ValidateSetBypassServiceWorker(bypass); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("bypass", bypass); + return _client.ExecuteDevToolsMethodAsync("Network.setBypassServiceWorker", dict); + } + + partial void ValidateSetCacheDisabled(bool cacheDisabled); + /// + /// Toggles ignoring cache for each request. If `true`, cache will not be used. + /// + /// Cache disabled state. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCacheDisabledAsync(bool cacheDisabled) + { + ValidateSetCacheDisabled(cacheDisabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheDisabled", cacheDisabled); + return _client.ExecuteDevToolsMethodAsync("Network.setCacheDisabled", dict); + } + + partial void ValidateSetCookie(string name, string value, string url = null, string domain = null, string path = null, bool? secure = null, bool? httpOnly = null, CefSharp.DevTools.Network.CookieSameSite? sameSite = null, double? expires = null, CefSharp.DevTools.Network.CookiePriority? priority = null, CefSharp.DevTools.Network.CookieSourceScheme? sourceScheme = null, int? sourcePort = null, CefSharp.DevTools.Network.CookiePartitionKey partitionKey = null); + /// + /// Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. + /// + /// Cookie name. + /// Cookie value. + /// The request-URI to associate with the setting of the cookie. This value can affect thedefault domain, path, source port, and source scheme values of the created cookie. + /// Cookie domain. + /// Cookie path. + /// True if cookie is secure. + /// True if cookie is http-only. + /// Cookie SameSite type. + /// Cookie expiration date, session cookie if not set + /// Cookie Priority type. + /// Cookie source scheme type. + /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port.An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.This is a temporary ability and it will be removed in the future. + /// Cookie partition key. If not set, the cookie will be set as not partitioned. + /// returns System.Threading.Tasks.Task<SetCookieResponse> + public System.Threading.Tasks.Task SetCookieAsync(string name, string value, string url = null, string domain = null, string path = null, bool? secure = null, bool? httpOnly = null, CefSharp.DevTools.Network.CookieSameSite? sameSite = null, double? expires = null, CefSharp.DevTools.Network.CookiePriority? priority = null, CefSharp.DevTools.Network.CookieSourceScheme? sourceScheme = null, int? sourcePort = null, CefSharp.DevTools.Network.CookiePartitionKey partitionKey = null) + { + ValidateSetCookie(name, value, url, domain, path, secure, httpOnly, sameSite, expires, priority, sourceScheme, sourcePort, partitionKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + dict.Add("value", value); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + if (!(string.IsNullOrEmpty(domain))) + { + dict.Add("domain", domain); + } + + if (!(string.IsNullOrEmpty(path))) + { + dict.Add("path", path); + } + + if (secure.HasValue) + { + dict.Add("secure", secure.Value); + } + + if (httpOnly.HasValue) + { + dict.Add("httpOnly", httpOnly.Value); + } + + if (sameSite.HasValue) + { + dict.Add("sameSite", EnumToString(sameSite)); + } + + if (expires.HasValue) + { + dict.Add("expires", expires.Value); + } + + if (priority.HasValue) + { + dict.Add("priority", EnumToString(priority)); + } + + if (sourceScheme.HasValue) + { + dict.Add("sourceScheme", EnumToString(sourceScheme)); + } + + if (sourcePort.HasValue) + { + dict.Add("sourcePort", sourcePort.Value); + } + + if ((partitionKey) != (null)) + { + dict.Add("partitionKey", partitionKey.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Network.setCookie", dict); + } + + partial void ValidateSetCookies(System.Collections.Generic.IList cookies); + /// + /// Sets given cookies. + /// + /// Cookies to be set. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCookiesAsync(System.Collections.Generic.IList cookies) + { + ValidateSetCookies(cookies); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cookies", cookies.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Network.setCookies", dict); + } + + partial void ValidateSetExtraHTTPHeaders(CefSharp.DevTools.Network.Headers headers); + /// + /// Specifies whether to always send extra HTTP headers with the requests from this page. + /// + /// Map with extra HTTP headers. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetExtraHTTPHeadersAsync(CefSharp.DevTools.Network.Headers headers) + { + ValidateSetExtraHTTPHeaders(headers); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("headers", headers.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Network.setExtraHTTPHeaders", dict); + } + + partial void ValidateSetAttachDebugStack(bool enabled); + /// + /// Specifies whether to attach a page script stack id in requests + /// + /// Whether to attach a page script stack for debugging purpose. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttachDebugStackAsync(bool enabled) + { + ValidateSetAttachDebugStack(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Network.setAttachDebugStack", dict); + } + + partial void ValidateSetUserAgentOverride(string userAgent, string acceptLanguage = null, string platform = null, CefSharp.DevTools.Emulation.UserAgentMetadata userAgentMetadata = null); + /// + /// Allows overriding user agent with the given string. + /// + /// User agent to use. + /// Browser language to emulate. + /// The platform navigator.platform should return. + /// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetUserAgentOverrideAsync(string userAgent, string acceptLanguage = null, string platform = null, CefSharp.DevTools.Emulation.UserAgentMetadata userAgentMetadata = null) + { + ValidateSetUserAgentOverride(userAgent, acceptLanguage, platform, userAgentMetadata); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("userAgent", userAgent); + if (!(string.IsNullOrEmpty(acceptLanguage))) + { + dict.Add("acceptLanguage", acceptLanguage); + } + + if (!(string.IsNullOrEmpty(platform))) + { + dict.Add("platform", platform); + } + + if ((userAgentMetadata) != (null)) + { + dict.Add("userAgentMetadata", userAgentMetadata.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Network.setUserAgentOverride", dict); + } + + partial void ValidateStreamResourceContent(string requestId); + /// + /// Enables streaming of the response for the given requestId. + /// If enabled, the dataReceived event contains the data that was received during streaming. + /// + /// Identifier of the request to stream. + /// returns System.Threading.Tasks.Task<StreamResourceContentResponse> + public System.Threading.Tasks.Task StreamResourceContentAsync(string requestId) + { + ValidateStreamResourceContent(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Network.streamResourceContent", dict); + } + + partial void ValidateGetSecurityIsolationStatus(string frameId = null); + /// + /// Returns information about the COEP/COOP isolation status. + /// + /// If no frameId is provided, the status of the target is provided. + /// returns System.Threading.Tasks.Task<GetSecurityIsolationStatusResponse> + public System.Threading.Tasks.Task GetSecurityIsolationStatusAsync(string frameId = null) + { + ValidateGetSecurityIsolationStatus(frameId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Network.getSecurityIsolationStatus", dict); + } + + partial void ValidateEnableReportingApi(bool enable); + /// + /// Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client. + /// Enabling triggers 'reportingApiReportAdded' for all existing reports. + /// + /// Whether to enable or disable events for the Reporting API + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableReportingApiAsync(bool enable) + { + ValidateEnableReportingApi(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Network.enableReportingApi", dict); + } + + partial void ValidateEnableDeviceBoundSessions(bool enable); + /// + /// Sets up tracking device bound sessions and fetching of initial set of sessions. + /// + /// Whether to enable or disable events. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableDeviceBoundSessionsAsync(bool enable) + { + ValidateEnableDeviceBoundSessions(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Network.enableDeviceBoundSessions", dict); + } + + partial void ValidateFetchSchemefulSite(string origin); + /// + /// Fetches the schemeful site for a specific origin. + /// + /// The URL origin. + /// returns System.Threading.Tasks.Task<FetchSchemefulSiteResponse> + public System.Threading.Tasks.Task FetchSchemefulSiteAsync(string origin) + { + ValidateFetchSchemefulSite(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Network.fetchSchemefulSite", dict); + } + + partial void ValidateLoadNetworkResource(string url, CefSharp.DevTools.Network.LoadNetworkResourceOptions options, string frameId = null); + /// + /// Fetches the resource and returns the content. + /// + /// URL of the resource to get content for. + /// Options for the request. + /// Frame id to get the resource for. Mandatory for frame targets, andshould be omitted for worker targets. + /// returns System.Threading.Tasks.Task<LoadNetworkResourceResponse> + public System.Threading.Tasks.Task LoadNetworkResourceAsync(string url, CefSharp.DevTools.Network.LoadNetworkResourceOptions options, string frameId = null) + { + ValidateLoadNetworkResource(url, options, frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + dict.Add("options", options.ToDictionary()); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Network.loadNetworkResource", dict); + } + + partial void ValidateSetCookieControls(bool enableThirdPartyCookieRestriction, bool disableThirdPartyCookieMetadata, bool disableThirdPartyCookieHeuristics); + /// + /// Sets Controls for third-party cookie access + /// Page reload is required before the new cookie behavior will be observed + /// + /// Whether 3pc restriction is enabled. + /// Whether 3pc grace period exception should be enabled; false by default. + /// Whether 3pc heuristics exceptions should be enabled; false by default. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCookieControlsAsync(bool enableThirdPartyCookieRestriction, bool disableThirdPartyCookieMetadata, bool disableThirdPartyCookieHeuristics) + { + ValidateSetCookieControls(enableThirdPartyCookieRestriction, disableThirdPartyCookieMetadata, disableThirdPartyCookieHeuristics); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enableThirdPartyCookieRestriction", enableThirdPartyCookieRestriction); + dict.Add("disableThirdPartyCookieMetadata", disableThirdPartyCookieMetadata); + dict.Add("disableThirdPartyCookieHeuristics", disableThirdPartyCookieHeuristics); + return _client.ExecuteDevToolsMethodAsync("Network.setCookieControls", dict); + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + /// + /// GetHighlightObjectForTestResponse + /// + [DataContract] + public class GetHighlightObjectForTestResponse : DevToolsDomainResponseBase + { + [DataMember] + internal object highlight + { + get; + set; + } + + /// + /// highlight + /// + public object Highlight + { + get + { + return highlight; + } + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + /// + /// GetGridHighlightObjectsForTestResponse + /// + [DataContract] + public class GetGridHighlightObjectsForTestResponse : DevToolsDomainResponseBase + { + [DataMember] + internal object highlights + { + get; + set; + } + + /// + /// highlights + /// + public object Highlights + { + get + { + return highlights; + } + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + /// + /// GetSourceOrderHighlightObjectForTestResponse + /// + [DataContract] + public class GetSourceOrderHighlightObjectForTestResponse : DevToolsDomainResponseBase + { + [DataMember] + internal object highlight + { + get; + set; + } + + /// + /// highlight + /// + public object Highlight + { + get + { + return highlight; + } + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + using System.Linq; + + /// + /// This domain provides various functionality related to drawing atop the inspected page. + /// + public partial class OverlayClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Overlay + /// + /// DevToolsClient + public OverlayClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when the node should be inspected. This happens after call to `setInspectMode` or when + /// user manually inspects an element. + /// + public event System.EventHandler InspectNodeRequested + { + add + { + _client.AddEventHandler("Overlay.inspectNodeRequested", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.inspectNodeRequested", value); + } + } + + /// + /// Fired when the node should be highlighted. This happens after call to `setInspectMode`. + /// + public event System.EventHandler NodeHighlightRequested + { + add + { + _client.AddEventHandler("Overlay.nodeHighlightRequested", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.nodeHighlightRequested", value); + } + } + + /// + /// Fired when user asks to capture screenshot of some area on the page. + /// + public event System.EventHandler ScreenshotRequested + { + add + { + _client.AddEventHandler("Overlay.screenshotRequested", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.screenshotRequested", value); + } + } + + /// + /// Fired when user asks to show the Inspect panel. + /// + public event System.EventHandler InspectPanelShowRequested + { + add + { + _client.AddEventHandler("Overlay.inspectPanelShowRequested", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.inspectPanelShowRequested", value); + } + } + + /// + /// Fired when user asks to restore the Inspected Element floating window. + /// + public event System.EventHandler InspectedElementWindowRestored + { + add + { + _client.AddEventHandler("Overlay.inspectedElementWindowRestored", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.inspectedElementWindowRestored", value); + } + } + + /// + /// Fired when user cancels the inspect mode. + /// + public event System.EventHandler InspectModeCanceled + { + add + { + _client.AddEventHandler("Overlay.inspectModeCanceled", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.inspectModeCanceled", value); + } + } + + /// + /// Disables domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Overlay.disable", dict); + } + + /// + /// Enables domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Overlay.enable", dict); + } + + partial void ValidateGetHighlightObjectForTest(int nodeId, bool? includeDistance = null, bool? includeStyle = null, CefSharp.DevTools.Overlay.ColorFormat? colorFormat = null, bool? showAccessibilityInfo = null); + /// + /// For testing. + /// + /// Id of the node to get highlight object for. + /// Whether to include distance info. + /// Whether to include style info. + /// The color format to get config with (default: hex). + /// Whether to show accessibility info (default: true). + /// returns System.Threading.Tasks.Task<GetHighlightObjectForTestResponse> + public System.Threading.Tasks.Task GetHighlightObjectForTestAsync(int nodeId, bool? includeDistance = null, bool? includeStyle = null, CefSharp.DevTools.Overlay.ColorFormat? colorFormat = null, bool? showAccessibilityInfo = null) + { + ValidateGetHighlightObjectForTest(nodeId, includeDistance, includeStyle, colorFormat, showAccessibilityInfo); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + if (includeDistance.HasValue) + { + dict.Add("includeDistance", includeDistance.Value); + } + + if (includeStyle.HasValue) + { + dict.Add("includeStyle", includeStyle.Value); + } + + if (colorFormat.HasValue) + { + dict.Add("colorFormat", EnumToString(colorFormat)); + } + + if (showAccessibilityInfo.HasValue) + { + dict.Add("showAccessibilityInfo", showAccessibilityInfo.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.getHighlightObjectForTest", dict); + } + + partial void ValidateGetGridHighlightObjectsForTest(int[] nodeIds); + /// + /// For Persistent Grid testing. + /// + /// Ids of the node to get highlight object for. + /// returns System.Threading.Tasks.Task<GetGridHighlightObjectsForTestResponse> + public System.Threading.Tasks.Task GetGridHighlightObjectsForTestAsync(int[] nodeIds) + { + ValidateGetGridHighlightObjectsForTest(nodeIds); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeIds", nodeIds); + return _client.ExecuteDevToolsMethodAsync("Overlay.getGridHighlightObjectsForTest", dict); + } + + partial void ValidateGetSourceOrderHighlightObjectForTest(int nodeId); + /// + /// For Source Order Viewer testing. + /// + /// Id of the node to highlight. + /// returns System.Threading.Tasks.Task<GetSourceOrderHighlightObjectForTestResponse> + public System.Threading.Tasks.Task GetSourceOrderHighlightObjectForTestAsync(int nodeId) + { + ValidateGetSourceOrderHighlightObjectForTest(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("Overlay.getSourceOrderHighlightObjectForTest", dict); + } + + /// + /// Hides any highlight. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HideHighlightAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Overlay.hideHighlight", dict); + } + + partial void ValidateHighlightNode(CefSharp.DevTools.Overlay.HighlightConfig highlightConfig, int? nodeId = null, int? backendNodeId = null, string objectId = null, string selector = null); + /// + /// Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or + /// objectId must be specified. + /// + /// A descriptor for the highlight appearance. + /// Identifier of the node to highlight. + /// Identifier of the backend node to highlight. + /// JavaScript object id of the node to be highlighted. + /// Selectors to highlight relevant nodes. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightNodeAsync(CefSharp.DevTools.Overlay.HighlightConfig highlightConfig, int? nodeId = null, int? backendNodeId = null, string objectId = null, string selector = null) + { + ValidateHighlightNode(highlightConfig, nodeId, backendNodeId, objectId, selector); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("highlightConfig", highlightConfig.ToDictionary()); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (!(string.IsNullOrEmpty(selector))) + { + dict.Add("selector", selector); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.highlightNode", dict); + } + + partial void ValidateHighlightQuad(double[] quad, CefSharp.DevTools.DOM.RGBA color = null, CefSharp.DevTools.DOM.RGBA outlineColor = null); + /// + /// Highlights given quad. Coordinates are absolute with respect to the main frame viewport. + /// + /// Quad to highlight + /// The highlight fill color (default: transparent). + /// The highlight outline color (default: transparent). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightQuadAsync(double[] quad, CefSharp.DevTools.DOM.RGBA color = null, CefSharp.DevTools.DOM.RGBA outlineColor = null) + { + ValidateHighlightQuad(quad, color, outlineColor); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("quad", quad); + if ((color) != (null)) + { + dict.Add("color", color.ToDictionary()); + } + + if ((outlineColor) != (null)) + { + dict.Add("outlineColor", outlineColor.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.highlightQuad", dict); + } + + partial void ValidateHighlightRect(int x, int y, int width, int height, CefSharp.DevTools.DOM.RGBA color = null, CefSharp.DevTools.DOM.RGBA outlineColor = null); + /// + /// Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport. + /// Issue: the method does not handle device pixel ratio (DPR) correctly. + /// The coordinates currently have to be adjusted by the client + /// if DPR is not 1 (see crbug.com/437807128). + /// + /// X coordinate + /// Y coordinate + /// Rectangle width + /// Rectangle height + /// The highlight fill color (default: transparent). + /// The highlight outline color (default: transparent). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightRectAsync(int x, int y, int width, int height, CefSharp.DevTools.DOM.RGBA color = null, CefSharp.DevTools.DOM.RGBA outlineColor = null) + { + ValidateHighlightRect(x, y, width, height, color, outlineColor); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + dict.Add("width", width); + dict.Add("height", height); + if ((color) != (null)) + { + dict.Add("color", color.ToDictionary()); + } + + if ((outlineColor) != (null)) + { + dict.Add("outlineColor", outlineColor.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.highlightRect", dict); + } + + partial void ValidateHighlightSourceOrder(CefSharp.DevTools.Overlay.SourceOrderConfig sourceOrderConfig, int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Highlights the source order of the children of the DOM node with given id or with the given + /// JavaScript object wrapper. Either nodeId or objectId must be specified. + /// + /// A descriptor for the appearance of the overlay drawing. + /// Identifier of the node to highlight. + /// Identifier of the backend node to highlight. + /// JavaScript object id of the node to be highlighted. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightSourceOrderAsync(CefSharp.DevTools.Overlay.SourceOrderConfig sourceOrderConfig, int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateHighlightSourceOrder(sourceOrderConfig, nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sourceOrderConfig", sourceOrderConfig.ToDictionary()); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.highlightSourceOrder", dict); + } + + partial void ValidateSetInspectMode(CefSharp.DevTools.Overlay.InspectMode mode, CefSharp.DevTools.Overlay.HighlightConfig highlightConfig = null); + /// + /// Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. + /// Backend then generates 'inspectNodeRequested' event upon element selection. + /// + /// Set an inspection mode. + /// A descriptor for the highlight appearance of hovered-over nodes. May be omitted if `enabled== false`. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInspectModeAsync(CefSharp.DevTools.Overlay.InspectMode mode, CefSharp.DevTools.Overlay.HighlightConfig highlightConfig = null) + { + ValidateSetInspectMode(mode, highlightConfig); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("mode", EnumToString(mode)); + if ((highlightConfig) != (null)) + { + dict.Add("highlightConfig", highlightConfig.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.setInspectMode", dict); + } + + partial void ValidateSetShowAdHighlights(bool show); + /// + /// Highlights owner element of all frames detected to be ads. + /// + /// True for showing ad highlights + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowAdHighlightsAsync(bool show) + { + ValidateSetShowAdHighlights(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowAdHighlights", dict); + } + + partial void ValidateSetPausedInDebuggerMessage(string message = null); + /// + /// SetPausedInDebuggerMessage + /// + /// The message to display, also triggers resume and step over controls. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPausedInDebuggerMessageAsync(string message = null) + { + ValidateSetPausedInDebuggerMessage(message); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(message))) + { + dict.Add("message", message); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.setPausedInDebuggerMessage", dict); + } + + partial void ValidateSetShowDebugBorders(bool show); + /// + /// Requests that backend shows debug borders on layers + /// + /// True for showing debug borders + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowDebugBordersAsync(bool show) + { + ValidateSetShowDebugBorders(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowDebugBorders", dict); + } + + partial void ValidateSetShowFPSCounter(bool show); + /// + /// Requests that backend shows the FPS counter + /// + /// True for showing the FPS counter + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowFPSCounterAsync(bool show) + { + ValidateSetShowFPSCounter(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowFPSCounter", dict); + } + + partial void ValidateSetShowGridOverlays(System.Collections.Generic.IList gridNodeHighlightConfigs); + /// + /// Highlight multiple elements with the CSS Grid overlay. + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowGridOverlaysAsync(System.Collections.Generic.IList gridNodeHighlightConfigs) + { + ValidateSetShowGridOverlays(gridNodeHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("gridNodeHighlightConfigs", gridNodeHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowGridOverlays", dict); + } + + partial void ValidateSetShowFlexOverlays(System.Collections.Generic.IList flexNodeHighlightConfigs); + /// + /// SetShowFlexOverlays + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowFlexOverlaysAsync(System.Collections.Generic.IList flexNodeHighlightConfigs) + { + ValidateSetShowFlexOverlays(flexNodeHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("flexNodeHighlightConfigs", flexNodeHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowFlexOverlays", dict); + } + + partial void ValidateSetShowScrollSnapOverlays(System.Collections.Generic.IList scrollSnapHighlightConfigs); + /// + /// SetShowScrollSnapOverlays + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowScrollSnapOverlaysAsync(System.Collections.Generic.IList scrollSnapHighlightConfigs) + { + ValidateSetShowScrollSnapOverlays(scrollSnapHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scrollSnapHighlightConfigs", scrollSnapHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowScrollSnapOverlays", dict); + } + + partial void ValidateSetShowContainerQueryOverlays(System.Collections.Generic.IList containerQueryHighlightConfigs); + /// + /// SetShowContainerQueryOverlays + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowContainerQueryOverlaysAsync(System.Collections.Generic.IList containerQueryHighlightConfigs) + { + ValidateSetShowContainerQueryOverlays(containerQueryHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("containerQueryHighlightConfigs", containerQueryHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowContainerQueryOverlays", dict); + } + + partial void ValidateSetShowInspectedElementAnchor(CefSharp.DevTools.Overlay.InspectedElementAnchorConfig inspectedElementAnchorConfig); + /// + /// SetShowInspectedElementAnchor + /// + /// Node identifier for which to show an anchor for. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowInspectedElementAnchorAsync(CefSharp.DevTools.Overlay.InspectedElementAnchorConfig inspectedElementAnchorConfig) + { + ValidateSetShowInspectedElementAnchor(inspectedElementAnchorConfig); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("inspectedElementAnchorConfig", inspectedElementAnchorConfig.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowInspectedElementAnchor", dict); + } + + partial void ValidateSetShowPaintRects(bool result); + /// + /// Requests that backend shows paint rectangles + /// + /// True for showing paint rectangles + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowPaintRectsAsync(bool result) + { + ValidateSetShowPaintRects(result); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("result", result); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowPaintRects", dict); + } + + partial void ValidateSetShowLayoutShiftRegions(bool result); + /// + /// Requests that backend shows layout shift regions + /// + /// True for showing layout shift regions + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowLayoutShiftRegionsAsync(bool result) + { + ValidateSetShowLayoutShiftRegions(result); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("result", result); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowLayoutShiftRegions", dict); + } + + partial void ValidateSetShowScrollBottleneckRects(bool show); + /// + /// Requests that backend shows scroll bottleneck rects + /// + /// True for showing scroll bottleneck rects + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowScrollBottleneckRectsAsync(bool show) + { + ValidateSetShowScrollBottleneckRects(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowScrollBottleneckRects", dict); + } + + partial void ValidateSetShowViewportSizeOnResize(bool show); + /// + /// Paints viewport size upon main frame resize. + /// + /// Whether to paint size or not. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowViewportSizeOnResizeAsync(bool show) + { + ValidateSetShowViewportSizeOnResize(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowViewportSizeOnResize", dict); + } + + partial void ValidateSetShowHinge(CefSharp.DevTools.Overlay.HingeConfig hingeConfig = null); + /// + /// Add a dual screen device hinge + /// + /// hinge data, null means hideHinge + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowHingeAsync(CefSharp.DevTools.Overlay.HingeConfig hingeConfig = null) + { + ValidateSetShowHinge(hingeConfig); + var dict = new System.Collections.Generic.Dictionary(); + if ((hingeConfig) != (null)) + { + dict.Add("hingeConfig", hingeConfig.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowHinge", dict); + } + + partial void ValidateSetShowIsolatedElements(System.Collections.Generic.IList isolatedElementHighlightConfigs); + /// + /// Show elements in isolation mode with overlays. + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowIsolatedElementsAsync(System.Collections.Generic.IList isolatedElementHighlightConfigs) + { + ValidateSetShowIsolatedElements(isolatedElementHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("isolatedElementHighlightConfigs", isolatedElementHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowIsolatedElements", dict); + } + + partial void ValidateSetShowWindowControlsOverlay(CefSharp.DevTools.Overlay.WindowControlsOverlayConfig windowControlsOverlayConfig = null); + /// + /// Show Window Controls Overlay for PWA + /// + /// Window Controls Overlay data, null means hide Window Controls Overlay + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowWindowControlsOverlayAsync(CefSharp.DevTools.Overlay.WindowControlsOverlayConfig windowControlsOverlayConfig = null) + { + ValidateSetShowWindowControlsOverlay(windowControlsOverlayConfig); + var dict = new System.Collections.Generic.Dictionary(); + if ((windowControlsOverlayConfig) != (null)) + { + dict.Add("windowControlsOverlayConfig", windowControlsOverlayConfig.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowWindowControlsOverlay", dict); + } + } +} + +namespace CefSharp.DevTools.PWA +{ + /// + /// GetOsAppStateResponse + /// + [DataContract] + public class GetOsAppStateResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int badgeCount + { + get; + set; + } + + /// + /// badgeCount + /// + public int BadgeCount + { + get + { + return badgeCount; + } + } + + [DataMember] + internal System.Collections.Generic.IList fileHandlers + { + get; + set; + } + + /// + /// fileHandlers + /// + public System.Collections.Generic.IList FileHandlers + { + get + { + return fileHandlers; + } + } + } +} + +namespace CefSharp.DevTools.PWA +{ + /// + /// LaunchResponse + /// + [DataContract] + public class LaunchResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string targetId + { + get; + set; + } + + /// + /// targetId + /// + public string TargetId + { + get + { + return targetId; + } + } + } +} + +namespace CefSharp.DevTools.PWA +{ + /// + /// LaunchFilesInAppResponse + /// + [DataContract] + public class LaunchFilesInAppResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] targetIds + { + get; + set; + } + + /// + /// targetIds + /// + public string[] TargetIds + { + get + { + return targetIds; + } + } + } +} + +namespace CefSharp.DevTools.PWA +{ + using System.Linq; + + /// + /// This domain allows interacting with the browser to control PWAs. + /// + public partial class PWAClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// PWA + /// + /// DevToolsClient + public PWAClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateGetOsAppState(string manifestId); + /// + /// Returns the following OS state for the given manifest id. + /// + /// The id from the webapp's manifest file, commonly it's the url of thesite installing the webapp. Seehttps://web.dev/learn/pwa/web-app-manifest. + /// returns System.Threading.Tasks.Task<GetOsAppStateResponse> + public System.Threading.Tasks.Task GetOsAppStateAsync(string manifestId) + { + ValidateGetOsAppState(manifestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + return _client.ExecuteDevToolsMethodAsync("PWA.getOsAppState", dict); + } + + partial void ValidateInstall(string manifestId, string installUrlOrBundleUrl = null); + /// + /// Installs the given manifest identity, optionally using the given installUrlOrBundleUrl + /// + /// IWA-specific install description: + /// manifestId corresponds to isolated-app:// + web_package::SignedWebBundleId + /// + /// File installation mode: + /// The installUrlOrBundleUrl can be either file:// or http(s):// pointing + /// to a signed web bundle (.swbn). In this case SignedWebBundleId must correspond to + /// The .swbn file's signing key. + /// + /// Dev proxy installation mode: + /// installUrlOrBundleUrl must be http(s):// that serves dev mode IWA. + /// web_package::SignedWebBundleId must be of type dev proxy. + /// + /// The advantage of dev proxy mode is that all changes to IWA + /// automatically will be reflected in the running app without + /// reinstallation. + /// + /// To generate bundle id for proxy mode: + /// 1. Generate 32 random bytes. + /// 2. Add a specific suffix at the end following the documentation + /// https://github.com/WICG/isolated-web-apps/blob/main/Scheme.md#suffix + /// 3. Encode the entire sequence using Base32 without padding. + /// + /// If Chrome is not in IWA dev + /// mode, the installation will fail, regardless of the state of the allowlist. + /// + /// manifestId + /// The location of the app or bundle overriding the one derived from themanifestId. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task InstallAsync(string manifestId, string installUrlOrBundleUrl = null) + { + ValidateInstall(manifestId, installUrlOrBundleUrl); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + if (!(string.IsNullOrEmpty(installUrlOrBundleUrl))) + { + dict.Add("installUrlOrBundleUrl", installUrlOrBundleUrl); + } + + return _client.ExecuteDevToolsMethodAsync("PWA.install", dict); + } + + partial void ValidateUninstall(string manifestId); + /// + /// Uninstalls the given manifest_id and closes any opened app windows. + /// + /// manifestId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UninstallAsync(string manifestId) + { + ValidateUninstall(manifestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + return _client.ExecuteDevToolsMethodAsync("PWA.uninstall", dict); + } + + partial void ValidateLaunch(string manifestId, string url = null); + /// + /// Launches the installed web app, or an url in the same web app instead of the + /// default start url if it is provided. Returns a page Target.TargetID which + /// can be used to attach to via Target.attachToTarget or similar APIs. + /// + /// manifestId + /// url + /// returns System.Threading.Tasks.Task<LaunchResponse> + public System.Threading.Tasks.Task LaunchAsync(string manifestId, string url = null) + { + ValidateLaunch(manifestId, url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + return _client.ExecuteDevToolsMethodAsync("PWA.launch", dict); + } + + partial void ValidateLaunchFilesInApp(string manifestId, string[] files); + /// + /// Opens one or more local files from an installed web app identified by its + /// manifestId. The web app needs to have file handlers registered to process + /// the files. The API returns one or more page Target.TargetIDs which can be + /// used to attach to via Target.attachToTarget or similar APIs. + /// If some files in the parameters cannot be handled by the web app, they will + /// be ignored. If none of the files can be handled, this API returns an error. + /// If no files are provided as the parameter, this API also returns an error. + /// + /// According to the definition of the file handlers in the manifest file, one + /// Target.TargetID may represent a page handling one or more files. The order + /// of the returned Target.TargetIDs is not guaranteed. + /// + /// TODO(crbug.com/339454034): Check the existences of the input files. + /// + /// manifestId + /// files + /// returns System.Threading.Tasks.Task<LaunchFilesInAppResponse> + public System.Threading.Tasks.Task LaunchFilesInAppAsync(string manifestId, string[] files) + { + ValidateLaunchFilesInApp(manifestId, files); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + dict.Add("files", files); + return _client.ExecuteDevToolsMethodAsync("PWA.launchFilesInApp", dict); + } + + partial void ValidateOpenCurrentPageInApp(string manifestId); + /// + /// Opens the current page in its web app identified by the manifest id, needs + /// to be called on a page target. This function returns immediately without + /// waiting for the app to finish loading. + /// + /// manifestId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task OpenCurrentPageInAppAsync(string manifestId) + { + ValidateOpenCurrentPageInApp(manifestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + return _client.ExecuteDevToolsMethodAsync("PWA.openCurrentPageInApp", dict); + } + + partial void ValidateChangeAppUserSettings(string manifestId, bool? linkCapturing = null, CefSharp.DevTools.PWA.DisplayMode? displayMode = null); + /// + /// Changes user settings of the web app identified by its manifestId. If the + /// app was not installed, this command returns an error. Unset parameters will + /// be ignored; unrecognized values will cause an error. + /// + /// Unlike the ones defined in the manifest files of the web apps, these + /// settings are provided by the browser and controlled by the users, they + /// impact the way the browser handling the web apps. + /// + /// See the comment of each parameter. + /// + /// manifestId + /// If user allows the links clicked on by the user in the app's scope, orextended scope if the manifest has scope extensions and the flags`DesktopPWAsLinkCapturingWithScopeExtensions` and`WebAppEnableScopeExtensions` are enabled.Note, the API does not support resetting the linkCapturing to theinitial value, uninstalling and installing the web app again will resetit.TODO(crbug.com/339453269): Setting this value on ChromeOS is notsupported yet. + /// displayMode + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ChangeAppUserSettingsAsync(string manifestId, bool? linkCapturing = null, CefSharp.DevTools.PWA.DisplayMode? displayMode = null) + { + ValidateChangeAppUserSettings(manifestId, linkCapturing, displayMode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + if (linkCapturing.HasValue) + { + dict.Add("linkCapturing", linkCapturing.Value); + } + + if (displayMode.HasValue) + { + dict.Add("displayMode", EnumToString(displayMode)); + } + + return _client.ExecuteDevToolsMethodAsync("PWA.changeAppUserSettings", dict); + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// AddScriptToEvaluateOnNewDocumentResponse + /// + [DataContract] + public class AddScriptToEvaluateOnNewDocumentResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string identifier + { + get; + set; + } + + /// + /// identifier + /// + public string Identifier + { + get + { + return identifier; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// CaptureScreenshotResponse + /// + [DataContract] + public class CaptureScreenshotResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string data + { + get; + set; + } + + /// + /// data + /// + public byte[] Data + { + get + { + return Convert(data); + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// CaptureSnapshotResponse + /// + [DataContract] + public class CaptureSnapshotResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string data + { + get; + set; + } + + /// + /// data + /// + public string Data + { + get + { + return data; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// CreateIsolatedWorldResponse + /// + [DataContract] + public class CreateIsolatedWorldResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int executionContextId + { + get; + set; + } + + /// + /// executionContextId + /// + public int ExecutionContextId + { + get + { + return executionContextId; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetAppManifestResponse + /// + [DataContract] + public class GetAppManifestResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string url + { + get; + set; + } + + /// + /// url + /// + public string Url + { + get + { + return url; + } + } + + [DataMember] + internal System.Collections.Generic.IList errors + { + get; + set; + } + + /// + /// errors + /// + public System.Collections.Generic.IList Errors + { + get + { + return errors; + } + } + + [DataMember] + internal string data + { + get; + set; + } + + /// + /// data + /// + public string Data + { + get + { + return data; + } + } + + [DataMember] + internal CefSharp.DevTools.Page.AppManifestParsedProperties parsed + { + get; + set; + } + + /// + /// parsed + /// + public CefSharp.DevTools.Page.AppManifestParsedProperties Parsed + { + get + { + return parsed; + } + } + + [DataMember] + internal CefSharp.DevTools.Page.WebAppManifest manifest + { + get; + set; + } + + /// + /// manifest + /// + public CefSharp.DevTools.Page.WebAppManifest Manifest + { + get + { + return manifest; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetInstallabilityErrorsResponse + /// + [DataContract] + public class GetInstallabilityErrorsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList installabilityErrors + { + get; + set; + } + + /// + /// installabilityErrors + /// + public System.Collections.Generic.IList InstallabilityErrors + { + get + { + return installabilityErrors; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetAppIdResponse + /// + [DataContract] + public class GetAppIdResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string appId + { + get; + set; + } + + /// + /// appId + /// + public string AppId + { + get + { + return appId; + } + } + + [DataMember] + internal string recommendedId + { + get; + set; + } + + /// + /// recommendedId + /// + public string RecommendedId + { + get + { + return recommendedId; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetAdScriptAncestryResponse + /// + [DataContract] + public class GetAdScriptAncestryResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Page.AdScriptAncestry adScriptAncestry + { + get; + set; + } + + /// + /// adScriptAncestry + /// + public CefSharp.DevTools.Page.AdScriptAncestry AdScriptAncestry + { + get + { + return adScriptAncestry; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetFrameTreeResponse + /// + [DataContract] + public class GetFrameTreeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Page.FrameTree frameTree + { + get; + set; + } + + /// + /// frameTree + /// + public CefSharp.DevTools.Page.FrameTree FrameTree + { + get + { + return frameTree; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetLayoutMetricsResponse + /// + [DataContract] + public class GetLayoutMetricsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Page.LayoutViewport layoutViewport + { + get; + set; + } + + /// + /// layoutViewport + /// + public CefSharp.DevTools.Page.LayoutViewport LayoutViewport + { + get + { + return layoutViewport; + } + } + + [DataMember] + internal CefSharp.DevTools.Page.VisualViewport visualViewport + { + get; + set; + } + + /// + /// visualViewport + /// + public CefSharp.DevTools.Page.VisualViewport VisualViewport + { + get + { + return visualViewport; + } + } + + [DataMember] + internal CefSharp.DevTools.DOM.Rect contentSize + { + get; + set; + } + + /// + /// contentSize + /// + public CefSharp.DevTools.DOM.Rect ContentSize + { + get + { + return contentSize; + } + } + + [DataMember] + internal CefSharp.DevTools.Page.LayoutViewport cssLayoutViewport + { + get; + set; + } + + /// + /// cssLayoutViewport + /// + public CefSharp.DevTools.Page.LayoutViewport CssLayoutViewport + { + get + { + return cssLayoutViewport; + } + } + + [DataMember] + internal CefSharp.DevTools.Page.VisualViewport cssVisualViewport + { + get; + set; + } + + /// + /// cssVisualViewport + /// + public CefSharp.DevTools.Page.VisualViewport CssVisualViewport + { + get + { + return cssVisualViewport; + } + } + + [DataMember] + internal CefSharp.DevTools.DOM.Rect cssContentSize + { + get; + set; + } + + /// + /// cssContentSize + /// + public CefSharp.DevTools.DOM.Rect CssContentSize + { + get + { + return cssContentSize; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetNavigationHistoryResponse + /// + [DataContract] + public class GetNavigationHistoryResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int currentIndex + { + get; + set; + } + + /// + /// currentIndex + /// + public int CurrentIndex + { + get + { + return currentIndex; + } + } + + [DataMember] + internal System.Collections.Generic.IList entries + { + get; + set; + } + + /// + /// entries + /// + public System.Collections.Generic.IList Entries + { + get + { + return entries; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetResourceContentResponse + /// + [DataContract] + public class GetResourceContentResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string content + { + get; + set; + } + + /// + /// content + /// + public string Content + { + get + { + return content; + } + } + + [DataMember] + internal bool base64Encoded + { + get; + set; + } + + /// + /// base64Encoded + /// + public bool Base64Encoded + { + get + { + return base64Encoded; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetResourceTreeResponse + /// + [DataContract] + public class GetResourceTreeResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Page.FrameResourceTree frameTree + { + get; + set; + } + + /// + /// frameTree + /// + public CefSharp.DevTools.Page.FrameResourceTree FrameTree + { + get + { + return frameTree; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// NavigateResponse + /// + [DataContract] + public class NavigateResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string frameId + { + get; + set; + } + + /// + /// frameId + /// + public string FrameId + { + get + { + return frameId; + } + } + + [DataMember] + internal string loaderId + { + get; + set; + } + + /// + /// loaderId + /// + public string LoaderId + { + get + { + return loaderId; + } + } + + [DataMember] + internal string errorText + { + get; + set; + } + + /// + /// errorText + /// + public string ErrorText + { + get + { + return errorText; + } + } + + [DataMember] + internal bool? isDownload + { + get; + set; + } + + /// + /// isDownload + /// + public bool? IsDownload + { + get + { + return isDownload; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// PrintToPDFResponse + /// + [DataContract] + public class PrintToPDFResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string data + { + get; + set; + } + + /// + /// data + /// + public byte[] Data + { + get + { + return Convert(data); + } + } + + [DataMember] + internal string stream + { + get; + set; + } + + /// + /// stream + /// + public string Stream + { + get + { + return stream; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// SearchInResourceResponse + /// + [DataContract] + public class SearchInResourceResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList result + { + get; + set; + } + + /// + /// result + /// + public System.Collections.Generic.IList Result + { + get + { + return result; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetPermissionsPolicyStateResponse + /// + [DataContract] + public class GetPermissionsPolicyStateResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList states + { + get; + set; + } + + /// + /// states + /// + public System.Collections.Generic.IList States + { + get + { + return states; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetOriginTrialsResponse + /// + [DataContract] + public class GetOriginTrialsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList originTrials + { + get; + set; + } + + /// + /// originTrials + /// + public System.Collections.Generic.IList OriginTrials + { + get + { + return originTrials; + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetAnnotatedPageContentResponse + /// + [DataContract] + public class GetAnnotatedPageContentResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string content + { + get; + set; + } + + /// + /// content + /// + public byte[] Content + { + get + { + return Convert(content); + } + } + } +} + +namespace CefSharp.DevTools.Page +{ + using System.Linq; + + /// + /// Image compression format (defaults to png). + /// + public enum CaptureScreenshotFormat + { + /// + /// jpeg + /// + [EnumMember(Value = ("jpeg"))] + Jpeg, + /// + /// png + /// + [EnumMember(Value = ("png"))] + Png, + /// + /// webp + /// + [EnumMember(Value = ("webp"))] + Webp + } + + /// + /// Format (defaults to mhtml). + /// + public enum CaptureSnapshotFormat + { + /// + /// mhtml + /// + [EnumMember(Value = ("mhtml"))] + Mhtml + } + + /// + /// return as stream + /// + public enum PrintToPDFTransferMode + { + /// + /// ReturnAsBase64 + /// + [EnumMember(Value = ("ReturnAsBase64"))] + ReturnAsBase64, + /// + /// ReturnAsStream + /// + [EnumMember(Value = ("ReturnAsStream"))] + ReturnAsStream + } + + /// + /// Image compression format. + /// + public enum StartScreencastFormat + { + /// + /// jpeg + /// + [EnumMember(Value = ("jpeg"))] + Jpeg, + /// + /// png + /// + [EnumMember(Value = ("png"))] + Png + } + + /// + /// Target lifecycle state + /// + public enum SetWebLifecycleStateState + { + /// + /// frozen + /// + [EnumMember(Value = ("frozen"))] + Frozen, + /// + /// active + /// + [EnumMember(Value = ("active"))] + Active + } + + /// + /// SetSPCTransactionModeMode + /// + public enum SetSPCTransactionModeMode + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// autoAccept + /// + [EnumMember(Value = ("autoAccept"))] + AutoAccept, + /// + /// autoChooseToAuthAnotherWay + /// + [EnumMember(Value = ("autoChooseToAuthAnotherWay"))] + AutoChooseToAuthAnotherWay, + /// + /// autoReject + /// + [EnumMember(Value = ("autoReject"))] + AutoReject, + /// + /// autoOptOut + /// + [EnumMember(Value = ("autoOptOut"))] + AutoOptOut + } + + /// + /// SetRPHRegistrationModeMode + /// + public enum SetRPHRegistrationModeMode + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// autoAccept + /// + [EnumMember(Value = ("autoAccept"))] + AutoAccept, + /// + /// autoReject + /// + [EnumMember(Value = ("autoReject"))] + AutoReject + } + + /// + /// Actions and events related to the inspected page belong to the page domain. + /// + public partial class PageClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Page + /// + /// DevToolsClient + public PageClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// DomContentEventFired + /// + public event System.EventHandler DomContentEventFired + { + add + { + _client.AddEventHandler("Page.domContentEventFired", value); + } + + remove + { + _client.RemoveEventHandler("Page.domContentEventFired", value); + } + } + + /// + /// Emitted only when `page.interceptFileChooser` is enabled. + /// + public event System.EventHandler FileChooserOpened + { + add + { + _client.AddEventHandler("Page.fileChooserOpened", value); + } + + remove + { + _client.RemoveEventHandler("Page.fileChooserOpened", value); + } + } + + /// + /// Fired when frame has been attached to its parent. + /// + public event System.EventHandler FrameAttached + { + add + { + _client.AddEventHandler("Page.frameAttached", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameAttached", value); + } + } + + /// + /// Fired when frame has been detached from its parent. + /// + public event System.EventHandler FrameDetached + { + add + { + _client.AddEventHandler("Page.frameDetached", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameDetached", value); + } + } + + /// + /// Fired before frame subtree is detached. Emitted before any frame of the + /// subtree is actually detached. + /// + public event System.EventHandler FrameSubtreeWillBeDetached + { + add + { + _client.AddEventHandler("Page.frameSubtreeWillBeDetached", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameSubtreeWillBeDetached", value); + } + } + + /// + /// Fired once navigation of the frame has completed. Frame is now associated with the new loader. + /// + public event System.EventHandler FrameNavigated + { + add + { + _client.AddEventHandler("Page.frameNavigated", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameNavigated", value); + } + } + + /// + /// Fired when opening document to write to. + /// + public event System.EventHandler DocumentOpened + { + add + { + _client.AddEventHandler("Page.documentOpened", value); + } + + remove + { + _client.RemoveEventHandler("Page.documentOpened", value); + } + } + + /// + /// FrameResized + /// + public event System.EventHandler FrameResized + { + add + { + _client.AddEventHandler("Page.frameResized", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameResized", value); + } + } + + /// + /// Fired when a navigation starts. This event is fired for both + /// renderer-initiated and browser-initiated navigations. For renderer-initiated + /// navigations, the event is fired after `frameRequestedNavigation`. + /// Navigation may still be cancelled after the event is issued. Multiple events + /// can be fired for a single navigation, for example, when a same-document + /// navigation becomes a cross-document navigation (such as in the case of a + /// frameset). + /// + public event System.EventHandler FrameStartedNavigating + { + add + { + _client.AddEventHandler("Page.frameStartedNavigating", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameStartedNavigating", value); + } + } + + /// + /// Fired when a renderer-initiated navigation is requested. + /// Navigation may still be cancelled after the event is issued. + /// + public event System.EventHandler FrameRequestedNavigation + { + add + { + _client.AddEventHandler("Page.frameRequestedNavigation", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameRequestedNavigation", value); + } + } + + /// + /// Fired when frame has started loading. + /// + public event System.EventHandler FrameStartedLoading + { + add + { + _client.AddEventHandler("Page.frameStartedLoading", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameStartedLoading", value); + } + } + + /// + /// Fired when frame has stopped loading. + /// + public event System.EventHandler FrameStoppedLoading + { + add + { + _client.AddEventHandler("Page.frameStoppedLoading", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameStoppedLoading", value); + } + } + + /// + /// Fired when interstitial page was hidden + /// + public event System.EventHandler InterstitialHidden + { + add + { + _client.AddEventHandler("Page.interstitialHidden", value); + } + + remove + { + _client.RemoveEventHandler("Page.interstitialHidden", value); + } + } + + /// + /// Fired when interstitial page was shown + /// + public event System.EventHandler InterstitialShown + { + add + { + _client.AddEventHandler("Page.interstitialShown", value); + } + + remove + { + _client.RemoveEventHandler("Page.interstitialShown", value); + } + } + + /// + /// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been + /// closed. + /// + public event System.EventHandler JavascriptDialogClosed + { + add + { + _client.AddEventHandler("Page.javascriptDialogClosed", value); + } + + remove + { + _client.RemoveEventHandler("Page.javascriptDialogClosed", value); + } + } + + /// + /// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to + /// open. + /// + public event System.EventHandler JavascriptDialogOpening + { + add + { + _client.AddEventHandler("Page.javascriptDialogOpening", value); + } + + remove + { + _client.RemoveEventHandler("Page.javascriptDialogOpening", value); + } + } + + /// + /// Fired for lifecycle events (navigation, load, paint, etc) in the current + /// target (including local frames). + /// + public event System.EventHandler LifecycleEvent + { + add + { + _client.AddEventHandler("Page.lifecycleEvent", value); + } + + remove + { + _client.RemoveEventHandler("Page.lifecycleEvent", value); + } + } + + /// + /// Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do + /// not assume any ordering with the Page.frameNavigated event. This event is fired only for + /// main-frame history navigation where the document changes (non-same-document navigations), + /// when bfcache navigation fails. + /// + public event System.EventHandler BackForwardCacheNotUsed + { + add + { + _client.AddEventHandler("Page.backForwardCacheNotUsed", value); + } + + remove + { + _client.RemoveEventHandler("Page.backForwardCacheNotUsed", value); + } + } + + /// + /// LoadEventFired + /// + public event System.EventHandler LoadEventFired + { + add + { + _client.AddEventHandler("Page.loadEventFired", value); + } + + remove + { + _client.RemoveEventHandler("Page.loadEventFired", value); + } + } + + /// + /// Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. + /// + public event System.EventHandler NavigatedWithinDocument + { + add + { + _client.AddEventHandler("Page.navigatedWithinDocument", value); + } + + remove + { + _client.RemoveEventHandler("Page.navigatedWithinDocument", value); + } + } + + /// + /// Compressed image data requested by the `startScreencast`. + /// + public event System.EventHandler ScreencastFrame + { + add + { + _client.AddEventHandler("Page.screencastFrame", value); + } + + remove + { + _client.RemoveEventHandler("Page.screencastFrame", value); + } + } + + /// + /// Fired when the page with currently enabled screencast was shown or hidden `. + /// + public event System.EventHandler ScreencastVisibilityChanged + { + add + { + _client.AddEventHandler("Page.screencastVisibilityChanged", value); + } + + remove + { + _client.RemoveEventHandler("Page.screencastVisibilityChanged", value); + } + } + + /// + /// Fired when a new window is going to be opened, via window.open(), link click, form submission, + /// etc. + /// + public event System.EventHandler WindowOpen + { + add + { + _client.AddEventHandler("Page.windowOpen", value); + } + + remove + { + _client.RemoveEventHandler("Page.windowOpen", value); + } + } + + /// + /// Issued for every compilation cache generated. + /// + public event System.EventHandler CompilationCacheProduced + { + add + { + _client.AddEventHandler("Page.compilationCacheProduced", value); + } + + remove + { + _client.RemoveEventHandler("Page.compilationCacheProduced", value); + } + } + + partial void ValidateAddScriptToEvaluateOnNewDocument(string source, string worldName = null, bool? includeCommandLineAPI = null, bool? runImmediately = null); + /// + /// Evaluates given script in every frame upon creation (before loading frame's scripts). + /// + /// source + /// If specified, creates an isolated world with the given name and evaluates given script in it.This world name will be used as the ExecutionContextDescription::name when the correspondingevent is emitted. + /// Specifies whether command line API should be available to the script, defaultsto false. + /// If true, runs the script immediately on existing execution contexts or worlds.Default: false. + /// returns System.Threading.Tasks.Task<AddScriptToEvaluateOnNewDocumentResponse> + public System.Threading.Tasks.Task AddScriptToEvaluateOnNewDocumentAsync(string source, string worldName = null, bool? includeCommandLineAPI = null, bool? runImmediately = null) + { + ValidateAddScriptToEvaluateOnNewDocument(source, worldName, includeCommandLineAPI, runImmediately); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("source", source); + if (!(string.IsNullOrEmpty(worldName))) + { + dict.Add("worldName", worldName); + } + + if (includeCommandLineAPI.HasValue) + { + dict.Add("includeCommandLineAPI", includeCommandLineAPI.Value); + } + + if (runImmediately.HasValue) + { + dict.Add("runImmediately", runImmediately.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.addScriptToEvaluateOnNewDocument", dict); + } + + /// + /// Brings page to front (activates tab). + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task BringToFrontAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.bringToFront", dict); + } + + partial void ValidateCaptureScreenshot(CefSharp.DevTools.Page.CaptureScreenshotFormat? format = null, int? quality = null, CefSharp.DevTools.Page.Viewport clip = null, bool? fromSurface = null, bool? captureBeyondViewport = null, bool? optimizeForSpeed = null); + /// + /// Capture page screenshot. + /// + /// Image compression format (defaults to png). + /// Compression quality from range [0..100] (jpeg only). + /// Capture the screenshot of a given region only. + /// Capture the screenshot from the surface, rather than the view. Defaults to true. + /// Capture the screenshot beyond the viewport. Defaults to false. + /// Optimize image encoding for speed, not for resulting size (defaults to false) + /// returns System.Threading.Tasks.Task<CaptureScreenshotResponse> + public System.Threading.Tasks.Task CaptureScreenshotAsync(CefSharp.DevTools.Page.CaptureScreenshotFormat? format = null, int? quality = null, CefSharp.DevTools.Page.Viewport clip = null, bool? fromSurface = null, bool? captureBeyondViewport = null, bool? optimizeForSpeed = null) + { + ValidateCaptureScreenshot(format, quality, clip, fromSurface, captureBeyondViewport, optimizeForSpeed); + var dict = new System.Collections.Generic.Dictionary(); + if (format.HasValue) + { + dict.Add("format", EnumToString(format)); + } + + if (quality.HasValue) + { + dict.Add("quality", quality.Value); + } + + if ((clip) != (null)) + { + dict.Add("clip", clip.ToDictionary()); + } + + if (fromSurface.HasValue) + { + dict.Add("fromSurface", fromSurface.Value); + } + + if (captureBeyondViewport.HasValue) + { + dict.Add("captureBeyondViewport", captureBeyondViewport.Value); + } + + if (optimizeForSpeed.HasValue) + { + dict.Add("optimizeForSpeed", optimizeForSpeed.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.captureScreenshot", dict); + } + + partial void ValidateCaptureSnapshot(CefSharp.DevTools.Page.CaptureSnapshotFormat? format = null); + /// + /// Returns a snapshot of the page as a string. For MHTML format, the serialization includes + /// iframes, shadow DOM, external resources, and element-inline styles. + /// + /// Format (defaults to mhtml). + /// returns System.Threading.Tasks.Task<CaptureSnapshotResponse> + public System.Threading.Tasks.Task CaptureSnapshotAsync(CefSharp.DevTools.Page.CaptureSnapshotFormat? format = null) + { + ValidateCaptureSnapshot(format); + var dict = new System.Collections.Generic.Dictionary(); + if (format.HasValue) + { + dict.Add("format", EnumToString(format)); + } + + return _client.ExecuteDevToolsMethodAsync("Page.captureSnapshot", dict); + } + + partial void ValidateCreateIsolatedWorld(string frameId, string worldName = null, bool? grantUniveralAccess = null); + /// + /// Creates an isolated world for the given frame. + /// + /// Id of the frame in which the isolated world should be created. + /// An optional name which is reported in the Execution Context. + /// Whether or not universal access should be granted to the isolated world. This is a powerfuloption, use with caution. + /// returns System.Threading.Tasks.Task<CreateIsolatedWorldResponse> + public System.Threading.Tasks.Task CreateIsolatedWorldAsync(string frameId, string worldName = null, bool? grantUniveralAccess = null) + { + ValidateCreateIsolatedWorld(frameId, worldName, grantUniveralAccess); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + if (!(string.IsNullOrEmpty(worldName))) + { + dict.Add("worldName", worldName); + } + + if (grantUniveralAccess.HasValue) + { + dict.Add("grantUniveralAccess", grantUniveralAccess.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.createIsolatedWorld", dict); + } + + /// + /// Disables page domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.disable", dict); + } + + partial void ValidateEnable(bool? enableFileChooserOpenedEvent = null); + /// + /// Enables page domain notifications. + /// + /// If true, the `Page.fileChooserOpened` event will be emitted regardless of the state set by`Page.setInterceptFileChooserDialog` command (default: false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(bool? enableFileChooserOpenedEvent = null) + { + ValidateEnable(enableFileChooserOpenedEvent); + var dict = new System.Collections.Generic.Dictionary(); + if (enableFileChooserOpenedEvent.HasValue) + { + dict.Add("enableFileChooserOpenedEvent", enableFileChooserOpenedEvent.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.enable", dict); + } + + partial void ValidateGetAppManifest(string manifestId = null); + /// + /// Gets the processed manifest for this current document. + /// This API always waits for the manifest to be loaded. + /// If manifestId is provided, and it does not match the manifest of the + /// current document, this API errors out. + /// If there is not a loaded page, this API errors out immediately. + /// + /// manifestId + /// returns System.Threading.Tasks.Task<GetAppManifestResponse> + public System.Threading.Tasks.Task GetAppManifestAsync(string manifestId = null) + { + ValidateGetAppManifest(manifestId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(manifestId))) + { + dict.Add("manifestId", manifestId); + } + + return _client.ExecuteDevToolsMethodAsync("Page.getAppManifest", dict); + } + + /// + /// GetInstallabilityErrors + /// + /// returns System.Threading.Tasks.Task<GetInstallabilityErrorsResponse> + public System.Threading.Tasks.Task GetInstallabilityErrorsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getInstallabilityErrors", dict); + } + + /// + /// Returns the unique (PWA) app id. + /// Only returns values if the feature flag 'WebAppEnableManifestId' is enabled + /// + /// returns System.Threading.Tasks.Task<GetAppIdResponse> + public System.Threading.Tasks.Task GetAppIdAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getAppId", dict); + } + + partial void ValidateGetAdScriptAncestry(string frameId); + /// + /// GetAdScriptAncestry + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetAdScriptAncestryResponse> + public System.Threading.Tasks.Task GetAdScriptAncestryAsync(string frameId) + { + ValidateGetAdScriptAncestry(frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + return _client.ExecuteDevToolsMethodAsync("Page.getAdScriptAncestry", dict); + } + + /// + /// Returns present frame tree structure. + /// + /// returns System.Threading.Tasks.Task<GetFrameTreeResponse> + public System.Threading.Tasks.Task GetFrameTreeAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getFrameTree", dict); + } + + /// + /// Returns metrics relating to the layouting of the page, such as viewport bounds/scale. + /// + /// returns System.Threading.Tasks.Task<GetLayoutMetricsResponse> + public System.Threading.Tasks.Task GetLayoutMetricsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getLayoutMetrics", dict); + } + + /// + /// Returns navigation history for the current page. + /// + /// returns System.Threading.Tasks.Task<GetNavigationHistoryResponse> + public System.Threading.Tasks.Task GetNavigationHistoryAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getNavigationHistory", dict); + } + + /// + /// Resets navigation history for the current page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetNavigationHistoryAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.resetNavigationHistory", dict); + } + + partial void ValidateGetResourceContent(string frameId, string url); + /// + /// Returns content of the given resource. + /// + /// Frame id to get resource for. + /// URL of the resource to get content for. + /// returns System.Threading.Tasks.Task<GetResourceContentResponse> + public System.Threading.Tasks.Task GetResourceContentAsync(string frameId, string url) + { + ValidateGetResourceContent(frameId, url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + dict.Add("url", url); + return _client.ExecuteDevToolsMethodAsync("Page.getResourceContent", dict); + } + + /// + /// Returns present frame / resource tree structure. + /// + /// returns System.Threading.Tasks.Task<GetResourceTreeResponse> + public System.Threading.Tasks.Task GetResourceTreeAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getResourceTree", dict); + } + + partial void ValidateHandleJavaScriptDialog(bool accept, string promptText = null); + /// + /// Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). + /// + /// Whether to accept or dismiss the dialog. + /// The text to enter into the dialog prompt before accepting. Used only if this is a promptdialog. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HandleJavaScriptDialogAsync(bool accept, string promptText = null) + { + ValidateHandleJavaScriptDialog(accept, promptText); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("accept", accept); + if (!(string.IsNullOrEmpty(promptText))) + { + dict.Add("promptText", promptText); + } + + return _client.ExecuteDevToolsMethodAsync("Page.handleJavaScriptDialog", dict); + } + + partial void ValidateNavigate(string url, string referrer = null, CefSharp.DevTools.Page.TransitionType? transitionType = null, string frameId = null, CefSharp.DevTools.Page.ReferrerPolicy? referrerPolicy = null); + /// + /// Navigates current page to the given URL. + /// + /// URL to navigate the page to. + /// Referrer URL. + /// Intended transition type. + /// Frame id to navigate, if not specified navigates the top frame. + /// Referrer-policy used for the navigation. + /// returns System.Threading.Tasks.Task<NavigateResponse> + public System.Threading.Tasks.Task NavigateAsync(string url, string referrer = null, CefSharp.DevTools.Page.TransitionType? transitionType = null, string frameId = null, CefSharp.DevTools.Page.ReferrerPolicy? referrerPolicy = null) + { + ValidateNavigate(url, referrer, transitionType, frameId, referrerPolicy); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + if (!(string.IsNullOrEmpty(referrer))) + { + dict.Add("referrer", referrer); + } + + if (transitionType.HasValue) + { + dict.Add("transitionType", EnumToString(transitionType)); + } + + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + if (referrerPolicy.HasValue) + { + dict.Add("referrerPolicy", EnumToString(referrerPolicy)); + } + + return _client.ExecuteDevToolsMethodAsync("Page.navigate", dict); + } + + partial void ValidateNavigateToHistoryEntry(int entryId); + /// + /// Navigates current page to the given history entry. + /// + /// Unique id of the entry to navigate to. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task NavigateToHistoryEntryAsync(int entryId) + { + ValidateNavigateToHistoryEntry(entryId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("entryId", entryId); + return _client.ExecuteDevToolsMethodAsync("Page.navigateToHistoryEntry", dict); + } + + partial void ValidatePrintToPDF(bool? landscape = null, bool? displayHeaderFooter = null, bool? printBackground = null, double? scale = null, double? paperWidth = null, double? paperHeight = null, double? marginTop = null, double? marginBottom = null, double? marginLeft = null, double? marginRight = null, string pageRanges = null, string headerTemplate = null, string footerTemplate = null, bool? preferCSSPageSize = null, CefSharp.DevTools.Page.PrintToPDFTransferMode? transferMode = null, bool? generateTaggedPDF = null, bool? generateDocumentOutline = null); + /// + /// Print page as PDF. + /// + /// Paper orientation. Defaults to false. + /// Display header and footer. Defaults to false. + /// Print background graphics. Defaults to false. + /// Scale of the webpage rendering. Defaults to 1. + /// Paper width in inches. Defaults to 8.5 inches. + /// Paper height in inches. Defaults to 11 inches. + /// Top margin in inches. Defaults to 1cm (~0.4 inches). + /// Bottom margin in inches. Defaults to 1cm (~0.4 inches). + /// Left margin in inches. Defaults to 1cm (~0.4 inches). + /// Right margin in inches. Defaults to 1cm (~0.4 inches). + /// Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages areprinted in the document order, not in the order specified, and nomore than once.Defaults to empty string, which implies the entire document is printed.The page numbers are quietly capped to actual page count of thedocument, and ranges beyond the end of the document are ignored.If this results in no pages to print, an error is reported.It is an error to specify a range with start greater than end. + /// HTML template for the print header. Should be valid HTML markup with followingclasses used to inject printing values into them:- `date`: formatted print date- `title`: document title- `url`: document location- `pageNumber`: current page number- `totalPages`: total pages in the documentFor example, `<span class=title> </span>` would generate span containing the title. + /// HTML template for the print footer. Should use the same format as the `headerTemplate`. + /// Whether or not to prefer page size as defined by css. Defaults to false,in which case the content will be scaled to fit the paper size. + /// return as stream + /// Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice. + /// Whether or not to embed the document outline into the PDF. + /// returns System.Threading.Tasks.Task<PrintToPDFResponse> + public System.Threading.Tasks.Task PrintToPDFAsync(bool? landscape = null, bool? displayHeaderFooter = null, bool? printBackground = null, double? scale = null, double? paperWidth = null, double? paperHeight = null, double? marginTop = null, double? marginBottom = null, double? marginLeft = null, double? marginRight = null, string pageRanges = null, string headerTemplate = null, string footerTemplate = null, bool? preferCSSPageSize = null, CefSharp.DevTools.Page.PrintToPDFTransferMode? transferMode = null, bool? generateTaggedPDF = null, bool? generateDocumentOutline = null) + { + ValidatePrintToPDF(landscape, displayHeaderFooter, printBackground, scale, paperWidth, paperHeight, marginTop, marginBottom, marginLeft, marginRight, pageRanges, headerTemplate, footerTemplate, preferCSSPageSize, transferMode, generateTaggedPDF, generateDocumentOutline); + var dict = new System.Collections.Generic.Dictionary(); + if (landscape.HasValue) + { + dict.Add("landscape", landscape.Value); + } + + if (displayHeaderFooter.HasValue) + { + dict.Add("displayHeaderFooter", displayHeaderFooter.Value); + } + + if (printBackground.HasValue) + { + dict.Add("printBackground", printBackground.Value); + } + + if (scale.HasValue) + { + dict.Add("scale", scale.Value); + } + + if (paperWidth.HasValue) + { + dict.Add("paperWidth", paperWidth.Value); + } + + if (paperHeight.HasValue) + { + dict.Add("paperHeight", paperHeight.Value); + } + + if (marginTop.HasValue) + { + dict.Add("marginTop", marginTop.Value); + } + + if (marginBottom.HasValue) + { + dict.Add("marginBottom", marginBottom.Value); + } + + if (marginLeft.HasValue) + { + dict.Add("marginLeft", marginLeft.Value); + } + + if (marginRight.HasValue) + { + dict.Add("marginRight", marginRight.Value); + } + + if (!(string.IsNullOrEmpty(pageRanges))) + { + dict.Add("pageRanges", pageRanges); + } + + if (!(string.IsNullOrEmpty(headerTemplate))) + { + dict.Add("headerTemplate", headerTemplate); + } + + if (!(string.IsNullOrEmpty(footerTemplate))) + { + dict.Add("footerTemplate", footerTemplate); + } + + if (preferCSSPageSize.HasValue) + { + dict.Add("preferCSSPageSize", preferCSSPageSize.Value); + } + + if (transferMode.HasValue) + { + dict.Add("transferMode", EnumToString(transferMode)); + } + + if (generateTaggedPDF.HasValue) + { + dict.Add("generateTaggedPDF", generateTaggedPDF.Value); + } + + if (generateDocumentOutline.HasValue) + { + dict.Add("generateDocumentOutline", generateDocumentOutline.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.printToPDF", dict); + } + + partial void ValidateReload(bool? ignoreCache = null, string scriptToEvaluateOnLoad = null, string loaderId = null); + /// + /// Reloads given page optionally ignoring the cache. + /// + /// If true, browser cache is ignored (as if the user pressed Shift+refresh). + /// If set, the script will be injected into all frames of the inspected page after reload.Argument will be ignored if reloading dataURL origin. + /// If set, an error will be thrown if the target page's main frame'sloader id does not match the provided id. This prevents accidentallyreloading an unintended target in case there's a racing navigation. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReloadAsync(bool? ignoreCache = null, string scriptToEvaluateOnLoad = null, string loaderId = null) + { + ValidateReload(ignoreCache, scriptToEvaluateOnLoad, loaderId); + var dict = new System.Collections.Generic.Dictionary(); + if (ignoreCache.HasValue) + { + dict.Add("ignoreCache", ignoreCache.Value); + } + + if (!(string.IsNullOrEmpty(scriptToEvaluateOnLoad))) + { + dict.Add("scriptToEvaluateOnLoad", scriptToEvaluateOnLoad); + } + + if (!(string.IsNullOrEmpty(loaderId))) + { + dict.Add("loaderId", loaderId); + } + + return _client.ExecuteDevToolsMethodAsync("Page.reload", dict); + } + + partial void ValidateRemoveScriptToEvaluateOnNewDocument(string identifier); + /// + /// Removes given script from the list. + /// + /// identifier + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveScriptToEvaluateOnNewDocumentAsync(string identifier) + { + ValidateRemoveScriptToEvaluateOnNewDocument(identifier); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("identifier", identifier); + return _client.ExecuteDevToolsMethodAsync("Page.removeScriptToEvaluateOnNewDocument", dict); + } + + partial void ValidateScreencastFrameAck(int sessionId); + /// + /// Acknowledges that a screencast frame has been received by the frontend. + /// + /// Frame number. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ScreencastFrameAckAsync(int sessionId) + { + ValidateScreencastFrameAck(sessionId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sessionId", sessionId); + return _client.ExecuteDevToolsMethodAsync("Page.screencastFrameAck", dict); + } + + partial void ValidateSearchInResource(string frameId, string url, string query, bool? caseSensitive = null, bool? isRegex = null); + /// + /// Searches for given string in resource content. + /// + /// Frame id for resource to search in. + /// URL of the resource to search in. + /// String to search for. + /// If true, search is case sensitive. + /// If true, treats string parameter as regex. + /// returns System.Threading.Tasks.Task<SearchInResourceResponse> + public System.Threading.Tasks.Task SearchInResourceAsync(string frameId, string url, string query, bool? caseSensitive = null, bool? isRegex = null) + { + ValidateSearchInResource(frameId, url, query, caseSensitive, isRegex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + dict.Add("url", url); + dict.Add("query", query); + if (caseSensitive.HasValue) + { + dict.Add("caseSensitive", caseSensitive.Value); + } + + if (isRegex.HasValue) + { + dict.Add("isRegex", isRegex.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.searchInResource", dict); + } + + partial void ValidateSetAdBlockingEnabled(bool enabled); + /// + /// Enable Chrome's experimental ad filter on all sites. + /// + /// Whether to block ads. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAdBlockingEnabledAsync(bool enabled) + { + ValidateSetAdBlockingEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Page.setAdBlockingEnabled", dict); + } + + partial void ValidateSetBypassCSP(bool enabled); + /// + /// Enable page Content Security Policy by-passing. + /// + /// Whether to bypass page CSP. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBypassCSPAsync(bool enabled) + { + ValidateSetBypassCSP(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Page.setBypassCSP", dict); + } + + partial void ValidateGetPermissionsPolicyState(string frameId); + /// + /// Get Permissions Policy state on given frame. + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetPermissionsPolicyStateResponse> + public System.Threading.Tasks.Task GetPermissionsPolicyStateAsync(string frameId) + { + ValidateGetPermissionsPolicyState(frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + return _client.ExecuteDevToolsMethodAsync("Page.getPermissionsPolicyState", dict); + } + + partial void ValidateGetOriginTrials(string frameId); + /// + /// Get Origin Trials on given frame. + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetOriginTrialsResponse> + public System.Threading.Tasks.Task GetOriginTrialsAsync(string frameId) + { + ValidateGetOriginTrials(frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + return _client.ExecuteDevToolsMethodAsync("Page.getOriginTrials", dict); + } + + partial void ValidateSetFontFamilies(CefSharp.DevTools.Page.FontFamilies fontFamilies, System.Collections.Generic.IList forScripts = null); + /// + /// Set generic font families. + /// + /// Specifies font families to set. If a font family is not specified, it won't be changed. + /// Specifies font families to set for individual scripts. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetFontFamiliesAsync(CefSharp.DevTools.Page.FontFamilies fontFamilies, System.Collections.Generic.IList forScripts = null) + { + ValidateSetFontFamilies(fontFamilies, forScripts); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("fontFamilies", fontFamilies.ToDictionary()); + if ((forScripts) != (null)) + { + dict.Add("forScripts", forScripts.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Page.setFontFamilies", dict); + } + + partial void ValidateSetFontSizes(CefSharp.DevTools.Page.FontSizes fontSizes); + /// + /// Set default font sizes. + /// + /// Specifies font sizes to set. If a font size is not specified, it won't be changed. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetFontSizesAsync(CefSharp.DevTools.Page.FontSizes fontSizes) + { + ValidateSetFontSizes(fontSizes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("fontSizes", fontSizes.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Page.setFontSizes", dict); + } + + partial void ValidateSetDocumentContent(string frameId, string html); + /// + /// Sets given markup as the document's HTML. + /// + /// Frame id to set HTML for. + /// HTML content to set. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDocumentContentAsync(string frameId, string html) + { + ValidateSetDocumentContent(frameId, html); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + dict.Add("html", html); + return _client.ExecuteDevToolsMethodAsync("Page.setDocumentContent", dict); + } + + partial void ValidateSetLifecycleEventsEnabled(bool enabled); + /// + /// Controls whether page will emit lifecycle events. + /// + /// If true, starts emitting lifecycle events. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetLifecycleEventsEnabledAsync(bool enabled) + { + ValidateSetLifecycleEventsEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Page.setLifecycleEventsEnabled", dict); + } + + partial void ValidateStartScreencast(CefSharp.DevTools.Page.StartScreencastFormat? format = null, int? quality = null, int? maxWidth = null, int? maxHeight = null, int? everyNthFrame = null); + /// + /// Starts sending each frame using the `screencastFrame` event. + /// + /// Image compression format. + /// Compression quality from range [0..100]. + /// Maximum screenshot width. + /// Maximum screenshot height. + /// Send every n-th frame. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartScreencastAsync(CefSharp.DevTools.Page.StartScreencastFormat? format = null, int? quality = null, int? maxWidth = null, int? maxHeight = null, int? everyNthFrame = null) + { + ValidateStartScreencast(format, quality, maxWidth, maxHeight, everyNthFrame); + var dict = new System.Collections.Generic.Dictionary(); + if (format.HasValue) + { + dict.Add("format", EnumToString(format)); + } + + if (quality.HasValue) + { + dict.Add("quality", quality.Value); + } + + if (maxWidth.HasValue) + { + dict.Add("maxWidth", maxWidth.Value); + } + + if (maxHeight.HasValue) + { + dict.Add("maxHeight", maxHeight.Value); + } + + if (everyNthFrame.HasValue) + { + dict.Add("everyNthFrame", everyNthFrame.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.startScreencast", dict); + } + + /// + /// Force the page stop all navigations and pending resource fetches. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopLoadingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.stopLoading", dict); + } + + /// + /// Crashes renderer on the IO thread, generates minidumps. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CrashAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.crash", dict); + } + + /// + /// Tries to close page, running its beforeunload hooks, if any. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CloseAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.close", dict); + } + + partial void ValidateSetWebLifecycleState(CefSharp.DevTools.Page.SetWebLifecycleStateState state); + /// + /// Tries to update the web lifecycle state of the page. + /// It will transition the page to the given state according to: + /// https://github.com/WICG/web-lifecycle/ + /// + /// Target lifecycle state + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetWebLifecycleStateAsync(CefSharp.DevTools.Page.SetWebLifecycleStateState state) + { + ValidateSetWebLifecycleState(state); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("state", EnumToString(state)); + return _client.ExecuteDevToolsMethodAsync("Page.setWebLifecycleState", dict); + } + + /// + /// Stops sending each frame in the `screencastFrame`. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopScreencastAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.stopScreencast", dict); + } + + partial void ValidateProduceCompilationCache(System.Collections.Generic.IList scripts); + /// + /// Requests backend to produce compilation cache for the specified scripts. + /// `scripts` are appended to the list of scripts for which the cache + /// would be produced. The list may be reset during page navigation. + /// When script with a matching URL is encountered, the cache is optionally + /// produced upon backend discretion, based on internal heuristics. + /// See also: `Page.compilationCacheProduced`. + /// + /// scripts + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ProduceCompilationCacheAsync(System.Collections.Generic.IList scripts) + { + ValidateProduceCompilationCache(scripts); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scripts", scripts.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Page.produceCompilationCache", dict); + } + + partial void ValidateAddCompilationCache(string url, byte[] data); + /// + /// Seeds compilation cache for given url. Compilation cache does not survive + /// cross-process navigation. + /// + /// url + /// Base64-encoded data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddCompilationCacheAsync(string url, byte[] data) + { + ValidateAddCompilationCache(url, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + dict.Add("data", ToBase64String(data)); + return _client.ExecuteDevToolsMethodAsync("Page.addCompilationCache", dict); + } + + /// + /// Clears seeded compilation cache. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearCompilationCacheAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.clearCompilationCache", dict); + } + + partial void ValidateSetSPCTransactionMode(CefSharp.DevTools.Page.SetSPCTransactionModeMode mode); + /// + /// Sets the Secure Payment Confirmation transaction mode. + /// https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode + /// + /// mode + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSPCTransactionModeAsync(CefSharp.DevTools.Page.SetSPCTransactionModeMode mode) + { + ValidateSetSPCTransactionMode(mode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("mode", EnumToString(mode)); + return _client.ExecuteDevToolsMethodAsync("Page.setSPCTransactionMode", dict); + } + + partial void ValidateSetRPHRegistrationMode(CefSharp.DevTools.Page.SetRPHRegistrationModeMode mode); + /// + /// Extensions for Custom Handlers API: + /// https://html.spec.whatwg.org/multipage/system-state.html#rph-automation + /// + /// mode + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetRPHRegistrationModeAsync(CefSharp.DevTools.Page.SetRPHRegistrationModeMode mode) + { + ValidateSetRPHRegistrationMode(mode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("mode", EnumToString(mode)); + return _client.ExecuteDevToolsMethodAsync("Page.setRPHRegistrationMode", dict); + } + + partial void ValidateGenerateTestReport(string message, string group = null); + /// + /// Generates a report for testing. + /// + /// Message to be displayed in the report. + /// Specifies the endpoint group to deliver the report to. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task GenerateTestReportAsync(string message, string group = null) + { + ValidateGenerateTestReport(message, group); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("message", message); + if (!(string.IsNullOrEmpty(group))) + { + dict.Add("group", group); + } + + return _client.ExecuteDevToolsMethodAsync("Page.generateTestReport", dict); + } + + /// + /// Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task WaitForDebuggerAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.waitForDebugger", dict); + } + + partial void ValidateSetInterceptFileChooserDialog(bool enabled, bool? cancel = null); + /// + /// Intercept file chooser requests and transfer control to protocol clients. + /// When file chooser interception is enabled, native file chooser dialog is not shown. + /// Instead, a protocol event `Page.fileChooserOpened` is emitted. + /// + /// enabled + /// If true, cancels the dialog by emitting relevant events (if any)in addition to not showing it if the interception is enabled(default: false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInterceptFileChooserDialogAsync(bool enabled, bool? cancel = null) + { + ValidateSetInterceptFileChooserDialog(enabled, cancel); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + if (cancel.HasValue) + { + dict.Add("cancel", cancel.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.setInterceptFileChooserDialog", dict); + } + + partial void ValidateSetPrerenderingAllowed(bool isAllowed); + /// + /// Enable/disable prerendering manually. + /// + /// This command is a short-term solution for https://crbug.com/1440085. + /// See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA + /// for more details. + /// + /// TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets. + /// + /// isAllowed + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPrerenderingAllowedAsync(bool isAllowed) + { + ValidateSetPrerenderingAllowed(isAllowed); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("isAllowed", isAllowed); + return _client.ExecuteDevToolsMethodAsync("Page.setPrerenderingAllowed", dict); + } + + partial void ValidateGetAnnotatedPageContent(bool? includeActionableInformation = null); + /// + /// Get the annotated page content for the main frame. + /// This is an experimental command that is subject to change. + /// + /// Whether to include actionable information. Defaults to true. + /// returns System.Threading.Tasks.Task<GetAnnotatedPageContentResponse> + public System.Threading.Tasks.Task GetAnnotatedPageContentAsync(bool? includeActionableInformation = null) + { + ValidateGetAnnotatedPageContent(includeActionableInformation); + var dict = new System.Collections.Generic.Dictionary(); + if (includeActionableInformation.HasValue) + { + dict.Add("includeActionableInformation", includeActionableInformation.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.getAnnotatedPageContent", dict); + } + } +} + +namespace CefSharp.DevTools.Performance +{ + /// + /// GetMetricsResponse + /// + [DataContract] + public class GetMetricsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList metrics + { + get; + set; + } + + /// + /// metrics + /// + public System.Collections.Generic.IList Metrics + { + get + { + return metrics; + } + } + } +} + +namespace CefSharp.DevTools.Performance +{ + using System.Linq; + + /// + /// Time domain to use for collecting and reporting duration metrics. + /// + public enum EnableTimeDomain + { + /// + /// timeTicks + /// + [EnumMember(Value = ("timeTicks"))] + TimeTicks, + /// + /// threadTicks + /// + [EnumMember(Value = ("threadTicks"))] + ThreadTicks + } + + /// + /// Performance + /// + public partial class PerformanceClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Performance + /// + /// DevToolsClient + public PerformanceClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Current values of the metrics. + /// + public event System.EventHandler Metrics + { + add + { + _client.AddEventHandler("Performance.metrics", value); + } + + remove + { + _client.RemoveEventHandler("Performance.metrics", value); + } + } + + /// + /// Disable collecting and reporting metrics. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Performance.disable", dict); + } + + partial void ValidateEnable(CefSharp.DevTools.Performance.EnableTimeDomain? timeDomain = null); + /// + /// Enable collecting and reporting metrics. + /// + /// Time domain to use for collecting and reporting duration metrics. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(CefSharp.DevTools.Performance.EnableTimeDomain? timeDomain = null) + { + ValidateEnable(timeDomain); + var dict = new System.Collections.Generic.Dictionary(); + if (timeDomain.HasValue) + { + dict.Add("timeDomain", EnumToString(timeDomain)); + } + + return _client.ExecuteDevToolsMethodAsync("Performance.enable", dict); + } + + /// + /// Retrieve current values of run-time metrics. + /// + /// returns System.Threading.Tasks.Task<GetMetricsResponse> + public System.Threading.Tasks.Task GetMetricsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Performance.getMetrics", dict); + } + } +} + +namespace CefSharp.DevTools.PerformanceTimeline +{ + using System.Linq; + + /// + /// Reporting of performance timeline events, as specified in + /// https://w3c.github.io/performance-timeline/#dom-performanceobserver. + /// + public partial class PerformanceTimelineClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// PerformanceTimeline + /// + /// DevToolsClient + public PerformanceTimelineClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Sent when a performance timeline event is added. See reportPerformanceTimeline method. + /// + public event System.EventHandler TimelineEventAdded + { + add + { + _client.AddEventHandler("PerformanceTimeline.timelineEventAdded", value); + } + + remove + { + _client.RemoveEventHandler("PerformanceTimeline.timelineEventAdded", value); + } + } + + partial void ValidateEnable(string[] eventTypes); + /// + /// Previously buffered events would be reported before method returns. + /// See also: timelineEventAdded + /// + /// The types of event to report, as specified inhttps://w3c.github.io/performance-timeline/#dom-performanceentry-entrytypeThe specified filter overrides any previous filters, passing emptyfilter disables recording.Note that not all types exposed to the web platform are currently supported. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(string[] eventTypes) + { + ValidateEnable(eventTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventTypes", eventTypes); + return _client.ExecuteDevToolsMethodAsync("PerformanceTimeline.enable", dict); + } + } +} + +namespace CefSharp.DevTools.Preload +{ + using System.Linq; + + /// + /// Preload + /// + public partial class PreloadClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Preload + /// + /// DevToolsClient + public PreloadClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Upsert. Currently, it is only emitted when a rule set added. + /// + public event System.EventHandler RuleSetUpdated + { + add + { + _client.AddEventHandler("Preload.ruleSetUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.ruleSetUpdated", value); + } + } + + /// + /// RuleSetRemoved + /// + public event System.EventHandler RuleSetRemoved + { + add + { + _client.AddEventHandler("Preload.ruleSetRemoved", value); + } + + remove + { + _client.RemoveEventHandler("Preload.ruleSetRemoved", value); + } + } + + /// + /// Fired when a preload enabled state is updated. + /// + public event System.EventHandler PreloadEnabledStateUpdated + { + add + { + _client.AddEventHandler("Preload.preloadEnabledStateUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.preloadEnabledStateUpdated", value); + } + } + + /// + /// Fired when a prefetch attempt is updated. + /// + public event System.EventHandler PrefetchStatusUpdated + { + add + { + _client.AddEventHandler("Preload.prefetchStatusUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.prefetchStatusUpdated", value); + } + } + + /// + /// Fired when a prerender attempt is updated. + /// + public event System.EventHandler PrerenderStatusUpdated + { + add + { + _client.AddEventHandler("Preload.prerenderStatusUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.prerenderStatusUpdated", value); + } + } + + /// + /// Send a list of sources for all preloading attempts in a document. + /// + public event System.EventHandler PreloadingAttemptSourcesUpdated + { + add + { + _client.AddEventHandler("Preload.preloadingAttemptSourcesUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.preloadingAttemptSourcesUpdated", value); + } + } + + /// + /// Enable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Preload.enable", dict); + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Preload.disable", dict); + } + } +} + +namespace CefSharp.DevTools.Security +{ + using System.Linq; + + /// + /// Security + /// + public partial class SecurityClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Security + /// + /// DevToolsClient + public SecurityClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// The security state of the page changed. + /// + public event System.EventHandler VisibleSecurityStateChanged + { + add + { + _client.AddEventHandler("Security.visibleSecurityStateChanged", value); + } + + remove + { + _client.RemoveEventHandler("Security.visibleSecurityStateChanged", value); + } + } + + /// + /// Disables tracking security state changes. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Security.disable", dict); + } + + /// + /// Enables tracking security state changes. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Security.enable", dict); + } + + partial void ValidateSetIgnoreCertificateErrors(bool ignore); + /// + /// Enable/disable whether all certificate errors should be ignored. + /// + /// If true, all certificate errors will be ignored. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetIgnoreCertificateErrorsAsync(bool ignore) + { + ValidateSetIgnoreCertificateErrors(ignore); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ignore", ignore); + return _client.ExecuteDevToolsMethodAsync("Security.setIgnoreCertificateErrors", dict); + } + } +} + +namespace CefSharp.DevTools.ServiceWorker +{ + using System.Linq; + + /// + /// ServiceWorker + /// + public partial class ServiceWorkerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// ServiceWorker + /// + /// DevToolsClient + public ServiceWorkerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// WorkerErrorReported + /// + public event System.EventHandler WorkerErrorReported + { + add + { + _client.AddEventHandler("ServiceWorker.workerErrorReported", value); + } + + remove + { + _client.RemoveEventHandler("ServiceWorker.workerErrorReported", value); + } + } + + /// + /// WorkerRegistrationUpdated + /// + public event System.EventHandler WorkerRegistrationUpdated + { + add + { + _client.AddEventHandler("ServiceWorker.workerRegistrationUpdated", value); + } + + remove + { + _client.RemoveEventHandler("ServiceWorker.workerRegistrationUpdated", value); + } + } + + /// + /// WorkerVersionUpdated + /// + public event System.EventHandler WorkerVersionUpdated + { + add + { + _client.AddEventHandler("ServiceWorker.workerVersionUpdated", value); + } + + remove + { + _client.RemoveEventHandler("ServiceWorker.workerVersionUpdated", value); + } + } + + partial void ValidateDeliverPushMessage(string origin, string registrationId, string data); + /// + /// DeliverPushMessage + /// + /// origin + /// registrationId + /// data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeliverPushMessageAsync(string origin, string registrationId, string data) + { + ValidateDeliverPushMessage(origin, registrationId, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + dict.Add("registrationId", registrationId); + dict.Add("data", data); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.deliverPushMessage", dict); + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.disable", dict); + } + + partial void ValidateDispatchSyncEvent(string origin, string registrationId, string tag, bool lastChance); + /// + /// DispatchSyncEvent + /// + /// origin + /// registrationId + /// tag + /// lastChance + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchSyncEventAsync(string origin, string registrationId, string tag, bool lastChance) + { + ValidateDispatchSyncEvent(origin, registrationId, tag, lastChance); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + dict.Add("registrationId", registrationId); + dict.Add("tag", tag); + dict.Add("lastChance", lastChance); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.dispatchSyncEvent", dict); + } + + partial void ValidateDispatchPeriodicSyncEvent(string origin, string registrationId, string tag); + /// + /// DispatchPeriodicSyncEvent + /// + /// origin + /// registrationId + /// tag + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchPeriodicSyncEventAsync(string origin, string registrationId, string tag) + { + ValidateDispatchPeriodicSyncEvent(origin, registrationId, tag); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + dict.Add("registrationId", registrationId); + dict.Add("tag", tag); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.dispatchPeriodicSyncEvent", dict); + } + + /// + /// Enable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.enable", dict); + } + + partial void ValidateSetForceUpdateOnPageLoad(bool forceUpdateOnPageLoad); + /// + /// SetForceUpdateOnPageLoad + /// + /// forceUpdateOnPageLoad + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetForceUpdateOnPageLoadAsync(bool forceUpdateOnPageLoad) + { + ValidateSetForceUpdateOnPageLoad(forceUpdateOnPageLoad); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("forceUpdateOnPageLoad", forceUpdateOnPageLoad); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.setForceUpdateOnPageLoad", dict); + } + + partial void ValidateSkipWaiting(string scopeURL); + /// + /// SkipWaiting + /// + /// scopeURL + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SkipWaitingAsync(string scopeURL) + { + ValidateSkipWaiting(scopeURL); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeURL", scopeURL); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.skipWaiting", dict); + } + + partial void ValidateStartWorker(string scopeURL); + /// + /// StartWorker + /// + /// scopeURL + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartWorkerAsync(string scopeURL) + { + ValidateStartWorker(scopeURL); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeURL", scopeURL); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.startWorker", dict); + } + + /// + /// StopAllWorkers + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopAllWorkersAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.stopAllWorkers", dict); + } + + partial void ValidateStopWorker(string versionId); + /// + /// StopWorker + /// + /// versionId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopWorkerAsync(string versionId) + { + ValidateStopWorker(versionId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("versionId", versionId); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.stopWorker", dict); + } + + partial void ValidateUnregister(string scopeURL); + /// + /// Unregister + /// + /// scopeURL + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UnregisterAsync(string scopeURL) + { + ValidateUnregister(scopeURL); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeURL", scopeURL); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.unregister", dict); + } + + partial void ValidateUpdateRegistration(string scopeURL); + /// + /// UpdateRegistration + /// + /// scopeURL + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UpdateRegistrationAsync(string scopeURL) + { + ValidateUpdateRegistration(scopeURL); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeURL", scopeURL); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.updateRegistration", dict); + } + } +} + +namespace CefSharp.DevTools.SmartCardEmulation +{ + using System.Linq; + + /// + /// SmartCardEmulation + /// + public partial class SmartCardEmulationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// SmartCardEmulation + /// + /// DevToolsClient + public SmartCardEmulationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when |SCardEstablishContext| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext + /// + public event System.EventHandler EstablishContextRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.establishContextRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.establishContextRequested", value); + } + } + + /// + /// Fired when |SCardReleaseContext| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext + /// + public event System.EventHandler ReleaseContextRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.releaseContextRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.releaseContextRequested", value); + } + } + + /// + /// Fired when |SCardListReaders| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa + /// + public event System.EventHandler ListReadersRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.listReadersRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.listReadersRequested", value); + } + } + + /// + /// Fired when |SCardGetStatusChange| is called. Timeout is specified in milliseconds. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea + /// + public event System.EventHandler GetStatusChangeRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.getStatusChangeRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.getStatusChangeRequested", value); + } + } + + /// + /// Fired when |SCardCancel| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel + /// + public event System.EventHandler CancelRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.cancelRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.cancelRequested", value); + } + } + + /// + /// Fired when |SCardConnect| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta + /// + public event System.EventHandler ConnectRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.connectRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.connectRequested", value); + } + } + + /// + /// Fired when |SCardDisconnect| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect + /// + public event System.EventHandler DisconnectRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.disconnectRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.disconnectRequested", value); + } + } + + /// + /// Fired when |SCardTransmit| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit + /// + public event System.EventHandler TransmitRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.transmitRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.transmitRequested", value); + } + } + + /// + /// Fired when |SCardControl| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol + /// + public event System.EventHandler ControlRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.controlRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.controlRequested", value); + } + } + + /// + /// Fired when |SCardGetAttrib| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib + /// + public event System.EventHandler GetAttribRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.getAttribRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.getAttribRequested", value); + } + } + + /// + /// Fired when |SCardSetAttrib| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib + /// + public event System.EventHandler SetAttribRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.setAttribRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.setAttribRequested", value); + } + } + + /// + /// Fired when |SCardStatus| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa + /// + public event System.EventHandler StatusRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.statusRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.statusRequested", value); + } + } + + /// + /// Fired when |SCardBeginTransaction| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction + /// + public event System.EventHandler BeginTransactionRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.beginTransactionRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.beginTransactionRequested", value); + } + } + + /// + /// Fired when |SCardEndTransaction| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction + /// + public event System.EventHandler EndTransactionRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.endTransactionRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.endTransactionRequested", value); + } + } + + /// + /// Enables the |SmartCardEmulation| domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.enable", dict); + } + + /// + /// Disables the |SmartCardEmulation| domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.disable", dict); + } + + partial void ValidateReportEstablishContextResult(string requestId, int contextId); + /// + /// Reports the successful result of a |SCardEstablishContext| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext + /// + /// requestId + /// contextId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportEstablishContextResultAsync(string requestId, int contextId) + { + ValidateReportEstablishContextResult(requestId, contextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("contextId", contextId); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportEstablishContextResult", dict); + } + + partial void ValidateReportReleaseContextResult(string requestId); + /// + /// Reports the successful result of a |SCardReleaseContext| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext + /// + /// requestId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportReleaseContextResultAsync(string requestId) + { + ValidateReportReleaseContextResult(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportReleaseContextResult", dict); + } + + partial void ValidateReportListReadersResult(string requestId, string[] readers); + /// + /// Reports the successful result of a |SCardListReaders| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa + /// + /// requestId + /// readers + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportListReadersResultAsync(string requestId, string[] readers) + { + ValidateReportListReadersResult(requestId, readers); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("readers", readers); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportListReadersResult", dict); + } + + partial void ValidateReportGetStatusChangeResult(string requestId, System.Collections.Generic.IList readerStates); + /// + /// Reports the successful result of a |SCardGetStatusChange| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea + /// + /// requestId + /// readerStates + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportGetStatusChangeResultAsync(string requestId, System.Collections.Generic.IList readerStates) + { + ValidateReportGetStatusChangeResult(requestId, readerStates); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("readerStates", readerStates.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportGetStatusChangeResult", dict); + } + + partial void ValidateReportBeginTransactionResult(string requestId, int handle); + /// + /// Reports the result of a |SCardBeginTransaction| call. + /// On success, this creates a new transaction object. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction + /// + /// requestId + /// handle + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportBeginTransactionResultAsync(string requestId, int handle) + { + ValidateReportBeginTransactionResult(requestId, handle); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("handle", handle); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportBeginTransactionResult", dict); + } + + partial void ValidateReportPlainResult(string requestId); + /// + /// Reports the successful result of a call that returns only a result code. + /// Used for: |SCardCancel|, |SCardDisconnect|, |SCardSetAttrib|, |SCardEndTransaction|. + /// + /// This maps to: + /// 1. SCardCancel + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel + /// + /// 2. SCardDisconnect + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect + /// + /// 3. SCardSetAttrib + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib + /// + /// 4. SCardEndTransaction + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction + /// + /// requestId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportPlainResultAsync(string requestId) + { + ValidateReportPlainResult(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportPlainResult", dict); + } + + partial void ValidateReportConnectResult(string requestId, int handle, CefSharp.DevTools.SmartCardEmulation.Protocol? activeProtocol = null); + /// + /// Reports the successful result of a |SCardConnect| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta + /// + /// requestId + /// handle + /// activeProtocol + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportConnectResultAsync(string requestId, int handle, CefSharp.DevTools.SmartCardEmulation.Protocol? activeProtocol = null) + { + ValidateReportConnectResult(requestId, handle, activeProtocol); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("handle", handle); + if (activeProtocol.HasValue) + { + dict.Add("activeProtocol", EnumToString(activeProtocol)); + } + + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportConnectResult", dict); + } + + partial void ValidateReportDataResult(string requestId, byte[] data); + /// + /// Reports the successful result of a call that sends back data on success. + /// Used for |SCardTransmit|, |SCardControl|, and |SCardGetAttrib|. + /// + /// This maps to: + /// 1. SCardTransmit + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit + /// + /// 2. SCardControl + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol + /// + /// 3. SCardGetAttrib + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib + /// + /// requestId + /// data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportDataResultAsync(string requestId, byte[] data) + { + ValidateReportDataResult(requestId, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("data", ToBase64String(data)); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportDataResult", dict); + } + + partial void ValidateReportStatusResult(string requestId, string readerName, CefSharp.DevTools.SmartCardEmulation.ConnectionState state, byte[] atr, CefSharp.DevTools.SmartCardEmulation.Protocol? protocol = null); + /// + /// Reports the successful result of a |SCardStatus| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa + /// + /// requestId + /// readerName + /// state + /// atr + /// protocol + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportStatusResultAsync(string requestId, string readerName, CefSharp.DevTools.SmartCardEmulation.ConnectionState state, byte[] atr, CefSharp.DevTools.SmartCardEmulation.Protocol? protocol = null) + { + ValidateReportStatusResult(requestId, readerName, state, atr, protocol); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("readerName", readerName); + dict.Add("state", EnumToString(state)); + dict.Add("atr", ToBase64String(atr)); + if (protocol.HasValue) + { + dict.Add("protocol", EnumToString(protocol)); + } + + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportStatusResult", dict); + } + + partial void ValidateReportError(string requestId, CefSharp.DevTools.SmartCardEmulation.ResultCode resultCode); + /// + /// Reports an error result for the given request. + /// + /// requestId + /// resultCode + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportErrorAsync(string requestId, CefSharp.DevTools.SmartCardEmulation.ResultCode resultCode) + { + ValidateReportError(requestId, resultCode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("resultCode", EnumToString(resultCode)); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportError", dict); + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetStorageKeyResponse + /// + [DataContract] + public class GetStorageKeyResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string storageKey + { + get; + set; + } + + /// + /// storageKey + /// + public string StorageKey + { + get + { + return storageKey; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetCookiesResponse + /// + [DataContract] + public class GetCookiesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList cookies + { + get; + set; + } + + /// + /// cookies + /// + public System.Collections.Generic.IList Cookies + { + get + { + return cookies; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetUsageAndQuotaResponse + /// + [DataContract] + public class GetUsageAndQuotaResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double usage + { + get; + set; + } + + /// + /// usage + /// + public double Usage + { + get + { + return usage; + } + } + + [DataMember] + internal double quota + { + get; + set; + } + + /// + /// quota + /// + public double Quota + { + get + { + return quota; + } + } + + [DataMember] + internal bool overrideActive + { + get; + set; + } + + /// + /// overrideActive + /// + public bool OverrideActive + { + get + { + return overrideActive; + } + } + + [DataMember] + internal System.Collections.Generic.IList usageBreakdown + { + get; + set; + } + + /// + /// usageBreakdown + /// + public System.Collections.Generic.IList UsageBreakdown + { + get + { + return usageBreakdown; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetTrustTokensResponse + /// + [DataContract] + public class GetTrustTokensResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList tokens + { + get; + set; + } + + /// + /// tokens + /// + public System.Collections.Generic.IList Tokens + { + get + { + return tokens; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// ClearTrustTokensResponse + /// + [DataContract] + public class ClearTrustTokensResponse : DevToolsDomainResponseBase + { + [DataMember] + internal bool didDeleteTokens + { + get; + set; + } + + /// + /// didDeleteTokens + /// + public bool DidDeleteTokens + { + get + { + return didDeleteTokens; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetInterestGroupDetailsResponse + /// + [DataContract] + public class GetInterestGroupDetailsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal object details + { + get; + set; + } + + /// + /// details + /// + public object Details + { + get + { + return details; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetSharedStorageMetadataResponse + /// + [DataContract] + public class GetSharedStorageMetadataResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Storage.SharedStorageMetadata metadata + { + get; + set; + } + + /// + /// metadata + /// + public CefSharp.DevTools.Storage.SharedStorageMetadata Metadata + { + get + { + return metadata; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetSharedStorageEntriesResponse + /// + [DataContract] + public class GetSharedStorageEntriesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList entries + { + get; + set; + } + + /// + /// entries + /// + public System.Collections.Generic.IList Entries + { + get + { + return entries; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// RunBounceTrackingMitigationsResponse + /// + [DataContract] + public class RunBounceTrackingMitigationsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] deletedSites + { + get; + set; + } + + /// + /// deletedSites + /// + public string[] DeletedSites + { + get + { + return deletedSites; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// SendPendingAttributionReportsResponse + /// + [DataContract] + public class SendPendingAttributionReportsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal int numSent + { + get; + set; + } + + /// + /// numSent + /// + public int NumSent + { + get + { + return numSent; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetRelatedWebsiteSetsResponse + /// + [DataContract] + public class GetRelatedWebsiteSetsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList sets + { + get; + set; + } + + /// + /// sets + /// + public System.Collections.Generic.IList Sets + { + get + { + return sets; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetAffectedUrlsForThirdPartyCookieMetadataResponse + /// + [DataContract] + public class GetAffectedUrlsForThirdPartyCookieMetadataResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] matchedUrls + { + get; + set; + } + + /// + /// matchedUrls + /// + public string[] MatchedUrls + { + get + { + return matchedUrls; + } + } + } +} + +namespace CefSharp.DevTools.Storage +{ + using System.Linq; + + /// + /// Storage + /// + public partial class StorageClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Storage + /// + /// DevToolsClient + public StorageClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// A cache's contents have been modified. + /// + public event System.EventHandler CacheStorageContentUpdated + { + add + { + _client.AddEventHandler("Storage.cacheStorageContentUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.cacheStorageContentUpdated", value); + } + } + + /// + /// A cache has been added/deleted. + /// + public event System.EventHandler CacheStorageListUpdated + { + add + { + _client.AddEventHandler("Storage.cacheStorageListUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.cacheStorageListUpdated", value); + } + } + + /// + /// The origin's IndexedDB object store has been modified. + /// + public event System.EventHandler IndexedDBContentUpdated + { + add + { + _client.AddEventHandler("Storage.indexedDBContentUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.indexedDBContentUpdated", value); + } + } + + /// + /// The origin's IndexedDB database list has been modified. + /// + public event System.EventHandler IndexedDBListUpdated + { + add + { + _client.AddEventHandler("Storage.indexedDBListUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.indexedDBListUpdated", value); + } + } + + /// + /// One of the interest groups was accessed. Note that these events are global + /// to all targets sharing an interest group store. + /// + public event System.EventHandler InterestGroupAccessed + { + add + { + _client.AddEventHandler("Storage.interestGroupAccessed", value); + } + + remove + { + _client.RemoveEventHandler("Storage.interestGroupAccessed", value); + } + } + + /// + /// An auction involving interest groups is taking place. These events are + /// target-specific. + /// + public event System.EventHandler InterestGroupAuctionEventOccurred + { + add + { + _client.AddEventHandler("Storage.interestGroupAuctionEventOccurred", value); + } + + remove + { + _client.RemoveEventHandler("Storage.interestGroupAuctionEventOccurred", value); + } + } + + /// + /// Specifies which auctions a particular network fetch may be related to, and + /// in what role. Note that it is not ordered with respect to + /// Network.requestWillBeSent (but will happen before loadingFinished + /// loadingFailed). + /// + public event System.EventHandler InterestGroupAuctionNetworkRequestCreated + { + add + { + _client.AddEventHandler("Storage.interestGroupAuctionNetworkRequestCreated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.interestGroupAuctionNetworkRequestCreated", value); + } + } + + /// + /// Shared storage was accessed by the associated page. + /// The following parameters are included in all events. + /// + public event System.EventHandler SharedStorageAccessed + { + add + { + _client.AddEventHandler("Storage.sharedStorageAccessed", value); + } + + remove + { + _client.RemoveEventHandler("Storage.sharedStorageAccessed", value); + } + } + + /// + /// A shared storage run or selectURL operation finished its execution. + /// The following parameters are included in all events. + /// + public event System.EventHandler SharedStorageWorkletOperationExecutionFinished + { + add + { + _client.AddEventHandler("Storage.sharedStorageWorkletOperationExecutionFinished", value); + } + + remove + { + _client.RemoveEventHandler("Storage.sharedStorageWorkletOperationExecutionFinished", value); + } + } + + /// + /// StorageBucketCreatedOrUpdated + /// + public event System.EventHandler StorageBucketCreatedOrUpdated + { + add + { + _client.AddEventHandler("Storage.storageBucketCreatedOrUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.storageBucketCreatedOrUpdated", value); + } + } + + /// + /// StorageBucketDeleted + /// + public event System.EventHandler StorageBucketDeleted + { + add + { + _client.AddEventHandler("Storage.storageBucketDeleted", value); + } + + remove + { + _client.RemoveEventHandler("Storage.storageBucketDeleted", value); + } + } + + /// + /// AttributionReportingSourceRegistered + /// + public event System.EventHandler AttributionReportingSourceRegistered + { + add + { + _client.AddEventHandler("Storage.attributionReportingSourceRegistered", value); + } + + remove + { + _client.RemoveEventHandler("Storage.attributionReportingSourceRegistered", value); + } + } + + /// + /// AttributionReportingTriggerRegistered + /// + public event System.EventHandler AttributionReportingTriggerRegistered + { + add + { + _client.AddEventHandler("Storage.attributionReportingTriggerRegistered", value); + } + + remove + { + _client.RemoveEventHandler("Storage.attributionReportingTriggerRegistered", value); + } + } + + /// + /// AttributionReportingReportSent + /// + public event System.EventHandler AttributionReportingReportSent + { + add + { + _client.AddEventHandler("Storage.attributionReportingReportSent", value); + } + + remove + { + _client.RemoveEventHandler("Storage.attributionReportingReportSent", value); + } + } + + /// + /// AttributionReportingVerboseDebugReportSent + /// + public event System.EventHandler AttributionReportingVerboseDebugReportSent + { + add + { + _client.AddEventHandler("Storage.attributionReportingVerboseDebugReportSent", value); + } + + remove + { + _client.RemoveEventHandler("Storage.attributionReportingVerboseDebugReportSent", value); + } + } + + partial void ValidateGetStorageKey(string frameId = null); + /// + /// Returns storage key for the given frame. If no frame ID is provided, + /// the storage key of the target executing this command is returned. + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetStorageKeyResponse> + public System.Threading.Tasks.Task GetStorageKeyAsync(string frameId = null) + { + ValidateGetStorageKey(frameId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.getStorageKey", dict); + } + + partial void ValidateClearDataForOrigin(string origin, string storageTypes); + /// + /// Clears storage for origin. + /// + /// Security origin. + /// Comma separated list of StorageType to clear. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDataForOriginAsync(string origin, string storageTypes) + { + ValidateClearDataForOrigin(origin, storageTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + dict.Add("storageTypes", storageTypes); + return _client.ExecuteDevToolsMethodAsync("Storage.clearDataForOrigin", dict); + } + + partial void ValidateClearDataForStorageKey(string storageKey, string storageTypes); + /// + /// Clears storage for storage key. + /// + /// Storage key. + /// Comma separated list of StorageType to clear. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDataForStorageKeyAsync(string storageKey, string storageTypes) + { + ValidateClearDataForStorageKey(storageKey, storageTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + dict.Add("storageTypes", storageTypes); + return _client.ExecuteDevToolsMethodAsync("Storage.clearDataForStorageKey", dict); + } + + partial void ValidateGetCookies(string browserContextId = null); + /// + /// Returns all browser cookies. + /// + /// Browser context to use when called on the browser endpoint. + /// returns System.Threading.Tasks.Task<GetCookiesResponse> + public System.Threading.Tasks.Task GetCookiesAsync(string browserContextId = null) + { + ValidateGetCookies(browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.getCookies", dict); + } + + partial void ValidateSetCookies(System.Collections.Generic.IList cookies, string browserContextId = null); + /// + /// Sets given cookies. + /// + /// Cookies to be set. + /// Browser context to use when called on the browser endpoint. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCookiesAsync(System.Collections.Generic.IList cookies, string browserContextId = null) + { + ValidateSetCookies(cookies, browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cookies", cookies.Select(x => x.ToDictionary())); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.setCookies", dict); + } + + partial void ValidateClearCookies(string browserContextId = null); + /// + /// Clears cookies. + /// + /// Browser context to use when called on the browser endpoint. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearCookiesAsync(string browserContextId = null) + { + ValidateClearCookies(browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.clearCookies", dict); + } + + partial void ValidateGetUsageAndQuota(string origin); + /// + /// Returns usage and quota in bytes. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<GetUsageAndQuotaResponse> + public System.Threading.Tasks.Task GetUsageAndQuotaAsync(string origin) + { + ValidateGetUsageAndQuota(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.getUsageAndQuota", dict); + } + + partial void ValidateOverrideQuotaForOrigin(string origin, double? quotaSize = null); + /// + /// Override quota for the specified origin + /// + /// Security origin. + /// The quota size (in bytes) to override the original quota with.If this is called multiple times, the overridden quota will be equal tothe quotaSize provided in the final call. If this is called withoutspecifying a quotaSize, the quota will be reset to the default value forthe specified origin. If this is called multiple times with differentorigins, the override will be maintained for each origin until it isdisabled (called without a quotaSize). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task OverrideQuotaForOriginAsync(string origin, double? quotaSize = null) + { + ValidateOverrideQuotaForOrigin(origin, quotaSize); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + if (quotaSize.HasValue) + { + dict.Add("quotaSize", quotaSize.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.overrideQuotaForOrigin", dict); + } + + partial void ValidateTrackCacheStorageForOrigin(string origin); + /// + /// Registers origin to be notified when an update occurs to its cache storage list. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackCacheStorageForOriginAsync(string origin) + { + ValidateTrackCacheStorageForOrigin(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.trackCacheStorageForOrigin", dict); + } + + partial void ValidateTrackCacheStorageForStorageKey(string storageKey); + /// + /// Registers storage key to be notified when an update occurs to its cache storage list. + /// + /// Storage key. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackCacheStorageForStorageKeyAsync(string storageKey) + { + ValidateTrackCacheStorageForStorageKey(storageKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + return _client.ExecuteDevToolsMethodAsync("Storage.trackCacheStorageForStorageKey", dict); + } + + partial void ValidateTrackIndexedDBForOrigin(string origin); + /// + /// Registers origin to be notified when an update occurs to its IndexedDB. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackIndexedDBForOriginAsync(string origin) + { + ValidateTrackIndexedDBForOrigin(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.trackIndexedDBForOrigin", dict); + } + + partial void ValidateTrackIndexedDBForStorageKey(string storageKey); + /// + /// Registers storage key to be notified when an update occurs to its IndexedDB. + /// + /// Storage key. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackIndexedDBForStorageKeyAsync(string storageKey) + { + ValidateTrackIndexedDBForStorageKey(storageKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + return _client.ExecuteDevToolsMethodAsync("Storage.trackIndexedDBForStorageKey", dict); + } + + partial void ValidateUntrackCacheStorageForOrigin(string origin); + /// + /// Unregisters origin from receiving notifications for cache storage. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UntrackCacheStorageForOriginAsync(string origin) + { + ValidateUntrackCacheStorageForOrigin(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.untrackCacheStorageForOrigin", dict); + } + + partial void ValidateUntrackCacheStorageForStorageKey(string storageKey); + /// + /// Unregisters storage key from receiving notifications for cache storage. + /// + /// Storage key. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UntrackCacheStorageForStorageKeyAsync(string storageKey) + { + ValidateUntrackCacheStorageForStorageKey(storageKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + return _client.ExecuteDevToolsMethodAsync("Storage.untrackCacheStorageForStorageKey", dict); + } + + partial void ValidateUntrackIndexedDBForOrigin(string origin); + /// + /// Unregisters origin from receiving notifications for IndexedDB. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UntrackIndexedDBForOriginAsync(string origin) + { + ValidateUntrackIndexedDBForOrigin(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.untrackIndexedDBForOrigin", dict); + } + + partial void ValidateUntrackIndexedDBForStorageKey(string storageKey); + /// + /// Unregisters storage key from receiving notifications for IndexedDB. + /// + /// Storage key. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UntrackIndexedDBForStorageKeyAsync(string storageKey) + { + ValidateUntrackIndexedDBForStorageKey(storageKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + return _client.ExecuteDevToolsMethodAsync("Storage.untrackIndexedDBForStorageKey", dict); + } + + /// + /// Returns the number of stored Trust Tokens per issuer for the + /// current browsing context. + /// + /// returns System.Threading.Tasks.Task<GetTrustTokensResponse> + public System.Threading.Tasks.Task GetTrustTokensAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Storage.getTrustTokens", dict); + } + + partial void ValidateClearTrustTokens(string issuerOrigin); + /// + /// Removes all Trust Tokens issued by the provided issuerOrigin. + /// Leaves other stored data, including the issuer's Redemption Records, intact. + /// + /// issuerOrigin + /// returns System.Threading.Tasks.Task<ClearTrustTokensResponse> + public System.Threading.Tasks.Task ClearTrustTokensAsync(string issuerOrigin) + { + ValidateClearTrustTokens(issuerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("issuerOrigin", issuerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.clearTrustTokens", dict); + } + + partial void ValidateGetInterestGroupDetails(string ownerOrigin, string name); + /// + /// Gets details for a named interest group. + /// + /// ownerOrigin + /// name + /// returns System.Threading.Tasks.Task<GetInterestGroupDetailsResponse> + public System.Threading.Tasks.Task GetInterestGroupDetailsAsync(string ownerOrigin, string name) + { + ValidateGetInterestGroupDetails(ownerOrigin, name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + dict.Add("name", name); + return _client.ExecuteDevToolsMethodAsync("Storage.getInterestGroupDetails", dict); + } + + partial void ValidateSetInterestGroupTracking(bool enable); + /// + /// Enables/Disables issuing of interestGroupAccessed events. + /// + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInterestGroupTrackingAsync(bool enable) + { + ValidateSetInterestGroupTracking(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setInterestGroupTracking", dict); + } + + partial void ValidateSetInterestGroupAuctionTracking(bool enable); + /// + /// Enables/Disables issuing of interestGroupAuctionEventOccurred and + /// interestGroupAuctionNetworkRequestCreated. + /// + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInterestGroupAuctionTrackingAsync(bool enable) + { + ValidateSetInterestGroupAuctionTracking(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setInterestGroupAuctionTracking", dict); + } + + partial void ValidateGetSharedStorageMetadata(string ownerOrigin); + /// + /// Gets metadata for an origin's shared storage. + /// + /// ownerOrigin + /// returns System.Threading.Tasks.Task<GetSharedStorageMetadataResponse> + public System.Threading.Tasks.Task GetSharedStorageMetadataAsync(string ownerOrigin) + { + ValidateGetSharedStorageMetadata(ownerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.getSharedStorageMetadata", dict); + } + + partial void ValidateGetSharedStorageEntries(string ownerOrigin); + /// + /// Gets the entries in an given origin's shared storage. + /// + /// ownerOrigin + /// returns System.Threading.Tasks.Task<GetSharedStorageEntriesResponse> + public System.Threading.Tasks.Task GetSharedStorageEntriesAsync(string ownerOrigin) + { + ValidateGetSharedStorageEntries(ownerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.getSharedStorageEntries", dict); + } + + partial void ValidateSetSharedStorageEntry(string ownerOrigin, string key, string value, bool? ignoreIfPresent = null); + /// + /// Sets entry with `key` and `value` for a given origin's shared storage. + /// + /// ownerOrigin + /// key + /// value + /// If `ignoreIfPresent` is included and true, then only sets the entry if`key` doesn't already exist. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSharedStorageEntryAsync(string ownerOrigin, string key, string value, bool? ignoreIfPresent = null) + { + ValidateSetSharedStorageEntry(ownerOrigin, key, value, ignoreIfPresent); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + dict.Add("key", key); + dict.Add("value", value); + if (ignoreIfPresent.HasValue) + { + dict.Add("ignoreIfPresent", ignoreIfPresent.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.setSharedStorageEntry", dict); + } + + partial void ValidateDeleteSharedStorageEntry(string ownerOrigin, string key); + /// + /// Deletes entry for `key` (if it exists) for a given origin's shared storage. + /// + /// ownerOrigin + /// key + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteSharedStorageEntryAsync(string ownerOrigin, string key) + { + ValidateDeleteSharedStorageEntry(ownerOrigin, key); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + dict.Add("key", key); + return _client.ExecuteDevToolsMethodAsync("Storage.deleteSharedStorageEntry", dict); + } + + partial void ValidateClearSharedStorageEntries(string ownerOrigin); + /// + /// Clears all entries for a given origin's shared storage. + /// + /// ownerOrigin + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearSharedStorageEntriesAsync(string ownerOrigin) + { + ValidateClearSharedStorageEntries(ownerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.clearSharedStorageEntries", dict); + } + + partial void ValidateResetSharedStorageBudget(string ownerOrigin); + /// + /// Resets the budget for `ownerOrigin` by clearing all budget withdrawals. + /// + /// ownerOrigin + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetSharedStorageBudgetAsync(string ownerOrigin) + { + ValidateResetSharedStorageBudget(ownerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.resetSharedStorageBudget", dict); + } + + partial void ValidateSetSharedStorageTracking(bool enable); + /// + /// Enables/disables issuing of sharedStorageAccessed events. + /// + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSharedStorageTrackingAsync(bool enable) + { + ValidateSetSharedStorageTracking(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setSharedStorageTracking", dict); + } + + partial void ValidateSetStorageBucketTracking(string storageKey, bool enable); + /// + /// Set tracking for a storage key's buckets. + /// + /// storageKey + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetStorageBucketTrackingAsync(string storageKey, bool enable) + { + ValidateSetStorageBucketTracking(storageKey, enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setStorageBucketTracking", dict); + } + + partial void ValidateDeleteStorageBucket(CefSharp.DevTools.Storage.StorageBucket bucket); + /// + /// Deletes the Storage Bucket with the given storage key and bucket name. + /// + /// bucket + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteStorageBucketAsync(CefSharp.DevTools.Storage.StorageBucket bucket) + { + ValidateDeleteStorageBucket(bucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("bucket", bucket.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Storage.deleteStorageBucket", dict); + } + + /// + /// Deletes state for sites identified as potential bounce trackers, immediately. + /// + /// returns System.Threading.Tasks.Task<RunBounceTrackingMitigationsResponse> + public System.Threading.Tasks.Task RunBounceTrackingMitigationsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Storage.runBounceTrackingMitigations", dict); + } + + partial void ValidateSetAttributionReportingLocalTestingMode(bool enabled); + /// + /// https://wicg.github.io/attribution-reporting-api/ + /// + /// If enabled, noise is suppressed and reports are sent immediately. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttributionReportingLocalTestingModeAsync(bool enabled) + { + ValidateSetAttributionReportingLocalTestingMode(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Storage.setAttributionReportingLocalTestingMode", dict); + } + + partial void ValidateSetAttributionReportingTracking(bool enable); + /// + /// Enables/disables issuing of Attribution Reporting events. + /// + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttributionReportingTrackingAsync(bool enable) + { + ValidateSetAttributionReportingTracking(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setAttributionReportingTracking", dict); + } + + /// + /// Sends all pending Attribution Reports immediately, regardless of their + /// scheduled report time. + /// + /// returns System.Threading.Tasks.Task<SendPendingAttributionReportsResponse> + public System.Threading.Tasks.Task SendPendingAttributionReportsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Storage.sendPendingAttributionReports", dict); + } + + /// + /// Returns the effective Related Website Sets in use by this profile for the browser + /// session. The effective Related Website Sets will not change during a browser session. + /// + /// returns System.Threading.Tasks.Task<GetRelatedWebsiteSetsResponse> + public System.Threading.Tasks.Task GetRelatedWebsiteSetsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Storage.getRelatedWebsiteSets", dict); + } + + partial void ValidateGetAffectedUrlsForThirdPartyCookieMetadata(string firstPartyUrl, string[] thirdPartyUrls); + /// + /// Returns the list of URLs from a page and its embedded resources that match + /// existing grace period URL pattern rules. + /// https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period + /// + /// The URL of the page currently being visited. + /// The list of embedded resource URLs from the page. + /// returns System.Threading.Tasks.Task<GetAffectedUrlsForThirdPartyCookieMetadataResponse> + public System.Threading.Tasks.Task GetAffectedUrlsForThirdPartyCookieMetadataAsync(string firstPartyUrl, string[] thirdPartyUrls) + { + ValidateGetAffectedUrlsForThirdPartyCookieMetadata(firstPartyUrl, thirdPartyUrls); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("firstPartyUrl", firstPartyUrl); + dict.Add("thirdPartyUrls", thirdPartyUrls); + return _client.ExecuteDevToolsMethodAsync("Storage.getAffectedUrlsForThirdPartyCookieMetadata", dict); + } + + partial void ValidateSetProtectedAudienceKAnonymity(string owner, string name, byte[][] hashes); + /// + /// SetProtectedAudienceKAnonymity + /// + /// owner + /// name + /// hashes + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetProtectedAudienceKAnonymityAsync(string owner, string name, byte[][] hashes) + { + ValidateSetProtectedAudienceKAnonymity(owner, name, hashes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("owner", owner); + dict.Add("name", name); + dict.Add("hashes", ToBase64String(hashes)); + return _client.ExecuteDevToolsMethodAsync("Storage.setProtectedAudienceKAnonymity", dict); + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + /// + /// GetInfoResponse + /// + [DataContract] + public class GetInfoResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.SystemInfo.GPUInfo gpu + { + get; + set; + } + + /// + /// gpu + /// + public CefSharp.DevTools.SystemInfo.GPUInfo Gpu + { + get + { + return gpu; + } + } + + [DataMember] + internal string modelName + { + get; + set; + } + + /// + /// modelName + /// + public string ModelName + { + get + { + return modelName; + } + } + + [DataMember] + internal string modelVersion + { + get; + set; + } + + /// + /// modelVersion + /// + public string ModelVersion + { + get + { + return modelVersion; + } + } + + [DataMember] + internal string commandLine + { + get; + set; + } + + /// + /// commandLine + /// + public string CommandLine + { + get + { + return commandLine; + } + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + /// + /// GetFeatureStateResponse + /// + [DataContract] + public class GetFeatureStateResponse : DevToolsDomainResponseBase + { + [DataMember] + internal bool featureEnabled + { + get; + set; + } + + /// + /// featureEnabled + /// + public bool FeatureEnabled + { + get + { + return featureEnabled; + } + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + /// + /// GetProcessInfoResponse + /// + [DataContract] + public class GetProcessInfoResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList processInfo + { + get; + set; + } + + /// + /// processInfo + /// + public System.Collections.Generic.IList ProcessInfo + { + get + { + return processInfo; + } + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + using System.Linq; + + /// + /// The SystemInfo domain defines methods and events for querying low-level system information. + /// + public partial class SystemInfoClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// SystemInfo + /// + /// DevToolsClient + public SystemInfoClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Returns information about the system. + /// + /// returns System.Threading.Tasks.Task<GetInfoResponse> + public System.Threading.Tasks.Task GetInfoAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("SystemInfo.getInfo", dict); + } + + partial void ValidateGetFeatureState(string featureState); + /// + /// Returns information about the feature state. + /// + /// featureState + /// returns System.Threading.Tasks.Task<GetFeatureStateResponse> + public System.Threading.Tasks.Task GetFeatureStateAsync(string featureState) + { + ValidateGetFeatureState(featureState); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("featureState", featureState); + return _client.ExecuteDevToolsMethodAsync("SystemInfo.getFeatureState", dict); + } + + /// + /// Returns information about all running processes. + /// + /// returns System.Threading.Tasks.Task<GetProcessInfoResponse> + public System.Threading.Tasks.Task GetProcessInfoAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("SystemInfo.getProcessInfo", dict); + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// AttachToTargetResponse + /// + [DataContract] + public class AttachToTargetResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string sessionId + { + get; + set; + } + + /// + /// sessionId + /// + public string SessionId + { + get + { + return sessionId; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// AttachToBrowserTargetResponse + /// + [DataContract] + public class AttachToBrowserTargetResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string sessionId + { + get; + set; + } + + /// + /// sessionId + /// + public string SessionId + { + get + { + return sessionId; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// CloseTargetResponse + /// + [DataContract] + public class CloseTargetResponse : DevToolsDomainResponseBase + { + [DataMember] + internal bool success + { + get; + set; + } + + /// + /// success + /// + public bool Success + { + get + { + return success; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// CreateBrowserContextResponse + /// + [DataContract] + public class CreateBrowserContextResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string browserContextId + { + get; + set; + } + + /// + /// browserContextId + /// + public string BrowserContextId + { + get + { + return browserContextId; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// GetBrowserContextsResponse + /// + [DataContract] + public class GetBrowserContextsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] browserContextIds + { + get; + set; + } + + /// + /// browserContextIds + /// + public string[] BrowserContextIds + { + get + { + return browserContextIds; + } + } + + [DataMember] + internal string defaultBrowserContextId + { + get; + set; + } + + /// + /// defaultBrowserContextId + /// + public string DefaultBrowserContextId + { + get + { + return defaultBrowserContextId; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// CreateTargetResponse + /// + [DataContract] + public class CreateTargetResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string targetId + { + get; + set; + } + + /// + /// targetId + /// + public string TargetId + { + get + { + return targetId; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// GetTargetInfoResponse + /// + [DataContract] + public class GetTargetInfoResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Target.TargetInfo targetInfo + { + get; + set; + } + + /// + /// targetInfo + /// + public CefSharp.DevTools.Target.TargetInfo TargetInfo + { + get + { + return targetInfo; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// GetTargetsResponse + /// + [DataContract] + public class GetTargetsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList targetInfos + { + get; + set; + } + + /// + /// targetInfos + /// + public System.Collections.Generic.IList TargetInfos + { + get + { + return targetInfos; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// GetDevToolsTargetResponse + /// + [DataContract] + public class GetDevToolsTargetResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string targetId + { + get; + set; + } + + /// + /// targetId + /// + public string TargetId + { + get + { + return targetId; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// OpenDevToolsResponse + /// + [DataContract] + public class OpenDevToolsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string targetId + { + get; + set; + } + + /// + /// targetId + /// + public string TargetId + { + get + { + return targetId; + } + } + } +} + +namespace CefSharp.DevTools.Target +{ + using System.Linq; + + /// + /// Supports additional targets discovery and allows to attach to them. + /// + public partial class TargetClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Target + /// + /// DevToolsClient + public TargetClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Issued when attached to target because of auto-attach or `attachToTarget` command. + /// + public event System.EventHandler AttachedToTarget + { + add + { + _client.AddEventHandler("Target.attachedToTarget", value); + } + + remove + { + _client.RemoveEventHandler("Target.attachedToTarget", value); + } + } + + /// + /// Issued when detached from target for any reason (including `detachFromTarget` command). Can be + /// issued multiple times per target if multiple sessions have been attached to it. + /// + public event System.EventHandler DetachedFromTarget + { + add + { + _client.AddEventHandler("Target.detachedFromTarget", value); + } + + remove + { + _client.RemoveEventHandler("Target.detachedFromTarget", value); + } + } + + /// + /// Notifies about a new protocol message received from the session (as reported in + /// `attachedToTarget` event). + /// + public event System.EventHandler ReceivedMessageFromTarget + { + add + { + _client.AddEventHandler("Target.receivedMessageFromTarget", value); + } + + remove + { + _client.RemoveEventHandler("Target.receivedMessageFromTarget", value); + } + } + + /// + /// Issued when a possible inspection target is created. + /// + public event System.EventHandler TargetCreated + { + add + { + _client.AddEventHandler("Target.targetCreated", value); + } + + remove + { + _client.RemoveEventHandler("Target.targetCreated", value); + } + } + + /// + /// Issued when a target is destroyed. + /// + public event System.EventHandler TargetDestroyed + { + add + { + _client.AddEventHandler("Target.targetDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("Target.targetDestroyed", value); + } + } + + /// + /// Issued when a target has crashed. + /// + public event System.EventHandler TargetCrashed + { + add + { + _client.AddEventHandler("Target.targetCrashed", value); + } + + remove + { + _client.RemoveEventHandler("Target.targetCrashed", value); + } + } + + /// + /// Issued when some information about a target has changed. This only happens between + /// `targetCreated` and `targetDestroyed`. + /// + public event System.EventHandler TargetInfoChanged + { + add + { + _client.AddEventHandler("Target.targetInfoChanged", value); + } + + remove + { + _client.RemoveEventHandler("Target.targetInfoChanged", value); + } + } + + partial void ValidateActivateTarget(string targetId); + /// + /// Activates (focuses) the target. + /// + /// targetId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ActivateTargetAsync(string targetId) + { + ValidateActivateTarget(targetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + return _client.ExecuteDevToolsMethodAsync("Target.activateTarget", dict); + } + + partial void ValidateAttachToTarget(string targetId, bool? flatten = null); + /// + /// Attaches to the target with given id. + /// + /// targetId + /// Enables "flat" access to the session via specifying sessionId attribute in the commands.We plan to make this the default, deprecate non-flattened mode,and eventually retire it. See crbug.com/991325. + /// returns System.Threading.Tasks.Task<AttachToTargetResponse> + public System.Threading.Tasks.Task AttachToTargetAsync(string targetId, bool? flatten = null) + { + ValidateAttachToTarget(targetId, flatten); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + if (flatten.HasValue) + { + dict.Add("flatten", flatten.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Target.attachToTarget", dict); + } + + /// + /// Attaches to the browser target, only uses flat sessionId mode. + /// + /// returns System.Threading.Tasks.Task<AttachToBrowserTargetResponse> + public System.Threading.Tasks.Task AttachToBrowserTargetAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Target.attachToBrowserTarget", dict); + } + + partial void ValidateCloseTarget(string targetId); + /// + /// Closes the target. If the target is a page that gets closed too. + /// + /// targetId + /// returns System.Threading.Tasks.Task<CloseTargetResponse> + public System.Threading.Tasks.Task CloseTargetAsync(string targetId) + { + ValidateCloseTarget(targetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + return _client.ExecuteDevToolsMethodAsync("Target.closeTarget", dict); + } + + partial void ValidateExposeDevToolsProtocol(string targetId, string bindingName = null, bool? inheritPermissions = null); + /// + /// Inject object to the target's main frame that provides a communication + /// channel with browser target. + /// + /// Injected object will be available as `window[bindingName]`. + /// + /// The object has the following API: + /// - `binding.send(json)` - a method to send messages over the remote debugging protocol + /// - `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses. + /// + /// targetId + /// Binding name, 'cdp' if not specified. + /// If true, inherits the current root session's permissions (default: false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ExposeDevToolsProtocolAsync(string targetId, string bindingName = null, bool? inheritPermissions = null) + { + ValidateExposeDevToolsProtocol(targetId, bindingName, inheritPermissions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + if (!(string.IsNullOrEmpty(bindingName))) + { + dict.Add("bindingName", bindingName); + } + + if (inheritPermissions.HasValue) + { + dict.Add("inheritPermissions", inheritPermissions.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Target.exposeDevToolsProtocol", dict); + } + + partial void ValidateCreateBrowserContext(bool? disposeOnDetach = null, string proxyServer = null, string proxyBypassList = null, string[] originsWithUniversalNetworkAccess = null); + /// + /// Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than + /// one. + /// + /// If specified, disposes this context when debugging session disconnects. + /// Proxy server, similar to the one passed to --proxy-server + /// Proxy bypass list, similar to the one passed to --proxy-bypass-list + /// An optional list of origins to grant unlimited cross-origin access to.Parts of the URL other than those constituting origin are ignored. + /// returns System.Threading.Tasks.Task<CreateBrowserContextResponse> + public System.Threading.Tasks.Task CreateBrowserContextAsync(bool? disposeOnDetach = null, string proxyServer = null, string proxyBypassList = null, string[] originsWithUniversalNetworkAccess = null) + { + ValidateCreateBrowserContext(disposeOnDetach, proxyServer, proxyBypassList, originsWithUniversalNetworkAccess); + var dict = new System.Collections.Generic.Dictionary(); + if (disposeOnDetach.HasValue) + { + dict.Add("disposeOnDetach", disposeOnDetach.Value); + } + + if (!(string.IsNullOrEmpty(proxyServer))) + { + dict.Add("proxyServer", proxyServer); + } + + if (!(string.IsNullOrEmpty(proxyBypassList))) + { + dict.Add("proxyBypassList", proxyBypassList); + } + + if ((originsWithUniversalNetworkAccess) != (null)) + { + dict.Add("originsWithUniversalNetworkAccess", originsWithUniversalNetworkAccess); + } + + return _client.ExecuteDevToolsMethodAsync("Target.createBrowserContext", dict); + } + + /// + /// Returns all browser contexts created with `Target.createBrowserContext` method. + /// + /// returns System.Threading.Tasks.Task<GetBrowserContextsResponse> + public System.Threading.Tasks.Task GetBrowserContextsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Target.getBrowserContexts", dict); + } + + partial void ValidateCreateTarget(string url, int? left = null, int? top = null, int? width = null, int? height = null, CefSharp.DevTools.Target.WindowState? windowState = null, string browserContextId = null, bool? enableBeginFrameControl = null, bool? newWindow = null, bool? background = null, bool? forTab = null, bool? hidden = null, bool? focus = null); + /// + /// Creates a new page. + /// + /// The initial URL the page will be navigated to. An empty string indicates about:blank. + /// Frame left origin in DIP (requires newWindow to be true or headless shell). + /// Frame top origin in DIP (requires newWindow to be true or headless shell). + /// Frame width in DIP (requires newWindow to be true or headless shell). + /// Frame height in DIP (requires newWindow to be true or headless shell). + /// Frame window state (requires newWindow to be true or headless shell).Default is normal. + /// The browser context to create the page in. + /// Whether BeginFrames for this target will be controlled via DevTools (headless shell only,not supported on MacOS yet, false by default). + /// Whether to create a new Window or Tab (false by default, not supported by headless shell). + /// Whether to create the target in background or foreground (false by default, not supportedby headless shell). + /// Whether to create the target of type "tab". + /// Whether to create a hidden target. The hidden target is observable via protocol, but notpresent in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or`background: false`. The life-time of the tab is limited to the life-time of the session. + /// If specified, the option is used to determine if the new target shouldbe focused or not. By default, the focus behavior depends on thevalue of the background field. For example, background=false and focus=falsewill result in the target tab being opened but the browser window remainunchanged (if it was in the background, it will remain in the background)and background=false with focus=undefined will result in the window being focused.Using background: true and focus: true is not supported and will result in an error. + /// returns System.Threading.Tasks.Task<CreateTargetResponse> + public System.Threading.Tasks.Task CreateTargetAsync(string url, int? left = null, int? top = null, int? width = null, int? height = null, CefSharp.DevTools.Target.WindowState? windowState = null, string browserContextId = null, bool? enableBeginFrameControl = null, bool? newWindow = null, bool? background = null, bool? forTab = null, bool? hidden = null, bool? focus = null) + { + ValidateCreateTarget(url, left, top, width, height, windowState, browserContextId, enableBeginFrameControl, newWindow, background, forTab, hidden, focus); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + if (left.HasValue) + { + dict.Add("left", left.Value); + } + + if (top.HasValue) + { + dict.Add("top", top.Value); + } + + if (width.HasValue) + { + dict.Add("width", width.Value); + } + + if (height.HasValue) + { + dict.Add("height", height.Value); + } + + if (windowState.HasValue) + { + dict.Add("windowState", EnumToString(windowState)); + } + + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + if (enableBeginFrameControl.HasValue) + { + dict.Add("enableBeginFrameControl", enableBeginFrameControl.Value); + } + + if (newWindow.HasValue) + { + dict.Add("newWindow", newWindow.Value); + } + + if (background.HasValue) + { + dict.Add("background", background.Value); + } + + if (forTab.HasValue) + { + dict.Add("forTab", forTab.Value); + } + + if (hidden.HasValue) + { + dict.Add("hidden", hidden.Value); + } + + if (focus.HasValue) + { + dict.Add("focus", focus.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Target.createTarget", dict); + } + + partial void ValidateDetachFromTarget(string sessionId = null, string targetId = null); + /// + /// Detaches session with given id. + /// + /// Session to detach. + /// Deprecated. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DetachFromTargetAsync(string sessionId = null, string targetId = null) + { + ValidateDetachFromTarget(sessionId, targetId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(sessionId))) + { + dict.Add("sessionId", sessionId); + } + + if (!(string.IsNullOrEmpty(targetId))) + { + dict.Add("targetId", targetId); + } + + return _client.ExecuteDevToolsMethodAsync("Target.detachFromTarget", dict); + } + + partial void ValidateDisposeBrowserContext(string browserContextId); + /// + /// Deletes a BrowserContext. All the belonging pages will be closed without calling their + /// beforeunload hooks. + /// + /// browserContextId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisposeBrowserContextAsync(string browserContextId) + { + ValidateDisposeBrowserContext(browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("browserContextId", browserContextId); + return _client.ExecuteDevToolsMethodAsync("Target.disposeBrowserContext", dict); + } + + partial void ValidateGetTargetInfo(string targetId = null); + /// + /// Returns information about a target. + /// + /// targetId + /// returns System.Threading.Tasks.Task<GetTargetInfoResponse> + public System.Threading.Tasks.Task GetTargetInfoAsync(string targetId = null) + { + ValidateGetTargetInfo(targetId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(targetId))) + { + dict.Add("targetId", targetId); + } + + return _client.ExecuteDevToolsMethodAsync("Target.getTargetInfo", dict); + } + + partial void ValidateGetTargets(System.Collections.Generic.IList filter = null); + /// + /// Retrieves a list of available targets. + /// + /// Only targets matching filter will be reported. If filter is not specifiedand target discovery is currently enabled, a filter used for target discoveryis used for consistency. + /// returns System.Threading.Tasks.Task<GetTargetsResponse> + public System.Threading.Tasks.Task GetTargetsAsync(System.Collections.Generic.IList filter = null) + { + ValidateGetTargets(filter); + var dict = new System.Collections.Generic.Dictionary(); + if ((filter) != (null)) + { + dict.Add("filter", filter.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Target.getTargets", dict); + } + + partial void ValidateSetAutoAttach(bool autoAttach, bool waitForDebuggerOnStart, bool? flatten = null, System.Collections.Generic.IList filter = null); + /// + /// Controls whether to automatically attach to new targets which are considered + /// to be directly related to this one (for example, iframes or workers). + /// When turned on, attaches to all existing related targets as well. When turned off, + /// automatically detaches from all currently attached targets. + /// This also clears all targets added by `autoAttachRelated` from the list of targets to watch + /// for creation of related targets. + /// You might want to call this recursively for auto-attached targets to attach + /// to all available targets. + /// + /// Whether to auto-attach to related targets. + /// Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`to run paused targets. + /// Enables "flat" access to the session via specifying sessionId attribute in the commands.We plan to make this the default, deprecate non-flattened mode,and eventually retire it. See crbug.com/991325. + /// Only targets matching filter will be attached. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAutoAttachAsync(bool autoAttach, bool waitForDebuggerOnStart, bool? flatten = null, System.Collections.Generic.IList filter = null) + { + ValidateSetAutoAttach(autoAttach, waitForDebuggerOnStart, flatten, filter); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("autoAttach", autoAttach); + dict.Add("waitForDebuggerOnStart", waitForDebuggerOnStart); + if (flatten.HasValue) + { + dict.Add("flatten", flatten.Value); + } + + if ((filter) != (null)) + { + dict.Add("filter", filter.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Target.setAutoAttach", dict); + } + + partial void ValidateAutoAttachRelated(string targetId, bool waitForDebuggerOnStart, System.Collections.Generic.IList filter = null); + /// + /// Adds the specified target to the list of targets that will be monitored for any related target + /// creation (such as child frames, child workers and new versions of service worker) and reported + /// through `attachedToTarget`. The specified target is also auto-attached. + /// This cancels the effect of any previous `setAutoAttach` and is also cancelled by subsequent + /// `setAutoAttach`. Only available at the Browser target. + /// + /// targetId + /// Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`to run paused targets. + /// Only targets matching filter will be attached. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AutoAttachRelatedAsync(string targetId, bool waitForDebuggerOnStart, System.Collections.Generic.IList filter = null) + { + ValidateAutoAttachRelated(targetId, waitForDebuggerOnStart, filter); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + dict.Add("waitForDebuggerOnStart", waitForDebuggerOnStart); + if ((filter) != (null)) + { + dict.Add("filter", filter.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Target.autoAttachRelated", dict); + } + + partial void ValidateSetDiscoverTargets(bool discover, System.Collections.Generic.IList filter = null); + /// + /// Controls whether to discover available targets and notify via + /// `targetCreated/targetInfoChanged/targetDestroyed` events. + /// + /// Whether to discover available targets. + /// Only targets matching filter will be attached. If `discover` is false,`filter` must be omitted or empty. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDiscoverTargetsAsync(bool discover, System.Collections.Generic.IList filter = null) + { + ValidateSetDiscoverTargets(discover, filter); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("discover", discover); + if ((filter) != (null)) + { + dict.Add("filter", filter.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Target.setDiscoverTargets", dict); + } + + partial void ValidateSetRemoteLocations(System.Collections.Generic.IList locations); + /// + /// Enables target discovery for the specified locations, when `setDiscoverTargets` was set to + /// `true`. + /// + /// List of remote locations. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetRemoteLocationsAsync(System.Collections.Generic.IList locations) + { + ValidateSetRemoteLocations(locations); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("locations", locations.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Target.setRemoteLocations", dict); + } + + partial void ValidateGetDevToolsTarget(string targetId); + /// + /// Gets the targetId of the DevTools page target opened for the given target + /// (if any). + /// + /// Page or tab target ID. + /// returns System.Threading.Tasks.Task<GetDevToolsTargetResponse> + public System.Threading.Tasks.Task GetDevToolsTargetAsync(string targetId) + { + ValidateGetDevToolsTarget(targetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + return _client.ExecuteDevToolsMethodAsync("Target.getDevToolsTarget", dict); + } + + partial void ValidateOpenDevTools(string targetId, string panelId = null); + /// + /// Opens a DevTools window for the target. + /// + /// This can be the page or tab target ID. + /// The id of the panel we want DevTools to open initially. Currentlysupported panels are elements, console, network, sources, resourcesand performance. + /// returns System.Threading.Tasks.Task<OpenDevToolsResponse> + public System.Threading.Tasks.Task OpenDevToolsAsync(string targetId, string panelId = null) + { + ValidateOpenDevTools(targetId, panelId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + if (!(string.IsNullOrEmpty(panelId))) + { + dict.Add("panelId", panelId); + } + + return _client.ExecuteDevToolsMethodAsync("Target.openDevTools", dict); + } + } +} + +namespace CefSharp.DevTools.Tethering +{ + using System.Linq; + + /// + /// The Tethering domain defines methods and events for browser port binding. + /// + public partial class TetheringClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Tethering + /// + /// DevToolsClient + public TetheringClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Informs that port was successfully bound and got a specified connection id. + /// + public event System.EventHandler Accepted + { + add + { + _client.AddEventHandler("Tethering.accepted", value); + } + + remove + { + _client.RemoveEventHandler("Tethering.accepted", value); + } + } + + partial void ValidateBind(int port); + /// + /// Request browser port binding. + /// + /// Port number to bind. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task BindAsync(int port) + { + ValidateBind(port); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("port", port); + return _client.ExecuteDevToolsMethodAsync("Tethering.bind", dict); + } + + partial void ValidateUnbind(int port); + /// + /// Request browser port unbinding. + /// + /// Port number to unbind. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UnbindAsync(int port) + { + ValidateUnbind(port); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("port", port); + return _client.ExecuteDevToolsMethodAsync("Tethering.unbind", dict); + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + /// + /// GetCategoriesResponse + /// + [DataContract] + public class GetCategoriesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] categories + { + get; + set; + } + + /// + /// categories + /// + public string[] Categories + { + get + { + return categories; + } + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + /// + /// GetTrackEventDescriptorResponse + /// + [DataContract] + public class GetTrackEventDescriptorResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string descriptor + { + get; + set; + } + + /// + /// descriptor + /// + public byte[] Descriptor + { + get + { + return Convert(descriptor); + } + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + /// + /// RequestMemoryDumpResponse + /// + [DataContract] + public class RequestMemoryDumpResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string dumpGuid + { + get; + set; + } + + /// + /// dumpGuid + /// + public string DumpGuid + { + get + { + return dumpGuid; + } + } + + [DataMember] + internal bool success + { + get; + set; + } + + /// + /// success + /// + public bool Success + { + get + { + return success; + } + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + using System.Linq; + + /// + /// Whether to report trace events as series of dataCollected events or to save trace to a + /// stream (defaults to `ReportEvents`). + /// + public enum StartTransferMode + { + /// + /// ReportEvents + /// + [EnumMember(Value = ("ReportEvents"))] + ReportEvents, + /// + /// ReturnAsStream + /// + [EnumMember(Value = ("ReturnAsStream"))] + ReturnAsStream + } + + /// + /// Tracing + /// + public partial class TracingClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Tracing + /// + /// DevToolsClient + public TracingClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// BufferUsage + /// + public event System.EventHandler BufferUsage + { + add + { + _client.AddEventHandler("Tracing.bufferUsage", value); + } + + remove + { + _client.RemoveEventHandler("Tracing.bufferUsage", value); + } + } + + /// + /// Contains a bucket of collected trace events. When tracing is stopped collected events will be + /// sent as a sequence of dataCollected events followed by tracingComplete event. + /// + public event System.EventHandler DataCollected + { + add + { + _client.AddEventHandler("Tracing.dataCollected", value); + } + + remove + { + _client.RemoveEventHandler("Tracing.dataCollected", value); + } + } + + /// + /// Signals that tracing is stopped and there is no trace buffers pending flush, all data were + /// delivered via dataCollected events. + /// + public event System.EventHandler TracingComplete + { + add + { + _client.AddEventHandler("Tracing.tracingComplete", value); + } + + remove + { + _client.RemoveEventHandler("Tracing.tracingComplete", value); + } + } + + /// + /// Stop trace events collection. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EndAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Tracing.end", dict); + } + + /// + /// Gets supported tracing categories. + /// + /// returns System.Threading.Tasks.Task<GetCategoriesResponse> + public System.Threading.Tasks.Task GetCategoriesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Tracing.getCategories", dict); + } + + /// + /// Return a descriptor for all available tracing categories. + /// + /// returns System.Threading.Tasks.Task<GetTrackEventDescriptorResponse> + public System.Threading.Tasks.Task GetTrackEventDescriptorAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Tracing.getTrackEventDescriptor", dict); + } + + partial void ValidateRecordClockSyncMarker(string syncId); + /// + /// Record a clock sync marker in the trace. + /// + /// The ID of this clock sync marker + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RecordClockSyncMarkerAsync(string syncId) + { + ValidateRecordClockSyncMarker(syncId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("syncId", syncId); + return _client.ExecuteDevToolsMethodAsync("Tracing.recordClockSyncMarker", dict); + } + + partial void ValidateRequestMemoryDump(bool? deterministic = null, CefSharp.DevTools.Tracing.MemoryDumpLevelOfDetail? levelOfDetail = null); + /// + /// Request a global memory dump. + /// + /// Enables more deterministic results by forcing garbage collection + /// Specifies level of details in memory dump. Defaults to "detailed". + /// returns System.Threading.Tasks.Task<RequestMemoryDumpResponse> + public System.Threading.Tasks.Task RequestMemoryDumpAsync(bool? deterministic = null, CefSharp.DevTools.Tracing.MemoryDumpLevelOfDetail? levelOfDetail = null) + { + ValidateRequestMemoryDump(deterministic, levelOfDetail); + var dict = new System.Collections.Generic.Dictionary(); + if (deterministic.HasValue) + { + dict.Add("deterministic", deterministic.Value); + } + + if (levelOfDetail.HasValue) + { + dict.Add("levelOfDetail", EnumToString(levelOfDetail)); + } + + return _client.ExecuteDevToolsMethodAsync("Tracing.requestMemoryDump", dict); + } + + partial void ValidateStart(string categories = null, string options = null, double? bufferUsageReportingInterval = null, CefSharp.DevTools.Tracing.StartTransferMode? transferMode = null, CefSharp.DevTools.Tracing.StreamFormat? streamFormat = null, CefSharp.DevTools.Tracing.StreamCompression? streamCompression = null, CefSharp.DevTools.Tracing.TraceConfig traceConfig = null, byte[] perfettoConfig = null, CefSharp.DevTools.Tracing.TracingBackend? tracingBackend = null); + /// + /// Start trace events collection. + /// + /// Category/tag filter + /// Tracing options + /// If set, the agent will issue bufferUsage events at this interval, specified in milliseconds + /// Whether to report trace events as series of dataCollected events or to save trace to astream (defaults to `ReportEvents`). + /// Trace data format to use. This only applies when using `ReturnAsStream`transfer mode (defaults to `json`). + /// Compression format to use. This only applies when using `ReturnAsStream`transfer mode (defaults to `none`) + /// traceConfig + /// Base64-encoded serialized perfetto.protos.TraceConfig protobuf messageWhen specified, the parameters `categories`, `options`, `traceConfig`are ignored. + /// Backend type (defaults to `auto`) + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartAsync(string categories = null, string options = null, double? bufferUsageReportingInterval = null, CefSharp.DevTools.Tracing.StartTransferMode? transferMode = null, CefSharp.DevTools.Tracing.StreamFormat? streamFormat = null, CefSharp.DevTools.Tracing.StreamCompression? streamCompression = null, CefSharp.DevTools.Tracing.TraceConfig traceConfig = null, byte[] perfettoConfig = null, CefSharp.DevTools.Tracing.TracingBackend? tracingBackend = null) + { + ValidateStart(categories, options, bufferUsageReportingInterval, transferMode, streamFormat, streamCompression, traceConfig, perfettoConfig, tracingBackend); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(categories))) + { + dict.Add("categories", categories); + } + + if (!(string.IsNullOrEmpty(options))) + { + dict.Add("options", options); + } + + if (bufferUsageReportingInterval.HasValue) + { + dict.Add("bufferUsageReportingInterval", bufferUsageReportingInterval.Value); + } + + if (transferMode.HasValue) + { + dict.Add("transferMode", EnumToString(transferMode)); + } + + if (streamFormat.HasValue) + { + dict.Add("streamFormat", EnumToString(streamFormat)); + } + + if (streamCompression.HasValue) + { + dict.Add("streamCompression", EnumToString(streamCompression)); + } + + if ((traceConfig) != (null)) + { + dict.Add("traceConfig", traceConfig.ToDictionary()); + } + + if ((perfettoConfig) != (null)) + { + dict.Add("perfettoConfig", ToBase64String(perfettoConfig)); + } + + if (tracingBackend.HasValue) + { + dict.Add("tracingBackend", EnumToString(tracingBackend)); + } + + return _client.ExecuteDevToolsMethodAsync("Tracing.start", dict); + } + } +} + +namespace CefSharp.DevTools.WebAudio +{ + /// + /// GetRealtimeDataResponse + /// + [DataContract] + public class GetRealtimeDataResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.WebAudio.ContextRealtimeData realtimeData + { + get; + set; + } + + /// + /// realtimeData + /// + public CefSharp.DevTools.WebAudio.ContextRealtimeData RealtimeData + { + get + { + return realtimeData; + } + } + } +} + +namespace CefSharp.DevTools.WebAudio +{ + using System.Linq; + + /// + /// This domain allows inspection of Web Audio API. + /// https://webaudio.github.io/web-audio-api/ + /// + public partial class WebAudioClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// WebAudio + /// + /// DevToolsClient + public WebAudioClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Notifies that a new BaseAudioContext has been created. + /// + public event System.EventHandler ContextCreated + { + add + { + _client.AddEventHandler("WebAudio.contextCreated", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.contextCreated", value); + } + } + + /// + /// Notifies that an existing BaseAudioContext will be destroyed. + /// + public event System.EventHandler ContextWillBeDestroyed + { + add + { + _client.AddEventHandler("WebAudio.contextWillBeDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.contextWillBeDestroyed", value); + } + } + + /// + /// Notifies that existing BaseAudioContext has changed some properties (id stays the same).. + /// + public event System.EventHandler ContextChanged + { + add + { + _client.AddEventHandler("WebAudio.contextChanged", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.contextChanged", value); + } + } + + /// + /// Notifies that the construction of an AudioListener has finished. + /// + public event System.EventHandler AudioListenerCreated + { + add + { + _client.AddEventHandler("WebAudio.audioListenerCreated", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioListenerCreated", value); + } + } + + /// + /// Notifies that a new AudioListener has been created. + /// + public event System.EventHandler AudioListenerWillBeDestroyed + { + add + { + _client.AddEventHandler("WebAudio.audioListenerWillBeDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioListenerWillBeDestroyed", value); + } + } + + /// + /// Notifies that a new AudioNode has been created. + /// + public event System.EventHandler AudioNodeCreated + { + add + { + _client.AddEventHandler("WebAudio.audioNodeCreated", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioNodeCreated", value); + } + } + + /// + /// Notifies that an existing AudioNode has been destroyed. + /// + public event System.EventHandler AudioNodeWillBeDestroyed + { + add + { + _client.AddEventHandler("WebAudio.audioNodeWillBeDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioNodeWillBeDestroyed", value); + } + } + + /// + /// Notifies that a new AudioParam has been created. + /// + public event System.EventHandler AudioParamCreated + { + add + { + _client.AddEventHandler("WebAudio.audioParamCreated", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioParamCreated", value); + } + } + + /// + /// Notifies that an existing AudioParam has been destroyed. + /// + public event System.EventHandler AudioParamWillBeDestroyed + { + add + { + _client.AddEventHandler("WebAudio.audioParamWillBeDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioParamWillBeDestroyed", value); + } + } + + /// + /// Notifies that two AudioNodes are connected. + /// + public event System.EventHandler NodesConnected + { + add + { + _client.AddEventHandler("WebAudio.nodesConnected", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.nodesConnected", value); + } + } + + /// + /// Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected. + /// + public event System.EventHandler NodesDisconnected + { + add + { + _client.AddEventHandler("WebAudio.nodesDisconnected", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.nodesDisconnected", value); + } + } + + /// + /// Notifies that an AudioNode is connected to an AudioParam. + /// + public event System.EventHandler NodeParamConnected + { + add + { + _client.AddEventHandler("WebAudio.nodeParamConnected", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.nodeParamConnected", value); + } + } + + /// + /// Notifies that an AudioNode is disconnected to an AudioParam. + /// + public event System.EventHandler NodeParamDisconnected + { + add + { + _client.AddEventHandler("WebAudio.nodeParamDisconnected", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.nodeParamDisconnected", value); + } + } + + /// + /// Enables the WebAudio domain and starts sending context lifetime events. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("WebAudio.enable", dict); + } + + /// + /// Disables the WebAudio domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("WebAudio.disable", dict); + } + + partial void ValidateGetRealtimeData(string contextId); + /// + /// Fetch the realtime data from the registered contexts. + /// + /// contextId + /// returns System.Threading.Tasks.Task<GetRealtimeDataResponse> + public System.Threading.Tasks.Task GetRealtimeDataAsync(string contextId) + { + ValidateGetRealtimeData(contextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("contextId", contextId); + return _client.ExecuteDevToolsMethodAsync("WebAudio.getRealtimeData", dict); + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + /// + /// AddVirtualAuthenticatorResponse + /// + [DataContract] + public class AddVirtualAuthenticatorResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string authenticatorId + { + get; + set; + } + + /// + /// authenticatorId + /// + public string AuthenticatorId + { + get + { + return authenticatorId; + } + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + /// + /// GetCredentialResponse + /// + [DataContract] + public class GetCredentialResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.WebAuthn.Credential credential + { + get; + set; + } + + /// + /// credential + /// + public CefSharp.DevTools.WebAuthn.Credential Credential + { + get + { + return credential; + } + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + /// + /// GetCredentialsResponse + /// + [DataContract] + public class GetCredentialsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList credentials + { + get; + set; + } + + /// + /// credentials + /// + public System.Collections.Generic.IList Credentials + { + get + { + return credentials; + } + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + using System.Linq; + + /// + /// This domain allows configuring virtual authenticators to test the WebAuthn + /// API. + /// + public partial class WebAuthnClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// WebAuthn + /// + /// DevToolsClient + public WebAuthnClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Triggered when a credential is added to an authenticator. + /// + public event System.EventHandler CredentialAdded + { + add + { + _client.AddEventHandler("WebAuthn.credentialAdded", value); + } + + remove + { + _client.RemoveEventHandler("WebAuthn.credentialAdded", value); + } + } + + /// + /// Triggered when a credential is deleted, e.g. through + /// PublicKeyCredential.signalUnknownCredential(). + /// + public event System.EventHandler CredentialDeleted + { + add + { + _client.AddEventHandler("WebAuthn.credentialDeleted", value); + } + + remove + { + _client.RemoveEventHandler("WebAuthn.credentialDeleted", value); + } + } + + /// + /// Triggered when a credential is updated, e.g. through + /// PublicKeyCredential.signalCurrentUserDetails(). + /// + public event System.EventHandler CredentialUpdated + { + add + { + _client.AddEventHandler("WebAuthn.credentialUpdated", value); + } + + remove + { + _client.RemoveEventHandler("WebAuthn.credentialUpdated", value); + } + } + + /// + /// Triggered when a credential is used in a webauthn assertion. + /// + public event System.EventHandler CredentialAsserted + { + add + { + _client.AddEventHandler("WebAuthn.credentialAsserted", value); + } + + remove + { + _client.RemoveEventHandler("WebAuthn.credentialAsserted", value); + } + } + + partial void ValidateEnable(bool? enableUI = null); + /// + /// Enable the WebAuthn domain and start intercepting credential storage and + /// retrieval with a virtual authenticator. + /// + /// Whether to enable the WebAuthn user interface. Enabling the UI isrecommended for debugging and demo purposes, as it is closer to the realexperience. Disabling the UI is recommended for automated testing.Supported at the embedder's discretion if UI is available.Defaults to false. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(bool? enableUI = null) + { + ValidateEnable(enableUI); + var dict = new System.Collections.Generic.Dictionary(); + if (enableUI.HasValue) + { + dict.Add("enableUI", enableUI.Value); + } + + return _client.ExecuteDevToolsMethodAsync("WebAuthn.enable", dict); + } + + /// + /// Disable the WebAuthn domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("WebAuthn.disable", dict); + } + + partial void ValidateAddVirtualAuthenticator(CefSharp.DevTools.WebAuthn.VirtualAuthenticatorOptions options); + /// + /// Creates and adds a virtual authenticator. + /// + /// options + /// returns System.Threading.Tasks.Task<AddVirtualAuthenticatorResponse> + public System.Threading.Tasks.Task AddVirtualAuthenticatorAsync(CefSharp.DevTools.WebAuthn.VirtualAuthenticatorOptions options) + { + ValidateAddVirtualAuthenticator(options); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("options", options.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.addVirtualAuthenticator", dict); + } + + partial void ValidateSetResponseOverrideBits(string authenticatorId, bool? isBogusSignature = null, bool? isBadUV = null, bool? isBadUP = null); + /// + /// Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present. + /// + /// authenticatorId + /// If isBogusSignature is set, overrides the signature in the authenticator response to be zero.Defaults to false. + /// If isBadUV is set, overrides the UV bit in the flags in the authenticator response tobe zero. Defaults to false. + /// If isBadUP is set, overrides the UP bit in the flags in the authenticator response tobe zero. Defaults to false. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetResponseOverrideBitsAsync(string authenticatorId, bool? isBogusSignature = null, bool? isBadUV = null, bool? isBadUP = null) + { + ValidateSetResponseOverrideBits(authenticatorId, isBogusSignature, isBadUV, isBadUP); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + if (isBogusSignature.HasValue) + { + dict.Add("isBogusSignature", isBogusSignature.Value); + } + + if (isBadUV.HasValue) + { + dict.Add("isBadUV", isBadUV.Value); + } + + if (isBadUP.HasValue) + { + dict.Add("isBadUP", isBadUP.Value); + } + + return _client.ExecuteDevToolsMethodAsync("WebAuthn.setResponseOverrideBits", dict); + } + + partial void ValidateRemoveVirtualAuthenticator(string authenticatorId); + /// + /// Removes the given authenticator. + /// + /// authenticatorId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveVirtualAuthenticatorAsync(string authenticatorId) + { + ValidateRemoveVirtualAuthenticator(authenticatorId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.removeVirtualAuthenticator", dict); + } + + partial void ValidateAddCredential(string authenticatorId, CefSharp.DevTools.WebAuthn.Credential credential); + /// + /// Adds the credential to the specified authenticator. + /// + /// authenticatorId + /// credential + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddCredentialAsync(string authenticatorId, CefSharp.DevTools.WebAuthn.Credential credential) + { + ValidateAddCredential(authenticatorId, credential); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("credential", credential.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.addCredential", dict); + } + + partial void ValidateGetCredential(string authenticatorId, byte[] credentialId); + /// + /// Returns a single credential stored in the given virtual authenticator that + /// matches the credential ID. + /// + /// authenticatorId + /// credentialId + /// returns System.Threading.Tasks.Task<GetCredentialResponse> + public System.Threading.Tasks.Task GetCredentialAsync(string authenticatorId, byte[] credentialId) + { + ValidateGetCredential(authenticatorId, credentialId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("credentialId", ToBase64String(credentialId)); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.getCredential", dict); + } + + partial void ValidateGetCredentials(string authenticatorId); + /// + /// Returns all the credentials stored in the given virtual authenticator. + /// + /// authenticatorId + /// returns System.Threading.Tasks.Task<GetCredentialsResponse> + public System.Threading.Tasks.Task GetCredentialsAsync(string authenticatorId) + { + ValidateGetCredentials(authenticatorId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.getCredentials", dict); + } + + partial void ValidateRemoveCredential(string authenticatorId, byte[] credentialId); + /// + /// Removes a credential from the authenticator. + /// + /// authenticatorId + /// credentialId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveCredentialAsync(string authenticatorId, byte[] credentialId) + { + ValidateRemoveCredential(authenticatorId, credentialId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("credentialId", ToBase64String(credentialId)); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.removeCredential", dict); + } + + partial void ValidateClearCredentials(string authenticatorId); + /// + /// Clears all the credentials from the specified device. + /// + /// authenticatorId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearCredentialsAsync(string authenticatorId) + { + ValidateClearCredentials(authenticatorId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.clearCredentials", dict); + } + + partial void ValidateSetUserVerified(string authenticatorId, bool isUserVerified); + /// + /// Sets whether User Verification succeeds or fails for an authenticator. + /// The default is true. + /// + /// authenticatorId + /// isUserVerified + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetUserVerifiedAsync(string authenticatorId, bool isUserVerified) + { + ValidateSetUserVerified(authenticatorId, isUserVerified); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("isUserVerified", isUserVerified); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.setUserVerified", dict); + } + + partial void ValidateSetAutomaticPresenceSimulation(string authenticatorId, bool enabled); + /// + /// Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. + /// The default is true. + /// + /// authenticatorId + /// enabled + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAutomaticPresenceSimulationAsync(string authenticatorId, bool enabled) + { + ValidateSetAutomaticPresenceSimulation(authenticatorId, enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.setAutomaticPresenceSimulation", dict); + } + + partial void ValidateSetCredentialProperties(string authenticatorId, byte[] credentialId, bool? backupEligibility = null, bool? backupState = null); + /// + /// Allows setting credential properties. + /// https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties + /// + /// authenticatorId + /// credentialId + /// backupEligibility + /// backupState + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCredentialPropertiesAsync(string authenticatorId, byte[] credentialId, bool? backupEligibility = null, bool? backupState = null) + { + ValidateSetCredentialProperties(authenticatorId, credentialId, backupEligibility, backupState); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("credentialId", ToBase64String(credentialId)); + if (backupEligibility.HasValue) + { + dict.Add("backupEligibility", backupEligibility.Value); + } + + if (backupState.HasValue) + { + dict.Add("backupState", backupState.Value); + } + + return _client.ExecuteDevToolsMethodAsync("WebAuthn.setCredentialProperties", dict); + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// EnableResponse + /// + [DataContract] + public class EnableResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string debuggerId + { + get; + set; + } + + /// + /// debuggerId + /// + public string DebuggerId + { + get + { + return debuggerId; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// EvaluateOnCallFrameResponse + /// + [DataContract] + public class EvaluateOnCallFrameResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject result + { + get; + set; + } + + /// + /// result + /// + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get + { + return result; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// GetPossibleBreakpointsResponse + /// + [DataContract] + public class GetPossibleBreakpointsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList locations + { + get; + set; + } + + /// + /// locations + /// + public System.Collections.Generic.IList Locations + { + get + { + return locations; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// GetScriptSourceResponse + /// + [DataContract] + public class GetScriptSourceResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string scriptSource + { + get; + set; + } + + /// + /// scriptSource + /// + public string ScriptSource + { + get + { + return scriptSource; + } + } + + [DataMember] + internal string bytecode + { + get; + set; + } + + /// + /// bytecode + /// + public byte[] Bytecode + { + get + { + return Convert(bytecode); + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// DisassembleWasmModuleResponse + /// + [DataContract] + public class DisassembleWasmModuleResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string streamId + { + get; + set; + } + + /// + /// streamId + /// + public string StreamId + { + get + { + return streamId; + } + } + + [DataMember] + internal int totalNumberOfLines + { + get; + set; + } + + /// + /// totalNumberOfLines + /// + public int TotalNumberOfLines + { + get + { + return totalNumberOfLines; + } + } + + [DataMember] + internal int[] functionBodyOffsets + { + get; + set; + } + + /// + /// functionBodyOffsets + /// + public int[] FunctionBodyOffsets + { + get + { + return functionBodyOffsets; + } + } + + [DataMember] + internal CefSharp.DevTools.Debugger.WasmDisassemblyChunk chunk + { + get; + set; + } + + /// + /// chunk + /// + public CefSharp.DevTools.Debugger.WasmDisassemblyChunk Chunk + { + get + { + return chunk; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// NextWasmDisassemblyChunkResponse + /// + [DataContract] + public class NextWasmDisassemblyChunkResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Debugger.WasmDisassemblyChunk chunk + { + get; + set; + } + + /// + /// chunk + /// + public CefSharp.DevTools.Debugger.WasmDisassemblyChunk Chunk + { + get + { + return chunk; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// GetStackTraceResponse + /// + [DataContract] + public class GetStackTraceResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.StackTrace stackTrace + { + get; + set; + } + + /// + /// stackTrace + /// + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get + { + return stackTrace; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// RestartFrameResponse + /// + [DataContract] + public class RestartFrameResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList callFrames + { + get; + set; + } + + /// + /// callFrames + /// + public System.Collections.Generic.IList CallFrames + { + get + { + return callFrames; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.StackTrace asyncStackTrace + { + get; + set; + } + + /// + /// asyncStackTrace + /// + public CefSharp.DevTools.Runtime.StackTrace AsyncStackTrace + { + get + { + return asyncStackTrace; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.StackTraceId asyncStackTraceId + { + get; + set; + } + + /// + /// asyncStackTraceId + /// + public CefSharp.DevTools.Runtime.StackTraceId AsyncStackTraceId + { + get + { + return asyncStackTraceId; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SearchInContentResponse + /// + [DataContract] + public class SearchInContentResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList result + { + get; + set; + } + + /// + /// result + /// + public System.Collections.Generic.IList Result + { + get + { + return result; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetBreakpointResponse + /// + [DataContract] + public class SetBreakpointResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string breakpointId + { + get; + set; + } + + /// + /// breakpointId + /// + public string BreakpointId + { + get + { + return breakpointId; + } + } + + [DataMember] + internal CefSharp.DevTools.Debugger.Location actualLocation + { + get; + set; + } + + /// + /// actualLocation + /// + public CefSharp.DevTools.Debugger.Location ActualLocation + { + get + { + return actualLocation; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetInstrumentationBreakpointResponse + /// + [DataContract] + public class SetInstrumentationBreakpointResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string breakpointId + { + get; + set; + } + + /// + /// breakpointId + /// + public string BreakpointId + { + get + { + return breakpointId; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetBreakpointByUrlResponse + /// + [DataContract] + public class SetBreakpointByUrlResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string breakpointId + { + get; + set; + } + + /// + /// breakpointId + /// + public string BreakpointId + { + get + { + return breakpointId; + } + } + + [DataMember] + internal System.Collections.Generic.IList locations + { + get; + set; + } + + /// + /// locations + /// + public System.Collections.Generic.IList Locations + { + get + { + return locations; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetBreakpointOnFunctionCallResponse + /// + [DataContract] + public class SetBreakpointOnFunctionCallResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string breakpointId + { + get; + set; + } + + /// + /// breakpointId + /// + public string BreakpointId + { + get + { + return breakpointId; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetScriptSourceResponse + /// + [DataContract] + public class SetScriptSourceResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList callFrames + { + get; + set; + } + + /// + /// callFrames + /// + public System.Collections.Generic.IList CallFrames + { + get + { + return callFrames; + } + } + + [DataMember] + internal bool? stackChanged + { + get; + set; + } + + /// + /// stackChanged + /// + public bool? StackChanged + { + get + { + return stackChanged; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.StackTrace asyncStackTrace + { + get; + set; + } + + /// + /// asyncStackTrace + /// + public CefSharp.DevTools.Runtime.StackTrace AsyncStackTrace + { + get + { + return asyncStackTrace; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.StackTraceId asyncStackTraceId + { + get; + set; + } + + /// + /// asyncStackTraceId + /// + public CefSharp.DevTools.Runtime.StackTraceId AsyncStackTraceId + { + get + { + return asyncStackTraceId; + } + } + + [DataMember] + internal string status + { + get; + set; + } + + /// + /// status + /// + public string Status + { + get + { + return status; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + using System.Linq; + + /// + /// ContinueToLocationTargetCallFrames + /// + public enum ContinueToLocationTargetCallFrames + { + /// + /// any + /// + [EnumMember(Value = ("any"))] + Any, + /// + /// current + /// + [EnumMember(Value = ("current"))] + Current + } + + /// + /// The `mode` parameter must be present and set to 'StepInto', otherwise + /// `restartFrame` will error out. + /// + public enum RestartFrameMode + { + /// + /// StepInto + /// + [EnumMember(Value = ("StepInto"))] + StepInto + } + + /// + /// Instrumentation name. + /// + public enum SetInstrumentationBreakpointInstrumentation + { + /// + /// beforeScriptExecution + /// + [EnumMember(Value = ("beforeScriptExecution"))] + BeforeScriptExecution, + /// + /// beforeScriptWithSourceMapExecution + /// + [EnumMember(Value = ("beforeScriptWithSourceMapExecution"))] + BeforeScriptWithSourceMapExecution + } + + /// + /// Pause on exceptions mode. + /// + public enum SetPauseOnExceptionsState + { + /// + /// none + /// + [EnumMember(Value = ("none"))] + None, + /// + /// caught + /// + [EnumMember(Value = ("caught"))] + Caught, + /// + /// uncaught + /// + [EnumMember(Value = ("uncaught"))] + Uncaught, + /// + /// all + /// + [EnumMember(Value = ("all"))] + All + } + + /// + /// Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing + /// breakpoints, stepping through execution, exploring stack traces, etc. + /// + public partial class DebuggerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Debugger + /// + /// DevToolsClient + public DebuggerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + /// + public event System.EventHandler Paused + { + add + { + _client.AddEventHandler("Debugger.paused", value); + } + + remove + { + _client.RemoveEventHandler("Debugger.paused", value); + } + } + + /// + /// Fired when the virtual machine resumed execution. + /// + public event System.EventHandler Resumed + { + add + { + _client.AddEventHandler("Debugger.resumed", value); + } + + remove + { + _client.RemoveEventHandler("Debugger.resumed", value); + } + } + + /// + /// Fired when virtual machine fails to parse the script. + /// + public event System.EventHandler ScriptFailedToParse + { + add + { + _client.AddEventHandler("Debugger.scriptFailedToParse", value); + } + + remove + { + _client.RemoveEventHandler("Debugger.scriptFailedToParse", value); + } + } + + /// + /// Fired when virtual machine parses script. This event is also fired for all known and uncollected + /// scripts upon enabling debugger. + /// + public event System.EventHandler ScriptParsed + { + add + { + _client.AddEventHandler("Debugger.scriptParsed", value); + } + + remove + { + _client.RemoveEventHandler("Debugger.scriptParsed", value); + } + } + + partial void ValidateContinueToLocation(CefSharp.DevTools.Debugger.Location location, CefSharp.DevTools.Debugger.ContinueToLocationTargetCallFrames? targetCallFrames = null); + /// + /// Continues execution until specific location is reached. + /// + /// Location to continue to. + /// targetCallFrames + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ContinueToLocationAsync(CefSharp.DevTools.Debugger.Location location, CefSharp.DevTools.Debugger.ContinueToLocationTargetCallFrames? targetCallFrames = null) + { + ValidateContinueToLocation(location, targetCallFrames); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("location", location.ToDictionary()); + if (targetCallFrames.HasValue) + { + dict.Add("targetCallFrames", EnumToString(targetCallFrames)); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.continueToLocation", dict); + } + + /// + /// Disables debugger for given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Debugger.disable", dict); + } + + partial void ValidateEnable(double? maxScriptsCacheSize = null); + /// + /// Enables debugger for the given page. Clients should not assume that the debugging has been + /// enabled until the result for this command is received. + /// + /// The maximum size in bytes of collected scripts (not referenced by other heap objects)the debugger can hold. Puts no limit if parameter is omitted. + /// returns System.Threading.Tasks.Task<EnableResponse> + public System.Threading.Tasks.Task EnableAsync(double? maxScriptsCacheSize = null) + { + ValidateEnable(maxScriptsCacheSize); + var dict = new System.Collections.Generic.Dictionary(); + if (maxScriptsCacheSize.HasValue) + { + dict.Add("maxScriptsCacheSize", maxScriptsCacheSize.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.enable", dict); + } + + partial void ValidateEvaluateOnCallFrame(string callFrameId, string expression, string objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? throwOnSideEffect = null, double? timeout = null); + /// + /// Evaluates expression on a given call frame. + /// + /// Call frame identifier to evaluate on. + /// Expression to evaluate. + /// String object group name to put result into (allows rapid releasing resulting object handlesusing `releaseObjectGroup`). + /// Specifies whether command line API should be available to the evaluated expression, defaultsto false. + /// In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state. + /// Whether the result is expected to be a JSON object that should be sent by value. + /// Whether preview should be generated for the result. + /// Whether to throw an exception if side effect cannot be ruled out during evaluation. + /// Terminate execution after timing out (number of milliseconds). + /// returns System.Threading.Tasks.Task<EvaluateOnCallFrameResponse> + public System.Threading.Tasks.Task EvaluateOnCallFrameAsync(string callFrameId, string expression, string objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? throwOnSideEffect = null, double? timeout = null) + { + ValidateEvaluateOnCallFrame(callFrameId, expression, objectGroup, includeCommandLineAPI, silent, returnByValue, generatePreview, throwOnSideEffect, timeout); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("callFrameId", callFrameId); + dict.Add("expression", expression); + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (includeCommandLineAPI.HasValue) + { + dict.Add("includeCommandLineAPI", includeCommandLineAPI.Value); + } + + if (silent.HasValue) + { + dict.Add("silent", silent.Value); + } + + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (throwOnSideEffect.HasValue) + { + dict.Add("throwOnSideEffect", throwOnSideEffect.Value); + } + + if (timeout.HasValue) + { + dict.Add("timeout", timeout.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.evaluateOnCallFrame", dict); + } + + partial void ValidateGetPossibleBreakpoints(CefSharp.DevTools.Debugger.Location start, CefSharp.DevTools.Debugger.Location end = null, bool? restrictToFunction = null); + /// + /// Returns possible locations for breakpoint. scriptId in start and end range locations should be + /// the same. + /// + /// Start of range to search possible breakpoint locations in. + /// End of range to search possible breakpoint locations in (excluding). When not specified, endof scripts is used as end of range. + /// Only consider locations which are in the same (non-nested) function as start. + /// returns System.Threading.Tasks.Task<GetPossibleBreakpointsResponse> + public System.Threading.Tasks.Task GetPossibleBreakpointsAsync(CefSharp.DevTools.Debugger.Location start, CefSharp.DevTools.Debugger.Location end = null, bool? restrictToFunction = null) + { + ValidateGetPossibleBreakpoints(start, end, restrictToFunction); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("start", start.ToDictionary()); + if ((end) != (null)) + { + dict.Add("end", end.ToDictionary()); + } + + if (restrictToFunction.HasValue) + { + dict.Add("restrictToFunction", restrictToFunction.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.getPossibleBreakpoints", dict); + } + + partial void ValidateGetScriptSource(string scriptId); + /// + /// Returns source for the script with given id. + /// + /// Id of the script to get source for. + /// returns System.Threading.Tasks.Task<GetScriptSourceResponse> + public System.Threading.Tasks.Task GetScriptSourceAsync(string scriptId) + { + ValidateGetScriptSource(scriptId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + return _client.ExecuteDevToolsMethodAsync("Debugger.getScriptSource", dict); + } + + partial void ValidateDisassembleWasmModule(string scriptId); + /// + /// DisassembleWasmModule + /// + /// Id of the script to disassemble + /// returns System.Threading.Tasks.Task<DisassembleWasmModuleResponse> + public System.Threading.Tasks.Task DisassembleWasmModuleAsync(string scriptId) + { + ValidateDisassembleWasmModule(scriptId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + return _client.ExecuteDevToolsMethodAsync("Debugger.disassembleWasmModule", dict); + } + + partial void ValidateNextWasmDisassemblyChunk(string streamId); + /// + /// Disassemble the next chunk of lines for the module corresponding to the + /// stream. If disassembly is complete, this API will invalidate the streamId + /// and return an empty chunk. Any subsequent calls for the now invalid stream + /// will return errors. + /// + /// streamId + /// returns System.Threading.Tasks.Task<NextWasmDisassemblyChunkResponse> + public System.Threading.Tasks.Task NextWasmDisassemblyChunkAsync(string streamId) + { + ValidateNextWasmDisassemblyChunk(streamId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("streamId", streamId); + return _client.ExecuteDevToolsMethodAsync("Debugger.nextWasmDisassemblyChunk", dict); + } + + partial void ValidateGetStackTrace(CefSharp.DevTools.Runtime.StackTraceId stackTraceId); + /// + /// Returns stack trace with given `stackTraceId`. + /// + /// stackTraceId + /// returns System.Threading.Tasks.Task<GetStackTraceResponse> + public System.Threading.Tasks.Task GetStackTraceAsync(CefSharp.DevTools.Runtime.StackTraceId stackTraceId) + { + ValidateGetStackTrace(stackTraceId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("stackTraceId", stackTraceId.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Debugger.getStackTrace", dict); + } + + /// + /// Stops on the next JavaScript statement. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task PauseAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Debugger.pause", dict); + } + + partial void ValidateRemoveBreakpoint(string breakpointId); + /// + /// Removes JavaScript breakpoint. + /// + /// breakpointId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveBreakpointAsync(string breakpointId) + { + ValidateRemoveBreakpoint(breakpointId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("breakpointId", breakpointId); + return _client.ExecuteDevToolsMethodAsync("Debugger.removeBreakpoint", dict); + } + + partial void ValidateRestartFrame(string callFrameId, CefSharp.DevTools.Debugger.RestartFrameMode? mode = null); + /// + /// Restarts particular call frame from the beginning. The old, deprecated + /// behavior of `restartFrame` is to stay paused and allow further CDP commands + /// after a restart was scheduled. This can cause problems with restarting, so + /// we now continue execution immediatly after it has been scheduled until we + /// reach the beginning of the restarted frame. + /// + /// To stay back-wards compatible, `restartFrame` now expects a `mode` + /// parameter to be present. If the `mode` parameter is missing, `restartFrame` + /// errors out. + /// + /// The various return values are deprecated and `callFrames` is always empty. + /// Use the call frames from the `Debugger#paused` events instead, that fires + /// once V8 pauses at the beginning of the restarted function. + /// + /// Call frame identifier to evaluate on. + /// The `mode` parameter must be present and set to 'StepInto', otherwise`restartFrame` will error out. + /// returns System.Threading.Tasks.Task<RestartFrameResponse> + public System.Threading.Tasks.Task RestartFrameAsync(string callFrameId, CefSharp.DevTools.Debugger.RestartFrameMode? mode = null) + { + ValidateRestartFrame(callFrameId, mode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("callFrameId", callFrameId); + if (mode.HasValue) + { + dict.Add("mode", EnumToString(mode)); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.restartFrame", dict); + } + + partial void ValidateResume(bool? terminateOnResume = null); + /// + /// Resumes JavaScript execution. + /// + /// Set to true to terminate execution upon resuming execution. In contrastto Runtime.terminateExecution, this will allows to execute furtherJavaScript (i.e. via evaluation) until execution of the paused codeis actually resumed, at which point termination is triggered.If execution is currently not paused, this parameter has no effect. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResumeAsync(bool? terminateOnResume = null) + { + ValidateResume(terminateOnResume); + var dict = new System.Collections.Generic.Dictionary(); + if (terminateOnResume.HasValue) + { + dict.Add("terminateOnResume", terminateOnResume.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.resume", dict); + } + + partial void ValidateSearchInContent(string scriptId, string query, bool? caseSensitive = null, bool? isRegex = null); + /// + /// Searches for given string in script content. + /// + /// Id of the script to search in. + /// String to search for. + /// If true, search is case sensitive. + /// If true, treats string parameter as regex. + /// returns System.Threading.Tasks.Task<SearchInContentResponse> + public System.Threading.Tasks.Task SearchInContentAsync(string scriptId, string query, bool? caseSensitive = null, bool? isRegex = null) + { + ValidateSearchInContent(scriptId, query, caseSensitive, isRegex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + dict.Add("query", query); + if (caseSensitive.HasValue) + { + dict.Add("caseSensitive", caseSensitive.Value); + } + + if (isRegex.HasValue) + { + dict.Add("isRegex", isRegex.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.searchInContent", dict); + } + + partial void ValidateSetAsyncCallStackDepth(int maxDepth); + /// + /// Enables or disables async call stacks tracking. + /// + /// Maximum depth of async call stacks. Setting to `0` will effectively disable collecting asynccall stacks (default). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAsyncCallStackDepthAsync(int maxDepth) + { + ValidateSetAsyncCallStackDepth(maxDepth); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("maxDepth", maxDepth); + return _client.ExecuteDevToolsMethodAsync("Debugger.setAsyncCallStackDepth", dict); + } + + partial void ValidateSetBlackboxExecutionContexts(string[] uniqueIds); + /// + /// Replace previous blackbox execution contexts with passed ones. Forces backend to skip + /// stepping/pausing in scripts in these execution contexts. VM will try to leave blackboxed script by + /// performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + /// + /// Array of execution context unique ids for the debugger to ignore. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBlackboxExecutionContextsAsync(string[] uniqueIds) + { + ValidateSetBlackboxExecutionContexts(uniqueIds); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("uniqueIds", uniqueIds); + return _client.ExecuteDevToolsMethodAsync("Debugger.setBlackboxExecutionContexts", dict); + } + + partial void ValidateSetBlackboxPatterns(string[] patterns, bool? skipAnonymous = null); + /// + /// Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in + /// scripts with url matching one of the patterns. VM will try to leave blackboxed script by + /// performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + /// + /// Array of regexps that will be used to check script url for blackbox state. + /// If true, also ignore scripts with no source url. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBlackboxPatternsAsync(string[] patterns, bool? skipAnonymous = null) + { + ValidateSetBlackboxPatterns(patterns, skipAnonymous); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("patterns", patterns); + if (skipAnonymous.HasValue) + { + dict.Add("skipAnonymous", skipAnonymous.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setBlackboxPatterns", dict); + } + + partial void ValidateSetBlackboxedRanges(string scriptId, System.Collections.Generic.IList positions); + /// + /// Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted + /// scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + /// Positions array contains positions where blackbox state is changed. First interval isn't + /// blackboxed. Array should be sorted. + /// + /// Id of the script. + /// positions + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBlackboxedRangesAsync(string scriptId, System.Collections.Generic.IList positions) + { + ValidateSetBlackboxedRanges(scriptId, positions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + dict.Add("positions", positions.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Debugger.setBlackboxedRanges", dict); + } + + partial void ValidateSetBreakpoint(CefSharp.DevTools.Debugger.Location location, string condition = null); + /// + /// Sets JavaScript breakpoint at a given location. + /// + /// Location to set breakpoint in. + /// Expression to use as a breakpoint condition. When specified, debugger will only stop on thebreakpoint if this expression evaluates to true. + /// returns System.Threading.Tasks.Task<SetBreakpointResponse> + public System.Threading.Tasks.Task SetBreakpointAsync(CefSharp.DevTools.Debugger.Location location, string condition = null) + { + ValidateSetBreakpoint(location, condition); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("location", location.ToDictionary()); + if (!(string.IsNullOrEmpty(condition))) + { + dict.Add("condition", condition); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setBreakpoint", dict); + } + + partial void ValidateSetInstrumentationBreakpoint(CefSharp.DevTools.Debugger.SetInstrumentationBreakpointInstrumentation instrumentation); + /// + /// Sets instrumentation breakpoint. + /// + /// Instrumentation name. + /// returns System.Threading.Tasks.Task<SetInstrumentationBreakpointResponse> + public System.Threading.Tasks.Task SetInstrumentationBreakpointAsync(CefSharp.DevTools.Debugger.SetInstrumentationBreakpointInstrumentation instrumentation) + { + ValidateSetInstrumentationBreakpoint(instrumentation); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("instrumentation", EnumToString(instrumentation)); + return _client.ExecuteDevToolsMethodAsync("Debugger.setInstrumentationBreakpoint", dict); + } + + partial void ValidateSetBreakpointByUrl(int lineNumber, string url = null, string urlRegex = null, string scriptHash = null, int? columnNumber = null, string condition = null); + /// + /// Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this + /// command is issued, all existing parsed scripts will have breakpoints resolved and returned in + /// `locations` property. Further matching script parsing will result in subsequent + /// `breakpointResolved` events issued. This logical breakpoint will survive page reloads. + /// + /// Line number to set breakpoint at. + /// URL of the resources to set breakpoint on. + /// Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or`urlRegex` must be specified. + /// Script hash of the resources to set breakpoint on. + /// Offset in the line to set breakpoint at. + /// Expression to use as a breakpoint condition. When specified, debugger will only stop on thebreakpoint if this expression evaluates to true. + /// returns System.Threading.Tasks.Task<SetBreakpointByUrlResponse> + public System.Threading.Tasks.Task SetBreakpointByUrlAsync(int lineNumber, string url = null, string urlRegex = null, string scriptHash = null, int? columnNumber = null, string condition = null) + { + ValidateSetBreakpointByUrl(lineNumber, url, urlRegex, scriptHash, columnNumber, condition); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("lineNumber", lineNumber); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + if (!(string.IsNullOrEmpty(urlRegex))) + { + dict.Add("urlRegex", urlRegex); + } + + if (!(string.IsNullOrEmpty(scriptHash))) + { + dict.Add("scriptHash", scriptHash); + } + + if (columnNumber.HasValue) + { + dict.Add("columnNumber", columnNumber.Value); + } + + if (!(string.IsNullOrEmpty(condition))) + { + dict.Add("condition", condition); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setBreakpointByUrl", dict); + } + + partial void ValidateSetBreakpointOnFunctionCall(string objectId, string condition = null); + /// + /// Sets JavaScript breakpoint before each call to the given function. + /// If another function was created from the same source as a given one, + /// calling it will also trigger the breakpoint. + /// + /// Function object id. + /// Expression to use as a breakpoint condition. When specified, debugger willstop on the breakpoint if this expression evaluates to true. + /// returns System.Threading.Tasks.Task<SetBreakpointOnFunctionCallResponse> + public System.Threading.Tasks.Task SetBreakpointOnFunctionCallAsync(string objectId, string condition = null) + { + ValidateSetBreakpointOnFunctionCall(objectId, condition); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + if (!(string.IsNullOrEmpty(condition))) + { + dict.Add("condition", condition); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setBreakpointOnFunctionCall", dict); + } + + partial void ValidateSetBreakpointsActive(bool active); + /// + /// Activates / deactivates all breakpoints on the page. + /// + /// New value for breakpoints active state. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBreakpointsActiveAsync(bool active) + { + ValidateSetBreakpointsActive(active); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("active", active); + return _client.ExecuteDevToolsMethodAsync("Debugger.setBreakpointsActive", dict); + } + + partial void ValidateSetPauseOnExceptions(CefSharp.DevTools.Debugger.SetPauseOnExceptionsState state); + /// + /// Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions, + /// or caught exceptions, no exceptions. Initial pause on exceptions state is `none`. + /// + /// Pause on exceptions mode. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPauseOnExceptionsAsync(CefSharp.DevTools.Debugger.SetPauseOnExceptionsState state) + { + ValidateSetPauseOnExceptions(state); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("state", EnumToString(state)); + return _client.ExecuteDevToolsMethodAsync("Debugger.setPauseOnExceptions", dict); + } + + partial void ValidateSetReturnValue(CefSharp.DevTools.Runtime.CallArgument newValue); + /// + /// Changes return value in top frame. Available only at return break position. + /// + /// New return value. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetReturnValueAsync(CefSharp.DevTools.Runtime.CallArgument newValue) + { + ValidateSetReturnValue(newValue); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("newValue", newValue.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Debugger.setReturnValue", dict); + } + + partial void ValidateSetScriptSource(string scriptId, string scriptSource, bool? dryRun = null, bool? allowTopFrameEditing = null); + /// + /// Edits JavaScript source live. + /// + /// In general, functions that are currently on the stack can not be edited with + /// a single exception: If the edited function is the top-most stack frame and + /// that is the only activation of that function on the stack. In this case + /// the live edit will be successful and a `Debugger.restartFrame` for the + /// top-most function is automatically triggered. + /// + /// Id of the script to edit. + /// New content of the script. + /// If true the change will not actually be applied. Dry run may be used to get resultdescription without actually modifying the code. + /// If true, then `scriptSource` is allowed to change the function on top of the stackas long as the top-most stack frame is the only activation of that function. + /// returns System.Threading.Tasks.Task<SetScriptSourceResponse> + public System.Threading.Tasks.Task SetScriptSourceAsync(string scriptId, string scriptSource, bool? dryRun = null, bool? allowTopFrameEditing = null) + { + ValidateSetScriptSource(scriptId, scriptSource, dryRun, allowTopFrameEditing); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + dict.Add("scriptSource", scriptSource); + if (dryRun.HasValue) + { + dict.Add("dryRun", dryRun.Value); + } + + if (allowTopFrameEditing.HasValue) + { + dict.Add("allowTopFrameEditing", allowTopFrameEditing.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setScriptSource", dict); + } + + partial void ValidateSetSkipAllPauses(bool skip); + /// + /// Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + /// + /// New value for skip pauses state. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSkipAllPausesAsync(bool skip) + { + ValidateSetSkipAllPauses(skip); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("skip", skip); + return _client.ExecuteDevToolsMethodAsync("Debugger.setSkipAllPauses", dict); + } + + partial void ValidateSetVariableValue(int scopeNumber, string variableName, CefSharp.DevTools.Runtime.CallArgument newValue, string callFrameId); + /// + /// Changes value of variable in a callframe. Object-based scopes are not supported and must be + /// mutated manually. + /// + /// 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'scope types are allowed. Other scopes could be manipulated manually. + /// Variable name. + /// New variable value. + /// Id of callframe that holds variable. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetVariableValueAsync(int scopeNumber, string variableName, CefSharp.DevTools.Runtime.CallArgument newValue, string callFrameId) + { + ValidateSetVariableValue(scopeNumber, variableName, newValue, callFrameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeNumber", scopeNumber); + dict.Add("variableName", variableName); + dict.Add("newValue", newValue.ToDictionary()); + dict.Add("callFrameId", callFrameId); + return _client.ExecuteDevToolsMethodAsync("Debugger.setVariableValue", dict); + } + + partial void ValidateStepInto(bool? breakOnAsyncCall = null, System.Collections.Generic.IList skipList = null); + /// + /// Steps into the function call. + /// + /// Debugger will pause on the execution of the first async task which was scheduledbefore next pause. + /// The skipList specifies location ranges that should be skipped on step into. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StepIntoAsync(bool? breakOnAsyncCall = null, System.Collections.Generic.IList skipList = null) + { + ValidateStepInto(breakOnAsyncCall, skipList); + var dict = new System.Collections.Generic.Dictionary(); + if (breakOnAsyncCall.HasValue) + { + dict.Add("breakOnAsyncCall", breakOnAsyncCall.Value); + } + + if ((skipList) != (null)) + { + dict.Add("skipList", skipList.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.stepInto", dict); + } + + /// + /// Steps out of the function call. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StepOutAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Debugger.stepOut", dict); + } + + partial void ValidateStepOver(System.Collections.Generic.IList skipList = null); + /// + /// Steps over the statement. + /// + /// The skipList specifies location ranges that should be skipped on step over. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StepOverAsync(System.Collections.Generic.IList skipList = null) + { + ValidateStepOver(skipList); + var dict = new System.Collections.Generic.Dictionary(); + if ((skipList) != (null)) + { + dict.Add("skipList", skipList.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.stepOver", dict); + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// GetHeapObjectIdResponse + /// + [DataContract] + public class GetHeapObjectIdResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string heapSnapshotObjectId + { + get; + set; + } + + /// + /// heapSnapshotObjectId + /// + public string HeapSnapshotObjectId + { + get + { + return heapSnapshotObjectId; + } + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// GetObjectByHeapObjectIdResponse + /// + [DataContract] + public class GetObjectByHeapObjectIdResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject result + { + get; + set; + } + + /// + /// result + /// + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get + { + return result; + } + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// GetSamplingProfileResponse + /// + [DataContract] + public class GetSamplingProfileResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.HeapProfiler.SamplingHeapProfile profile + { + get; + set; + } + + /// + /// profile + /// + public CefSharp.DevTools.HeapProfiler.SamplingHeapProfile Profile + { + get + { + return profile; + } + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// StopSamplingResponse + /// + [DataContract] + public class StopSamplingResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.HeapProfiler.SamplingHeapProfile profile + { + get; + set; + } + + /// + /// profile + /// + public CefSharp.DevTools.HeapProfiler.SamplingHeapProfile Profile + { + get + { + return profile; + } + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + using System.Linq; + + /// + /// HeapProfiler + /// + public partial class HeapProfilerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// HeapProfiler + /// + /// DevToolsClient + public HeapProfilerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// AddHeapSnapshotChunk + /// + public event System.EventHandler AddHeapSnapshotChunk + { + add + { + _client.AddEventHandler("HeapProfiler.addHeapSnapshotChunk", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.addHeapSnapshotChunk", value); + } + } + + /// + /// If heap objects tracking has been started then backend may send update for one or more fragments + /// + public event System.EventHandler HeapStatsUpdate + { + add + { + _client.AddEventHandler("HeapProfiler.heapStatsUpdate", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.heapStatsUpdate", value); + } + } + + /// + /// If heap objects tracking has been started then backend regularly sends a current value for last + /// seen object id and corresponding timestamp. If the were changes in the heap since last event + /// then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + /// + public event System.EventHandler LastSeenObjectId + { + add + { + _client.AddEventHandler("HeapProfiler.lastSeenObjectId", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.lastSeenObjectId", value); + } + } + + /// + /// ReportHeapSnapshotProgress + /// + public event System.EventHandler ReportHeapSnapshotProgress + { + add + { + _client.AddEventHandler("HeapProfiler.reportHeapSnapshotProgress", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.reportHeapSnapshotProgress", value); + } + } + + /// + /// ResetProfiles + /// + public event System.EventHandler ResetProfiles + { + add + { + _client.AddEventHandler("HeapProfiler.resetProfiles", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.resetProfiles", value); + } + } + + partial void ValidateAddInspectedHeapObject(string heapObjectId); + /// + /// Enables console to refer to the node with given id via $x (see Command Line API for more details + /// $x functions). + /// + /// Heap snapshot object id to be accessible by means of $x command line API. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddInspectedHeapObjectAsync(string heapObjectId) + { + ValidateAddInspectedHeapObject(heapObjectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("heapObjectId", heapObjectId); + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.addInspectedHeapObject", dict); + } + + /// + /// CollectGarbage + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CollectGarbageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.collectGarbage", dict); + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.disable", dict); + } + + /// + /// Enable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.enable", dict); + } + + partial void ValidateGetHeapObjectId(string objectId); + /// + /// GetHeapObjectId + /// + /// Identifier of the object to get heap object id for. + /// returns System.Threading.Tasks.Task<GetHeapObjectIdResponse> + public System.Threading.Tasks.Task GetHeapObjectIdAsync(string objectId) + { + ValidateGetHeapObjectId(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.getHeapObjectId", dict); + } + + partial void ValidateGetObjectByHeapObjectId(string objectId, string objectGroup = null); + /// + /// GetObjectByHeapObjectId + /// + /// objectId + /// Symbolic group name that can be used to release multiple objects. + /// returns System.Threading.Tasks.Task<GetObjectByHeapObjectIdResponse> + public System.Threading.Tasks.Task GetObjectByHeapObjectIdAsync(string objectId, string objectGroup = null) + { + ValidateGetObjectByHeapObjectId(objectId, objectGroup); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.getObjectByHeapObjectId", dict); + } + + /// + /// GetSamplingProfile + /// + /// returns System.Threading.Tasks.Task<GetSamplingProfileResponse> + public System.Threading.Tasks.Task GetSamplingProfileAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.getSamplingProfile", dict); + } + + partial void ValidateStartSampling(double? samplingInterval = null, double? stackDepth = null, bool? includeObjectsCollectedByMajorGC = null, bool? includeObjectsCollectedByMinorGC = null); + /// + /// StartSampling + /// + /// Average sample interval in bytes. Poisson distribution is used for the intervals. Thedefault value is 32768 bytes. + /// Maximum stack depth. The default value is 128. + /// By default, the sampling heap profiler reports only objects which arestill alive when the profile is returned via getSamplingProfile orstopSampling, which is useful for determining what functions contributethe most to steady-state memory usage. This flag instructs the samplingheap profiler to also include information about objects discarded bymajor GC, which will show which functions cause large temporary memoryusage or long GC pauses. + /// By default, the sampling heap profiler reports only objects which arestill alive when the profile is returned via getSamplingProfile orstopSampling, which is useful for determining what functions contributethe most to steady-state memory usage. This flag instructs the samplingheap profiler to also include information about objects discarded byminor GC, which is useful when tuning a latency-sensitive applicationfor minimal GC activity. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartSamplingAsync(double? samplingInterval = null, double? stackDepth = null, bool? includeObjectsCollectedByMajorGC = null, bool? includeObjectsCollectedByMinorGC = null) + { + ValidateStartSampling(samplingInterval, stackDepth, includeObjectsCollectedByMajorGC, includeObjectsCollectedByMinorGC); + var dict = new System.Collections.Generic.Dictionary(); + if (samplingInterval.HasValue) + { + dict.Add("samplingInterval", samplingInterval.Value); + } + + if (stackDepth.HasValue) + { + dict.Add("stackDepth", stackDepth.Value); + } + + if (includeObjectsCollectedByMajorGC.HasValue) + { + dict.Add("includeObjectsCollectedByMajorGC", includeObjectsCollectedByMajorGC.Value); + } + + if (includeObjectsCollectedByMinorGC.HasValue) + { + dict.Add("includeObjectsCollectedByMinorGC", includeObjectsCollectedByMinorGC.Value); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.startSampling", dict); + } + + partial void ValidateStartTrackingHeapObjects(bool? trackAllocations = null); + /// + /// StartTrackingHeapObjects + /// + /// trackAllocations + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartTrackingHeapObjectsAsync(bool? trackAllocations = null) + { + ValidateStartTrackingHeapObjects(trackAllocations); + var dict = new System.Collections.Generic.Dictionary(); + if (trackAllocations.HasValue) + { + dict.Add("trackAllocations", trackAllocations.Value); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.startTrackingHeapObjects", dict); + } + + /// + /// StopSampling + /// + /// returns System.Threading.Tasks.Task<StopSamplingResponse> + public System.Threading.Tasks.Task StopSamplingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.stopSampling", dict); + } + + partial void ValidateStopTrackingHeapObjects(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null); + /// + /// StopTrackingHeapObjects + /// + /// If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being takenwhen the tracking is stopped. + /// Deprecated in favor of `exposeInternals`. + /// If true, numerical values are included in the snapshot + /// If true, exposes internals of the snapshot. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopTrackingHeapObjectsAsync(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null) + { + ValidateStopTrackingHeapObjects(reportProgress, treatGlobalObjectsAsRoots, captureNumericValue, exposeInternals); + var dict = new System.Collections.Generic.Dictionary(); + if (reportProgress.HasValue) + { + dict.Add("reportProgress", reportProgress.Value); + } + + if (treatGlobalObjectsAsRoots.HasValue) + { + dict.Add("treatGlobalObjectsAsRoots", treatGlobalObjectsAsRoots.Value); + } + + if (captureNumericValue.HasValue) + { + dict.Add("captureNumericValue", captureNumericValue.Value); + } + + if (exposeInternals.HasValue) + { + dict.Add("exposeInternals", exposeInternals.Value); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.stopTrackingHeapObjects", dict); + } + + partial void ValidateTakeHeapSnapshot(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null); + /// + /// TakeHeapSnapshot + /// + /// If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + /// If true, a raw snapshot without artificial roots will be generated.Deprecated in favor of `exposeInternals`. + /// If true, numerical values are included in the snapshot + /// If true, exposes internals of the snapshot. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TakeHeapSnapshotAsync(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null) + { + ValidateTakeHeapSnapshot(reportProgress, treatGlobalObjectsAsRoots, captureNumericValue, exposeInternals); + var dict = new System.Collections.Generic.Dictionary(); + if (reportProgress.HasValue) + { + dict.Add("reportProgress", reportProgress.Value); + } + + if (treatGlobalObjectsAsRoots.HasValue) + { + dict.Add("treatGlobalObjectsAsRoots", treatGlobalObjectsAsRoots.Value); + } + + if (captureNumericValue.HasValue) + { + dict.Add("captureNumericValue", captureNumericValue.Value); + } + + if (exposeInternals.HasValue) + { + dict.Add("exposeInternals", exposeInternals.Value); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.takeHeapSnapshot", dict); + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// GetBestEffortCoverageResponse + /// + [DataContract] + public class GetBestEffortCoverageResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList result + { + get; + set; + } + + /// + /// result + /// + public System.Collections.Generic.IList Result + { + get + { + return result; + } + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// StartPreciseCoverageResponse + /// + [DataContract] + public class StartPreciseCoverageResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double timestamp + { + get; + set; + } + + /// + /// timestamp + /// + public double Timestamp + { + get + { + return timestamp; + } + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// StopResponse + /// + [DataContract] + public class StopResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Profiler.Profile profile + { + get; + set; + } + + /// + /// profile + /// + public CefSharp.DevTools.Profiler.Profile Profile + { + get + { + return profile; + } + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// TakePreciseCoverageResponse + /// + [DataContract] + public class TakePreciseCoverageResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList result + { + get; + set; + } + + /// + /// result + /// + public System.Collections.Generic.IList Result + { + get + { + return result; + } + } + + [DataMember] + internal double timestamp + { + get; + set; + } + + /// + /// timestamp + /// + public double Timestamp + { + get + { + return timestamp; + } + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + using System.Linq; + + /// + /// Profiler + /// + public partial class ProfilerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Profiler + /// + /// DevToolsClient + public ProfilerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// ConsoleProfileFinished + /// + public event System.EventHandler ConsoleProfileFinished + { + add + { + _client.AddEventHandler("Profiler.consoleProfileFinished", value); + } + + remove + { + _client.RemoveEventHandler("Profiler.consoleProfileFinished", value); + } + } + + /// + /// Sent when new profile recording is started using console.profile() call. + /// + public event System.EventHandler ConsoleProfileStarted + { + add + { + _client.AddEventHandler("Profiler.consoleProfileStarted", value); + } + + remove + { + _client.RemoveEventHandler("Profiler.consoleProfileStarted", value); + } + } + + /// + /// Reports coverage delta since the last poll (either from an event like this, or from + /// `takePreciseCoverage` for the current isolate. May only be sent if precise code + /// coverage has been started. This event can be trigged by the embedder to, for example, + /// trigger collection of coverage data immediately at a certain point in time. + /// + public event System.EventHandler PreciseCoverageDeltaUpdate + { + add + { + _client.AddEventHandler("Profiler.preciseCoverageDeltaUpdate", value); + } + + remove + { + _client.RemoveEventHandler("Profiler.preciseCoverageDeltaUpdate", value); + } + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.disable", dict); + } + + /// + /// Enable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.enable", dict); + } + + /// + /// Collect coverage data for the current isolate. The coverage data may be incomplete due to + /// garbage collection. + /// + /// returns System.Threading.Tasks.Task<GetBestEffortCoverageResponse> + public System.Threading.Tasks.Task GetBestEffortCoverageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.getBestEffortCoverage", dict); + } + + partial void ValidateSetSamplingInterval(int interval); + /// + /// Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + /// + /// New sampling interval in microseconds. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSamplingIntervalAsync(int interval) + { + ValidateSetSamplingInterval(interval); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("interval", interval); + return _client.ExecuteDevToolsMethodAsync("Profiler.setSamplingInterval", dict); + } + + /// + /// Start + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.start", dict); + } + + partial void ValidateStartPreciseCoverage(bool? callCount = null, bool? detailed = null, bool? allowTriggeredUpdates = null); + /// + /// Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code + /// coverage may be incomplete. Enabling prevents running optimized code and resets execution + /// counters. + /// + /// Collect accurate call counts beyond simple 'covered' or 'not covered'. + /// Collect block-based coverage. + /// Allow the backend to send updates on its own initiative + /// returns System.Threading.Tasks.Task<StartPreciseCoverageResponse> + public System.Threading.Tasks.Task StartPreciseCoverageAsync(bool? callCount = null, bool? detailed = null, bool? allowTriggeredUpdates = null) + { + ValidateStartPreciseCoverage(callCount, detailed, allowTriggeredUpdates); + var dict = new System.Collections.Generic.Dictionary(); + if (callCount.HasValue) + { + dict.Add("callCount", callCount.Value); + } + + if (detailed.HasValue) + { + dict.Add("detailed", detailed.Value); + } + + if (allowTriggeredUpdates.HasValue) + { + dict.Add("allowTriggeredUpdates", allowTriggeredUpdates.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Profiler.startPreciseCoverage", dict); + } + + /// + /// Stop + /// + /// returns System.Threading.Tasks.Task<StopResponse> + public System.Threading.Tasks.Task StopAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.stop", dict); + } + + /// + /// Disable precise code coverage. Disabling releases unnecessary execution count records and allows + /// executing optimized code. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopPreciseCoverageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.stopPreciseCoverage", dict); + } + + /// + /// Collect coverage data for the current isolate, and resets execution counters. Precise code + /// coverage needs to have started. + /// + /// returns System.Threading.Tasks.Task<TakePreciseCoverageResponse> + public System.Threading.Tasks.Task TakePreciseCoverageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.takePreciseCoverage", dict); + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// AwaitPromiseResponse + /// + [DataContract] + public class AwaitPromiseResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject result + { + get; + set; + } + + /// + /// result + /// + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get + { + return result; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// CallFunctionOnResponse + /// + [DataContract] + public class CallFunctionOnResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject result + { + get; + set; + } + + /// + /// result + /// + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get + { + return result; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// CompileScriptResponse + /// + [DataContract] + public class CompileScriptResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string scriptId + { + get; + set; + } + + /// + /// scriptId + /// + public string ScriptId + { + get + { + return scriptId; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// EvaluateResponse + /// + [DataContract] + public class EvaluateResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject result + { + get; + set; + } + + /// + /// result + /// + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get + { + return result; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GetIsolateIdResponse + /// + [DataContract] + public class GetIsolateIdResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string id + { + get; + set; + } + + /// + /// id + /// + public string Id + { + get + { + return id; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GetHeapUsageResponse + /// + [DataContract] + public class GetHeapUsageResponse : DevToolsDomainResponseBase + { + [DataMember] + internal double usedSize + { + get; + set; + } + + /// + /// usedSize + /// + public double UsedSize + { + get + { + return usedSize; + } + } + + [DataMember] + internal double totalSize + { + get; + set; + } + + /// + /// totalSize + /// + public double TotalSize + { + get + { + return totalSize; + } + } + + [DataMember] + internal double embedderHeapUsedSize + { + get; + set; + } + + /// + /// embedderHeapUsedSize + /// + public double EmbedderHeapUsedSize + { + get + { + return embedderHeapUsedSize; + } + } + + [DataMember] + internal double backingStorageSize + { + get; + set; + } + + /// + /// backingStorageSize + /// + public double BackingStorageSize + { + get + { + return backingStorageSize; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GetPropertiesResponse + /// + [DataContract] + public class GetPropertiesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal System.Collections.Generic.IList result + { + get; + set; + } + + /// + /// result + /// + public System.Collections.Generic.IList Result + { + get + { + return result; + } + } + + [DataMember] + internal System.Collections.Generic.IList internalProperties + { + get; + set; + } + + /// + /// internalProperties + /// + public System.Collections.Generic.IList InternalProperties + { + get + { + return internalProperties; + } + } + + [DataMember] + internal System.Collections.Generic.IList privateProperties + { + get; + set; + } + + /// + /// privateProperties + /// + public System.Collections.Generic.IList PrivateProperties + { + get + { + return privateProperties; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GlobalLexicalScopeNamesResponse + /// + [DataContract] + public class GlobalLexicalScopeNamesResponse : DevToolsDomainResponseBase + { + [DataMember] + internal string[] names + { + get; + set; + } + + /// + /// names + /// + public string[] Names + { + get + { + return names; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// QueryObjectsResponse + /// + [DataContract] + public class QueryObjectsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject objects + { + get; + set; + } + + /// + /// objects + /// + public CefSharp.DevTools.Runtime.RemoteObject Objects + { + get + { + return objects; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// RunScriptResponse + /// + [DataContract] + public class RunScriptResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.RemoteObject result + { + get; + set; + } + + /// + /// result + /// + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get + { + return result; + } + } + + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GetExceptionDetailsResponse + /// + [DataContract] + public class GetExceptionDetailsResponse : DevToolsDomainResponseBase + { + [DataMember] + internal CefSharp.DevTools.Runtime.ExceptionDetails exceptionDetails + { + get; + set; + } + + /// + /// exceptionDetails + /// + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get + { + return exceptionDetails; + } + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + using System.Linq; + + /// + /// Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. + /// Evaluation results are returned as mirror object that expose object type, string representation + /// and unique identifier that can be used for further object reference. Original objects are + /// maintained in memory unless they are either explicitly released or are released along with the + /// other objects in their object group. + /// + public partial class RuntimeClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Runtime + /// + /// DevToolsClient + public RuntimeClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Notification is issued every time when binding is called. + /// + public event System.EventHandler BindingCalled + { + add + { + _client.AddEventHandler("Runtime.bindingCalled", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.bindingCalled", value); + } + } + + /// + /// Issued when console API was called. + /// + public event System.EventHandler ConsoleAPICalled + { + add + { + _client.AddEventHandler("Runtime.consoleAPICalled", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.consoleAPICalled", value); + } + } + + /// + /// Issued when unhandled exception was revoked. + /// + public event System.EventHandler ExceptionRevoked + { + add + { + _client.AddEventHandler("Runtime.exceptionRevoked", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.exceptionRevoked", value); + } + } + + /// + /// Issued when exception was thrown and unhandled. + /// + public event System.EventHandler ExceptionThrown + { + add + { + _client.AddEventHandler("Runtime.exceptionThrown", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.exceptionThrown", value); + } + } + + /// + /// Issued when new execution context is created. + /// + public event System.EventHandler ExecutionContextCreated + { + add + { + _client.AddEventHandler("Runtime.executionContextCreated", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.executionContextCreated", value); + } + } + + /// + /// Issued when execution context is destroyed. + /// + public event System.EventHandler ExecutionContextDestroyed + { + add + { + _client.AddEventHandler("Runtime.executionContextDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.executionContextDestroyed", value); + } + } + + /// + /// Issued when all executionContexts were cleared in browser + /// + public event System.EventHandler ExecutionContextsCleared + { + add + { + _client.AddEventHandler("Runtime.executionContextsCleared", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.executionContextsCleared", value); + } + } + + /// + /// Issued when object should be inspected (for example, as a result of inspect() command line API + /// call). + /// + public event System.EventHandler InspectRequested + { + add + { + _client.AddEventHandler("Runtime.inspectRequested", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.inspectRequested", value); + } + } + + partial void ValidateAwaitPromise(string promiseObjectId, bool? returnByValue = null, bool? generatePreview = null); + /// + /// Add handler to promise with given promise object id. + /// + /// Identifier of the promise. + /// Whether the result is expected to be a JSON object that should be sent by value. + /// Whether preview should be generated for the result. + /// returns System.Threading.Tasks.Task<AwaitPromiseResponse> + public System.Threading.Tasks.Task AwaitPromiseAsync(string promiseObjectId, bool? returnByValue = null, bool? generatePreview = null) + { + ValidateAwaitPromise(promiseObjectId, returnByValue, generatePreview); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("promiseObjectId", promiseObjectId); + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.awaitPromise", dict); + } + + partial void ValidateCallFunctionOn(string functionDeclaration, string objectId = null, System.Collections.Generic.IList arguments = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? userGesture = null, bool? awaitPromise = null, int? executionContextId = null, string objectGroup = null, bool? throwOnSideEffect = null, string uniqueContextId = null, CefSharp.DevTools.Runtime.SerializationOptions serializationOptions = null); + /// + /// Calls function with given declaration on the given object. Object group of the result is + /// inherited from the target object. + /// + /// Declaration of the function to call. + /// Identifier of the object to call function on. Either objectId or executionContextId shouldbe specified. + /// Call arguments. All call arguments must belong to the same JavaScript world as the targetobject. + /// In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state. + /// Whether the result is expected to be a JSON object which should be sent by value.Can be overriden by `serializationOptions`. + /// Whether preview should be generated for the result. + /// Whether execution should be treated as initiated by user in the UI. + /// Whether execution should `await` for resulting value and return once awaited promise isresolved. + /// Specifies execution context which global object will be used to call function on. EitherexecutionContextId or objectId should be specified. + /// Symbolic group name that can be used to release multiple objects. If objectGroup is notspecified and objectId is, objectGroup will be inherited from object. + /// Whether to throw an exception if side effect cannot be ruled out during evaluation. + /// An alternative way to specify the execution context to call function on.Compared to contextId that may be reused across processes, this is guaranteed to besystem-unique, so it can be used to prevent accidental function callin context different than intended (e.g. as a result of navigation across processboundaries).This is mutually exclusive with `executionContextId`. + /// Specifies the result serialization. If provided, overrides`generatePreview` and `returnByValue`. + /// returns System.Threading.Tasks.Task<CallFunctionOnResponse> + public System.Threading.Tasks.Task CallFunctionOnAsync(string functionDeclaration, string objectId = null, System.Collections.Generic.IList arguments = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? userGesture = null, bool? awaitPromise = null, int? executionContextId = null, string objectGroup = null, bool? throwOnSideEffect = null, string uniqueContextId = null, CefSharp.DevTools.Runtime.SerializationOptions serializationOptions = null) + { + ValidateCallFunctionOn(functionDeclaration, objectId, arguments, silent, returnByValue, generatePreview, userGesture, awaitPromise, executionContextId, objectGroup, throwOnSideEffect, uniqueContextId, serializationOptions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("functionDeclaration", functionDeclaration); + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if ((arguments) != (null)) + { + dict.Add("arguments", arguments.Select(x => x.ToDictionary())); + } + + if (silent.HasValue) + { + dict.Add("silent", silent.Value); + } + + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (userGesture.HasValue) + { + dict.Add("userGesture", userGesture.Value); + } + + if (awaitPromise.HasValue) + { + dict.Add("awaitPromise", awaitPromise.Value); + } + + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (throwOnSideEffect.HasValue) + { + dict.Add("throwOnSideEffect", throwOnSideEffect.Value); + } + + if (!(string.IsNullOrEmpty(uniqueContextId))) + { + dict.Add("uniqueContextId", uniqueContextId); + } + + if ((serializationOptions) != (null)) + { + dict.Add("serializationOptions", serializationOptions.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.callFunctionOn", dict); + } + + partial void ValidateCompileScript(string expression, string sourceURL, bool persistScript, int? executionContextId = null); + /// + /// Compiles expression. + /// + /// Expression to compile. + /// Source url to be set for the script. + /// Specifies whether the compiled script should be persisted. + /// Specifies in which execution context to perform script run. If the parameter is omitted theevaluation will be performed in the context of the inspected page. + /// returns System.Threading.Tasks.Task<CompileScriptResponse> + public System.Threading.Tasks.Task CompileScriptAsync(string expression, string sourceURL, bool persistScript, int? executionContextId = null) + { + ValidateCompileScript(expression, sourceURL, persistScript, executionContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("expression", expression); + dict.Add("sourceURL", sourceURL); + dict.Add("persistScript", persistScript); + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.compileScript", dict); + } + + /// + /// Disables reporting of execution contexts creation. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.disable", dict); + } + + /// + /// Discards collected exceptions and console API calls. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DiscardConsoleEntriesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.discardConsoleEntries", dict); + } + + /// + /// Enables reporting of execution contexts creation by means of `executionContextCreated` event. + /// When the reporting gets enabled the event will be sent immediately for each existing execution + /// context. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.enable", dict); + } + + partial void ValidateEvaluate(string expression, string objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, int? contextId = null, bool? returnByValue = null, bool? generatePreview = null, bool? userGesture = null, bool? awaitPromise = null, bool? throwOnSideEffect = null, double? timeout = null, bool? disableBreaks = null, bool? replMode = null, bool? allowUnsafeEvalBlockedByCSP = null, string uniqueContextId = null, CefSharp.DevTools.Runtime.SerializationOptions serializationOptions = null); + /// + /// Evaluates expression on global object. + /// + /// Expression to evaluate. + /// Symbolic group name that can be used to release multiple objects. + /// Determines whether Command Line API should be available during the evaluation. + /// In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state. + /// Specifies in which execution context to perform evaluation. If the parameter is omitted theevaluation will be performed in the context of the inspected page.This is mutually exclusive with `uniqueContextId`, which offers analternative way to identify the execution context that is more reliablein a multi-process environment. + /// Whether the result is expected to be a JSON object that should be sent by value. + /// Whether preview should be generated for the result. + /// Whether execution should be treated as initiated by user in the UI. + /// Whether execution should `await` for resulting value and return once awaited promise isresolved. + /// Whether to throw an exception if side effect cannot be ruled out during evaluation.This implies `disableBreaks` below. + /// Terminate execution after timing out (number of milliseconds). + /// Disable breakpoints during execution. + /// Setting this flag to true enables `let` re-declaration and top-level `await`.Note that `let` variables can only be re-declared if they originate from`replMode` themselves. + /// The Content Security Policy (CSP) for the target might block 'unsafe-eval'which includes eval(), Function(), setTimeout() and setInterval()when called with non-callable arguments. This flag bypasses CSP for thisevaluation and allows unsafe-eval. Defaults to true. + /// An alternative way to specify the execution context to evaluate in.Compared to contextId that may be reused across processes, this is guaranteed to besystem-unique, so it can be used to prevent accidental evaluation of the expressionin context different than intended (e.g. as a result of navigation across processboundaries).This is mutually exclusive with `contextId`. + /// Specifies the result serialization. If provided, overrides`generatePreview` and `returnByValue`. + /// returns System.Threading.Tasks.Task<EvaluateResponse> + public System.Threading.Tasks.Task EvaluateAsync(string expression, string objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, int? contextId = null, bool? returnByValue = null, bool? generatePreview = null, bool? userGesture = null, bool? awaitPromise = null, bool? throwOnSideEffect = null, double? timeout = null, bool? disableBreaks = null, bool? replMode = null, bool? allowUnsafeEvalBlockedByCSP = null, string uniqueContextId = null, CefSharp.DevTools.Runtime.SerializationOptions serializationOptions = null) + { + ValidateEvaluate(expression, objectGroup, includeCommandLineAPI, silent, contextId, returnByValue, generatePreview, userGesture, awaitPromise, throwOnSideEffect, timeout, disableBreaks, replMode, allowUnsafeEvalBlockedByCSP, uniqueContextId, serializationOptions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("expression", expression); + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (includeCommandLineAPI.HasValue) + { + dict.Add("includeCommandLineAPI", includeCommandLineAPI.Value); + } + + if (silent.HasValue) + { + dict.Add("silent", silent.Value); + } + + if (contextId.HasValue) + { + dict.Add("contextId", contextId.Value); + } + + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (userGesture.HasValue) + { + dict.Add("userGesture", userGesture.Value); + } + + if (awaitPromise.HasValue) + { + dict.Add("awaitPromise", awaitPromise.Value); + } + + if (throwOnSideEffect.HasValue) + { + dict.Add("throwOnSideEffect", throwOnSideEffect.Value); + } + + if (timeout.HasValue) + { + dict.Add("timeout", timeout.Value); + } + + if (disableBreaks.HasValue) + { + dict.Add("disableBreaks", disableBreaks.Value); + } + + if (replMode.HasValue) + { + dict.Add("replMode", replMode.Value); + } + + if (allowUnsafeEvalBlockedByCSP.HasValue) + { + dict.Add("allowUnsafeEvalBlockedByCSP", allowUnsafeEvalBlockedByCSP.Value); + } + + if (!(string.IsNullOrEmpty(uniqueContextId))) + { + dict.Add("uniqueContextId", uniqueContextId); + } + + if ((serializationOptions) != (null)) + { + dict.Add("serializationOptions", serializationOptions.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.evaluate", dict); + } + + /// + /// Returns the isolate id. + /// + /// returns System.Threading.Tasks.Task<GetIsolateIdResponse> + public System.Threading.Tasks.Task GetIsolateIdAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.getIsolateId", dict); + } + + /// + /// Returns the JavaScript heap usage. + /// It is the total usage of the corresponding isolate not scoped to a particular Runtime. + /// + /// returns System.Threading.Tasks.Task<GetHeapUsageResponse> + public System.Threading.Tasks.Task GetHeapUsageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.getHeapUsage", dict); + } + + partial void ValidateGetProperties(string objectId, bool? ownProperties = null, bool? accessorPropertiesOnly = null, bool? generatePreview = null, bool? nonIndexedPropertiesOnly = null); + /// + /// Returns properties of a given object. Object group of the result is inherited from the target + /// object. + /// + /// Identifier of the object to return properties for. + /// If true, returns properties belonging only to the element itself, not to its prototypechain. + /// If true, returns accessor properties (with getter/setter) only; internal properties are notreturned either. + /// Whether preview should be generated for the results. + /// If true, returns non-indexed properties only. + /// returns System.Threading.Tasks.Task<GetPropertiesResponse> + public System.Threading.Tasks.Task GetPropertiesAsync(string objectId, bool? ownProperties = null, bool? accessorPropertiesOnly = null, bool? generatePreview = null, bool? nonIndexedPropertiesOnly = null) + { + ValidateGetProperties(objectId, ownProperties, accessorPropertiesOnly, generatePreview, nonIndexedPropertiesOnly); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + if (ownProperties.HasValue) + { + dict.Add("ownProperties", ownProperties.Value); + } + + if (accessorPropertiesOnly.HasValue) + { + dict.Add("accessorPropertiesOnly", accessorPropertiesOnly.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (nonIndexedPropertiesOnly.HasValue) + { + dict.Add("nonIndexedPropertiesOnly", nonIndexedPropertiesOnly.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.getProperties", dict); + } + + partial void ValidateGlobalLexicalScopeNames(int? executionContextId = null); + /// + /// Returns all let, const and class variables from global scope. + /// + /// Specifies in which execution context to lookup global scope variables. + /// returns System.Threading.Tasks.Task<GlobalLexicalScopeNamesResponse> + public System.Threading.Tasks.Task GlobalLexicalScopeNamesAsync(int? executionContextId = null) + { + ValidateGlobalLexicalScopeNames(executionContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.globalLexicalScopeNames", dict); + } + + partial void ValidateQueryObjects(string prototypeObjectId, string objectGroup = null); + /// + /// QueryObjects + /// + /// Identifier of the prototype to return objects for. + /// Symbolic group name that can be used to release the results. + /// returns System.Threading.Tasks.Task<QueryObjectsResponse> + public System.Threading.Tasks.Task QueryObjectsAsync(string prototypeObjectId, string objectGroup = null) + { + ValidateQueryObjects(prototypeObjectId, objectGroup); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("prototypeObjectId", prototypeObjectId); + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.queryObjects", dict); + } + + partial void ValidateReleaseObject(string objectId); + /// + /// Releases remote object with given id. + /// + /// Identifier of the object to release. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReleaseObjectAsync(string objectId) + { + ValidateReleaseObject(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("Runtime.releaseObject", dict); + } + + partial void ValidateReleaseObjectGroup(string objectGroup); + /// + /// Releases all remote objects that belong to a given group. + /// + /// Symbolic object group name. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReleaseObjectGroupAsync(string objectGroup) + { + ValidateReleaseObjectGroup(objectGroup); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectGroup", objectGroup); + return _client.ExecuteDevToolsMethodAsync("Runtime.releaseObjectGroup", dict); + } + + /// + /// Tells inspected instance to run if it was waiting for debugger to attach. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RunIfWaitingForDebuggerAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.runIfWaitingForDebugger", dict); + } + + partial void ValidateRunScript(string scriptId, int? executionContextId = null, string objectGroup = null, bool? silent = null, bool? includeCommandLineAPI = null, bool? returnByValue = null, bool? generatePreview = null, bool? awaitPromise = null); + /// + /// Runs script with given id in a given context. + /// + /// Id of the script to run. + /// Specifies in which execution context to perform script run. If the parameter is omitted theevaluation will be performed in the context of the inspected page. + /// Symbolic group name that can be used to release multiple objects. + /// In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state. + /// Determines whether Command Line API should be available during the evaluation. + /// Whether the result is expected to be a JSON object which should be sent by value. + /// Whether preview should be generated for the result. + /// Whether execution should `await` for resulting value and return once awaited promise isresolved. + /// returns System.Threading.Tasks.Task<RunScriptResponse> + public System.Threading.Tasks.Task RunScriptAsync(string scriptId, int? executionContextId = null, string objectGroup = null, bool? silent = null, bool? includeCommandLineAPI = null, bool? returnByValue = null, bool? generatePreview = null, bool? awaitPromise = null) + { + ValidateRunScript(scriptId, executionContextId, objectGroup, silent, includeCommandLineAPI, returnByValue, generatePreview, awaitPromise); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (silent.HasValue) + { + dict.Add("silent", silent.Value); + } + + if (includeCommandLineAPI.HasValue) + { + dict.Add("includeCommandLineAPI", includeCommandLineAPI.Value); + } + + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (awaitPromise.HasValue) + { + dict.Add("awaitPromise", awaitPromise.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.runScript", dict); + } + + partial void ValidateSetAsyncCallStackDepth(int maxDepth); + /// + /// Enables or disables async call stacks tracking. + /// + /// Maximum depth of async call stacks. Setting to `0` will effectively disable collecting asynccall stacks (default). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAsyncCallStackDepthAsync(int maxDepth) + { + ValidateSetAsyncCallStackDepth(maxDepth); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("maxDepth", maxDepth); + return _client.ExecuteDevToolsMethodAsync("Runtime.setAsyncCallStackDepth", dict); + } + + partial void ValidateSetCustomObjectFormatterEnabled(bool enabled); + /// + /// SetCustomObjectFormatterEnabled + /// + /// enabled + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCustomObjectFormatterEnabledAsync(bool enabled) + { + ValidateSetCustomObjectFormatterEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Runtime.setCustomObjectFormatterEnabled", dict); + } + + partial void ValidateSetMaxCallStackSizeToCapture(int size); + /// + /// SetMaxCallStackSizeToCapture + /// + /// size + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetMaxCallStackSizeToCaptureAsync(int size) + { + ValidateSetMaxCallStackSizeToCapture(size); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("size", size); + return _client.ExecuteDevToolsMethodAsync("Runtime.setMaxCallStackSizeToCapture", dict); + } + + /// + /// Terminate current or next JavaScript execution. + /// Will cancel the termination when the outer-most script execution ends. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TerminateExecutionAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.terminateExecution", dict); + } + + partial void ValidateAddBinding(string name, int? executionContextId = null, string executionContextName = null); + /// + /// If executionContextId is empty, adds binding with the given name on the + /// global objects of all inspected contexts, including those created later, + /// bindings survive reloads. + /// Binding function takes exactly one argument, this argument should be string, + /// in case of any other input, function throws an exception. + /// Each binding function call produces Runtime.bindingCalled notification. + /// + /// name + /// If specified, the binding would only be exposed to the specifiedexecution context. If omitted and `executionContextName` is not set,the binding is exposed to all execution contexts of the target.This parameter is mutually exclusive with `executionContextName`.Deprecated in favor of `executionContextName` due to an unclear use caseand bugs in implementation (crbug.com/1169639). `executionContextId` will beremoved in the future. + /// If specified, the binding is exposed to the executionContext withmatching name, even for contexts created after the binding is added.See also `ExecutionContext.name` and `worldName` parameter to`Page.addScriptToEvaluateOnNewDocument`.This parameter is mutually exclusive with `executionContextId`. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddBindingAsync(string name, int? executionContextId = null, string executionContextName = null) + { + ValidateAddBinding(name, executionContextId, executionContextName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + if (!(string.IsNullOrEmpty(executionContextName))) + { + dict.Add("executionContextName", executionContextName); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.addBinding", dict); + } + + partial void ValidateRemoveBinding(string name); + /// + /// This method does not remove binding function from global object but + /// unsubscribes current runtime agent from Runtime.bindingCalled notifications. + /// + /// name + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveBindingAsync(string name) + { + ValidateRemoveBinding(name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + return _client.ExecuteDevToolsMethodAsync("Runtime.removeBinding", dict); + } + + partial void ValidateGetExceptionDetails(string errorObjectId); + /// + /// This method tries to lookup and populate exception details for a + /// JavaScript Error object. + /// Note that the stackTrace portion of the resulting exceptionDetails will + /// only be populated if the Runtime domain was enabled at the time when the + /// Error was thrown. + /// + /// The error object for which to resolve the exception details. + /// returns System.Threading.Tasks.Task<GetExceptionDetailsResponse> + public System.Threading.Tasks.Task GetExceptionDetailsAsync(string errorObjectId) + { + ValidateGetExceptionDetails(errorObjectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("errorObjectId", errorObjectId); + return _client.ExecuteDevToolsMethodAsync("Runtime.getExceptionDetails", dict); + } + } +} + +namespace CefSharp.DevTools +{ + /// + /// Generated DevToolsClient methods + /// + public partial class DevToolsClient + { + private CefSharp.DevTools.Accessibility.AccessibilityClient _Accessibility; + /// + /// Accessibility + /// + public CefSharp.DevTools.Accessibility.AccessibilityClient Accessibility + { + get + { + if ((_Accessibility) == (null)) + { + _Accessibility = (new CefSharp.DevTools.Accessibility.AccessibilityClient(this)); + } + + return _Accessibility; + } + } + + private CefSharp.DevTools.Animation.AnimationClient _Animation; + /// + /// Animation + /// + public CefSharp.DevTools.Animation.AnimationClient Animation + { + get + { + if ((_Animation) == (null)) + { + _Animation = (new CefSharp.DevTools.Animation.AnimationClient(this)); + } + + return _Animation; + } + } + + private CefSharp.DevTools.Audits.AuditsClient _Audits; + /// + /// Audits domain allows investigation of page violations and possible improvements. + /// + public CefSharp.DevTools.Audits.AuditsClient Audits + { + get + { + if ((_Audits) == (null)) + { + _Audits = (new CefSharp.DevTools.Audits.AuditsClient(this)); + } + + return _Audits; + } + } + + private CefSharp.DevTools.Autofill.AutofillClient _Autofill; + /// + /// Defines commands and events for Autofill. + /// + public CefSharp.DevTools.Autofill.AutofillClient Autofill + { + get + { + if ((_Autofill) == (null)) + { + _Autofill = (new CefSharp.DevTools.Autofill.AutofillClient(this)); + } + + return _Autofill; + } + } + + private CefSharp.DevTools.BackgroundService.BackgroundServiceClient _BackgroundService; + /// + /// Defines events for background web platform features. + /// + public CefSharp.DevTools.BackgroundService.BackgroundServiceClient BackgroundService + { + get + { + if ((_BackgroundService) == (null)) + { + _BackgroundService = (new CefSharp.DevTools.BackgroundService.BackgroundServiceClient(this)); + } + + return _BackgroundService; + } + } + + private CefSharp.DevTools.BluetoothEmulation.BluetoothEmulationClient _BluetoothEmulation; + /// + /// This domain allows configuring virtual Bluetooth devices to test + /// the web-bluetooth API. + /// + public CefSharp.DevTools.BluetoothEmulation.BluetoothEmulationClient BluetoothEmulation + { + get + { + if ((_BluetoothEmulation) == (null)) + { + _BluetoothEmulation = (new CefSharp.DevTools.BluetoothEmulation.BluetoothEmulationClient(this)); + } + + return _BluetoothEmulation; + } + } + + private CefSharp.DevTools.Browser.BrowserClient _Browser; + /// + /// The Browser domain defines methods and events for browser managing. + /// + public CefSharp.DevTools.Browser.BrowserClient Browser + { + get + { + if ((_Browser) == (null)) + { + _Browser = (new CefSharp.DevTools.Browser.BrowserClient(this)); + } + + return _Browser; + } + } + + private CefSharp.DevTools.CSS.CSSClient _CSS; + /// + /// This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) + /// have an associated `id` used in subsequent operations on the related object. Each object type has + /// a specific `id` structure, and those are not interchangeable between objects of different kinds. + /// CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client + /// can also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and + /// subsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods. + /// + public CefSharp.DevTools.CSS.CSSClient CSS + { + get + { + if ((_CSS) == (null)) + { + _CSS = (new CefSharp.DevTools.CSS.CSSClient(this)); + } + + return _CSS; + } + } + + private CefSharp.DevTools.CacheStorage.CacheStorageClient _CacheStorage; + /// + /// CacheStorage + /// + public CefSharp.DevTools.CacheStorage.CacheStorageClient CacheStorage + { + get + { + if ((_CacheStorage) == (null)) + { + _CacheStorage = (new CefSharp.DevTools.CacheStorage.CacheStorageClient(this)); + } + + return _CacheStorage; + } + } + + private CefSharp.DevTools.Cast.CastClient _Cast; + /// + /// A domain for interacting with Cast, Presentation API, and Remote Playback API + /// functionalities. + /// + public CefSharp.DevTools.Cast.CastClient Cast + { + get + { + if ((_Cast) == (null)) + { + _Cast = (new CefSharp.DevTools.Cast.CastClient(this)); + } + + return _Cast; + } + } + + private CefSharp.DevTools.DOM.DOMClient _DOM; + /// + /// This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object + /// that has an `id`. This `id` can be used to get additional information on the Node, resolve it into + /// the JavaScript object wrapper, etc. It is important that client receives DOM events only for the + /// nodes that are known to the client. Backend keeps track of the nodes that were sent to the client + /// and never sends the same node twice. It is client's responsibility to collect information about + /// the nodes that were sent to the client. Note that `iframe` owner elements will return + /// corresponding document elements as their child nodes. + /// + public CefSharp.DevTools.DOM.DOMClient DOM + { + get + { + if ((_DOM) == (null)) + { + _DOM = (new CefSharp.DevTools.DOM.DOMClient(this)); + } + + return _DOM; + } + } + + private CefSharp.DevTools.DOMDebugger.DOMDebuggerClient _DOMDebugger; + /// + /// DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript + /// execution will stop on these operations as if there was a regular breakpoint set. + /// + public CefSharp.DevTools.DOMDebugger.DOMDebuggerClient DOMDebugger + { + get + { + if ((_DOMDebugger) == (null)) + { + _DOMDebugger = (new CefSharp.DevTools.DOMDebugger.DOMDebuggerClient(this)); + } + + return _DOMDebugger; + } + } + + private CefSharp.DevTools.DOMSnapshot.DOMSnapshotClient _DOMSnapshot; + /// + /// This domain facilitates obtaining document snapshots with DOM, layout, and style information. + /// + public CefSharp.DevTools.DOMSnapshot.DOMSnapshotClient DOMSnapshot + { + get + { + if ((_DOMSnapshot) == (null)) + { + _DOMSnapshot = (new CefSharp.DevTools.DOMSnapshot.DOMSnapshotClient(this)); + } + + return _DOMSnapshot; + } + } + + private CefSharp.DevTools.DOMStorage.DOMStorageClient _DOMStorage; + /// + /// Query and modify DOM storage. + /// + public CefSharp.DevTools.DOMStorage.DOMStorageClient DOMStorage + { + get + { + if ((_DOMStorage) == (null)) + { + _DOMStorage = (new CefSharp.DevTools.DOMStorage.DOMStorageClient(this)); + } + + return _DOMStorage; + } + } + + private CefSharp.DevTools.DeviceAccess.DeviceAccessClient _DeviceAccess; + /// + /// DeviceAccess + /// + public CefSharp.DevTools.DeviceAccess.DeviceAccessClient DeviceAccess + { + get + { + if ((_DeviceAccess) == (null)) + { + _DeviceAccess = (new CefSharp.DevTools.DeviceAccess.DeviceAccessClient(this)); + } + + return _DeviceAccess; + } + } + + private CefSharp.DevTools.DeviceOrientation.DeviceOrientationClient _DeviceOrientation; + /// + /// DeviceOrientation + /// + public CefSharp.DevTools.DeviceOrientation.DeviceOrientationClient DeviceOrientation + { + get + { + if ((_DeviceOrientation) == (null)) + { + _DeviceOrientation = (new CefSharp.DevTools.DeviceOrientation.DeviceOrientationClient(this)); + } + + return _DeviceOrientation; + } + } + + private CefSharp.DevTools.Emulation.EmulationClient _Emulation; + /// + /// This domain emulates different environments for the page. + /// + public CefSharp.DevTools.Emulation.EmulationClient Emulation + { + get + { + if ((_Emulation) == (null)) + { + _Emulation = (new CefSharp.DevTools.Emulation.EmulationClient(this)); + } + + return _Emulation; + } + } + + private CefSharp.DevTools.EventBreakpoints.EventBreakpointsClient _EventBreakpoints; + /// + /// EventBreakpoints permits setting JavaScript breakpoints on operations and events + /// occurring in native code invoked from JavaScript. Once breakpoint is hit, it is + /// reported through Debugger domain, similarly to regular breakpoints being hit. + /// + public CefSharp.DevTools.EventBreakpoints.EventBreakpointsClient EventBreakpoints + { + get + { + if ((_EventBreakpoints) == (null)) + { + _EventBreakpoints = (new CefSharp.DevTools.EventBreakpoints.EventBreakpointsClient(this)); + } + + return _EventBreakpoints; + } + } + + private CefSharp.DevTools.Extensions.ExtensionsClient _Extensions; + /// + /// Defines commands and events for browser extensions. + /// + public CefSharp.DevTools.Extensions.ExtensionsClient Extensions + { + get + { + if ((_Extensions) == (null)) + { + _Extensions = (new CefSharp.DevTools.Extensions.ExtensionsClient(this)); + } + + return _Extensions; + } + } + + private CefSharp.DevTools.FedCm.FedCmClient _FedCm; + /// + /// This domain allows interacting with the FedCM dialog. + /// + public CefSharp.DevTools.FedCm.FedCmClient FedCm + { + get + { + if ((_FedCm) == (null)) + { + _FedCm = (new CefSharp.DevTools.FedCm.FedCmClient(this)); + } + + return _FedCm; + } + } + + private CefSharp.DevTools.Fetch.FetchClient _Fetch; + /// + /// A domain for letting clients substitute browser's network layer with client code. + /// + public CefSharp.DevTools.Fetch.FetchClient Fetch + { + get + { + if ((_Fetch) == (null)) + { + _Fetch = (new CefSharp.DevTools.Fetch.FetchClient(this)); + } + + return _Fetch; + } + } + + private CefSharp.DevTools.FileSystem.FileSystemClient _FileSystem; + /// + /// FileSystem + /// + public CefSharp.DevTools.FileSystem.FileSystemClient FileSystem + { + get + { + if ((_FileSystem) == (null)) + { + _FileSystem = (new CefSharp.DevTools.FileSystem.FileSystemClient(this)); + } + + return _FileSystem; + } + } + + private CefSharp.DevTools.HeadlessExperimental.HeadlessExperimentalClient _HeadlessExperimental; + /// + /// This domain provides experimental commands only supported in headless mode. + /// + public CefSharp.DevTools.HeadlessExperimental.HeadlessExperimentalClient HeadlessExperimental + { + get + { + if ((_HeadlessExperimental) == (null)) + { + _HeadlessExperimental = (new CefSharp.DevTools.HeadlessExperimental.HeadlessExperimentalClient(this)); + } + + return _HeadlessExperimental; + } + } + + private CefSharp.DevTools.IO.IOClient _IO; + /// + /// Input/Output operations for streams produced by DevTools. + /// + public CefSharp.DevTools.IO.IOClient IO + { + get + { + if ((_IO) == (null)) + { + _IO = (new CefSharp.DevTools.IO.IOClient(this)); + } + + return _IO; + } + } + + private CefSharp.DevTools.IndexedDB.IndexedDBClient _IndexedDB; + /// + /// IndexedDB + /// + public CefSharp.DevTools.IndexedDB.IndexedDBClient IndexedDB + { + get + { + if ((_IndexedDB) == (null)) + { + _IndexedDB = (new CefSharp.DevTools.IndexedDB.IndexedDBClient(this)); + } + + return _IndexedDB; + } + } + + private CefSharp.DevTools.Input.InputClient _Input; + /// + /// Input + /// + public CefSharp.DevTools.Input.InputClient Input + { + get + { + if ((_Input) == (null)) + { + _Input = (new CefSharp.DevTools.Input.InputClient(this)); + } + + return _Input; + } + } + + private CefSharp.DevTools.Inspector.InspectorClient _Inspector; + /// + /// Inspector + /// + public CefSharp.DevTools.Inspector.InspectorClient Inspector + { + get + { + if ((_Inspector) == (null)) + { + _Inspector = (new CefSharp.DevTools.Inspector.InspectorClient(this)); + } + + return _Inspector; + } + } + + private CefSharp.DevTools.LayerTree.LayerTreeClient _LayerTree; + /// + /// LayerTree + /// + public CefSharp.DevTools.LayerTree.LayerTreeClient LayerTree + { + get + { + if ((_LayerTree) == (null)) + { + _LayerTree = (new CefSharp.DevTools.LayerTree.LayerTreeClient(this)); + } + + return _LayerTree; + } + } + + private CefSharp.DevTools.Log.LogClient _Log; + /// + /// Provides access to log entries. + /// + public CefSharp.DevTools.Log.LogClient Log + { + get + { + if ((_Log) == (null)) + { + _Log = (new CefSharp.DevTools.Log.LogClient(this)); + } + + return _Log; + } + } + + private CefSharp.DevTools.Media.MediaClient _Media; + /// + /// This domain allows detailed inspection of media elements. + /// + public CefSharp.DevTools.Media.MediaClient Media + { + get + { + if ((_Media) == (null)) + { + _Media = (new CefSharp.DevTools.Media.MediaClient(this)); + } + + return _Media; + } + } + + private CefSharp.DevTools.Memory.MemoryClient _Memory; + /// + /// Memory + /// + public CefSharp.DevTools.Memory.MemoryClient Memory + { + get + { + if ((_Memory) == (null)) + { + _Memory = (new CefSharp.DevTools.Memory.MemoryClient(this)); + } + + return _Memory; + } + } + + private CefSharp.DevTools.Network.NetworkClient _Network; + /// + /// Network domain allows tracking network activities of the page. It exposes information about http, + /// file, data and other requests and responses, their headers, bodies, timing, etc. + /// + public CefSharp.DevTools.Network.NetworkClient Network + { + get + { + if ((_Network) == (null)) + { + _Network = (new CefSharp.DevTools.Network.NetworkClient(this)); + } + + return _Network; + } + } + + private CefSharp.DevTools.Overlay.OverlayClient _Overlay; + /// + /// This domain provides various functionality related to drawing atop the inspected page. + /// + public CefSharp.DevTools.Overlay.OverlayClient Overlay + { + get + { + if ((_Overlay) == (null)) + { + _Overlay = (new CefSharp.DevTools.Overlay.OverlayClient(this)); + } + + return _Overlay; + } + } + + private CefSharp.DevTools.PWA.PWAClient _PWA; + /// + /// This domain allows interacting with the browser to control PWAs. + /// + public CefSharp.DevTools.PWA.PWAClient PWA + { + get + { + if ((_PWA) == (null)) + { + _PWA = (new CefSharp.DevTools.PWA.PWAClient(this)); + } + + return _PWA; + } + } + + private CefSharp.DevTools.Page.PageClient _Page; + /// + /// Actions and events related to the inspected page belong to the page domain. + /// + public CefSharp.DevTools.Page.PageClient Page + { + get + { + if ((_Page) == (null)) + { + _Page = (new CefSharp.DevTools.Page.PageClient(this)); + } + + return _Page; + } + } + + private CefSharp.DevTools.Performance.PerformanceClient _Performance; + /// + /// Performance + /// + public CefSharp.DevTools.Performance.PerformanceClient Performance + { + get + { + if ((_Performance) == (null)) + { + _Performance = (new CefSharp.DevTools.Performance.PerformanceClient(this)); + } + + return _Performance; + } + } + + private CefSharp.DevTools.PerformanceTimeline.PerformanceTimelineClient _PerformanceTimeline; + /// + /// Reporting of performance timeline events, as specified in + /// https://w3c.github.io/performance-timeline/#dom-performanceobserver. + /// + public CefSharp.DevTools.PerformanceTimeline.PerformanceTimelineClient PerformanceTimeline + { + get + { + if ((_PerformanceTimeline) == (null)) + { + _PerformanceTimeline = (new CefSharp.DevTools.PerformanceTimeline.PerformanceTimelineClient(this)); + } + + return _PerformanceTimeline; + } + } + + private CefSharp.DevTools.Preload.PreloadClient _Preload; + /// + /// Preload + /// + public CefSharp.DevTools.Preload.PreloadClient Preload + { + get + { + if ((_Preload) == (null)) + { + _Preload = (new CefSharp.DevTools.Preload.PreloadClient(this)); + } + + return _Preload; + } + } + + private CefSharp.DevTools.Security.SecurityClient _Security; + /// + /// Security + /// + public CefSharp.DevTools.Security.SecurityClient Security + { + get + { + if ((_Security) == (null)) + { + _Security = (new CefSharp.DevTools.Security.SecurityClient(this)); + } + + return _Security; + } + } + + private CefSharp.DevTools.ServiceWorker.ServiceWorkerClient _ServiceWorker; + /// + /// ServiceWorker + /// + public CefSharp.DevTools.ServiceWorker.ServiceWorkerClient ServiceWorker + { + get + { + if ((_ServiceWorker) == (null)) + { + _ServiceWorker = (new CefSharp.DevTools.ServiceWorker.ServiceWorkerClient(this)); + } + + return _ServiceWorker; + } + } + + private CefSharp.DevTools.SmartCardEmulation.SmartCardEmulationClient _SmartCardEmulation; + /// + /// SmartCardEmulation + /// + public CefSharp.DevTools.SmartCardEmulation.SmartCardEmulationClient SmartCardEmulation + { + get + { + if ((_SmartCardEmulation) == (null)) + { + _SmartCardEmulation = (new CefSharp.DevTools.SmartCardEmulation.SmartCardEmulationClient(this)); + } + + return _SmartCardEmulation; + } + } + + private CefSharp.DevTools.Storage.StorageClient _Storage; + /// + /// Storage + /// + public CefSharp.DevTools.Storage.StorageClient Storage + { + get + { + if ((_Storage) == (null)) + { + _Storage = (new CefSharp.DevTools.Storage.StorageClient(this)); + } + + return _Storage; + } + } + + private CefSharp.DevTools.SystemInfo.SystemInfoClient _SystemInfo; + /// + /// The SystemInfo domain defines methods and events for querying low-level system information. + /// + public CefSharp.DevTools.SystemInfo.SystemInfoClient SystemInfo + { + get + { + if ((_SystemInfo) == (null)) + { + _SystemInfo = (new CefSharp.DevTools.SystemInfo.SystemInfoClient(this)); + } + + return _SystemInfo; + } + } + + private CefSharp.DevTools.Target.TargetClient _Target; + /// + /// Supports additional targets discovery and allows to attach to them. + /// + public CefSharp.DevTools.Target.TargetClient Target + { + get + { + if ((_Target) == (null)) + { + _Target = (new CefSharp.DevTools.Target.TargetClient(this)); + } + + return _Target; + } + } + + private CefSharp.DevTools.Tethering.TetheringClient _Tethering; + /// + /// The Tethering domain defines methods and events for browser port binding. + /// + public CefSharp.DevTools.Tethering.TetheringClient Tethering + { + get + { + if ((_Tethering) == (null)) + { + _Tethering = (new CefSharp.DevTools.Tethering.TetheringClient(this)); + } + + return _Tethering; + } + } + + private CefSharp.DevTools.Tracing.TracingClient _Tracing; + /// + /// Tracing + /// + public CefSharp.DevTools.Tracing.TracingClient Tracing + { + get + { + if ((_Tracing) == (null)) + { + _Tracing = (new CefSharp.DevTools.Tracing.TracingClient(this)); + } + + return _Tracing; + } + } + + private CefSharp.DevTools.WebAudio.WebAudioClient _WebAudio; + /// + /// This domain allows inspection of Web Audio API. + /// https://webaudio.github.io/web-audio-api/ + /// + public CefSharp.DevTools.WebAudio.WebAudioClient WebAudio + { + get + { + if ((_WebAudio) == (null)) + { + _WebAudio = (new CefSharp.DevTools.WebAudio.WebAudioClient(this)); + } + + return _WebAudio; + } + } + + private CefSharp.DevTools.WebAuthn.WebAuthnClient _WebAuthn; + /// + /// This domain allows configuring virtual authenticators to test the WebAuthn + /// API. + /// + public CefSharp.DevTools.WebAuthn.WebAuthnClient WebAuthn + { + get + { + if ((_WebAuthn) == (null)) + { + _WebAuthn = (new CefSharp.DevTools.WebAuthn.WebAuthnClient(this)); + } + + return _WebAuthn; + } + } + + private CefSharp.DevTools.Debugger.DebuggerClient _Debugger; + /// + /// Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing + /// breakpoints, stepping through execution, exploring stack traces, etc. + /// + public CefSharp.DevTools.Debugger.DebuggerClient Debugger + { + get + { + if ((_Debugger) == (null)) + { + _Debugger = (new CefSharp.DevTools.Debugger.DebuggerClient(this)); + } + + return _Debugger; + } + } + + private CefSharp.DevTools.HeapProfiler.HeapProfilerClient _HeapProfiler; + /// + /// HeapProfiler + /// + public CefSharp.DevTools.HeapProfiler.HeapProfilerClient HeapProfiler + { + get + { + if ((_HeapProfiler) == (null)) + { + _HeapProfiler = (new CefSharp.DevTools.HeapProfiler.HeapProfilerClient(this)); + } + + return _HeapProfiler; + } + } + + private CefSharp.DevTools.Profiler.ProfilerClient _Profiler; + /// + /// Profiler + /// + public CefSharp.DevTools.Profiler.ProfilerClient Profiler + { + get + { + if ((_Profiler) == (null)) + { + _Profiler = (new CefSharp.DevTools.Profiler.ProfilerClient(this)); + } + + return _Profiler; + } + } + + private CefSharp.DevTools.Runtime.RuntimeClient _Runtime; + /// + /// Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. + /// Evaluation results are returned as mirror object that expose object type, string representation + /// and unique identifier that can be used for further object reference. Original objects are + /// maintained in memory unless they are either explicitly released or are released along with the + /// other objects in their object group. + /// + public CefSharp.DevTools.Runtime.RuntimeClient Runtime + { + get + { + if ((_Runtime) == (null)) + { + _Runtime = (new CefSharp.DevTools.Runtime.RuntimeClient(this)); + } + + return _Runtime; + } + } + } +} \ No newline at end of file diff --git a/CefSharp.Core/DevTools/DevToolsClient.Generated.netcore.cs b/CefSharp.Core/DevTools/DevToolsClient.Generated.netcore.cs new file mode 100644 index 0000000000..96d62b22a7 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsClient.Generated.netcore.cs @@ -0,0 +1,65718 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +// +// **This code was generated by a tool, do not change directly** +// CHROMIUM VERSION 146.0.7680.165 +using System.Text.Json.Serialization; + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// Enum of possible property types. + /// + public enum AXValueType + { + /// + /// boolean + /// + [JsonPropertyName("boolean")] + Boolean, + /// + /// tristate + /// + [JsonPropertyName("tristate")] + Tristate, + /// + /// booleanOrUndefined + /// + [JsonPropertyName("booleanOrUndefined")] + BooleanOrUndefined, + /// + /// idref + /// + [JsonPropertyName("idref")] + Idref, + /// + /// idrefList + /// + [JsonPropertyName("idrefList")] + IdrefList, + /// + /// integer + /// + [JsonPropertyName("integer")] + Integer, + /// + /// node + /// + [JsonPropertyName("node")] + Node, + /// + /// nodeList + /// + [JsonPropertyName("nodeList")] + NodeList, + /// + /// number + /// + [JsonPropertyName("number")] + Number, + /// + /// string + /// + [JsonPropertyName("string")] + String, + /// + /// computedString + /// + [JsonPropertyName("computedString")] + ComputedString, + /// + /// token + /// + [JsonPropertyName("token")] + Token, + /// + /// tokenList + /// + [JsonPropertyName("tokenList")] + TokenList, + /// + /// domRelation + /// + [JsonPropertyName("domRelation")] + DomRelation, + /// + /// role + /// + [JsonPropertyName("role")] + Role, + /// + /// internalRole + /// + [JsonPropertyName("internalRole")] + InternalRole, + /// + /// valueUndefined + /// + [JsonPropertyName("valueUndefined")] + ValueUndefined + } + + /// + /// Enum of possible property sources. + /// + public enum AXValueSourceType + { + /// + /// attribute + /// + [JsonPropertyName("attribute")] + Attribute, + /// + /// implicit + /// + [JsonPropertyName("implicit")] + Implicit, + /// + /// style + /// + [JsonPropertyName("style")] + Style, + /// + /// contents + /// + [JsonPropertyName("contents")] + Contents, + /// + /// placeholder + /// + [JsonPropertyName("placeholder")] + Placeholder, + /// + /// relatedElement + /// + [JsonPropertyName("relatedElement")] + RelatedElement + } + + /// + /// Enum of possible native property sources (as a subtype of a particular AXValueSourceType). + /// + public enum AXValueNativeSourceType + { + /// + /// description + /// + [JsonPropertyName("description")] + Description, + /// + /// figcaption + /// + [JsonPropertyName("figcaption")] + Figcaption, + /// + /// label + /// + [JsonPropertyName("label")] + Label, + /// + /// labelfor + /// + [JsonPropertyName("labelfor")] + Labelfor, + /// + /// labelwrapped + /// + [JsonPropertyName("labelwrapped")] + Labelwrapped, + /// + /// legend + /// + [JsonPropertyName("legend")] + Legend, + /// + /// rubyannotation + /// + [JsonPropertyName("rubyannotation")] + Rubyannotation, + /// + /// tablecaption + /// + [JsonPropertyName("tablecaption")] + Tablecaption, + /// + /// title + /// + [JsonPropertyName("title")] + Title, + /// + /// other + /// + [JsonPropertyName("other")] + Other + } + + /// + /// A single source for a computed AX property. + /// + public partial class AXValueSource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// What type of source this is. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Accessibility.AXValueSourceType Type + { + get; + set; + } + + /// + /// The value of this property source. + /// + [JsonPropertyName("value")] + public CefSharp.DevTools.Accessibility.AXValue Value + { + get; + set; + } + + /// + /// The name of the relevant attribute, if any. + /// + [JsonPropertyName("attribute")] + public string Attribute + { + get; + set; + } + + /// + /// The value of the relevant attribute, if any. + /// + [JsonPropertyName("attributeValue")] + public CefSharp.DevTools.Accessibility.AXValue AttributeValue + { + get; + set; + } + + /// + /// Whether this source is superseded by a higher priority source. + /// + [JsonPropertyName("superseded")] + public bool? Superseded + { + get; + set; + } + + /// + /// The native markup source for this value, e.g. a `<label>` element. + /// + [JsonPropertyName("nativeSource")] + public CefSharp.DevTools.Accessibility.AXValueNativeSourceType? NativeSource + { + get; + set; + } + + /// + /// The value, such as a node or node list, of the native source. + /// + [JsonPropertyName("nativeSourceValue")] + public CefSharp.DevTools.Accessibility.AXValue NativeSourceValue + { + get; + set; + } + + /// + /// Whether the value for this property is invalid. + /// + [JsonPropertyName("invalid")] + public bool? Invalid + { + get; + set; + } + + /// + /// Reason for the value being invalid, if it is. + /// + [JsonPropertyName("invalidReason")] + public string InvalidReason + { + get; + set; + } + } + + /// + /// AXRelatedNode + /// + public partial class AXRelatedNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The BackendNodeId of the related DOM node. + /// + [JsonPropertyName("backendDOMNodeId")] + public int BackendDOMNodeId + { + get; + set; + } + + /// + /// The IDRef value provided, if any. + /// + [JsonPropertyName("idref")] + public string Idref + { + get; + set; + } + + /// + /// The text alternative of this node in the current context. + /// + [JsonPropertyName("text")] + public string Text + { + get; + set; + } + } + + /// + /// AXProperty + /// + public partial class AXProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The name of this property. + /// + [JsonPropertyName("name")] + public CefSharp.DevTools.Accessibility.AXPropertyName Name + { + get; + set; + } + + /// + /// The value of this property. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Accessibility.AXValue Value + { + get; + set; + } + } + + /// + /// A single computed AX property. + /// + public partial class AXValue : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The type of this value. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Accessibility.AXValueType Type + { + get; + set; + } + + /// + /// The computed value of this property. + /// + [JsonPropertyName("value")] + public object Value + { + get; + set; + } + + /// + /// One or more related nodes, if applicable. + /// + [JsonPropertyName("relatedNodes")] + public System.Collections.Generic.IList RelatedNodes + { + get; + set; + } + + /// + /// The sources which contributed to the computation of this property. + /// + [JsonPropertyName("sources")] + public System.Collections.Generic.IList Sources + { + get; + set; + } + } + + /// + /// Values of AXProperty name: + /// - from 'busy' to 'roledescription': states which apply to every AX node + /// - from 'live' to 'root': attributes which apply to nodes in live regions + /// - from 'autocomplete' to 'valuetext': attributes which apply to widgets + /// - from 'checked' to 'selected': states which apply to widgets + /// - from 'activedescendant' to 'owns': relationships between elements other than parent/child/sibling + /// - from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden + /// + public enum AXPropertyName + { + /// + /// actions + /// + [JsonPropertyName("actions")] + Actions, + /// + /// busy + /// + [JsonPropertyName("busy")] + Busy, + /// + /// disabled + /// + [JsonPropertyName("disabled")] + Disabled, + /// + /// editable + /// + [JsonPropertyName("editable")] + Editable, + /// + /// focusable + /// + [JsonPropertyName("focusable")] + Focusable, + /// + /// focused + /// + [JsonPropertyName("focused")] + Focused, + /// + /// hidden + /// + [JsonPropertyName("hidden")] + Hidden, + /// + /// hiddenRoot + /// + [JsonPropertyName("hiddenRoot")] + HiddenRoot, + /// + /// invalid + /// + [JsonPropertyName("invalid")] + Invalid, + /// + /// keyshortcuts + /// + [JsonPropertyName("keyshortcuts")] + Keyshortcuts, + /// + /// settable + /// + [JsonPropertyName("settable")] + Settable, + /// + /// roledescription + /// + [JsonPropertyName("roledescription")] + Roledescription, + /// + /// live + /// + [JsonPropertyName("live")] + Live, + /// + /// atomic + /// + [JsonPropertyName("atomic")] + Atomic, + /// + /// relevant + /// + [JsonPropertyName("relevant")] + Relevant, + /// + /// root + /// + [JsonPropertyName("root")] + Root, + /// + /// autocomplete + /// + [JsonPropertyName("autocomplete")] + Autocomplete, + /// + /// hasPopup + /// + [JsonPropertyName("hasPopup")] + HasPopup, + /// + /// level + /// + [JsonPropertyName("level")] + Level, + /// + /// multiselectable + /// + [JsonPropertyName("multiselectable")] + Multiselectable, + /// + /// orientation + /// + [JsonPropertyName("orientation")] + Orientation, + /// + /// multiline + /// + [JsonPropertyName("multiline")] + Multiline, + /// + /// readonly + /// + [JsonPropertyName("readonly")] + Readonly, + /// + /// required + /// + [JsonPropertyName("required")] + Required, + /// + /// valuemin + /// + [JsonPropertyName("valuemin")] + Valuemin, + /// + /// valuemax + /// + [JsonPropertyName("valuemax")] + Valuemax, + /// + /// valuetext + /// + [JsonPropertyName("valuetext")] + Valuetext, + /// + /// checked + /// + [JsonPropertyName("checked")] + Checked, + /// + /// expanded + /// + [JsonPropertyName("expanded")] + Expanded, + /// + /// modal + /// + [JsonPropertyName("modal")] + Modal, + /// + /// pressed + /// + [JsonPropertyName("pressed")] + Pressed, + /// + /// selected + /// + [JsonPropertyName("selected")] + Selected, + /// + /// activedescendant + /// + [JsonPropertyName("activedescendant")] + Activedescendant, + /// + /// controls + /// + [JsonPropertyName("controls")] + Controls, + /// + /// describedby + /// + [JsonPropertyName("describedby")] + Describedby, + /// + /// details + /// + [JsonPropertyName("details")] + Details, + /// + /// errormessage + /// + [JsonPropertyName("errormessage")] + Errormessage, + /// + /// flowto + /// + [JsonPropertyName("flowto")] + Flowto, + /// + /// labelledby + /// + [JsonPropertyName("labelledby")] + Labelledby, + /// + /// owns + /// + [JsonPropertyName("owns")] + Owns, + /// + /// url + /// + [JsonPropertyName("url")] + Url, + /// + /// activeFullscreenElement + /// + [JsonPropertyName("activeFullscreenElement")] + ActiveFullscreenElement, + /// + /// activeModalDialog + /// + [JsonPropertyName("activeModalDialog")] + ActiveModalDialog, + /// + /// activeAriaModalDialog + /// + [JsonPropertyName("activeAriaModalDialog")] + ActiveAriaModalDialog, + /// + /// ariaHiddenElement + /// + [JsonPropertyName("ariaHiddenElement")] + AriaHiddenElement, + /// + /// ariaHiddenSubtree + /// + [JsonPropertyName("ariaHiddenSubtree")] + AriaHiddenSubtree, + /// + /// emptyAlt + /// + [JsonPropertyName("emptyAlt")] + EmptyAlt, + /// + /// emptyText + /// + [JsonPropertyName("emptyText")] + EmptyText, + /// + /// inertElement + /// + [JsonPropertyName("inertElement")] + InertElement, + /// + /// inertSubtree + /// + [JsonPropertyName("inertSubtree")] + InertSubtree, + /// + /// labelContainer + /// + [JsonPropertyName("labelContainer")] + LabelContainer, + /// + /// labelFor + /// + [JsonPropertyName("labelFor")] + LabelFor, + /// + /// notRendered + /// + [JsonPropertyName("notRendered")] + NotRendered, + /// + /// notVisible + /// + [JsonPropertyName("notVisible")] + NotVisible, + /// + /// presentationalRole + /// + [JsonPropertyName("presentationalRole")] + PresentationalRole, + /// + /// probablyPresentational + /// + [JsonPropertyName("probablyPresentational")] + ProbablyPresentational, + /// + /// inactiveCarouselTabContent + /// + [JsonPropertyName("inactiveCarouselTabContent")] + InactiveCarouselTabContent, + /// + /// uninteresting + /// + [JsonPropertyName("uninteresting")] + Uninteresting + } + + /// + /// A node in the accessibility tree. + /// + public partial class AXNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unique identifier for this node. + /// + [JsonPropertyName("nodeId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeId + { + get; + set; + } + + /// + /// Whether this node is ignored for accessibility + /// + [JsonPropertyName("ignored")] + public bool Ignored + { + get; + set; + } + + /// + /// Collection of reasons why this node is hidden. + /// + [JsonPropertyName("ignoredReasons")] + public System.Collections.Generic.IList IgnoredReasons + { + get; + set; + } + + /// + /// This `Node`'s role, whether explicit or implicit. + /// + [JsonPropertyName("role")] + public CefSharp.DevTools.Accessibility.AXValue Role + { + get; + set; + } + + /// + /// This `Node`'s Chrome raw role. + /// + [JsonPropertyName("chromeRole")] + public CefSharp.DevTools.Accessibility.AXValue ChromeRole + { + get; + set; + } + + /// + /// The accessible name for this `Node`. + /// + [JsonPropertyName("name")] + public CefSharp.DevTools.Accessibility.AXValue Name + { + get; + set; + } + + /// + /// The accessible description for this `Node`. + /// + [JsonPropertyName("description")] + public CefSharp.DevTools.Accessibility.AXValue Description + { + get; + set; + } + + /// + /// The value for this `Node`. + /// + [JsonPropertyName("value")] + public CefSharp.DevTools.Accessibility.AXValue Value + { + get; + set; + } + + /// + /// All other properties + /// + [JsonPropertyName("properties")] + public System.Collections.Generic.IList Properties + { + get; + set; + } + + /// + /// ID for this node's parent. + /// + [JsonPropertyName("parentId")] + public string ParentId + { + get; + set; + } + + /// + /// IDs for each of this node's child nodes. + /// + [JsonPropertyName("childIds")] + public string[] ChildIds + { + get; + set; + } + + /// + /// The backend ID for the associated DOM node, if any. + /// + [JsonPropertyName("backendDOMNodeId")] + public int? BackendDOMNodeId + { + get; + set; + } + + /// + /// The frame ID for the frame associated with this nodes document. + /// + [JsonPropertyName("frameId")] + public string FrameId + { + get; + set; + } + } + + /// + /// The loadComplete event mirrors the load complete event sent by the browser to assistive + /// technology when the web page has finished loading. + /// + public class LoadCompleteEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// New document root node. + /// + [JsonInclude] + [JsonPropertyName("root")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Accessibility.AXNode Root + { + get; + private set; + } + } + + /// + /// The nodesUpdated event is sent every time a previously requested node has changed the in tree. + /// + public class NodesUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Updated node data. + /// + [JsonInclude] + [JsonPropertyName("nodes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Animation +{ + /// + /// Animation type of `Animation`. + /// + public enum AnimationType + { + /// + /// CSSTransition + /// + [JsonPropertyName("CSSTransition")] + CSSTransition, + /// + /// CSSAnimation + /// + [JsonPropertyName("CSSAnimation")] + CSSAnimation, + /// + /// WebAnimation + /// + [JsonPropertyName("WebAnimation")] + WebAnimation + } + + /// + /// Animation instance. + /// + public partial class Animation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `Animation`'s id. + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// `Animation`'s name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// `Animation`'s internal paused state. + /// + [JsonPropertyName("pausedState")] + public bool PausedState + { + get; + set; + } + + /// + /// `Animation`'s play state. + /// + [JsonPropertyName("playState")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PlayState + { + get; + set; + } + + /// + /// `Animation`'s playback rate. + /// + [JsonPropertyName("playbackRate")] + public double PlaybackRate + { + get; + set; + } + + /// + /// `Animation`'s start time. + /// Milliseconds for time based animations and + /// percentage [0 - 100] for scroll driven animations + /// (i.e. when viewOrScrollTimeline exists). + /// + [JsonPropertyName("startTime")] + public double StartTime + { + get; + set; + } + + /// + /// `Animation`'s current time. + /// + [JsonPropertyName("currentTime")] + public double CurrentTime + { + get; + set; + } + + /// + /// Animation type of `Animation`. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Animation.AnimationType Type + { + get; + set; + } + + /// + /// `Animation`'s source animation node. + /// + [JsonPropertyName("source")] + public CefSharp.DevTools.Animation.AnimationEffect Source + { + get; + set; + } + + /// + /// A unique ID for `Animation` representing the sources that triggered this CSS + /// animation/transition. + /// + [JsonPropertyName("cssId")] + public string CssId + { + get; + set; + } + + /// + /// View or scroll timeline + /// + [JsonPropertyName("viewOrScrollTimeline")] + public CefSharp.DevTools.Animation.ViewOrScrollTimeline ViewOrScrollTimeline + { + get; + set; + } + } + + /// + /// Timeline instance + /// + public partial class ViewOrScrollTimeline : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Scroll container node + /// + [JsonPropertyName("sourceNodeId")] + public int? SourceNodeId + { + get; + set; + } + + /// + /// Represents the starting scroll position of the timeline + /// as a length offset in pixels from scroll origin. + /// + [JsonPropertyName("startOffset")] + public double? StartOffset + { + get; + set; + } + + /// + /// Represents the ending scroll position of the timeline + /// as a length offset in pixels from scroll origin. + /// + [JsonPropertyName("endOffset")] + public double? EndOffset + { + get; + set; + } + + /// + /// The element whose principal box's visibility in the + /// scrollport defined the progress of the timeline. + /// Does not exist for animations with ScrollTimeline + /// + [JsonPropertyName("subjectNodeId")] + public int? SubjectNodeId + { + get; + set; + } + + /// + /// Orientation of the scroll + /// + [JsonPropertyName("axis")] + public CefSharp.DevTools.DOM.ScrollOrientation Axis + { + get; + set; + } + } + + /// + /// AnimationEffect instance + /// + public partial class AnimationEffect : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `AnimationEffect`'s delay. + /// + [JsonPropertyName("delay")] + public double Delay + { + get; + set; + } + + /// + /// `AnimationEffect`'s end delay. + /// + [JsonPropertyName("endDelay")] + public double EndDelay + { + get; + set; + } + + /// + /// `AnimationEffect`'s iteration start. + /// + [JsonPropertyName("iterationStart")] + public double IterationStart + { + get; + set; + } + + /// + /// `AnimationEffect`'s iterations. Omitted if the value is infinite. + /// + [JsonPropertyName("iterations")] + public double? Iterations + { + get; + set; + } + + /// + /// `AnimationEffect`'s iteration duration. + /// Milliseconds for time based animations and + /// percentage [0 - 100] for scroll driven animations + /// (i.e. when viewOrScrollTimeline exists). + /// + [JsonPropertyName("duration")] + public double Duration + { + get; + set; + } + + /// + /// `AnimationEffect`'s playback direction. + /// + [JsonPropertyName("direction")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Direction + { + get; + set; + } + + /// + /// `AnimationEffect`'s fill mode. + /// + [JsonPropertyName("fill")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Fill + { + get; + set; + } + + /// + /// `AnimationEffect`'s target node. + /// + [JsonPropertyName("backendNodeId")] + public int? BackendNodeId + { + get; + set; + } + + /// + /// `AnimationEffect`'s keyframes. + /// + [JsonPropertyName("keyframesRule")] + public CefSharp.DevTools.Animation.KeyframesRule KeyframesRule + { + get; + set; + } + + /// + /// `AnimationEffect`'s timing function. + /// + [JsonPropertyName("easing")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Easing + { + get; + set; + } + } + + /// + /// Keyframes Rule + /// + public partial class KeyframesRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CSS keyframed animation's name. + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// List of animation keyframes. + /// + [JsonPropertyName("keyframes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Keyframes + { + get; + set; + } + } + + /// + /// Keyframe Style + /// + public partial class KeyframeStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Keyframe's time offset. + /// + [JsonPropertyName("offset")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Offset + { + get; + set; + } + + /// + /// `AnimationEffect`'s timing function. + /// + [JsonPropertyName("easing")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Easing + { + get; + set; + } + } + + /// + /// Event for when an animation has been cancelled. + /// + public class AnimationCanceledEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the animation that was cancelled. + /// + [JsonInclude] + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + private set; + } + } + + /// + /// Event for each animation that has been created. + /// + public class AnimationCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the animation that was created. + /// + [JsonInclude] + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + private set; + } + } + + /// + /// Event for animation that has been started. + /// + public class AnimationStartedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Animation that was started. + /// + [JsonInclude] + [JsonPropertyName("animation")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Animation.Animation Animation + { + get; + private set; + } + } + + /// + /// Event for animation that has been updated. + /// + public class AnimationUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Animation that was updated. + /// + [JsonInclude] + [JsonPropertyName("animation")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Animation.Animation Animation + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Audits +{ + /// + /// Information about a cookie that is affected by an inspector issue. + /// + public partial class AffectedCookie : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The following three properties uniquely identify a cookie + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Path + /// + [JsonPropertyName("path")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Path + { + get; + set; + } + + /// + /// Domain + /// + [JsonPropertyName("domain")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Domain + { + get; + set; + } + } + + /// + /// Information about a request that is affected by an inspector issue. + /// + public partial class AffectedRequest : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The unique request id. + /// + [JsonPropertyName("requestId")] + public string RequestId + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + } + + /// + /// Information about the frame affected by an inspector issue. + /// + public partial class AffectedFrame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FrameId + /// + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + set; + } + } + + /// + /// CookieExclusionReason + /// + public enum CookieExclusionReason + { + /// + /// ExcludeSameSiteUnspecifiedTreatedAsLax + /// + [JsonPropertyName("ExcludeSameSiteUnspecifiedTreatedAsLax")] + ExcludeSameSiteUnspecifiedTreatedAsLax, + /// + /// ExcludeSameSiteNoneInsecure + /// + [JsonPropertyName("ExcludeSameSiteNoneInsecure")] + ExcludeSameSiteNoneInsecure, + /// + /// ExcludeSameSiteLax + /// + [JsonPropertyName("ExcludeSameSiteLax")] + ExcludeSameSiteLax, + /// + /// ExcludeSameSiteStrict + /// + [JsonPropertyName("ExcludeSameSiteStrict")] + ExcludeSameSiteStrict, + /// + /// ExcludeDomainNonASCII + /// + [JsonPropertyName("ExcludeDomainNonASCII")] + ExcludeDomainNonASCII, + /// + /// ExcludeThirdPartyCookieBlockedInFirstPartySet + /// + [JsonPropertyName("ExcludeThirdPartyCookieBlockedInFirstPartySet")] + ExcludeThirdPartyCookieBlockedInFirstPartySet, + /// + /// ExcludeThirdPartyPhaseout + /// + [JsonPropertyName("ExcludeThirdPartyPhaseout")] + ExcludeThirdPartyPhaseout, + /// + /// ExcludePortMismatch + /// + [JsonPropertyName("ExcludePortMismatch")] + ExcludePortMismatch, + /// + /// ExcludeSchemeMismatch + /// + [JsonPropertyName("ExcludeSchemeMismatch")] + ExcludeSchemeMismatch + } + + /// + /// CookieWarningReason + /// + public enum CookieWarningReason + { + /// + /// WarnSameSiteUnspecifiedCrossSiteContext + /// + [JsonPropertyName("WarnSameSiteUnspecifiedCrossSiteContext")] + WarnSameSiteUnspecifiedCrossSiteContext, + /// + /// WarnSameSiteNoneInsecure + /// + [JsonPropertyName("WarnSameSiteNoneInsecure")] + WarnSameSiteNoneInsecure, + /// + /// WarnSameSiteUnspecifiedLaxAllowUnsafe + /// + [JsonPropertyName("WarnSameSiteUnspecifiedLaxAllowUnsafe")] + WarnSameSiteUnspecifiedLaxAllowUnsafe, + /// + /// WarnSameSiteStrictLaxDowngradeStrict + /// + [JsonPropertyName("WarnSameSiteStrictLaxDowngradeStrict")] + WarnSameSiteStrictLaxDowngradeStrict, + /// + /// WarnSameSiteStrictCrossDowngradeStrict + /// + [JsonPropertyName("WarnSameSiteStrictCrossDowngradeStrict")] + WarnSameSiteStrictCrossDowngradeStrict, + /// + /// WarnSameSiteStrictCrossDowngradeLax + /// + [JsonPropertyName("WarnSameSiteStrictCrossDowngradeLax")] + WarnSameSiteStrictCrossDowngradeLax, + /// + /// WarnSameSiteLaxCrossDowngradeStrict + /// + [JsonPropertyName("WarnSameSiteLaxCrossDowngradeStrict")] + WarnSameSiteLaxCrossDowngradeStrict, + /// + /// WarnSameSiteLaxCrossDowngradeLax + /// + [JsonPropertyName("WarnSameSiteLaxCrossDowngradeLax")] + WarnSameSiteLaxCrossDowngradeLax, + /// + /// WarnAttributeValueExceedsMaxSize + /// + [JsonPropertyName("WarnAttributeValueExceedsMaxSize")] + WarnAttributeValueExceedsMaxSize, + /// + /// WarnDomainNonASCII + /// + [JsonPropertyName("WarnDomainNonASCII")] + WarnDomainNonASCII, + /// + /// WarnThirdPartyPhaseout + /// + [JsonPropertyName("WarnThirdPartyPhaseout")] + WarnThirdPartyPhaseout, + /// + /// WarnCrossSiteRedirectDowngradeChangesInclusion + /// + [JsonPropertyName("WarnCrossSiteRedirectDowngradeChangesInclusion")] + WarnCrossSiteRedirectDowngradeChangesInclusion, + /// + /// WarnDeprecationTrialMetadata + /// + [JsonPropertyName("WarnDeprecationTrialMetadata")] + WarnDeprecationTrialMetadata, + /// + /// WarnThirdPartyCookieHeuristic + /// + [JsonPropertyName("WarnThirdPartyCookieHeuristic")] + WarnThirdPartyCookieHeuristic + } + + /// + /// CookieOperation + /// + public enum CookieOperation + { + /// + /// SetCookie + /// + [JsonPropertyName("SetCookie")] + SetCookie, + /// + /// ReadCookie + /// + [JsonPropertyName("ReadCookie")] + ReadCookie + } + + /// + /// Represents the category of insight that a cookie issue falls under. + /// + public enum InsightType + { + /// + /// GitHubResource + /// + [JsonPropertyName("GitHubResource")] + GitHubResource, + /// + /// GracePeriod + /// + [JsonPropertyName("GracePeriod")] + GracePeriod, + /// + /// Heuristics + /// + [JsonPropertyName("Heuristics")] + Heuristics + } + + /// + /// Information about the suggested solution to a cookie issue. + /// + public partial class CookieIssueInsight : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Audits.InsightType Type + { + get; + set; + } + + /// + /// Link to table entry in third-party cookie migration readiness list. + /// + [JsonPropertyName("tableEntryUrl")] + public string TableEntryUrl + { + get; + set; + } + } + + /// + /// This information is currently necessary, as the front-end has a difficult + /// time finding a specific cookie. With this, we can convey specific error + /// information without the cookie. + /// + public partial class CookieIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// If AffectedCookie is not set then rawCookieLine contains the raw + /// Set-Cookie header string. This hints at a problem where the + /// cookie line is syntactically or semantically malformed in a way + /// that no valid cookie could be created. + /// + [JsonPropertyName("cookie")] + public CefSharp.DevTools.Audits.AffectedCookie Cookie + { + get; + set; + } + + /// + /// RawCookieLine + /// + [JsonPropertyName("rawCookieLine")] + public string RawCookieLine + { + get; + set; + } + + /// + /// CookieWarningReasons + /// + [JsonPropertyName("cookieWarningReasons")] + public CefSharp.DevTools.Audits.CookieWarningReason[] CookieWarningReasons + { + get; + set; + } + + /// + /// CookieExclusionReasons + /// + [JsonPropertyName("cookieExclusionReasons")] + public CefSharp.DevTools.Audits.CookieExclusionReason[] CookieExclusionReasons + { + get; + set; + } + + /// + /// Optionally identifies the site-for-cookies and the cookie url, which + /// may be used by the front-end as additional context. + /// + [JsonPropertyName("operation")] + public CefSharp.DevTools.Audits.CookieOperation Operation + { + get; + set; + } + + /// + /// SiteForCookies + /// + [JsonPropertyName("siteForCookies")] + public string SiteForCookies + { + get; + set; + } + + /// + /// CookieUrl + /// + [JsonPropertyName("cookieUrl")] + public string CookieUrl + { + get; + set; + } + + /// + /// Request + /// + [JsonPropertyName("request")] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// The recommended solution to the issue. + /// + [JsonPropertyName("insight")] + public CefSharp.DevTools.Audits.CookieIssueInsight Insight + { + get; + set; + } + } + + /// + /// MixedContentResolutionStatus + /// + public enum MixedContentResolutionStatus + { + /// + /// MixedContentBlocked + /// + [JsonPropertyName("MixedContentBlocked")] + MixedContentBlocked, + /// + /// MixedContentAutomaticallyUpgraded + /// + [JsonPropertyName("MixedContentAutomaticallyUpgraded")] + MixedContentAutomaticallyUpgraded, + /// + /// MixedContentWarning + /// + [JsonPropertyName("MixedContentWarning")] + MixedContentWarning + } + + /// + /// MixedContentResourceType + /// + public enum MixedContentResourceType + { + /// + /// AttributionSrc + /// + [JsonPropertyName("AttributionSrc")] + AttributionSrc, + /// + /// Audio + /// + [JsonPropertyName("Audio")] + Audio, + /// + /// Beacon + /// + [JsonPropertyName("Beacon")] + Beacon, + /// + /// CSPReport + /// + [JsonPropertyName("CSPReport")] + CSPReport, + /// + /// Download + /// + [JsonPropertyName("Download")] + Download, + /// + /// EventSource + /// + [JsonPropertyName("EventSource")] + EventSource, + /// + /// Favicon + /// + [JsonPropertyName("Favicon")] + Favicon, + /// + /// Font + /// + [JsonPropertyName("Font")] + Font, + /// + /// Form + /// + [JsonPropertyName("Form")] + Form, + /// + /// Frame + /// + [JsonPropertyName("Frame")] + Frame, + /// + /// Image + /// + [JsonPropertyName("Image")] + Image, + /// + /// Import + /// + [JsonPropertyName("Import")] + Import, + /// + /// JSON + /// + [JsonPropertyName("JSON")] + JSON, + /// + /// Manifest + /// + [JsonPropertyName("Manifest")] + Manifest, + /// + /// Ping + /// + [JsonPropertyName("Ping")] + Ping, + /// + /// PluginData + /// + [JsonPropertyName("PluginData")] + PluginData, + /// + /// PluginResource + /// + [JsonPropertyName("PluginResource")] + PluginResource, + /// + /// Prefetch + /// + [JsonPropertyName("Prefetch")] + Prefetch, + /// + /// Resource + /// + [JsonPropertyName("Resource")] + Resource, + /// + /// Script + /// + [JsonPropertyName("Script")] + Script, + /// + /// ServiceWorker + /// + [JsonPropertyName("ServiceWorker")] + ServiceWorker, + /// + /// SharedWorker + /// + [JsonPropertyName("SharedWorker")] + SharedWorker, + /// + /// SpeculationRules + /// + [JsonPropertyName("SpeculationRules")] + SpeculationRules, + /// + /// Stylesheet + /// + [JsonPropertyName("Stylesheet")] + Stylesheet, + /// + /// Track + /// + [JsonPropertyName("Track")] + Track, + /// + /// Video + /// + [JsonPropertyName("Video")] + Video, + /// + /// Worker + /// + [JsonPropertyName("Worker")] + Worker, + /// + /// XMLHttpRequest + /// + [JsonPropertyName("XMLHttpRequest")] + XMLHttpRequest, + /// + /// XSLT + /// + [JsonPropertyName("XSLT")] + XSLT + } + + /// + /// MixedContentIssueDetails + /// + public partial class MixedContentIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The type of resource causing the mixed content issue (css, js, iframe, + /// form,...). Marked as optional because it is mapped to from + /// blink::mojom::RequestContextType, which will be replaced + /// by network::mojom::RequestDestination + /// + [JsonPropertyName("resourceType")] + public CefSharp.DevTools.Audits.MixedContentResourceType? ResourceType + { + get; + set; + } + + /// + /// The way the mixed content issue is being resolved. + /// + [JsonPropertyName("resolutionStatus")] + public CefSharp.DevTools.Audits.MixedContentResolutionStatus ResolutionStatus + { + get; + set; + } + + /// + /// The unsafe http url causing the mixed content issue. + /// + [JsonPropertyName("insecureURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string InsecureURL + { + get; + set; + } + + /// + /// The url responsible for the call to an unsafe url. + /// + [JsonPropertyName("mainResourceURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string MainResourceURL + { + get; + set; + } + + /// + /// The mixed content request. + /// Does not always exist (e.g. for unsafe form submission urls). + /// + [JsonPropertyName("request")] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// Optional because not every mixed content issue is necessarily linked to a frame. + /// + [JsonPropertyName("frame")] + public CefSharp.DevTools.Audits.AffectedFrame Frame + { + get; + set; + } + } + + /// + /// Enum indicating the reason a response has been blocked. These reasons are + /// refinements of the net error BLOCKED_BY_RESPONSE. + /// + public enum BlockedByResponseReason + { + /// + /// CoepFrameResourceNeedsCoepHeader + /// + [JsonPropertyName("CoepFrameResourceNeedsCoepHeader")] + CoepFrameResourceNeedsCoepHeader, + /// + /// CoopSandboxedIFrameCannotNavigateToCoopPage + /// + [JsonPropertyName("CoopSandboxedIFrameCannotNavigateToCoopPage")] + CoopSandboxedIFrameCannotNavigateToCoopPage, + /// + /// CorpNotSameOrigin + /// + [JsonPropertyName("CorpNotSameOrigin")] + CorpNotSameOrigin, + /// + /// CorpNotSameOriginAfterDefaultedToSameOriginByCoep + /// + [JsonPropertyName("CorpNotSameOriginAfterDefaultedToSameOriginByCoep")] + CorpNotSameOriginAfterDefaultedToSameOriginByCoep, + /// + /// CorpNotSameOriginAfterDefaultedToSameOriginByDip + /// + [JsonPropertyName("CorpNotSameOriginAfterDefaultedToSameOriginByDip")] + CorpNotSameOriginAfterDefaultedToSameOriginByDip, + /// + /// CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip + /// + [JsonPropertyName("CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip")] + CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip, + /// + /// CorpNotSameSite + /// + [JsonPropertyName("CorpNotSameSite")] + CorpNotSameSite, + /// + /// SRIMessageSignatureMismatch + /// + [JsonPropertyName("SRIMessageSignatureMismatch")] + SRIMessageSignatureMismatch + } + + /// + /// Details for a request that has been blocked with the BLOCKED_BY_RESPONSE + /// code. Currently only used for COEP/COOP, but may be extended to include + /// some CSP errors in the future. + /// + public partial class BlockedByResponseIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Request + /// + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// ParentFrame + /// + [JsonPropertyName("parentFrame")] + public CefSharp.DevTools.Audits.AffectedFrame ParentFrame + { + get; + set; + } + + /// + /// BlockedFrame + /// + [JsonPropertyName("blockedFrame")] + public CefSharp.DevTools.Audits.AffectedFrame BlockedFrame + { + get; + set; + } + + /// + /// Reason + /// + [JsonPropertyName("reason")] + public CefSharp.DevTools.Audits.BlockedByResponseReason Reason + { + get; + set; + } + } + + /// + /// HeavyAdResolutionStatus + /// + public enum HeavyAdResolutionStatus + { + /// + /// HeavyAdBlocked + /// + [JsonPropertyName("HeavyAdBlocked")] + HeavyAdBlocked, + /// + /// HeavyAdWarning + /// + [JsonPropertyName("HeavyAdWarning")] + HeavyAdWarning + } + + /// + /// HeavyAdReason + /// + public enum HeavyAdReason + { + /// + /// NetworkTotalLimit + /// + [JsonPropertyName("NetworkTotalLimit")] + NetworkTotalLimit, + /// + /// CpuTotalLimit + /// + [JsonPropertyName("CpuTotalLimit")] + CpuTotalLimit, + /// + /// CpuPeakLimit + /// + [JsonPropertyName("CpuPeakLimit")] + CpuPeakLimit + } + + /// + /// HeavyAdIssueDetails + /// + public partial class HeavyAdIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The resolution status, either blocking the content or warning. + /// + [JsonPropertyName("resolution")] + public CefSharp.DevTools.Audits.HeavyAdResolutionStatus Resolution + { + get; + set; + } + + /// + /// The reason the ad was blocked, total network or cpu or peak cpu. + /// + [JsonPropertyName("reason")] + public CefSharp.DevTools.Audits.HeavyAdReason Reason + { + get; + set; + } + + /// + /// The frame that was blocked. + /// + [JsonPropertyName("frame")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.AffectedFrame Frame + { + get; + set; + } + } + + /// + /// ContentSecurityPolicyViolationType + /// + public enum ContentSecurityPolicyViolationType + { + /// + /// kInlineViolation + /// + [JsonPropertyName("kInlineViolation")] + KInlineViolation, + /// + /// kEvalViolation + /// + [JsonPropertyName("kEvalViolation")] + KEvalViolation, + /// + /// kURLViolation + /// + [JsonPropertyName("kURLViolation")] + KURLViolation, + /// + /// kSRIViolation + /// + [JsonPropertyName("kSRIViolation")] + KSRIViolation, + /// + /// kTrustedTypesSinkViolation + /// + [JsonPropertyName("kTrustedTypesSinkViolation")] + KTrustedTypesSinkViolation, + /// + /// kTrustedTypesPolicyViolation + /// + [JsonPropertyName("kTrustedTypesPolicyViolation")] + KTrustedTypesPolicyViolation, + /// + /// kWasmEvalViolation + /// + [JsonPropertyName("kWasmEvalViolation")] + KWasmEvalViolation + } + + /// + /// SourceCodeLocation + /// + public partial class SourceCodeLocation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ScriptId + /// + [JsonPropertyName("scriptId")] + public string ScriptId + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// LineNumber + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// ColumnNumber + /// + [JsonPropertyName("columnNumber")] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// ContentSecurityPolicyIssueDetails + /// + public partial class ContentSecurityPolicyIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The url not included in allowed sources. + /// + [JsonPropertyName("blockedURL")] + public string BlockedURL + { + get; + set; + } + + /// + /// Specific directive that is violated, causing the CSP issue. + /// + [JsonPropertyName("violatedDirective")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ViolatedDirective + { + get; + set; + } + + /// + /// IsReportOnly + /// + [JsonPropertyName("isReportOnly")] + public bool IsReportOnly + { + get; + set; + } + + /// + /// ContentSecurityPolicyViolationType + /// + [JsonPropertyName("contentSecurityPolicyViolationType")] + public CefSharp.DevTools.Audits.ContentSecurityPolicyViolationType ContentSecurityPolicyViolationType + { + get; + set; + } + + /// + /// FrameAncestor + /// + [JsonPropertyName("frameAncestor")] + public CefSharp.DevTools.Audits.AffectedFrame FrameAncestor + { + get; + set; + } + + /// + /// SourceCodeLocation + /// + [JsonPropertyName("sourceCodeLocation")] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// ViolatingNodeId + /// + [JsonPropertyName("violatingNodeId")] + public int? ViolatingNodeId + { + get; + set; + } + } + + /// + /// SharedArrayBufferIssueType + /// + public enum SharedArrayBufferIssueType + { + /// + /// TransferIssue + /// + [JsonPropertyName("TransferIssue")] + TransferIssue, + /// + /// CreationIssue + /// + [JsonPropertyName("CreationIssue")] + CreationIssue + } + + /// + /// Details for a issue arising from an SAB being instantiated in, or + /// transferred to a context that is not cross-origin isolated. + /// + public partial class SharedArrayBufferIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// SourceCodeLocation + /// + [JsonPropertyName("sourceCodeLocation")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// IsWarning + /// + [JsonPropertyName("isWarning")] + public bool IsWarning + { + get; + set; + } + + /// + /// Type + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Audits.SharedArrayBufferIssueType Type + { + get; + set; + } + } + + /// + /// LowTextContrastIssueDetails + /// + public partial class LowTextContrastIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ViolatingNodeId + /// + [JsonPropertyName("violatingNodeId")] + public int ViolatingNodeId + { + get; + set; + } + + /// + /// ViolatingNodeSelector + /// + [JsonPropertyName("violatingNodeSelector")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ViolatingNodeSelector + { + get; + set; + } + + /// + /// ContrastRatio + /// + [JsonPropertyName("contrastRatio")] + public double ContrastRatio + { + get; + set; + } + + /// + /// ThresholdAA + /// + [JsonPropertyName("thresholdAA")] + public double ThresholdAA + { + get; + set; + } + + /// + /// ThresholdAAA + /// + [JsonPropertyName("thresholdAAA")] + public double ThresholdAAA + { + get; + set; + } + + /// + /// FontSize + /// + [JsonPropertyName("fontSize")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FontSize + { + get; + set; + } + + /// + /// FontWeight + /// + [JsonPropertyName("fontWeight")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FontWeight + { + get; + set; + } + } + + /// + /// Details for a CORS related issue, e.g. a warning or error related to + /// CORS RFC1918 enforcement. + /// + public partial class CorsIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CorsErrorStatus + /// + [JsonPropertyName("corsErrorStatus")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.CorsErrorStatus CorsErrorStatus + { + get; + set; + } + + /// + /// IsWarning + /// + [JsonPropertyName("isWarning")] + public bool IsWarning + { + get; + set; + } + + /// + /// Request + /// + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// Location + /// + [JsonPropertyName("location")] + public CefSharp.DevTools.Audits.SourceCodeLocation Location + { + get; + set; + } + + /// + /// InitiatorOrigin + /// + [JsonPropertyName("initiatorOrigin")] + public string InitiatorOrigin + { + get; + set; + } + + /// + /// ResourceIPAddressSpace + /// + [JsonPropertyName("resourceIPAddressSpace")] + public CefSharp.DevTools.Network.IPAddressSpace? ResourceIPAddressSpace + { + get; + set; + } + + /// + /// ClientSecurityState + /// + [JsonPropertyName("clientSecurityState")] + public CefSharp.DevTools.Network.ClientSecurityState ClientSecurityState + { + get; + set; + } + } + + /// + /// AttributionReportingIssueType + /// + public enum AttributionReportingIssueType + { + /// + /// PermissionPolicyDisabled + /// + [JsonPropertyName("PermissionPolicyDisabled")] + PermissionPolicyDisabled, + /// + /// UntrustworthyReportingOrigin + /// + [JsonPropertyName("UntrustworthyReportingOrigin")] + UntrustworthyReportingOrigin, + /// + /// InsecureContext + /// + [JsonPropertyName("InsecureContext")] + InsecureContext, + /// + /// InvalidHeader + /// + [JsonPropertyName("InvalidHeader")] + InvalidHeader, + /// + /// InvalidRegisterTriggerHeader + /// + [JsonPropertyName("InvalidRegisterTriggerHeader")] + InvalidRegisterTriggerHeader, + /// + /// SourceAndTriggerHeaders + /// + [JsonPropertyName("SourceAndTriggerHeaders")] + SourceAndTriggerHeaders, + /// + /// SourceIgnored + /// + [JsonPropertyName("SourceIgnored")] + SourceIgnored, + /// + /// TriggerIgnored + /// + [JsonPropertyName("TriggerIgnored")] + TriggerIgnored, + /// + /// OsSourceIgnored + /// + [JsonPropertyName("OsSourceIgnored")] + OsSourceIgnored, + /// + /// OsTriggerIgnored + /// + [JsonPropertyName("OsTriggerIgnored")] + OsTriggerIgnored, + /// + /// InvalidRegisterOsSourceHeader + /// + [JsonPropertyName("InvalidRegisterOsSourceHeader")] + InvalidRegisterOsSourceHeader, + /// + /// InvalidRegisterOsTriggerHeader + /// + [JsonPropertyName("InvalidRegisterOsTriggerHeader")] + InvalidRegisterOsTriggerHeader, + /// + /// WebAndOsHeaders + /// + [JsonPropertyName("WebAndOsHeaders")] + WebAndOsHeaders, + /// + /// NoWebOrOsSupport + /// + [JsonPropertyName("NoWebOrOsSupport")] + NoWebOrOsSupport, + /// + /// NavigationRegistrationWithoutTransientUserActivation + /// + [JsonPropertyName("NavigationRegistrationWithoutTransientUserActivation")] + NavigationRegistrationWithoutTransientUserActivation, + /// + /// InvalidInfoHeader + /// + [JsonPropertyName("InvalidInfoHeader")] + InvalidInfoHeader, + /// + /// NoRegisterSourceHeader + /// + [JsonPropertyName("NoRegisterSourceHeader")] + NoRegisterSourceHeader, + /// + /// NoRegisterTriggerHeader + /// + [JsonPropertyName("NoRegisterTriggerHeader")] + NoRegisterTriggerHeader, + /// + /// NoRegisterOsSourceHeader + /// + [JsonPropertyName("NoRegisterOsSourceHeader")] + NoRegisterOsSourceHeader, + /// + /// NoRegisterOsTriggerHeader + /// + [JsonPropertyName("NoRegisterOsTriggerHeader")] + NoRegisterOsTriggerHeader, + /// + /// NavigationRegistrationUniqueScopeAlreadySet + /// + [JsonPropertyName("NavigationRegistrationUniqueScopeAlreadySet")] + NavigationRegistrationUniqueScopeAlreadySet + } + + /// + /// SharedDictionaryError + /// + public enum SharedDictionaryError + { + /// + /// UseErrorCrossOriginNoCorsRequest + /// + [JsonPropertyName("UseErrorCrossOriginNoCorsRequest")] + UseErrorCrossOriginNoCorsRequest, + /// + /// UseErrorDictionaryLoadFailure + /// + [JsonPropertyName("UseErrorDictionaryLoadFailure")] + UseErrorDictionaryLoadFailure, + /// + /// UseErrorMatchingDictionaryNotUsed + /// + [JsonPropertyName("UseErrorMatchingDictionaryNotUsed")] + UseErrorMatchingDictionaryNotUsed, + /// + /// UseErrorUnexpectedContentDictionaryHeader + /// + [JsonPropertyName("UseErrorUnexpectedContentDictionaryHeader")] + UseErrorUnexpectedContentDictionaryHeader, + /// + /// WriteErrorCossOriginNoCorsRequest + /// + [JsonPropertyName("WriteErrorCossOriginNoCorsRequest")] + WriteErrorCossOriginNoCorsRequest, + /// + /// WriteErrorDisallowedBySettings + /// + [JsonPropertyName("WriteErrorDisallowedBySettings")] + WriteErrorDisallowedBySettings, + /// + /// WriteErrorExpiredResponse + /// + [JsonPropertyName("WriteErrorExpiredResponse")] + WriteErrorExpiredResponse, + /// + /// WriteErrorFeatureDisabled + /// + [JsonPropertyName("WriteErrorFeatureDisabled")] + WriteErrorFeatureDisabled, + /// + /// WriteErrorInsufficientResources + /// + [JsonPropertyName("WriteErrorInsufficientResources")] + WriteErrorInsufficientResources, + /// + /// WriteErrorInvalidMatchField + /// + [JsonPropertyName("WriteErrorInvalidMatchField")] + WriteErrorInvalidMatchField, + /// + /// WriteErrorInvalidStructuredHeader + /// + [JsonPropertyName("WriteErrorInvalidStructuredHeader")] + WriteErrorInvalidStructuredHeader, + /// + /// WriteErrorInvalidTTLField + /// + [JsonPropertyName("WriteErrorInvalidTTLField")] + WriteErrorInvalidTTLField, + /// + /// WriteErrorNavigationRequest + /// + [JsonPropertyName("WriteErrorNavigationRequest")] + WriteErrorNavigationRequest, + /// + /// WriteErrorNoMatchField + /// + [JsonPropertyName("WriteErrorNoMatchField")] + WriteErrorNoMatchField, + /// + /// WriteErrorNonIntegerTTLField + /// + [JsonPropertyName("WriteErrorNonIntegerTTLField")] + WriteErrorNonIntegerTTLField, + /// + /// WriteErrorNonListMatchDestField + /// + [JsonPropertyName("WriteErrorNonListMatchDestField")] + WriteErrorNonListMatchDestField, + /// + /// WriteErrorNonSecureContext + /// + [JsonPropertyName("WriteErrorNonSecureContext")] + WriteErrorNonSecureContext, + /// + /// WriteErrorNonStringIdField + /// + [JsonPropertyName("WriteErrorNonStringIdField")] + WriteErrorNonStringIdField, + /// + /// WriteErrorNonStringInMatchDestList + /// + [JsonPropertyName("WriteErrorNonStringInMatchDestList")] + WriteErrorNonStringInMatchDestList, + /// + /// WriteErrorNonStringMatchField + /// + [JsonPropertyName("WriteErrorNonStringMatchField")] + WriteErrorNonStringMatchField, + /// + /// WriteErrorNonTokenTypeField + /// + [JsonPropertyName("WriteErrorNonTokenTypeField")] + WriteErrorNonTokenTypeField, + /// + /// WriteErrorRequestAborted + /// + [JsonPropertyName("WriteErrorRequestAborted")] + WriteErrorRequestAborted, + /// + /// WriteErrorShuttingDown + /// + [JsonPropertyName("WriteErrorShuttingDown")] + WriteErrorShuttingDown, + /// + /// WriteErrorTooLongIdField + /// + [JsonPropertyName("WriteErrorTooLongIdField")] + WriteErrorTooLongIdField, + /// + /// WriteErrorUnsupportedType + /// + [JsonPropertyName("WriteErrorUnsupportedType")] + WriteErrorUnsupportedType + } + + /// + /// SRIMessageSignatureError + /// + public enum SRIMessageSignatureError + { + /// + /// MissingSignatureHeader + /// + [JsonPropertyName("MissingSignatureHeader")] + MissingSignatureHeader, + /// + /// MissingSignatureInputHeader + /// + [JsonPropertyName("MissingSignatureInputHeader")] + MissingSignatureInputHeader, + /// + /// InvalidSignatureHeader + /// + [JsonPropertyName("InvalidSignatureHeader")] + InvalidSignatureHeader, + /// + /// InvalidSignatureInputHeader + /// + [JsonPropertyName("InvalidSignatureInputHeader")] + InvalidSignatureInputHeader, + /// + /// SignatureHeaderValueIsNotByteSequence + /// + [JsonPropertyName("SignatureHeaderValueIsNotByteSequence")] + SignatureHeaderValueIsNotByteSequence, + /// + /// SignatureHeaderValueIsParameterized + /// + [JsonPropertyName("SignatureHeaderValueIsParameterized")] + SignatureHeaderValueIsParameterized, + /// + /// SignatureHeaderValueIsIncorrectLength + /// + [JsonPropertyName("SignatureHeaderValueIsIncorrectLength")] + SignatureHeaderValueIsIncorrectLength, + /// + /// SignatureInputHeaderMissingLabel + /// + [JsonPropertyName("SignatureInputHeaderMissingLabel")] + SignatureInputHeaderMissingLabel, + /// + /// SignatureInputHeaderValueNotInnerList + /// + [JsonPropertyName("SignatureInputHeaderValueNotInnerList")] + SignatureInputHeaderValueNotInnerList, + /// + /// SignatureInputHeaderValueMissingComponents + /// + [JsonPropertyName("SignatureInputHeaderValueMissingComponents")] + SignatureInputHeaderValueMissingComponents, + /// + /// SignatureInputHeaderInvalidComponentType + /// + [JsonPropertyName("SignatureInputHeaderInvalidComponentType")] + SignatureInputHeaderInvalidComponentType, + /// + /// SignatureInputHeaderInvalidComponentName + /// + [JsonPropertyName("SignatureInputHeaderInvalidComponentName")] + SignatureInputHeaderInvalidComponentName, + /// + /// SignatureInputHeaderInvalidHeaderComponentParameter + /// + [JsonPropertyName("SignatureInputHeaderInvalidHeaderComponentParameter")] + SignatureInputHeaderInvalidHeaderComponentParameter, + /// + /// SignatureInputHeaderInvalidDerivedComponentParameter + /// + [JsonPropertyName("SignatureInputHeaderInvalidDerivedComponentParameter")] + SignatureInputHeaderInvalidDerivedComponentParameter, + /// + /// SignatureInputHeaderKeyIdLength + /// + [JsonPropertyName("SignatureInputHeaderKeyIdLength")] + SignatureInputHeaderKeyIdLength, + /// + /// SignatureInputHeaderInvalidParameter + /// + [JsonPropertyName("SignatureInputHeaderInvalidParameter")] + SignatureInputHeaderInvalidParameter, + /// + /// SignatureInputHeaderMissingRequiredParameters + /// + [JsonPropertyName("SignatureInputHeaderMissingRequiredParameters")] + SignatureInputHeaderMissingRequiredParameters, + /// + /// ValidationFailedSignatureExpired + /// + [JsonPropertyName("ValidationFailedSignatureExpired")] + ValidationFailedSignatureExpired, + /// + /// ValidationFailedInvalidLength + /// + [JsonPropertyName("ValidationFailedInvalidLength")] + ValidationFailedInvalidLength, + /// + /// ValidationFailedSignatureMismatch + /// + [JsonPropertyName("ValidationFailedSignatureMismatch")] + ValidationFailedSignatureMismatch, + /// + /// ValidationFailedIntegrityMismatch + /// + [JsonPropertyName("ValidationFailedIntegrityMismatch")] + ValidationFailedIntegrityMismatch + } + + /// + /// UnencodedDigestError + /// + public enum UnencodedDigestError + { + /// + /// MalformedDictionary + /// + [JsonPropertyName("MalformedDictionary")] + MalformedDictionary, + /// + /// UnknownAlgorithm + /// + [JsonPropertyName("UnknownAlgorithm")] + UnknownAlgorithm, + /// + /// IncorrectDigestType + /// + [JsonPropertyName("IncorrectDigestType")] + IncorrectDigestType, + /// + /// IncorrectDigestLength + /// + [JsonPropertyName("IncorrectDigestLength")] + IncorrectDigestLength + } + + /// + /// ConnectionAllowlistError + /// + public enum ConnectionAllowlistError + { + /// + /// InvalidHeader + /// + [JsonPropertyName("InvalidHeader")] + InvalidHeader, + /// + /// MoreThanOneList + /// + [JsonPropertyName("MoreThanOneList")] + MoreThanOneList, + /// + /// ItemNotInnerList + /// + [JsonPropertyName("ItemNotInnerList")] + ItemNotInnerList, + /// + /// InvalidAllowlistItemType + /// + [JsonPropertyName("InvalidAllowlistItemType")] + InvalidAllowlistItemType, + /// + /// ReportingEndpointNotToken + /// + [JsonPropertyName("ReportingEndpointNotToken")] + ReportingEndpointNotToken, + /// + /// InvalidUrlPattern + /// + [JsonPropertyName("InvalidUrlPattern")] + InvalidUrlPattern + } + + /// + /// Details for issues around "Attribution Reporting API" usage. + /// Explainer: https://github.com/WICG/attribution-reporting-api + /// + public partial class AttributionReportingIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ViolationType + /// + [JsonPropertyName("violationType")] + public CefSharp.DevTools.Audits.AttributionReportingIssueType ViolationType + { + get; + set; + } + + /// + /// Request + /// + [JsonPropertyName("request")] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// ViolatingNodeId + /// + [JsonPropertyName("violatingNodeId")] + public int? ViolatingNodeId + { + get; + set; + } + + /// + /// InvalidParameter + /// + [JsonPropertyName("invalidParameter")] + public string InvalidParameter + { + get; + set; + } + } + + /// + /// Details for issues about documents in Quirks Mode + /// or Limited Quirks Mode that affects page layouting. + /// + public partial class QuirksModeIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// If false, it means the document's mode is "quirks" + /// instead of "limited-quirks". + /// + [JsonPropertyName("isLimitedQuirksMode")] + public bool IsLimitedQuirksMode + { + get; + set; + } + + /// + /// DocumentNodeId + /// + [JsonPropertyName("documentNodeId")] + public int DocumentNodeId + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// FrameId + /// + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + set; + } + + /// + /// LoaderId + /// + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + set; + } + } + + /// + /// NavigatorUserAgentIssueDetails + /// + public partial class NavigatorUserAgentIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Location + /// + [JsonPropertyName("location")] + public CefSharp.DevTools.Audits.SourceCodeLocation Location + { + get; + set; + } + } + + /// + /// SharedDictionaryIssueDetails + /// + public partial class SharedDictionaryIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// SharedDictionaryError + /// + [JsonPropertyName("sharedDictionaryError")] + public CefSharp.DevTools.Audits.SharedDictionaryError SharedDictionaryError + { + get; + set; + } + + /// + /// Request + /// + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// SRIMessageSignatureIssueDetails + /// + public partial class SRIMessageSignatureIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error + /// + [JsonPropertyName("error")] + public CefSharp.DevTools.Audits.SRIMessageSignatureError Error + { + get; + set; + } + + /// + /// SignatureBase + /// + [JsonPropertyName("signatureBase")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SignatureBase + { + get; + set; + } + + /// + /// IntegrityAssertions + /// + [JsonPropertyName("integrityAssertions")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] IntegrityAssertions + { + get; + set; + } + + /// + /// Request + /// + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// UnencodedDigestIssueDetails + /// + public partial class UnencodedDigestIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error + /// + [JsonPropertyName("error")] + public CefSharp.DevTools.Audits.UnencodedDigestError Error + { + get; + set; + } + + /// + /// Request + /// + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// ConnectionAllowlistIssueDetails + /// + public partial class ConnectionAllowlistIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error + /// + [JsonPropertyName("error")] + public CefSharp.DevTools.Audits.ConnectionAllowlistError Error + { + get; + set; + } + + /// + /// Request + /// + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// GenericIssueErrorType + /// + public enum GenericIssueErrorType + { + /// + /// FormLabelForNameError + /// + [JsonPropertyName("FormLabelForNameError")] + FormLabelForNameError, + /// + /// FormDuplicateIdForInputError + /// + [JsonPropertyName("FormDuplicateIdForInputError")] + FormDuplicateIdForInputError, + /// + /// FormInputWithNoLabelError + /// + [JsonPropertyName("FormInputWithNoLabelError")] + FormInputWithNoLabelError, + /// + /// FormAutocompleteAttributeEmptyError + /// + [JsonPropertyName("FormAutocompleteAttributeEmptyError")] + FormAutocompleteAttributeEmptyError, + /// + /// FormEmptyIdAndNameAttributesForInputError + /// + [JsonPropertyName("FormEmptyIdAndNameAttributesForInputError")] + FormEmptyIdAndNameAttributesForInputError, + /// + /// FormAriaLabelledByToNonExistingIdError + /// + [JsonPropertyName("FormAriaLabelledByToNonExistingIdError")] + FormAriaLabelledByToNonExistingIdError, + /// + /// FormInputAssignedAutocompleteValueToIdOrNameAttributeError + /// + [JsonPropertyName("FormInputAssignedAutocompleteValueToIdOrNameAttributeError")] + FormInputAssignedAutocompleteValueToIdOrNameAttributeError, + /// + /// FormLabelHasNeitherForNorNestedInputError + /// + [JsonPropertyName("FormLabelHasNeitherForNorNestedInputError")] + FormLabelHasNeitherForNorNestedInputError, + /// + /// FormLabelForMatchesNonExistingIdError + /// + [JsonPropertyName("FormLabelForMatchesNonExistingIdError")] + FormLabelForMatchesNonExistingIdError, + /// + /// FormInputHasWrongButWellIntendedAutocompleteValueError + /// + [JsonPropertyName("FormInputHasWrongButWellIntendedAutocompleteValueError")] + FormInputHasWrongButWellIntendedAutocompleteValueError, + /// + /// ResponseWasBlockedByORB + /// + [JsonPropertyName("ResponseWasBlockedByORB")] + ResponseWasBlockedByORB, + /// + /// NavigationEntryMarkedSkippable + /// + [JsonPropertyName("NavigationEntryMarkedSkippable")] + NavigationEntryMarkedSkippable, + /// + /// AutofillAndManualTextPolicyControlledFeaturesInfo + /// + [JsonPropertyName("AutofillAndManualTextPolicyControlledFeaturesInfo")] + AutofillAndManualTextPolicyControlledFeaturesInfo, + /// + /// AutofillPolicyControlledFeatureInfo + /// + [JsonPropertyName("AutofillPolicyControlledFeatureInfo")] + AutofillPolicyControlledFeatureInfo, + /// + /// ManualTextPolicyControlledFeatureInfo + /// + [JsonPropertyName("ManualTextPolicyControlledFeatureInfo")] + ManualTextPolicyControlledFeatureInfo + } + + /// + /// Depending on the concrete errorType, different properties are set. + /// + public partial class GenericIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Issues with the same errorType are aggregated in the frontend. + /// + [JsonPropertyName("errorType")] + public CefSharp.DevTools.Audits.GenericIssueErrorType ErrorType + { + get; + set; + } + + /// + /// FrameId + /// + [JsonPropertyName("frameId")] + public string FrameId + { + get; + set; + } + + /// + /// ViolatingNodeId + /// + [JsonPropertyName("violatingNodeId")] + public int? ViolatingNodeId + { + get; + set; + } + + /// + /// ViolatingNodeAttribute + /// + [JsonPropertyName("violatingNodeAttribute")] + public string ViolatingNodeAttribute + { + get; + set; + } + + /// + /// Request + /// + [JsonPropertyName("request")] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + } + + /// + /// This issue tracks information needed to print a deprecation message. + /// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md + /// + public partial class DeprecationIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// AffectedFrame + /// + [JsonPropertyName("affectedFrame")] + public CefSharp.DevTools.Audits.AffectedFrame AffectedFrame + { + get; + set; + } + + /// + /// SourceCodeLocation + /// + [JsonPropertyName("sourceCodeLocation")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5 + /// + [JsonPropertyName("type")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Type + { + get; + set; + } + } + + /// + /// This issue warns about sites in the redirect chain of a finished navigation + /// that may be flagged as trackers and have their state cleared if they don't + /// receive a user interaction. Note that in this context 'site' means eTLD+1. + /// For example, if the URL `https://example.test:80/bounce` was in the + /// redirect chain, the site reported would be `example.test`. + /// + public partial class BounceTrackingIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TrackingSites + /// + [JsonPropertyName("trackingSites")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] TrackingSites + { + get; + set; + } + } + + /// + /// This issue warns about third-party sites that are accessing cookies on the + /// current page, and have been permitted due to having a global metadata grant. + /// Note that in this context 'site' means eTLD+1. For example, if the URL + /// `https://example.test:80/web_page` was accessing cookies, the site reported + /// would be `example.test`. + /// + public partial class CookieDeprecationMetadataIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// AllowedSites + /// + [JsonPropertyName("allowedSites")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] AllowedSites + { + get; + set; + } + + /// + /// OptOutPercentage + /// + [JsonPropertyName("optOutPercentage")] + public double OptOutPercentage + { + get; + set; + } + + /// + /// IsOptOutTopLevel + /// + [JsonPropertyName("isOptOutTopLevel")] + public bool IsOptOutTopLevel + { + get; + set; + } + + /// + /// Operation + /// + [JsonPropertyName("operation")] + public CefSharp.DevTools.Audits.CookieOperation Operation + { + get; + set; + } + } + + /// + /// ClientHintIssueReason + /// + public enum ClientHintIssueReason + { + /// + /// MetaTagAllowListInvalidOrigin + /// + [JsonPropertyName("MetaTagAllowListInvalidOrigin")] + MetaTagAllowListInvalidOrigin, + /// + /// MetaTagModifiedHTML + /// + [JsonPropertyName("MetaTagModifiedHTML")] + MetaTagModifiedHTML + } + + /// + /// FederatedAuthRequestIssueDetails + /// + public partial class FederatedAuthRequestIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FederatedAuthRequestIssueReason + /// + [JsonPropertyName("federatedAuthRequestIssueReason")] + public CefSharp.DevTools.Audits.FederatedAuthRequestIssueReason FederatedAuthRequestIssueReason + { + get; + set; + } + } + + /// + /// Represents the failure reason when a federated authentication reason fails. + /// Should be updated alongside RequestIdTokenStatus in + /// third_party/blink/public/mojom/devtools/inspector_issue.mojom to include + /// all cases except for success. + /// + public enum FederatedAuthRequestIssueReason + { + /// + /// ShouldEmbargo + /// + [JsonPropertyName("ShouldEmbargo")] + ShouldEmbargo, + /// + /// TooManyRequests + /// + [JsonPropertyName("TooManyRequests")] + TooManyRequests, + /// + /// WellKnownHttpNotFound + /// + [JsonPropertyName("WellKnownHttpNotFound")] + WellKnownHttpNotFound, + /// + /// WellKnownNoResponse + /// + [JsonPropertyName("WellKnownNoResponse")] + WellKnownNoResponse, + /// + /// WellKnownInvalidResponse + /// + [JsonPropertyName("WellKnownInvalidResponse")] + WellKnownInvalidResponse, + /// + /// WellKnownListEmpty + /// + [JsonPropertyName("WellKnownListEmpty")] + WellKnownListEmpty, + /// + /// WellKnownInvalidContentType + /// + [JsonPropertyName("WellKnownInvalidContentType")] + WellKnownInvalidContentType, + /// + /// ConfigNotInWellKnown + /// + [JsonPropertyName("ConfigNotInWellKnown")] + ConfigNotInWellKnown, + /// + /// WellKnownTooBig + /// + [JsonPropertyName("WellKnownTooBig")] + WellKnownTooBig, + /// + /// ConfigHttpNotFound + /// + [JsonPropertyName("ConfigHttpNotFound")] + ConfigHttpNotFound, + /// + /// ConfigNoResponse + /// + [JsonPropertyName("ConfigNoResponse")] + ConfigNoResponse, + /// + /// ConfigInvalidResponse + /// + [JsonPropertyName("ConfigInvalidResponse")] + ConfigInvalidResponse, + /// + /// ConfigInvalidContentType + /// + [JsonPropertyName("ConfigInvalidContentType")] + ConfigInvalidContentType, + /// + /// ClientMetadataHttpNotFound + /// + [JsonPropertyName("ClientMetadataHttpNotFound")] + ClientMetadataHttpNotFound, + /// + /// ClientMetadataNoResponse + /// + [JsonPropertyName("ClientMetadataNoResponse")] + ClientMetadataNoResponse, + /// + /// ClientMetadataInvalidResponse + /// + [JsonPropertyName("ClientMetadataInvalidResponse")] + ClientMetadataInvalidResponse, + /// + /// ClientMetadataInvalidContentType + /// + [JsonPropertyName("ClientMetadataInvalidContentType")] + ClientMetadataInvalidContentType, + /// + /// IdpNotPotentiallyTrustworthy + /// + [JsonPropertyName("IdpNotPotentiallyTrustworthy")] + IdpNotPotentiallyTrustworthy, + /// + /// DisabledInSettings + /// + [JsonPropertyName("DisabledInSettings")] + DisabledInSettings, + /// + /// DisabledInFlags + /// + [JsonPropertyName("DisabledInFlags")] + DisabledInFlags, + /// + /// ErrorFetchingSignin + /// + [JsonPropertyName("ErrorFetchingSignin")] + ErrorFetchingSignin, + /// + /// InvalidSigninResponse + /// + [JsonPropertyName("InvalidSigninResponse")] + InvalidSigninResponse, + /// + /// AccountsHttpNotFound + /// + [JsonPropertyName("AccountsHttpNotFound")] + AccountsHttpNotFound, + /// + /// AccountsNoResponse + /// + [JsonPropertyName("AccountsNoResponse")] + AccountsNoResponse, + /// + /// AccountsInvalidResponse + /// + [JsonPropertyName("AccountsInvalidResponse")] + AccountsInvalidResponse, + /// + /// AccountsListEmpty + /// + [JsonPropertyName("AccountsListEmpty")] + AccountsListEmpty, + /// + /// AccountsInvalidContentType + /// + [JsonPropertyName("AccountsInvalidContentType")] + AccountsInvalidContentType, + /// + /// IdTokenHttpNotFound + /// + [JsonPropertyName("IdTokenHttpNotFound")] + IdTokenHttpNotFound, + /// + /// IdTokenNoResponse + /// + [JsonPropertyName("IdTokenNoResponse")] + IdTokenNoResponse, + /// + /// IdTokenInvalidResponse + /// + [JsonPropertyName("IdTokenInvalidResponse")] + IdTokenInvalidResponse, + /// + /// IdTokenIdpErrorResponse + /// + [JsonPropertyName("IdTokenIdpErrorResponse")] + IdTokenIdpErrorResponse, + /// + /// IdTokenCrossSiteIdpErrorResponse + /// + [JsonPropertyName("IdTokenCrossSiteIdpErrorResponse")] + IdTokenCrossSiteIdpErrorResponse, + /// + /// IdTokenInvalidRequest + /// + [JsonPropertyName("IdTokenInvalidRequest")] + IdTokenInvalidRequest, + /// + /// IdTokenInvalidContentType + /// + [JsonPropertyName("IdTokenInvalidContentType")] + IdTokenInvalidContentType, + /// + /// ErrorIdToken + /// + [JsonPropertyName("ErrorIdToken")] + ErrorIdToken, + /// + /// Canceled + /// + [JsonPropertyName("Canceled")] + Canceled, + /// + /// RpPageNotVisible + /// + [JsonPropertyName("RpPageNotVisible")] + RpPageNotVisible, + /// + /// SilentMediationFailure + /// + [JsonPropertyName("SilentMediationFailure")] + SilentMediationFailure, + /// + /// ThirdPartyCookiesBlocked + /// + [JsonPropertyName("ThirdPartyCookiesBlocked")] + ThirdPartyCookiesBlocked, + /// + /// NotSignedInWithIdp + /// + [JsonPropertyName("NotSignedInWithIdp")] + NotSignedInWithIdp, + /// + /// MissingTransientUserActivation + /// + [JsonPropertyName("MissingTransientUserActivation")] + MissingTransientUserActivation, + /// + /// ReplacedByActiveMode + /// + [JsonPropertyName("ReplacedByActiveMode")] + ReplacedByActiveMode, + /// + /// InvalidFieldsSpecified + /// + [JsonPropertyName("InvalidFieldsSpecified")] + InvalidFieldsSpecified, + /// + /// RelyingPartyOriginIsOpaque + /// + [JsonPropertyName("RelyingPartyOriginIsOpaque")] + RelyingPartyOriginIsOpaque, + /// + /// TypeNotMatching + /// + [JsonPropertyName("TypeNotMatching")] + TypeNotMatching, + /// + /// UiDismissedNoEmbargo + /// + [JsonPropertyName("UiDismissedNoEmbargo")] + UiDismissedNoEmbargo, + /// + /// CorsError + /// + [JsonPropertyName("CorsError")] + CorsError, + /// + /// SuppressedBySegmentationPlatform + /// + [JsonPropertyName("SuppressedBySegmentationPlatform")] + SuppressedBySegmentationPlatform + } + + /// + /// FederatedAuthUserInfoRequestIssueDetails + /// + public partial class FederatedAuthUserInfoRequestIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FederatedAuthUserInfoRequestIssueReason + /// + [JsonPropertyName("federatedAuthUserInfoRequestIssueReason")] + public CefSharp.DevTools.Audits.FederatedAuthUserInfoRequestIssueReason FederatedAuthUserInfoRequestIssueReason + { + get; + set; + } + } + + /// + /// Represents the failure reason when a getUserInfo() call fails. + /// Should be updated alongside FederatedAuthUserInfoRequestResult in + /// third_party/blink/public/mojom/devtools/inspector_issue.mojom. + /// + public enum FederatedAuthUserInfoRequestIssueReason + { + /// + /// NotSameOrigin + /// + [JsonPropertyName("NotSameOrigin")] + NotSameOrigin, + /// + /// NotIframe + /// + [JsonPropertyName("NotIframe")] + NotIframe, + /// + /// NotPotentiallyTrustworthy + /// + [JsonPropertyName("NotPotentiallyTrustworthy")] + NotPotentiallyTrustworthy, + /// + /// NoApiPermission + /// + [JsonPropertyName("NoApiPermission")] + NoApiPermission, + /// + /// NotSignedInWithIdp + /// + [JsonPropertyName("NotSignedInWithIdp")] + NotSignedInWithIdp, + /// + /// NoAccountSharingPermission + /// + [JsonPropertyName("NoAccountSharingPermission")] + NoAccountSharingPermission, + /// + /// InvalidConfigOrWellKnown + /// + [JsonPropertyName("InvalidConfigOrWellKnown")] + InvalidConfigOrWellKnown, + /// + /// InvalidAccountsResponse + /// + [JsonPropertyName("InvalidAccountsResponse")] + InvalidAccountsResponse, + /// + /// NoReturningUserFromFetchedAccounts + /// + [JsonPropertyName("NoReturningUserFromFetchedAccounts")] + NoReturningUserFromFetchedAccounts + } + + /// + /// This issue tracks client hints related issues. It's used to deprecate old + /// features, encourage the use of new ones, and provide general guidance. + /// + public partial class ClientHintIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// SourceCodeLocation + /// + [JsonPropertyName("sourceCodeLocation")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// ClientHintIssueReason + /// + [JsonPropertyName("clientHintIssueReason")] + public CefSharp.DevTools.Audits.ClientHintIssueReason ClientHintIssueReason + { + get; + set; + } + } + + /// + /// FailedRequestInfo + /// + public partial class FailedRequestInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The URL that failed to load. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// The failure message for the failed request. + /// + [JsonPropertyName("failureMessage")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FailureMessage + { + get; + set; + } + + /// + /// RequestId + /// + [JsonPropertyName("requestId")] + public string RequestId + { + get; + set; + } + } + + /// + /// PartitioningBlobURLInfo + /// + public enum PartitioningBlobURLInfo + { + /// + /// BlockedCrossPartitionFetching + /// + [JsonPropertyName("BlockedCrossPartitionFetching")] + BlockedCrossPartitionFetching, + /// + /// EnforceNoopenerForNavigation + /// + [JsonPropertyName("EnforceNoopenerForNavigation")] + EnforceNoopenerForNavigation + } + + /// + /// PartitioningBlobURLIssueDetails + /// + public partial class PartitioningBlobURLIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The BlobURL that failed to load. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Additional information about the Partitioning Blob URL issue. + /// + [JsonPropertyName("partitioningBlobURLInfo")] + public CefSharp.DevTools.Audits.PartitioningBlobURLInfo PartitioningBlobURLInfo + { + get; + set; + } + } + + /// + /// ElementAccessibilityIssueReason + /// + public enum ElementAccessibilityIssueReason + { + /// + /// DisallowedSelectChild + /// + [JsonPropertyName("DisallowedSelectChild")] + DisallowedSelectChild, + /// + /// DisallowedOptGroupChild + /// + [JsonPropertyName("DisallowedOptGroupChild")] + DisallowedOptGroupChild, + /// + /// NonPhrasingContentOptionChild + /// + [JsonPropertyName("NonPhrasingContentOptionChild")] + NonPhrasingContentOptionChild, + /// + /// InteractiveContentOptionChild + /// + [JsonPropertyName("InteractiveContentOptionChild")] + InteractiveContentOptionChild, + /// + /// InteractiveContentLegendChild + /// + [JsonPropertyName("InteractiveContentLegendChild")] + InteractiveContentLegendChild, + /// + /// InteractiveContentSummaryDescendant + /// + [JsonPropertyName("InteractiveContentSummaryDescendant")] + InteractiveContentSummaryDescendant + } + + /// + /// This issue warns about errors in the select or summary element content model. + /// + public partial class ElementAccessibilityIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// NodeId + /// + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + set; + } + + /// + /// ElementAccessibilityIssueReason + /// + [JsonPropertyName("elementAccessibilityIssueReason")] + public CefSharp.DevTools.Audits.ElementAccessibilityIssueReason ElementAccessibilityIssueReason + { + get; + set; + } + + /// + /// HasDisallowedAttributes + /// + [JsonPropertyName("hasDisallowedAttributes")] + public bool HasDisallowedAttributes + { + get; + set; + } + } + + /// + /// StyleSheetLoadingIssueReason + /// + public enum StyleSheetLoadingIssueReason + { + /// + /// LateImportRule + /// + [JsonPropertyName("LateImportRule")] + LateImportRule, + /// + /// RequestFailed + /// + [JsonPropertyName("RequestFailed")] + RequestFailed + } + + /// + /// This issue warns when a referenced stylesheet couldn't be loaded. + /// + public partial class StylesheetLoadingIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source code position that referenced the failing stylesheet. + /// + [JsonPropertyName("sourceCodeLocation")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// Reason why the stylesheet couldn't be loaded. + /// + [JsonPropertyName("styleSheetLoadingIssueReason")] + public CefSharp.DevTools.Audits.StyleSheetLoadingIssueReason StyleSheetLoadingIssueReason + { + get; + set; + } + + /// + /// Contains additional info when the failure was due to a request. + /// + [JsonPropertyName("failedRequestInfo")] + public CefSharp.DevTools.Audits.FailedRequestInfo FailedRequestInfo + { + get; + set; + } + } + + /// + /// PropertyRuleIssueReason + /// + public enum PropertyRuleIssueReason + { + /// + /// InvalidSyntax + /// + [JsonPropertyName("InvalidSyntax")] + InvalidSyntax, + /// + /// InvalidInitialValue + /// + [JsonPropertyName("InvalidInitialValue")] + InvalidInitialValue, + /// + /// InvalidInherits + /// + [JsonPropertyName("InvalidInherits")] + InvalidInherits, + /// + /// InvalidName + /// + [JsonPropertyName("InvalidName")] + InvalidName + } + + /// + /// This issue warns about errors in property rules that lead to property + /// registrations being ignored. + /// + public partial class PropertyRuleIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source code position of the property rule. + /// + [JsonPropertyName("sourceCodeLocation")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + + /// + /// Reason why the property rule was discarded. + /// + [JsonPropertyName("propertyRuleIssueReason")] + public CefSharp.DevTools.Audits.PropertyRuleIssueReason PropertyRuleIssueReason + { + get; + set; + } + + /// + /// The value of the property rule property that failed to parse + /// + [JsonPropertyName("propertyValue")] + public string PropertyValue + { + get; + set; + } + } + + /// + /// UserReidentificationIssueType + /// + public enum UserReidentificationIssueType + { + /// + /// BlockedFrameNavigation + /// + [JsonPropertyName("BlockedFrameNavigation")] + BlockedFrameNavigation, + /// + /// BlockedSubresource + /// + [JsonPropertyName("BlockedSubresource")] + BlockedSubresource, + /// + /// NoisedCanvasReadback + /// + [JsonPropertyName("NoisedCanvasReadback")] + NoisedCanvasReadback + } + + /// + /// This issue warns about uses of APIs that may be considered misuse to + /// re-identify users. + /// + public partial class UserReidentificationIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Audits.UserReidentificationIssueType Type + { + get; + set; + } + + /// + /// Applies to BlockedFrameNavigation and BlockedSubresource issue types. + /// + [JsonPropertyName("request")] + public CefSharp.DevTools.Audits.AffectedRequest Request + { + get; + set; + } + + /// + /// Applies to NoisedCanvasReadback issue type. + /// + [JsonPropertyName("sourceCodeLocation")] + public CefSharp.DevTools.Audits.SourceCodeLocation SourceCodeLocation + { + get; + set; + } + } + + /// + /// PermissionElementIssueType + /// + public enum PermissionElementIssueType + { + /// + /// InvalidType + /// + [JsonPropertyName("InvalidType")] + InvalidType, + /// + /// FencedFrameDisallowed + /// + [JsonPropertyName("FencedFrameDisallowed")] + FencedFrameDisallowed, + /// + /// CspFrameAncestorsMissing + /// + [JsonPropertyName("CspFrameAncestorsMissing")] + CspFrameAncestorsMissing, + /// + /// PermissionsPolicyBlocked + /// + [JsonPropertyName("PermissionsPolicyBlocked")] + PermissionsPolicyBlocked, + /// + /// PaddingRightUnsupported + /// + [JsonPropertyName("PaddingRightUnsupported")] + PaddingRightUnsupported, + /// + /// PaddingBottomUnsupported + /// + [JsonPropertyName("PaddingBottomUnsupported")] + PaddingBottomUnsupported, + /// + /// InsetBoxShadowUnsupported + /// + [JsonPropertyName("InsetBoxShadowUnsupported")] + InsetBoxShadowUnsupported, + /// + /// RequestInProgress + /// + [JsonPropertyName("RequestInProgress")] + RequestInProgress, + /// + /// UntrustedEvent + /// + [JsonPropertyName("UntrustedEvent")] + UntrustedEvent, + /// + /// RegistrationFailed + /// + [JsonPropertyName("RegistrationFailed")] + RegistrationFailed, + /// + /// TypeNotSupported + /// + [JsonPropertyName("TypeNotSupported")] + TypeNotSupported, + /// + /// InvalidTypeActivation + /// + [JsonPropertyName("InvalidTypeActivation")] + InvalidTypeActivation, + /// + /// SecurityChecksFailed + /// + [JsonPropertyName("SecurityChecksFailed")] + SecurityChecksFailed, + /// + /// ActivationDisabled + /// + [JsonPropertyName("ActivationDisabled")] + ActivationDisabled, + /// + /// GeolocationDeprecated + /// + [JsonPropertyName("GeolocationDeprecated")] + GeolocationDeprecated, + /// + /// InvalidDisplayStyle + /// + [JsonPropertyName("InvalidDisplayStyle")] + InvalidDisplayStyle, + /// + /// NonOpaqueColor + /// + [JsonPropertyName("NonOpaqueColor")] + NonOpaqueColor, + /// + /// LowContrast + /// + [JsonPropertyName("LowContrast")] + LowContrast, + /// + /// FontSizeTooSmall + /// + [JsonPropertyName("FontSizeTooSmall")] + FontSizeTooSmall, + /// + /// FontSizeTooLarge + /// + [JsonPropertyName("FontSizeTooLarge")] + FontSizeTooLarge, + /// + /// InvalidSizeValue + /// + [JsonPropertyName("InvalidSizeValue")] + InvalidSizeValue + } + + /// + /// This issue warns about improper usage of the <permission> element. + /// + public partial class PermissionElementIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// IssueType + /// + [JsonPropertyName("issueType")] + public CefSharp.DevTools.Audits.PermissionElementIssueType IssueType + { + get; + set; + } + + /// + /// The value of the type attribute. + /// + [JsonPropertyName("type")] + public string Type + { + get; + set; + } + + /// + /// The node ID of the <permission> element. + /// + [JsonPropertyName("nodeId")] + public int? NodeId + { + get; + set; + } + + /// + /// True if the issue is a warning, false if it is an error. + /// + [JsonPropertyName("isWarning")] + public bool? IsWarning + { + get; + set; + } + + /// + /// Fields for message construction: + /// Used for messages that reference a specific permission name + /// + [JsonPropertyName("permissionName")] + public string PermissionName + { + get; + set; + } + + /// + /// Used for messages about occlusion + /// + [JsonPropertyName("occluderNodeInfo")] + public string OccluderNodeInfo + { + get; + set; + } + + /// + /// Used for messages about occluder's parent + /// + [JsonPropertyName("occluderParentNodeInfo")] + public string OccluderParentNodeInfo + { + get; + set; + } + + /// + /// Used for messages about activation disabled reason + /// + [JsonPropertyName("disableReason")] + public string DisableReason + { + get; + set; + } + } + + /// + /// A unique identifier for the type of issue. Each type may use one of the + /// optional fields in InspectorIssueDetails to convey more specific + /// information about the kind of issue. + /// + public enum InspectorIssueCode + { + /// + /// CookieIssue + /// + [JsonPropertyName("CookieIssue")] + CookieIssue, + /// + /// MixedContentIssue + /// + [JsonPropertyName("MixedContentIssue")] + MixedContentIssue, + /// + /// BlockedByResponseIssue + /// + [JsonPropertyName("BlockedByResponseIssue")] + BlockedByResponseIssue, + /// + /// HeavyAdIssue + /// + [JsonPropertyName("HeavyAdIssue")] + HeavyAdIssue, + /// + /// ContentSecurityPolicyIssue + /// + [JsonPropertyName("ContentSecurityPolicyIssue")] + ContentSecurityPolicyIssue, + /// + /// SharedArrayBufferIssue + /// + [JsonPropertyName("SharedArrayBufferIssue")] + SharedArrayBufferIssue, + /// + /// LowTextContrastIssue + /// + [JsonPropertyName("LowTextContrastIssue")] + LowTextContrastIssue, + /// + /// CorsIssue + /// + [JsonPropertyName("CorsIssue")] + CorsIssue, + /// + /// AttributionReportingIssue + /// + [JsonPropertyName("AttributionReportingIssue")] + AttributionReportingIssue, + /// + /// QuirksModeIssue + /// + [JsonPropertyName("QuirksModeIssue")] + QuirksModeIssue, + /// + /// PartitioningBlobURLIssue + /// + [JsonPropertyName("PartitioningBlobURLIssue")] + PartitioningBlobURLIssue, + /// + /// NavigatorUserAgentIssue + /// + [JsonPropertyName("NavigatorUserAgentIssue")] + NavigatorUserAgentIssue, + /// + /// GenericIssue + /// + [JsonPropertyName("GenericIssue")] + GenericIssue, + /// + /// DeprecationIssue + /// + [JsonPropertyName("DeprecationIssue")] + DeprecationIssue, + /// + /// ClientHintIssue + /// + [JsonPropertyName("ClientHintIssue")] + ClientHintIssue, + /// + /// FederatedAuthRequestIssue + /// + [JsonPropertyName("FederatedAuthRequestIssue")] + FederatedAuthRequestIssue, + /// + /// BounceTrackingIssue + /// + [JsonPropertyName("BounceTrackingIssue")] + BounceTrackingIssue, + /// + /// CookieDeprecationMetadataIssue + /// + [JsonPropertyName("CookieDeprecationMetadataIssue")] + CookieDeprecationMetadataIssue, + /// + /// StylesheetLoadingIssue + /// + [JsonPropertyName("StylesheetLoadingIssue")] + StylesheetLoadingIssue, + /// + /// FederatedAuthUserInfoRequestIssue + /// + [JsonPropertyName("FederatedAuthUserInfoRequestIssue")] + FederatedAuthUserInfoRequestIssue, + /// + /// PropertyRuleIssue + /// + [JsonPropertyName("PropertyRuleIssue")] + PropertyRuleIssue, + /// + /// SharedDictionaryIssue + /// + [JsonPropertyName("SharedDictionaryIssue")] + SharedDictionaryIssue, + /// + /// ElementAccessibilityIssue + /// + [JsonPropertyName("ElementAccessibilityIssue")] + ElementAccessibilityIssue, + /// + /// SRIMessageSignatureIssue + /// + [JsonPropertyName("SRIMessageSignatureIssue")] + SRIMessageSignatureIssue, + /// + /// UnencodedDigestIssue + /// + [JsonPropertyName("UnencodedDigestIssue")] + UnencodedDigestIssue, + /// + /// ConnectionAllowlistIssue + /// + [JsonPropertyName("ConnectionAllowlistIssue")] + ConnectionAllowlistIssue, + /// + /// UserReidentificationIssue + /// + [JsonPropertyName("UserReidentificationIssue")] + UserReidentificationIssue, + /// + /// PermissionElementIssue + /// + [JsonPropertyName("PermissionElementIssue")] + PermissionElementIssue + } + + /// + /// This struct holds a list of optional fields with additional information + /// specific to the kind of issue. When adding a new issue code, please also + /// add a new optional field to this type. + /// + public partial class InspectorIssueDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CookieIssueDetails + /// + [JsonPropertyName("cookieIssueDetails")] + public CefSharp.DevTools.Audits.CookieIssueDetails CookieIssueDetails + { + get; + set; + } + + /// + /// MixedContentIssueDetails + /// + [JsonPropertyName("mixedContentIssueDetails")] + public CefSharp.DevTools.Audits.MixedContentIssueDetails MixedContentIssueDetails + { + get; + set; + } + + /// + /// BlockedByResponseIssueDetails + /// + [JsonPropertyName("blockedByResponseIssueDetails")] + public CefSharp.DevTools.Audits.BlockedByResponseIssueDetails BlockedByResponseIssueDetails + { + get; + set; + } + + /// + /// HeavyAdIssueDetails + /// + [JsonPropertyName("heavyAdIssueDetails")] + public CefSharp.DevTools.Audits.HeavyAdIssueDetails HeavyAdIssueDetails + { + get; + set; + } + + /// + /// ContentSecurityPolicyIssueDetails + /// + [JsonPropertyName("contentSecurityPolicyIssueDetails")] + public CefSharp.DevTools.Audits.ContentSecurityPolicyIssueDetails ContentSecurityPolicyIssueDetails + { + get; + set; + } + + /// + /// SharedArrayBufferIssueDetails + /// + [JsonPropertyName("sharedArrayBufferIssueDetails")] + public CefSharp.DevTools.Audits.SharedArrayBufferIssueDetails SharedArrayBufferIssueDetails + { + get; + set; + } + + /// + /// LowTextContrastIssueDetails + /// + [JsonPropertyName("lowTextContrastIssueDetails")] + public CefSharp.DevTools.Audits.LowTextContrastIssueDetails LowTextContrastIssueDetails + { + get; + set; + } + + /// + /// CorsIssueDetails + /// + [JsonPropertyName("corsIssueDetails")] + public CefSharp.DevTools.Audits.CorsIssueDetails CorsIssueDetails + { + get; + set; + } + + /// + /// AttributionReportingIssueDetails + /// + [JsonPropertyName("attributionReportingIssueDetails")] + public CefSharp.DevTools.Audits.AttributionReportingIssueDetails AttributionReportingIssueDetails + { + get; + set; + } + + /// + /// QuirksModeIssueDetails + /// + [JsonPropertyName("quirksModeIssueDetails")] + public CefSharp.DevTools.Audits.QuirksModeIssueDetails QuirksModeIssueDetails + { + get; + set; + } + + /// + /// PartitioningBlobURLIssueDetails + /// + [JsonPropertyName("partitioningBlobURLIssueDetails")] + public CefSharp.DevTools.Audits.PartitioningBlobURLIssueDetails PartitioningBlobURLIssueDetails + { + get; + set; + } + + /// + /// NavigatorUserAgentIssueDetails + /// + [JsonPropertyName("navigatorUserAgentIssueDetails")] + public CefSharp.DevTools.Audits.NavigatorUserAgentIssueDetails NavigatorUserAgentIssueDetails + { + get; + set; + } + + /// + /// GenericIssueDetails + /// + [JsonPropertyName("genericIssueDetails")] + public CefSharp.DevTools.Audits.GenericIssueDetails GenericIssueDetails + { + get; + set; + } + + /// + /// DeprecationIssueDetails + /// + [JsonPropertyName("deprecationIssueDetails")] + public CefSharp.DevTools.Audits.DeprecationIssueDetails DeprecationIssueDetails + { + get; + set; + } + + /// + /// ClientHintIssueDetails + /// + [JsonPropertyName("clientHintIssueDetails")] + public CefSharp.DevTools.Audits.ClientHintIssueDetails ClientHintIssueDetails + { + get; + set; + } + + /// + /// FederatedAuthRequestIssueDetails + /// + [JsonPropertyName("federatedAuthRequestIssueDetails")] + public CefSharp.DevTools.Audits.FederatedAuthRequestIssueDetails FederatedAuthRequestIssueDetails + { + get; + set; + } + + /// + /// BounceTrackingIssueDetails + /// + [JsonPropertyName("bounceTrackingIssueDetails")] + public CefSharp.DevTools.Audits.BounceTrackingIssueDetails BounceTrackingIssueDetails + { + get; + set; + } + + /// + /// CookieDeprecationMetadataIssueDetails + /// + [JsonPropertyName("cookieDeprecationMetadataIssueDetails")] + public CefSharp.DevTools.Audits.CookieDeprecationMetadataIssueDetails CookieDeprecationMetadataIssueDetails + { + get; + set; + } + + /// + /// StylesheetLoadingIssueDetails + /// + [JsonPropertyName("stylesheetLoadingIssueDetails")] + public CefSharp.DevTools.Audits.StylesheetLoadingIssueDetails StylesheetLoadingIssueDetails + { + get; + set; + } + + /// + /// PropertyRuleIssueDetails + /// + [JsonPropertyName("propertyRuleIssueDetails")] + public CefSharp.DevTools.Audits.PropertyRuleIssueDetails PropertyRuleIssueDetails + { + get; + set; + } + + /// + /// FederatedAuthUserInfoRequestIssueDetails + /// + [JsonPropertyName("federatedAuthUserInfoRequestIssueDetails")] + public CefSharp.DevTools.Audits.FederatedAuthUserInfoRequestIssueDetails FederatedAuthUserInfoRequestIssueDetails + { + get; + set; + } + + /// + /// SharedDictionaryIssueDetails + /// + [JsonPropertyName("sharedDictionaryIssueDetails")] + public CefSharp.DevTools.Audits.SharedDictionaryIssueDetails SharedDictionaryIssueDetails + { + get; + set; + } + + /// + /// ElementAccessibilityIssueDetails + /// + [JsonPropertyName("elementAccessibilityIssueDetails")] + public CefSharp.DevTools.Audits.ElementAccessibilityIssueDetails ElementAccessibilityIssueDetails + { + get; + set; + } + + /// + /// SriMessageSignatureIssueDetails + /// + [JsonPropertyName("sriMessageSignatureIssueDetails")] + public CefSharp.DevTools.Audits.SRIMessageSignatureIssueDetails SriMessageSignatureIssueDetails + { + get; + set; + } + + /// + /// UnencodedDigestIssueDetails + /// + [JsonPropertyName("unencodedDigestIssueDetails")] + public CefSharp.DevTools.Audits.UnencodedDigestIssueDetails UnencodedDigestIssueDetails + { + get; + set; + } + + /// + /// ConnectionAllowlistIssueDetails + /// + [JsonPropertyName("connectionAllowlistIssueDetails")] + public CefSharp.DevTools.Audits.ConnectionAllowlistIssueDetails ConnectionAllowlistIssueDetails + { + get; + set; + } + + /// + /// UserReidentificationIssueDetails + /// + [JsonPropertyName("userReidentificationIssueDetails")] + public CefSharp.DevTools.Audits.UserReidentificationIssueDetails UserReidentificationIssueDetails + { + get; + set; + } + + /// + /// PermissionElementIssueDetails + /// + [JsonPropertyName("permissionElementIssueDetails")] + public CefSharp.DevTools.Audits.PermissionElementIssueDetails PermissionElementIssueDetails + { + get; + set; + } + } + + /// + /// An inspector issue reported from the back-end. + /// + public partial class InspectorIssue : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Code + /// + [JsonPropertyName("code")] + public CefSharp.DevTools.Audits.InspectorIssueCode Code + { + get; + set; + } + + /// + /// Details + /// + [JsonPropertyName("details")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.InspectorIssueDetails Details + { + get; + set; + } + + /// + /// A unique id for this issue. May be omitted if no other entity (e.g. + /// exception, CDP message, etc.) is referencing this issue. + /// + [JsonPropertyName("issueId")] + public string IssueId + { + get; + set; + } + } + + /// + /// issueAdded + /// + public class IssueAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Issue + /// + [JsonInclude] + [JsonPropertyName("issue")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Audits.InspectorIssue Issue + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Autofill +{ + /// + /// CreditCard + /// + public partial class CreditCard : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// 16-digit credit card number. + /// + [JsonPropertyName("number")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Number + { + get; + set; + } + + /// + /// Name of the credit card owner. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// 2-digit expiry month. + /// + [JsonPropertyName("expiryMonth")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ExpiryMonth + { + get; + set; + } + + /// + /// 4-digit expiry year. + /// + [JsonPropertyName("expiryYear")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ExpiryYear + { + get; + set; + } + + /// + /// 3-digit card verification code. + /// + [JsonPropertyName("cvc")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Cvc + { + get; + set; + } + } + + /// + /// AddressField + /// + public partial class AddressField : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// address field name, for example GIVEN_NAME. + /// The full list of supported field names: + /// https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/field_types.cc;l=38 + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// address field value, for example Jon Doe. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// A list of address fields. + /// + public partial class AddressFields : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Fields + /// + [JsonPropertyName("fields")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Fields + { + get; + set; + } + } + + /// + /// Address + /// + public partial class Address : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// fields and values defining an address. + /// + [JsonPropertyName("fields")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Fields + { + get; + set; + } + } + + /// + /// Defines how an address can be displayed like in chrome://settings/addresses. + /// Address UI is a two dimensional array, each inner array is an "address information line", and when rendered in a UI surface should be displayed as such. + /// The following address UI for instance: + /// [[{name: "GIVE_NAME", value: "Jon"}, {name: "FAMILY_NAME", value: "Doe"}], [{name: "CITY", value: "Munich"}, {name: "ZIP", value: "81456"}]] + /// should allow the receiver to render: + /// Jon Doe + /// Munich 81456 + /// + public partial class AddressUI : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A two dimension array containing the representation of values from an address profile. + /// + [JsonPropertyName("addressFields")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList AddressFields + { + get; + set; + } + } + + /// + /// Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics. + /// + public enum FillingStrategy + { + /// + /// autocompleteAttribute + /// + [JsonPropertyName("autocompleteAttribute")] + AutocompleteAttribute, + /// + /// autofillInferred + /// + [JsonPropertyName("autofillInferred")] + AutofillInferred + } + + /// + /// FilledField + /// + public partial class FilledField : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The type of the field, e.g text, password etc. + /// + [JsonPropertyName("htmlType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string HtmlType + { + get; + set; + } + + /// + /// the html id + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// the html name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// the field value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + + /// + /// The actual field type, e.g FAMILY_NAME + /// + [JsonPropertyName("autofillType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string AutofillType + { + get; + set; + } + + /// + /// The filling strategy + /// + [JsonPropertyName("fillingStrategy")] + public CefSharp.DevTools.Autofill.FillingStrategy FillingStrategy + { + get; + set; + } + + /// + /// The frame the field belongs to + /// + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + set; + } + + /// + /// The form field's DOM node + /// + [JsonPropertyName("fieldId")] + public int FieldId + { + get; + set; + } + } + + /// + /// Emitted when an address form is filled. + /// + public class AddressFormFilledEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Information about the fields that were filled + /// + [JsonInclude] + [JsonPropertyName("filledFields")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList FilledFields + { + get; + private set; + } + + /// + /// An UI representation of the address used to fill the form. + /// Consists of a 2D array where each child represents an address/profile line. + /// + [JsonInclude] + [JsonPropertyName("addressUi")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Autofill.AddressUI AddressUi + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.BackgroundService +{ + /// + /// The Background Service that will be associated with the commands/events. + /// Every Background Service operates independently, but they share the same + /// API. + /// + public enum ServiceName + { + /// + /// backgroundFetch + /// + [JsonPropertyName("backgroundFetch")] + BackgroundFetch, + /// + /// backgroundSync + /// + [JsonPropertyName("backgroundSync")] + BackgroundSync, + /// + /// pushMessaging + /// + [JsonPropertyName("pushMessaging")] + PushMessaging, + /// + /// notifications + /// + [JsonPropertyName("notifications")] + Notifications, + /// + /// paymentHandler + /// + [JsonPropertyName("paymentHandler")] + PaymentHandler, + /// + /// periodicBackgroundSync + /// + [JsonPropertyName("periodicBackgroundSync")] + PeriodicBackgroundSync + } + + /// + /// A key-value pair for additional event information to pass along. + /// + public partial class EventMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Key + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// BackgroundServiceEvent + /// + public partial class BackgroundServiceEvent : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Timestamp of the event (in seconds). + /// + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + set; + } + + /// + /// The origin this event belongs to. + /// + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + set; + } + + /// + /// The Service Worker ID that initiated the event. + /// + [JsonPropertyName("serviceWorkerRegistrationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ServiceWorkerRegistrationId + { + get; + set; + } + + /// + /// The Background Service this event belongs to. + /// + [JsonPropertyName("service")] + public CefSharp.DevTools.BackgroundService.ServiceName Service + { + get; + set; + } + + /// + /// A description of the event. + /// + [JsonPropertyName("eventName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string EventName + { + get; + set; + } + + /// + /// An identifier that groups related events together. + /// + [JsonPropertyName("instanceId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string InstanceId + { + get; + set; + } + + /// + /// A list of event-specific information. + /// + [JsonPropertyName("eventMetadata")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList EventMetadata + { + get; + set; + } + + /// + /// Storage key this event belongs to. + /// + [JsonPropertyName("storageKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StorageKey + { + get; + set; + } + } + + /// + /// Called when the recording state for the service has been updated. + /// + public class RecordingStateChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// IsRecording + /// + [JsonInclude] + [JsonPropertyName("isRecording")] + public bool IsRecording + { + get; + private set; + } + + /// + /// Service + /// + [JsonInclude] + [JsonPropertyName("service")] + public CefSharp.DevTools.BackgroundService.ServiceName Service + { + get; + private set; + } + } + + /// + /// Called with all existing backgroundServiceEvents when enabled, and all new + /// events afterwards if enabled and recording. + /// + public class BackgroundServiceEventReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// BackgroundServiceEvent + /// + [JsonInclude] + [JsonPropertyName("backgroundServiceEvent")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.BackgroundService.BackgroundServiceEvent BackgroundServiceEvent + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + /// + /// Indicates the various states of Central. + /// + public enum CentralState + { + /// + /// absent + /// + [JsonPropertyName("absent")] + Absent, + /// + /// powered-off + /// + [JsonPropertyName("powered-off")] + PoweredOff, + /// + /// powered-on + /// + [JsonPropertyName("powered-on")] + PoweredOn + } + + /// + /// Indicates the various types of GATT event. + /// + public enum GATTOperationType + { + /// + /// connection + /// + [JsonPropertyName("connection")] + Connection, + /// + /// discovery + /// + [JsonPropertyName("discovery")] + Discovery + } + + /// + /// Indicates the various types of characteristic write. + /// + public enum CharacteristicWriteType + { + /// + /// write-default-deprecated + /// + [JsonPropertyName("write-default-deprecated")] + WriteDefaultDeprecated, + /// + /// write-with-response + /// + [JsonPropertyName("write-with-response")] + WriteWithResponse, + /// + /// write-without-response + /// + [JsonPropertyName("write-without-response")] + WriteWithoutResponse + } + + /// + /// Indicates the various types of characteristic operation. + /// + public enum CharacteristicOperationType + { + /// + /// read + /// + [JsonPropertyName("read")] + Read, + /// + /// write + /// + [JsonPropertyName("write")] + Write, + /// + /// subscribe-to-notifications + /// + [JsonPropertyName("subscribe-to-notifications")] + SubscribeToNotifications, + /// + /// unsubscribe-from-notifications + /// + [JsonPropertyName("unsubscribe-from-notifications")] + UnsubscribeFromNotifications + } + + /// + /// Indicates the various types of descriptor operation. + /// + public enum DescriptorOperationType + { + /// + /// read + /// + [JsonPropertyName("read")] + Read, + /// + /// write + /// + [JsonPropertyName("write")] + Write + } + + /// + /// Stores the manufacturer data + /// + public partial class ManufacturerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Company identifier + /// https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/company_identifiers/company_identifiers.yaml + /// https://usb.org/developers + /// + [JsonPropertyName("key")] + public int Key + { + get; + set; + } + + /// + /// Manufacturer-specific data + /// + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + set; + } + } + + /// + /// Stores the byte data of the advertisement packet sent by a Bluetooth device. + /// + public partial class ScanRecord : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// Uuids + /// + [JsonPropertyName("uuids")] + public string[] Uuids + { + get; + set; + } + + /// + /// Stores the external appearance description of the device. + /// + [JsonPropertyName("appearance")] + public int? Appearance + { + get; + set; + } + + /// + /// Stores the transmission power of a broadcasting device. + /// + [JsonPropertyName("txPower")] + public int? TxPower + { + get; + set; + } + + /// + /// Key is the company identifier and the value is an array of bytes of + /// manufacturer specific data. + /// + [JsonPropertyName("manufacturerData")] + public System.Collections.Generic.IList ManufacturerData + { + get; + set; + } + } + + /// + /// Stores the advertisement packet information that is sent by a Bluetooth device. + /// + public partial class ScanEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// DeviceAddress + /// + [JsonPropertyName("deviceAddress")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DeviceAddress + { + get; + set; + } + + /// + /// Rssi + /// + [JsonPropertyName("rssi")] + public int Rssi + { + get; + set; + } + + /// + /// ScanRecord + /// + [JsonPropertyName("scanRecord")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.BluetoothEmulation.ScanRecord ScanRecord + { + get; + set; + } + } + + /// + /// Describes the properties of a characteristic. This follows Bluetooth Core + /// Specification BT 4.2 Vol 3 Part G 3.3.1. Characteristic Properties. + /// + public partial class CharacteristicProperties : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Broadcast + /// + [JsonPropertyName("broadcast")] + public bool? Broadcast + { + get; + set; + } + + /// + /// Read + /// + [JsonPropertyName("read")] + public bool? Read + { + get; + set; + } + + /// + /// WriteWithoutResponse + /// + [JsonPropertyName("writeWithoutResponse")] + public bool? WriteWithoutResponse + { + get; + set; + } + + /// + /// Write + /// + [JsonPropertyName("write")] + public bool? Write + { + get; + set; + } + + /// + /// Notify + /// + [JsonPropertyName("notify")] + public bool? Notify + { + get; + set; + } + + /// + /// Indicate + /// + [JsonPropertyName("indicate")] + public bool? Indicate + { + get; + set; + } + + /// + /// AuthenticatedSignedWrites + /// + [JsonPropertyName("authenticatedSignedWrites")] + public bool? AuthenticatedSignedWrites + { + get; + set; + } + + /// + /// ExtendedProperties + /// + [JsonPropertyName("extendedProperties")] + public bool? ExtendedProperties + { + get; + set; + } + } + + /// + /// Event for when a GATT operation of |type| to the peripheral with |address| + /// happened. + /// + public class GattOperationReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Address + /// + [JsonInclude] + [JsonPropertyName("address")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Address + { + get; + private set; + } + + /// + /// Type + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.BluetoothEmulation.GATTOperationType Type + { + get; + private set; + } + } + + /// + /// Event for when a characteristic operation of |type| to the characteristic + /// respresented by |characteristicId| happened. |data| and |writeType| is + /// expected to exist when |type| is write. + /// + public class CharacteristicOperationReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// CharacteristicId + /// + [JsonInclude] + [JsonPropertyName("characteristicId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string CharacteristicId + { + get; + private set; + } + + /// + /// Type + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.BluetoothEmulation.CharacteristicOperationType Type + { + get; + private set; + } + + /// + /// Data + /// + [JsonInclude] + [JsonPropertyName("data")] + public byte[] Data + { + get; + private set; + } + + /// + /// WriteType + /// + [JsonInclude] + [JsonPropertyName("writeType")] + public CefSharp.DevTools.BluetoothEmulation.CharacteristicWriteType? WriteType + { + get; + private set; + } + } + + /// + /// Event for when a descriptor operation of |type| to the descriptor + /// respresented by |descriptorId| happened. |data| is expected to exist when + /// |type| is write. + /// + public class DescriptorOperationReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// DescriptorId + /// + [JsonInclude] + [JsonPropertyName("descriptorId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DescriptorId + { + get; + private set; + } + + /// + /// Type + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.BluetoothEmulation.DescriptorOperationType Type + { + get; + private set; + } + + /// + /// Data + /// + [JsonInclude] + [JsonPropertyName("data")] + public byte[] Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// The state of the browser window. + /// + public enum WindowState + { + /// + /// normal + /// + [JsonPropertyName("normal")] + Normal, + /// + /// minimized + /// + [JsonPropertyName("minimized")] + Minimized, + /// + /// maximized + /// + [JsonPropertyName("maximized")] + Maximized, + /// + /// fullscreen + /// + [JsonPropertyName("fullscreen")] + Fullscreen + } + + /// + /// Browser window bounds information + /// + public partial class Bounds : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The offset from the left edge of the screen to the window in pixels. + /// + [JsonPropertyName("left")] + public int? Left + { + get; + set; + } + + /// + /// The offset from the top edge of the screen to the window in pixels. + /// + [JsonPropertyName("top")] + public int? Top + { + get; + set; + } + + /// + /// The window width in pixels. + /// + [JsonPropertyName("width")] + public int? Width + { + get; + set; + } + + /// + /// The window height in pixels. + /// + [JsonPropertyName("height")] + public int? Height + { + get; + set; + } + + /// + /// The window state. Default to normal. + /// + [JsonPropertyName("windowState")] + public CefSharp.DevTools.Browser.WindowState? WindowState + { + get; + set; + } + } + + /// + /// PermissionType + /// + public enum PermissionType + { + /// + /// ar + /// + [JsonPropertyName("ar")] + Ar, + /// + /// audioCapture + /// + [JsonPropertyName("audioCapture")] + AudioCapture, + /// + /// automaticFullscreen + /// + [JsonPropertyName("automaticFullscreen")] + AutomaticFullscreen, + /// + /// backgroundFetch + /// + [JsonPropertyName("backgroundFetch")] + BackgroundFetch, + /// + /// backgroundSync + /// + [JsonPropertyName("backgroundSync")] + BackgroundSync, + /// + /// cameraPanTiltZoom + /// + [JsonPropertyName("cameraPanTiltZoom")] + CameraPanTiltZoom, + /// + /// capturedSurfaceControl + /// + [JsonPropertyName("capturedSurfaceControl")] + CapturedSurfaceControl, + /// + /// clipboardReadWrite + /// + [JsonPropertyName("clipboardReadWrite")] + ClipboardReadWrite, + /// + /// clipboardSanitizedWrite + /// + [JsonPropertyName("clipboardSanitizedWrite")] + ClipboardSanitizedWrite, + /// + /// displayCapture + /// + [JsonPropertyName("displayCapture")] + DisplayCapture, + /// + /// durableStorage + /// + [JsonPropertyName("durableStorage")] + DurableStorage, + /// + /// geolocation + /// + [JsonPropertyName("geolocation")] + Geolocation, + /// + /// handTracking + /// + [JsonPropertyName("handTracking")] + HandTracking, + /// + /// idleDetection + /// + [JsonPropertyName("idleDetection")] + IdleDetection, + /// + /// keyboardLock + /// + [JsonPropertyName("keyboardLock")] + KeyboardLock, + /// + /// localFonts + /// + [JsonPropertyName("localFonts")] + LocalFonts, + /// + /// localNetwork + /// + [JsonPropertyName("localNetwork")] + LocalNetwork, + /// + /// localNetworkAccess + /// + [JsonPropertyName("localNetworkAccess")] + LocalNetworkAccess, + /// + /// loopbackNetwork + /// + [JsonPropertyName("loopbackNetwork")] + LoopbackNetwork, + /// + /// midi + /// + [JsonPropertyName("midi")] + Midi, + /// + /// midiSysex + /// + [JsonPropertyName("midiSysex")] + MidiSysex, + /// + /// nfc + /// + [JsonPropertyName("nfc")] + Nfc, + /// + /// notifications + /// + [JsonPropertyName("notifications")] + Notifications, + /// + /// paymentHandler + /// + [JsonPropertyName("paymentHandler")] + PaymentHandler, + /// + /// periodicBackgroundSync + /// + [JsonPropertyName("periodicBackgroundSync")] + PeriodicBackgroundSync, + /// + /// pointerLock + /// + [JsonPropertyName("pointerLock")] + PointerLock, + /// + /// protectedMediaIdentifier + /// + [JsonPropertyName("protectedMediaIdentifier")] + ProtectedMediaIdentifier, + /// + /// sensors + /// + [JsonPropertyName("sensors")] + Sensors, + /// + /// smartCard + /// + [JsonPropertyName("smartCard")] + SmartCard, + /// + /// speakerSelection + /// + [JsonPropertyName("speakerSelection")] + SpeakerSelection, + /// + /// storageAccess + /// + [JsonPropertyName("storageAccess")] + StorageAccess, + /// + /// topLevelStorageAccess + /// + [JsonPropertyName("topLevelStorageAccess")] + TopLevelStorageAccess, + /// + /// videoCapture + /// + [JsonPropertyName("videoCapture")] + VideoCapture, + /// + /// vr + /// + [JsonPropertyName("vr")] + Vr, + /// + /// wakeLockScreen + /// + [JsonPropertyName("wakeLockScreen")] + WakeLockScreen, + /// + /// wakeLockSystem + /// + [JsonPropertyName("wakeLockSystem")] + WakeLockSystem, + /// + /// webAppInstallation + /// + [JsonPropertyName("webAppInstallation")] + WebAppInstallation, + /// + /// webPrinting + /// + [JsonPropertyName("webPrinting")] + WebPrinting, + /// + /// windowManagement + /// + [JsonPropertyName("windowManagement")] + WindowManagement + } + + /// + /// PermissionSetting + /// + public enum PermissionSetting + { + /// + /// granted + /// + [JsonPropertyName("granted")] + Granted, + /// + /// denied + /// + [JsonPropertyName("denied")] + Denied, + /// + /// prompt + /// + [JsonPropertyName("prompt")] + Prompt + } + + /// + /// Definition of PermissionDescriptor defined in the Permissions API: + /// https://w3c.github.io/permissions/#dom-permissiondescriptor. + /// + public partial class PermissionDescriptor : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of permission. + /// See https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl for valid permission names. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// For "midi" permission, may also specify sysex control. + /// + [JsonPropertyName("sysex")] + public bool? Sysex + { + get; + set; + } + + /// + /// For "push" permission, may specify userVisibleOnly. + /// Note that userVisibleOnly = true is the only currently supported type. + /// + [JsonPropertyName("userVisibleOnly")] + public bool? UserVisibleOnly + { + get; + set; + } + + /// + /// For "clipboard" permission, may specify allowWithoutSanitization. + /// + [JsonPropertyName("allowWithoutSanitization")] + public bool? AllowWithoutSanitization + { + get; + set; + } + + /// + /// For "fullscreen" permission, must specify allowWithoutGesture:true. + /// + [JsonPropertyName("allowWithoutGesture")] + public bool? AllowWithoutGesture + { + get; + set; + } + + /// + /// For "camera" permission, may specify panTiltZoom. + /// + [JsonPropertyName("panTiltZoom")] + public bool? PanTiltZoom + { + get; + set; + } + } + + /// + /// Browser command ids used by executeBrowserCommand. + /// + public enum BrowserCommandId + { + /// + /// openTabSearch + /// + [JsonPropertyName("openTabSearch")] + OpenTabSearch, + /// + /// closeTabSearch + /// + [JsonPropertyName("closeTabSearch")] + CloseTabSearch, + /// + /// openGlic + /// + [JsonPropertyName("openGlic")] + OpenGlic + } + + /// + /// Chrome histogram bucket. + /// + public partial class Bucket : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Minimum value (inclusive). + /// + [JsonPropertyName("low")] + public int Low + { + get; + set; + } + + /// + /// Maximum value (exclusive). + /// + [JsonPropertyName("high")] + public int High + { + get; + set; + } + + /// + /// Number of samples. + /// + [JsonPropertyName("count")] + public int Count + { + get; + set; + } + } + + /// + /// Chrome histogram. + /// + public partial class Histogram : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Sum of sample values. + /// + [JsonPropertyName("sum")] + public int Sum + { + get; + set; + } + + /// + /// Total number of samples. + /// + [JsonPropertyName("count")] + public int Count + { + get; + set; + } + + /// + /// Buckets. + /// + [JsonPropertyName("buckets")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Buckets + { + get; + set; + } + } + + /// + /// PrivacySandboxAPI + /// + public enum PrivacySandboxAPI + { + /// + /// BiddingAndAuctionServices + /// + [JsonPropertyName("BiddingAndAuctionServices")] + BiddingAndAuctionServices, + /// + /// TrustedKeyValue + /// + [JsonPropertyName("TrustedKeyValue")] + TrustedKeyValue + } + + /// + /// Fired when page is about to start a download. + /// + public class DownloadWillBeginEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that caused the download to begin. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Global unique identifier of the download. + /// + [JsonInclude] + [JsonPropertyName("guid")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Guid + { + get; + private set; + } + + /// + /// URL of the resource being downloaded. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Suggested file name of the resource (the actual name of the file saved on disk may differ). + /// + [JsonInclude] + [JsonPropertyName("suggestedFilename")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SuggestedFilename + { + get; + private set; + } + } + + /// + /// Download status. + /// + public enum DownloadProgressState + { + /// + /// inProgress + /// + [JsonPropertyName("inProgress")] + InProgress, + /// + /// completed + /// + [JsonPropertyName("completed")] + Completed, + /// + /// canceled + /// + [JsonPropertyName("canceled")] + Canceled + } + + /// + /// Fired when download makes progress. Last call has |done| == true. + /// + public class DownloadProgressEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Global unique identifier of the download. + /// + [JsonInclude] + [JsonPropertyName("guid")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Guid + { + get; + private set; + } + + /// + /// Total expected bytes to download. + /// + [JsonInclude] + [JsonPropertyName("totalBytes")] + public double TotalBytes + { + get; + private set; + } + + /// + /// Total bytes received. + /// + [JsonInclude] + [JsonPropertyName("receivedBytes")] + public double ReceivedBytes + { + get; + private set; + } + + /// + /// Download status. + /// + [JsonInclude] + [JsonPropertyName("state")] + public CefSharp.DevTools.Browser.DownloadProgressState State + { + get; + private set; + } + + /// + /// If download is "completed", provides the path of the downloaded file. + /// Depending on the platform, it is not guaranteed to be set, nor the file + /// is guaranteed to exist. + /// + [JsonInclude] + [JsonPropertyName("filePath")] + public string FilePath + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agent + /// stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via + /// inspector" rules), "regular" for regular stylesheets. + /// + public enum StyleSheetOrigin + { + /// + /// injected + /// + [JsonPropertyName("injected")] + Injected, + /// + /// user-agent + /// + [JsonPropertyName("user-agent")] + UserAgent, + /// + /// inspector + /// + [JsonPropertyName("inspector")] + Inspector, + /// + /// regular + /// + [JsonPropertyName("regular")] + Regular + } + + /// + /// CSS rule collection for a single pseudo style. + /// + public partial class PseudoElementMatches : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Pseudo element type. + /// + [JsonPropertyName("pseudoType")] + public CefSharp.DevTools.DOM.PseudoType PseudoType + { + get; + set; + } + + /// + /// Pseudo element custom ident. + /// + [JsonPropertyName("pseudoIdentifier")] + public string PseudoIdentifier + { + get; + set; + } + + /// + /// Matches of CSS rules applicable to the pseudo style. + /// + [JsonPropertyName("matches")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Matches + { + get; + set; + } + } + + /// + /// CSS style coming from animations with the name of the animation. + /// + public partial class CSSAnimationStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The name of the animation. + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// The style coming from the animation. + /// + [JsonPropertyName("style")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// Inherited CSS rule collection from ancestor node. + /// + public partial class InheritedStyleEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The ancestor node's inline style, if any, in the style inheritance chain. + /// + [JsonPropertyName("inlineStyle")] + public CefSharp.DevTools.CSS.CSSStyle InlineStyle + { + get; + set; + } + + /// + /// Matches of CSS rules matching the ancestor node in the style inheritance chain. + /// + [JsonPropertyName("matchedCSSRules")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList MatchedCSSRules + { + get; + set; + } + } + + /// + /// Inherited CSS style collection for animated styles from ancestor node. + /// + public partial class InheritedAnimatedStyleEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Styles coming from the animations of the ancestor, if any, in the style inheritance chain. + /// + [JsonPropertyName("animationStyles")] + public System.Collections.Generic.IList AnimationStyles + { + get; + set; + } + + /// + /// The style coming from the transitions of the ancestor, if any, in the style inheritance chain. + /// + [JsonPropertyName("transitionsStyle")] + public CefSharp.DevTools.CSS.CSSStyle TransitionsStyle + { + get; + set; + } + } + + /// + /// Inherited pseudo element matches from pseudos of an ancestor node. + /// + public partial class InheritedPseudoElementMatches : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Matches of pseudo styles from the pseudos of an ancestor node. + /// + [JsonPropertyName("pseudoElements")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList PseudoElements + { + get; + set; + } + } + + /// + /// Match data for a CSS rule. + /// + public partial class RuleMatch : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CSS rule in the match. + /// + [JsonPropertyName("rule")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSRule Rule + { + get; + set; + } + + /// + /// Matching selector indices in the rule's selectorList selectors (0-based). + /// + [JsonPropertyName("matchingSelectors")] + public int[] MatchingSelectors + { + get; + set; + } + } + + /// + /// Data for a simple selector (these are delimited by commas in a selector list). + /// + public partial class Value : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Value text. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + + /// + /// Value range in the underlying resource (if available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Specificity of the selector. + /// + [JsonPropertyName("specificity")] + public CefSharp.DevTools.CSS.Specificity Specificity + { + get; + set; + } + } + + /// + /// Specificity: + /// https://drafts.csswg.org/selectors/#specificity-rules + /// + public partial class Specificity : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The a component, which represents the number of ID selectors. + /// + [JsonPropertyName("a")] + public int A + { + get; + set; + } + + /// + /// The b component, which represents the number of class selectors, attributes selectors, and + /// pseudo-classes. + /// + [JsonPropertyName("b")] + public int B + { + get; + set; + } + + /// + /// The c component, which represents the number of type selectors and pseudo-elements. + /// + [JsonPropertyName("c")] + public int C + { + get; + set; + } + } + + /// + /// Selector list data. + /// + public partial class SelectorList : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Selectors in the list. + /// + [JsonPropertyName("selectors")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Selectors + { + get; + set; + } + + /// + /// Rule selector text. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + } + + /// + /// CSS stylesheet metainformation. + /// + public partial class CSSStyleSheetHeader : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The stylesheet identifier. + /// + [JsonPropertyName("styleSheetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StyleSheetId + { + get; + set; + } + + /// + /// Owner frame identifier. + /// + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + set; + } + + /// + /// Stylesheet resource URL. Empty if this is a constructed stylesheet created using + /// new CSSStyleSheet() (but non-empty if this is a constructed stylesheet imported + /// as a CSS module script). + /// + [JsonPropertyName("sourceURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SourceURL + { + get; + set; + } + + /// + /// URL of source map associated with the stylesheet (if any). + /// + [JsonPropertyName("sourceMapURL")] + public string SourceMapURL + { + get; + set; + } + + /// + /// Stylesheet origin. + /// + [JsonPropertyName("origin")] + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get; + set; + } + + /// + /// Stylesheet title. + /// + [JsonPropertyName("title")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Title + { + get; + set; + } + + /// + /// The backend id for the owner node of the stylesheet. + /// + [JsonPropertyName("ownerNode")] + public int? OwnerNode + { + get; + set; + } + + /// + /// Denotes whether the stylesheet is disabled. + /// + [JsonPropertyName("disabled")] + public bool Disabled + { + get; + set; + } + + /// + /// Whether the sourceURL field value comes from the sourceURL comment. + /// + [JsonPropertyName("hasSourceURL")] + public bool? HasSourceURL + { + get; + set; + } + + /// + /// Whether this stylesheet is created for STYLE tag by parser. This flag is not set for + /// document.written STYLE tags. + /// + [JsonPropertyName("isInline")] + public bool IsInline + { + get; + set; + } + + /// + /// Whether this stylesheet is mutable. Inline stylesheets become mutable + /// after they have been modified via CSSOM API. + /// `<link>` element's stylesheets become mutable only if DevTools modifies them. + /// Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation. + /// + [JsonPropertyName("isMutable")] + public bool IsMutable + { + get; + set; + } + + /// + /// True if this stylesheet is created through new CSSStyleSheet() or imported as a + /// CSS module script. + /// + [JsonPropertyName("isConstructed")] + public bool IsConstructed + { + get; + set; + } + + /// + /// Line offset of the stylesheet within the resource (zero based). + /// + [JsonPropertyName("startLine")] + public double StartLine + { + get; + set; + } + + /// + /// Column offset of the stylesheet within the resource (zero based). + /// + [JsonPropertyName("startColumn")] + public double StartColumn + { + get; + set; + } + + /// + /// Size of the content (in characters). + /// + [JsonPropertyName("length")] + public double Length + { + get; + set; + } + + /// + /// Line offset of the end of the stylesheet within the resource (zero based). + /// + [JsonPropertyName("endLine")] + public double EndLine + { + get; + set; + } + + /// + /// Column offset of the end of the stylesheet within the resource (zero based). + /// + [JsonPropertyName("endColumn")] + public double EndColumn + { + get; + set; + } + + /// + /// If the style sheet was loaded from a network resource, this indicates when the resource failed to load + /// + [JsonPropertyName("loadingFailed")] + public bool? LoadingFailed + { + get; + set; + } + } + + /// + /// CSS rule representation. + /// + public partial class CSSRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Rule selector data. + /// + [JsonPropertyName("selectorList")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.SelectorList SelectorList + { + get; + set; + } + + /// + /// Array of selectors from ancestor style rules, sorted by distance from the current rule. + /// + [JsonPropertyName("nestingSelectors")] + public string[] NestingSelectors + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + [JsonPropertyName("origin")] + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [JsonPropertyName("style")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + + /// + /// The BackendNodeId of the DOM node that constitutes the origin tree scope of this rule. + /// + [JsonPropertyName("originTreeScopeNodeId")] + public int? OriginTreeScopeNodeId + { + get; + set; + } + + /// + /// Media list array (for rules involving media queries). The array enumerates media queries + /// starting with the innermost one, going outwards. + /// + [JsonPropertyName("media")] + public System.Collections.Generic.IList Media + { + get; + set; + } + + /// + /// Container query list array (for rules involving container queries). + /// The array enumerates container queries starting with the innermost one, going outwards. + /// + [JsonPropertyName("containerQueries")] + public System.Collections.Generic.IList ContainerQueries + { + get; + set; + } + + /// + /// @supports CSS at-rule array. + /// The array enumerates @supports at-rules starting with the innermost one, going outwards. + /// + [JsonPropertyName("supports")] + public System.Collections.Generic.IList Supports + { + get; + set; + } + + /// + /// Cascade layer array. Contains the layer hierarchy that this rule belongs to starting + /// with the innermost layer and going outwards. + /// + [JsonPropertyName("layers")] + public System.Collections.Generic.IList Layers + { + get; + set; + } + + /// + /// @scope CSS at-rule array. + /// The array enumerates @scope at-rules starting with the innermost one, going outwards. + /// + [JsonPropertyName("scopes")] + public System.Collections.Generic.IList Scopes + { + get; + set; + } + + /// + /// The array keeps the types of ancestor CSSRules from the innermost going outwards. + /// + [JsonPropertyName("ruleTypes")] + public CefSharp.DevTools.CSS.CSSRuleType[] RuleTypes + { + get; + set; + } + + /// + /// @starting-style CSS at-rule array. + /// The array enumerates @starting-style at-rules starting with the innermost one, going outwards. + /// + [JsonPropertyName("startingStyles")] + public System.Collections.Generic.IList StartingStyles + { + get; + set; + } + } + + /// + /// Enum indicating the type of a CSS rule, used to represent the order of a style rule's ancestors. + /// This list only contains rule types that are collected during the ancestor rule collection. + /// + public enum CSSRuleType + { + /// + /// MediaRule + /// + [JsonPropertyName("MediaRule")] + MediaRule, + /// + /// SupportsRule + /// + [JsonPropertyName("SupportsRule")] + SupportsRule, + /// + /// ContainerRule + /// + [JsonPropertyName("ContainerRule")] + ContainerRule, + /// + /// LayerRule + /// + [JsonPropertyName("LayerRule")] + LayerRule, + /// + /// ScopeRule + /// + [JsonPropertyName("ScopeRule")] + ScopeRule, + /// + /// StyleRule + /// + [JsonPropertyName("StyleRule")] + StyleRule, + /// + /// StartingStyleRule + /// + [JsonPropertyName("StartingStyleRule")] + StartingStyleRule + } + + /// + /// CSS coverage information. + /// + public partial class RuleUsage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StyleSheetId + { + get; + set; + } + + /// + /// Offset of the start of the rule (including selector) from the beginning of the stylesheet. + /// + [JsonPropertyName("startOffset")] + public double StartOffset + { + get; + set; + } + + /// + /// Offset of the end of the rule body from the beginning of the stylesheet. + /// + [JsonPropertyName("endOffset")] + public double EndOffset + { + get; + set; + } + + /// + /// Indicates whether the rule was actually used by some element in the page. + /// + [JsonPropertyName("used")] + public bool Used + { + get; + set; + } + } + + /// + /// Text range within a resource. All numbers are zero-based. + /// + public partial class SourceRange : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Start line of range. + /// + [JsonPropertyName("startLine")] + public int StartLine + { + get; + set; + } + + /// + /// Start column of range (inclusive). + /// + [JsonPropertyName("startColumn")] + public int StartColumn + { + get; + set; + } + + /// + /// End line of range + /// + [JsonPropertyName("endLine")] + public int EndLine + { + get; + set; + } + + /// + /// End column of range (exclusive). + /// + [JsonPropertyName("endColumn")] + public int EndColumn + { + get; + set; + } + } + + /// + /// ShorthandEntry + /// + public partial class ShorthandEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Shorthand name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Shorthand value. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + + /// + /// Whether the property has "!important" annotation (implies `false` if absent). + /// + [JsonPropertyName("important")] + public bool? Important + { + get; + set; + } + } + + /// + /// CSSComputedStyleProperty + /// + public partial class CSSComputedStyleProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Computed style property name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Computed style property value. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// ComputedStyleExtraFields + /// + public partial class ComputedStyleExtraFields : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Returns whether or not this node is being rendered with base appearance, + /// which happens when it has its appearance property set to base/base-select + /// or it is in the subtree of an element being rendered with base appearance. + /// + [JsonPropertyName("isAppearanceBase")] + public bool IsAppearanceBase + { + get; + set; + } + } + + /// + /// CSS style representation. + /// + public partial class CSSStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// CSS properties in the style. + /// + [JsonPropertyName("cssProperties")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList CssProperties + { + get; + set; + } + + /// + /// Computed values for all shorthands found in the style. + /// + [JsonPropertyName("shorthandEntries")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList ShorthandEntries + { + get; + set; + } + + /// + /// Style declaration text (if available). + /// + [JsonPropertyName("cssText")] + public string CssText + { + get; + set; + } + + /// + /// Style declaration range in the enclosing stylesheet (if available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + } + + /// + /// CSS property declaration data. + /// + public partial class CSSProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The property name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// The property value. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + + /// + /// Whether the property has "!important" annotation (implies `false` if absent). + /// + [JsonPropertyName("important")] + public bool? Important + { + get; + set; + } + + /// + /// Whether the property is implicit (implies `false` if absent). + /// + [JsonPropertyName("implicit")] + public bool? Implicit + { + get; + set; + } + + /// + /// The full property text as specified in the style. + /// + [JsonPropertyName("text")] + public string Text + { + get; + set; + } + + /// + /// Whether the property is understood by the browser (implies `true` if absent). + /// + [JsonPropertyName("parsedOk")] + public bool? ParsedOk + { + get; + set; + } + + /// + /// Whether the property is disabled by the user (present for source-based properties only). + /// + [JsonPropertyName("disabled")] + public bool? Disabled + { + get; + set; + } + + /// + /// The entire property range in the enclosing style declaration (if available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Parsed longhand components of this property if it is a shorthand. + /// This field will be empty if the given property is not a shorthand. + /// + [JsonPropertyName("longhandProperties")] + public System.Collections.Generic.IList LonghandProperties + { + get; + set; + } + } + + /// + /// Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if + /// specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked + /// stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline + /// stylesheet's STYLE tag. + /// + public enum CSSMediaSource + { + /// + /// mediaRule + /// + [JsonPropertyName("mediaRule")] + MediaRule, + /// + /// importRule + /// + [JsonPropertyName("importRule")] + ImportRule, + /// + /// linkedSheet + /// + [JsonPropertyName("linkedSheet")] + LinkedSheet, + /// + /// inlineSheet + /// + [JsonPropertyName("inlineSheet")] + InlineSheet + } + + /// + /// CSS media rule descriptor. + /// + public partial class CSSMedia : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Media query text. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + + /// + /// Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if + /// specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked + /// stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline + /// stylesheet's STYLE tag. + /// + [JsonPropertyName("source")] + public CefSharp.DevTools.CSS.CSSMediaSource Source + { + get; + set; + } + + /// + /// URL of the document containing the media query description. + /// + [JsonPropertyName("sourceURL")] + public string SourceURL + { + get; + set; + } + + /// + /// The associated rule (@media or @import) header range in the enclosing stylesheet (if + /// available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Array of media queries. + /// + [JsonPropertyName("mediaList")] + public System.Collections.Generic.IList MediaList + { + get; + set; + } + } + + /// + /// Media query descriptor. + /// + public partial class MediaQuery : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Array of media query expressions. + /// + [JsonPropertyName("expressions")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Expressions + { + get; + set; + } + + /// + /// Whether the media query condition is satisfied. + /// + [JsonPropertyName("active")] + public bool Active + { + get; + set; + } + } + + /// + /// Media query expression descriptor. + /// + public partial class MediaQueryExpression : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Media query expression value. + /// + [JsonPropertyName("value")] + public double Value + { + get; + set; + } + + /// + /// Media query expression units. + /// + [JsonPropertyName("unit")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Unit + { + get; + set; + } + + /// + /// Media query expression feature. + /// + [JsonPropertyName("feature")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Feature + { + get; + set; + } + + /// + /// The associated range of the value text in the enclosing stylesheet (if available). + /// + [JsonPropertyName("valueRange")] + public CefSharp.DevTools.CSS.SourceRange ValueRange + { + get; + set; + } + + /// + /// Computed length of media query expression (if applicable). + /// + [JsonPropertyName("computedLength")] + public double? ComputedLength + { + get; + set; + } + } + + /// + /// CSS container query rule descriptor. + /// + public partial class CSSContainerQuery : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Container query text. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Optional name for the container. + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// Optional physical axes queried for the container. + /// + [JsonPropertyName("physicalAxes")] + public CefSharp.DevTools.DOM.PhysicalAxes? PhysicalAxes + { + get; + set; + } + + /// + /// Optional logical axes queried for the container. + /// + [JsonPropertyName("logicalAxes")] + public CefSharp.DevTools.DOM.LogicalAxes? LogicalAxes + { + get; + set; + } + + /// + /// true if the query contains scroll-state() queries. + /// + [JsonPropertyName("queriesScrollState")] + public bool? QueriesScrollState + { + get; + set; + } + + /// + /// true if the query contains anchored() queries. + /// + [JsonPropertyName("queriesAnchored")] + public bool? QueriesAnchored + { + get; + set; + } + } + + /// + /// CSS Supports at-rule descriptor. + /// + public partial class CSSSupports : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Supports rule text. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + + /// + /// Whether the supports condition is satisfied. + /// + [JsonPropertyName("active")] + public bool Active + { + get; + set; + } + + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + } + + /// + /// CSS Scope at-rule descriptor. + /// + public partial class CSSScope : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Scope rule text. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + } + + /// + /// CSS Layer at-rule descriptor. + /// + public partial class CSSLayer : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Layer name. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + } + + /// + /// CSS Starting Style at-rule descriptor. + /// + public partial class CSSStartingStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The associated rule header range in the enclosing stylesheet (if + /// available). + /// + [JsonPropertyName("range")] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// Identifier of the stylesheet containing this object (if exists). + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + } + + /// + /// CSS Layer data. + /// + public partial class CSSLayerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Layer name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Direct sub-layers + /// + [JsonPropertyName("subLayers")] + public System.Collections.Generic.IList SubLayers + { + get; + set; + } + + /// + /// Layer order. The order determines the order of the layer in the cascade order. + /// A higher number has higher priority in the cascade order. + /// + [JsonPropertyName("order")] + public double Order + { + get; + set; + } + } + + /// + /// Information about amount of glyphs that were rendered with given font. + /// + public partial class PlatformFontUsage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Font's family name reported by platform. + /// + [JsonPropertyName("familyName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FamilyName + { + get; + set; + } + + /// + /// Font's PostScript name reported by platform. + /// + [JsonPropertyName("postScriptName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PostScriptName + { + get; + set; + } + + /// + /// Indicates if the font was downloaded or resolved locally. + /// + [JsonPropertyName("isCustomFont")] + public bool IsCustomFont + { + get; + set; + } + + /// + /// Amount of glyphs that were rendered with this font. + /// + [JsonPropertyName("glyphCount")] + public double GlyphCount + { + get; + set; + } + } + + /// + /// Information about font variation axes for variable fonts + /// + public partial class FontVariationAxis : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The font-variation-setting tag (a.k.a. "axis tag"). + /// + [JsonPropertyName("tag")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Tag + { + get; + set; + } + + /// + /// Human-readable variation name in the default language (normally, "en"). + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// The minimum value (inclusive) the font supports for this tag. + /// + [JsonPropertyName("minValue")] + public double MinValue + { + get; + set; + } + + /// + /// The maximum value (inclusive) the font supports for this tag. + /// + [JsonPropertyName("maxValue")] + public double MaxValue + { + get; + set; + } + + /// + /// The default value. + /// + [JsonPropertyName("defaultValue")] + public double DefaultValue + { + get; + set; + } + } + + /// + /// Properties of a web font: https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions + /// and additional information such as platformFontFamily and fontVariationAxes. + /// + public partial class FontFace : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The font-family. + /// + [JsonPropertyName("fontFamily")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FontFamily + { + get; + set; + } + + /// + /// The font-style. + /// + [JsonPropertyName("fontStyle")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FontStyle + { + get; + set; + } + + /// + /// The font-variant. + /// + [JsonPropertyName("fontVariant")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FontVariant + { + get; + set; + } + + /// + /// The font-weight. + /// + [JsonPropertyName("fontWeight")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FontWeight + { + get; + set; + } + + /// + /// The font-stretch. + /// + [JsonPropertyName("fontStretch")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FontStretch + { + get; + set; + } + + /// + /// The font-display. + /// + [JsonPropertyName("fontDisplay")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FontDisplay + { + get; + set; + } + + /// + /// The unicode-range. + /// + [JsonPropertyName("unicodeRange")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string UnicodeRange + { + get; + set; + } + + /// + /// The src. + /// + [JsonPropertyName("src")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Src + { + get; + set; + } + + /// + /// The resolved platform font family + /// + [JsonPropertyName("platformFontFamily")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PlatformFontFamily + { + get; + set; + } + + /// + /// Available variation settings (a.k.a. "axes"). + /// + [JsonPropertyName("fontVariationAxes")] + public System.Collections.Generic.IList FontVariationAxes + { + get; + set; + } + } + + /// + /// CSS try rule representation. + /// + public partial class CSSTryRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + [JsonPropertyName("origin")] + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [JsonPropertyName("style")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// CSS @position-try rule representation. + /// + public partial class CSSPositionTryRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The prelude dashed-ident name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.Value Name + { + get; + set; + } + + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + [JsonPropertyName("origin")] + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [JsonPropertyName("style")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + + /// + /// Active + /// + [JsonPropertyName("active")] + public bool Active + { + get; + set; + } + } + + /// + /// CSS keyframes rule representation. + /// + public partial class CSSKeyframesRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Animation name. + /// + [JsonPropertyName("animationName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.Value AnimationName + { + get; + set; + } + + /// + /// List of keyframes. + /// + [JsonPropertyName("keyframes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Keyframes + { + get; + set; + } + } + + /// + /// Representation of a custom property registration through CSS.registerProperty + /// + public partial class CSSPropertyRegistration : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// PropertyName + /// + [JsonPropertyName("propertyName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PropertyName + { + get; + set; + } + + /// + /// InitialValue + /// + [JsonPropertyName("initialValue")] + public CefSharp.DevTools.CSS.Value InitialValue + { + get; + set; + } + + /// + /// Inherits + /// + [JsonPropertyName("inherits")] + public bool Inherits + { + get; + set; + } + + /// + /// Syntax + /// + [JsonPropertyName("syntax")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Syntax + { + get; + set; + } + } + + /// + /// Type of at-rule. + /// + public enum CSSAtRuleType + { + /// + /// font-face + /// + [JsonPropertyName("font-face")] + FontFace, + /// + /// font-feature-values + /// + [JsonPropertyName("font-feature-values")] + FontFeatureValues, + /// + /// font-palette-values + /// + [JsonPropertyName("font-palette-values")] + FontPaletteValues + } + + /// + /// Subsection of font-feature-values, if this is a subsection. + /// + public enum CSSAtRuleSubsection + { + /// + /// swash + /// + [JsonPropertyName("swash")] + Swash, + /// + /// annotation + /// + [JsonPropertyName("annotation")] + Annotation, + /// + /// ornaments + /// + [JsonPropertyName("ornaments")] + Ornaments, + /// + /// stylistic + /// + [JsonPropertyName("stylistic")] + Stylistic, + /// + /// styleset + /// + [JsonPropertyName("styleset")] + Styleset, + /// + /// character-variant + /// + [JsonPropertyName("character-variant")] + CharacterVariant + } + + /// + /// CSS generic @rule representation. + /// + public partial class CSSAtRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type of at-rule. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.CSS.CSSAtRuleType Type + { + get; + set; + } + + /// + /// Subsection of font-feature-values, if this is a subsection. + /// + [JsonPropertyName("subsection")] + public CefSharp.DevTools.CSS.CSSAtRuleSubsection? Subsection + { + get; + set; + } + + /// + /// LINT.ThenChange(//third_party/blink/renderer/core/inspector/inspector_style_sheet.cc:FontVariantAlternatesFeatureType,//third_party/blink/renderer/core/inspector/inspector_css_agent.cc:FontVariantAlternatesFeatureType) + /// Associated name, if applicable. + /// + [JsonPropertyName("name")] + public CefSharp.DevTools.CSS.Value Name + { + get; + set; + } + + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + [JsonPropertyName("origin")] + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [JsonPropertyName("style")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// CSS property at-rule representation. + /// + public partial class CSSPropertyRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + [JsonPropertyName("origin")] + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get; + set; + } + + /// + /// Associated property name. + /// + [JsonPropertyName("propertyName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.Value PropertyName + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [JsonPropertyName("style")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// CSS function argument representation. + /// + public partial class CSSFunctionParameter : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The parameter name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// The parameter type. + /// + [JsonPropertyName("type")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Type + { + get; + set; + } + } + + /// + /// CSS function conditional block representation. + /// + public partial class CSSFunctionConditionNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Media query for this conditional block. Only one type of condition should be set. + /// + [JsonPropertyName("media")] + public CefSharp.DevTools.CSS.CSSMedia Media + { + get; + set; + } + + /// + /// Container query for this conditional block. Only one type of condition should be set. + /// + [JsonPropertyName("containerQueries")] + public CefSharp.DevTools.CSS.CSSContainerQuery ContainerQueries + { + get; + set; + } + + /// + /// @supports CSS at-rule condition. Only one type of condition should be set. + /// + [JsonPropertyName("supports")] + public CefSharp.DevTools.CSS.CSSSupports Supports + { + get; + set; + } + + /// + /// Block body. + /// + [JsonPropertyName("children")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Children + { + get; + set; + } + + /// + /// The condition text. + /// + [JsonPropertyName("conditionText")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ConditionText + { + get; + set; + } + } + + /// + /// Section of the body of a CSS function rule. + /// + public partial class CSSFunctionNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A conditional block. If set, style should not be set. + /// + [JsonPropertyName("condition")] + public CefSharp.DevTools.CSS.CSSFunctionConditionNode Condition + { + get; + set; + } + + /// + /// Values set by this node. If set, condition should not be set. + /// + [JsonPropertyName("style")] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// CSS function at-rule representation. + /// + public partial class CSSFunctionRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of the function. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.Value Name + { + get; + set; + } + + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + [JsonPropertyName("origin")] + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get; + set; + } + + /// + /// List of parameters. + /// + [JsonPropertyName("parameters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Parameters + { + get; + set; + } + + /// + /// Function body. + /// + [JsonPropertyName("children")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Children + { + get; + set; + } + } + + /// + /// CSS keyframe rule representation. + /// + public partial class CSSKeyframeRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier (absent for user agent stylesheet and user-specified + /// stylesheet rules) this rule came from. + /// + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + set; + } + + /// + /// Parent stylesheet's origin. + /// + [JsonPropertyName("origin")] + public CefSharp.DevTools.CSS.StyleSheetOrigin Origin + { + get; + set; + } + + /// + /// Associated key text. + /// + [JsonPropertyName("keyText")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.Value KeyText + { + get; + set; + } + + /// + /// Associated style declaration. + /// + [JsonPropertyName("style")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSStyle Style + { + get; + set; + } + } + + /// + /// A descriptor of operation to mutate style declaration text. + /// + public partial class StyleDeclarationEdit : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The css style sheet identifier. + /// + [JsonPropertyName("styleSheetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StyleSheetId + { + get; + set; + } + + /// + /// The range of the style text in the enclosing stylesheet. + /// + [JsonPropertyName("range")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.SourceRange Range + { + get; + set; + } + + /// + /// New style text. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + } + + /// + /// Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded + /// web font. + /// + public class FontsUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The web font that has loaded. + /// + [JsonInclude] + [JsonPropertyName("font")] + public CefSharp.DevTools.CSS.FontFace Font + { + get; + private set; + } + } + + /// + /// Fired whenever an active document stylesheet is added. + /// + public class StyleSheetAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Added stylesheet metainfo. + /// + [JsonInclude] + [JsonPropertyName("header")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.CSS.CSSStyleSheetHeader Header + { + get; + private set; + } + } + + /// + /// Fired whenever a stylesheet is changed as a result of the client operation. + /// + public class StyleSheetChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StyleSheetId + /// + [JsonInclude] + [JsonPropertyName("styleSheetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StyleSheetId + { + get; + private set; + } + } + + /// + /// Fired whenever an active document stylesheet is removed. + /// + public class StyleSheetRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier of the removed stylesheet. + /// + [JsonInclude] + [JsonPropertyName("styleSheetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StyleSheetId + { + get; + private set; + } + } + + /// + /// computedStyleUpdated + /// + public class ComputedStyleUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The node id that has updated computed styles. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + /// + /// type of HTTP response cached + /// + public enum CachedResponseType + { + /// + /// basic + /// + [JsonPropertyName("basic")] + Basic, + /// + /// cors + /// + [JsonPropertyName("cors")] + Cors, + /// + /// default + /// + [JsonPropertyName("default")] + Default, + /// + /// error + /// + [JsonPropertyName("error")] + Error, + /// + /// opaqueResponse + /// + [JsonPropertyName("opaqueResponse")] + OpaqueResponse, + /// + /// opaqueRedirect + /// + [JsonPropertyName("opaqueRedirect")] + OpaqueRedirect + } + + /// + /// Data entry. + /// + public partial class DataEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Request URL. + /// + [JsonPropertyName("requestURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestURL + { + get; + set; + } + + /// + /// Request method. + /// + [JsonPropertyName("requestMethod")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestMethod + { + get; + set; + } + + /// + /// Request headers + /// + [JsonPropertyName("requestHeaders")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList RequestHeaders + { + get; + set; + } + + /// + /// Number of seconds since epoch. + /// + [JsonPropertyName("responseTime")] + public double ResponseTime + { + get; + set; + } + + /// + /// HTTP response status code. + /// + [JsonPropertyName("responseStatus")] + public int ResponseStatus + { + get; + set; + } + + /// + /// HTTP response status text. + /// + [JsonPropertyName("responseStatusText")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ResponseStatusText + { + get; + set; + } + + /// + /// HTTP response type + /// + [JsonPropertyName("responseType")] + public CefSharp.DevTools.CacheStorage.CachedResponseType ResponseType + { + get; + set; + } + + /// + /// Response headers + /// + [JsonPropertyName("responseHeaders")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList ResponseHeaders + { + get; + set; + } + } + + /// + /// Cache identifier. + /// + public partial class Cache : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// An opaque unique id of the cache. + /// + [JsonPropertyName("cacheId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string CacheId + { + get; + set; + } + + /// + /// Security origin of the cache. + /// + [JsonPropertyName("securityOrigin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SecurityOrigin + { + get; + set; + } + + /// + /// Storage key of the cache. + /// + [JsonPropertyName("storageKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StorageKey + { + get; + set; + } + + /// + /// Storage bucket of the cache. + /// + [JsonPropertyName("storageBucket")] + public CefSharp.DevTools.Storage.StorageBucket StorageBucket + { + get; + set; + } + + /// + /// The name of the cache. + /// + [JsonPropertyName("cacheName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string CacheName + { + get; + set; + } + } + + /// + /// Header + /// + public partial class Header : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// Cached response + /// + public partial class CachedResponse : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Entry content, base64-encoded. + /// + [JsonPropertyName("body")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Body + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.Cast +{ + /// + /// Sink + /// + public partial class Sink : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Id + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// Text describing the current session. Present only if there is an active + /// session on the sink. + /// + [JsonPropertyName("session")] + public string Session + { + get; + set; + } + } + + /// + /// This is fired whenever the list of available sinks changes. A sink is a + /// device or a software surface that you can cast to. + /// + public class SinksUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Sinks + /// + [JsonInclude] + [JsonPropertyName("sinks")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Sinks + { + get; + private set; + } + } + + /// + /// This is fired whenever the outstanding issue/error message changes. + /// |issueMessage| is empty if there is no issue. + /// + public class IssueUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// IssueMessage + /// + [JsonInclude] + [JsonPropertyName("issueMessage")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string IssueMessage + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// Backend node with a friendly name. + /// + public partial class BackendNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `Node`'s nodeType. + /// + [JsonPropertyName("nodeType")] + public int NodeType + { + get; + set; + } + + /// + /// `Node`'s nodeName. + /// + [JsonPropertyName("nodeName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeName + { + get; + set; + } + + /// + /// BackendNodeId + /// + [JsonPropertyName("backendNodeId")] + public int BackendNodeId + { + get; + set; + } + } + + /// + /// Pseudo element type. + /// + public enum PseudoType + { + /// + /// first-line + /// + [JsonPropertyName("first-line")] + FirstLine, + /// + /// first-letter + /// + [JsonPropertyName("first-letter")] + FirstLetter, + /// + /// checkmark + /// + [JsonPropertyName("checkmark")] + Checkmark, + /// + /// before + /// + [JsonPropertyName("before")] + Before, + /// + /// after + /// + [JsonPropertyName("after")] + After, + /// + /// picker-icon + /// + [JsonPropertyName("picker-icon")] + PickerIcon, + /// + /// interest-hint + /// + [JsonPropertyName("interest-hint")] + InterestHint, + /// + /// marker + /// + [JsonPropertyName("marker")] + Marker, + /// + /// backdrop + /// + [JsonPropertyName("backdrop")] + Backdrop, + /// + /// column + /// + [JsonPropertyName("column")] + Column, + /// + /// selection + /// + [JsonPropertyName("selection")] + Selection, + /// + /// search-text + /// + [JsonPropertyName("search-text")] + SearchText, + /// + /// target-text + /// + [JsonPropertyName("target-text")] + TargetText, + /// + /// spelling-error + /// + [JsonPropertyName("spelling-error")] + SpellingError, + /// + /// grammar-error + /// + [JsonPropertyName("grammar-error")] + GrammarError, + /// + /// highlight + /// + [JsonPropertyName("highlight")] + Highlight, + /// + /// first-line-inherited + /// + [JsonPropertyName("first-line-inherited")] + FirstLineInherited, + /// + /// scroll-marker + /// + [JsonPropertyName("scroll-marker")] + ScrollMarker, + /// + /// scroll-marker-group + /// + [JsonPropertyName("scroll-marker-group")] + ScrollMarkerGroup, + /// + /// scroll-button + /// + [JsonPropertyName("scroll-button")] + ScrollButton, + /// + /// scrollbar + /// + [JsonPropertyName("scrollbar")] + Scrollbar, + /// + /// scrollbar-thumb + /// + [JsonPropertyName("scrollbar-thumb")] + ScrollbarThumb, + /// + /// scrollbar-button + /// + [JsonPropertyName("scrollbar-button")] + ScrollbarButton, + /// + /// scrollbar-track + /// + [JsonPropertyName("scrollbar-track")] + ScrollbarTrack, + /// + /// scrollbar-track-piece + /// + [JsonPropertyName("scrollbar-track-piece")] + ScrollbarTrackPiece, + /// + /// scrollbar-corner + /// + [JsonPropertyName("scrollbar-corner")] + ScrollbarCorner, + /// + /// resizer + /// + [JsonPropertyName("resizer")] + Resizer, + /// + /// input-list-button + /// + [JsonPropertyName("input-list-button")] + InputListButton, + /// + /// view-transition + /// + [JsonPropertyName("view-transition")] + ViewTransition, + /// + /// view-transition-group + /// + [JsonPropertyName("view-transition-group")] + ViewTransitionGroup, + /// + /// view-transition-image-pair + /// + [JsonPropertyName("view-transition-image-pair")] + ViewTransitionImagePair, + /// + /// view-transition-group-children + /// + [JsonPropertyName("view-transition-group-children")] + ViewTransitionGroupChildren, + /// + /// view-transition-old + /// + [JsonPropertyName("view-transition-old")] + ViewTransitionOld, + /// + /// view-transition-new + /// + [JsonPropertyName("view-transition-new")] + ViewTransitionNew, + /// + /// placeholder + /// + [JsonPropertyName("placeholder")] + Placeholder, + /// + /// file-selector-button + /// + [JsonPropertyName("file-selector-button")] + FileSelectorButton, + /// + /// details-content + /// + [JsonPropertyName("details-content")] + DetailsContent, + /// + /// picker + /// + [JsonPropertyName("picker")] + Picker, + /// + /// permission-icon + /// + [JsonPropertyName("permission-icon")] + PermissionIcon, + /// + /// overscroll-area-parent + /// + [JsonPropertyName("overscroll-area-parent")] + OverscrollAreaParent + } + + /// + /// Shadow root type. + /// + public enum ShadowRootType + { + /// + /// user-agent + /// + [JsonPropertyName("user-agent")] + UserAgent, + /// + /// open + /// + [JsonPropertyName("open")] + Open, + /// + /// closed + /// + [JsonPropertyName("closed")] + Closed + } + + /// + /// Document compatibility mode. + /// + public enum CompatibilityMode + { + /// + /// QuirksMode + /// + [JsonPropertyName("QuirksMode")] + QuirksMode, + /// + /// LimitedQuirksMode + /// + [JsonPropertyName("LimitedQuirksMode")] + LimitedQuirksMode, + /// + /// NoQuirksMode + /// + [JsonPropertyName("NoQuirksMode")] + NoQuirksMode + } + + /// + /// ContainerSelector physical axes + /// + public enum PhysicalAxes + { + /// + /// Horizontal + /// + [JsonPropertyName("Horizontal")] + Horizontal, + /// + /// Vertical + /// + [JsonPropertyName("Vertical")] + Vertical, + /// + /// Both + /// + [JsonPropertyName("Both")] + Both + } + + /// + /// ContainerSelector logical axes + /// + public enum LogicalAxes + { + /// + /// Inline + /// + [JsonPropertyName("Inline")] + Inline, + /// + /// Block + /// + [JsonPropertyName("Block")] + Block, + /// + /// Both + /// + [JsonPropertyName("Both")] + Both + } + + /// + /// Physical scroll orientation + /// + public enum ScrollOrientation + { + /// + /// horizontal + /// + [JsonPropertyName("horizontal")] + Horizontal, + /// + /// vertical + /// + [JsonPropertyName("vertical")] + Vertical + } + + /// + /// DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. + /// DOMNode is a base node mirror type. + /// + public partial class Node : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend + /// will only push node with given `id` once. It is aware of all requested nodes and will only + /// fire DOM events for nodes known to the client. + /// + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + set; + } + + /// + /// The id of the parent node if any. + /// + [JsonPropertyName("parentId")] + public int? ParentId + { + get; + set; + } + + /// + /// The BackendNodeId for this node. + /// + [JsonPropertyName("backendNodeId")] + public int BackendNodeId + { + get; + set; + } + + /// + /// `Node`'s nodeType. + /// + [JsonPropertyName("nodeType")] + public int NodeType + { + get; + set; + } + + /// + /// `Node`'s nodeName. + /// + [JsonPropertyName("nodeName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeName + { + get; + set; + } + + /// + /// `Node`'s localName. + /// + [JsonPropertyName("localName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LocalName + { + get; + set; + } + + /// + /// `Node`'s nodeValue. + /// + [JsonPropertyName("nodeValue")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeValue + { + get; + set; + } + + /// + /// Child count for `Container` nodes. + /// + [JsonPropertyName("childNodeCount")] + public int? ChildNodeCount + { + get; + set; + } + + /// + /// Child nodes of this node when requested with children. + /// + [JsonPropertyName("children")] + public System.Collections.Generic.IList Children + { + get; + set; + } + + /// + /// Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`. + /// + [JsonPropertyName("attributes")] + public string[] Attributes + { + get; + set; + } + + /// + /// Document URL that `Document` or `FrameOwner` node points to. + /// + [JsonPropertyName("documentURL")] + public string DocumentURL + { + get; + set; + } + + /// + /// Base URL that `Document` or `FrameOwner` node uses for URL completion. + /// + [JsonPropertyName("baseURL")] + public string BaseURL + { + get; + set; + } + + /// + /// `DocumentType`'s publicId. + /// + [JsonPropertyName("publicId")] + public string PublicId + { + get; + set; + } + + /// + /// `DocumentType`'s systemId. + /// + [JsonPropertyName("systemId")] + public string SystemId + { + get; + set; + } + + /// + /// `DocumentType`'s internalSubset. + /// + [JsonPropertyName("internalSubset")] + public string InternalSubset + { + get; + set; + } + + /// + /// `Document`'s XML version in case of XML documents. + /// + [JsonPropertyName("xmlVersion")] + public string XmlVersion + { + get; + set; + } + + /// + /// `Attr`'s name. + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// `Attr`'s value. + /// + [JsonPropertyName("value")] + public string Value + { + get; + set; + } + + /// + /// Pseudo element type for this node. + /// + [JsonPropertyName("pseudoType")] + public CefSharp.DevTools.DOM.PseudoType? PseudoType + { + get; + set; + } + + /// + /// Pseudo element identifier for this node. Only present if there is a + /// valid pseudoType. + /// + [JsonPropertyName("pseudoIdentifier")] + public string PseudoIdentifier + { + get; + set; + } + + /// + /// Shadow root type. + /// + [JsonPropertyName("shadowRootType")] + public CefSharp.DevTools.DOM.ShadowRootType? ShadowRootType + { + get; + set; + } + + /// + /// Frame ID for frame owner elements. + /// + [JsonPropertyName("frameId")] + public string FrameId + { + get; + set; + } + + /// + /// Content document for frame owner elements. + /// + [JsonPropertyName("contentDocument")] + public CefSharp.DevTools.DOM.Node ContentDocument + { + get; + set; + } + + /// + /// Shadow root list for given element host. + /// + [JsonPropertyName("shadowRoots")] + public System.Collections.Generic.IList ShadowRoots + { + get; + set; + } + + /// + /// Content document fragment for template elements. + /// + [JsonPropertyName("templateContent")] + public CefSharp.DevTools.DOM.Node TemplateContent + { + get; + set; + } + + /// + /// Pseudo elements associated with this node. + /// + [JsonPropertyName("pseudoElements")] + public System.Collections.Generic.IList PseudoElements + { + get; + set; + } + + /// + /// Deprecated, as the HTML Imports API has been removed (crbug.com/937746). + /// This property used to return the imported document for the HTMLImport links. + /// The property is always undefined now. + /// + [JsonPropertyName("importedDocument")] + public CefSharp.DevTools.DOM.Node ImportedDocument + { + get; + set; + } + + /// + /// Distributed nodes for given insertion point. + /// + [JsonPropertyName("distributedNodes")] + public System.Collections.Generic.IList DistributedNodes + { + get; + set; + } + + /// + /// Whether the node is SVG. + /// + [JsonPropertyName("isSVG")] + public bool? IsSVG + { + get; + set; + } + + /// + /// CompatibilityMode + /// + [JsonPropertyName("compatibilityMode")] + public CefSharp.DevTools.DOM.CompatibilityMode? CompatibilityMode + { + get; + set; + } + + /// + /// AssignedSlot + /// + [JsonPropertyName("assignedSlot")] + public CefSharp.DevTools.DOM.BackendNode AssignedSlot + { + get; + set; + } + + /// + /// IsScrollable + /// + [JsonPropertyName("isScrollable")] + public bool? IsScrollable + { + get; + set; + } + + /// + /// AffectedByStartingStyles + /// + [JsonPropertyName("affectedByStartingStyles")] + public bool? AffectedByStartingStyles + { + get; + set; + } + + /// + /// AdoptedStyleSheets + /// + [JsonPropertyName("adoptedStyleSheets")] + public string[] AdoptedStyleSheets + { + get; + set; + } + } + + /// + /// A structure to hold the top-level node of a detached tree and an array of its retained descendants. + /// + public partial class DetachedElementInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TreeNode + /// + [JsonPropertyName("treeNode")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Node TreeNode + { + get; + set; + } + + /// + /// RetainedNodeIds + /// + [JsonPropertyName("retainedNodeIds")] + public int[] RetainedNodeIds + { + get; + set; + } + } + + /// + /// A structure holding an RGBA color. + /// + public partial class RGBA : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The red component, in the [0-255] range. + /// + [JsonPropertyName("r")] + public int R + { + get; + set; + } + + /// + /// The green component, in the [0-255] range. + /// + [JsonPropertyName("g")] + public int G + { + get; + set; + } + + /// + /// The blue component, in the [0-255] range. + /// + [JsonPropertyName("b")] + public int B + { + get; + set; + } + + /// + /// The alpha component, in the [0-1] range (default: 1). + /// + [JsonPropertyName("a")] + public double? A + { + get; + set; + } + } + + /// + /// Box model. + /// + public partial class BoxModel : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Content box + /// + [JsonPropertyName("content")] + public double[] Content + { + get; + set; + } + + /// + /// Padding box + /// + [JsonPropertyName("padding")] + public double[] Padding + { + get; + set; + } + + /// + /// Border box + /// + [JsonPropertyName("border")] + public double[] Border + { + get; + set; + } + + /// + /// Margin box + /// + [JsonPropertyName("margin")] + public double[] Margin + { + get; + set; + } + + /// + /// Node width + /// + [JsonPropertyName("width")] + public int Width + { + get; + set; + } + + /// + /// Node height + /// + [JsonPropertyName("height")] + public int Height + { + get; + set; + } + + /// + /// Shape outside coordinates + /// + [JsonPropertyName("shapeOutside")] + public CefSharp.DevTools.DOM.ShapeOutsideInfo ShapeOutside + { + get; + set; + } + } + + /// + /// CSS Shape Outside details. + /// + public partial class ShapeOutsideInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Shape bounds + /// + [JsonPropertyName("bounds")] + public double[] Bounds + { + get; + set; + } + + /// + /// Shape coordinate details + /// + [JsonPropertyName("shape")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public object[] Shape + { + get; + set; + } + + /// + /// Margin shape bounds + /// + [JsonPropertyName("marginShape")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public object[] MarginShape + { + get; + set; + } + } + + /// + /// Rectangle. + /// + public partial class Rect : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X coordinate + /// + [JsonPropertyName("x")] + public double X + { + get; + set; + } + + /// + /// Y coordinate + /// + [JsonPropertyName("y")] + public double Y + { + get; + set; + } + + /// + /// Rectangle width + /// + [JsonPropertyName("width")] + public double Width + { + get; + set; + } + + /// + /// Rectangle height + /// + [JsonPropertyName("height")] + public double Height + { + get; + set; + } + } + + /// + /// CSSComputedStyleProperty + /// + public partial class CSSComputedStyleProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Computed style property name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Computed style property value. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// Fired when `Element`'s attribute is modified. + /// + public class AttributeModifiedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + + /// + /// Attribute name. + /// + [JsonInclude] + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + private set; + } + + /// + /// Attribute value. + /// + [JsonInclude] + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + private set; + } + } + + /// + /// Fired when `Element`'s adoptedStyleSheets are modified. + /// + public class AdoptedStyleSheetsModifiedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + + /// + /// New adoptedStyleSheets array. + /// + [JsonInclude] + [JsonPropertyName("adoptedStyleSheets")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] AdoptedStyleSheets + { + get; + private set; + } + } + + /// + /// Fired when `Element`'s attribute is removed. + /// + public class AttributeRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + + /// + /// A ttribute name. + /// + [JsonInclude] + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + private set; + } + } + + /// + /// Mirrors `DOMCharacterDataModified` event. + /// + public class CharacterDataModifiedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + + /// + /// New text value. + /// + [JsonInclude] + [JsonPropertyName("characterData")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string CharacterData + { + get; + private set; + } + } + + /// + /// Fired when `Container`'s child node count has changed. + /// + public class ChildNodeCountUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + + /// + /// New node count. + /// + [JsonInclude] + [JsonPropertyName("childNodeCount")] + public int ChildNodeCount + { + get; + private set; + } + } + + /// + /// Mirrors `DOMNodeInserted` event. + /// + public class ChildNodeInsertedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node that has changed. + /// + [JsonInclude] + [JsonPropertyName("parentNodeId")] + public int ParentNodeId + { + get; + private set; + } + + /// + /// Id of the previous sibling. + /// + [JsonInclude] + [JsonPropertyName("previousNodeId")] + public int PreviousNodeId + { + get; + private set; + } + + /// + /// Inserted node data. + /// + [JsonInclude] + [JsonPropertyName("node")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Node Node + { + get; + private set; + } + } + + /// + /// Mirrors `DOMNodeRemoved` event. + /// + public class ChildNodeRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Parent id. + /// + [JsonInclude] + [JsonPropertyName("parentNodeId")] + public int ParentNodeId + { + get; + private set; + } + + /// + /// Id of the node that has been removed. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } + + /// + /// Called when distribution is changed. + /// + public class DistributedNodesUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Insertion point where distributed nodes were updated. + /// + [JsonInclude] + [JsonPropertyName("insertionPointId")] + public int InsertionPointId + { + get; + private set; + } + + /// + /// Distributed nodes for given insertion point. + /// + [JsonInclude] + [JsonPropertyName("distributedNodes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList DistributedNodes + { + get; + private set; + } + } + + /// + /// Fired when `Element`'s inline style is modified via a CSS property modification. + /// + public class InlineStyleInvalidatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Ids of the nodes for which the inline styles have been invalidated. + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } + + /// + /// Called when a pseudo element is added to an element. + /// + public class PseudoElementAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Pseudo element's parent element id. + /// + [JsonInclude] + [JsonPropertyName("parentId")] + public int ParentId + { + get; + private set; + } + + /// + /// The added pseudo element. + /// + [JsonInclude] + [JsonPropertyName("pseudoElement")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Node PseudoElement + { + get; + private set; + } + } + + /// + /// Fired when a node's scrollability state changes. + /// + public class ScrollableFlagUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The id of the node. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + + /// + /// If the node is scrollable. + /// + [JsonInclude] + [JsonPropertyName("isScrollable")] + public bool IsScrollable + { + get; + private set; + } + } + + /// + /// Fired when a node's starting styles changes. + /// + public class AffectedByStartingStylesFlagUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The id of the node. + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + + /// + /// If the node has starting styles. + /// + [JsonInclude] + [JsonPropertyName("affectedByStartingStyles")] + public bool AffectedByStartingStyles + { + get; + private set; + } + } + + /// + /// Called when a pseudo element is removed from an element. + /// + public class PseudoElementRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Pseudo element's parent element id. + /// + [JsonInclude] + [JsonPropertyName("parentId")] + public int ParentId + { + get; + private set; + } + + /// + /// The removed pseudo element id. + /// + [JsonInclude] + [JsonPropertyName("pseudoElementId")] + public int PseudoElementId + { + get; + private set; + } + } + + /// + /// Fired when backend wants to provide client with the missing DOM structure. This happens upon + /// most of the calls requesting node ids. + /// + public class SetChildNodesEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Parent node id to populate with children. + /// + [JsonInclude] + [JsonPropertyName("parentId")] + public int ParentId + { + get; + private set; + } + + /// + /// Child nodes array. + /// + [JsonInclude] + [JsonPropertyName("nodes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } + + /// + /// Called when shadow root is popped from the element. + /// + public class ShadowRootPoppedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Host element id. + /// + [JsonInclude] + [JsonPropertyName("hostId")] + public int HostId + { + get; + private set; + } + + /// + /// Shadow root id. + /// + [JsonInclude] + [JsonPropertyName("rootId")] + public int RootId + { + get; + private set; + } + } + + /// + /// Called when shadow root is pushed into the element. + /// + public class ShadowRootPushedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Host element id. + /// + [JsonInclude] + [JsonPropertyName("hostId")] + public int HostId + { + get; + private set; + } + + /// + /// Shadow root. + /// + [JsonInclude] + [JsonPropertyName("root")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Node Root + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOMDebugger +{ + /// + /// DOM breakpoint type. + /// + public enum DOMBreakpointType + { + /// + /// subtree-modified + /// + [JsonPropertyName("subtree-modified")] + SubtreeModified, + /// + /// attribute-modified + /// + [JsonPropertyName("attribute-modified")] + AttributeModified, + /// + /// node-removed + /// + [JsonPropertyName("node-removed")] + NodeRemoved + } + + /// + /// CSP Violation type. + /// + public enum CSPViolationType + { + /// + /// trustedtype-sink-violation + /// + [JsonPropertyName("trustedtype-sink-violation")] + TrustedtypeSinkViolation, + /// + /// trustedtype-policy-violation + /// + [JsonPropertyName("trustedtype-policy-violation")] + TrustedtypePolicyViolation + } + + /// + /// Object event listener. + /// + public partial class EventListener : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `EventListener`'s type. + /// + [JsonPropertyName("type")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Type + { + get; + set; + } + + /// + /// `EventListener`'s useCapture. + /// + [JsonPropertyName("useCapture")] + public bool UseCapture + { + get; + set; + } + + /// + /// `EventListener`'s passive flag. + /// + [JsonPropertyName("passive")] + public bool Passive + { + get; + set; + } + + /// + /// `EventListener`'s once flag. + /// + [JsonPropertyName("once")] + public bool Once + { + get; + set; + } + + /// + /// Script id of the handler code. + /// + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + set; + } + + /// + /// Line number in the script (0-based). + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// Column number in the script (0-based). + /// + [JsonPropertyName("columnNumber")] + public int ColumnNumber + { + get; + set; + } + + /// + /// Event handler function value. + /// + [JsonPropertyName("handler")] + public CefSharp.DevTools.Runtime.RemoteObject Handler + { + get; + set; + } + + /// + /// Event original handler function value. + /// + [JsonPropertyName("originalHandler")] + public CefSharp.DevTools.Runtime.RemoteObject OriginalHandler + { + get; + set; + } + + /// + /// Node the listener is added to (if any). + /// + [JsonPropertyName("backendNodeId")] + public int? BackendNodeId + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.DOMSnapshot +{ + /// + /// A Node in the DOM tree. + /// + public partial class DOMNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// `Node`'s nodeType. + /// + [JsonPropertyName("nodeType")] + public int NodeType + { + get; + set; + } + + /// + /// `Node`'s nodeName. + /// + [JsonPropertyName("nodeName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeName + { + get; + set; + } + + /// + /// `Node`'s nodeValue. + /// + [JsonPropertyName("nodeValue")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeValue + { + get; + set; + } + + /// + /// Only set for textarea elements, contains the text value. + /// + [JsonPropertyName("textValue")] + public string TextValue + { + get; + set; + } + + /// + /// Only set for input elements, contains the input's associated text value. + /// + [JsonPropertyName("inputValue")] + public string InputValue + { + get; + set; + } + + /// + /// Only set for radio and checkbox input elements, indicates if the element has been checked + /// + [JsonPropertyName("inputChecked")] + public bool? InputChecked + { + get; + set; + } + + /// + /// Only set for option elements, indicates if the element has been selected + /// + [JsonPropertyName("optionSelected")] + public bool? OptionSelected + { + get; + set; + } + + /// + /// `Node`'s id, corresponds to DOM.Node.backendNodeId. + /// + [JsonPropertyName("backendNodeId")] + public int BackendNodeId + { + get; + set; + } + + /// + /// The indexes of the node's child nodes in the `domNodes` array returned by `getSnapshot`, if + /// any. + /// + [JsonPropertyName("childNodeIndexes")] + public int[] ChildNodeIndexes + { + get; + set; + } + + /// + /// Attributes of an `Element` node. + /// + [JsonPropertyName("attributes")] + public System.Collections.Generic.IList Attributes + { + get; + set; + } + + /// + /// Indexes of pseudo elements associated with this node in the `domNodes` array returned by + /// `getSnapshot`, if any. + /// + [JsonPropertyName("pseudoElementIndexes")] + public int[] PseudoElementIndexes + { + get; + set; + } + + /// + /// The index of the node's related layout tree node in the `layoutTreeNodes` array returned by + /// `getSnapshot`, if any. + /// + [JsonPropertyName("layoutNodeIndex")] + public int? LayoutNodeIndex + { + get; + set; + } + + /// + /// Document URL that `Document` or `FrameOwner` node points to. + /// + [JsonPropertyName("documentURL")] + public string DocumentURL + { + get; + set; + } + + /// + /// Base URL that `Document` or `FrameOwner` node uses for URL completion. + /// + [JsonPropertyName("baseURL")] + public string BaseURL + { + get; + set; + } + + /// + /// Only set for documents, contains the document's content language. + /// + [JsonPropertyName("contentLanguage")] + public string ContentLanguage + { + get; + set; + } + + /// + /// Only set for documents, contains the document's character set encoding. + /// + [JsonPropertyName("documentEncoding")] + public string DocumentEncoding + { + get; + set; + } + + /// + /// `DocumentType` node's publicId. + /// + [JsonPropertyName("publicId")] + public string PublicId + { + get; + set; + } + + /// + /// `DocumentType` node's systemId. + /// + [JsonPropertyName("systemId")] + public string SystemId + { + get; + set; + } + + /// + /// Frame ID for frame owner elements and also for the document node. + /// + [JsonPropertyName("frameId")] + public string FrameId + { + get; + set; + } + + /// + /// The index of a frame owner element's content document in the `domNodes` array returned by + /// `getSnapshot`, if any. + /// + [JsonPropertyName("contentDocumentIndex")] + public int? ContentDocumentIndex + { + get; + set; + } + + /// + /// Type of a pseudo element node. + /// + [JsonPropertyName("pseudoType")] + public CefSharp.DevTools.DOM.PseudoType? PseudoType + { + get; + set; + } + + /// + /// Shadow root type. + /// + [JsonPropertyName("shadowRootType")] + public CefSharp.DevTools.DOM.ShadowRootType? ShadowRootType + { + get; + set; + } + + /// + /// Whether this DOM node responds to mouse clicks. This includes nodes that have had click + /// event listeners attached via JavaScript as well as anchor tags that naturally navigate when + /// clicked. + /// + [JsonPropertyName("isClickable")] + public bool? IsClickable + { + get; + set; + } + + /// + /// Details of the node's event listeners, if any. + /// + [JsonPropertyName("eventListeners")] + public System.Collections.Generic.IList EventListeners + { + get; + set; + } + + /// + /// The selected url for nodes with a srcset attribute. + /// + [JsonPropertyName("currentSourceURL")] + public string CurrentSourceURL + { + get; + set; + } + + /// + /// The url of the script (if any) that generates this node. + /// + [JsonPropertyName("originURL")] + public string OriginURL + { + get; + set; + } + + /// + /// Scroll offsets, set when this node is a Document. + /// + [JsonPropertyName("scrollOffsetX")] + public double? ScrollOffsetX + { + get; + set; + } + + /// + /// ScrollOffsetY + /// + [JsonPropertyName("scrollOffsetY")] + public double? ScrollOffsetY + { + get; + set; + } + } + + /// + /// Details of post layout rendered text positions. The exact layout should not be regarded as + /// stable and may change between versions. + /// + public partial class InlineTextBox : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The bounding box in document coordinates. Note that scroll offset of the document is ignored. + /// + [JsonPropertyName("boundingBox")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect BoundingBox + { + get; + set; + } + + /// + /// The starting index in characters, for this post layout textbox substring. Characters that + /// would be represented as a surrogate pair in UTF-16 have length 2. + /// + [JsonPropertyName("startCharacterIndex")] + public int StartCharacterIndex + { + get; + set; + } + + /// + /// The number of characters in this post layout textbox substring. Characters that would be + /// represented as a surrogate pair in UTF-16 have length 2. + /// + [JsonPropertyName("numCharacters")] + public int NumCharacters + { + get; + set; + } + } + + /// + /// Details of an element in the DOM tree with a LayoutObject. + /// + public partial class LayoutTreeNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The index of the related DOM node in the `domNodes` array returned by `getSnapshot`. + /// + [JsonPropertyName("domNodeIndex")] + public int DomNodeIndex + { + get; + set; + } + + /// + /// The bounding box in document coordinates. Note that scroll offset of the document is ignored. + /// + [JsonPropertyName("boundingBox")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect BoundingBox + { + get; + set; + } + + /// + /// Contents of the LayoutText, if any. + /// + [JsonPropertyName("layoutText")] + public string LayoutText + { + get; + set; + } + + /// + /// The post-layout inline text nodes, if any. + /// + [JsonPropertyName("inlineTextNodes")] + public System.Collections.Generic.IList InlineTextNodes + { + get; + set; + } + + /// + /// Index into the `computedStyles` array returned by `getSnapshot`. + /// + [JsonPropertyName("styleIndex")] + public int? StyleIndex + { + get; + set; + } + + /// + /// Global paint order index, which is determined by the stacking order of the nodes. Nodes + /// that are painted together will have the same index. Only provided if includePaintOrder in + /// getSnapshot was true. + /// + [JsonPropertyName("paintOrder")] + public int? PaintOrder + { + get; + set; + } + + /// + /// Set to true to indicate the element begins a new stacking context. + /// + [JsonPropertyName("isStackingContext")] + public bool? IsStackingContext + { + get; + set; + } + } + + /// + /// A subset of the full ComputedStyle as defined by the request whitelist. + /// + public partial class ComputedStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name/value pairs of computed style properties. + /// + [JsonPropertyName("properties")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Properties + { + get; + set; + } + } + + /// + /// A name/value pair. + /// + public partial class NameValue : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Attribute/property name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Attribute/property value. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// Data that is only present on rare nodes. + /// + public partial class RareStringData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index + /// + [JsonPropertyName("index")] + public int[] Index + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + public int[] Value + { + get; + set; + } + } + + /// + /// RareBooleanData + /// + public partial class RareBooleanData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index + /// + [JsonPropertyName("index")] + public int[] Index + { + get; + set; + } + } + + /// + /// RareIntegerData + /// + public partial class RareIntegerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index + /// + [JsonPropertyName("index")] + public int[] Index + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + public int[] Value + { + get; + set; + } + } + + /// + /// Document snapshot. + /// + public partial class DocumentSnapshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Document URL that `Document` or `FrameOwner` node points to. + /// + [JsonPropertyName("documentURL")] + public int DocumentURL + { + get; + set; + } + + /// + /// Document title. + /// + [JsonPropertyName("title")] + public int Title + { + get; + set; + } + + /// + /// Base URL that `Document` or `FrameOwner` node uses for URL completion. + /// + [JsonPropertyName("baseURL")] + public int BaseURL + { + get; + set; + } + + /// + /// Contains the document's content language. + /// + [JsonPropertyName("contentLanguage")] + public int ContentLanguage + { + get; + set; + } + + /// + /// Contains the document's character set encoding. + /// + [JsonPropertyName("encodingName")] + public int EncodingName + { + get; + set; + } + + /// + /// `DocumentType` node's publicId. + /// + [JsonPropertyName("publicId")] + public int PublicId + { + get; + set; + } + + /// + /// `DocumentType` node's systemId. + /// + [JsonPropertyName("systemId")] + public int SystemId + { + get; + set; + } + + /// + /// Frame ID for frame owner elements and also for the document node. + /// + [JsonPropertyName("frameId")] + public int FrameId + { + get; + set; + } + + /// + /// A table with dom nodes. + /// + [JsonPropertyName("nodes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOMSnapshot.NodeTreeSnapshot Nodes + { + get; + set; + } + + /// + /// The nodes in the layout tree. + /// + [JsonPropertyName("layout")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOMSnapshot.LayoutTreeSnapshot Layout + { + get; + set; + } + + /// + /// The post-layout inline text nodes. + /// + [JsonPropertyName("textBoxes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOMSnapshot.TextBoxSnapshot TextBoxes + { + get; + set; + } + + /// + /// Horizontal scroll offset. + /// + [JsonPropertyName("scrollOffsetX")] + public double? ScrollOffsetX + { + get; + set; + } + + /// + /// Vertical scroll offset. + /// + [JsonPropertyName("scrollOffsetY")] + public double? ScrollOffsetY + { + get; + set; + } + + /// + /// Document content width. + /// + [JsonPropertyName("contentWidth")] + public double? ContentWidth + { + get; + set; + } + + /// + /// Document content height. + /// + [JsonPropertyName("contentHeight")] + public double? ContentHeight + { + get; + set; + } + } + + /// + /// Table containing nodes. + /// + public partial class NodeTreeSnapshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Parent node index. + /// + [JsonPropertyName("parentIndex")] + public int[] ParentIndex + { + get; + set; + } + + /// + /// `Node`'s nodeType. + /// + [JsonPropertyName("nodeType")] + public int[] NodeType + { + get; + set; + } + + /// + /// Type of the shadow root the `Node` is in. String values are equal to the `ShadowRootType` enum. + /// + [JsonPropertyName("shadowRootType")] + public CefSharp.DevTools.DOMSnapshot.RareStringData ShadowRootType + { + get; + set; + } + + /// + /// `Node`'s nodeName. + /// + [JsonPropertyName("nodeName")] + public int[] NodeName + { + get; + set; + } + + /// + /// `Node`'s nodeValue. + /// + [JsonPropertyName("nodeValue")] + public int[] NodeValue + { + get; + set; + } + + /// + /// `Node`'s id, corresponds to DOM.Node.backendNodeId. + /// + [JsonPropertyName("backendNodeId")] + public int[] BackendNodeId + { + get; + set; + } + + /// + /// Attributes of an `Element` node. Flatten name, value pairs. + /// + [JsonPropertyName("attributes")] + public int[] Attributes + { + get; + set; + } + + /// + /// Only set for textarea elements, contains the text value. + /// + [JsonPropertyName("textValue")] + public CefSharp.DevTools.DOMSnapshot.RareStringData TextValue + { + get; + set; + } + + /// + /// Only set for input elements, contains the input's associated text value. + /// + [JsonPropertyName("inputValue")] + public CefSharp.DevTools.DOMSnapshot.RareStringData InputValue + { + get; + set; + } + + /// + /// Only set for radio and checkbox input elements, indicates if the element has been checked + /// + [JsonPropertyName("inputChecked")] + public CefSharp.DevTools.DOMSnapshot.RareBooleanData InputChecked + { + get; + set; + } + + /// + /// Only set for option elements, indicates if the element has been selected + /// + [JsonPropertyName("optionSelected")] + public CefSharp.DevTools.DOMSnapshot.RareBooleanData OptionSelected + { + get; + set; + } + + /// + /// The index of the document in the list of the snapshot documents. + /// + [JsonPropertyName("contentDocumentIndex")] + public CefSharp.DevTools.DOMSnapshot.RareIntegerData ContentDocumentIndex + { + get; + set; + } + + /// + /// Type of a pseudo element node. + /// + [JsonPropertyName("pseudoType")] + public CefSharp.DevTools.DOMSnapshot.RareStringData PseudoType + { + get; + set; + } + + /// + /// Pseudo element identifier for this node. Only present if there is a + /// valid pseudoType. + /// + [JsonPropertyName("pseudoIdentifier")] + public CefSharp.DevTools.DOMSnapshot.RareStringData PseudoIdentifier + { + get; + set; + } + + /// + /// Whether this DOM node responds to mouse clicks. This includes nodes that have had click + /// event listeners attached via JavaScript as well as anchor tags that naturally navigate when + /// clicked. + /// + [JsonPropertyName("isClickable")] + public CefSharp.DevTools.DOMSnapshot.RareBooleanData IsClickable + { + get; + set; + } + + /// + /// The selected url for nodes with a srcset attribute. + /// + [JsonPropertyName("currentSourceURL")] + public CefSharp.DevTools.DOMSnapshot.RareStringData CurrentSourceURL + { + get; + set; + } + + /// + /// The url of the script (if any) that generates this node. + /// + [JsonPropertyName("originURL")] + public CefSharp.DevTools.DOMSnapshot.RareStringData OriginURL + { + get; + set; + } + } + + /// + /// Table of details of an element in the DOM tree with a LayoutObject. + /// + public partial class LayoutTreeSnapshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index of the corresponding node in the `NodeTreeSnapshot` array returned by `captureSnapshot`. + /// + [JsonPropertyName("nodeIndex")] + public int[] NodeIndex + { + get; + set; + } + + /// + /// Array of indexes specifying computed style strings, filtered according to the `computedStyles` parameter passed to `captureSnapshot`. + /// + [JsonPropertyName("styles")] + public int[] Styles + { + get; + set; + } + + /// + /// The absolute position bounding box. + /// + [JsonPropertyName("bounds")] + public double[] Bounds + { + get; + set; + } + + /// + /// Contents of the LayoutText, if any. + /// + [JsonPropertyName("text")] + public int[] Text + { + get; + set; + } + + /// + /// Stacking context information. + /// + [JsonPropertyName("stackingContexts")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOMSnapshot.RareBooleanData StackingContexts + { + get; + set; + } + + /// + /// Global paint order index, which is determined by the stacking order of the nodes. Nodes + /// that are painted together will have the same index. Only provided if includePaintOrder in + /// captureSnapshot was true. + /// + [JsonPropertyName("paintOrders")] + public int[] PaintOrders + { + get; + set; + } + + /// + /// The offset rect of nodes. Only available when includeDOMRects is set to true + /// + [JsonPropertyName("offsetRects")] + public double[] OffsetRects + { + get; + set; + } + + /// + /// The scroll rect of nodes. Only available when includeDOMRects is set to true + /// + [JsonPropertyName("scrollRects")] + public double[] ScrollRects + { + get; + set; + } + + /// + /// The client rect of nodes. Only available when includeDOMRects is set to true + /// + [JsonPropertyName("clientRects")] + public double[] ClientRects + { + get; + set; + } + + /// + /// The list of background colors that are blended with colors of overlapping elements. + /// + [JsonPropertyName("blendedBackgroundColors")] + public int[] BlendedBackgroundColors + { + get; + set; + } + + /// + /// The list of computed text opacities. + /// + [JsonPropertyName("textColorOpacities")] + public double[] TextColorOpacities + { + get; + set; + } + } + + /// + /// Table of details of the post layout rendered text positions. The exact layout should not be regarded as + /// stable and may change between versions. + /// + public partial class TextBoxSnapshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index of the layout tree node that owns this box collection. + /// + [JsonPropertyName("layoutIndex")] + public int[] LayoutIndex + { + get; + set; + } + + /// + /// The absolute position bounding box. + /// + [JsonPropertyName("bounds")] + public double[] Bounds + { + get; + set; + } + + /// + /// The starting index in characters, for this post layout textbox substring. Characters that + /// would be represented as a surrogate pair in UTF-16 have length 2. + /// + [JsonPropertyName("start")] + public int[] Start + { + get; + set; + } + + /// + /// The number of characters in this post layout textbox substring. Characters that would be + /// represented as a surrogate pair in UTF-16 have length 2. + /// + [JsonPropertyName("length")] + public int[] Length + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.DOMStorage +{ + /// + /// DOM Storage identifier. + /// + public partial class StorageId : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Security origin for the storage. + /// + [JsonPropertyName("securityOrigin")] + public string SecurityOrigin + { + get; + set; + } + + /// + /// Represents a key by which DOM Storage keys its CachedStorageAreas + /// + [JsonPropertyName("storageKey")] + public string StorageKey + { + get; + set; + } + + /// + /// Whether the storage is local storage (not session storage). + /// + [JsonPropertyName("isLocalStorage")] + public bool IsLocalStorage + { + get; + set; + } + } + + /// + /// domStorageItemAdded + /// + public class DomStorageItemAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StorageId + /// + [JsonInclude] + [JsonPropertyName("storageId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOMStorage.StorageId StorageId + { + get; + private set; + } + + /// + /// Key + /// + [JsonInclude] + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Key + { + get; + private set; + } + + /// + /// NewValue + /// + [JsonInclude] + [JsonPropertyName("newValue")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NewValue + { + get; + private set; + } + } + + /// + /// domStorageItemRemoved + /// + public class DomStorageItemRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StorageId + /// + [JsonInclude] + [JsonPropertyName("storageId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOMStorage.StorageId StorageId + { + get; + private set; + } + + /// + /// Key + /// + [JsonInclude] + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Key + { + get; + private set; + } + } + + /// + /// domStorageItemUpdated + /// + public class DomStorageItemUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StorageId + /// + [JsonInclude] + [JsonPropertyName("storageId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOMStorage.StorageId StorageId + { + get; + private set; + } + + /// + /// Key + /// + [JsonInclude] + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Key + { + get; + private set; + } + + /// + /// OldValue + /// + [JsonInclude] + [JsonPropertyName("oldValue")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string OldValue + { + get; + private set; + } + + /// + /// NewValue + /// + [JsonInclude] + [JsonPropertyName("newValue")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NewValue + { + get; + private set; + } + } + + /// + /// domStorageItemsCleared + /// + public class DomStorageItemsClearedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// StorageId + /// + [JsonInclude] + [JsonPropertyName("storageId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOMStorage.StorageId StorageId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DeviceAccess +{ + /// + /// Device information displayed in a user prompt to select a device. + /// + public partial class PromptDevice : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// Display name as it appears in a device request user prompt. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + } + + /// + /// A device request opened a user prompt to select a device. Respond with the + /// selectPrompt or cancelPrompt command. + /// + public class DeviceRequestPromptedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id + /// + [JsonInclude] + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + private set; + } + + /// + /// Devices + /// + [JsonInclude] + [JsonPropertyName("devices")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Devices + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// SafeAreaInsets + /// + public partial class SafeAreaInsets : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Overrides safe-area-inset-top. + /// + [JsonPropertyName("top")] + public int? Top + { + get; + set; + } + + /// + /// Overrides safe-area-max-inset-top. + /// + [JsonPropertyName("topMax")] + public int? TopMax + { + get; + set; + } + + /// + /// Overrides safe-area-inset-left. + /// + [JsonPropertyName("left")] + public int? Left + { + get; + set; + } + + /// + /// Overrides safe-area-max-inset-left. + /// + [JsonPropertyName("leftMax")] + public int? LeftMax + { + get; + set; + } + + /// + /// Overrides safe-area-inset-bottom. + /// + [JsonPropertyName("bottom")] + public int? Bottom + { + get; + set; + } + + /// + /// Overrides safe-area-max-inset-bottom. + /// + [JsonPropertyName("bottomMax")] + public int? BottomMax + { + get; + set; + } + + /// + /// Overrides safe-area-inset-right. + /// + [JsonPropertyName("right")] + public int? Right + { + get; + set; + } + + /// + /// Overrides safe-area-max-inset-right. + /// + [JsonPropertyName("rightMax")] + public int? RightMax + { + get; + set; + } + } + + /// + /// Orientation type. + /// + public enum ScreenOrientationType + { + /// + /// portraitPrimary + /// + [JsonPropertyName("portraitPrimary")] + PortraitPrimary, + /// + /// portraitSecondary + /// + [JsonPropertyName("portraitSecondary")] + PortraitSecondary, + /// + /// landscapePrimary + /// + [JsonPropertyName("landscapePrimary")] + LandscapePrimary, + /// + /// landscapeSecondary + /// + [JsonPropertyName("landscapeSecondary")] + LandscapeSecondary + } + + /// + /// Screen orientation. + /// + public partial class ScreenOrientation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Orientation type. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Emulation.ScreenOrientationType Type + { + get; + set; + } + + /// + /// Orientation angle. + /// + [JsonPropertyName("angle")] + public int Angle + { + get; + set; + } + } + + /// + /// Orientation of a display feature in relation to screen + /// + public enum DisplayFeatureOrientation + { + /// + /// vertical + /// + [JsonPropertyName("vertical")] + Vertical, + /// + /// horizontal + /// + [JsonPropertyName("horizontal")] + Horizontal + } + + /// + /// DisplayFeature + /// + public partial class DisplayFeature : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Orientation of a display feature in relation to screen + /// + [JsonPropertyName("orientation")] + public CefSharp.DevTools.Emulation.DisplayFeatureOrientation Orientation + { + get; + set; + } + + /// + /// The offset from the screen origin in either the x (for vertical + /// orientation) or y (for horizontal orientation) direction. + /// + [JsonPropertyName("offset")] + public int Offset + { + get; + set; + } + + /// + /// A display feature may mask content such that it is not physically + /// displayed - this length along with the offset describes this area. + /// A display feature that only splits content will have a 0 mask_length. + /// + [JsonPropertyName("maskLength")] + public int MaskLength + { + get; + set; + } + } + + /// + /// Current posture of the device + /// + public enum DevicePostureType + { + /// + /// continuous + /// + [JsonPropertyName("continuous")] + Continuous, + /// + /// folded + /// + [JsonPropertyName("folded")] + Folded + } + + /// + /// DevicePosture + /// + public partial class DevicePosture : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Current posture of the device + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Emulation.DevicePostureType Type + { + get; + set; + } + } + + /// + /// MediaFeature + /// + public partial class MediaFeature : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to + /// allow the next delayed task (if any) to run; pause: The virtual time base may not advance; + /// pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending + /// resource fetches. + /// + public enum VirtualTimePolicy + { + /// + /// advance + /// + [JsonPropertyName("advance")] + Advance, + /// + /// pause + /// + [JsonPropertyName("pause")] + Pause, + /// + /// pauseIfNetworkFetchesPending + /// + [JsonPropertyName("pauseIfNetworkFetchesPending")] + PauseIfNetworkFetchesPending + } + + /// + /// Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints + /// + public partial class UserAgentBrandVersion : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Brand + /// + [JsonPropertyName("brand")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Brand + { + get; + set; + } + + /// + /// Version + /// + [JsonPropertyName("version")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Version + { + get; + set; + } + } + + /// + /// Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints + /// Missing optional values will be filled in by the target with what it would normally use. + /// + public partial class UserAgentMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Brands appearing in Sec-CH-UA. + /// + [JsonPropertyName("brands")] + public System.Collections.Generic.IList Brands + { + get; + set; + } + + /// + /// Brands appearing in Sec-CH-UA-Full-Version-List. + /// + [JsonPropertyName("fullVersionList")] + public System.Collections.Generic.IList FullVersionList + { + get; + set; + } + + /// + /// FullVersion + /// + [JsonPropertyName("fullVersion")] + public string FullVersion + { + get; + set; + } + + /// + /// Platform + /// + [JsonPropertyName("platform")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Platform + { + get; + set; + } + + /// + /// PlatformVersion + /// + [JsonPropertyName("platformVersion")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PlatformVersion + { + get; + set; + } + + /// + /// Architecture + /// + [JsonPropertyName("architecture")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Architecture + { + get; + set; + } + + /// + /// Model + /// + [JsonPropertyName("model")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Model + { + get; + set; + } + + /// + /// Mobile + /// + [JsonPropertyName("mobile")] + public bool Mobile + { + get; + set; + } + + /// + /// Bitness + /// + [JsonPropertyName("bitness")] + public string Bitness + { + get; + set; + } + + /// + /// Wow64 + /// + [JsonPropertyName("wow64")] + public bool? Wow64 + { + get; + set; + } + + /// + /// Used to specify User Agent form-factor values. + /// See https://wicg.github.io/ua-client-hints/#sec-ch-ua-form-factors + /// + [JsonPropertyName("formFactors")] + public string[] FormFactors + { + get; + set; + } + } + + /// + /// Used to specify sensor types to emulate. + /// See https://w3c.github.io/sensors/#automation for more information. + /// + public enum SensorType + { + /// + /// absolute-orientation + /// + [JsonPropertyName("absolute-orientation")] + AbsoluteOrientation, + /// + /// accelerometer + /// + [JsonPropertyName("accelerometer")] + Accelerometer, + /// + /// ambient-light + /// + [JsonPropertyName("ambient-light")] + AmbientLight, + /// + /// gravity + /// + [JsonPropertyName("gravity")] + Gravity, + /// + /// gyroscope + /// + [JsonPropertyName("gyroscope")] + Gyroscope, + /// + /// linear-acceleration + /// + [JsonPropertyName("linear-acceleration")] + LinearAcceleration, + /// + /// magnetometer + /// + [JsonPropertyName("magnetometer")] + Magnetometer, + /// + /// relative-orientation + /// + [JsonPropertyName("relative-orientation")] + RelativeOrientation + } + + /// + /// SensorMetadata + /// + public partial class SensorMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Available + /// + [JsonPropertyName("available")] + public bool? Available + { + get; + set; + } + + /// + /// MinimumFrequency + /// + [JsonPropertyName("minimumFrequency")] + public double? MinimumFrequency + { + get; + set; + } + + /// + /// MaximumFrequency + /// + [JsonPropertyName("maximumFrequency")] + public double? MaximumFrequency + { + get; + set; + } + } + + /// + /// SensorReadingSingle + /// + public partial class SensorReadingSingle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Value + /// + [JsonPropertyName("value")] + public double Value + { + get; + set; + } + } + + /// + /// SensorReadingXYZ + /// + public partial class SensorReadingXYZ : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X + /// + [JsonPropertyName("x")] + public double X + { + get; + set; + } + + /// + /// Y + /// + [JsonPropertyName("y")] + public double Y + { + get; + set; + } + + /// + /// Z + /// + [JsonPropertyName("z")] + public double Z + { + get; + set; + } + } + + /// + /// SensorReadingQuaternion + /// + public partial class SensorReadingQuaternion : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X + /// + [JsonPropertyName("x")] + public double X + { + get; + set; + } + + /// + /// Y + /// + [JsonPropertyName("y")] + public double Y + { + get; + set; + } + + /// + /// Z + /// + [JsonPropertyName("z")] + public double Z + { + get; + set; + } + + /// + /// W + /// + [JsonPropertyName("w")] + public double W + { + get; + set; + } + } + + /// + /// SensorReading + /// + public partial class SensorReading : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Single + /// + [JsonPropertyName("single")] + public CefSharp.DevTools.Emulation.SensorReadingSingle Single + { + get; + set; + } + + /// + /// Xyz + /// + [JsonPropertyName("xyz")] + public CefSharp.DevTools.Emulation.SensorReadingXYZ Xyz + { + get; + set; + } + + /// + /// Quaternion + /// + [JsonPropertyName("quaternion")] + public CefSharp.DevTools.Emulation.SensorReadingQuaternion Quaternion + { + get; + set; + } + } + + /// + /// PressureSource + /// + public enum PressureSource + { + /// + /// cpu + /// + [JsonPropertyName("cpu")] + Cpu + } + + /// + /// PressureState + /// + public enum PressureState + { + /// + /// nominal + /// + [JsonPropertyName("nominal")] + Nominal, + /// + /// fair + /// + [JsonPropertyName("fair")] + Fair, + /// + /// serious + /// + [JsonPropertyName("serious")] + Serious, + /// + /// critical + /// + [JsonPropertyName("critical")] + Critical + } + + /// + /// PressureMetadata + /// + public partial class PressureMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Available + /// + [JsonPropertyName("available")] + public bool? Available + { + get; + set; + } + } + + /// + /// WorkAreaInsets + /// + public partial class WorkAreaInsets : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Work area top inset in pixels. Default is 0; + /// + [JsonPropertyName("top")] + public int? Top + { + get; + set; + } + + /// + /// Work area left inset in pixels. Default is 0; + /// + [JsonPropertyName("left")] + public int? Left + { + get; + set; + } + + /// + /// Work area bottom inset in pixels. Default is 0; + /// + [JsonPropertyName("bottom")] + public int? Bottom + { + get; + set; + } + + /// + /// Work area right inset in pixels. Default is 0; + /// + [JsonPropertyName("right")] + public int? Right + { + get; + set; + } + } + + /// + /// Screen information similar to the one returned by window.getScreenDetails() method, + /// see https://w3c.github.io/window-management/#screendetailed. + /// + public partial class ScreenInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Offset of the left edge of the screen. + /// + [JsonPropertyName("left")] + public int Left + { + get; + set; + } + + /// + /// Offset of the top edge of the screen. + /// + [JsonPropertyName("top")] + public int Top + { + get; + set; + } + + /// + /// Width of the screen. + /// + [JsonPropertyName("width")] + public int Width + { + get; + set; + } + + /// + /// Height of the screen. + /// + [JsonPropertyName("height")] + public int Height + { + get; + set; + } + + /// + /// Offset of the left edge of the available screen area. + /// + [JsonPropertyName("availLeft")] + public int AvailLeft + { + get; + set; + } + + /// + /// Offset of the top edge of the available screen area. + /// + [JsonPropertyName("availTop")] + public int AvailTop + { + get; + set; + } + + /// + /// Width of the available screen area. + /// + [JsonPropertyName("availWidth")] + public int AvailWidth + { + get; + set; + } + + /// + /// Height of the available screen area. + /// + [JsonPropertyName("availHeight")] + public int AvailHeight + { + get; + set; + } + + /// + /// Specifies the screen's device pixel ratio. + /// + [JsonPropertyName("devicePixelRatio")] + public double DevicePixelRatio + { + get; + set; + } + + /// + /// Specifies the screen's orientation. + /// + [JsonPropertyName("orientation")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Emulation.ScreenOrientation Orientation + { + get; + set; + } + + /// + /// Specifies the screen's color depth in bits. + /// + [JsonPropertyName("colorDepth")] + public int ColorDepth + { + get; + set; + } + + /// + /// Indicates whether the device has multiple screens. + /// + [JsonPropertyName("isExtended")] + public bool IsExtended + { + get; + set; + } + + /// + /// Indicates whether the screen is internal to the device or external, attached to the device. + /// + [JsonPropertyName("isInternal")] + public bool IsInternal + { + get; + set; + } + + /// + /// Indicates whether the screen is set as the the operating system primary screen. + /// + [JsonPropertyName("isPrimary")] + public bool IsPrimary + { + get; + set; + } + + /// + /// Specifies the descriptive label for the screen. + /// + [JsonPropertyName("label")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Label + { + get; + set; + } + + /// + /// Specifies the unique identifier of the screen. + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + } + + /// + /// Enum of image types that can be disabled. + /// + public enum DisabledImageType + { + /// + /// avif + /// + [JsonPropertyName("avif")] + Avif, + /// + /// webp + /// + [JsonPropertyName("webp")] + Webp + } +} + +namespace CefSharp.DevTools.Extensions +{ + /// + /// Storage areas. + /// + public enum StorageArea + { + /// + /// session + /// + [JsonPropertyName("session")] + Session, + /// + /// local + /// + [JsonPropertyName("local")] + Local, + /// + /// sync + /// + [JsonPropertyName("sync")] + Sync, + /// + /// managed + /// + [JsonPropertyName("managed")] + Managed + } +} + +namespace CefSharp.DevTools.FedCm +{ + /// + /// Whether this is a sign-up or sign-in action for this account, i.e. + /// whether this account has ever been used to sign in to this RP before. + /// + public enum LoginState + { + /// + /// SignIn + /// + [JsonPropertyName("SignIn")] + SignIn, + /// + /// SignUp + /// + [JsonPropertyName("SignUp")] + SignUp + } + + /// + /// The types of FedCM dialogs. + /// + public enum DialogType + { + /// + /// AccountChooser + /// + [JsonPropertyName("AccountChooser")] + AccountChooser, + /// + /// AutoReauthn + /// + [JsonPropertyName("AutoReauthn")] + AutoReauthn, + /// + /// ConfirmIdpLogin + /// + [JsonPropertyName("ConfirmIdpLogin")] + ConfirmIdpLogin, + /// + /// Error + /// + [JsonPropertyName("Error")] + Error + } + + /// + /// The buttons on the FedCM dialog. + /// + public enum DialogButton + { + /// + /// ConfirmIdpLoginContinue + /// + [JsonPropertyName("ConfirmIdpLoginContinue")] + ConfirmIdpLoginContinue, + /// + /// ErrorGotIt + /// + [JsonPropertyName("ErrorGotIt")] + ErrorGotIt, + /// + /// ErrorMoreDetails + /// + [JsonPropertyName("ErrorMoreDetails")] + ErrorMoreDetails + } + + /// + /// The URLs that each account has + /// + public enum AccountUrlType + { + /// + /// TermsOfService + /// + [JsonPropertyName("TermsOfService")] + TermsOfService, + /// + /// PrivacyPolicy + /// + [JsonPropertyName("PrivacyPolicy")] + PrivacyPolicy + } + + /// + /// Corresponds to IdentityRequestAccount + /// + public partial class Account : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// AccountId + /// + [JsonPropertyName("accountId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string AccountId + { + get; + set; + } + + /// + /// Email + /// + [JsonPropertyName("email")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Email + { + get; + set; + } + + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// GivenName + /// + [JsonPropertyName("givenName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string GivenName + { + get; + set; + } + + /// + /// PictureUrl + /// + [JsonPropertyName("pictureUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PictureUrl + { + get; + set; + } + + /// + /// IdpConfigUrl + /// + [JsonPropertyName("idpConfigUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string IdpConfigUrl + { + get; + set; + } + + /// + /// IdpLoginUrl + /// + [JsonPropertyName("idpLoginUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string IdpLoginUrl + { + get; + set; + } + + /// + /// LoginState + /// + [JsonPropertyName("loginState")] + public CefSharp.DevTools.FedCm.LoginState LoginState + { + get; + set; + } + + /// + /// These two are only set if the loginState is signUp + /// + [JsonPropertyName("termsOfServiceUrl")] + public string TermsOfServiceUrl + { + get; + set; + } + + /// + /// PrivacyPolicyUrl + /// + [JsonPropertyName("privacyPolicyUrl")] + public string PrivacyPolicyUrl + { + get; + set; + } + } + + /// + /// dialogShown + /// + public class DialogShownEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// DialogId + /// + [JsonInclude] + [JsonPropertyName("dialogId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DialogId + { + get; + private set; + } + + /// + /// DialogType + /// + [JsonInclude] + [JsonPropertyName("dialogType")] + public CefSharp.DevTools.FedCm.DialogType DialogType + { + get; + private set; + } + + /// + /// Accounts + /// + [JsonInclude] + [JsonPropertyName("accounts")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Accounts + { + get; + private set; + } + + /// + /// These exist primarily so that the caller can verify the + /// RP context was used appropriately. + /// + [JsonInclude] + [JsonPropertyName("title")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Title + { + get; + private set; + } + + /// + /// Subtitle + /// + [JsonInclude] + [JsonPropertyName("subtitle")] + public string Subtitle + { + get; + private set; + } + } + + /// + /// Triggered when a dialog is closed, either by user action, JS abort, + /// or a command below. + /// + public class DialogClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// DialogId + /// + [JsonInclude] + [JsonPropertyName("dialogId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DialogId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Fetch +{ + /// + /// Stages of the request to handle. Request will intercept before the request is + /// sent. Response will intercept after the response is received (but before response + /// body is received). + /// + public enum RequestStage + { + /// + /// Request + /// + [JsonPropertyName("Request")] + Request, + /// + /// Response + /// + [JsonPropertyName("Response")] + Response + } + + /// + /// RequestPattern + /// + public partial class RequestPattern : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is + /// backslash. Omitting is equivalent to `"*"`. + /// + [JsonPropertyName("urlPattern")] + public string UrlPattern + { + get; + set; + } + + /// + /// If set, only requests for matching resource types will be intercepted. + /// + [JsonPropertyName("resourceType")] + public CefSharp.DevTools.Network.ResourceType? ResourceType + { + get; + set; + } + + /// + /// Stage at which to begin intercepting requests. Default is Request. + /// + [JsonPropertyName("requestStage")] + public CefSharp.DevTools.Fetch.RequestStage? RequestStage + { + get; + set; + } + } + + /// + /// Response HTTP header entry + /// + public partial class HeaderEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// Source of the authentication challenge. + /// + public enum AuthChallengeSource + { + /// + /// Server + /// + [JsonPropertyName("Server")] + Server, + /// + /// Proxy + /// + [JsonPropertyName("Proxy")] + Proxy + } + + /// + /// Authorization challenge for HTTP status code 401 or 407. + /// + public partial class AuthChallenge : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source of the authentication challenge. + /// + [JsonPropertyName("source")] + public CefSharp.DevTools.Fetch.AuthChallengeSource? Source + { + get; + set; + } + + /// + /// Origin of the challenger. + /// + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + set; + } + + /// + /// The authentication scheme used, such as basic or digest + /// + [JsonPropertyName("scheme")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Scheme + { + get; + set; + } + + /// + /// The realm of the challenge. May be empty. + /// + [JsonPropertyName("realm")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Realm + { + get; + set; + } + } + + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + public enum AuthChallengeResponseResponse + { + /// + /// Default + /// + [JsonPropertyName("Default")] + Default, + /// + /// CancelAuth + /// + [JsonPropertyName("CancelAuth")] + CancelAuth, + /// + /// ProvideCredentials + /// + [JsonPropertyName("ProvideCredentials")] + ProvideCredentials + } + + /// + /// Response to an AuthChallenge. + /// + public partial class AuthChallengeResponse : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + [JsonPropertyName("response")] + public CefSharp.DevTools.Fetch.AuthChallengeResponseResponse Response + { + get; + set; + } + + /// + /// The username to provide, possibly empty. Should only be set if response is + /// ProvideCredentials. + /// + [JsonPropertyName("username")] + public string Username + { + get; + set; + } + + /// + /// The password to provide, possibly empty. Should only be set if response is + /// ProvideCredentials. + /// + [JsonPropertyName("password")] + public string Password + { + get; + set; + } + } + + /// + /// Issued when the domain is enabled and the request URL matches the + /// specified filter. The request is paused until the client responds + /// with one of continueRequest, failRequest or fulfillRequest. + /// The stage of the request can be determined by presence of responseErrorReason + /// and responseStatusCode -- the request is at the response stage if either + /// of these fields is present and in the request stage otherwise. + /// Redirect responses and subsequent requests are reported similarly to regular + /// responses and requests. Redirect responses may be distinguished by the value + /// of `responseStatusCode` (which is one of 301, 302, 303, 307, 308) along with + /// presence of the `location` header. Requests resulting from a redirect will + /// have `redirectedRequestId` field set. + /// + public class RequestPausedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Each request the page makes will have a unique id. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// The details of the request. + /// + [JsonInclude] + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Request Request + { + get; + private set; + } + + /// + /// The id of the frame that initiated the request. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// How the requested resource will be used. + /// + [JsonInclude] + [JsonPropertyName("resourceType")] + public CefSharp.DevTools.Network.ResourceType ResourceType + { + get; + private set; + } + + /// + /// Response error if intercepted at response stage. + /// + [JsonInclude] + [JsonPropertyName("responseErrorReason")] + public CefSharp.DevTools.Network.ErrorReason? ResponseErrorReason + { + get; + private set; + } + + /// + /// Response code if intercepted at response stage. + /// + [JsonInclude] + [JsonPropertyName("responseStatusCode")] + public int? ResponseStatusCode + { + get; + private set; + } + + /// + /// Response status text if intercepted at response stage. + /// + [JsonInclude] + [JsonPropertyName("responseStatusText")] + public string ResponseStatusText + { + get; + private set; + } + + /// + /// Response headers if intercepted at the response stage. + /// + [JsonInclude] + [JsonPropertyName("responseHeaders")] + public System.Collections.Generic.IList ResponseHeaders + { + get; + private set; + } + + /// + /// If the intercepted request had a corresponding Network.requestWillBeSent event fired for it, + /// then this networkId will be the same as the requestId present in the requestWillBeSent event. + /// + [JsonInclude] + [JsonPropertyName("networkId")] + public string NetworkId + { + get; + private set; + } + + /// + /// If the request is due to a redirect response from the server, the id of the request that + /// has caused the redirect. + /// + [JsonInclude] + [JsonPropertyName("redirectedRequestId")] + public string RedirectedRequestId + { + get; + private set; + } + } + + /// + /// Issued when the domain is enabled with handleAuthRequests set to true. + /// The request is paused until client responds with continueWithAuth. + /// + public class AuthRequiredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Each request the page makes will have a unique id. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// The details of the request. + /// + [JsonInclude] + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Request Request + { + get; + private set; + } + + /// + /// The id of the frame that initiated the request. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// How the requested resource will be used. + /// + [JsonInclude] + [JsonPropertyName("resourceType")] + public CefSharp.DevTools.Network.ResourceType ResourceType + { + get; + private set; + } + + /// + /// Details of the Authorization Challenge encountered. + /// If this is set, client should respond with continueRequest that + /// contains AuthChallengeResponse. + /// + [JsonInclude] + [JsonPropertyName("authChallenge")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Fetch.AuthChallenge AuthChallenge + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.FileSystem +{ + /// + /// File + /// + public partial class File : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Timestamp + /// + [JsonPropertyName("lastModified")] + public double LastModified + { + get; + set; + } + + /// + /// Size in bytes + /// + [JsonPropertyName("size")] + public double Size + { + get; + set; + } + + /// + /// Type + /// + [JsonPropertyName("type")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Type + { + get; + set; + } + } + + /// + /// Directory + /// + public partial class Directory : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// NestedDirectories + /// + [JsonPropertyName("nestedDirectories")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] NestedDirectories + { + get; + set; + } + + /// + /// Files that are directly nested under this directory. + /// + [JsonPropertyName("nestedFiles")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList NestedFiles + { + get; + set; + } + } + + /// + /// BucketFileSystemLocator + /// + public partial class BucketFileSystemLocator : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Storage key + /// + [JsonPropertyName("storageKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StorageKey + { + get; + set; + } + + /// + /// Bucket name. Not passing a `bucketName` will retrieve the default Bucket. (https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#storage_buckets) + /// + [JsonPropertyName("bucketName")] + public string BucketName + { + get; + set; + } + + /// + /// Path to the directory using each path component as an array item. + /// + [JsonPropertyName("pathComponents")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] PathComponents + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.HeadlessExperimental +{ + /// + /// Image compression format (defaults to png). + /// + public enum ScreenshotParamsFormat + { + /// + /// jpeg + /// + [JsonPropertyName("jpeg")] + Jpeg, + /// + /// png + /// + [JsonPropertyName("png")] + Png, + /// + /// webp + /// + [JsonPropertyName("webp")] + Webp + } + + /// + /// Encoding options for a screenshot. + /// + public partial class ScreenshotParams : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Image compression format (defaults to png). + /// + [JsonPropertyName("format")] + public CefSharp.DevTools.HeadlessExperimental.ScreenshotParamsFormat? Format + { + get; + set; + } + + /// + /// Compression quality from range [0..100] (jpeg and webp only). + /// + [JsonPropertyName("quality")] + public int? Quality + { + get; + set; + } + + /// + /// Optimize image encoding for speed, not for resulting size (defaults to false) + /// + [JsonPropertyName("optimizeForSpeed")] + public bool? OptimizeForSpeed + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// Database with an array of object stores. + /// + public partial class DatabaseWithObjectStores : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Database name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Database version (type is not 'integer', as the standard + /// requires the version number to be 'unsigned long long') + /// + [JsonPropertyName("version")] + public double Version + { + get; + set; + } + + /// + /// Object stores in this database. + /// + [JsonPropertyName("objectStores")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList ObjectStores + { + get; + set; + } + } + + /// + /// Object store. + /// + public partial class ObjectStore : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Object store name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Object store key path. + /// + [JsonPropertyName("keyPath")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.IndexedDB.KeyPath KeyPath + { + get; + set; + } + + /// + /// If true, object store has auto increment flag set. + /// + [JsonPropertyName("autoIncrement")] + public bool AutoIncrement + { + get; + set; + } + + /// + /// Indexes in this object store. + /// + [JsonPropertyName("indexes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Indexes + { + get; + set; + } + } + + /// + /// Object store index. + /// + public partial class ObjectStoreIndex : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Index name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Index key path. + /// + [JsonPropertyName("keyPath")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.IndexedDB.KeyPath KeyPath + { + get; + set; + } + + /// + /// If true, index is unique. + /// + [JsonPropertyName("unique")] + public bool Unique + { + get; + set; + } + + /// + /// If true, index allows multiple entries for a key. + /// + [JsonPropertyName("multiEntry")] + public bool MultiEntry + { + get; + set; + } + } + + /// + /// Key type. + /// + public enum KeyType + { + /// + /// number + /// + [JsonPropertyName("number")] + Number, + /// + /// string + /// + [JsonPropertyName("string")] + String, + /// + /// date + /// + [JsonPropertyName("date")] + Date, + /// + /// array + /// + [JsonPropertyName("array")] + Array + } + + /// + /// Key. + /// + public partial class Key : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key type. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.IndexedDB.KeyType Type + { + get; + set; + } + + /// + /// Number value. + /// + [JsonPropertyName("number")] + public double? Number + { + get; + set; + } + + /// + /// String value. + /// + [JsonPropertyName("string")] + public string String + { + get; + set; + } + + /// + /// Date value. + /// + [JsonPropertyName("date")] + public double? Date + { + get; + set; + } + + /// + /// Array value. + /// + [JsonPropertyName("array")] + public System.Collections.Generic.IList Array + { + get; + set; + } + } + + /// + /// Key range. + /// + public partial class KeyRange : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Lower bound. + /// + [JsonPropertyName("lower")] + public CefSharp.DevTools.IndexedDB.Key Lower + { + get; + set; + } + + /// + /// Upper bound. + /// + [JsonPropertyName("upper")] + public CefSharp.DevTools.IndexedDB.Key Upper + { + get; + set; + } + + /// + /// If true lower bound is open. + /// + [JsonPropertyName("lowerOpen")] + public bool LowerOpen + { + get; + set; + } + + /// + /// If true upper bound is open. + /// + [JsonPropertyName("upperOpen")] + public bool UpperOpen + { + get; + set; + } + } + + /// + /// Data entry. + /// + public partial class DataEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key object. + /// + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.RemoteObject Key + { + get; + set; + } + + /// + /// Primary key object. + /// + [JsonPropertyName("primaryKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.RemoteObject PrimaryKey + { + get; + set; + } + + /// + /// Value object. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.RemoteObject Value + { + get; + set; + } + } + + /// + /// Key path type. + /// + public enum KeyPathType + { + /// + /// null + /// + [JsonPropertyName("null")] + Null, + /// + /// string + /// + [JsonPropertyName("string")] + String, + /// + /// array + /// + [JsonPropertyName("array")] + Array + } + + /// + /// Key path. + /// + public partial class KeyPath : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key path type. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.IndexedDB.KeyPathType Type + { + get; + set; + } + + /// + /// String value. + /// + [JsonPropertyName("string")] + public string String + { + get; + set; + } + + /// + /// Array value. + /// + [JsonPropertyName("array")] + public string[] Array + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.Input +{ + /// + /// TouchPoint + /// + public partial class TouchPoint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X coordinate of the event relative to the main frame's viewport in CSS pixels. + /// + [JsonPropertyName("x")] + public double X + { + get; + set; + } + + /// + /// Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to + /// the top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + /// + [JsonPropertyName("y")] + public double Y + { + get; + set; + } + + /// + /// X radius of the touch area (default: 1.0). + /// + [JsonPropertyName("radiusX")] + public double? RadiusX + { + get; + set; + } + + /// + /// Y radius of the touch area (default: 1.0). + /// + [JsonPropertyName("radiusY")] + public double? RadiusY + { + get; + set; + } + + /// + /// Rotation angle (default: 0.0). + /// + [JsonPropertyName("rotationAngle")] + public double? RotationAngle + { + get; + set; + } + + /// + /// Force (default: 1.0). + /// + [JsonPropertyName("force")] + public double? Force + { + get; + set; + } + + /// + /// The normalized tangential pressure, which has a range of [-1,1] (default: 0). + /// + [JsonPropertyName("tangentialPressure")] + public double? TangentialPressure + { + get; + set; + } + + /// + /// The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0) + /// + [JsonPropertyName("tiltX")] + public double? TiltX + { + get; + set; + } + + /// + /// The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0). + /// + [JsonPropertyName("tiltY")] + public double? TiltY + { + get; + set; + } + + /// + /// The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0). + /// + [JsonPropertyName("twist")] + public int? Twist + { + get; + set; + } + + /// + /// Identifier used to track touch sources between events, must be unique within an event. + /// + [JsonPropertyName("id")] + public double? Id + { + get; + set; + } + } + + /// + /// GestureSourceType + /// + public enum GestureSourceType + { + /// + /// default + /// + [JsonPropertyName("default")] + Default, + /// + /// touch + /// + [JsonPropertyName("touch")] + Touch, + /// + /// mouse + /// + [JsonPropertyName("mouse")] + Mouse + } + + /// + /// MouseButton + /// + public enum MouseButton + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// left + /// + [JsonPropertyName("left")] + Left, + /// + /// middle + /// + [JsonPropertyName("middle")] + Middle, + /// + /// right + /// + [JsonPropertyName("right")] + Right, + /// + /// back + /// + [JsonPropertyName("back")] + Back, + /// + /// forward + /// + [JsonPropertyName("forward")] + Forward + } + + /// + /// DragDataItem + /// + public partial class DragDataItem : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Mime type of the dragged data. + /// + [JsonPropertyName("mimeType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string MimeType + { + get; + set; + } + + /// + /// Depending of the value of `mimeType`, it contains the dragged link, + /// text, HTML markup or any other data. + /// + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Data + { + get; + set; + } + + /// + /// Title associated with a link. Only valid when `mimeType` == "text/uri-list". + /// + [JsonPropertyName("title")] + public string Title + { + get; + set; + } + + /// + /// Stores the base URL for the contained markup. Only valid when `mimeType` + /// == "text/html". + /// + [JsonPropertyName("baseURL")] + public string BaseURL + { + get; + set; + } + } + + /// + /// DragData + /// + public partial class DragData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Items + /// + [JsonPropertyName("items")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Items + { + get; + set; + } + + /// + /// List of filenames that should be included when dropping + /// + [JsonPropertyName("files")] + public string[] Files + { + get; + set; + } + + /// + /// Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 + /// + [JsonPropertyName("dragOperationsMask")] + public int DragOperationsMask + { + get; + set; + } + } + + /// + /// Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to + /// restore normal drag and drop behavior. + /// + public class DragInterceptedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Data + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Input.DragData Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Inspector +{ + /// + /// Fired when remote debugging connection is about to be terminated. Contains detach reason. + /// + public class DetachedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The reason why connection has been terminated. + /// + [JsonInclude] + [JsonPropertyName("reason")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Reason + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// Reason for rectangle to force scrolling on the main thread + /// + public enum ScrollRectType + { + /// + /// RepaintsOnScroll + /// + [JsonPropertyName("RepaintsOnScroll")] + RepaintsOnScroll, + /// + /// TouchEventHandler + /// + [JsonPropertyName("TouchEventHandler")] + TouchEventHandler, + /// + /// WheelEventHandler + /// + [JsonPropertyName("WheelEventHandler")] + WheelEventHandler + } + + /// + /// Rectangle where scrolling happens on the main thread. + /// + public partial class ScrollRect : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Rectangle itself. + /// + [JsonPropertyName("rect")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect Rect + { + get; + set; + } + + /// + /// Reason for rectangle to force scrolling on the main thread + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.LayerTree.ScrollRectType Type + { + get; + set; + } + } + + /// + /// Sticky position constraints. + /// + public partial class StickyPositionConstraint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Layout rectangle of the sticky element before being shifted + /// + [JsonPropertyName("stickyBoxRect")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect StickyBoxRect + { + get; + set; + } + + /// + /// Layout rectangle of the containing block of the sticky element + /// + [JsonPropertyName("containingBlockRect")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect ContainingBlockRect + { + get; + set; + } + + /// + /// The nearest sticky layer that shifts the sticky box + /// + [JsonPropertyName("nearestLayerShiftingStickyBox")] + public string NearestLayerShiftingStickyBox + { + get; + set; + } + + /// + /// The nearest sticky layer that shifts the containing block + /// + [JsonPropertyName("nearestLayerShiftingContainingBlock")] + public string NearestLayerShiftingContainingBlock + { + get; + set; + } + } + + /// + /// Serialized fragment of layer picture along with its offset within the layer. + /// + public partial class PictureTile : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Offset from owning layer left boundary + /// + [JsonPropertyName("x")] + public double X + { + get; + set; + } + + /// + /// Offset from owning layer top boundary + /// + [JsonPropertyName("y")] + public double Y + { + get; + set; + } + + /// + /// Base64-encoded snapshot data. + /// + [JsonPropertyName("picture")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Picture + { + get; + set; + } + } + + /// + /// Information about a compositing layer. + /// + public partial class Layer : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The unique id for this layer. + /// + [JsonPropertyName("layerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LayerId + { + get; + set; + } + + /// + /// The id of parent (not present for root). + /// + [JsonPropertyName("parentLayerId")] + public string ParentLayerId + { + get; + set; + } + + /// + /// The backend id for the node associated with this layer. + /// + [JsonPropertyName("backendNodeId")] + public int? BackendNodeId + { + get; + set; + } + + /// + /// Offset from parent layer, X coordinate. + /// + [JsonPropertyName("offsetX")] + public double OffsetX + { + get; + set; + } + + /// + /// Offset from parent layer, Y coordinate. + /// + [JsonPropertyName("offsetY")] + public double OffsetY + { + get; + set; + } + + /// + /// Layer width. + /// + [JsonPropertyName("width")] + public double Width + { + get; + set; + } + + /// + /// Layer height. + /// + [JsonPropertyName("height")] + public double Height + { + get; + set; + } + + /// + /// Transformation matrix for layer, default is identity matrix + /// + [JsonPropertyName("transform")] + public double[] Transform + { + get; + set; + } + + /// + /// Transform anchor point X, absent if no transform specified + /// + [JsonPropertyName("anchorX")] + public double? AnchorX + { + get; + set; + } + + /// + /// Transform anchor point Y, absent if no transform specified + /// + [JsonPropertyName("anchorY")] + public double? AnchorY + { + get; + set; + } + + /// + /// Transform anchor point Z, absent if no transform specified + /// + [JsonPropertyName("anchorZ")] + public double? AnchorZ + { + get; + set; + } + + /// + /// Indicates how many time this layer has painted. + /// + [JsonPropertyName("paintCount")] + public int PaintCount + { + get; + set; + } + + /// + /// Indicates whether this layer hosts any content, rather than being used for + /// transform/scrolling purposes only. + /// + [JsonPropertyName("drawsContent")] + public bool DrawsContent + { + get; + set; + } + + /// + /// Set if layer is not visible. + /// + [JsonPropertyName("invisible")] + public bool? Invisible + { + get; + set; + } + + /// + /// Rectangles scrolling on main thread only. + /// + [JsonPropertyName("scrollRects")] + public System.Collections.Generic.IList ScrollRects + { + get; + set; + } + + /// + /// Sticky position constraint information + /// + [JsonPropertyName("stickyPositionConstraint")] + public CefSharp.DevTools.LayerTree.StickyPositionConstraint StickyPositionConstraint + { + get; + set; + } + } + + /// + /// layerPainted + /// + public class LayerPaintedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The id of the painted layer. + /// + [JsonInclude] + [JsonPropertyName("layerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LayerId + { + get; + private set; + } + + /// + /// Clip rectangle. + /// + [JsonInclude] + [JsonPropertyName("clip")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect Clip + { + get; + private set; + } + } + + /// + /// layerTreeDidChange + /// + public class LayerTreeDidChangeEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Layer tree, absent if not in the compositing mode. + /// + [JsonInclude] + [JsonPropertyName("layers")] + public System.Collections.Generic.IList Layers + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Log +{ + /// + /// Log entry source. + /// + public enum LogEntrySource + { + /// + /// xml + /// + [JsonPropertyName("xml")] + Xml, + /// + /// javascript + /// + [JsonPropertyName("javascript")] + Javascript, + /// + /// network + /// + [JsonPropertyName("network")] + Network, + /// + /// storage + /// + [JsonPropertyName("storage")] + Storage, + /// + /// appcache + /// + [JsonPropertyName("appcache")] + Appcache, + /// + /// rendering + /// + [JsonPropertyName("rendering")] + Rendering, + /// + /// security + /// + [JsonPropertyName("security")] + Security, + /// + /// deprecation + /// + [JsonPropertyName("deprecation")] + Deprecation, + /// + /// worker + /// + [JsonPropertyName("worker")] + Worker, + /// + /// violation + /// + [JsonPropertyName("violation")] + Violation, + /// + /// intervention + /// + [JsonPropertyName("intervention")] + Intervention, + /// + /// recommendation + /// + [JsonPropertyName("recommendation")] + Recommendation, + /// + /// other + /// + [JsonPropertyName("other")] + Other + } + + /// + /// Log entry severity. + /// + public enum LogEntryLevel + { + /// + /// verbose + /// + [JsonPropertyName("verbose")] + Verbose, + /// + /// info + /// + [JsonPropertyName("info")] + Info, + /// + /// warning + /// + [JsonPropertyName("warning")] + Warning, + /// + /// error + /// + [JsonPropertyName("error")] + Error + } + + /// + /// LogEntryCategory + /// + public enum LogEntryCategory + { + /// + /// cors + /// + [JsonPropertyName("cors")] + Cors + } + + /// + /// Log entry. + /// + public partial class LogEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Log entry source. + /// + [JsonPropertyName("source")] + public CefSharp.DevTools.Log.LogEntrySource Source + { + get; + set; + } + + /// + /// Log entry severity. + /// + [JsonPropertyName("level")] + public CefSharp.DevTools.Log.LogEntryLevel Level + { + get; + set; + } + + /// + /// Logged text. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + + /// + /// Category + /// + [JsonPropertyName("category")] + public CefSharp.DevTools.Log.LogEntryCategory? Category + { + get; + set; + } + + /// + /// Timestamp when this entry was added. + /// + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + set; + } + + /// + /// URL of the resource if known. + /// + [JsonPropertyName("url")] + public string Url + { + get; + set; + } + + /// + /// Line number in the resource. + /// + [JsonPropertyName("lineNumber")] + public int? LineNumber + { + get; + set; + } + + /// + /// JavaScript stack trace. + /// + [JsonPropertyName("stackTrace")] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + set; + } + + /// + /// Identifier of the network request associated with this entry. + /// + [JsonPropertyName("networkRequestId")] + public string NetworkRequestId + { + get; + set; + } + + /// + /// Identifier of the worker associated with this entry. + /// + [JsonPropertyName("workerId")] + public string WorkerId + { + get; + set; + } + + /// + /// Call arguments. + /// + [JsonPropertyName("args")] + public System.Collections.Generic.IList Args + { + get; + set; + } + } + + /// + /// Violation type. + /// + public enum ViolationSettingName + { + /// + /// longTask + /// + [JsonPropertyName("longTask")] + LongTask, + /// + /// longLayout + /// + [JsonPropertyName("longLayout")] + LongLayout, + /// + /// blockedEvent + /// + [JsonPropertyName("blockedEvent")] + BlockedEvent, + /// + /// blockedParser + /// + [JsonPropertyName("blockedParser")] + BlockedParser, + /// + /// discouragedAPIUse + /// + [JsonPropertyName("discouragedAPIUse")] + DiscouragedAPIUse, + /// + /// handler + /// + [JsonPropertyName("handler")] + Handler, + /// + /// recurringHandler + /// + [JsonPropertyName("recurringHandler")] + RecurringHandler + } + + /// + /// Violation configuration setting. + /// + public partial class ViolationSetting : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Violation type. + /// + [JsonPropertyName("name")] + public CefSharp.DevTools.Log.ViolationSettingName Name + { + get; + set; + } + + /// + /// Time threshold to trigger upon. + /// + [JsonPropertyName("threshold")] + public double Threshold + { + get; + set; + } + } + + /// + /// Issued when new message was logged. + /// + public class EntryAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The entry. + /// + [JsonInclude] + [JsonPropertyName("entry")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Log.LogEntry Entry + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Media +{ + /// + /// Keep in sync with MediaLogMessageLevel + /// We are currently keeping the message level 'error' separate from the + /// PlayerError type because right now they represent different things, + /// this one being a DVLOG(ERROR) style log message that gets printed + /// based on what log level is selected in the UI, and the other is a + /// representation of a media::PipelineStatus object. Soon however we're + /// going to be moving away from using PipelineStatus for errors and + /// introducing a new error type which should hopefully let us integrate + /// the error log level into the PlayerError type. + /// + public enum PlayerMessageLevel + { + /// + /// error + /// + [JsonPropertyName("error")] + Error, + /// + /// warning + /// + [JsonPropertyName("warning")] + Warning, + /// + /// info + /// + [JsonPropertyName("info")] + Info, + /// + /// debug + /// + [JsonPropertyName("debug")] + Debug + } + + /// + /// Have one type per entry in MediaLogRecord::Type + /// Corresponds to kMessage + /// + public partial class PlayerMessage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Keep in sync with MediaLogMessageLevel + /// We are currently keeping the message level 'error' separate from the + /// PlayerError type because right now they represent different things, + /// this one being a DVLOG(ERROR) style log message that gets printed + /// based on what log level is selected in the UI, and the other is a + /// representation of a media::PipelineStatus object. Soon however we're + /// going to be moving away from using PipelineStatus for errors and + /// introducing a new error type which should hopefully let us integrate + /// the error log level into the PlayerError type. + /// + [JsonPropertyName("level")] + public CefSharp.DevTools.Media.PlayerMessageLevel Level + { + get; + set; + } + + /// + /// Message + /// + [JsonPropertyName("message")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Message + { + get; + set; + } + } + + /// + /// Corresponds to kMediaPropertyChange + /// + public partial class PlayerProperty : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// Corresponds to kMediaEventTriggered + /// + public partial class PlayerEvent : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Timestamp + /// + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// Represents logged source line numbers reported in an error. + /// NOTE: file and line are from chromium c++ implementation code, not js. + /// + public partial class PlayerErrorSourceLocation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// File + /// + [JsonPropertyName("file")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string File + { + get; + set; + } + + /// + /// Line + /// + [JsonPropertyName("line")] + public int Line + { + get; + set; + } + } + + /// + /// Corresponds to kMediaError + /// + public partial class PlayerError : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ErrorType + /// + [JsonPropertyName("errorType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ErrorType + { + get; + set; + } + + /// + /// Code is the numeric enum entry for a specific set of error codes, such + /// as PipelineStatusCodes in media/base/pipeline_status.h + /// + [JsonPropertyName("code")] + public int Code + { + get; + set; + } + + /// + /// A trace of where this error was caused / where it passed through. + /// + [JsonPropertyName("stack")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Stack + { + get; + set; + } + + /// + /// Errors potentially have a root cause error, ie, a DecoderError might be + /// caused by an WindowsError + /// + [JsonPropertyName("cause")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Cause + { + get; + set; + } + + /// + /// Extra data attached to an error, such as an HRESULT, Video Codec, etc. + /// + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public object Data + { + get; + set; + } + } + + /// + /// Player + /// + public partial class Player : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// PlayerId + /// + [JsonPropertyName("playerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PlayerId + { + get; + set; + } + + /// + /// DomNodeId + /// + [JsonPropertyName("domNodeId")] + public int? DomNodeId + { + get; + set; + } + } + + /// + /// This can be called multiple times, and can be used to set / override / + /// remove player properties. A null propValue indicates removal. + /// + public class PlayerPropertiesChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// PlayerId + /// + [JsonInclude] + [JsonPropertyName("playerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PlayerId + { + get; + private set; + } + + /// + /// Properties + /// + [JsonInclude] + [JsonPropertyName("properties")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Properties + { + get; + private set; + } + } + + /// + /// Send events as a list, allowing them to be batched on the browser for less + /// congestion. If batched, events must ALWAYS be in chronological order. + /// + public class PlayerEventsAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// PlayerId + /// + [JsonInclude] + [JsonPropertyName("playerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PlayerId + { + get; + private set; + } + + /// + /// Events + /// + [JsonInclude] + [JsonPropertyName("events")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Events + { + get; + private set; + } + } + + /// + /// Send a list of any messages that need to be delivered. + /// + public class PlayerMessagesLoggedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// PlayerId + /// + [JsonInclude] + [JsonPropertyName("playerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PlayerId + { + get; + private set; + } + + /// + /// Messages + /// + [JsonInclude] + [JsonPropertyName("messages")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Messages + { + get; + private set; + } + } + + /// + /// Send a list of any errors that need to be delivered. + /// + public class PlayerErrorsRaisedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// PlayerId + /// + [JsonInclude] + [JsonPropertyName("playerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PlayerId + { + get; + private set; + } + + /// + /// Errors + /// + [JsonInclude] + [JsonPropertyName("errors")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Errors + { + get; + private set; + } + } + + /// + /// Called whenever a player is created, or when a new agent joins and receives + /// a list of active players. If an agent is restored, it will receive one + /// event for each active player. + /// + public class PlayerCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Player + /// + [JsonInclude] + [JsonPropertyName("player")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Media.Player Player + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// Memory pressure level. + /// + public enum PressureLevel + { + /// + /// moderate + /// + [JsonPropertyName("moderate")] + Moderate, + /// + /// critical + /// + [JsonPropertyName("critical")] + Critical + } + + /// + /// Heap profile sample. + /// + public partial class SamplingProfileNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Size of the sampled allocation. + /// + [JsonPropertyName("size")] + public double Size + { + get; + set; + } + + /// + /// Total bytes attributed to this sample. + /// + [JsonPropertyName("total")] + public double Total + { + get; + set; + } + + /// + /// Execution stack at the point of allocation. + /// + [JsonPropertyName("stack")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Stack + { + get; + set; + } + } + + /// + /// Array of heap profile samples. + /// + public partial class SamplingProfile : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Samples + /// + [JsonPropertyName("samples")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Samples + { + get; + set; + } + + /// + /// Modules + /// + [JsonPropertyName("modules")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Modules + { + get; + set; + } + } + + /// + /// Executable module information + /// + public partial class Module : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of the module. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// UUID of the module. + /// + [JsonPropertyName("uuid")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Uuid + { + get; + set; + } + + /// + /// Base address where the module is loaded into memory. Encoded as a decimal + /// or hexadecimal (0x prefixed) string. + /// + [JsonPropertyName("baseAddress")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BaseAddress + { + get; + set; + } + + /// + /// Size of the module in bytes. + /// + [JsonPropertyName("size")] + public double Size + { + get; + set; + } + } + + /// + /// DOM object counter data. + /// + public partial class DOMCounter : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Object name. Note: object names should be presumed volatile and clients should not expect + /// the returned names to be consistent across runs. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Object count. + /// + [JsonPropertyName("count")] + public int Count + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// Resource type as it was perceived by the rendering engine. + /// + public enum ResourceType + { + /// + /// Document + /// + [JsonPropertyName("Document")] + Document, + /// + /// Stylesheet + /// + [JsonPropertyName("Stylesheet")] + Stylesheet, + /// + /// Image + /// + [JsonPropertyName("Image")] + Image, + /// + /// Media + /// + [JsonPropertyName("Media")] + Media, + /// + /// Font + /// + [JsonPropertyName("Font")] + Font, + /// + /// Script + /// + [JsonPropertyName("Script")] + Script, + /// + /// TextTrack + /// + [JsonPropertyName("TextTrack")] + TextTrack, + /// + /// XHR + /// + [JsonPropertyName("XHR")] + XHR, + /// + /// Fetch + /// + [JsonPropertyName("Fetch")] + Fetch, + /// + /// Prefetch + /// + [JsonPropertyName("Prefetch")] + Prefetch, + /// + /// EventSource + /// + [JsonPropertyName("EventSource")] + EventSource, + /// + /// WebSocket + /// + [JsonPropertyName("WebSocket")] + WebSocket, + /// + /// Manifest + /// + [JsonPropertyName("Manifest")] + Manifest, + /// + /// SignedExchange + /// + [JsonPropertyName("SignedExchange")] + SignedExchange, + /// + /// Ping + /// + [JsonPropertyName("Ping")] + Ping, + /// + /// CSPViolationReport + /// + [JsonPropertyName("CSPViolationReport")] + CSPViolationReport, + /// + /// Preflight + /// + [JsonPropertyName("Preflight")] + Preflight, + /// + /// FedCM + /// + [JsonPropertyName("FedCM")] + FedCM, + /// + /// Other + /// + [JsonPropertyName("Other")] + Other + } + + /// + /// Network level fetch failure reason. + /// + public enum ErrorReason + { + /// + /// Failed + /// + [JsonPropertyName("Failed")] + Failed, + /// + /// Aborted + /// + [JsonPropertyName("Aborted")] + Aborted, + /// + /// TimedOut + /// + [JsonPropertyName("TimedOut")] + TimedOut, + /// + /// AccessDenied + /// + [JsonPropertyName("AccessDenied")] + AccessDenied, + /// + /// ConnectionClosed + /// + [JsonPropertyName("ConnectionClosed")] + ConnectionClosed, + /// + /// ConnectionReset + /// + [JsonPropertyName("ConnectionReset")] + ConnectionReset, + /// + /// ConnectionRefused + /// + [JsonPropertyName("ConnectionRefused")] + ConnectionRefused, + /// + /// ConnectionAborted + /// + [JsonPropertyName("ConnectionAborted")] + ConnectionAborted, + /// + /// ConnectionFailed + /// + [JsonPropertyName("ConnectionFailed")] + ConnectionFailed, + /// + /// NameNotResolved + /// + [JsonPropertyName("NameNotResolved")] + NameNotResolved, + /// + /// InternetDisconnected + /// + [JsonPropertyName("InternetDisconnected")] + InternetDisconnected, + /// + /// AddressUnreachable + /// + [JsonPropertyName("AddressUnreachable")] + AddressUnreachable, + /// + /// BlockedByClient + /// + [JsonPropertyName("BlockedByClient")] + BlockedByClient, + /// + /// BlockedByResponse + /// + [JsonPropertyName("BlockedByResponse")] + BlockedByResponse + } + + /// + /// The underlying connection technology that the browser is supposedly using. + /// + public enum ConnectionType + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// cellular2g + /// + [JsonPropertyName("cellular2g")] + Cellular2g, + /// + /// cellular3g + /// + [JsonPropertyName("cellular3g")] + Cellular3g, + /// + /// cellular4g + /// + [JsonPropertyName("cellular4g")] + Cellular4g, + /// + /// bluetooth + /// + [JsonPropertyName("bluetooth")] + Bluetooth, + /// + /// ethernet + /// + [JsonPropertyName("ethernet")] + Ethernet, + /// + /// wifi + /// + [JsonPropertyName("wifi")] + Wifi, + /// + /// wimax + /// + [JsonPropertyName("wimax")] + Wimax, + /// + /// other + /// + [JsonPropertyName("other")] + Other + } + + /// + /// Represents the cookie's 'SameSite' status: + /// https://tools.ietf.org/html/draft-west-first-party-cookies + /// + public enum CookieSameSite + { + /// + /// Strict + /// + [JsonPropertyName("Strict")] + Strict, + /// + /// Lax + /// + [JsonPropertyName("Lax")] + Lax, + /// + /// None + /// + [JsonPropertyName("None")] + None + } + + /// + /// Represents the cookie's 'Priority' status: + /// https://tools.ietf.org/html/draft-west-cookie-priority-00 + /// + public enum CookiePriority + { + /// + /// Low + /// + [JsonPropertyName("Low")] + Low, + /// + /// Medium + /// + [JsonPropertyName("Medium")] + Medium, + /// + /// High + /// + [JsonPropertyName("High")] + High + } + + /// + /// Represents the source scheme of the origin that originally set the cookie. + /// A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. + /// This is a temporary ability and it will be removed in the future. + /// + public enum CookieSourceScheme + { + /// + /// Unset + /// + [JsonPropertyName("Unset")] + Unset, + /// + /// NonSecure + /// + [JsonPropertyName("NonSecure")] + NonSecure, + /// + /// Secure + /// + [JsonPropertyName("Secure")] + Secure + } + + /// + /// Timing information for the request. + /// + public partial class ResourceTiming : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Timing's requestTime is a baseline in seconds, while the other numbers are ticks in + /// milliseconds relatively to this requestTime. + /// + [JsonPropertyName("requestTime")] + public double RequestTime + { + get; + set; + } + + /// + /// Started resolving proxy. + /// + [JsonPropertyName("proxyStart")] + public double ProxyStart + { + get; + set; + } + + /// + /// Finished resolving proxy. + /// + [JsonPropertyName("proxyEnd")] + public double ProxyEnd + { + get; + set; + } + + /// + /// Started DNS address resolve. + /// + [JsonPropertyName("dnsStart")] + public double DnsStart + { + get; + set; + } + + /// + /// Finished DNS address resolve. + /// + [JsonPropertyName("dnsEnd")] + public double DnsEnd + { + get; + set; + } + + /// + /// Started connecting to the remote host. + /// + [JsonPropertyName("connectStart")] + public double ConnectStart + { + get; + set; + } + + /// + /// Connected to the remote host. + /// + [JsonPropertyName("connectEnd")] + public double ConnectEnd + { + get; + set; + } + + /// + /// Started SSL handshake. + /// + [JsonPropertyName("sslStart")] + public double SslStart + { + get; + set; + } + + /// + /// Finished SSL handshake. + /// + [JsonPropertyName("sslEnd")] + public double SslEnd + { + get; + set; + } + + /// + /// Started running ServiceWorker. + /// + [JsonPropertyName("workerStart")] + public double WorkerStart + { + get; + set; + } + + /// + /// Finished Starting ServiceWorker. + /// + [JsonPropertyName("workerReady")] + public double WorkerReady + { + get; + set; + } + + /// + /// Started fetch event. + /// + [JsonPropertyName("workerFetchStart")] + public double WorkerFetchStart + { + get; + set; + } + + /// + /// Settled fetch event respondWith promise. + /// + [JsonPropertyName("workerRespondWithSettled")] + public double WorkerRespondWithSettled + { + get; + set; + } + + /// + /// Started ServiceWorker static routing source evaluation. + /// + [JsonPropertyName("workerRouterEvaluationStart")] + public double? WorkerRouterEvaluationStart + { + get; + set; + } + + /// + /// Started cache lookup when the source was evaluated to `cache`. + /// + [JsonPropertyName("workerCacheLookupStart")] + public double? WorkerCacheLookupStart + { + get; + set; + } + + /// + /// Started sending request. + /// + [JsonPropertyName("sendStart")] + public double SendStart + { + get; + set; + } + + /// + /// Finished sending request. + /// + [JsonPropertyName("sendEnd")] + public double SendEnd + { + get; + set; + } + + /// + /// Time the server started pushing request. + /// + [JsonPropertyName("pushStart")] + public double PushStart + { + get; + set; + } + + /// + /// Time the server finished pushing request. + /// + [JsonPropertyName("pushEnd")] + public double PushEnd + { + get; + set; + } + + /// + /// Started receiving response headers. + /// + [JsonPropertyName("receiveHeadersStart")] + public double ReceiveHeadersStart + { + get; + set; + } + + /// + /// Finished receiving response headers. + /// + [JsonPropertyName("receiveHeadersEnd")] + public double ReceiveHeadersEnd + { + get; + set; + } + } + + /// + /// Loading priority of a resource request. + /// + public enum ResourcePriority + { + /// + /// VeryLow + /// + [JsonPropertyName("VeryLow")] + VeryLow, + /// + /// Low + /// + [JsonPropertyName("Low")] + Low, + /// + /// Medium + /// + [JsonPropertyName("Medium")] + Medium, + /// + /// High + /// + [JsonPropertyName("High")] + High, + /// + /// VeryHigh + /// + [JsonPropertyName("VeryHigh")] + VeryHigh + } + + /// + /// The render blocking behavior of a resource request. + /// + public enum RenderBlockingBehavior + { + /// + /// Blocking + /// + [JsonPropertyName("Blocking")] + Blocking, + /// + /// InBodyParserBlocking + /// + [JsonPropertyName("InBodyParserBlocking")] + InBodyParserBlocking, + /// + /// NonBlocking + /// + [JsonPropertyName("NonBlocking")] + NonBlocking, + /// + /// NonBlockingDynamic + /// + [JsonPropertyName("NonBlockingDynamic")] + NonBlockingDynamic, + /// + /// PotentiallyBlocking + /// + [JsonPropertyName("PotentiallyBlocking")] + PotentiallyBlocking + } + + /// + /// Post data entry for HTTP request + /// + public partial class PostDataEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Bytes + /// + [JsonPropertyName("bytes")] + public byte[] Bytes + { + get; + set; + } + } + + /// + /// The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/ + /// + public enum RequestReferrerPolicy + { + /// + /// unsafe-url + /// + [JsonPropertyName("unsafe-url")] + UnsafeUrl, + /// + /// no-referrer-when-downgrade + /// + [JsonPropertyName("no-referrer-when-downgrade")] + NoReferrerWhenDowngrade, + /// + /// no-referrer + /// + [JsonPropertyName("no-referrer")] + NoReferrer, + /// + /// origin + /// + [JsonPropertyName("origin")] + Origin, + /// + /// origin-when-cross-origin + /// + [JsonPropertyName("origin-when-cross-origin")] + OriginWhenCrossOrigin, + /// + /// same-origin + /// + [JsonPropertyName("same-origin")] + SameOrigin, + /// + /// strict-origin + /// + [JsonPropertyName("strict-origin")] + StrictOrigin, + /// + /// strict-origin-when-cross-origin + /// + [JsonPropertyName("strict-origin-when-cross-origin")] + StrictOriginWhenCrossOrigin + } + + /// + /// HTTP request data. + /// + public partial class Request : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Request URL (without fragment). + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Fragment of the requested URL starting with hash, if present. + /// + [JsonPropertyName("urlFragment")] + public string UrlFragment + { + get; + set; + } + + /// + /// HTTP request method. + /// + [JsonPropertyName("method")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Method + { + get; + set; + } + + /// + /// HTTP request headers. + /// + [JsonPropertyName("headers")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + + /// + /// HTTP POST request data. + /// Use postDataEntries instead. + /// + [JsonPropertyName("postData")] + public string PostData + { + get; + set; + } + + /// + /// True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long. + /// + [JsonPropertyName("hasPostData")] + public bool? HasPostData + { + get; + set; + } + + /// + /// Request body elements (post data broken into individual entries). + /// + [JsonPropertyName("postDataEntries")] + public System.Collections.Generic.IList PostDataEntries + { + get; + set; + } + + /// + /// The mixed content type of the request. + /// + [JsonPropertyName("mixedContentType")] + public CefSharp.DevTools.Security.MixedContentType? MixedContentType + { + get; + set; + } + + /// + /// Priority of the resource request at the time request is sent. + /// + [JsonPropertyName("initialPriority")] + public CefSharp.DevTools.Network.ResourcePriority InitialPriority + { + get; + set; + } + + /// + /// The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/ + /// + [JsonPropertyName("referrerPolicy")] + public CefSharp.DevTools.Network.RequestReferrerPolicy ReferrerPolicy + { + get; + set; + } + + /// + /// Whether is loaded via link preload. + /// + [JsonPropertyName("isLinkPreload")] + public bool? IsLinkPreload + { + get; + set; + } + + /// + /// Set for requests when the TrustToken API is used. Contains the parameters + /// passed by the developer (e.g. via "fetch") as understood by the backend. + /// + [JsonPropertyName("trustTokenParams")] + public CefSharp.DevTools.Network.TrustTokenParams TrustTokenParams + { + get; + set; + } + + /// + /// True if this resource request is considered to be the 'same site' as the + /// request corresponding to the main frame. + /// + [JsonPropertyName("isSameSite")] + public bool? IsSameSite + { + get; + set; + } + + /// + /// True when the resource request is ad-related. + /// + [JsonPropertyName("isAdRelated")] + public bool? IsAdRelated + { + get; + set; + } + } + + /// + /// Details of a signed certificate timestamp (SCT). + /// + public partial class SignedCertificateTimestamp : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Validation status. + /// + [JsonPropertyName("status")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Status + { + get; + set; + } + + /// + /// Origin. + /// + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + set; + } + + /// + /// Log name / description. + /// + [JsonPropertyName("logDescription")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LogDescription + { + get; + set; + } + + /// + /// Log ID. + /// + [JsonPropertyName("logId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LogId + { + get; + set; + } + + /// + /// Issuance date. Unlike TimeSinceEpoch, this contains the number of + /// milliseconds since January 1, 1970, UTC, not the number of seconds. + /// + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + set; + } + + /// + /// Hash algorithm. + /// + [JsonPropertyName("hashAlgorithm")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string HashAlgorithm + { + get; + set; + } + + /// + /// Signature algorithm. + /// + [JsonPropertyName("signatureAlgorithm")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SignatureAlgorithm + { + get; + set; + } + + /// + /// Signature data. + /// + [JsonPropertyName("signatureData")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SignatureData + { + get; + set; + } + } + + /// + /// Security details about a request. + /// + public partial class SecurityDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Protocol name (e.g. "TLS 1.2" or "QUIC"). + /// + [JsonPropertyName("protocol")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Protocol + { + get; + set; + } + + /// + /// Key Exchange used by the connection, or the empty string if not applicable. + /// + [JsonPropertyName("keyExchange")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string KeyExchange + { + get; + set; + } + + /// + /// (EC)DH group used by the connection, if applicable. + /// + [JsonPropertyName("keyExchangeGroup")] + public string KeyExchangeGroup + { + get; + set; + } + + /// + /// Cipher name. + /// + [JsonPropertyName("cipher")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Cipher + { + get; + set; + } + + /// + /// TLS MAC. Note that AEAD ciphers do not have separate MACs. + /// + [JsonPropertyName("mac")] + public string Mac + { + get; + set; + } + + /// + /// Certificate ID value. + /// + [JsonPropertyName("certificateId")] + public int CertificateId + { + get; + set; + } + + /// + /// Certificate subject name. + /// + [JsonPropertyName("subjectName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SubjectName + { + get; + set; + } + + /// + /// Subject Alternative Name (SAN) DNS names and IP addresses. + /// + [JsonPropertyName("sanList")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] SanList + { + get; + set; + } + + /// + /// Name of the issuing CA. + /// + [JsonPropertyName("issuer")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Issuer + { + get; + set; + } + + /// + /// Certificate valid from date. + /// + [JsonPropertyName("validFrom")] + public double ValidFrom + { + get; + set; + } + + /// + /// Certificate valid to (expiration) date + /// + [JsonPropertyName("validTo")] + public double ValidTo + { + get; + set; + } + + /// + /// List of signed certificate timestamps (SCTs). + /// + [JsonPropertyName("signedCertificateTimestampList")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList SignedCertificateTimestampList + { + get; + set; + } + + /// + /// Whether the request complied with Certificate Transparency policy + /// + [JsonPropertyName("certificateTransparencyCompliance")] + public CefSharp.DevTools.Network.CertificateTransparencyCompliance CertificateTransparencyCompliance + { + get; + set; + } + + /// + /// The signature algorithm used by the server in the TLS server signature, + /// represented as a TLS SignatureScheme code point. Omitted if not + /// applicable or not known. + /// + [JsonPropertyName("serverSignatureAlgorithm")] + public int? ServerSignatureAlgorithm + { + get; + set; + } + + /// + /// Whether the connection used Encrypted ClientHello + /// + [JsonPropertyName("encryptedClientHello")] + public bool EncryptedClientHello + { + get; + set; + } + } + + /// + /// Whether the request complied with Certificate Transparency policy. + /// + public enum CertificateTransparencyCompliance + { + /// + /// unknown + /// + [JsonPropertyName("unknown")] + Unknown, + /// + /// not-compliant + /// + [JsonPropertyName("not-compliant")] + NotCompliant, + /// + /// compliant + /// + [JsonPropertyName("compliant")] + Compliant + } + + /// + /// The reason why request was blocked. + /// + public enum BlockedReason + { + /// + /// other + /// + [JsonPropertyName("other")] + Other, + /// + /// csp + /// + [JsonPropertyName("csp")] + Csp, + /// + /// mixed-content + /// + [JsonPropertyName("mixed-content")] + MixedContent, + /// + /// origin + /// + [JsonPropertyName("origin")] + Origin, + /// + /// inspector + /// + [JsonPropertyName("inspector")] + Inspector, + /// + /// integrity + /// + [JsonPropertyName("integrity")] + Integrity, + /// + /// subresource-filter + /// + [JsonPropertyName("subresource-filter")] + SubresourceFilter, + /// + /// content-type + /// + [JsonPropertyName("content-type")] + ContentType, + /// + /// coep-frame-resource-needs-coep-header + /// + [JsonPropertyName("coep-frame-resource-needs-coep-header")] + CoepFrameResourceNeedsCoepHeader, + /// + /// coop-sandboxed-iframe-cannot-navigate-to-coop-page + /// + [JsonPropertyName("coop-sandboxed-iframe-cannot-navigate-to-coop-page")] + CoopSandboxedIframeCannotNavigateToCoopPage, + /// + /// corp-not-same-origin + /// + [JsonPropertyName("corp-not-same-origin")] + CorpNotSameOrigin, + /// + /// corp-not-same-origin-after-defaulted-to-same-origin-by-coep + /// + [JsonPropertyName("corp-not-same-origin-after-defaulted-to-same-origin-by-coep")] + CorpNotSameOriginAfterDefaultedToSameOriginByCoep, + /// + /// corp-not-same-origin-after-defaulted-to-same-origin-by-dip + /// + [JsonPropertyName("corp-not-same-origin-after-defaulted-to-same-origin-by-dip")] + CorpNotSameOriginAfterDefaultedToSameOriginByDip, + /// + /// corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip + /// + [JsonPropertyName("corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip")] + CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip, + /// + /// corp-not-same-site + /// + [JsonPropertyName("corp-not-same-site")] + CorpNotSameSite, + /// + /// sri-message-signature-mismatch + /// + [JsonPropertyName("sri-message-signature-mismatch")] + SriMessageSignatureMismatch + } + + /// + /// The reason why request was blocked. + /// + public enum CorsError + { + /// + /// DisallowedByMode + /// + [JsonPropertyName("DisallowedByMode")] + DisallowedByMode, + /// + /// InvalidResponse + /// + [JsonPropertyName("InvalidResponse")] + InvalidResponse, + /// + /// WildcardOriginNotAllowed + /// + [JsonPropertyName("WildcardOriginNotAllowed")] + WildcardOriginNotAllowed, + /// + /// MissingAllowOriginHeader + /// + [JsonPropertyName("MissingAllowOriginHeader")] + MissingAllowOriginHeader, + /// + /// MultipleAllowOriginValues + /// + [JsonPropertyName("MultipleAllowOriginValues")] + MultipleAllowOriginValues, + /// + /// InvalidAllowOriginValue + /// + [JsonPropertyName("InvalidAllowOriginValue")] + InvalidAllowOriginValue, + /// + /// AllowOriginMismatch + /// + [JsonPropertyName("AllowOriginMismatch")] + AllowOriginMismatch, + /// + /// InvalidAllowCredentials + /// + [JsonPropertyName("InvalidAllowCredentials")] + InvalidAllowCredentials, + /// + /// CorsDisabledScheme + /// + [JsonPropertyName("CorsDisabledScheme")] + CorsDisabledScheme, + /// + /// PreflightInvalidStatus + /// + [JsonPropertyName("PreflightInvalidStatus")] + PreflightInvalidStatus, + /// + /// PreflightDisallowedRedirect + /// + [JsonPropertyName("PreflightDisallowedRedirect")] + PreflightDisallowedRedirect, + /// + /// PreflightWildcardOriginNotAllowed + /// + [JsonPropertyName("PreflightWildcardOriginNotAllowed")] + PreflightWildcardOriginNotAllowed, + /// + /// PreflightMissingAllowOriginHeader + /// + [JsonPropertyName("PreflightMissingAllowOriginHeader")] + PreflightMissingAllowOriginHeader, + /// + /// PreflightMultipleAllowOriginValues + /// + [JsonPropertyName("PreflightMultipleAllowOriginValues")] + PreflightMultipleAllowOriginValues, + /// + /// PreflightInvalidAllowOriginValue + /// + [JsonPropertyName("PreflightInvalidAllowOriginValue")] + PreflightInvalidAllowOriginValue, + /// + /// PreflightAllowOriginMismatch + /// + [JsonPropertyName("PreflightAllowOriginMismatch")] + PreflightAllowOriginMismatch, + /// + /// PreflightInvalidAllowCredentials + /// + [JsonPropertyName("PreflightInvalidAllowCredentials")] + PreflightInvalidAllowCredentials, + /// + /// PreflightMissingAllowExternal + /// + [JsonPropertyName("PreflightMissingAllowExternal")] + PreflightMissingAllowExternal, + /// + /// PreflightInvalidAllowExternal + /// + [JsonPropertyName("PreflightInvalidAllowExternal")] + PreflightInvalidAllowExternal, + /// + /// InvalidAllowMethodsPreflightResponse + /// + [JsonPropertyName("InvalidAllowMethodsPreflightResponse")] + InvalidAllowMethodsPreflightResponse, + /// + /// InvalidAllowHeadersPreflightResponse + /// + [JsonPropertyName("InvalidAllowHeadersPreflightResponse")] + InvalidAllowHeadersPreflightResponse, + /// + /// MethodDisallowedByPreflightResponse + /// + [JsonPropertyName("MethodDisallowedByPreflightResponse")] + MethodDisallowedByPreflightResponse, + /// + /// HeaderDisallowedByPreflightResponse + /// + [JsonPropertyName("HeaderDisallowedByPreflightResponse")] + HeaderDisallowedByPreflightResponse, + /// + /// RedirectContainsCredentials + /// + [JsonPropertyName("RedirectContainsCredentials")] + RedirectContainsCredentials, + /// + /// InsecureLocalNetwork + /// + [JsonPropertyName("InsecureLocalNetwork")] + InsecureLocalNetwork, + /// + /// InvalidLocalNetworkAccess + /// + [JsonPropertyName("InvalidLocalNetworkAccess")] + InvalidLocalNetworkAccess, + /// + /// NoCorsRedirectModeNotFollow + /// + [JsonPropertyName("NoCorsRedirectModeNotFollow")] + NoCorsRedirectModeNotFollow, + /// + /// LocalNetworkAccessPermissionDenied + /// + [JsonPropertyName("LocalNetworkAccessPermissionDenied")] + LocalNetworkAccessPermissionDenied + } + + /// + /// CorsErrorStatus + /// + public partial class CorsErrorStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CorsError + /// + [JsonPropertyName("corsError")] + public CefSharp.DevTools.Network.CorsError CorsError + { + get; + set; + } + + /// + /// FailedParameter + /// + [JsonPropertyName("failedParameter")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FailedParameter + { + get; + set; + } + } + + /// + /// Source of serviceworker response. + /// + public enum ServiceWorkerResponseSource + { + /// + /// cache-storage + /// + [JsonPropertyName("cache-storage")] + CacheStorage, + /// + /// http-cache + /// + [JsonPropertyName("http-cache")] + HttpCache, + /// + /// fallback-code + /// + [JsonPropertyName("fallback-code")] + FallbackCode, + /// + /// network + /// + [JsonPropertyName("network")] + Network + } + + /// + /// Only set for "token-redemption" operation and determine whether + /// to request a fresh SRR or use a still valid cached SRR. + /// + public enum TrustTokenParamsRefreshPolicy + { + /// + /// UseCached + /// + [JsonPropertyName("UseCached")] + UseCached, + /// + /// Refresh + /// + [JsonPropertyName("Refresh")] + Refresh + } + + /// + /// Determines what type of Trust Token operation is executed and + /// depending on the type, some additional parameters. The values + /// are specified in third_party/blink/renderer/core/fetch/trust_token.idl. + /// + public partial class TrustTokenParams : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Operation + /// + [JsonPropertyName("operation")] + public CefSharp.DevTools.Network.TrustTokenOperationType Operation + { + get; + set; + } + + /// + /// Only set for "token-redemption" operation and determine whether + /// to request a fresh SRR or use a still valid cached SRR. + /// + [JsonPropertyName("refreshPolicy")] + public CefSharp.DevTools.Network.TrustTokenParamsRefreshPolicy RefreshPolicy + { + get; + set; + } + + /// + /// Origins of issuers from whom to request tokens or redemption + /// records. + /// + [JsonPropertyName("issuers")] + public string[] Issuers + { + get; + set; + } + } + + /// + /// TrustTokenOperationType + /// + public enum TrustTokenOperationType + { + /// + /// Issuance + /// + [JsonPropertyName("Issuance")] + Issuance, + /// + /// Redemption + /// + [JsonPropertyName("Redemption")] + Redemption, + /// + /// Signing + /// + [JsonPropertyName("Signing")] + Signing + } + + /// + /// The reason why Chrome uses a specific transport protocol for HTTP semantics. + /// + public enum AlternateProtocolUsage + { + /// + /// alternativeJobWonWithoutRace + /// + [JsonPropertyName("alternativeJobWonWithoutRace")] + AlternativeJobWonWithoutRace, + /// + /// alternativeJobWonRace + /// + [JsonPropertyName("alternativeJobWonRace")] + AlternativeJobWonRace, + /// + /// mainJobWonRace + /// + [JsonPropertyName("mainJobWonRace")] + MainJobWonRace, + /// + /// mappingMissing + /// + [JsonPropertyName("mappingMissing")] + MappingMissing, + /// + /// broken + /// + [JsonPropertyName("broken")] + Broken, + /// + /// dnsAlpnH3JobWonWithoutRace + /// + [JsonPropertyName("dnsAlpnH3JobWonWithoutRace")] + DnsAlpnH3JobWonWithoutRace, + /// + /// dnsAlpnH3JobWonRace + /// + [JsonPropertyName("dnsAlpnH3JobWonRace")] + DnsAlpnH3JobWonRace, + /// + /// unspecifiedReason + /// + [JsonPropertyName("unspecifiedReason")] + UnspecifiedReason + } + + /// + /// Source of service worker router. + /// + public enum ServiceWorkerRouterSource + { + /// + /// network + /// + [JsonPropertyName("network")] + Network, + /// + /// cache + /// + [JsonPropertyName("cache")] + Cache, + /// + /// fetch-event + /// + [JsonPropertyName("fetch-event")] + FetchEvent, + /// + /// race-network-and-fetch-handler + /// + [JsonPropertyName("race-network-and-fetch-handler")] + RaceNetworkAndFetchHandler, + /// + /// race-network-and-cache + /// + [JsonPropertyName("race-network-and-cache")] + RaceNetworkAndCache + } + + /// + /// ServiceWorkerRouterInfo + /// + public partial class ServiceWorkerRouterInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ID of the rule matched. If there is a matched rule, this field will + /// be set, otherwiser no value will be set. + /// + [JsonPropertyName("ruleIdMatched")] + public int? RuleIdMatched + { + get; + set; + } + + /// + /// The router source of the matched rule. If there is a matched rule, this + /// field will be set, otherwise no value will be set. + /// + [JsonPropertyName("matchedSourceType")] + public CefSharp.DevTools.Network.ServiceWorkerRouterSource? MatchedSourceType + { + get; + set; + } + + /// + /// The actual router source used. + /// + [JsonPropertyName("actualSourceType")] + public CefSharp.DevTools.Network.ServiceWorkerRouterSource? ActualSourceType + { + get; + set; + } + } + + /// + /// HTTP response data. + /// + public partial class Response : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Response URL. This URL can be different from CachedResource.url in case of redirect. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// HTTP response status code. + /// + [JsonPropertyName("status")] + public int Status + { + get; + set; + } + + /// + /// HTTP response status text. + /// + [JsonPropertyName("statusText")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StatusText + { + get; + set; + } + + /// + /// HTTP response headers. + /// + [JsonPropertyName("headers")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + + /// + /// HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo. + /// + [JsonPropertyName("headersText")] + public string HeadersText + { + get; + set; + } + + /// + /// Resource mimeType as determined by the browser. + /// + [JsonPropertyName("mimeType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string MimeType + { + get; + set; + } + + /// + /// Resource charset as determined by the browser (if applicable). + /// + [JsonPropertyName("charset")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Charset + { + get; + set; + } + + /// + /// Refined HTTP request headers that were actually transmitted over the network. + /// + [JsonPropertyName("requestHeaders")] + public CefSharp.DevTools.Network.Headers RequestHeaders + { + get; + set; + } + + /// + /// HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo. + /// + [JsonPropertyName("requestHeadersText")] + public string RequestHeadersText + { + get; + set; + } + + /// + /// Specifies whether physical connection was actually reused for this request. + /// + [JsonPropertyName("connectionReused")] + public bool ConnectionReused + { + get; + set; + } + + /// + /// Physical connection id that was actually used for this request. + /// + [JsonPropertyName("connectionId")] + public double ConnectionId + { + get; + set; + } + + /// + /// Remote IP address. + /// + [JsonPropertyName("remoteIPAddress")] + public string RemoteIPAddress + { + get; + set; + } + + /// + /// Remote port. + /// + [JsonPropertyName("remotePort")] + public int? RemotePort + { + get; + set; + } + + /// + /// Specifies that the request was served from the disk cache. + /// + [JsonPropertyName("fromDiskCache")] + public bool? FromDiskCache + { + get; + set; + } + + /// + /// Specifies that the request was served from the ServiceWorker. + /// + [JsonPropertyName("fromServiceWorker")] + public bool? FromServiceWorker + { + get; + set; + } + + /// + /// Specifies that the request was served from the prefetch cache. + /// + [JsonPropertyName("fromPrefetchCache")] + public bool? FromPrefetchCache + { + get; + set; + } + + /// + /// Specifies that the request was served from the prefetch cache. + /// + [JsonPropertyName("fromEarlyHints")] + public bool? FromEarlyHints + { + get; + set; + } + + /// + /// Information about how ServiceWorker Static Router API was used. If this + /// field is set with `matchedSourceType` field, a matching rule is found. + /// If this field is set without `matchedSource`, no matching rule is found. + /// Otherwise, the API is not used. + /// + [JsonPropertyName("serviceWorkerRouterInfo")] + public CefSharp.DevTools.Network.ServiceWorkerRouterInfo ServiceWorkerRouterInfo + { + get; + set; + } + + /// + /// Total number of bytes received for this request so far. + /// + [JsonPropertyName("encodedDataLength")] + public double EncodedDataLength + { + get; + set; + } + + /// + /// Timing information for the given request. + /// + [JsonPropertyName("timing")] + public CefSharp.DevTools.Network.ResourceTiming Timing + { + get; + set; + } + + /// + /// Response source of response from ServiceWorker. + /// + [JsonPropertyName("serviceWorkerResponseSource")] + public CefSharp.DevTools.Network.ServiceWorkerResponseSource? ServiceWorkerResponseSource + { + get; + set; + } + + /// + /// The time at which the returned response was generated. + /// + [JsonPropertyName("responseTime")] + public double? ResponseTime + { + get; + set; + } + + /// + /// Cache Storage Cache Name. + /// + [JsonPropertyName("cacheStorageCacheName")] + public string CacheStorageCacheName + { + get; + set; + } + + /// + /// Protocol used to fetch this request. + /// + [JsonPropertyName("protocol")] + public string Protocol + { + get; + set; + } + + /// + /// The reason why Chrome uses a specific transport protocol for HTTP semantics. + /// + [JsonPropertyName("alternateProtocolUsage")] + public CefSharp.DevTools.Network.AlternateProtocolUsage? AlternateProtocolUsage + { + get; + set; + } + + /// + /// Security state of the request resource. + /// + [JsonPropertyName("securityState")] + public CefSharp.DevTools.Security.SecurityState SecurityState + { + get; + set; + } + + /// + /// Security details for the request. + /// + [JsonPropertyName("securityDetails")] + public CefSharp.DevTools.Network.SecurityDetails SecurityDetails + { + get; + set; + } + } + + /// + /// WebSocket request data. + /// + public partial class WebSocketRequest : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// HTTP request headers. + /// + [JsonPropertyName("headers")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + } + + /// + /// WebSocket response data. + /// + public partial class WebSocketResponse : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// HTTP response status code. + /// + [JsonPropertyName("status")] + public int Status + { + get; + set; + } + + /// + /// HTTP response status text. + /// + [JsonPropertyName("statusText")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StatusText + { + get; + set; + } + + /// + /// HTTP response headers. + /// + [JsonPropertyName("headers")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + + /// + /// HTTP response headers text. + /// + [JsonPropertyName("headersText")] + public string HeadersText + { + get; + set; + } + + /// + /// HTTP request headers. + /// + [JsonPropertyName("requestHeaders")] + public CefSharp.DevTools.Network.Headers RequestHeaders + { + get; + set; + } + + /// + /// HTTP request headers text. + /// + [JsonPropertyName("requestHeadersText")] + public string RequestHeadersText + { + get; + set; + } + } + + /// + /// WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests. + /// + public partial class WebSocketFrame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// WebSocket message opcode. + /// + [JsonPropertyName("opcode")] + public double Opcode + { + get; + set; + } + + /// + /// WebSocket message mask. + /// + [JsonPropertyName("mask")] + public bool Mask + { + get; + set; + } + + /// + /// WebSocket message payload data. + /// If the opcode is 1, this is a text message and payloadData is a UTF-8 string. + /// If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data. + /// + [JsonPropertyName("payloadData")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PayloadData + { + get; + set; + } + } + + /// + /// Information about the cached resource. + /// + public partial class CachedResource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Resource URL. This is the url of the original network request. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Type of this resource. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Network.ResourceType Type + { + get; + set; + } + + /// + /// Cached response data. + /// + [JsonPropertyName("response")] + public CefSharp.DevTools.Network.Response Response + { + get; + set; + } + + /// + /// Cached response body size. + /// + [JsonPropertyName("bodySize")] + public double BodySize + { + get; + set; + } + } + + /// + /// Type of this initiator. + /// + public enum InitiatorType + { + /// + /// parser + /// + [JsonPropertyName("parser")] + Parser, + /// + /// script + /// + [JsonPropertyName("script")] + Script, + /// + /// preload + /// + [JsonPropertyName("preload")] + Preload, + /// + /// SignedExchange + /// + [JsonPropertyName("SignedExchange")] + SignedExchange, + /// + /// preflight + /// + [JsonPropertyName("preflight")] + Preflight, + /// + /// FedCM + /// + [JsonPropertyName("FedCM")] + FedCM, + /// + /// other + /// + [JsonPropertyName("other")] + Other + } + + /// + /// Information about the request initiator. + /// + public partial class Initiator : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type of this initiator. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Network.InitiatorType Type + { + get; + set; + } + + /// + /// Initiator JavaScript stack trace, set for Script only. + /// Requires the Debugger domain to be enabled. + /// + [JsonPropertyName("stack")] + public CefSharp.DevTools.Runtime.StackTrace Stack + { + get; + set; + } + + /// + /// Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type. + /// + [JsonPropertyName("url")] + public string Url + { + get; + set; + } + + /// + /// Initiator line number, set for Parser type or for Script type (when script is importing + /// module) (0-based). + /// + [JsonPropertyName("lineNumber")] + public double? LineNumber + { + get; + set; + } + + /// + /// Initiator column number, set for Parser type or for Script type (when script is importing + /// module) (0-based). + /// + [JsonPropertyName("columnNumber")] + public double? ColumnNumber + { + get; + set; + } + + /// + /// Set if another request triggered this request (e.g. preflight). + /// + [JsonPropertyName("requestId")] + public string RequestId + { + get; + set; + } + } + + /// + /// cookiePartitionKey object + /// The representation of the components of the key that are created by the cookiePartitionKey class contained in net/cookies/cookie_partition_key.h. + /// + public partial class CookiePartitionKey : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The site of the top-level URL the browser was visiting at the start + /// of the request to the endpoint that set the cookie. + /// + [JsonPropertyName("topLevelSite")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TopLevelSite + { + get; + set; + } + + /// + /// Indicates if the cookie has any ancestors that are cross-site to the topLevelSite. + /// + [JsonPropertyName("hasCrossSiteAncestor")] + public bool HasCrossSiteAncestor + { + get; + set; + } + } + + /// + /// Cookie object + /// + public partial class Cookie : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Cookie name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Cookie value. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + + /// + /// Cookie domain. + /// + [JsonPropertyName("domain")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Domain + { + get; + set; + } + + /// + /// Cookie path. + /// + [JsonPropertyName("path")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Path + { + get; + set; + } + + /// + /// Cookie expiration date as the number of seconds since the UNIX epoch. + /// The value is set to -1 if the expiry date is not set. + /// The value can be null for values that cannot be represented in + /// JSON (±Inf). + /// + [JsonPropertyName("expires")] + public double Expires + { + get; + set; + } + + /// + /// Cookie size. + /// + [JsonPropertyName("size")] + public int Size + { + get; + set; + } + + /// + /// True if cookie is http-only. + /// + [JsonPropertyName("httpOnly")] + public bool HttpOnly + { + get; + set; + } + + /// + /// True if cookie is secure. + /// + [JsonPropertyName("secure")] + public bool Secure + { + get; + set; + } + + /// + /// True in case of session cookie. + /// + [JsonPropertyName("session")] + public bool Session + { + get; + set; + } + + /// + /// Cookie SameSite type. + /// + [JsonPropertyName("sameSite")] + public CefSharp.DevTools.Network.CookieSameSite? SameSite + { + get; + set; + } + + /// + /// Cookie Priority + /// + [JsonPropertyName("priority")] + public CefSharp.DevTools.Network.CookiePriority Priority + { + get; + set; + } + + /// + /// Cookie source scheme type. + /// + [JsonPropertyName("sourceScheme")] + public CefSharp.DevTools.Network.CookieSourceScheme SourceScheme + { + get; + set; + } + + /// + /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. + /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. + /// This is a temporary ability and it will be removed in the future. + /// + [JsonPropertyName("sourcePort")] + public int SourcePort + { + get; + set; + } + + /// + /// Cookie partition key. + /// + [JsonPropertyName("partitionKey")] + public CefSharp.DevTools.Network.CookiePartitionKey PartitionKey + { + get; + set; + } + + /// + /// True if cookie partition key is opaque. + /// + [JsonPropertyName("partitionKeyOpaque")] + public bool? PartitionKeyOpaque + { + get; + set; + } + } + + /// + /// Types of reasons why a cookie may not be stored from a response. + /// + public enum SetCookieBlockedReason + { + /// + /// SecureOnly + /// + [JsonPropertyName("SecureOnly")] + SecureOnly, + /// + /// SameSiteStrict + /// + [JsonPropertyName("SameSiteStrict")] + SameSiteStrict, + /// + /// SameSiteLax + /// + [JsonPropertyName("SameSiteLax")] + SameSiteLax, + /// + /// SameSiteUnspecifiedTreatedAsLax + /// + [JsonPropertyName("SameSiteUnspecifiedTreatedAsLax")] + SameSiteUnspecifiedTreatedAsLax, + /// + /// SameSiteNoneInsecure + /// + [JsonPropertyName("SameSiteNoneInsecure")] + SameSiteNoneInsecure, + /// + /// UserPreferences + /// + [JsonPropertyName("UserPreferences")] + UserPreferences, + /// + /// ThirdPartyPhaseout + /// + [JsonPropertyName("ThirdPartyPhaseout")] + ThirdPartyPhaseout, + /// + /// ThirdPartyBlockedInFirstPartySet + /// + [JsonPropertyName("ThirdPartyBlockedInFirstPartySet")] + ThirdPartyBlockedInFirstPartySet, + /// + /// SyntaxError + /// + [JsonPropertyName("SyntaxError")] + SyntaxError, + /// + /// SchemeNotSupported + /// + [JsonPropertyName("SchemeNotSupported")] + SchemeNotSupported, + /// + /// OverwriteSecure + /// + [JsonPropertyName("OverwriteSecure")] + OverwriteSecure, + /// + /// InvalidDomain + /// + [JsonPropertyName("InvalidDomain")] + InvalidDomain, + /// + /// InvalidPrefix + /// + [JsonPropertyName("InvalidPrefix")] + InvalidPrefix, + /// + /// UnknownError + /// + [JsonPropertyName("UnknownError")] + UnknownError, + /// + /// SchemefulSameSiteStrict + /// + [JsonPropertyName("SchemefulSameSiteStrict")] + SchemefulSameSiteStrict, + /// + /// SchemefulSameSiteLax + /// + [JsonPropertyName("SchemefulSameSiteLax")] + SchemefulSameSiteLax, + /// + /// SchemefulSameSiteUnspecifiedTreatedAsLax + /// + [JsonPropertyName("SchemefulSameSiteUnspecifiedTreatedAsLax")] + SchemefulSameSiteUnspecifiedTreatedAsLax, + /// + /// NameValuePairExceedsMaxSize + /// + [JsonPropertyName("NameValuePairExceedsMaxSize")] + NameValuePairExceedsMaxSize, + /// + /// DisallowedCharacter + /// + [JsonPropertyName("DisallowedCharacter")] + DisallowedCharacter, + /// + /// NoCookieContent + /// + [JsonPropertyName("NoCookieContent")] + NoCookieContent + } + + /// + /// Types of reasons why a cookie may not be sent with a request. + /// + public enum CookieBlockedReason + { + /// + /// SecureOnly + /// + [JsonPropertyName("SecureOnly")] + SecureOnly, + /// + /// NotOnPath + /// + [JsonPropertyName("NotOnPath")] + NotOnPath, + /// + /// DomainMismatch + /// + [JsonPropertyName("DomainMismatch")] + DomainMismatch, + /// + /// SameSiteStrict + /// + [JsonPropertyName("SameSiteStrict")] + SameSiteStrict, + /// + /// SameSiteLax + /// + [JsonPropertyName("SameSiteLax")] + SameSiteLax, + /// + /// SameSiteUnspecifiedTreatedAsLax + /// + [JsonPropertyName("SameSiteUnspecifiedTreatedAsLax")] + SameSiteUnspecifiedTreatedAsLax, + /// + /// SameSiteNoneInsecure + /// + [JsonPropertyName("SameSiteNoneInsecure")] + SameSiteNoneInsecure, + /// + /// UserPreferences + /// + [JsonPropertyName("UserPreferences")] + UserPreferences, + /// + /// ThirdPartyPhaseout + /// + [JsonPropertyName("ThirdPartyPhaseout")] + ThirdPartyPhaseout, + /// + /// ThirdPartyBlockedInFirstPartySet + /// + [JsonPropertyName("ThirdPartyBlockedInFirstPartySet")] + ThirdPartyBlockedInFirstPartySet, + /// + /// UnknownError + /// + [JsonPropertyName("UnknownError")] + UnknownError, + /// + /// SchemefulSameSiteStrict + /// + [JsonPropertyName("SchemefulSameSiteStrict")] + SchemefulSameSiteStrict, + /// + /// SchemefulSameSiteLax + /// + [JsonPropertyName("SchemefulSameSiteLax")] + SchemefulSameSiteLax, + /// + /// SchemefulSameSiteUnspecifiedTreatedAsLax + /// + [JsonPropertyName("SchemefulSameSiteUnspecifiedTreatedAsLax")] + SchemefulSameSiteUnspecifiedTreatedAsLax, + /// + /// NameValuePairExceedsMaxSize + /// + [JsonPropertyName("NameValuePairExceedsMaxSize")] + NameValuePairExceedsMaxSize, + /// + /// PortMismatch + /// + [JsonPropertyName("PortMismatch")] + PortMismatch, + /// + /// SchemeMismatch + /// + [JsonPropertyName("SchemeMismatch")] + SchemeMismatch, + /// + /// AnonymousContext + /// + [JsonPropertyName("AnonymousContext")] + AnonymousContext + } + + /// + /// Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request. + /// + public enum CookieExemptionReason + { + /// + /// None + /// + [JsonPropertyName("None")] + None, + /// + /// UserSetting + /// + [JsonPropertyName("UserSetting")] + UserSetting, + /// + /// TPCDMetadata + /// + [JsonPropertyName("TPCDMetadata")] + TPCDMetadata, + /// + /// TPCDDeprecationTrial + /// + [JsonPropertyName("TPCDDeprecationTrial")] + TPCDDeprecationTrial, + /// + /// TopLevelTPCDDeprecationTrial + /// + [JsonPropertyName("TopLevelTPCDDeprecationTrial")] + TopLevelTPCDDeprecationTrial, + /// + /// TPCDHeuristics + /// + [JsonPropertyName("TPCDHeuristics")] + TPCDHeuristics, + /// + /// EnterprisePolicy + /// + [JsonPropertyName("EnterprisePolicy")] + EnterprisePolicy, + /// + /// StorageAccess + /// + [JsonPropertyName("StorageAccess")] + StorageAccess, + /// + /// TopLevelStorageAccess + /// + [JsonPropertyName("TopLevelStorageAccess")] + TopLevelStorageAccess, + /// + /// Scheme + /// + [JsonPropertyName("Scheme")] + Scheme, + /// + /// SameSiteNoneCookiesInSandbox + /// + [JsonPropertyName("SameSiteNoneCookiesInSandbox")] + SameSiteNoneCookiesInSandbox + } + + /// + /// A cookie which was not stored from a response with the corresponding reason. + /// + public partial class BlockedSetCookieWithReason : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The reason(s) this cookie was blocked. + /// + [JsonPropertyName("blockedReasons")] + public CefSharp.DevTools.Network.SetCookieBlockedReason[] BlockedReasons + { + get; + set; + } + + /// + /// The string representing this individual cookie as it would appear in the header. + /// This is not the entire "cookie" or "set-cookie" header which could have multiple cookies. + /// + [JsonPropertyName("cookieLine")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string CookieLine + { + get; + set; + } + + /// + /// The cookie object which represents the cookie which was not stored. It is optional because + /// sometimes complete cookie information is not available, such as in the case of parsing + /// errors. + /// + [JsonPropertyName("cookie")] + public CefSharp.DevTools.Network.Cookie Cookie + { + get; + set; + } + } + + /// + /// A cookie should have been blocked by 3PCD but is exempted and stored from a response with the + /// corresponding reason. A cookie could only have at most one exemption reason. + /// + public partial class ExemptedSetCookieWithReason : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The reason the cookie was exempted. + /// + [JsonPropertyName("exemptionReason")] + public CefSharp.DevTools.Network.CookieExemptionReason ExemptionReason + { + get; + set; + } + + /// + /// The string representing this individual cookie as it would appear in the header. + /// + [JsonPropertyName("cookieLine")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string CookieLine + { + get; + set; + } + + /// + /// The cookie object representing the cookie. + /// + [JsonPropertyName("cookie")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Cookie Cookie + { + get; + set; + } + } + + /// + /// A cookie associated with the request which may or may not be sent with it. + /// Includes the cookies itself and reasons for blocking or exemption. + /// + public partial class AssociatedCookie : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The cookie object representing the cookie which was not sent. + /// + [JsonPropertyName("cookie")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Cookie Cookie + { + get; + set; + } + + /// + /// The reason(s) the cookie was blocked. If empty means the cookie is included. + /// + [JsonPropertyName("blockedReasons")] + public CefSharp.DevTools.Network.CookieBlockedReason[] BlockedReasons + { + get; + set; + } + + /// + /// The reason the cookie should have been blocked by 3PCD but is exempted. A cookie could + /// only have at most one exemption reason. + /// + [JsonPropertyName("exemptionReason")] + public CefSharp.DevTools.Network.CookieExemptionReason? ExemptionReason + { + get; + set; + } + } + + /// + /// Cookie parameter object + /// + public partial class CookieParam : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Cookie name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Cookie value. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + + /// + /// The request-URI to associate with the setting of the cookie. This value can affect the + /// default domain, path, source port, and source scheme values of the created cookie. + /// + [JsonPropertyName("url")] + public string Url + { + get; + set; + } + + /// + /// Cookie domain. + /// + [JsonPropertyName("domain")] + public string Domain + { + get; + set; + } + + /// + /// Cookie path. + /// + [JsonPropertyName("path")] + public string Path + { + get; + set; + } + + /// + /// True if cookie is secure. + /// + [JsonPropertyName("secure")] + public bool? Secure + { + get; + set; + } + + /// + /// True if cookie is http-only. + /// + [JsonPropertyName("httpOnly")] + public bool? HttpOnly + { + get; + set; + } + + /// + /// Cookie SameSite type. + /// + [JsonPropertyName("sameSite")] + public CefSharp.DevTools.Network.CookieSameSite? SameSite + { + get; + set; + } + + /// + /// Cookie expiration date, session cookie if not set + /// + [JsonPropertyName("expires")] + public double? Expires + { + get; + set; + } + + /// + /// Cookie Priority. + /// + [JsonPropertyName("priority")] + public CefSharp.DevTools.Network.CookiePriority? Priority + { + get; + set; + } + + /// + /// Cookie source scheme type. + /// + [JsonPropertyName("sourceScheme")] + public CefSharp.DevTools.Network.CookieSourceScheme? SourceScheme + { + get; + set; + } + + /// + /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. + /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. + /// This is a temporary ability and it will be removed in the future. + /// + [JsonPropertyName("sourcePort")] + public int? SourcePort + { + get; + set; + } + + /// + /// Cookie partition key. If not set, the cookie will be set as not partitioned. + /// + [JsonPropertyName("partitionKey")] + public CefSharp.DevTools.Network.CookiePartitionKey PartitionKey + { + get; + set; + } + } + + /// + /// Source of the authentication challenge. + /// + public enum AuthChallengeSource + { + /// + /// Server + /// + [JsonPropertyName("Server")] + Server, + /// + /// Proxy + /// + [JsonPropertyName("Proxy")] + Proxy + } + + /// + /// Authorization challenge for HTTP status code 401 or 407. + /// + public partial class AuthChallenge : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source of the authentication challenge. + /// + [JsonPropertyName("source")] + public CefSharp.DevTools.Network.AuthChallengeSource? Source + { + get; + set; + } + + /// + /// Origin of the challenger. + /// + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + set; + } + + /// + /// The authentication scheme used, such as basic or digest + /// + [JsonPropertyName("scheme")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Scheme + { + get; + set; + } + + /// + /// The realm of the challenge. May be empty. + /// + [JsonPropertyName("realm")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Realm + { + get; + set; + } + } + + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + public enum AuthChallengeResponseResponse + { + /// + /// Default + /// + [JsonPropertyName("Default")] + Default, + /// + /// CancelAuth + /// + [JsonPropertyName("CancelAuth")] + CancelAuth, + /// + /// ProvideCredentials + /// + [JsonPropertyName("ProvideCredentials")] + ProvideCredentials + } + + /// + /// Response to an AuthChallenge. + /// + public partial class AuthChallengeResponse : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The decision on what to do in response to the authorization challenge. Default means + /// deferring to the default behavior of the net stack, which will likely either the Cancel + /// authentication or display a popup dialog box. + /// + [JsonPropertyName("response")] + public CefSharp.DevTools.Network.AuthChallengeResponseResponse Response + { + get; + set; + } + + /// + /// The username to provide, possibly empty. Should only be set if response is + /// ProvideCredentials. + /// + [JsonPropertyName("username")] + public string Username + { + get; + set; + } + + /// + /// The password to provide, possibly empty. Should only be set if response is + /// ProvideCredentials. + /// + [JsonPropertyName("password")] + public string Password + { + get; + set; + } + } + + /// + /// Stages of the interception to begin intercepting. Request will intercept before the request is + /// sent. Response will intercept after the response is received. + /// + public enum InterceptionStage + { + /// + /// Request + /// + [JsonPropertyName("Request")] + Request, + /// + /// HeadersReceived + /// + [JsonPropertyName("HeadersReceived")] + HeadersReceived + } + + /// + /// Request pattern for interception. + /// + public partial class RequestPattern : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Wildcards (`'*'` -> zero or more, `'?'` -> exactly one) are allowed. Escape character is + /// backslash. Omitting is equivalent to `"*"`. + /// + [JsonPropertyName("urlPattern")] + public string UrlPattern + { + get; + set; + } + + /// + /// If set, only requests for matching resource types will be intercepted. + /// + [JsonPropertyName("resourceType")] + public CefSharp.DevTools.Network.ResourceType? ResourceType + { + get; + set; + } + + /// + /// Stage at which to begin intercepting requests. Default is Request. + /// + [JsonPropertyName("interceptionStage")] + public CefSharp.DevTools.Network.InterceptionStage? InterceptionStage + { + get; + set; + } + } + + /// + /// Information about a signed exchange signature. + /// https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1 + /// + public partial class SignedExchangeSignature : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Signed exchange signature label. + /// + [JsonPropertyName("label")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Label + { + get; + set; + } + + /// + /// The hex string of signed exchange signature. + /// + [JsonPropertyName("signature")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Signature + { + get; + set; + } + + /// + /// Signed exchange signature integrity. + /// + [JsonPropertyName("integrity")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Integrity + { + get; + set; + } + + /// + /// Signed exchange signature cert Url. + /// + [JsonPropertyName("certUrl")] + public string CertUrl + { + get; + set; + } + + /// + /// The hex string of signed exchange signature cert sha256. + /// + [JsonPropertyName("certSha256")] + public string CertSha256 + { + get; + set; + } + + /// + /// Signed exchange signature validity Url. + /// + [JsonPropertyName("validityUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ValidityUrl + { + get; + set; + } + + /// + /// Signed exchange signature date. + /// + [JsonPropertyName("date")] + public int Date + { + get; + set; + } + + /// + /// Signed exchange signature expires. + /// + [JsonPropertyName("expires")] + public int Expires + { + get; + set; + } + + /// + /// The encoded certificates. + /// + [JsonPropertyName("certificates")] + public string[] Certificates + { + get; + set; + } + } + + /// + /// Information about a signed exchange header. + /// https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation + /// + public partial class SignedExchangeHeader : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Signed exchange request URL. + /// + [JsonPropertyName("requestUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestUrl + { + get; + set; + } + + /// + /// Signed exchange response code. + /// + [JsonPropertyName("responseCode")] + public int ResponseCode + { + get; + set; + } + + /// + /// Signed exchange response headers. + /// + [JsonPropertyName("responseHeaders")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Headers ResponseHeaders + { + get; + set; + } + + /// + /// Signed exchange response signature. + /// + [JsonPropertyName("signatures")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Signatures + { + get; + set; + } + + /// + /// Signed exchange header integrity hash in the form of `sha256-<base64-hash-value>`. + /// + [JsonPropertyName("headerIntegrity")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string HeaderIntegrity + { + get; + set; + } + } + + /// + /// Field type for a signed exchange related error. + /// + public enum SignedExchangeErrorField + { + /// + /// signatureSig + /// + [JsonPropertyName("signatureSig")] + SignatureSig, + /// + /// signatureIntegrity + /// + [JsonPropertyName("signatureIntegrity")] + SignatureIntegrity, + /// + /// signatureCertUrl + /// + [JsonPropertyName("signatureCertUrl")] + SignatureCertUrl, + /// + /// signatureCertSha256 + /// + [JsonPropertyName("signatureCertSha256")] + SignatureCertSha256, + /// + /// signatureValidityUrl + /// + [JsonPropertyName("signatureValidityUrl")] + SignatureValidityUrl, + /// + /// signatureTimestamps + /// + [JsonPropertyName("signatureTimestamps")] + SignatureTimestamps + } + + /// + /// Information about a signed exchange response. + /// + public partial class SignedExchangeError : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error message. + /// + [JsonPropertyName("message")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Message + { + get; + set; + } + + /// + /// The index of the signature which caused the error. + /// + [JsonPropertyName("signatureIndex")] + public int? SignatureIndex + { + get; + set; + } + + /// + /// The field which caused the error. + /// + [JsonPropertyName("errorField")] + public CefSharp.DevTools.Network.SignedExchangeErrorField? ErrorField + { + get; + set; + } + } + + /// + /// Information about a signed exchange response. + /// + public partial class SignedExchangeInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The outer response of signed HTTP exchange which was received from network. + /// + [JsonPropertyName("outerResponse")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Response OuterResponse + { + get; + set; + } + + /// + /// Whether network response for the signed exchange was accompanied by + /// extra headers. + /// + [JsonPropertyName("hasExtraInfo")] + public bool HasExtraInfo + { + get; + set; + } + + /// + /// Information about the signed exchange header. + /// + [JsonPropertyName("header")] + public CefSharp.DevTools.Network.SignedExchangeHeader Header + { + get; + set; + } + + /// + /// Security details for the signed exchange header. + /// + [JsonPropertyName("securityDetails")] + public CefSharp.DevTools.Network.SecurityDetails SecurityDetails + { + get; + set; + } + + /// + /// Errors occurred while handling the signed exchange. + /// + [JsonPropertyName("errors")] + public System.Collections.Generic.IList Errors + { + get; + set; + } + } + + /// + /// List of content encodings supported by the backend. + /// + public enum ContentEncoding + { + /// + /// deflate + /// + [JsonPropertyName("deflate")] + Deflate, + /// + /// gzip + /// + [JsonPropertyName("gzip")] + Gzip, + /// + /// br + /// + [JsonPropertyName("br")] + Br, + /// + /// zstd + /// + [JsonPropertyName("zstd")] + Zstd + } + + /// + /// NetworkConditions + /// + public partial class NetworkConditions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string + /// syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are + /// matched (including p2p connections). + /// + [JsonPropertyName("urlPattern")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string UrlPattern + { + get; + set; + } + + /// + /// Minimum latency from request sent to response headers received (ms). + /// + [JsonPropertyName("latency")] + public double Latency + { + get; + set; + } + + /// + /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. + /// + [JsonPropertyName("downloadThroughput")] + public double DownloadThroughput + { + get; + set; + } + + /// + /// Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. + /// + [JsonPropertyName("uploadThroughput")] + public double UploadThroughput + { + get; + set; + } + + /// + /// Connection type if known. + /// + [JsonPropertyName("connectionType")] + public CefSharp.DevTools.Network.ConnectionType? ConnectionType + { + get; + set; + } + + /// + /// WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets. + /// + [JsonPropertyName("packetLoss")] + public double? PacketLoss + { + get; + set; + } + + /// + /// WebRTC packet queue length (packet). 0 removes any queue length limitations. + /// + [JsonPropertyName("packetQueueLength")] + public int? PacketQueueLength + { + get; + set; + } + + /// + /// WebRTC packetReordering feature. + /// + [JsonPropertyName("packetReordering")] + public bool? PacketReordering + { + get; + set; + } + } + + /// + /// BlockPattern + /// + public partial class BlockPattern : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// URL pattern to match. Patterns use the URLPattern constructor string syntax + /// (https://urlpattern.spec.whatwg.org/) and must be absolute. Example: `*://*:*/*.css`. + /// + [JsonPropertyName("urlPattern")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string UrlPattern + { + get; + set; + } + + /// + /// Whether or not to block the pattern. If false, a matching request will not be blocked even if it matches a later + /// `BlockPattern`. + /// + [JsonPropertyName("block")] + public bool Block + { + get; + set; + } + } + + /// + /// DirectSocketDnsQueryType + /// + public enum DirectSocketDnsQueryType + { + /// + /// ipv4 + /// + [JsonPropertyName("ipv4")] + Ipv4, + /// + /// ipv6 + /// + [JsonPropertyName("ipv6")] + Ipv6 + } + + /// + /// DirectTCPSocketOptions + /// + public partial class DirectTCPSocketOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TCP_NODELAY option + /// + [JsonPropertyName("noDelay")] + public bool NoDelay + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonPropertyName("keepAliveDelay")] + public double? KeepAliveDelay + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonPropertyName("sendBufferSize")] + public double? SendBufferSize + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonPropertyName("receiveBufferSize")] + public double? ReceiveBufferSize + { + get; + set; + } + + /// + /// DnsQueryType + /// + [JsonPropertyName("dnsQueryType")] + public CefSharp.DevTools.Network.DirectSocketDnsQueryType? DnsQueryType + { + get; + set; + } + } + + /// + /// DirectUDPSocketOptions + /// + public partial class DirectUDPSocketOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// RemoteAddr + /// + [JsonPropertyName("remoteAddr")] + public string RemoteAddr + { + get; + set; + } + + /// + /// Unsigned int 16. + /// + [JsonPropertyName("remotePort")] + public int? RemotePort + { + get; + set; + } + + /// + /// LocalAddr + /// + [JsonPropertyName("localAddr")] + public string LocalAddr + { + get; + set; + } + + /// + /// Unsigned int 16. + /// + [JsonPropertyName("localPort")] + public int? LocalPort + { + get; + set; + } + + /// + /// DnsQueryType + /// + [JsonPropertyName("dnsQueryType")] + public CefSharp.DevTools.Network.DirectSocketDnsQueryType? DnsQueryType + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonPropertyName("sendBufferSize")] + public double? SendBufferSize + { + get; + set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonPropertyName("receiveBufferSize")] + public double? ReceiveBufferSize + { + get; + set; + } + + /// + /// MulticastLoopback + /// + [JsonPropertyName("multicastLoopback")] + public bool? MulticastLoopback + { + get; + set; + } + + /// + /// Unsigned int 8. + /// + [JsonPropertyName("multicastTimeToLive")] + public int? MulticastTimeToLive + { + get; + set; + } + + /// + /// MulticastAllowAddressSharing + /// + [JsonPropertyName("multicastAllowAddressSharing")] + public bool? MulticastAllowAddressSharing + { + get; + set; + } + } + + /// + /// DirectUDPMessage + /// + public partial class DirectUDPMessage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Data + /// + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + set; + } + + /// + /// Null for connected mode. + /// + [JsonPropertyName("remoteAddr")] + public string RemoteAddr + { + get; + set; + } + + /// + /// Null for connected mode. + /// Expected to be unsigned integer. + /// + [JsonPropertyName("remotePort")] + public int? RemotePort + { + get; + set; + } + } + + /// + /// LocalNetworkAccessRequestPolicy + /// + public enum LocalNetworkAccessRequestPolicy + { + /// + /// Allow + /// + [JsonPropertyName("Allow")] + Allow, + /// + /// BlockFromInsecureToMorePrivate + /// + [JsonPropertyName("BlockFromInsecureToMorePrivate")] + BlockFromInsecureToMorePrivate, + /// + /// WarnFromInsecureToMorePrivate + /// + [JsonPropertyName("WarnFromInsecureToMorePrivate")] + WarnFromInsecureToMorePrivate, + /// + /// PermissionBlock + /// + [JsonPropertyName("PermissionBlock")] + PermissionBlock, + /// + /// PermissionWarn + /// + [JsonPropertyName("PermissionWarn")] + PermissionWarn + } + + /// + /// IPAddressSpace + /// + public enum IPAddressSpace + { + /// + /// Loopback + /// + [JsonPropertyName("Loopback")] + Loopback, + /// + /// Local + /// + [JsonPropertyName("Local")] + Local, + /// + /// Public + /// + [JsonPropertyName("Public")] + Public, + /// + /// Unknown + /// + [JsonPropertyName("Unknown")] + Unknown + } + + /// + /// ConnectTiming + /// + public partial class ConnectTiming : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Timing's requestTime is a baseline in seconds, while the other numbers are ticks in + /// milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for + /// the same request (but not for redirected requests). + /// + [JsonPropertyName("requestTime")] + public double RequestTime + { + get; + set; + } + } + + /// + /// ClientSecurityState + /// + public partial class ClientSecurityState : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// InitiatorIsSecureContext + /// + [JsonPropertyName("initiatorIsSecureContext")] + public bool InitiatorIsSecureContext + { + get; + set; + } + + /// + /// InitiatorIPAddressSpace + /// + [JsonPropertyName("initiatorIPAddressSpace")] + public CefSharp.DevTools.Network.IPAddressSpace InitiatorIPAddressSpace + { + get; + set; + } + + /// + /// LocalNetworkAccessRequestPolicy + /// + [JsonPropertyName("localNetworkAccessRequestPolicy")] + public CefSharp.DevTools.Network.LocalNetworkAccessRequestPolicy LocalNetworkAccessRequestPolicy + { + get; + set; + } + } + + /// + /// CrossOriginOpenerPolicyValue + /// + public enum CrossOriginOpenerPolicyValue + { + /// + /// SameOrigin + /// + [JsonPropertyName("SameOrigin")] + SameOrigin, + /// + /// SameOriginAllowPopups + /// + [JsonPropertyName("SameOriginAllowPopups")] + SameOriginAllowPopups, + /// + /// RestrictProperties + /// + [JsonPropertyName("RestrictProperties")] + RestrictProperties, + /// + /// UnsafeNone + /// + [JsonPropertyName("UnsafeNone")] + UnsafeNone, + /// + /// SameOriginPlusCoep + /// + [JsonPropertyName("SameOriginPlusCoep")] + SameOriginPlusCoep, + /// + /// RestrictPropertiesPlusCoep + /// + [JsonPropertyName("RestrictPropertiesPlusCoep")] + RestrictPropertiesPlusCoep, + /// + /// NoopenerAllowPopups + /// + [JsonPropertyName("NoopenerAllowPopups")] + NoopenerAllowPopups + } + + /// + /// CrossOriginOpenerPolicyStatus + /// + public partial class CrossOriginOpenerPolicyStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Value + /// + [JsonPropertyName("value")] + public CefSharp.DevTools.Network.CrossOriginOpenerPolicyValue Value + { + get; + set; + } + + /// + /// ReportOnlyValue + /// + [JsonPropertyName("reportOnlyValue")] + public CefSharp.DevTools.Network.CrossOriginOpenerPolicyValue ReportOnlyValue + { + get; + set; + } + + /// + /// ReportingEndpoint + /// + [JsonPropertyName("reportingEndpoint")] + public string ReportingEndpoint + { + get; + set; + } + + /// + /// ReportOnlyReportingEndpoint + /// + [JsonPropertyName("reportOnlyReportingEndpoint")] + public string ReportOnlyReportingEndpoint + { + get; + set; + } + } + + /// + /// CrossOriginEmbedderPolicyValue + /// + public enum CrossOriginEmbedderPolicyValue + { + /// + /// None + /// + [JsonPropertyName("None")] + None, + /// + /// Credentialless + /// + [JsonPropertyName("Credentialless")] + Credentialless, + /// + /// RequireCorp + /// + [JsonPropertyName("RequireCorp")] + RequireCorp + } + + /// + /// CrossOriginEmbedderPolicyStatus + /// + public partial class CrossOriginEmbedderPolicyStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Value + /// + [JsonPropertyName("value")] + public CefSharp.DevTools.Network.CrossOriginEmbedderPolicyValue Value + { + get; + set; + } + + /// + /// ReportOnlyValue + /// + [JsonPropertyName("reportOnlyValue")] + public CefSharp.DevTools.Network.CrossOriginEmbedderPolicyValue ReportOnlyValue + { + get; + set; + } + + /// + /// ReportingEndpoint + /// + [JsonPropertyName("reportingEndpoint")] + public string ReportingEndpoint + { + get; + set; + } + + /// + /// ReportOnlyReportingEndpoint + /// + [JsonPropertyName("reportOnlyReportingEndpoint")] + public string ReportOnlyReportingEndpoint + { + get; + set; + } + } + + /// + /// ContentSecurityPolicySource + /// + public enum ContentSecurityPolicySource + { + /// + /// HTTP + /// + [JsonPropertyName("HTTP")] + HTTP, + /// + /// Meta + /// + [JsonPropertyName("Meta")] + Meta + } + + /// + /// ContentSecurityPolicyStatus + /// + public partial class ContentSecurityPolicyStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// EffectiveDirectives + /// + [JsonPropertyName("effectiveDirectives")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string EffectiveDirectives + { + get; + set; + } + + /// + /// IsEnforced + /// + [JsonPropertyName("isEnforced")] + public bool IsEnforced + { + get; + set; + } + + /// + /// Source + /// + [JsonPropertyName("source")] + public CefSharp.DevTools.Network.ContentSecurityPolicySource Source + { + get; + set; + } + } + + /// + /// SecurityIsolationStatus + /// + public partial class SecurityIsolationStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Coop + /// + [JsonPropertyName("coop")] + public CefSharp.DevTools.Network.CrossOriginOpenerPolicyStatus Coop + { + get; + set; + } + + /// + /// Coep + /// + [JsonPropertyName("coep")] + public CefSharp.DevTools.Network.CrossOriginEmbedderPolicyStatus Coep + { + get; + set; + } + + /// + /// Csp + /// + [JsonPropertyName("csp")] + public System.Collections.Generic.IList Csp + { + get; + set; + } + } + + /// + /// The status of a Reporting API report. + /// + public enum ReportStatus + { + /// + /// Queued + /// + [JsonPropertyName("Queued")] + Queued, + /// + /// Pending + /// + [JsonPropertyName("Pending")] + Pending, + /// + /// MarkedForRemoval + /// + [JsonPropertyName("MarkedForRemoval")] + MarkedForRemoval, + /// + /// Success + /// + [JsonPropertyName("Success")] + Success + } + + /// + /// An object representing a report generated by the Reporting API. + /// + public partial class ReportingApiReport : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// The URL of the document that triggered the report. + /// + [JsonPropertyName("initiatorUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string InitiatorUrl + { + get; + set; + } + + /// + /// The name of the endpoint group that should be used to deliver the report. + /// + [JsonPropertyName("destination")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Destination + { + get; + set; + } + + /// + /// The type of the report (specifies the set of data that is contained in the report body). + /// + [JsonPropertyName("type")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Type + { + get; + set; + } + + /// + /// When the report was generated. + /// + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + set; + } + + /// + /// How many uploads deep the related request was. + /// + [JsonPropertyName("depth")] + public int Depth + { + get; + set; + } + + /// + /// The number of delivery attempts made so far, not including an active attempt. + /// + [JsonPropertyName("completedAttempts")] + public int CompletedAttempts + { + get; + set; + } + + /// + /// Body + /// + [JsonPropertyName("body")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public object Body + { + get; + set; + } + + /// + /// Status + /// + [JsonPropertyName("status")] + public CefSharp.DevTools.Network.ReportStatus Status + { + get; + set; + } + } + + /// + /// ReportingApiEndpoint + /// + public partial class ReportingApiEndpoint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The URL of the endpoint to which reports may be delivered. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Name of the endpoint group. + /// + [JsonPropertyName("groupName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string GroupName + { + get; + set; + } + } + + /// + /// Unique identifier for a device bound session. + /// + public partial class DeviceBoundSessionKey : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The site the session is set up for. + /// + [JsonPropertyName("site")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Site + { + get; + set; + } + + /// + /// The id of the session. + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + } + + /// + /// How the session was used (or not used). + /// + public enum DeviceBoundSessionWithUsageUsage + { + /// + /// NotInScope + /// + [JsonPropertyName("NotInScope")] + NotInScope, + /// + /// InScopeRefreshNotYetNeeded + /// + [JsonPropertyName("InScopeRefreshNotYetNeeded")] + InScopeRefreshNotYetNeeded, + /// + /// InScopeRefreshNotAllowed + /// + [JsonPropertyName("InScopeRefreshNotAllowed")] + InScopeRefreshNotAllowed, + /// + /// ProactiveRefreshNotPossible + /// + [JsonPropertyName("ProactiveRefreshNotPossible")] + ProactiveRefreshNotPossible, + /// + /// ProactiveRefreshAttempted + /// + [JsonPropertyName("ProactiveRefreshAttempted")] + ProactiveRefreshAttempted, + /// + /// Deferred + /// + [JsonPropertyName("Deferred")] + Deferred + } + + /// + /// How a device bound session was used during a request. + /// + public partial class DeviceBoundSessionWithUsage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The key for the session. + /// + [JsonPropertyName("sessionKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.DeviceBoundSessionKey SessionKey + { + get; + set; + } + + /// + /// How the session was used (or not used). + /// + [JsonPropertyName("usage")] + public CefSharp.DevTools.Network.DeviceBoundSessionWithUsageUsage Usage + { + get; + set; + } + } + + /// + /// A device bound session's cookie craving. + /// + public partial class DeviceBoundSessionCookieCraving : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The name of the craving. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// The domain of the craving. + /// + [JsonPropertyName("domain")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Domain + { + get; + set; + } + + /// + /// The path of the craving. + /// + [JsonPropertyName("path")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Path + { + get; + set; + } + + /// + /// The `Secure` attribute of the craving attributes. + /// + [JsonPropertyName("secure")] + public bool Secure + { + get; + set; + } + + /// + /// The `HttpOnly` attribute of the craving attributes. + /// + [JsonPropertyName("httpOnly")] + public bool HttpOnly + { + get; + set; + } + + /// + /// The `SameSite` attribute of the craving attributes. + /// + [JsonPropertyName("sameSite")] + public CefSharp.DevTools.Network.CookieSameSite? SameSite + { + get; + set; + } + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`. + /// + public enum DeviceBoundSessionUrlRuleRuleType + { + /// + /// Exclude + /// + [JsonPropertyName("Exclude")] + Exclude, + /// + /// Include + /// + [JsonPropertyName("Include")] + Include + } + + /// + /// A device bound session's inclusion URL rule. + /// + public partial class DeviceBoundSessionUrlRule : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`. + /// + [JsonPropertyName("ruleType")] + public CefSharp.DevTools.Network.DeviceBoundSessionUrlRuleRuleType RuleType + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern`. + /// + [JsonPropertyName("hostPattern")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string HostPattern + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix`. + /// + [JsonPropertyName("pathPrefix")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PathPrefix + { + get; + set; + } + } + + /// + /// A device bound session's inclusion rules. + /// + public partial class DeviceBoundSessionInclusionRules : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::origin_`. + /// + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + set; + } + + /// + /// Whether the whole site is included. See comments on + /// `net::device_bound_sessions::SessionInclusionRules::include_site_` for more + /// details; this boolean is true if that value is populated. + /// + [JsonPropertyName("includeSite")] + public bool IncludeSite + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::SessionInclusionRules::url_rules_`. + /// + [JsonPropertyName("urlRules")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList UrlRules + { + get; + set; + } + } + + /// + /// A device bound session. + /// + public partial class DeviceBoundSession : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The site and session ID of the session. + /// + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.DeviceBoundSessionKey Key + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::refresh_url_`. + /// + [JsonPropertyName("refreshUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RefreshUrl + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::inclusion_rules_`. + /// + [JsonPropertyName("inclusionRules")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.DeviceBoundSessionInclusionRules InclusionRules + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::cookie_cravings_`. + /// + [JsonPropertyName("cookieCravings")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList CookieCravings + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::expiry_date_`. + /// + [JsonPropertyName("expiryDate")] + public double ExpiryDate + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::cached_challenge__`. + /// + [JsonPropertyName("cachedChallenge")] + public string CachedChallenge + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::Session::allowed_refresh_initiators_`. + /// + [JsonPropertyName("allowedRefreshInitiators")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] AllowedRefreshInitiators + { + get; + set; + } + } + + /// + /// A fetch result for a device bound session creation or refresh. + /// + public enum DeviceBoundSessionFetchResult + { + /// + /// Success + /// + [JsonPropertyName("Success")] + Success, + /// + /// KeyError + /// + [JsonPropertyName("KeyError")] + KeyError, + /// + /// SigningError + /// + [JsonPropertyName("SigningError")] + SigningError, + /// + /// ServerRequestedTermination + /// + [JsonPropertyName("ServerRequestedTermination")] + ServerRequestedTermination, + /// + /// InvalidSessionId + /// + [JsonPropertyName("InvalidSessionId")] + InvalidSessionId, + /// + /// InvalidChallenge + /// + [JsonPropertyName("InvalidChallenge")] + InvalidChallenge, + /// + /// TooManyChallenges + /// + [JsonPropertyName("TooManyChallenges")] + TooManyChallenges, + /// + /// InvalidFetcherUrl + /// + [JsonPropertyName("InvalidFetcherUrl")] + InvalidFetcherUrl, + /// + /// InvalidRefreshUrl + /// + [JsonPropertyName("InvalidRefreshUrl")] + InvalidRefreshUrl, + /// + /// TransientHttpError + /// + [JsonPropertyName("TransientHttpError")] + TransientHttpError, + /// + /// ScopeOriginSameSiteMismatch + /// + [JsonPropertyName("ScopeOriginSameSiteMismatch")] + ScopeOriginSameSiteMismatch, + /// + /// RefreshUrlSameSiteMismatch + /// + [JsonPropertyName("RefreshUrlSameSiteMismatch")] + RefreshUrlSameSiteMismatch, + /// + /// MismatchedSessionId + /// + [JsonPropertyName("MismatchedSessionId")] + MismatchedSessionId, + /// + /// MissingScope + /// + [JsonPropertyName("MissingScope")] + MissingScope, + /// + /// NoCredentials + /// + [JsonPropertyName("NoCredentials")] + NoCredentials, + /// + /// SubdomainRegistrationWellKnownUnavailable + /// + [JsonPropertyName("SubdomainRegistrationWellKnownUnavailable")] + SubdomainRegistrationWellKnownUnavailable, + /// + /// SubdomainRegistrationUnauthorized + /// + [JsonPropertyName("SubdomainRegistrationUnauthorized")] + SubdomainRegistrationUnauthorized, + /// + /// SubdomainRegistrationWellKnownMalformed + /// + [JsonPropertyName("SubdomainRegistrationWellKnownMalformed")] + SubdomainRegistrationWellKnownMalformed, + /// + /// SessionProviderWellKnownUnavailable + /// + [JsonPropertyName("SessionProviderWellKnownUnavailable")] + SessionProviderWellKnownUnavailable, + /// + /// RelyingPartyWellKnownUnavailable + /// + [JsonPropertyName("RelyingPartyWellKnownUnavailable")] + RelyingPartyWellKnownUnavailable, + /// + /// FederatedKeyThumbprintMismatch + /// + [JsonPropertyName("FederatedKeyThumbprintMismatch")] + FederatedKeyThumbprintMismatch, + /// + /// InvalidFederatedSessionUrl + /// + [JsonPropertyName("InvalidFederatedSessionUrl")] + InvalidFederatedSessionUrl, + /// + /// InvalidFederatedKey + /// + [JsonPropertyName("InvalidFederatedKey")] + InvalidFederatedKey, + /// + /// TooManyRelyingOriginLabels + /// + [JsonPropertyName("TooManyRelyingOriginLabels")] + TooManyRelyingOriginLabels, + /// + /// BoundCookieSetForbidden + /// + [JsonPropertyName("BoundCookieSetForbidden")] + BoundCookieSetForbidden, + /// + /// NetError + /// + [JsonPropertyName("NetError")] + NetError, + /// + /// ProxyError + /// + [JsonPropertyName("ProxyError")] + ProxyError, + /// + /// EmptySessionConfig + /// + [JsonPropertyName("EmptySessionConfig")] + EmptySessionConfig, + /// + /// InvalidCredentialsConfig + /// + [JsonPropertyName("InvalidCredentialsConfig")] + InvalidCredentialsConfig, + /// + /// InvalidCredentialsType + /// + [JsonPropertyName("InvalidCredentialsType")] + InvalidCredentialsType, + /// + /// InvalidCredentialsEmptyName + /// + [JsonPropertyName("InvalidCredentialsEmptyName")] + InvalidCredentialsEmptyName, + /// + /// InvalidCredentialsCookie + /// + [JsonPropertyName("InvalidCredentialsCookie")] + InvalidCredentialsCookie, + /// + /// PersistentHttpError + /// + [JsonPropertyName("PersistentHttpError")] + PersistentHttpError, + /// + /// RegistrationAttemptedChallenge + /// + [JsonPropertyName("RegistrationAttemptedChallenge")] + RegistrationAttemptedChallenge, + /// + /// InvalidScopeOrigin + /// + [JsonPropertyName("InvalidScopeOrigin")] + InvalidScopeOrigin, + /// + /// ScopeOriginContainsPath + /// + [JsonPropertyName("ScopeOriginContainsPath")] + ScopeOriginContainsPath, + /// + /// RefreshInitiatorNotString + /// + [JsonPropertyName("RefreshInitiatorNotString")] + RefreshInitiatorNotString, + /// + /// RefreshInitiatorInvalidHostPattern + /// + [JsonPropertyName("RefreshInitiatorInvalidHostPattern")] + RefreshInitiatorInvalidHostPattern, + /// + /// InvalidScopeSpecification + /// + [JsonPropertyName("InvalidScopeSpecification")] + InvalidScopeSpecification, + /// + /// MissingScopeSpecificationType + /// + [JsonPropertyName("MissingScopeSpecificationType")] + MissingScopeSpecificationType, + /// + /// EmptyScopeSpecificationDomain + /// + [JsonPropertyName("EmptyScopeSpecificationDomain")] + EmptyScopeSpecificationDomain, + /// + /// EmptyScopeSpecificationPath + /// + [JsonPropertyName("EmptyScopeSpecificationPath")] + EmptyScopeSpecificationPath, + /// + /// InvalidScopeSpecificationType + /// + [JsonPropertyName("InvalidScopeSpecificationType")] + InvalidScopeSpecificationType, + /// + /// InvalidScopeIncludeSite + /// + [JsonPropertyName("InvalidScopeIncludeSite")] + InvalidScopeIncludeSite, + /// + /// MissingScopeIncludeSite + /// + [JsonPropertyName("MissingScopeIncludeSite")] + MissingScopeIncludeSite, + /// + /// FederatedNotAuthorizedByProvider + /// + [JsonPropertyName("FederatedNotAuthorizedByProvider")] + FederatedNotAuthorizedByProvider, + /// + /// FederatedNotAuthorizedByRelyingParty + /// + [JsonPropertyName("FederatedNotAuthorizedByRelyingParty")] + FederatedNotAuthorizedByRelyingParty, + /// + /// SessionProviderWellKnownMalformed + /// + [JsonPropertyName("SessionProviderWellKnownMalformed")] + SessionProviderWellKnownMalformed, + /// + /// SessionProviderWellKnownHasProviderOrigin + /// + [JsonPropertyName("SessionProviderWellKnownHasProviderOrigin")] + SessionProviderWellKnownHasProviderOrigin, + /// + /// RelyingPartyWellKnownMalformed + /// + [JsonPropertyName("RelyingPartyWellKnownMalformed")] + RelyingPartyWellKnownMalformed, + /// + /// RelyingPartyWellKnownHasRelyingOrigins + /// + [JsonPropertyName("RelyingPartyWellKnownHasRelyingOrigins")] + RelyingPartyWellKnownHasRelyingOrigins, + /// + /// InvalidFederatedSessionProviderSessionMissing + /// + [JsonPropertyName("InvalidFederatedSessionProviderSessionMissing")] + InvalidFederatedSessionProviderSessionMissing, + /// + /// InvalidFederatedSessionWrongProviderOrigin + /// + [JsonPropertyName("InvalidFederatedSessionWrongProviderOrigin")] + InvalidFederatedSessionWrongProviderOrigin, + /// + /// InvalidCredentialsCookieCreationTime + /// + [JsonPropertyName("InvalidCredentialsCookieCreationTime")] + InvalidCredentialsCookieCreationTime, + /// + /// InvalidCredentialsCookieName + /// + [JsonPropertyName("InvalidCredentialsCookieName")] + InvalidCredentialsCookieName, + /// + /// InvalidCredentialsCookieParsing + /// + [JsonPropertyName("InvalidCredentialsCookieParsing")] + InvalidCredentialsCookieParsing, + /// + /// InvalidCredentialsCookieUnpermittedAttribute + /// + [JsonPropertyName("InvalidCredentialsCookieUnpermittedAttribute")] + InvalidCredentialsCookieUnpermittedAttribute, + /// + /// InvalidCredentialsCookieInvalidDomain + /// + [JsonPropertyName("InvalidCredentialsCookieInvalidDomain")] + InvalidCredentialsCookieInvalidDomain, + /// + /// InvalidCredentialsCookiePrefix + /// + [JsonPropertyName("InvalidCredentialsCookiePrefix")] + InvalidCredentialsCookiePrefix, + /// + /// InvalidScopeRulePath + /// + [JsonPropertyName("InvalidScopeRulePath")] + InvalidScopeRulePath, + /// + /// InvalidScopeRuleHostPattern + /// + [JsonPropertyName("InvalidScopeRuleHostPattern")] + InvalidScopeRuleHostPattern, + /// + /// ScopeRuleOriginScopedHostPatternMismatch + /// + [JsonPropertyName("ScopeRuleOriginScopedHostPatternMismatch")] + ScopeRuleOriginScopedHostPatternMismatch, + /// + /// ScopeRuleSiteScopedHostPatternMismatch + /// + [JsonPropertyName("ScopeRuleSiteScopedHostPatternMismatch")] + ScopeRuleSiteScopedHostPatternMismatch, + /// + /// SigningQuotaExceeded + /// + [JsonPropertyName("SigningQuotaExceeded")] + SigningQuotaExceeded, + /// + /// InvalidConfigJson + /// + [JsonPropertyName("InvalidConfigJson")] + InvalidConfigJson, + /// + /// InvalidFederatedSessionProviderFailedToRestoreKey + /// + [JsonPropertyName("InvalidFederatedSessionProviderFailedToRestoreKey")] + InvalidFederatedSessionProviderFailedToRestoreKey, + /// + /// FailedToUnwrapKey + /// + [JsonPropertyName("FailedToUnwrapKey")] + FailedToUnwrapKey, + /// + /// SessionDeletedDuringRefresh + /// + [JsonPropertyName("SessionDeletedDuringRefresh")] + SessionDeletedDuringRefresh + } + + /// + /// Session event details specific to creation. + /// + public partial class CreationEventDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The result of the fetch attempt. + /// + [JsonPropertyName("fetchResult")] + public CefSharp.DevTools.Network.DeviceBoundSessionFetchResult FetchResult + { + get; + set; + } + + /// + /// The session if there was a newly created session. This is populated for + /// all successful creation events. + /// + [JsonPropertyName("newSession")] + public CefSharp.DevTools.Network.DeviceBoundSession NewSession + { + get; + set; + } + } + + /// + /// The result of a refresh. + /// + public enum RefreshEventDetailsRefreshResult + { + /// + /// Refreshed + /// + [JsonPropertyName("Refreshed")] + Refreshed, + /// + /// InitializedService + /// + [JsonPropertyName("InitializedService")] + InitializedService, + /// + /// Unreachable + /// + [JsonPropertyName("Unreachable")] + Unreachable, + /// + /// ServerError + /// + [JsonPropertyName("ServerError")] + ServerError, + /// + /// RefreshQuotaExceeded + /// + [JsonPropertyName("RefreshQuotaExceeded")] + RefreshQuotaExceeded, + /// + /// FatalError + /// + [JsonPropertyName("FatalError")] + FatalError, + /// + /// SigningQuotaExceeded + /// + [JsonPropertyName("SigningQuotaExceeded")] + SigningQuotaExceeded + } + + /// + /// Session event details specific to refresh. + /// + public partial class RefreshEventDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The result of a refresh. + /// + [JsonPropertyName("refreshResult")] + public CefSharp.DevTools.Network.RefreshEventDetailsRefreshResult RefreshResult + { + get; + set; + } + + /// + /// If there was a fetch attempt, the result of that. + /// + [JsonPropertyName("fetchResult")] + public CefSharp.DevTools.Network.DeviceBoundSessionFetchResult? FetchResult + { + get; + set; + } + + /// + /// The session display if there was a newly created session. This is populated + /// for any refresh event that modifies the session config. + /// + [JsonPropertyName("newSession")] + public CefSharp.DevTools.Network.DeviceBoundSession NewSession + { + get; + set; + } + + /// + /// See comments on `net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh`. + /// + [JsonPropertyName("wasFullyProactiveRefresh")] + public bool WasFullyProactiveRefresh + { + get; + set; + } + } + + /// + /// The reason for a session being deleted. + /// + public enum TerminationEventDetailsDeletionReason + { + /// + /// Expired + /// + [JsonPropertyName("Expired")] + Expired, + /// + /// FailedToRestoreKey + /// + [JsonPropertyName("FailedToRestoreKey")] + FailedToRestoreKey, + /// + /// FailedToUnwrapKey + /// + [JsonPropertyName("FailedToUnwrapKey")] + FailedToUnwrapKey, + /// + /// StoragePartitionCleared + /// + [JsonPropertyName("StoragePartitionCleared")] + StoragePartitionCleared, + /// + /// ClearBrowsingData + /// + [JsonPropertyName("ClearBrowsingData")] + ClearBrowsingData, + /// + /// ServerRequested + /// + [JsonPropertyName("ServerRequested")] + ServerRequested, + /// + /// InvalidSessionParams + /// + [JsonPropertyName("InvalidSessionParams")] + InvalidSessionParams, + /// + /// RefreshFatalError + /// + [JsonPropertyName("RefreshFatalError")] + RefreshFatalError + } + + /// + /// Session event details specific to termination. + /// + public partial class TerminationEventDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The reason for a session being deleted. + /// + [JsonPropertyName("deletionReason")] + public CefSharp.DevTools.Network.TerminationEventDetailsDeletionReason DeletionReason + { + get; + set; + } + } + + /// + /// The result of a challenge. + /// + public enum ChallengeEventDetailsChallengeResult + { + /// + /// Success + /// + [JsonPropertyName("Success")] + Success, + /// + /// NoSessionId + /// + [JsonPropertyName("NoSessionId")] + NoSessionId, + /// + /// NoSessionMatch + /// + [JsonPropertyName("NoSessionMatch")] + NoSessionMatch, + /// + /// CantSetBoundCookie + /// + [JsonPropertyName("CantSetBoundCookie")] + CantSetBoundCookie + } + + /// + /// Session event details specific to challenges. + /// + public partial class ChallengeEventDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The result of a challenge. + /// + [JsonPropertyName("challengeResult")] + public CefSharp.DevTools.Network.ChallengeEventDetailsChallengeResult ChallengeResult + { + get; + set; + } + + /// + /// The challenge set. + /// + [JsonPropertyName("challenge")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Challenge + { + get; + set; + } + } + + /// + /// An object providing the result of a network resource load. + /// + public partial class LoadNetworkResourcePageResult : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Success + /// + [JsonPropertyName("success")] + public bool Success + { + get; + set; + } + + /// + /// Optional values used for error reporting. + /// + [JsonPropertyName("netError")] + public double? NetError + { + get; + set; + } + + /// + /// NetErrorName + /// + [JsonPropertyName("netErrorName")] + public string NetErrorName + { + get; + set; + } + + /// + /// HttpStatusCode + /// + [JsonPropertyName("httpStatusCode")] + public double? HttpStatusCode + { + get; + set; + } + + /// + /// If successful, one of the following two fields holds the result. + /// + [JsonPropertyName("stream")] + public string Stream + { + get; + set; + } + + /// + /// Response headers. + /// + [JsonPropertyName("headers")] + public CefSharp.DevTools.Network.Headers Headers + { + get; + set; + } + } + + /// + /// An options object that may be extended later to better support CORS, + /// CORB and streaming. + /// + public partial class LoadNetworkResourceOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// DisableCache + /// + [JsonPropertyName("disableCache")] + public bool DisableCache + { + get; + set; + } + + /// + /// IncludeCredentials + /// + [JsonPropertyName("includeCredentials")] + public bool IncludeCredentials + { + get; + set; + } + } + + /// + /// Fired when data chunk was received over the network. + /// + public class DataReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Data chunk length. + /// + [JsonInclude] + [JsonPropertyName("dataLength")] + public int DataLength + { + get; + private set; + } + + /// + /// Actual bytes received (might be less than dataLength for compressed encodings). + /// + [JsonInclude] + [JsonPropertyName("encodedDataLength")] + public int EncodedDataLength + { + get; + private set; + } + + /// + /// Data that was received. + /// + [JsonInclude] + [JsonPropertyName("data")] + public byte[] Data + { + get; + private set; + } + } + + /// + /// Fired when EventSource message is received. + /// + public class EventSourceMessageReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Message type. + /// + [JsonInclude] + [JsonPropertyName("eventName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string EventName + { + get; + private set; + } + + /// + /// Message identifier. + /// + [JsonInclude] + [JsonPropertyName("eventId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string EventId + { + get; + private set; + } + + /// + /// Message content. + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Data + { + get; + private set; + } + } + + /// + /// Fired when HTTP request has failed to load. + /// + public class LoadingFailedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Resource type. + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Network.ResourceType Type + { + get; + private set; + } + + /// + /// Error message. List of network errors: https://cs.chromium.org/chromium/src/net/base/net_error_list.h + /// + [JsonInclude] + [JsonPropertyName("errorText")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ErrorText + { + get; + private set; + } + + /// + /// True if loading was canceled. + /// + [JsonInclude] + [JsonPropertyName("canceled")] + public bool? Canceled + { + get; + private set; + } + + /// + /// The reason why loading was blocked, if any. + /// + [JsonInclude] + [JsonPropertyName("blockedReason")] + public CefSharp.DevTools.Network.BlockedReason? BlockedReason + { + get; + private set; + } + + /// + /// The reason why loading was blocked by CORS, if any. + /// + [JsonInclude] + [JsonPropertyName("corsErrorStatus")] + public CefSharp.DevTools.Network.CorsErrorStatus CorsErrorStatus + { + get; + private set; + } + } + + /// + /// Fired when HTTP request has finished loading. + /// + public class LoadingFinishedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Total number of bytes received for this request. + /// + [JsonInclude] + [JsonPropertyName("encodedDataLength")] + public double EncodedDataLength + { + get; + private set; + } + } + + /// + /// Details of an intercepted HTTP request, which must be either allowed, blocked, modified or + /// mocked. + /// Deprecated, use Fetch.requestPaused instead. + /// + public class RequestInterceptedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Each request the page makes will have a unique id, however if any redirects are encountered + /// while processing that fetch, they will be reported with the same id as the original fetch. + /// Likewise if HTTP authentication is needed then the same fetch id will be used. + /// + [JsonInclude] + [JsonPropertyName("interceptionId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string InterceptionId + { + get; + private set; + } + + /// + /// Request + /// + [JsonInclude] + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Request Request + { + get; + private set; + } + + /// + /// The id of the frame that initiated the request. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// How the requested resource will be used. + /// + [JsonInclude] + [JsonPropertyName("resourceType")] + public CefSharp.DevTools.Network.ResourceType ResourceType + { + get; + private set; + } + + /// + /// Whether this is a navigation request, which can abort the navigation completely. + /// + [JsonInclude] + [JsonPropertyName("isNavigationRequest")] + public bool IsNavigationRequest + { + get; + private set; + } + + /// + /// Set if the request is a navigation that will result in a download. + /// Only present after response is received from the server (i.e. HeadersReceived stage). + /// + [JsonInclude] + [JsonPropertyName("isDownload")] + public bool? IsDownload + { + get; + private set; + } + + /// + /// Redirect location, only sent if a redirect was intercepted. + /// + [JsonInclude] + [JsonPropertyName("redirectUrl")] + public string RedirectUrl + { + get; + private set; + } + + /// + /// Details of the Authorization Challenge encountered. If this is set then + /// continueInterceptedRequest must contain an authChallengeResponse. + /// + [JsonInclude] + [JsonPropertyName("authChallenge")] + public CefSharp.DevTools.Network.AuthChallenge AuthChallenge + { + get; + private set; + } + + /// + /// Response error if intercepted at response stage or if redirect occurred while intercepting + /// request. + /// + [JsonInclude] + [JsonPropertyName("responseErrorReason")] + public CefSharp.DevTools.Network.ErrorReason? ResponseErrorReason + { + get; + private set; + } + + /// + /// Response code if intercepted at response stage or if redirect occurred while intercepting + /// request or auth retry occurred. + /// + [JsonInclude] + [JsonPropertyName("responseStatusCode")] + public int? ResponseStatusCode + { + get; + private set; + } + + /// + /// Response headers if intercepted at the response stage or if redirect occurred while + /// intercepting request or auth retry occurred. + /// + [JsonInclude] + [JsonPropertyName("responseHeaders")] + public CefSharp.DevTools.Network.Headers ResponseHeaders + { + get; + private set; + } + + /// + /// If the intercepted request had a corresponding requestWillBeSent event fired for it, then + /// this requestId will be the same as the requestId present in the requestWillBeSent event. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + public string RequestId + { + get; + private set; + } + } + + /// + /// Fired if request ended up loading from cache. + /// + public class RequestServedFromCacheEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + } + + /// + /// Fired when page is about to send HTTP request. + /// + public class RequestWillBeSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Loader identifier. Empty string if the request is fetched from worker. + /// + [JsonInclude] + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + private set; + } + + /// + /// URL of the document this request is loaded for. + /// + [JsonInclude] + [JsonPropertyName("documentURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DocumentURL + { + get; + private set; + } + + /// + /// Request data. + /// + [JsonInclude] + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Request Request + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("wallTime")] + public double WallTime + { + get; + private set; + } + + /// + /// Request initiator. + /// + [JsonInclude] + [JsonPropertyName("initiator")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + + /// + /// In the case that redirectResponse is populated, this flag indicates whether + /// requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted + /// for the request which was just redirected. + /// + [JsonInclude] + [JsonPropertyName("redirectHasExtraInfo")] + public bool RedirectHasExtraInfo + { + get; + private set; + } + + /// + /// Redirect response data. + /// + [JsonInclude] + [JsonPropertyName("redirectResponse")] + public CefSharp.DevTools.Network.Response RedirectResponse + { + get; + private set; + } + + /// + /// Type of this resource. + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Network.ResourceType? Type + { + get; + private set; + } + + /// + /// Frame identifier. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + public string FrameId + { + get; + private set; + } + + /// + /// Whether the request is initiated by a user gesture. Defaults to false. + /// + [JsonInclude] + [JsonPropertyName("hasUserGesture")] + public bool? HasUserGesture + { + get; + private set; + } + + /// + /// The render blocking behavior of the request. + /// + [JsonInclude] + [JsonPropertyName("renderBlockingBehavior")] + public CefSharp.DevTools.Network.RenderBlockingBehavior? RenderBlockingBehavior + { + get; + private set; + } + } + + /// + /// Fired when resource loading priority is changed + /// + public class ResourceChangedPriorityEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// New priority + /// + [JsonInclude] + [JsonPropertyName("newPriority")] + public CefSharp.DevTools.Network.ResourcePriority NewPriority + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when a signed exchange was received over the network + /// + public class SignedExchangeReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Information about the signed exchange response. + /// + [JsonInclude] + [JsonPropertyName("info")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.SignedExchangeInfo Info + { + get; + private set; + } + } + + /// + /// Fired when HTTP response is available. + /// + public class ResponseReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Loader identifier. Empty string if the request is fetched from worker. + /// + [JsonInclude] + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Resource type. + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Network.ResourceType Type + { + get; + private set; + } + + /// + /// Response data. + /// + [JsonInclude] + [JsonPropertyName("response")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Response Response + { + get; + private set; + } + + /// + /// Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be + /// or were emitted for this request. + /// + [JsonInclude] + [JsonPropertyName("hasExtraInfo")] + public bool HasExtraInfo + { + get; + private set; + } + + /// + /// Frame identifier. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + public string FrameId + { + get; + private set; + } + } + + /// + /// Fired when WebSocket is closed. + /// + public class WebSocketClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired upon WebSocket creation. + /// + public class WebSocketCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// WebSocket request URL. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Request initiator. + /// + [JsonInclude] + [JsonPropertyName("initiator")] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + } + + /// + /// Fired when WebSocket message error occurs. + /// + public class WebSocketFrameErrorEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// WebSocket error message. + /// + [JsonInclude] + [JsonPropertyName("errorMessage")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ErrorMessage + { + get; + private set; + } + } + + /// + /// Fired when WebSocket message is received. + /// + public class WebSocketFrameReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// WebSocket response data. + /// + [JsonInclude] + [JsonPropertyName("response")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.WebSocketFrame Response + { + get; + private set; + } + } + + /// + /// Fired when WebSocket message is sent. + /// + public class WebSocketFrameSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// WebSocket response data. + /// + [JsonInclude] + [JsonPropertyName("response")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.WebSocketFrame Response + { + get; + private set; + } + } + + /// + /// Fired when WebSocket handshake response becomes available. + /// + public class WebSocketHandshakeResponseReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// WebSocket response data. + /// + [JsonInclude] + [JsonPropertyName("response")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.WebSocketResponse Response + { + get; + private set; + } + } + + /// + /// Fired when WebSocket is about to initiate handshake. + /// + public class WebSocketWillSendHandshakeRequestEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// UTC Timestamp. + /// + [JsonInclude] + [JsonPropertyName("wallTime")] + public double WallTime + { + get; + private set; + } + + /// + /// WebSocket request data. + /// + [JsonInclude] + [JsonPropertyName("request")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.WebSocketRequest Request + { + get; + private set; + } + } + + /// + /// Fired upon WebTransport creation. + /// + public class WebTransportCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// WebTransport identifier. + /// + [JsonInclude] + [JsonPropertyName("transportId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TransportId + { + get; + private set; + } + + /// + /// WebTransport request URL. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Request initiator. + /// + [JsonInclude] + [JsonPropertyName("initiator")] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + } + + /// + /// Fired when WebTransport handshake is finished. + /// + public class WebTransportConnectionEstablishedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// WebTransport identifier. + /// + [JsonInclude] + [JsonPropertyName("transportId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TransportId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when WebTransport is disposed. + /// + public class WebTransportClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// WebTransport identifier. + /// + [JsonInclude] + [JsonPropertyName("transportId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TransportId + { + get; + private set; + } + + /// + /// Timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired upon direct_socket.TCPSocket creation. + /// + public class DirectTCPSocketCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// RemoteAddr + /// + [JsonInclude] + [JsonPropertyName("remoteAddr")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RemoteAddr + { + get; + private set; + } + + /// + /// Unsigned int 16. + /// + [JsonInclude] + [JsonPropertyName("remotePort")] + public int RemotePort + { + get; + private set; + } + + /// + /// Options + /// + [JsonInclude] + [JsonPropertyName("options")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.DirectTCPSocketOptions Options + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Initiator + /// + [JsonInclude] + [JsonPropertyName("initiator")] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.TCPSocket connection is opened. + /// + public class DirectTCPSocketOpenedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// RemoteAddr + /// + [JsonInclude] + [JsonPropertyName("remoteAddr")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RemoteAddr + { + get; + private set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonInclude] + [JsonPropertyName("remotePort")] + public int RemotePort + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// LocalAddr + /// + [JsonInclude] + [JsonPropertyName("localAddr")] + public string LocalAddr + { + get; + private set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonInclude] + [JsonPropertyName("localPort")] + public int? LocalPort + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.TCPSocket is aborted. + /// + public class DirectTCPSocketAbortedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// ErrorMessage + /// + [JsonInclude] + [JsonPropertyName("errorMessage")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ErrorMessage + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.TCPSocket is closed. + /// + public class DirectTCPSocketClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when data is sent to tcp direct socket stream. + /// + public class DirectTCPSocketChunkSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// Data + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when data is received from tcp direct socket stream. + /// + public class DirectTCPSocketChunkReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// Data + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// directUDPSocketJoinedMulticastGroup + /// + public class DirectUDPSocketJoinedMulticastGroupEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// IPAddress + /// + [JsonInclude] + [JsonPropertyName("IPAddress")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string IPAddress + { + get; + private set; + } + } + + /// + /// directUDPSocketLeftMulticastGroup + /// + public class DirectUDPSocketLeftMulticastGroupEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// IPAddress + /// + [JsonInclude] + [JsonPropertyName("IPAddress")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string IPAddress + { + get; + private set; + } + } + + /// + /// Fired upon direct_socket.UDPSocket creation. + /// + public class DirectUDPSocketCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// Options + /// + [JsonInclude] + [JsonPropertyName("options")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.DirectUDPSocketOptions Options + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Initiator + /// + [JsonInclude] + [JsonPropertyName("initiator")] + public CefSharp.DevTools.Network.Initiator Initiator + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.UDPSocket connection is opened. + /// + public class DirectUDPSocketOpenedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// LocalAddr + /// + [JsonInclude] + [JsonPropertyName("localAddr")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LocalAddr + { + get; + private set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonInclude] + [JsonPropertyName("localPort")] + public int LocalPort + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// RemoteAddr + /// + [JsonInclude] + [JsonPropertyName("remoteAddr")] + public string RemoteAddr + { + get; + private set; + } + + /// + /// Expected to be unsigned integer. + /// + [JsonInclude] + [JsonPropertyName("remotePort")] + public int? RemotePort + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.UDPSocket is aborted. + /// + public class DirectUDPSocketAbortedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// ErrorMessage + /// + [JsonInclude] + [JsonPropertyName("errorMessage")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ErrorMessage + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when direct_socket.UDPSocket is closed. + /// + public class DirectUDPSocketClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when message is sent to udp direct socket stream. + /// + public class DirectUDPSocketChunkSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// Message + /// + [JsonInclude] + [JsonPropertyName("message")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.DirectUDPMessage Message + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when message is received from udp direct socket stream. + /// + public class DirectUDPSocketChunkReceivedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Identifier + { + get; + private set; + } + + /// + /// Message + /// + [JsonInclude] + [JsonPropertyName("message")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.DirectUDPMessage Message + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired when additional information about a requestWillBeSent event is available from the + /// network stack. Not every requestWillBeSent event will have an additional + /// requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent + /// or requestWillBeSentExtraInfo will be fired first for the same request. + /// + public class RequestWillBeSentExtraInfoEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. Used to match this information to an existing requestWillBeSent event. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// A list of cookies potentially associated to the requested URL. This includes both cookies sent with + /// the request and the ones not sent; the latter are distinguished by having blockedReasons field set. + /// + [JsonInclude] + [JsonPropertyName("associatedCookies")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList AssociatedCookies + { + get; + private set; + } + + /// + /// Raw request headers as they will be sent over the wire. + /// + [JsonInclude] + [JsonPropertyName("headers")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Headers Headers + { + get; + private set; + } + + /// + /// Connection timing information for the request. + /// + [JsonInclude] + [JsonPropertyName("connectTiming")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.ConnectTiming ConnectTiming + { + get; + private set; + } + + /// + /// How the request site's device bound sessions were used during this request. + /// + [JsonInclude] + [JsonPropertyName("deviceBoundSessionUsages")] + public System.Collections.Generic.IList DeviceBoundSessionUsages + { + get; + private set; + } + + /// + /// The client security state set for the request. + /// + [JsonInclude] + [JsonPropertyName("clientSecurityState")] + public CefSharp.DevTools.Network.ClientSecurityState ClientSecurityState + { + get; + private set; + } + + /// + /// Whether the site has partitioned cookies stored in a partition different than the current one. + /// + [JsonInclude] + [JsonPropertyName("siteHasCookieInOtherPartition")] + public bool? SiteHasCookieInOtherPartition + { + get; + private set; + } + + /// + /// The network conditions id if this request was affected by network conditions configured via + /// emulateNetworkConditionsByRule. + /// + [JsonInclude] + [JsonPropertyName("appliedNetworkConditionsId")] + public string AppliedNetworkConditionsId + { + get; + private set; + } + } + + /// + /// Fired when additional information about a responseReceived event is available from the network + /// stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for + /// it, and responseReceivedExtraInfo may be fired before or after responseReceived. + /// + public class ResponseReceivedExtraInfoEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. Used to match this information to another responseReceived event. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// A list of cookies which were not stored from the response along with the corresponding + /// reasons for blocking. The cookies here may not be valid due to syntax errors, which + /// are represented by the invalid cookie line string instead of a proper cookie. + /// + [JsonInclude] + [JsonPropertyName("blockedCookies")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList BlockedCookies + { + get; + private set; + } + + /// + /// Raw response headers as they were received over the wire. + /// Duplicate headers in the response are represented as a single key with their values + /// concatentated using `\n` as the separator. + /// See also `headersText` that contains verbatim text for HTTP/1.*. + /// + [JsonInclude] + [JsonPropertyName("headers")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Headers Headers + { + get; + private set; + } + + /// + /// The IP address space of the resource. The address space can only be determined once the transport + /// established the connection, so we can't send it in `requestWillBeSentExtraInfo`. + /// + [JsonInclude] + [JsonPropertyName("resourceIPAddressSpace")] + public CefSharp.DevTools.Network.IPAddressSpace ResourceIPAddressSpace + { + get; + private set; + } + + /// + /// The status code of the response. This is useful in cases the request failed and no responseReceived + /// event is triggered, which is the case for, e.g., CORS errors. This is also the correct status code + /// for cached requests, where the status in responseReceived is a 200 and this will be 304. + /// + [JsonInclude] + [JsonPropertyName("statusCode")] + public int StatusCode + { + get; + private set; + } + + /// + /// Raw response header text as it was received over the wire. The raw text may not always be + /// available, such as in the case of HTTP/2 or QUIC. + /// + [JsonInclude] + [JsonPropertyName("headersText")] + public string HeadersText + { + get; + private set; + } + + /// + /// The cookie partition key that will be used to store partitioned cookies set in this response. + /// Only sent when partitioned cookies are enabled. + /// + [JsonInclude] + [JsonPropertyName("cookiePartitionKey")] + public CefSharp.DevTools.Network.CookiePartitionKey CookiePartitionKey + { + get; + private set; + } + + /// + /// True if partitioned cookies are enabled, but the partition key is not serializable to string. + /// + [JsonInclude] + [JsonPropertyName("cookiePartitionKeyOpaque")] + public bool? CookiePartitionKeyOpaque + { + get; + private set; + } + + /// + /// A list of cookies which should have been blocked by 3PCD but are exempted and stored from + /// the response with the corresponding reason. + /// + [JsonInclude] + [JsonPropertyName("exemptedCookies")] + public System.Collections.Generic.IList ExemptedCookies + { + get; + private set; + } + } + + /// + /// Fired when 103 Early Hints headers is received in addition to the common response. + /// Not every responseReceived event will have an responseReceivedEarlyHints fired. + /// Only one responseReceivedEarlyHints may be fired for eached responseReceived event. + /// + public class ResponseReceivedEarlyHintsEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Request identifier. Used to match this information to another responseReceived event. + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Raw response headers as they were received over the wire. + /// Duplicate headers in the response are represented as a single key with their values + /// concatentated using `\n` as the separator. + /// See also `headersText` that contains verbatim text for HTTP/1.*. + /// + [JsonInclude] + [JsonPropertyName("headers")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.Headers Headers + { + get; + private set; + } + } + + /// + /// Detailed success or error status of the operation. + /// 'AlreadyExists' also signifies a successful operation, as the result + /// of the operation already exists und thus, the operation was abort + /// preemptively (e.g. a cache hit). + /// + public enum TrustTokenOperationDoneStatus + { + /// + /// Ok + /// + [JsonPropertyName("Ok")] + Ok, + /// + /// InvalidArgument + /// + [JsonPropertyName("InvalidArgument")] + InvalidArgument, + /// + /// MissingIssuerKeys + /// + [JsonPropertyName("MissingIssuerKeys")] + MissingIssuerKeys, + /// + /// FailedPrecondition + /// + [JsonPropertyName("FailedPrecondition")] + FailedPrecondition, + /// + /// ResourceExhausted + /// + [JsonPropertyName("ResourceExhausted")] + ResourceExhausted, + /// + /// AlreadyExists + /// + [JsonPropertyName("AlreadyExists")] + AlreadyExists, + /// + /// ResourceLimited + /// + [JsonPropertyName("ResourceLimited")] + ResourceLimited, + /// + /// Unauthorized + /// + [JsonPropertyName("Unauthorized")] + Unauthorized, + /// + /// BadResponse + /// + [JsonPropertyName("BadResponse")] + BadResponse, + /// + /// InternalError + /// + [JsonPropertyName("InternalError")] + InternalError, + /// + /// UnknownError + /// + [JsonPropertyName("UnknownError")] + UnknownError, + /// + /// FulfilledLocally + /// + [JsonPropertyName("FulfilledLocally")] + FulfilledLocally, + /// + /// SiteIssuerLimit + /// + [JsonPropertyName("SiteIssuerLimit")] + SiteIssuerLimit + } + + /// + /// Fired exactly once for each Trust Token operation. Depending on + /// the type of the operation and whether the operation succeeded or + /// failed, the event is fired before the corresponding request was sent + /// or after the response was received. + /// + public class TrustTokenOperationDoneEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Detailed success or error status of the operation. + /// 'AlreadyExists' also signifies a successful operation, as the result + /// of the operation already exists und thus, the operation was abort + /// preemptively (e.g. a cache hit). + /// + [JsonInclude] + [JsonPropertyName("status")] + public CefSharp.DevTools.Network.TrustTokenOperationDoneStatus Status + { + get; + private set; + } + + /// + /// Type + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Network.TrustTokenOperationType Type + { + get; + private set; + } + + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Top level origin. The context in which the operation was attempted. + /// + [JsonInclude] + [JsonPropertyName("topLevelOrigin")] + public string TopLevelOrigin + { + get; + private set; + } + + /// + /// Origin of the issuer in case of a "Issuance" or "Redemption" operation. + /// + [JsonInclude] + [JsonPropertyName("issuerOrigin")] + public string IssuerOrigin + { + get; + private set; + } + + /// + /// The number of obtained Trust Tokens on a successful "Issuance" operation. + /// + [JsonInclude] + [JsonPropertyName("issuedTokenCount")] + public int? IssuedTokenCount + { + get; + private set; + } + } + + /// + /// Is sent whenever a new report is added. + /// And after 'enableReportingApi' for all existing reports. + /// + public class ReportingApiReportAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Report + /// + [JsonInclude] + [JsonPropertyName("report")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.ReportingApiReport Report + { + get; + private set; + } + } + + /// + /// reportingApiReportUpdated + /// + public class ReportingApiReportUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Report + /// + [JsonInclude] + [JsonPropertyName("report")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Network.ReportingApiReport Report + { + get; + private set; + } + } + + /// + /// reportingApiEndpointsChangedForOrigin + /// + public class ReportingApiEndpointsChangedForOriginEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin of the document(s) which configured the endpoints. + /// + [JsonInclude] + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + private set; + } + + /// + /// Endpoints + /// + [JsonInclude] + [JsonPropertyName("endpoints")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Endpoints + { + get; + private set; + } + } + + /// + /// Triggered when the initial set of device bound sessions is added. + /// + public class DeviceBoundSessionsAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The device bound sessions. + /// + [JsonInclude] + [JsonPropertyName("sessions")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Sessions + { + get; + private set; + } + } + + /// + /// Triggered when a device bound session event occurs. + /// + public class DeviceBoundSessionEventOccurredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// A unique identifier for this session event. + /// + [JsonInclude] + [JsonPropertyName("eventId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string EventId + { + get; + private set; + } + + /// + /// The site this session event is associated with. + /// + [JsonInclude] + [JsonPropertyName("site")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Site + { + get; + private set; + } + + /// + /// Whether this event was considered successful. + /// + [JsonInclude] + [JsonPropertyName("succeeded")] + public bool Succeeded + { + get; + private set; + } + + /// + /// The session ID this event is associated with. May not be populated for + /// failed events. + /// + [JsonInclude] + [JsonPropertyName("sessionId")] + public string SessionId + { + get; + private set; + } + + /// + /// The below are the different session event type details. Exactly one is populated. + /// + [JsonInclude] + [JsonPropertyName("creationEventDetails")] + public CefSharp.DevTools.Network.CreationEventDetails CreationEventDetails + { + get; + private set; + } + + /// + /// RefreshEventDetails + /// + [JsonInclude] + [JsonPropertyName("refreshEventDetails")] + public CefSharp.DevTools.Network.RefreshEventDetails RefreshEventDetails + { + get; + private set; + } + + /// + /// TerminationEventDetails + /// + [JsonInclude] + [JsonPropertyName("terminationEventDetails")] + public CefSharp.DevTools.Network.TerminationEventDetails TerminationEventDetails + { + get; + private set; + } + + /// + /// ChallengeEventDetails + /// + [JsonInclude] + [JsonPropertyName("challengeEventDetails")] + public CefSharp.DevTools.Network.ChallengeEventDetails ChallengeEventDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + /// + /// Configuration data for drawing the source order of an elements children. + /// + public partial class SourceOrderConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// the color to outline the given element in. + /// + [JsonPropertyName("parentOutlineColor")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.RGBA ParentOutlineColor + { + get; + set; + } + + /// + /// the color to outline the child elements in. + /// + [JsonPropertyName("childOutlineColor")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.RGBA ChildOutlineColor + { + get; + set; + } + } + + /// + /// Configuration data for the highlighting of Grid elements. + /// + public partial class GridHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Whether the extension lines from grid cells to the rulers should be shown (default: false). + /// + [JsonPropertyName("showGridExtensionLines")] + public bool? ShowGridExtensionLines + { + get; + set; + } + + /// + /// Show Positive line number labels (default: false). + /// + [JsonPropertyName("showPositiveLineNumbers")] + public bool? ShowPositiveLineNumbers + { + get; + set; + } + + /// + /// Show Negative line number labels (default: false). + /// + [JsonPropertyName("showNegativeLineNumbers")] + public bool? ShowNegativeLineNumbers + { + get; + set; + } + + /// + /// Show area name labels (default: false). + /// + [JsonPropertyName("showAreaNames")] + public bool? ShowAreaNames + { + get; + set; + } + + /// + /// Show line name labels (default: false). + /// + [JsonPropertyName("showLineNames")] + public bool? ShowLineNames + { + get; + set; + } + + /// + /// Show track size labels (default: false). + /// + [JsonPropertyName("showTrackSizes")] + public bool? ShowTrackSizes + { + get; + set; + } + + /// + /// The grid container border highlight color (default: transparent). + /// + [JsonPropertyName("gridBorderColor")] + public CefSharp.DevTools.DOM.RGBA GridBorderColor + { + get; + set; + } + + /// + /// The cell border color (default: transparent). Deprecated, please use rowLineColor and columnLineColor instead. + /// + [JsonPropertyName("cellBorderColor")] + public CefSharp.DevTools.DOM.RGBA CellBorderColor + { + get; + set; + } + + /// + /// The row line color (default: transparent). + /// + [JsonPropertyName("rowLineColor")] + public CefSharp.DevTools.DOM.RGBA RowLineColor + { + get; + set; + } + + /// + /// The column line color (default: transparent). + /// + [JsonPropertyName("columnLineColor")] + public CefSharp.DevTools.DOM.RGBA ColumnLineColor + { + get; + set; + } + + /// + /// Whether the grid border is dashed (default: false). + /// + [JsonPropertyName("gridBorderDash")] + public bool? GridBorderDash + { + get; + set; + } + + /// + /// Whether the cell border is dashed (default: false). Deprecated, please us rowLineDash and columnLineDash instead. + /// + [JsonPropertyName("cellBorderDash")] + public bool? CellBorderDash + { + get; + set; + } + + /// + /// Whether row lines are dashed (default: false). + /// + [JsonPropertyName("rowLineDash")] + public bool? RowLineDash + { + get; + set; + } + + /// + /// Whether column lines are dashed (default: false). + /// + [JsonPropertyName("columnLineDash")] + public bool? ColumnLineDash + { + get; + set; + } + + /// + /// The row gap highlight fill color (default: transparent). + /// + [JsonPropertyName("rowGapColor")] + public CefSharp.DevTools.DOM.RGBA RowGapColor + { + get; + set; + } + + /// + /// The row gap hatching fill color (default: transparent). + /// + [JsonPropertyName("rowHatchColor")] + public CefSharp.DevTools.DOM.RGBA RowHatchColor + { + get; + set; + } + + /// + /// The column gap highlight fill color (default: transparent). + /// + [JsonPropertyName("columnGapColor")] + public CefSharp.DevTools.DOM.RGBA ColumnGapColor + { + get; + set; + } + + /// + /// The column gap hatching fill color (default: transparent). + /// + [JsonPropertyName("columnHatchColor")] + public CefSharp.DevTools.DOM.RGBA ColumnHatchColor + { + get; + set; + } + + /// + /// The named grid areas border color (Default: transparent). + /// + [JsonPropertyName("areaBorderColor")] + public CefSharp.DevTools.DOM.RGBA AreaBorderColor + { + get; + set; + } + + /// + /// The grid container background color (Default: transparent). + /// + [JsonPropertyName("gridBackgroundColor")] + public CefSharp.DevTools.DOM.RGBA GridBackgroundColor + { + get; + set; + } + } + + /// + /// Configuration data for the highlighting of Flex container elements. + /// + public partial class FlexContainerHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The style of the container border + /// + [JsonPropertyName("containerBorder")] + public CefSharp.DevTools.Overlay.LineStyle ContainerBorder + { + get; + set; + } + + /// + /// The style of the separator between lines + /// + [JsonPropertyName("lineSeparator")] + public CefSharp.DevTools.Overlay.LineStyle LineSeparator + { + get; + set; + } + + /// + /// The style of the separator between items + /// + [JsonPropertyName("itemSeparator")] + public CefSharp.DevTools.Overlay.LineStyle ItemSeparator + { + get; + set; + } + + /// + /// Style of content-distribution space on the main axis (justify-content). + /// + [JsonPropertyName("mainDistributedSpace")] + public CefSharp.DevTools.Overlay.BoxStyle MainDistributedSpace + { + get; + set; + } + + /// + /// Style of content-distribution space on the cross axis (align-content). + /// + [JsonPropertyName("crossDistributedSpace")] + public CefSharp.DevTools.Overlay.BoxStyle CrossDistributedSpace + { + get; + set; + } + + /// + /// Style of empty space caused by row gaps (gap/row-gap). + /// + [JsonPropertyName("rowGapSpace")] + public CefSharp.DevTools.Overlay.BoxStyle RowGapSpace + { + get; + set; + } + + /// + /// Style of empty space caused by columns gaps (gap/column-gap). + /// + [JsonPropertyName("columnGapSpace")] + public CefSharp.DevTools.Overlay.BoxStyle ColumnGapSpace + { + get; + set; + } + + /// + /// Style of the self-alignment line (align-items). + /// + [JsonPropertyName("crossAlignment")] + public CefSharp.DevTools.Overlay.LineStyle CrossAlignment + { + get; + set; + } + } + + /// + /// Configuration data for the highlighting of Flex item elements. + /// + public partial class FlexItemHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Style of the box representing the item's base size + /// + [JsonPropertyName("baseSizeBox")] + public CefSharp.DevTools.Overlay.BoxStyle BaseSizeBox + { + get; + set; + } + + /// + /// Style of the border around the box representing the item's base size + /// + [JsonPropertyName("baseSizeBorder")] + public CefSharp.DevTools.Overlay.LineStyle BaseSizeBorder + { + get; + set; + } + + /// + /// Style of the arrow representing if the item grew or shrank + /// + [JsonPropertyName("flexibilityArrow")] + public CefSharp.DevTools.Overlay.LineStyle FlexibilityArrow + { + get; + set; + } + } + + /// + /// The line pattern (default: solid) + /// + public enum LineStylePattern + { + /// + /// dashed + /// + [JsonPropertyName("dashed")] + Dashed, + /// + /// dotted + /// + [JsonPropertyName("dotted")] + Dotted + } + + /// + /// Style information for drawing a line. + /// + public partial class LineStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The color of the line (default: transparent) + /// + [JsonPropertyName("color")] + public CefSharp.DevTools.DOM.RGBA Color + { + get; + set; + } + + /// + /// The line pattern (default: solid) + /// + [JsonPropertyName("pattern")] + public CefSharp.DevTools.Overlay.LineStylePattern? Pattern + { + get; + set; + } + } + + /// + /// Style information for drawing a box. + /// + public partial class BoxStyle : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The background color for the box (default: transparent) + /// + [JsonPropertyName("fillColor")] + public CefSharp.DevTools.DOM.RGBA FillColor + { + get; + set; + } + + /// + /// The hatching color for the box (default: transparent) + /// + [JsonPropertyName("hatchColor")] + public CefSharp.DevTools.DOM.RGBA HatchColor + { + get; + set; + } + } + + /// + /// ContrastAlgorithm + /// + public enum ContrastAlgorithm + { + /// + /// aa + /// + [JsonPropertyName("aa")] + Aa, + /// + /// aaa + /// + [JsonPropertyName("aaa")] + Aaa, + /// + /// apca + /// + [JsonPropertyName("apca")] + Apca + } + + /// + /// Configuration data for the highlighting of page elements. + /// + public partial class HighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Whether the node info tooltip should be shown (default: false). + /// + [JsonPropertyName("showInfo")] + public bool? ShowInfo + { + get; + set; + } + + /// + /// Whether the node styles in the tooltip (default: false). + /// + [JsonPropertyName("showStyles")] + public bool? ShowStyles + { + get; + set; + } + + /// + /// Whether the rulers should be shown (default: false). + /// + [JsonPropertyName("showRulers")] + public bool? ShowRulers + { + get; + set; + } + + /// + /// Whether the a11y info should be shown (default: true). + /// + [JsonPropertyName("showAccessibilityInfo")] + public bool? ShowAccessibilityInfo + { + get; + set; + } + + /// + /// Whether the extension lines from node to the rulers should be shown (default: false). + /// + [JsonPropertyName("showExtensionLines")] + public bool? ShowExtensionLines + { + get; + set; + } + + /// + /// The content box highlight fill color (default: transparent). + /// + [JsonPropertyName("contentColor")] + public CefSharp.DevTools.DOM.RGBA ContentColor + { + get; + set; + } + + /// + /// The padding highlight fill color (default: transparent). + /// + [JsonPropertyName("paddingColor")] + public CefSharp.DevTools.DOM.RGBA PaddingColor + { + get; + set; + } + + /// + /// The border highlight fill color (default: transparent). + /// + [JsonPropertyName("borderColor")] + public CefSharp.DevTools.DOM.RGBA BorderColor + { + get; + set; + } + + /// + /// The margin highlight fill color (default: transparent). + /// + [JsonPropertyName("marginColor")] + public CefSharp.DevTools.DOM.RGBA MarginColor + { + get; + set; + } + + /// + /// The event target element highlight fill color (default: transparent). + /// + [JsonPropertyName("eventTargetColor")] + public CefSharp.DevTools.DOM.RGBA EventTargetColor + { + get; + set; + } + + /// + /// The shape outside fill color (default: transparent). + /// + [JsonPropertyName("shapeColor")] + public CefSharp.DevTools.DOM.RGBA ShapeColor + { + get; + set; + } + + /// + /// The shape margin fill color (default: transparent). + /// + [JsonPropertyName("shapeMarginColor")] + public CefSharp.DevTools.DOM.RGBA ShapeMarginColor + { + get; + set; + } + + /// + /// The grid layout color (default: transparent). + /// + [JsonPropertyName("cssGridColor")] + public CefSharp.DevTools.DOM.RGBA CssGridColor + { + get; + set; + } + + /// + /// The color format used to format color styles (default: hex). + /// + [JsonPropertyName("colorFormat")] + public CefSharp.DevTools.Overlay.ColorFormat? ColorFormat + { + get; + set; + } + + /// + /// The grid layout highlight configuration (default: all transparent). + /// + [JsonPropertyName("gridHighlightConfig")] + public CefSharp.DevTools.Overlay.GridHighlightConfig GridHighlightConfig + { + get; + set; + } + + /// + /// The flex container highlight configuration (default: all transparent). + /// + [JsonPropertyName("flexContainerHighlightConfig")] + public CefSharp.DevTools.Overlay.FlexContainerHighlightConfig FlexContainerHighlightConfig + { + get; + set; + } + + /// + /// The flex item highlight configuration (default: all transparent). + /// + [JsonPropertyName("flexItemHighlightConfig")] + public CefSharp.DevTools.Overlay.FlexItemHighlightConfig FlexItemHighlightConfig + { + get; + set; + } + + /// + /// The contrast algorithm to use for the contrast ratio (default: aa). + /// + [JsonPropertyName("contrastAlgorithm")] + public CefSharp.DevTools.Overlay.ContrastAlgorithm? ContrastAlgorithm + { + get; + set; + } + + /// + /// The container query container highlight configuration (default: all transparent). + /// + [JsonPropertyName("containerQueryContainerHighlightConfig")] + public CefSharp.DevTools.Overlay.ContainerQueryContainerHighlightConfig ContainerQueryContainerHighlightConfig + { + get; + set; + } + } + + /// + /// ColorFormat + /// + public enum ColorFormat + { + /// + /// rgb + /// + [JsonPropertyName("rgb")] + Rgb, + /// + /// hsl + /// + [JsonPropertyName("hsl")] + Hsl, + /// + /// hwb + /// + [JsonPropertyName("hwb")] + Hwb, + /// + /// hex + /// + [JsonPropertyName("hex")] + Hex + } + + /// + /// Configurations for Persistent Grid Highlight + /// + public partial class GridNodeHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance. + /// + [JsonPropertyName("gridHighlightConfig")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Overlay.GridHighlightConfig GridHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the node to highlight. + /// + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + set; + } + } + + /// + /// FlexNodeHighlightConfig + /// + public partial class FlexNodeHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance of flex containers. + /// + [JsonPropertyName("flexContainerHighlightConfig")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Overlay.FlexContainerHighlightConfig FlexContainerHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the node to highlight. + /// + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + set; + } + } + + /// + /// ScrollSnapContainerHighlightConfig + /// + public partial class ScrollSnapContainerHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The style of the snapport border (default: transparent) + /// + [JsonPropertyName("snapportBorder")] + public CefSharp.DevTools.Overlay.LineStyle SnapportBorder + { + get; + set; + } + + /// + /// The style of the snap area border (default: transparent) + /// + [JsonPropertyName("snapAreaBorder")] + public CefSharp.DevTools.Overlay.LineStyle SnapAreaBorder + { + get; + set; + } + + /// + /// The margin highlight fill color (default: transparent). + /// + [JsonPropertyName("scrollMarginColor")] + public CefSharp.DevTools.DOM.RGBA ScrollMarginColor + { + get; + set; + } + + /// + /// The padding highlight fill color (default: transparent). + /// + [JsonPropertyName("scrollPaddingColor")] + public CefSharp.DevTools.DOM.RGBA ScrollPaddingColor + { + get; + set; + } + } + + /// + /// ScrollSnapHighlightConfig + /// + public partial class ScrollSnapHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance of scroll snap containers. + /// + [JsonPropertyName("scrollSnapContainerHighlightConfig")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Overlay.ScrollSnapContainerHighlightConfig ScrollSnapContainerHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the node to highlight. + /// + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + set; + } + } + + /// + /// Configuration for dual screen hinge + /// + public partial class HingeConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A rectangle represent hinge + /// + [JsonPropertyName("rect")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect Rect + { + get; + set; + } + + /// + /// The content box highlight fill color (default: a dark color). + /// + [JsonPropertyName("contentColor")] + public CefSharp.DevTools.DOM.RGBA ContentColor + { + get; + set; + } + + /// + /// The content box highlight outline color (default: transparent). + /// + [JsonPropertyName("outlineColor")] + public CefSharp.DevTools.DOM.RGBA OutlineColor + { + get; + set; + } + } + + /// + /// Configuration for Window Controls Overlay + /// + public partial class WindowControlsOverlayConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Whether the title bar CSS should be shown when emulating the Window Controls Overlay. + /// + [JsonPropertyName("showCSS")] + public bool ShowCSS + { + get; + set; + } + + /// + /// Selected platforms to show the overlay. + /// + [JsonPropertyName("selectedPlatform")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SelectedPlatform + { + get; + set; + } + + /// + /// The theme color defined in app manifest. + /// + [JsonPropertyName("themeColor")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ThemeColor + { + get; + set; + } + } + + /// + /// ContainerQueryHighlightConfig + /// + public partial class ContainerQueryHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance of container query containers. + /// + [JsonPropertyName("containerQueryContainerHighlightConfig")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Overlay.ContainerQueryContainerHighlightConfig ContainerQueryContainerHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the container node to highlight. + /// + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + set; + } + } + + /// + /// ContainerQueryContainerHighlightConfig + /// + public partial class ContainerQueryContainerHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The style of the container border. + /// + [JsonPropertyName("containerBorder")] + public CefSharp.DevTools.Overlay.LineStyle ContainerBorder + { + get; + set; + } + + /// + /// The style of the descendants' borders. + /// + [JsonPropertyName("descendantBorder")] + public CefSharp.DevTools.Overlay.LineStyle DescendantBorder + { + get; + set; + } + } + + /// + /// IsolatedElementHighlightConfig + /// + public partial class IsolatedElementHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A descriptor for the highlight appearance of an element in isolation mode. + /// + [JsonPropertyName("isolationModeHighlightConfig")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Overlay.IsolationModeHighlightConfig IsolationModeHighlightConfig + { + get; + set; + } + + /// + /// Identifier of the isolated element to highlight. + /// + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + set; + } + } + + /// + /// IsolationModeHighlightConfig + /// + public partial class IsolationModeHighlightConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The fill color of the resizers (default: transparent). + /// + [JsonPropertyName("resizerColor")] + public CefSharp.DevTools.DOM.RGBA ResizerColor + { + get; + set; + } + + /// + /// The fill color for resizer handles (default: transparent). + /// + [JsonPropertyName("resizerHandleColor")] + public CefSharp.DevTools.DOM.RGBA ResizerHandleColor + { + get; + set; + } + + /// + /// The fill color for the mask covering non-isolated elements (default: transparent). + /// + [JsonPropertyName("maskColor")] + public CefSharp.DevTools.DOM.RGBA MaskColor + { + get; + set; + } + } + + /// + /// InspectMode + /// + public enum InspectMode + { + /// + /// searchForNode + /// + [JsonPropertyName("searchForNode")] + SearchForNode, + /// + /// searchForUAShadowDOM + /// + [JsonPropertyName("searchForUAShadowDOM")] + SearchForUAShadowDOM, + /// + /// captureAreaScreenshot + /// + [JsonPropertyName("captureAreaScreenshot")] + CaptureAreaScreenshot, + /// + /// none + /// + [JsonPropertyName("none")] + None + } + + /// + /// InspectedElementAnchorConfig + /// + public partial class InspectedElementAnchorConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Identifier of the node to highlight. + /// + [JsonPropertyName("nodeId")] + public int? NodeId + { + get; + set; + } + + /// + /// Identifier of the backend node to highlight. + /// + [JsonPropertyName("backendNodeId")] + public int? BackendNodeId + { + get; + set; + } + } + + /// + /// Fired when the node should be inspected. This happens after call to `setInspectMode` or when + /// user manually inspects an element. + /// + public class InspectNodeRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node to inspect. + /// + [JsonInclude] + [JsonPropertyName("backendNodeId")] + public int BackendNodeId + { + get; + private set; + } + } + + /// + /// Fired when the node should be highlighted. This happens after call to `setInspectMode`. + /// + public class NodeHighlightRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// NodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } + + /// + /// Fired when user asks to capture screenshot of some area on the page. + /// + public class ScreenshotRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Viewport to capture, in device independent pixels (dip). + /// + [JsonInclude] + [JsonPropertyName("viewport")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Page.Viewport Viewport + { + get; + private set; + } + } + + /// + /// Fired when user asks to show the Inspect panel. + /// + public class InspectPanelShowRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node to show in the panel. + /// + [JsonInclude] + [JsonPropertyName("backendNodeId")] + public int BackendNodeId + { + get; + private set; + } + } + + /// + /// Fired when user asks to restore the Inspected Element floating window. + /// + public class InspectedElementWindowRestoredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the node to restore the floating window for. + /// + [JsonInclude] + [JsonPropertyName("backendNodeId")] + public int BackendNodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.PWA +{ + /// + /// The following types are the replica of + /// https://crsrc.org/c/chrome/browser/web_applications/proto/web_app_os_integration_state.proto;drc=9910d3be894c8f142c977ba1023f30a656bc13fc;l=67 + /// + public partial class FileHandlerAccept : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// New name of the mimetype according to + /// https://www.iana.org/assignments/media-types/media-types.xhtml + /// + [JsonPropertyName("mediaType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string MediaType + { + get; + set; + } + + /// + /// FileExtensions + /// + [JsonPropertyName("fileExtensions")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] FileExtensions + { + get; + set; + } + } + + /// + /// FileHandler + /// + public partial class FileHandler : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Action + /// + [JsonPropertyName("action")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Action + { + get; + set; + } + + /// + /// Accepts + /// + [JsonPropertyName("accepts")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Accepts + { + get; + set; + } + + /// + /// DisplayName + /// + [JsonPropertyName("displayName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DisplayName + { + get; + set; + } + } + + /// + /// If user prefers opening the app in browser or an app window. + /// + public enum DisplayMode + { + /// + /// standalone + /// + [JsonPropertyName("standalone")] + Standalone, + /// + /// browser + /// + [JsonPropertyName("browser")] + Browser + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// Indicates whether a frame has been identified as an ad. + /// + public enum AdFrameType + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// child + /// + [JsonPropertyName("child")] + Child, + /// + /// root + /// + [JsonPropertyName("root")] + Root + } + + /// + /// AdFrameExplanation + /// + public enum AdFrameExplanation + { + /// + /// ParentIsAd + /// + [JsonPropertyName("ParentIsAd")] + ParentIsAd, + /// + /// CreatedByAdScript + /// + [JsonPropertyName("CreatedByAdScript")] + CreatedByAdScript, + /// + /// MatchedBlockingRule + /// + [JsonPropertyName("MatchedBlockingRule")] + MatchedBlockingRule + } + + /// + /// Indicates whether a frame has been identified as an ad and why. + /// + public partial class AdFrameStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// AdFrameType + /// + [JsonPropertyName("adFrameType")] + public CefSharp.DevTools.Page.AdFrameType AdFrameType + { + get; + set; + } + + /// + /// Explanations + /// + [JsonPropertyName("explanations")] + public CefSharp.DevTools.Page.AdFrameExplanation[] Explanations + { + get; + set; + } + } + + /// + /// Identifies the script which caused a script or frame to be labelled as an + /// ad. + /// + public partial class AdScriptId : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Script Id of the script which caused a script or frame to be labelled as + /// an ad. + /// + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + set; + } + + /// + /// Id of scriptId's debugger. + /// + [JsonPropertyName("debuggerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DebuggerId + { + get; + set; + } + } + + /// + /// Encapsulates the script ancestry and the root script filterlist rule that + /// caused the frame to be labelled as an ad. Only created when `ancestryChain` + /// is not empty. + /// + public partial class AdScriptAncestry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// A chain of `AdScriptId`s representing the ancestry of an ad script that + /// led to the creation of a frame. The chain is ordered from the script + /// itself (lower level) up to its root ancestor that was flagged by + /// filterlist. + /// + [JsonPropertyName("ancestryChain")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList AncestryChain + { + get; + set; + } + + /// + /// The filterlist rule that caused the root (last) script in + /// `ancestryChain` to be ad-tagged. Only populated if the rule is + /// available. + /// + [JsonPropertyName("rootScriptFilterlistRule")] + public string RootScriptFilterlistRule + { + get; + set; + } + } + + /// + /// Indicates whether the frame is a secure context and why it is the case. + /// + public enum SecureContextType + { + /// + /// Secure + /// + [JsonPropertyName("Secure")] + Secure, + /// + /// SecureLocalhost + /// + [JsonPropertyName("SecureLocalhost")] + SecureLocalhost, + /// + /// InsecureScheme + /// + [JsonPropertyName("InsecureScheme")] + InsecureScheme, + /// + /// InsecureAncestor + /// + [JsonPropertyName("InsecureAncestor")] + InsecureAncestor + } + + /// + /// Indicates whether the frame is cross-origin isolated and why it is the case. + /// + public enum CrossOriginIsolatedContextType + { + /// + /// Isolated + /// + [JsonPropertyName("Isolated")] + Isolated, + /// + /// NotIsolated + /// + [JsonPropertyName("NotIsolated")] + NotIsolated, + /// + /// NotIsolatedFeatureDisabled + /// + [JsonPropertyName("NotIsolatedFeatureDisabled")] + NotIsolatedFeatureDisabled + } + + /// + /// GatedAPIFeatures + /// + public enum GatedAPIFeatures + { + /// + /// SharedArrayBuffers + /// + [JsonPropertyName("SharedArrayBuffers")] + SharedArrayBuffers, + /// + /// SharedArrayBuffersTransferAllowed + /// + [JsonPropertyName("SharedArrayBuffersTransferAllowed")] + SharedArrayBuffersTransferAllowed, + /// + /// PerformanceMeasureMemory + /// + [JsonPropertyName("PerformanceMeasureMemory")] + PerformanceMeasureMemory, + /// + /// PerformanceProfile + /// + [JsonPropertyName("PerformanceProfile")] + PerformanceProfile + } + + /// + /// All Permissions Policy features. This enum should match the one defined + /// in services/network/public/cpp/permissions_policy/permissions_policy_features.json5. + /// LINT.IfChange(PermissionsPolicyFeature) + /// + public enum PermissionsPolicyFeature + { + /// + /// accelerometer + /// + [JsonPropertyName("accelerometer")] + Accelerometer, + /// + /// all-screens-capture + /// + [JsonPropertyName("all-screens-capture")] + AllScreensCapture, + /// + /// ambient-light-sensor + /// + [JsonPropertyName("ambient-light-sensor")] + AmbientLightSensor, + /// + /// aria-notify + /// + [JsonPropertyName("aria-notify")] + AriaNotify, + /// + /// attribution-reporting + /// + [JsonPropertyName("attribution-reporting")] + AttributionReporting, + /// + /// autofill + /// + [JsonPropertyName("autofill")] + Autofill, + /// + /// autoplay + /// + [JsonPropertyName("autoplay")] + Autoplay, + /// + /// bluetooth + /// + [JsonPropertyName("bluetooth")] + Bluetooth, + /// + /// browsing-topics + /// + [JsonPropertyName("browsing-topics")] + BrowsingTopics, + /// + /// camera + /// + [JsonPropertyName("camera")] + Camera, + /// + /// captured-surface-control + /// + [JsonPropertyName("captured-surface-control")] + CapturedSurfaceControl, + /// + /// ch-dpr + /// + [JsonPropertyName("ch-dpr")] + ChDpr, + /// + /// ch-device-memory + /// + [JsonPropertyName("ch-device-memory")] + ChDeviceMemory, + /// + /// ch-downlink + /// + [JsonPropertyName("ch-downlink")] + ChDownlink, + /// + /// ch-ect + /// + [JsonPropertyName("ch-ect")] + ChEct, + /// + /// ch-prefers-color-scheme + /// + [JsonPropertyName("ch-prefers-color-scheme")] + ChPrefersColorScheme, + /// + /// ch-prefers-reduced-motion + /// + [JsonPropertyName("ch-prefers-reduced-motion")] + ChPrefersReducedMotion, + /// + /// ch-prefers-reduced-transparency + /// + [JsonPropertyName("ch-prefers-reduced-transparency")] + ChPrefersReducedTransparency, + /// + /// ch-rtt + /// + [JsonPropertyName("ch-rtt")] + ChRtt, + /// + /// ch-save-data + /// + [JsonPropertyName("ch-save-data")] + ChSaveData, + /// + /// ch-ua + /// + [JsonPropertyName("ch-ua")] + ChUa, + /// + /// ch-ua-arch + /// + [JsonPropertyName("ch-ua-arch")] + ChUaArch, + /// + /// ch-ua-bitness + /// + [JsonPropertyName("ch-ua-bitness")] + ChUaBitness, + /// + /// ch-ua-high-entropy-values + /// + [JsonPropertyName("ch-ua-high-entropy-values")] + ChUaHighEntropyValues, + /// + /// ch-ua-platform + /// + [JsonPropertyName("ch-ua-platform")] + ChUaPlatform, + /// + /// ch-ua-model + /// + [JsonPropertyName("ch-ua-model")] + ChUaModel, + /// + /// ch-ua-mobile + /// + [JsonPropertyName("ch-ua-mobile")] + ChUaMobile, + /// + /// ch-ua-form-factors + /// + [JsonPropertyName("ch-ua-form-factors")] + ChUaFormFactors, + /// + /// ch-ua-full-version + /// + [JsonPropertyName("ch-ua-full-version")] + ChUaFullVersion, + /// + /// ch-ua-full-version-list + /// + [JsonPropertyName("ch-ua-full-version-list")] + ChUaFullVersionList, + /// + /// ch-ua-platform-version + /// + [JsonPropertyName("ch-ua-platform-version")] + ChUaPlatformVersion, + /// + /// ch-ua-wow64 + /// + [JsonPropertyName("ch-ua-wow64")] + ChUaWow64, + /// + /// ch-viewport-height + /// + [JsonPropertyName("ch-viewport-height")] + ChViewportHeight, + /// + /// ch-viewport-width + /// + [JsonPropertyName("ch-viewport-width")] + ChViewportWidth, + /// + /// ch-width + /// + [JsonPropertyName("ch-width")] + ChWidth, + /// + /// clipboard-read + /// + [JsonPropertyName("clipboard-read")] + ClipboardRead, + /// + /// clipboard-write + /// + [JsonPropertyName("clipboard-write")] + ClipboardWrite, + /// + /// compute-pressure + /// + [JsonPropertyName("compute-pressure")] + ComputePressure, + /// + /// controlled-frame + /// + [JsonPropertyName("controlled-frame")] + ControlledFrame, + /// + /// cross-origin-isolated + /// + [JsonPropertyName("cross-origin-isolated")] + CrossOriginIsolated, + /// + /// deferred-fetch + /// + [JsonPropertyName("deferred-fetch")] + DeferredFetch, + /// + /// deferred-fetch-minimal + /// + [JsonPropertyName("deferred-fetch-minimal")] + DeferredFetchMinimal, + /// + /// device-attributes + /// + [JsonPropertyName("device-attributes")] + DeviceAttributes, + /// + /// digital-credentials-create + /// + [JsonPropertyName("digital-credentials-create")] + DigitalCredentialsCreate, + /// + /// digital-credentials-get + /// + [JsonPropertyName("digital-credentials-get")] + DigitalCredentialsGet, + /// + /// direct-sockets + /// + [JsonPropertyName("direct-sockets")] + DirectSockets, + /// + /// direct-sockets-multicast + /// + [JsonPropertyName("direct-sockets-multicast")] + DirectSocketsMulticast, + /// + /// direct-sockets-private + /// + [JsonPropertyName("direct-sockets-private")] + DirectSocketsPrivate, + /// + /// display-capture + /// + [JsonPropertyName("display-capture")] + DisplayCapture, + /// + /// document-domain + /// + [JsonPropertyName("document-domain")] + DocumentDomain, + /// + /// encrypted-media + /// + [JsonPropertyName("encrypted-media")] + EncryptedMedia, + /// + /// execution-while-out-of-viewport + /// + [JsonPropertyName("execution-while-out-of-viewport")] + ExecutionWhileOutOfViewport, + /// + /// execution-while-not-rendered + /// + [JsonPropertyName("execution-while-not-rendered")] + ExecutionWhileNotRendered, + /// + /// fenced-unpartitioned-storage-read + /// + [JsonPropertyName("fenced-unpartitioned-storage-read")] + FencedUnpartitionedStorageRead, + /// + /// focus-without-user-activation + /// + [JsonPropertyName("focus-without-user-activation")] + FocusWithoutUserActivation, + /// + /// fullscreen + /// + [JsonPropertyName("fullscreen")] + Fullscreen, + /// + /// frobulate + /// + [JsonPropertyName("frobulate")] + Frobulate, + /// + /// gamepad + /// + [JsonPropertyName("gamepad")] + Gamepad, + /// + /// geolocation + /// + [JsonPropertyName("geolocation")] + Geolocation, + /// + /// gyroscope + /// + [JsonPropertyName("gyroscope")] + Gyroscope, + /// + /// hid + /// + [JsonPropertyName("hid")] + Hid, + /// + /// identity-credentials-get + /// + [JsonPropertyName("identity-credentials-get")] + IdentityCredentialsGet, + /// + /// idle-detection + /// + [JsonPropertyName("idle-detection")] + IdleDetection, + /// + /// interest-cohort + /// + [JsonPropertyName("interest-cohort")] + InterestCohort, + /// + /// join-ad-interest-group + /// + [JsonPropertyName("join-ad-interest-group")] + JoinAdInterestGroup, + /// + /// keyboard-map + /// + [JsonPropertyName("keyboard-map")] + KeyboardMap, + /// + /// language-detector + /// + [JsonPropertyName("language-detector")] + LanguageDetector, + /// + /// language-model + /// + [JsonPropertyName("language-model")] + LanguageModel, + /// + /// local-fonts + /// + [JsonPropertyName("local-fonts")] + LocalFonts, + /// + /// local-network + /// + [JsonPropertyName("local-network")] + LocalNetwork, + /// + /// local-network-access + /// + [JsonPropertyName("local-network-access")] + LocalNetworkAccess, + /// + /// loopback-network + /// + [JsonPropertyName("loopback-network")] + LoopbackNetwork, + /// + /// magnetometer + /// + [JsonPropertyName("magnetometer")] + Magnetometer, + /// + /// manual-text + /// + [JsonPropertyName("manual-text")] + ManualText, + /// + /// media-playback-while-not-visible + /// + [JsonPropertyName("media-playback-while-not-visible")] + MediaPlaybackWhileNotVisible, + /// + /// microphone + /// + [JsonPropertyName("microphone")] + Microphone, + /// + /// midi + /// + [JsonPropertyName("midi")] + Midi, + /// + /// on-device-speech-recognition + /// + [JsonPropertyName("on-device-speech-recognition")] + OnDeviceSpeechRecognition, + /// + /// otp-credentials + /// + [JsonPropertyName("otp-credentials")] + OtpCredentials, + /// + /// payment + /// + [JsonPropertyName("payment")] + Payment, + /// + /// picture-in-picture + /// + [JsonPropertyName("picture-in-picture")] + PictureInPicture, + /// + /// private-aggregation + /// + [JsonPropertyName("private-aggregation")] + PrivateAggregation, + /// + /// private-state-token-issuance + /// + [JsonPropertyName("private-state-token-issuance")] + PrivateStateTokenIssuance, + /// + /// private-state-token-redemption + /// + [JsonPropertyName("private-state-token-redemption")] + PrivateStateTokenRedemption, + /// + /// publickey-credentials-create + /// + [JsonPropertyName("publickey-credentials-create")] + PublickeyCredentialsCreate, + /// + /// publickey-credentials-get + /// + [JsonPropertyName("publickey-credentials-get")] + PublickeyCredentialsGet, + /// + /// record-ad-auction-events + /// + [JsonPropertyName("record-ad-auction-events")] + RecordAdAuctionEvents, + /// + /// rewriter + /// + [JsonPropertyName("rewriter")] + Rewriter, + /// + /// run-ad-auction + /// + [JsonPropertyName("run-ad-auction")] + RunAdAuction, + /// + /// screen-wake-lock + /// + [JsonPropertyName("screen-wake-lock")] + ScreenWakeLock, + /// + /// serial + /// + [JsonPropertyName("serial")] + Serial, + /// + /// shared-storage + /// + [JsonPropertyName("shared-storage")] + SharedStorage, + /// + /// shared-storage-select-url + /// + [JsonPropertyName("shared-storage-select-url")] + SharedStorageSelectUrl, + /// + /// smart-card + /// + [JsonPropertyName("smart-card")] + SmartCard, + /// + /// speaker-selection + /// + [JsonPropertyName("speaker-selection")] + SpeakerSelection, + /// + /// storage-access + /// + [JsonPropertyName("storage-access")] + StorageAccess, + /// + /// sub-apps + /// + [JsonPropertyName("sub-apps")] + SubApps, + /// + /// summarizer + /// + [JsonPropertyName("summarizer")] + Summarizer, + /// + /// sync-xhr + /// + [JsonPropertyName("sync-xhr")] + SyncXhr, + /// + /// translator + /// + [JsonPropertyName("translator")] + Translator, + /// + /// unload + /// + [JsonPropertyName("unload")] + Unload, + /// + /// usb + /// + [JsonPropertyName("usb")] + Usb, + /// + /// usb-unrestricted + /// + [JsonPropertyName("usb-unrestricted")] + UsbUnrestricted, + /// + /// vertical-scroll + /// + [JsonPropertyName("vertical-scroll")] + VerticalScroll, + /// + /// web-app-installation + /// + [JsonPropertyName("web-app-installation")] + WebAppInstallation, + /// + /// web-printing + /// + [JsonPropertyName("web-printing")] + WebPrinting, + /// + /// web-share + /// + [JsonPropertyName("web-share")] + WebShare, + /// + /// window-management + /// + [JsonPropertyName("window-management")] + WindowManagement, + /// + /// writer + /// + [JsonPropertyName("writer")] + Writer, + /// + /// xr-spatial-tracking + /// + [JsonPropertyName("xr-spatial-tracking")] + XrSpatialTracking + } + + /// + /// Reason for a permissions policy feature to be disabled. + /// + public enum PermissionsPolicyBlockReason + { + /// + /// Header + /// + [JsonPropertyName("Header")] + Header, + /// + /// IframeAttribute + /// + [JsonPropertyName("IframeAttribute")] + IframeAttribute, + /// + /// InFencedFrameTree + /// + [JsonPropertyName("InFencedFrameTree")] + InFencedFrameTree, + /// + /// InIsolatedApp + /// + [JsonPropertyName("InIsolatedApp")] + InIsolatedApp + } + + /// + /// PermissionsPolicyBlockLocator + /// + public partial class PermissionsPolicyBlockLocator : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FrameId + /// + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + set; + } + + /// + /// BlockReason + /// + [JsonPropertyName("blockReason")] + public CefSharp.DevTools.Page.PermissionsPolicyBlockReason BlockReason + { + get; + set; + } + } + + /// + /// PermissionsPolicyFeatureState + /// + public partial class PermissionsPolicyFeatureState : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Feature + /// + [JsonPropertyName("feature")] + public CefSharp.DevTools.Page.PermissionsPolicyFeature Feature + { + get; + set; + } + + /// + /// Allowed + /// + [JsonPropertyName("allowed")] + public bool Allowed + { + get; + set; + } + + /// + /// Locator + /// + [JsonPropertyName("locator")] + public CefSharp.DevTools.Page.PermissionsPolicyBlockLocator Locator + { + get; + set; + } + } + + /// + /// Origin Trial(https://www.chromium.org/blink/origin-trials) support. + /// Status for an Origin Trial token. + /// + public enum OriginTrialTokenStatus + { + /// + /// Success + /// + [JsonPropertyName("Success")] + Success, + /// + /// NotSupported + /// + [JsonPropertyName("NotSupported")] + NotSupported, + /// + /// Insecure + /// + [JsonPropertyName("Insecure")] + Insecure, + /// + /// Expired + /// + [JsonPropertyName("Expired")] + Expired, + /// + /// WrongOrigin + /// + [JsonPropertyName("WrongOrigin")] + WrongOrigin, + /// + /// InvalidSignature + /// + [JsonPropertyName("InvalidSignature")] + InvalidSignature, + /// + /// Malformed + /// + [JsonPropertyName("Malformed")] + Malformed, + /// + /// WrongVersion + /// + [JsonPropertyName("WrongVersion")] + WrongVersion, + /// + /// FeatureDisabled + /// + [JsonPropertyName("FeatureDisabled")] + FeatureDisabled, + /// + /// TokenDisabled + /// + [JsonPropertyName("TokenDisabled")] + TokenDisabled, + /// + /// FeatureDisabledForUser + /// + [JsonPropertyName("FeatureDisabledForUser")] + FeatureDisabledForUser, + /// + /// UnknownTrial + /// + [JsonPropertyName("UnknownTrial")] + UnknownTrial + } + + /// + /// Status for an Origin Trial. + /// + public enum OriginTrialStatus + { + /// + /// Enabled + /// + [JsonPropertyName("Enabled")] + Enabled, + /// + /// ValidTokenNotProvided + /// + [JsonPropertyName("ValidTokenNotProvided")] + ValidTokenNotProvided, + /// + /// OSNotSupported + /// + [JsonPropertyName("OSNotSupported")] + OSNotSupported, + /// + /// TrialNotAllowed + /// + [JsonPropertyName("TrialNotAllowed")] + TrialNotAllowed + } + + /// + /// OriginTrialUsageRestriction + /// + public enum OriginTrialUsageRestriction + { + /// + /// None + /// + [JsonPropertyName("None")] + None, + /// + /// Subset + /// + [JsonPropertyName("Subset")] + Subset + } + + /// + /// OriginTrialToken + /// + public partial class OriginTrialToken : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Origin + /// + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + set; + } + + /// + /// MatchSubDomains + /// + [JsonPropertyName("matchSubDomains")] + public bool MatchSubDomains + { + get; + set; + } + + /// + /// TrialName + /// + [JsonPropertyName("trialName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TrialName + { + get; + set; + } + + /// + /// ExpiryTime + /// + [JsonPropertyName("expiryTime")] + public double ExpiryTime + { + get; + set; + } + + /// + /// IsThirdParty + /// + [JsonPropertyName("isThirdParty")] + public bool IsThirdParty + { + get; + set; + } + + /// + /// UsageRestriction + /// + [JsonPropertyName("usageRestriction")] + public CefSharp.DevTools.Page.OriginTrialUsageRestriction UsageRestriction + { + get; + set; + } + } + + /// + /// OriginTrialTokenWithStatus + /// + public partial class OriginTrialTokenWithStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// RawTokenText + /// + [JsonPropertyName("rawTokenText")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RawTokenText + { + get; + set; + } + + /// + /// `parsedToken` is present only when the token is extractable and + /// parsable. + /// + [JsonPropertyName("parsedToken")] + public CefSharp.DevTools.Page.OriginTrialToken ParsedToken + { + get; + set; + } + + /// + /// Status + /// + [JsonPropertyName("status")] + public CefSharp.DevTools.Page.OriginTrialTokenStatus Status + { + get; + set; + } + } + + /// + /// OriginTrial + /// + public partial class OriginTrial : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TrialName + /// + [JsonPropertyName("trialName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TrialName + { + get; + set; + } + + /// + /// Status + /// + [JsonPropertyName("status")] + public CefSharp.DevTools.Page.OriginTrialStatus Status + { + get; + set; + } + + /// + /// TokensWithStatus + /// + [JsonPropertyName("tokensWithStatus")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList TokensWithStatus + { + get; + set; + } + } + + /// + /// Additional information about the frame document's security origin. + /// + public partial class SecurityOriginDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Indicates whether the frame document's security origin is one + /// of the local hostnames (e.g. "localhost") or IP addresses (IPv4 + /// 127.0.0.0/8 or IPv6 ::1). + /// + [JsonPropertyName("isLocalhost")] + public bool IsLocalhost + { + get; + set; + } + } + + /// + /// Information about the Frame on the page. + /// + public partial class Frame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Frame unique identifier. + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// Parent frame identifier. + /// + [JsonPropertyName("parentId")] + public string ParentId + { + get; + set; + } + + /// + /// Identifier of the loader associated with this frame. + /// + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + set; + } + + /// + /// Frame's name as specified in the tag. + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// Frame document's URL without fragment. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Frame document's URL fragment including the '#'. + /// + [JsonPropertyName("urlFragment")] + public string UrlFragment + { + get; + set; + } + + /// + /// Frame document's registered domain, taking the public suffixes list into account. + /// Extracted from the Frame's url. + /// Example URLs: http://www.google.com/file.html -> "google.com" + /// http://a.b.co.uk/file.html -> "b.co.uk" + /// + [JsonPropertyName("domainAndRegistry")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DomainAndRegistry + { + get; + set; + } + + /// + /// Frame document's security origin. + /// + [JsonPropertyName("securityOrigin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SecurityOrigin + { + get; + set; + } + + /// + /// Additional details about the frame document's security origin. + /// + [JsonPropertyName("securityOriginDetails")] + public CefSharp.DevTools.Page.SecurityOriginDetails SecurityOriginDetails + { + get; + set; + } + + /// + /// Frame document's mimeType as determined by the browser. + /// + [JsonPropertyName("mimeType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string MimeType + { + get; + set; + } + + /// + /// If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment. + /// + [JsonPropertyName("unreachableUrl")] + public string UnreachableUrl + { + get; + set; + } + + /// + /// Indicates whether this frame was tagged as an ad and why. + /// + [JsonPropertyName("adFrameStatus")] + public CefSharp.DevTools.Page.AdFrameStatus AdFrameStatus + { + get; + set; + } + + /// + /// Indicates whether the main document is a secure context and explains why that is the case. + /// + [JsonPropertyName("secureContextType")] + public CefSharp.DevTools.Page.SecureContextType SecureContextType + { + get; + set; + } + + /// + /// Indicates whether this is a cross origin isolated context. + /// + [JsonPropertyName("crossOriginIsolatedContextType")] + public CefSharp.DevTools.Page.CrossOriginIsolatedContextType CrossOriginIsolatedContextType + { + get; + set; + } + + /// + /// Indicated which gated APIs / features are available. + /// + [JsonPropertyName("gatedAPIFeatures")] + public CefSharp.DevTools.Page.GatedAPIFeatures[] GatedAPIFeatures + { + get; + set; + } + } + + /// + /// Information about the Resource on the page. + /// + public partial class FrameResource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Resource URL. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Type of this resource. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Network.ResourceType Type + { + get; + set; + } + + /// + /// Resource mimeType as determined by the browser. + /// + [JsonPropertyName("mimeType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string MimeType + { + get; + set; + } + + /// + /// last-modified timestamp as reported by server. + /// + [JsonPropertyName("lastModified")] + public double? LastModified + { + get; + set; + } + + /// + /// Resource content size. + /// + [JsonPropertyName("contentSize")] + public double? ContentSize + { + get; + set; + } + + /// + /// True if the resource failed to load. + /// + [JsonPropertyName("failed")] + public bool? Failed + { + get; + set; + } + + /// + /// True if the resource was canceled during loading. + /// + [JsonPropertyName("canceled")] + public bool? Canceled + { + get; + set; + } + } + + /// + /// Information about the Frame hierarchy along with their cached resources. + /// + public partial class FrameResourceTree : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Frame information for this tree item. + /// + [JsonPropertyName("frame")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Page.Frame Frame + { + get; + set; + } + + /// + /// Child frames. + /// + [JsonPropertyName("childFrames")] + public System.Collections.Generic.IList ChildFrames + { + get; + set; + } + + /// + /// Information about frame resources. + /// + [JsonPropertyName("resources")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Resources + { + get; + set; + } + } + + /// + /// Information about the Frame hierarchy. + /// + public partial class FrameTree : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Frame information for this tree item. + /// + [JsonPropertyName("frame")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Page.Frame Frame + { + get; + set; + } + + /// + /// Child frames. + /// + [JsonPropertyName("childFrames")] + public System.Collections.Generic.IList ChildFrames + { + get; + set; + } + } + + /// + /// Transition type. + /// + public enum TransitionType + { + /// + /// link + /// + [JsonPropertyName("link")] + Link, + /// + /// typed + /// + [JsonPropertyName("typed")] + Typed, + /// + /// address_bar + /// + [JsonPropertyName("address_bar")] + AddressBar, + /// + /// auto_bookmark + /// + [JsonPropertyName("auto_bookmark")] + AutoBookmark, + /// + /// auto_subframe + /// + [JsonPropertyName("auto_subframe")] + AutoSubframe, + /// + /// manual_subframe + /// + [JsonPropertyName("manual_subframe")] + ManualSubframe, + /// + /// generated + /// + [JsonPropertyName("generated")] + Generated, + /// + /// auto_toplevel + /// + [JsonPropertyName("auto_toplevel")] + AutoToplevel, + /// + /// form_submit + /// + [JsonPropertyName("form_submit")] + FormSubmit, + /// + /// reload + /// + [JsonPropertyName("reload")] + Reload, + /// + /// keyword + /// + [JsonPropertyName("keyword")] + Keyword, + /// + /// keyword_generated + /// + [JsonPropertyName("keyword_generated")] + KeywordGenerated, + /// + /// other + /// + [JsonPropertyName("other")] + Other + } + + /// + /// Navigation history entry. + /// + public partial class NavigationEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unique id of the navigation history entry. + /// + [JsonPropertyName("id")] + public int Id + { + get; + set; + } + + /// + /// URL of the navigation history entry. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// URL that the user typed in the url bar. + /// + [JsonPropertyName("userTypedURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string UserTypedURL + { + get; + set; + } + + /// + /// Title of the navigation history entry. + /// + [JsonPropertyName("title")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Title + { + get; + set; + } + + /// + /// Transition type. + /// + [JsonPropertyName("transitionType")] + public CefSharp.DevTools.Page.TransitionType TransitionType + { + get; + set; + } + } + + /// + /// Screencast frame metadata. + /// + public partial class ScreencastFrameMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Top offset in DIP. + /// + [JsonPropertyName("offsetTop")] + public double OffsetTop + { + get; + set; + } + + /// + /// Page scale factor. + /// + [JsonPropertyName("pageScaleFactor")] + public double PageScaleFactor + { + get; + set; + } + + /// + /// Device screen width in DIP. + /// + [JsonPropertyName("deviceWidth")] + public double DeviceWidth + { + get; + set; + } + + /// + /// Device screen height in DIP. + /// + [JsonPropertyName("deviceHeight")] + public double DeviceHeight + { + get; + set; + } + + /// + /// Position of horizontal scroll in CSS pixels. + /// + [JsonPropertyName("scrollOffsetX")] + public double ScrollOffsetX + { + get; + set; + } + + /// + /// Position of vertical scroll in CSS pixels. + /// + [JsonPropertyName("scrollOffsetY")] + public double ScrollOffsetY + { + get; + set; + } + + /// + /// Frame swap timestamp. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp + { + get; + set; + } + } + + /// + /// Javascript dialog type. + /// + public enum DialogType + { + /// + /// alert + /// + [JsonPropertyName("alert")] + Alert, + /// + /// confirm + /// + [JsonPropertyName("confirm")] + Confirm, + /// + /// prompt + /// + [JsonPropertyName("prompt")] + Prompt, + /// + /// beforeunload + /// + [JsonPropertyName("beforeunload")] + Beforeunload + } + + /// + /// Error while paring app manifest. + /// + public partial class AppManifestError : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Error message. + /// + [JsonPropertyName("message")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Message + { + get; + set; + } + + /// + /// If critical, this is a non-recoverable parse error. + /// + [JsonPropertyName("critical")] + public int Critical + { + get; + set; + } + + /// + /// Error line. + /// + [JsonPropertyName("line")] + public int Line + { + get; + set; + } + + /// + /// Error column. + /// + [JsonPropertyName("column")] + public int Column + { + get; + set; + } + } + + /// + /// Parsed app manifest properties. + /// + public partial class AppManifestParsedProperties : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Computed scope value + /// + [JsonPropertyName("scope")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Scope + { + get; + set; + } + } + + /// + /// Layout viewport position and dimensions. + /// + public partial class LayoutViewport : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Horizontal offset relative to the document (CSS pixels). + /// + [JsonPropertyName("pageX")] + public int PageX + { + get; + set; + } + + /// + /// Vertical offset relative to the document (CSS pixels). + /// + [JsonPropertyName("pageY")] + public int PageY + { + get; + set; + } + + /// + /// Width (CSS pixels), excludes scrollbar if present. + /// + [JsonPropertyName("clientWidth")] + public int ClientWidth + { + get; + set; + } + + /// + /// Height (CSS pixels), excludes scrollbar if present. + /// + [JsonPropertyName("clientHeight")] + public int ClientHeight + { + get; + set; + } + } + + /// + /// Visual viewport position, dimensions, and scale. + /// + public partial class VisualViewport : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Horizontal offset relative to the layout viewport (CSS pixels). + /// + [JsonPropertyName("offsetX")] + public double OffsetX + { + get; + set; + } + + /// + /// Vertical offset relative to the layout viewport (CSS pixels). + /// + [JsonPropertyName("offsetY")] + public double OffsetY + { + get; + set; + } + + /// + /// Horizontal offset relative to the document (CSS pixels). + /// + [JsonPropertyName("pageX")] + public double PageX + { + get; + set; + } + + /// + /// Vertical offset relative to the document (CSS pixels). + /// + [JsonPropertyName("pageY")] + public double PageY + { + get; + set; + } + + /// + /// Width (CSS pixels), excludes scrollbar if present. + /// + [JsonPropertyName("clientWidth")] + public double ClientWidth + { + get; + set; + } + + /// + /// Height (CSS pixels), excludes scrollbar if present. + /// + [JsonPropertyName("clientHeight")] + public double ClientHeight + { + get; + set; + } + + /// + /// Scale relative to the ideal viewport (size at width=device-width). + /// + [JsonPropertyName("scale")] + public double Scale + { + get; + set; + } + + /// + /// Page zoom factor (CSS to device independent pixels ratio). + /// + [JsonPropertyName("zoom")] + public double? Zoom + { + get; + set; + } + } + + /// + /// Viewport for capturing screenshot. + /// + public partial class Viewport : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// X offset in device independent pixels (dip). + /// + [JsonPropertyName("x")] + public double X + { + get; + set; + } + + /// + /// Y offset in device independent pixels (dip). + /// + [JsonPropertyName("y")] + public double Y + { + get; + set; + } + + /// + /// Rectangle width in device independent pixels (dip). + /// + [JsonPropertyName("width")] + public double Width + { + get; + set; + } + + /// + /// Rectangle height in device independent pixels (dip). + /// + [JsonPropertyName("height")] + public double Height + { + get; + set; + } + + /// + /// Page scale factor. + /// + [JsonPropertyName("scale")] + public double Scale + { + get; + set; + } + } + + /// + /// Generic font families collection. + /// + public partial class FontFamilies : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The standard font-family. + /// + [JsonPropertyName("standard")] + public string Standard + { + get; + set; + } + + /// + /// The fixed font-family. + /// + [JsonPropertyName("fixed")] + public string Fixed + { + get; + set; + } + + /// + /// The serif font-family. + /// + [JsonPropertyName("serif")] + public string Serif + { + get; + set; + } + + /// + /// The sansSerif font-family. + /// + [JsonPropertyName("sansSerif")] + public string SansSerif + { + get; + set; + } + + /// + /// The cursive font-family. + /// + [JsonPropertyName("cursive")] + public string Cursive + { + get; + set; + } + + /// + /// The fantasy font-family. + /// + [JsonPropertyName("fantasy")] + public string Fantasy + { + get; + set; + } + + /// + /// The math font-family. + /// + [JsonPropertyName("math")] + public string Math + { + get; + set; + } + } + + /// + /// Font families collection for a script. + /// + public partial class ScriptFontFamilies : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of the script which these font families are defined for. + /// + [JsonPropertyName("script")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Script + { + get; + set; + } + + /// + /// Generic font families collection for the script. + /// + [JsonPropertyName("fontFamilies")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Page.FontFamilies FontFamilies + { + get; + set; + } + } + + /// + /// Default font sizes. + /// + public partial class FontSizes : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Default standard font size. + /// + [JsonPropertyName("standard")] + public int? Standard + { + get; + set; + } + + /// + /// Default fixed font size. + /// + [JsonPropertyName("fixed")] + public int? Fixed + { + get; + set; + } + } + + /// + /// ClientNavigationReason + /// + public enum ClientNavigationReason + { + /// + /// anchorClick + /// + [JsonPropertyName("anchorClick")] + AnchorClick, + /// + /// formSubmissionGet + /// + [JsonPropertyName("formSubmissionGet")] + FormSubmissionGet, + /// + /// formSubmissionPost + /// + [JsonPropertyName("formSubmissionPost")] + FormSubmissionPost, + /// + /// httpHeaderRefresh + /// + [JsonPropertyName("httpHeaderRefresh")] + HttpHeaderRefresh, + /// + /// initialFrameNavigation + /// + [JsonPropertyName("initialFrameNavigation")] + InitialFrameNavigation, + /// + /// metaTagRefresh + /// + [JsonPropertyName("metaTagRefresh")] + MetaTagRefresh, + /// + /// other + /// + [JsonPropertyName("other")] + Other, + /// + /// pageBlockInterstitial + /// + [JsonPropertyName("pageBlockInterstitial")] + PageBlockInterstitial, + /// + /// reload + /// + [JsonPropertyName("reload")] + Reload, + /// + /// scriptInitiated + /// + [JsonPropertyName("scriptInitiated")] + ScriptInitiated + } + + /// + /// ClientNavigationDisposition + /// + public enum ClientNavigationDisposition + { + /// + /// currentTab + /// + [JsonPropertyName("currentTab")] + CurrentTab, + /// + /// newTab + /// + [JsonPropertyName("newTab")] + NewTab, + /// + /// newWindow + /// + [JsonPropertyName("newWindow")] + NewWindow, + /// + /// download + /// + [JsonPropertyName("download")] + Download + } + + /// + /// InstallabilityErrorArgument + /// + public partial class InstallabilityErrorArgument : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Argument name (e.g. name:'minimum-icon-size-in-pixels'). + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Argument value (e.g. value:'64'). + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// The installability error + /// + public partial class InstallabilityError : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The error id (e.g. 'manifest-missing-suitable-icon'). + /// + [JsonPropertyName("errorId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ErrorId + { + get; + set; + } + + /// + /// The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels', value:'64'}). + /// + [JsonPropertyName("errorArguments")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList ErrorArguments + { + get; + set; + } + } + + /// + /// The referring-policy used for the navigation. + /// + public enum ReferrerPolicy + { + /// + /// noReferrer + /// + [JsonPropertyName("noReferrer")] + NoReferrer, + /// + /// noReferrerWhenDowngrade + /// + [JsonPropertyName("noReferrerWhenDowngrade")] + NoReferrerWhenDowngrade, + /// + /// origin + /// + [JsonPropertyName("origin")] + Origin, + /// + /// originWhenCrossOrigin + /// + [JsonPropertyName("originWhenCrossOrigin")] + OriginWhenCrossOrigin, + /// + /// sameOrigin + /// + [JsonPropertyName("sameOrigin")] + SameOrigin, + /// + /// strictOrigin + /// + [JsonPropertyName("strictOrigin")] + StrictOrigin, + /// + /// strictOriginWhenCrossOrigin + /// + [JsonPropertyName("strictOriginWhenCrossOrigin")] + StrictOriginWhenCrossOrigin, + /// + /// unsafeUrl + /// + [JsonPropertyName("unsafeUrl")] + UnsafeUrl + } + + /// + /// Per-script compilation cache parameters for `Page.produceCompilationCache` + /// + public partial class CompilationCacheParams : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The URL of the script to produce a compilation cache entry for. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// A hint to the backend whether eager compilation is recommended. + /// (the actual compilation mode used is upon backend discretion). + /// + [JsonPropertyName("eager")] + public bool? Eager + { + get; + set; + } + } + + /// + /// FileFilter + /// + public partial class FileFilter : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// Accepts + /// + [JsonPropertyName("accepts")] + public string[] Accepts + { + get; + set; + } + } + + /// + /// FileHandler + /// + public partial class FileHandler : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Action + /// + [JsonPropertyName("action")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Action + { + get; + set; + } + + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Icons + /// + [JsonPropertyName("icons")] + public System.Collections.Generic.IList Icons + { + get; + set; + } + + /// + /// Mimic a map, name is the key, accepts is the value. + /// + [JsonPropertyName("accepts")] + public System.Collections.Generic.IList Accepts + { + get; + set; + } + + /// + /// Won't repeat the enums, using string for easy comparison. Same as the + /// other enums below. + /// + [JsonPropertyName("launchType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LaunchType + { + get; + set; + } + } + + /// + /// The image definition used in both icon and screenshot. + /// + public partial class ImageResource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The src field in the definition, but changing to url in favor of + /// consistency. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Sizes + /// + [JsonPropertyName("sizes")] + public string Sizes + { + get; + set; + } + + /// + /// Type + /// + [JsonPropertyName("type")] + public string Type + { + get; + set; + } + } + + /// + /// LaunchHandler + /// + public partial class LaunchHandler : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ClientMode + /// + [JsonPropertyName("clientMode")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ClientMode + { + get; + set; + } + } + + /// + /// ProtocolHandler + /// + public partial class ProtocolHandler : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Protocol + /// + [JsonPropertyName("protocol")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Protocol + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + } + + /// + /// RelatedApplication + /// + public partial class RelatedApplication : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [JsonPropertyName("id")] + public string Id + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + } + + /// + /// ScopeExtension + /// + public partial class ScopeExtension : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Instead of using tuple, this field always returns the serialized string + /// for easy understanding and comparison. + /// + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + set; + } + + /// + /// HasOriginWildcard + /// + [JsonPropertyName("hasOriginWildcard")] + public bool HasOriginWildcard + { + get; + set; + } + } + + /// + /// Screenshot + /// + public partial class Screenshot : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Image + /// + [JsonPropertyName("image")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Page.ImageResource Image + { + get; + set; + } + + /// + /// FormFactor + /// + [JsonPropertyName("formFactor")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FormFactor + { + get; + set; + } + + /// + /// Label + /// + [JsonPropertyName("label")] + public string Label + { + get; + set; + } + } + + /// + /// ShareTarget + /// + public partial class ShareTarget : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Action + /// + [JsonPropertyName("action")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Action + { + get; + set; + } + + /// + /// Method + /// + [JsonPropertyName("method")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Method + { + get; + set; + } + + /// + /// Enctype + /// + [JsonPropertyName("enctype")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Enctype + { + get; + set; + } + + /// + /// Embed the ShareTargetParams + /// + [JsonPropertyName("title")] + public string Title + { + get; + set; + } + + /// + /// Text + /// + [JsonPropertyName("text")] + public string Text + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + public string Url + { + get; + set; + } + + /// + /// Files + /// + [JsonPropertyName("files")] + public System.Collections.Generic.IList Files + { + get; + set; + } + } + + /// + /// Shortcut + /// + public partial class Shortcut : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + } + + /// + /// WebAppManifest + /// + public partial class WebAppManifest : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// BackgroundColor + /// + [JsonPropertyName("backgroundColor")] + public string BackgroundColor + { + get; + set; + } + + /// + /// The extra description provided by the manifest. + /// + [JsonPropertyName("description")] + public string Description + { + get; + set; + } + + /// + /// Dir + /// + [JsonPropertyName("dir")] + public string Dir + { + get; + set; + } + + /// + /// Display + /// + [JsonPropertyName("display")] + public string Display + { + get; + set; + } + + /// + /// The overrided display mode controlled by the user. + /// + [JsonPropertyName("displayOverrides")] + public string[] DisplayOverrides + { + get; + set; + } + + /// + /// The handlers to open files. + /// + [JsonPropertyName("fileHandlers")] + public System.Collections.Generic.IList FileHandlers + { + get; + set; + } + + /// + /// Icons + /// + [JsonPropertyName("icons")] + public System.Collections.Generic.IList Icons + { + get; + set; + } + + /// + /// Id + /// + [JsonPropertyName("id")] + public string Id + { + get; + set; + } + + /// + /// Lang + /// + [JsonPropertyName("lang")] + public string Lang + { + get; + set; + } + + /// + /// TODO(crbug.com/1231886): This field is non-standard and part of a Chrome + /// experiment. See: + /// https://github.com/WICG/web-app-launch/blob/main/launch_handler.md + /// + [JsonPropertyName("launchHandler")] + public CefSharp.DevTools.Page.LaunchHandler LaunchHandler + { + get; + set; + } + + /// + /// Name + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// Orientation + /// + [JsonPropertyName("orientation")] + public string Orientation + { + get; + set; + } + + /// + /// PreferRelatedApplications + /// + [JsonPropertyName("preferRelatedApplications")] + public bool? PreferRelatedApplications + { + get; + set; + } + + /// + /// The handlers to open protocols. + /// + [JsonPropertyName("protocolHandlers")] + public System.Collections.Generic.IList ProtocolHandlers + { + get; + set; + } + + /// + /// RelatedApplications + /// + [JsonPropertyName("relatedApplications")] + public System.Collections.Generic.IList RelatedApplications + { + get; + set; + } + + /// + /// Scope + /// + [JsonPropertyName("scope")] + public string Scope + { + get; + set; + } + + /// + /// Non-standard, see + /// https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md + /// + [JsonPropertyName("scopeExtensions")] + public System.Collections.Generic.IList ScopeExtensions + { + get; + set; + } + + /// + /// The screenshots used by chromium. + /// + [JsonPropertyName("screenshots")] + public System.Collections.Generic.IList Screenshots + { + get; + set; + } + + /// + /// ShareTarget + /// + [JsonPropertyName("shareTarget")] + public CefSharp.DevTools.Page.ShareTarget ShareTarget + { + get; + set; + } + + /// + /// ShortName + /// + [JsonPropertyName("shortName")] + public string ShortName + { + get; + set; + } + + /// + /// Shortcuts + /// + [JsonPropertyName("shortcuts")] + public System.Collections.Generic.IList Shortcuts + { + get; + set; + } + + /// + /// StartUrl + /// + [JsonPropertyName("startUrl")] + public string StartUrl + { + get; + set; + } + + /// + /// ThemeColor + /// + [JsonPropertyName("themeColor")] + public string ThemeColor + { + get; + set; + } + } + + /// + /// The type of a frameNavigated event. + /// + public enum NavigationType + { + /// + /// Navigation + /// + [JsonPropertyName("Navigation")] + Navigation, + /// + /// BackForwardCacheRestore + /// + [JsonPropertyName("BackForwardCacheRestore")] + BackForwardCacheRestore + } + + /// + /// List of not restored reasons for back-forward cache. + /// + public enum BackForwardCacheNotRestoredReason + { + /// + /// NotPrimaryMainFrame + /// + [JsonPropertyName("NotPrimaryMainFrame")] + NotPrimaryMainFrame, + /// + /// BackForwardCacheDisabled + /// + [JsonPropertyName("BackForwardCacheDisabled")] + BackForwardCacheDisabled, + /// + /// RelatedActiveContentsExist + /// + [JsonPropertyName("RelatedActiveContentsExist")] + RelatedActiveContentsExist, + /// + /// HTTPStatusNotOK + /// + [JsonPropertyName("HTTPStatusNotOK")] + HTTPStatusNotOK, + /// + /// SchemeNotHTTPOrHTTPS + /// + [JsonPropertyName("SchemeNotHTTPOrHTTPS")] + SchemeNotHTTPOrHTTPS, + /// + /// Loading + /// + [JsonPropertyName("Loading")] + Loading, + /// + /// WasGrantedMediaAccess + /// + [JsonPropertyName("WasGrantedMediaAccess")] + WasGrantedMediaAccess, + /// + /// DisableForRenderFrameHostCalled + /// + [JsonPropertyName("DisableForRenderFrameHostCalled")] + DisableForRenderFrameHostCalled, + /// + /// DomainNotAllowed + /// + [JsonPropertyName("DomainNotAllowed")] + DomainNotAllowed, + /// + /// HTTPMethodNotGET + /// + [JsonPropertyName("HTTPMethodNotGET")] + HTTPMethodNotGET, + /// + /// SubframeIsNavigating + /// + [JsonPropertyName("SubframeIsNavigating")] + SubframeIsNavigating, + /// + /// Timeout + /// + [JsonPropertyName("Timeout")] + Timeout, + /// + /// CacheLimit + /// + [JsonPropertyName("CacheLimit")] + CacheLimit, + /// + /// JavaScriptExecution + /// + [JsonPropertyName("JavaScriptExecution")] + JavaScriptExecution, + /// + /// RendererProcessKilled + /// + [JsonPropertyName("RendererProcessKilled")] + RendererProcessKilled, + /// + /// RendererProcessCrashed + /// + [JsonPropertyName("RendererProcessCrashed")] + RendererProcessCrashed, + /// + /// SchedulerTrackedFeatureUsed + /// + [JsonPropertyName("SchedulerTrackedFeatureUsed")] + SchedulerTrackedFeatureUsed, + /// + /// ConflictingBrowsingInstance + /// + [JsonPropertyName("ConflictingBrowsingInstance")] + ConflictingBrowsingInstance, + /// + /// CacheFlushed + /// + [JsonPropertyName("CacheFlushed")] + CacheFlushed, + /// + /// ServiceWorkerVersionActivation + /// + [JsonPropertyName("ServiceWorkerVersionActivation")] + ServiceWorkerVersionActivation, + /// + /// SessionRestored + /// + [JsonPropertyName("SessionRestored")] + SessionRestored, + /// + /// ServiceWorkerPostMessage + /// + [JsonPropertyName("ServiceWorkerPostMessage")] + ServiceWorkerPostMessage, + /// + /// EnteredBackForwardCacheBeforeServiceWorkerHostAdded + /// + [JsonPropertyName("EnteredBackForwardCacheBeforeServiceWorkerHostAdded")] + EnteredBackForwardCacheBeforeServiceWorkerHostAdded, + /// + /// RenderFrameHostReused_SameSite + /// + [JsonPropertyName("RenderFrameHostReused_SameSite")] + RenderFrameHostReusedSameSite, + /// + /// RenderFrameHostReused_CrossSite + /// + [JsonPropertyName("RenderFrameHostReused_CrossSite")] + RenderFrameHostReusedCrossSite, + /// + /// ServiceWorkerClaim + /// + [JsonPropertyName("ServiceWorkerClaim")] + ServiceWorkerClaim, + /// + /// IgnoreEventAndEvict + /// + [JsonPropertyName("IgnoreEventAndEvict")] + IgnoreEventAndEvict, + /// + /// HaveInnerContents + /// + [JsonPropertyName("HaveInnerContents")] + HaveInnerContents, + /// + /// TimeoutPuttingInCache + /// + [JsonPropertyName("TimeoutPuttingInCache")] + TimeoutPuttingInCache, + /// + /// BackForwardCacheDisabledByLowMemory + /// + [JsonPropertyName("BackForwardCacheDisabledByLowMemory")] + BackForwardCacheDisabledByLowMemory, + /// + /// BackForwardCacheDisabledByCommandLine + /// + [JsonPropertyName("BackForwardCacheDisabledByCommandLine")] + BackForwardCacheDisabledByCommandLine, + /// + /// NetworkRequestDatapipeDrainedAsBytesConsumer + /// + [JsonPropertyName("NetworkRequestDatapipeDrainedAsBytesConsumer")] + NetworkRequestDatapipeDrainedAsBytesConsumer, + /// + /// NetworkRequestRedirected + /// + [JsonPropertyName("NetworkRequestRedirected")] + NetworkRequestRedirected, + /// + /// NetworkRequestTimeout + /// + [JsonPropertyName("NetworkRequestTimeout")] + NetworkRequestTimeout, + /// + /// NetworkExceedsBufferLimit + /// + [JsonPropertyName("NetworkExceedsBufferLimit")] + NetworkExceedsBufferLimit, + /// + /// NavigationCancelledWhileRestoring + /// + [JsonPropertyName("NavigationCancelledWhileRestoring")] + NavigationCancelledWhileRestoring, + /// + /// NotMostRecentNavigationEntry + /// + [JsonPropertyName("NotMostRecentNavigationEntry")] + NotMostRecentNavigationEntry, + /// + /// BackForwardCacheDisabledForPrerender + /// + [JsonPropertyName("BackForwardCacheDisabledForPrerender")] + BackForwardCacheDisabledForPrerender, + /// + /// UserAgentOverrideDiffers + /// + [JsonPropertyName("UserAgentOverrideDiffers")] + UserAgentOverrideDiffers, + /// + /// ForegroundCacheLimit + /// + [JsonPropertyName("ForegroundCacheLimit")] + ForegroundCacheLimit, + /// + /// BrowsingInstanceNotSwapped + /// + [JsonPropertyName("BrowsingInstanceNotSwapped")] + BrowsingInstanceNotSwapped, + /// + /// BackForwardCacheDisabledForDelegate + /// + [JsonPropertyName("BackForwardCacheDisabledForDelegate")] + BackForwardCacheDisabledForDelegate, + /// + /// UnloadHandlerExistsInMainFrame + /// + [JsonPropertyName("UnloadHandlerExistsInMainFrame")] + UnloadHandlerExistsInMainFrame, + /// + /// UnloadHandlerExistsInSubFrame + /// + [JsonPropertyName("UnloadHandlerExistsInSubFrame")] + UnloadHandlerExistsInSubFrame, + /// + /// ServiceWorkerUnregistration + /// + [JsonPropertyName("ServiceWorkerUnregistration")] + ServiceWorkerUnregistration, + /// + /// CacheControlNoStore + /// + [JsonPropertyName("CacheControlNoStore")] + CacheControlNoStore, + /// + /// CacheControlNoStoreCookieModified + /// + [JsonPropertyName("CacheControlNoStoreCookieModified")] + CacheControlNoStoreCookieModified, + /// + /// CacheControlNoStoreHTTPOnlyCookieModified + /// + [JsonPropertyName("CacheControlNoStoreHTTPOnlyCookieModified")] + CacheControlNoStoreHTTPOnlyCookieModified, + /// + /// NoResponseHead + /// + [JsonPropertyName("NoResponseHead")] + NoResponseHead, + /// + /// Unknown + /// + [JsonPropertyName("Unknown")] + Unknown, + /// + /// ActivationNavigationsDisallowedForBug1234857 + /// + [JsonPropertyName("ActivationNavigationsDisallowedForBug1234857")] + ActivationNavigationsDisallowedForBug1234857, + /// + /// ErrorDocument + /// + [JsonPropertyName("ErrorDocument")] + ErrorDocument, + /// + /// FencedFramesEmbedder + /// + [JsonPropertyName("FencedFramesEmbedder")] + FencedFramesEmbedder, + /// + /// CookieDisabled + /// + [JsonPropertyName("CookieDisabled")] + CookieDisabled, + /// + /// HTTPAuthRequired + /// + [JsonPropertyName("HTTPAuthRequired")] + HTTPAuthRequired, + /// + /// CookieFlushed + /// + [JsonPropertyName("CookieFlushed")] + CookieFlushed, + /// + /// BroadcastChannelOnMessage + /// + [JsonPropertyName("BroadcastChannelOnMessage")] + BroadcastChannelOnMessage, + /// + /// WebViewSettingsChanged + /// + [JsonPropertyName("WebViewSettingsChanged")] + WebViewSettingsChanged, + /// + /// WebViewJavaScriptObjectChanged + /// + [JsonPropertyName("WebViewJavaScriptObjectChanged")] + WebViewJavaScriptObjectChanged, + /// + /// WebViewMessageListenerInjected + /// + [JsonPropertyName("WebViewMessageListenerInjected")] + WebViewMessageListenerInjected, + /// + /// WebViewSafeBrowsingAllowlistChanged + /// + [JsonPropertyName("WebViewSafeBrowsingAllowlistChanged")] + WebViewSafeBrowsingAllowlistChanged, + /// + /// WebViewDocumentStartJavascriptChanged + /// + [JsonPropertyName("WebViewDocumentStartJavascriptChanged")] + WebViewDocumentStartJavascriptChanged, + /// + /// WebSocket + /// + [JsonPropertyName("WebSocket")] + WebSocket, + /// + /// WebTransport + /// + [JsonPropertyName("WebTransport")] + WebTransport, + /// + /// WebRTC + /// + [JsonPropertyName("WebRTC")] + WebRTC, + /// + /// MainResourceHasCacheControlNoStore + /// + [JsonPropertyName("MainResourceHasCacheControlNoStore")] + MainResourceHasCacheControlNoStore, + /// + /// MainResourceHasCacheControlNoCache + /// + [JsonPropertyName("MainResourceHasCacheControlNoCache")] + MainResourceHasCacheControlNoCache, + /// + /// SubresourceHasCacheControlNoStore + /// + [JsonPropertyName("SubresourceHasCacheControlNoStore")] + SubresourceHasCacheControlNoStore, + /// + /// SubresourceHasCacheControlNoCache + /// + [JsonPropertyName("SubresourceHasCacheControlNoCache")] + SubresourceHasCacheControlNoCache, + /// + /// ContainsPlugins + /// + [JsonPropertyName("ContainsPlugins")] + ContainsPlugins, + /// + /// DocumentLoaded + /// + [JsonPropertyName("DocumentLoaded")] + DocumentLoaded, + /// + /// OutstandingNetworkRequestOthers + /// + [JsonPropertyName("OutstandingNetworkRequestOthers")] + OutstandingNetworkRequestOthers, + /// + /// RequestedMIDIPermission + /// + [JsonPropertyName("RequestedMIDIPermission")] + RequestedMIDIPermission, + /// + /// RequestedAudioCapturePermission + /// + [JsonPropertyName("RequestedAudioCapturePermission")] + RequestedAudioCapturePermission, + /// + /// RequestedVideoCapturePermission + /// + [JsonPropertyName("RequestedVideoCapturePermission")] + RequestedVideoCapturePermission, + /// + /// RequestedBackForwardCacheBlockedSensors + /// + [JsonPropertyName("RequestedBackForwardCacheBlockedSensors")] + RequestedBackForwardCacheBlockedSensors, + /// + /// RequestedBackgroundWorkPermission + /// + [JsonPropertyName("RequestedBackgroundWorkPermission")] + RequestedBackgroundWorkPermission, + /// + /// BroadcastChannel + /// + [JsonPropertyName("BroadcastChannel")] + BroadcastChannel, + /// + /// WebXR + /// + [JsonPropertyName("WebXR")] + WebXR, + /// + /// SharedWorker + /// + [JsonPropertyName("SharedWorker")] + SharedWorker, + /// + /// SharedWorkerMessage + /// + [JsonPropertyName("SharedWorkerMessage")] + SharedWorkerMessage, + /// + /// SharedWorkerWithNoActiveClient + /// + [JsonPropertyName("SharedWorkerWithNoActiveClient")] + SharedWorkerWithNoActiveClient, + /// + /// WebLocks + /// + [JsonPropertyName("WebLocks")] + WebLocks, + /// + /// WebLocksContention + /// + [JsonPropertyName("WebLocksContention")] + WebLocksContention, + /// + /// WebHID + /// + [JsonPropertyName("WebHID")] + WebHID, + /// + /// WebBluetooth + /// + [JsonPropertyName("WebBluetooth")] + WebBluetooth, + /// + /// WebShare + /// + [JsonPropertyName("WebShare")] + WebShare, + /// + /// RequestedStorageAccessGrant + /// + [JsonPropertyName("RequestedStorageAccessGrant")] + RequestedStorageAccessGrant, + /// + /// WebNfc + /// + [JsonPropertyName("WebNfc")] + WebNfc, + /// + /// OutstandingNetworkRequestFetch + /// + [JsonPropertyName("OutstandingNetworkRequestFetch")] + OutstandingNetworkRequestFetch, + /// + /// OutstandingNetworkRequestXHR + /// + [JsonPropertyName("OutstandingNetworkRequestXHR")] + OutstandingNetworkRequestXHR, + /// + /// AppBanner + /// + [JsonPropertyName("AppBanner")] + AppBanner, + /// + /// Printing + /// + [JsonPropertyName("Printing")] + Printing, + /// + /// WebDatabase + /// + [JsonPropertyName("WebDatabase")] + WebDatabase, + /// + /// PictureInPicture + /// + [JsonPropertyName("PictureInPicture")] + PictureInPicture, + /// + /// SpeechRecognizer + /// + [JsonPropertyName("SpeechRecognizer")] + SpeechRecognizer, + /// + /// IdleManager + /// + [JsonPropertyName("IdleManager")] + IdleManager, + /// + /// PaymentManager + /// + [JsonPropertyName("PaymentManager")] + PaymentManager, + /// + /// SpeechSynthesis + /// + [JsonPropertyName("SpeechSynthesis")] + SpeechSynthesis, + /// + /// KeyboardLock + /// + [JsonPropertyName("KeyboardLock")] + KeyboardLock, + /// + /// WebOTPService + /// + [JsonPropertyName("WebOTPService")] + WebOTPService, + /// + /// OutstandingNetworkRequestDirectSocket + /// + [JsonPropertyName("OutstandingNetworkRequestDirectSocket")] + OutstandingNetworkRequestDirectSocket, + /// + /// InjectedJavascript + /// + [JsonPropertyName("InjectedJavascript")] + InjectedJavascript, + /// + /// InjectedStyleSheet + /// + [JsonPropertyName("InjectedStyleSheet")] + InjectedStyleSheet, + /// + /// KeepaliveRequest + /// + [JsonPropertyName("KeepaliveRequest")] + KeepaliveRequest, + /// + /// IndexedDBEvent + /// + [JsonPropertyName("IndexedDBEvent")] + IndexedDBEvent, + /// + /// Dummy + /// + [JsonPropertyName("Dummy")] + Dummy, + /// + /// JsNetworkRequestReceivedCacheControlNoStoreResource + /// + [JsonPropertyName("JsNetworkRequestReceivedCacheControlNoStoreResource")] + JsNetworkRequestReceivedCacheControlNoStoreResource, + /// + /// WebRTCUsedWithCCNS + /// + [JsonPropertyName("WebRTCUsedWithCCNS")] + WebRTCUsedWithCCNS, + /// + /// WebTransportUsedWithCCNS + /// + [JsonPropertyName("WebTransportUsedWithCCNS")] + WebTransportUsedWithCCNS, + /// + /// WebSocketUsedWithCCNS + /// + [JsonPropertyName("WebSocketUsedWithCCNS")] + WebSocketUsedWithCCNS, + /// + /// SmartCard + /// + [JsonPropertyName("SmartCard")] + SmartCard, + /// + /// LiveMediaStreamTrack + /// + [JsonPropertyName("LiveMediaStreamTrack")] + LiveMediaStreamTrack, + /// + /// UnloadHandler + /// + [JsonPropertyName("UnloadHandler")] + UnloadHandler, + /// + /// ParserAborted + /// + [JsonPropertyName("ParserAborted")] + ParserAborted, + /// + /// ContentSecurityHandler + /// + [JsonPropertyName("ContentSecurityHandler")] + ContentSecurityHandler, + /// + /// ContentWebAuthenticationAPI + /// + [JsonPropertyName("ContentWebAuthenticationAPI")] + ContentWebAuthenticationAPI, + /// + /// ContentFileChooser + /// + [JsonPropertyName("ContentFileChooser")] + ContentFileChooser, + /// + /// ContentSerial + /// + [JsonPropertyName("ContentSerial")] + ContentSerial, + /// + /// ContentFileSystemAccess + /// + [JsonPropertyName("ContentFileSystemAccess")] + ContentFileSystemAccess, + /// + /// ContentMediaDevicesDispatcherHost + /// + [JsonPropertyName("ContentMediaDevicesDispatcherHost")] + ContentMediaDevicesDispatcherHost, + /// + /// ContentWebBluetooth + /// + [JsonPropertyName("ContentWebBluetooth")] + ContentWebBluetooth, + /// + /// ContentWebUSB + /// + [JsonPropertyName("ContentWebUSB")] + ContentWebUSB, + /// + /// ContentMediaSessionService + /// + [JsonPropertyName("ContentMediaSessionService")] + ContentMediaSessionService, + /// + /// ContentScreenReader + /// + [JsonPropertyName("ContentScreenReader")] + ContentScreenReader, + /// + /// ContentDiscarded + /// + [JsonPropertyName("ContentDiscarded")] + ContentDiscarded, + /// + /// EmbedderPopupBlockerTabHelper + /// + [JsonPropertyName("EmbedderPopupBlockerTabHelper")] + EmbedderPopupBlockerTabHelper, + /// + /// EmbedderSafeBrowsingTriggeredPopupBlocker + /// + [JsonPropertyName("EmbedderSafeBrowsingTriggeredPopupBlocker")] + EmbedderSafeBrowsingTriggeredPopupBlocker, + /// + /// EmbedderSafeBrowsingThreatDetails + /// + [JsonPropertyName("EmbedderSafeBrowsingThreatDetails")] + EmbedderSafeBrowsingThreatDetails, + /// + /// EmbedderAppBannerManager + /// + [JsonPropertyName("EmbedderAppBannerManager")] + EmbedderAppBannerManager, + /// + /// EmbedderDomDistillerViewerSource + /// + [JsonPropertyName("EmbedderDomDistillerViewerSource")] + EmbedderDomDistillerViewerSource, + /// + /// EmbedderDomDistillerSelfDeletingRequestDelegate + /// + [JsonPropertyName("EmbedderDomDistillerSelfDeletingRequestDelegate")] + EmbedderDomDistillerSelfDeletingRequestDelegate, + /// + /// EmbedderOomInterventionTabHelper + /// + [JsonPropertyName("EmbedderOomInterventionTabHelper")] + EmbedderOomInterventionTabHelper, + /// + /// EmbedderOfflinePage + /// + [JsonPropertyName("EmbedderOfflinePage")] + EmbedderOfflinePage, + /// + /// EmbedderChromePasswordManagerClientBindCredentialManager + /// + [JsonPropertyName("EmbedderChromePasswordManagerClientBindCredentialManager")] + EmbedderChromePasswordManagerClientBindCredentialManager, + /// + /// EmbedderPermissionRequestManager + /// + [JsonPropertyName("EmbedderPermissionRequestManager")] + EmbedderPermissionRequestManager, + /// + /// EmbedderModalDialog + /// + [JsonPropertyName("EmbedderModalDialog")] + EmbedderModalDialog, + /// + /// EmbedderExtensions + /// + [JsonPropertyName("EmbedderExtensions")] + EmbedderExtensions, + /// + /// EmbedderExtensionMessaging + /// + [JsonPropertyName("EmbedderExtensionMessaging")] + EmbedderExtensionMessaging, + /// + /// EmbedderExtensionMessagingForOpenPort + /// + [JsonPropertyName("EmbedderExtensionMessagingForOpenPort")] + EmbedderExtensionMessagingForOpenPort, + /// + /// EmbedderExtensionSentMessageToCachedFrame + /// + [JsonPropertyName("EmbedderExtensionSentMessageToCachedFrame")] + EmbedderExtensionSentMessageToCachedFrame, + /// + /// RequestedByWebViewClient + /// + [JsonPropertyName("RequestedByWebViewClient")] + RequestedByWebViewClient, + /// + /// PostMessageByWebViewClient + /// + [JsonPropertyName("PostMessageByWebViewClient")] + PostMessageByWebViewClient, + /// + /// CacheControlNoStoreDeviceBoundSessionTerminated + /// + [JsonPropertyName("CacheControlNoStoreDeviceBoundSessionTerminated")] + CacheControlNoStoreDeviceBoundSessionTerminated, + /// + /// CacheLimitPrunedOnModerateMemoryPressure + /// + [JsonPropertyName("CacheLimitPrunedOnModerateMemoryPressure")] + CacheLimitPrunedOnModerateMemoryPressure, + /// + /// CacheLimitPrunedOnCriticalMemoryPressure + /// + [JsonPropertyName("CacheLimitPrunedOnCriticalMemoryPressure")] + CacheLimitPrunedOnCriticalMemoryPressure + } + + /// + /// Types of not restored reasons for back-forward cache. + /// + public enum BackForwardCacheNotRestoredReasonType + { + /// + /// SupportPending + /// + [JsonPropertyName("SupportPending")] + SupportPending, + /// + /// PageSupportNeeded + /// + [JsonPropertyName("PageSupportNeeded")] + PageSupportNeeded, + /// + /// Circumstantial + /// + [JsonPropertyName("Circumstantial")] + Circumstantial + } + + /// + /// BackForwardCacheBlockingDetails + /// + public partial class BackForwardCacheBlockingDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Url of the file where blockage happened. Optional because of tests. + /// + [JsonPropertyName("url")] + public string Url + { + get; + set; + } + + /// + /// Function name where blockage happened. Optional because of anonymous functions and tests. + /// + [JsonPropertyName("function")] + public string Function + { + get; + set; + } + + /// + /// Line number in the script (0-based). + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// Column number in the script (0-based). + /// + [JsonPropertyName("columnNumber")] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// BackForwardCacheNotRestoredExplanation + /// + public partial class BackForwardCacheNotRestoredExplanation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type of the reason + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Page.BackForwardCacheNotRestoredReasonType Type + { + get; + set; + } + + /// + /// Not restored reason + /// + [JsonPropertyName("reason")] + public CefSharp.DevTools.Page.BackForwardCacheNotRestoredReason Reason + { + get; + set; + } + + /// + /// Context associated with the reason. The meaning of this context is + /// dependent on the reason: + /// - EmbedderExtensionSentMessageToCachedFrame: the extension ID. + /// + [JsonPropertyName("context")] + public string Context + { + get; + set; + } + + /// + /// Details + /// + [JsonPropertyName("details")] + public System.Collections.Generic.IList Details + { + get; + set; + } + } + + /// + /// BackForwardCacheNotRestoredExplanationTree + /// + public partial class BackForwardCacheNotRestoredExplanationTree : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// URL of each frame + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Not restored reasons of each frame + /// + [JsonPropertyName("explanations")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Explanations + { + get; + set; + } + + /// + /// Array of children frame + /// + [JsonPropertyName("children")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Children + { + get; + set; + } + } + + /// + /// domContentEventFired + /// + public class DomContentEventFiredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Input mode. + /// + public enum FileChooserOpenedMode + { + /// + /// selectSingle + /// + [JsonPropertyName("selectSingle")] + SelectSingle, + /// + /// selectMultiple + /// + [JsonPropertyName("selectMultiple")] + SelectMultiple + } + + /// + /// Emitted only when `page.interceptFileChooser` is enabled. + /// + public class FileChooserOpenedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame containing input node. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Input mode. + /// + [JsonInclude] + [JsonPropertyName("mode")] + public CefSharp.DevTools.Page.FileChooserOpenedMode Mode + { + get; + private set; + } + + /// + /// Input node id. Only present for file choosers opened via an `<input type="file" >` element. + /// + [JsonInclude] + [JsonPropertyName("backendNodeId")] + public int? BackendNodeId + { + get; + private set; + } + } + + /// + /// Fired when frame has been attached to its parent. + /// + public class FrameAttachedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has been attached. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Parent frame identifier. + /// + [JsonInclude] + [JsonPropertyName("parentFrameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ParentFrameId + { + get; + private set; + } + + /// + /// JavaScript stack trace of when frame was attached, only set if frame initiated from script. + /// + [JsonInclude] + [JsonPropertyName("stack")] + public CefSharp.DevTools.Runtime.StackTrace Stack + { + get; + private set; + } + } + + /// + /// Fired when frame no longer has a scheduled navigation. + /// + public class FrameClearedScheduledNavigationEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has cleared its scheduled navigation. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + } + + /// + /// FrameDetachedReason + /// + public enum FrameDetachedReason + { + /// + /// remove + /// + [JsonPropertyName("remove")] + Remove, + /// + /// swap + /// + [JsonPropertyName("swap")] + Swap + } + + /// + /// Fired when frame has been detached from its parent. + /// + public class FrameDetachedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has been detached. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Reason + /// + [JsonInclude] + [JsonPropertyName("reason")] + public CefSharp.DevTools.Page.FrameDetachedReason Reason + { + get; + private set; + } + } + + /// + /// Fired before frame subtree is detached. Emitted before any frame of the + /// subtree is actually detached. + /// + public class FrameSubtreeWillBeDetachedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that is the root of the subtree that will be detached. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + } + + /// + /// Fired once navigation of the frame has completed. Frame is now associated with the new loader. + /// + public class FrameNavigatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Frame object. + /// + [JsonInclude] + [JsonPropertyName("frame")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Page.Frame Frame + { + get; + private set; + } + + /// + /// Type + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Page.NavigationType Type + { + get; + private set; + } + } + + /// + /// Fired when opening document to write to. + /// + public class DocumentOpenedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Frame object. + /// + [JsonInclude] + [JsonPropertyName("frame")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Page.Frame Frame + { + get; + private set; + } + } + + /// + /// FrameStartedNavigatingNavigationType + /// + public enum FrameStartedNavigatingNavigationType + { + /// + /// reload + /// + [JsonPropertyName("reload")] + Reload, + /// + /// reloadBypassingCache + /// + [JsonPropertyName("reloadBypassingCache")] + ReloadBypassingCache, + /// + /// restore + /// + [JsonPropertyName("restore")] + Restore, + /// + /// restoreWithPost + /// + [JsonPropertyName("restoreWithPost")] + RestoreWithPost, + /// + /// historySameDocument + /// + [JsonPropertyName("historySameDocument")] + HistorySameDocument, + /// + /// historyDifferentDocument + /// + [JsonPropertyName("historyDifferentDocument")] + HistoryDifferentDocument, + /// + /// sameDocument + /// + [JsonPropertyName("sameDocument")] + SameDocument, + /// + /// differentDocument + /// + [JsonPropertyName("differentDocument")] + DifferentDocument + } + + /// + /// Fired when a navigation starts. This event is fired for both + /// renderer-initiated and browser-initiated navigations. For renderer-initiated + /// navigations, the event is fired after `frameRequestedNavigation`. + /// Navigation may still be cancelled after the event is issued. Multiple events + /// can be fired for a single navigation, for example, when a same-document + /// navigation becomes a cross-document navigation (such as in the case of a + /// frameset). + /// + public class FrameStartedNavigatingEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ID of the frame that is being navigated. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// The URL the navigation started with. The final URL can be different. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Loader identifier. Even though it is present in case of same-document + /// navigation, the previously committed loaderId would not change unless + /// the navigation changes from a same-document to a cross-document + /// navigation. + /// + [JsonInclude] + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + private set; + } + + /// + /// NavigationType + /// + [JsonInclude] + [JsonPropertyName("navigationType")] + public CefSharp.DevTools.Page.FrameStartedNavigatingNavigationType NavigationType + { + get; + private set; + } + } + + /// + /// Fired when a renderer-initiated navigation is requested. + /// Navigation may still be cancelled after the event is issued. + /// + public class FrameRequestedNavigationEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that is being navigated. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// The reason for the navigation. + /// + [JsonInclude] + [JsonPropertyName("reason")] + public CefSharp.DevTools.Page.ClientNavigationReason Reason + { + get; + private set; + } + + /// + /// The destination URL for the requested navigation. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// The disposition for the navigation. + /// + [JsonInclude] + [JsonPropertyName("disposition")] + public CefSharp.DevTools.Page.ClientNavigationDisposition Disposition + { + get; + private set; + } + } + + /// + /// Fired when frame schedules a potential navigation. + /// + public class FrameScheduledNavigationEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has scheduled a navigation. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Delay (in seconds) until the navigation is scheduled to begin. The navigation is not + /// guaranteed to start. + /// + [JsonInclude] + [JsonPropertyName("delay")] + public double Delay + { + get; + private set; + } + + /// + /// The reason for the navigation. + /// + [JsonInclude] + [JsonPropertyName("reason")] + public CefSharp.DevTools.Page.ClientNavigationReason Reason + { + get; + private set; + } + + /// + /// The destination URL for the scheduled navigation. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + } + + /// + /// Fired when frame has started loading. + /// + public class FrameStartedLoadingEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has started loading. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + } + + /// + /// Fired when frame has stopped loading. + /// + public class FrameStoppedLoadingEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that has stopped loading. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + } + + /// + /// Fired when page is about to start a download. + /// Deprecated. Use Browser.downloadWillBegin instead. + /// + public class DownloadWillBeginEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame that caused download to begin. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Global unique identifier of the download. + /// + [JsonInclude] + [JsonPropertyName("guid")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Guid + { + get; + private set; + } + + /// + /// URL of the resource being downloaded. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Suggested file name of the resource (the actual name of the file saved on disk may differ). + /// + [JsonInclude] + [JsonPropertyName("suggestedFilename")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SuggestedFilename + { + get; + private set; + } + } + + /// + /// Download status. + /// + public enum DownloadProgressState + { + /// + /// inProgress + /// + [JsonPropertyName("inProgress")] + InProgress, + /// + /// completed + /// + [JsonPropertyName("completed")] + Completed, + /// + /// canceled + /// + [JsonPropertyName("canceled")] + Canceled + } + + /// + /// Fired when download makes progress. Last call has |done| == true. + /// Deprecated. Use Browser.downloadProgress instead. + /// + public class DownloadProgressEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Global unique identifier of the download. + /// + [JsonInclude] + [JsonPropertyName("guid")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Guid + { + get; + private set; + } + + /// + /// Total expected bytes to download. + /// + [JsonInclude] + [JsonPropertyName("totalBytes")] + public double TotalBytes + { + get; + private set; + } + + /// + /// Total bytes received. + /// + [JsonInclude] + [JsonPropertyName("receivedBytes")] + public double ReceivedBytes + { + get; + private set; + } + + /// + /// Download status. + /// + [JsonInclude] + [JsonPropertyName("state")] + public CefSharp.DevTools.Page.DownloadProgressState State + { + get; + private set; + } + } + + /// + /// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been + /// closed. + /// + public class JavascriptDialogClosedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Frame id. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Whether dialog was confirmed. + /// + [JsonInclude] + [JsonPropertyName("result")] + public bool Result + { + get; + private set; + } + + /// + /// User input in case of prompt. + /// + [JsonInclude] + [JsonPropertyName("userInput")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string UserInput + { + get; + private set; + } + } + + /// + /// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to + /// open. + /// + public class JavascriptDialogOpeningEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Frame url. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Frame id. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Message that will be displayed by the dialog. + /// + [JsonInclude] + [JsonPropertyName("message")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Message + { + get; + private set; + } + + /// + /// Dialog type. + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Page.DialogType Type + { + get; + private set; + } + + /// + /// True iff browser is capable showing or acting on the given dialog. When browser has no + /// dialog handler for given target, calling alert while Page domain is engaged will stall + /// the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog. + /// + [JsonInclude] + [JsonPropertyName("hasBrowserHandler")] + public bool HasBrowserHandler + { + get; + private set; + } + + /// + /// Default dialog prompt. + /// + [JsonInclude] + [JsonPropertyName("defaultPrompt")] + public string DefaultPrompt + { + get; + private set; + } + } + + /// + /// Fired for lifecycle events (navigation, load, paint, etc) in the current + /// target (including local frames). + /// + public class LifecycleEventEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Loader identifier. Empty string if the request is fetched from worker. + /// + [JsonInclude] + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + private set; + } + + /// + /// Name + /// + [JsonInclude] + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do + /// not assume any ordering with the Page.frameNavigated event. This event is fired only for + /// main-frame history navigation where the document changes (non-same-document navigations), + /// when bfcache navigation fails. + /// + public class BackForwardCacheNotUsedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The loader id for the associated navigation. + /// + [JsonInclude] + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + private set; + } + + /// + /// The frame id of the associated frame. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Array of reasons why the page could not be cached. This must not be empty. + /// + [JsonInclude] + [JsonPropertyName("notRestoredExplanations")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList NotRestoredExplanations + { + get; + private set; + } + + /// + /// Tree structure of reasons why the page could not be cached for each frame. + /// + [JsonInclude] + [JsonPropertyName("notRestoredExplanationsTree")] + public CefSharp.DevTools.Page.BackForwardCacheNotRestoredExplanationTree NotRestoredExplanationsTree + { + get; + private set; + } + } + + /// + /// loadEventFired + /// + public class LoadEventFiredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// Navigation type + /// + public enum NavigatedWithinDocumentNavigationType + { + /// + /// fragment + /// + [JsonPropertyName("fragment")] + Fragment, + /// + /// historyApi + /// + [JsonPropertyName("historyApi")] + HistoryApi, + /// + /// other + /// + [JsonPropertyName("other")] + Other + } + + /// + /// Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. + /// + public class NavigatedWithinDocumentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the frame. + /// + [JsonInclude] + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + private set; + } + + /// + /// Frame's new url. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Navigation type + /// + [JsonInclude] + [JsonPropertyName("navigationType")] + public CefSharp.DevTools.Page.NavigatedWithinDocumentNavigationType NavigationType + { + get; + private set; + } + } + + /// + /// Compressed image data requested by the `startScreencast`. + /// + public class ScreencastFrameEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Base64-encoded compressed image. + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + private set; + } + + /// + /// Screencast frame metadata. + /// + [JsonInclude] + [JsonPropertyName("metadata")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Page.ScreencastFrameMetadata Metadata + { + get; + private set; + } + + /// + /// Frame number. + /// + [JsonInclude] + [JsonPropertyName("sessionId")] + public int SessionId + { + get; + private set; + } + } + + /// + /// Fired when the page with currently enabled screencast was shown or hidden `. + /// + public class ScreencastVisibilityChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// True if the page is visible. + /// + [JsonInclude] + [JsonPropertyName("visible")] + public bool Visible + { + get; + private set; + } + } + + /// + /// Fired when a new window is going to be opened, via window.open(), link click, form submission, + /// etc. + /// + public class WindowOpenEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The URL for the new window. + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Window name. + /// + [JsonInclude] + [JsonPropertyName("windowName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string WindowName + { + get; + private set; + } + + /// + /// An array of enabled window features. + /// + [JsonInclude] + [JsonPropertyName("windowFeatures")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] WindowFeatures + { + get; + private set; + } + + /// + /// Whether or not it was triggered by user gesture. + /// + [JsonInclude] + [JsonPropertyName("userGesture")] + public bool UserGesture + { + get; + private set; + } + } + + /// + /// Issued for every compilation cache generated. + /// + public class CompilationCacheProducedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Url + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Base64-encoded data + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Performance +{ + /// + /// Run-time execution metric. + /// + public partial class Metric : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Metric name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Metric value. + /// + [JsonPropertyName("value")] + public double Value + { + get; + set; + } + } + + /// + /// Current values of the metrics. + /// + public class MetricsEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Current values of the metrics. + /// + [JsonInclude] + [JsonPropertyName("metrics")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Metrics + { + get; + private set; + } + + /// + /// Timestamp title. + /// + [JsonInclude] + [JsonPropertyName("title")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Title + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.PerformanceTimeline +{ + /// + /// See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl + /// + public partial class LargestContentfulPaint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// RenderTime + /// + [JsonPropertyName("renderTime")] + public double RenderTime + { + get; + set; + } + + /// + /// LoadTime + /// + [JsonPropertyName("loadTime")] + public double LoadTime + { + get; + set; + } + + /// + /// The number of pixels being painted. + /// + [JsonPropertyName("size")] + public double Size + { + get; + set; + } + + /// + /// The id attribute of the element, if available. + /// + [JsonPropertyName("elementId")] + public string ElementId + { + get; + set; + } + + /// + /// The URL of the image (may be trimmed). + /// + [JsonPropertyName("url")] + public string Url + { + get; + set; + } + + /// + /// NodeId + /// + [JsonPropertyName("nodeId")] + public int? NodeId + { + get; + set; + } + } + + /// + /// LayoutShiftAttribution + /// + public partial class LayoutShiftAttribution : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// PreviousRect + /// + [JsonPropertyName("previousRect")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect PreviousRect + { + get; + set; + } + + /// + /// CurrentRect + /// + [JsonPropertyName("currentRect")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.DOM.Rect CurrentRect + { + get; + set; + } + + /// + /// NodeId + /// + [JsonPropertyName("nodeId")] + public int? NodeId + { + get; + set; + } + } + + /// + /// See https://wicg.github.io/layout-instability/#sec-layout-shift and layout_shift.idl + /// + public partial class LayoutShift : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Score increment produced by this event. + /// + [JsonPropertyName("value")] + public double Value + { + get; + set; + } + + /// + /// HadRecentInput + /// + [JsonPropertyName("hadRecentInput")] + public bool HadRecentInput + { + get; + set; + } + + /// + /// LastInputTime + /// + [JsonPropertyName("lastInputTime")] + public double LastInputTime + { + get; + set; + } + + /// + /// Sources + /// + [JsonPropertyName("sources")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Sources + { + get; + set; + } + } + + /// + /// TimelineEvent + /// + public partial class TimelineEvent : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Identifies the frame that this event is related to. Empty for non-frame targets. + /// + [JsonPropertyName("frameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FrameId + { + get; + set; + } + + /// + /// The event type, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype + /// This determines which of the optional "details" fields is present. + /// + [JsonPropertyName("type")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Type + { + get; + set; + } + + /// + /// Name may be empty depending on the type. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Time in seconds since Epoch, monotonically increasing within document lifetime. + /// + [JsonPropertyName("time")] + public double Time + { + get; + set; + } + + /// + /// Event duration, if applicable. + /// + [JsonPropertyName("duration")] + public double? Duration + { + get; + set; + } + + /// + /// LcpDetails + /// + [JsonPropertyName("lcpDetails")] + public CefSharp.DevTools.PerformanceTimeline.LargestContentfulPaint LcpDetails + { + get; + set; + } + + /// + /// LayoutShiftDetails + /// + [JsonPropertyName("layoutShiftDetails")] + public CefSharp.DevTools.PerformanceTimeline.LayoutShift LayoutShiftDetails + { + get; + set; + } + } + + /// + /// Sent when a performance timeline event is added. See reportPerformanceTimeline method. + /// + public class TimelineEventAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Event + /// + [JsonInclude] + [JsonPropertyName("event")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.PerformanceTimeline.TimelineEvent Event + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Preload +{ + /// + /// Corresponds to SpeculationRuleSet + /// + public partial class RuleSet : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// Identifies a document which the rule set is associated with. + /// + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + set; + } + + /// + /// Source text of JSON representing the rule set. If it comes from + /// `<script>` tag, it is the textContent of the node. Note that it is + /// a JSON for valid case. + /// + /// See also: + /// - https://wicg.github.io/nav-speculation/speculation-rules.html + /// - https://github.com/WICG/nav-speculation/blob/main/triggers.md + /// + [JsonPropertyName("sourceText")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SourceText + { + get; + set; + } + + /// + /// A speculation rule set is either added through an inline + /// `<script>` tag or through an external resource via the + /// 'Speculation-Rules' HTTP header. For the first case, we include + /// the BackendNodeId of the relevant `<script>` tag. For the second + /// case, we include the external URL where the rule set was loaded + /// from, and also RequestId if Network domain is enabled. + /// + /// See also: + /// - https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-script + /// - https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-header + /// + [JsonPropertyName("backendNodeId")] + public int? BackendNodeId + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + public string Url + { + get; + set; + } + + /// + /// RequestId + /// + [JsonPropertyName("requestId")] + public string RequestId + { + get; + set; + } + + /// + /// Error information + /// `errorMessage` is null iff `errorType` is null. + /// + [JsonPropertyName("errorType")] + public CefSharp.DevTools.Preload.RuleSetErrorType? ErrorType + { + get; + set; + } + + /// + /// TODO(https://crbug.com/1425354): Replace this property with structured error. + /// + [JsonPropertyName("errorMessage")] + public string ErrorMessage + { + get; + set; + } + + /// + /// For more details, see: + /// https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md + /// + [JsonPropertyName("tag")] + public string Tag + { + get; + set; + } + } + + /// + /// RuleSetErrorType + /// + public enum RuleSetErrorType + { + /// + /// SourceIsNotJsonObject + /// + [JsonPropertyName("SourceIsNotJsonObject")] + SourceIsNotJsonObject, + /// + /// InvalidRulesSkipped + /// + [JsonPropertyName("InvalidRulesSkipped")] + InvalidRulesSkipped, + /// + /// InvalidRulesetLevelTag + /// + [JsonPropertyName("InvalidRulesetLevelTag")] + InvalidRulesetLevelTag + } + + /// + /// The type of preloading attempted. It corresponds to + /// mojom::SpeculationAction (although PrefetchWithSubresources is omitted as it + /// isn't being used by clients). + /// + public enum SpeculationAction + { + /// + /// Prefetch + /// + [JsonPropertyName("Prefetch")] + Prefetch, + /// + /// Prerender + /// + [JsonPropertyName("Prerender")] + Prerender, + /// + /// PrerenderUntilScript + /// + [JsonPropertyName("PrerenderUntilScript")] + PrerenderUntilScript + } + + /// + /// Corresponds to mojom::SpeculationTargetHint. + /// See https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints + /// + public enum SpeculationTargetHint + { + /// + /// Blank + /// + [JsonPropertyName("Blank")] + Blank, + /// + /// Self + /// + [JsonPropertyName("Self")] + Self + } + + /// + /// A key that identifies a preloading attempt. + /// + /// The url used is the url specified by the trigger (i.e. the initial URL), and + /// not the final url that is navigated to. For example, prerendering allows + /// same-origin main frame navigations during the attempt, but the attempt is + /// still keyed with the initial URL. + /// + public partial class PreloadingAttemptKey : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// LoaderId + /// + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + set; + } + + /// + /// Action + /// + [JsonPropertyName("action")] + public CefSharp.DevTools.Preload.SpeculationAction Action + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// TargetHint + /// + [JsonPropertyName("targetHint")] + public CefSharp.DevTools.Preload.SpeculationTargetHint? TargetHint + { + get; + set; + } + } + + /// + /// Lists sources for a preloading attempt, specifically the ids of rule sets + /// that had a speculation rule that triggered the attempt, and the + /// BackendNodeIds of <a href> or <area href> elements that triggered the + /// attempt (in the case of attempts triggered by a document rule). It is + /// possible for multiple rule sets and links to trigger a single attempt. + /// + public partial class PreloadingAttemptSource : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Preload.PreloadingAttemptKey Key + { + get; + set; + } + + /// + /// RuleSetIds + /// + [JsonPropertyName("ruleSetIds")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] RuleSetIds + { + get; + set; + } + + /// + /// NodeIds + /// + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + set; + } + } + + /// + /// List of FinalStatus reasons for Prerender2. + /// + public enum PrerenderFinalStatus + { + /// + /// Activated + /// + [JsonPropertyName("Activated")] + Activated, + /// + /// Destroyed + /// + [JsonPropertyName("Destroyed")] + Destroyed, + /// + /// LowEndDevice + /// + [JsonPropertyName("LowEndDevice")] + LowEndDevice, + /// + /// InvalidSchemeRedirect + /// + [JsonPropertyName("InvalidSchemeRedirect")] + InvalidSchemeRedirect, + /// + /// InvalidSchemeNavigation + /// + [JsonPropertyName("InvalidSchemeNavigation")] + InvalidSchemeNavigation, + /// + /// NavigationRequestBlockedByCsp + /// + [JsonPropertyName("NavigationRequestBlockedByCsp")] + NavigationRequestBlockedByCsp, + /// + /// MojoBinderPolicy + /// + [JsonPropertyName("MojoBinderPolicy")] + MojoBinderPolicy, + /// + /// RendererProcessCrashed + /// + [JsonPropertyName("RendererProcessCrashed")] + RendererProcessCrashed, + /// + /// RendererProcessKilled + /// + [JsonPropertyName("RendererProcessKilled")] + RendererProcessKilled, + /// + /// Download + /// + [JsonPropertyName("Download")] + Download, + /// + /// TriggerDestroyed + /// + [JsonPropertyName("TriggerDestroyed")] + TriggerDestroyed, + /// + /// NavigationNotCommitted + /// + [JsonPropertyName("NavigationNotCommitted")] + NavigationNotCommitted, + /// + /// NavigationBadHttpStatus + /// + [JsonPropertyName("NavigationBadHttpStatus")] + NavigationBadHttpStatus, + /// + /// ClientCertRequested + /// + [JsonPropertyName("ClientCertRequested")] + ClientCertRequested, + /// + /// NavigationRequestNetworkError + /// + [JsonPropertyName("NavigationRequestNetworkError")] + NavigationRequestNetworkError, + /// + /// CancelAllHostsForTesting + /// + [JsonPropertyName("CancelAllHostsForTesting")] + CancelAllHostsForTesting, + /// + /// DidFailLoad + /// + [JsonPropertyName("DidFailLoad")] + DidFailLoad, + /// + /// Stop + /// + [JsonPropertyName("Stop")] + Stop, + /// + /// SslCertificateError + /// + [JsonPropertyName("SslCertificateError")] + SslCertificateError, + /// + /// LoginAuthRequested + /// + [JsonPropertyName("LoginAuthRequested")] + LoginAuthRequested, + /// + /// UaChangeRequiresReload + /// + [JsonPropertyName("UaChangeRequiresReload")] + UaChangeRequiresReload, + /// + /// BlockedByClient + /// + [JsonPropertyName("BlockedByClient")] + BlockedByClient, + /// + /// AudioOutputDeviceRequested + /// + [JsonPropertyName("AudioOutputDeviceRequested")] + AudioOutputDeviceRequested, + /// + /// MixedContent + /// + [JsonPropertyName("MixedContent")] + MixedContent, + /// + /// TriggerBackgrounded + /// + [JsonPropertyName("TriggerBackgrounded")] + TriggerBackgrounded, + /// + /// MemoryLimitExceeded + /// + [JsonPropertyName("MemoryLimitExceeded")] + MemoryLimitExceeded, + /// + /// DataSaverEnabled + /// + [JsonPropertyName("DataSaverEnabled")] + DataSaverEnabled, + /// + /// TriggerUrlHasEffectiveUrl + /// + [JsonPropertyName("TriggerUrlHasEffectiveUrl")] + TriggerUrlHasEffectiveUrl, + /// + /// ActivatedBeforeStarted + /// + [JsonPropertyName("ActivatedBeforeStarted")] + ActivatedBeforeStarted, + /// + /// InactivePageRestriction + /// + [JsonPropertyName("InactivePageRestriction")] + InactivePageRestriction, + /// + /// StartFailed + /// + [JsonPropertyName("StartFailed")] + StartFailed, + /// + /// TimeoutBackgrounded + /// + [JsonPropertyName("TimeoutBackgrounded")] + TimeoutBackgrounded, + /// + /// CrossSiteRedirectInInitialNavigation + /// + [JsonPropertyName("CrossSiteRedirectInInitialNavigation")] + CrossSiteRedirectInInitialNavigation, + /// + /// CrossSiteNavigationInInitialNavigation + /// + [JsonPropertyName("CrossSiteNavigationInInitialNavigation")] + CrossSiteNavigationInInitialNavigation, + /// + /// SameSiteCrossOriginRedirectNotOptInInInitialNavigation + /// + [JsonPropertyName("SameSiteCrossOriginRedirectNotOptInInInitialNavigation")] + SameSiteCrossOriginRedirectNotOptInInInitialNavigation, + /// + /// SameSiteCrossOriginNavigationNotOptInInInitialNavigation + /// + [JsonPropertyName("SameSiteCrossOriginNavigationNotOptInInInitialNavigation")] + SameSiteCrossOriginNavigationNotOptInInInitialNavigation, + /// + /// ActivationNavigationParameterMismatch + /// + [JsonPropertyName("ActivationNavigationParameterMismatch")] + ActivationNavigationParameterMismatch, + /// + /// ActivatedInBackground + /// + [JsonPropertyName("ActivatedInBackground")] + ActivatedInBackground, + /// + /// EmbedderHostDisallowed + /// + [JsonPropertyName("EmbedderHostDisallowed")] + EmbedderHostDisallowed, + /// + /// ActivationNavigationDestroyedBeforeSuccess + /// + [JsonPropertyName("ActivationNavigationDestroyedBeforeSuccess")] + ActivationNavigationDestroyedBeforeSuccess, + /// + /// TabClosedByUserGesture + /// + [JsonPropertyName("TabClosedByUserGesture")] + TabClosedByUserGesture, + /// + /// TabClosedWithoutUserGesture + /// + [JsonPropertyName("TabClosedWithoutUserGesture")] + TabClosedWithoutUserGesture, + /// + /// PrimaryMainFrameRendererProcessCrashed + /// + [JsonPropertyName("PrimaryMainFrameRendererProcessCrashed")] + PrimaryMainFrameRendererProcessCrashed, + /// + /// PrimaryMainFrameRendererProcessKilled + /// + [JsonPropertyName("PrimaryMainFrameRendererProcessKilled")] + PrimaryMainFrameRendererProcessKilled, + /// + /// ActivationFramePolicyNotCompatible + /// + [JsonPropertyName("ActivationFramePolicyNotCompatible")] + ActivationFramePolicyNotCompatible, + /// + /// PreloadingDisabled + /// + [JsonPropertyName("PreloadingDisabled")] + PreloadingDisabled, + /// + /// BatterySaverEnabled + /// + [JsonPropertyName("BatterySaverEnabled")] + BatterySaverEnabled, + /// + /// ActivatedDuringMainFrameNavigation + /// + [JsonPropertyName("ActivatedDuringMainFrameNavigation")] + ActivatedDuringMainFrameNavigation, + /// + /// PreloadingUnsupportedByWebContents + /// + [JsonPropertyName("PreloadingUnsupportedByWebContents")] + PreloadingUnsupportedByWebContents, + /// + /// CrossSiteRedirectInMainFrameNavigation + /// + [JsonPropertyName("CrossSiteRedirectInMainFrameNavigation")] + CrossSiteRedirectInMainFrameNavigation, + /// + /// CrossSiteNavigationInMainFrameNavigation + /// + [JsonPropertyName("CrossSiteNavigationInMainFrameNavigation")] + CrossSiteNavigationInMainFrameNavigation, + /// + /// SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation + /// + [JsonPropertyName("SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation")] + SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation, + /// + /// SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation + /// + [JsonPropertyName("SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation")] + SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation, + /// + /// MemoryPressureOnTrigger + /// + [JsonPropertyName("MemoryPressureOnTrigger")] + MemoryPressureOnTrigger, + /// + /// MemoryPressureAfterTriggered + /// + [JsonPropertyName("MemoryPressureAfterTriggered")] + MemoryPressureAfterTriggered, + /// + /// PrerenderingDisabledByDevTools + /// + [JsonPropertyName("PrerenderingDisabledByDevTools")] + PrerenderingDisabledByDevTools, + /// + /// SpeculationRuleRemoved + /// + [JsonPropertyName("SpeculationRuleRemoved")] + SpeculationRuleRemoved, + /// + /// ActivatedWithAuxiliaryBrowsingContexts + /// + [JsonPropertyName("ActivatedWithAuxiliaryBrowsingContexts")] + ActivatedWithAuxiliaryBrowsingContexts, + /// + /// MaxNumOfRunningEagerPrerendersExceeded + /// + [JsonPropertyName("MaxNumOfRunningEagerPrerendersExceeded")] + MaxNumOfRunningEagerPrerendersExceeded, + /// + /// MaxNumOfRunningNonEagerPrerendersExceeded + /// + [JsonPropertyName("MaxNumOfRunningNonEagerPrerendersExceeded")] + MaxNumOfRunningNonEagerPrerendersExceeded, + /// + /// MaxNumOfRunningEmbedderPrerendersExceeded + /// + [JsonPropertyName("MaxNumOfRunningEmbedderPrerendersExceeded")] + MaxNumOfRunningEmbedderPrerendersExceeded, + /// + /// PrerenderingUrlHasEffectiveUrl + /// + [JsonPropertyName("PrerenderingUrlHasEffectiveUrl")] + PrerenderingUrlHasEffectiveUrl, + /// + /// RedirectedPrerenderingUrlHasEffectiveUrl + /// + [JsonPropertyName("RedirectedPrerenderingUrlHasEffectiveUrl")] + RedirectedPrerenderingUrlHasEffectiveUrl, + /// + /// ActivationUrlHasEffectiveUrl + /// + [JsonPropertyName("ActivationUrlHasEffectiveUrl")] + ActivationUrlHasEffectiveUrl, + /// + /// JavaScriptInterfaceAdded + /// + [JsonPropertyName("JavaScriptInterfaceAdded")] + JavaScriptInterfaceAdded, + /// + /// JavaScriptInterfaceRemoved + /// + [JsonPropertyName("JavaScriptInterfaceRemoved")] + JavaScriptInterfaceRemoved, + /// + /// AllPrerenderingCanceled + /// + [JsonPropertyName("AllPrerenderingCanceled")] + AllPrerenderingCanceled, + /// + /// WindowClosed + /// + [JsonPropertyName("WindowClosed")] + WindowClosed, + /// + /// SlowNetwork + /// + [JsonPropertyName("SlowNetwork")] + SlowNetwork, + /// + /// OtherPrerenderedPageActivated + /// + [JsonPropertyName("OtherPrerenderedPageActivated")] + OtherPrerenderedPageActivated, + /// + /// V8OptimizerDisabled + /// + [JsonPropertyName("V8OptimizerDisabled")] + V8OptimizerDisabled, + /// + /// PrerenderFailedDuringPrefetch + /// + [JsonPropertyName("PrerenderFailedDuringPrefetch")] + PrerenderFailedDuringPrefetch, + /// + /// BrowsingDataRemoved + /// + [JsonPropertyName("BrowsingDataRemoved")] + BrowsingDataRemoved, + /// + /// PrerenderHostReused + /// + [JsonPropertyName("PrerenderHostReused")] + PrerenderHostReused + } + + /// + /// Preloading status values, see also PreloadingTriggeringOutcome. This + /// status is shared by prefetchStatusUpdated and prerenderStatusUpdated. + /// + public enum PreloadingStatus + { + /// + /// Pending + /// + [JsonPropertyName("Pending")] + Pending, + /// + /// Running + /// + [JsonPropertyName("Running")] + Running, + /// + /// Ready + /// + [JsonPropertyName("Ready")] + Ready, + /// + /// Success + /// + [JsonPropertyName("Success")] + Success, + /// + /// Failure + /// + [JsonPropertyName("Failure")] + Failure, + /// + /// NotSupported + /// + [JsonPropertyName("NotSupported")] + NotSupported + } + + /// + /// TODO(https://crbug.com/1384419): revisit the list of PrefetchStatus and + /// filter out the ones that aren't necessary to the developers. + /// + public enum PrefetchStatus + { + /// + /// PrefetchAllowed + /// + [JsonPropertyName("PrefetchAllowed")] + PrefetchAllowed, + /// + /// PrefetchFailedIneligibleRedirect + /// + [JsonPropertyName("PrefetchFailedIneligibleRedirect")] + PrefetchFailedIneligibleRedirect, + /// + /// PrefetchFailedInvalidRedirect + /// + [JsonPropertyName("PrefetchFailedInvalidRedirect")] + PrefetchFailedInvalidRedirect, + /// + /// PrefetchFailedMIMENotSupported + /// + [JsonPropertyName("PrefetchFailedMIMENotSupported")] + PrefetchFailedMIMENotSupported, + /// + /// PrefetchFailedNetError + /// + [JsonPropertyName("PrefetchFailedNetError")] + PrefetchFailedNetError, + /// + /// PrefetchFailedNon2XX + /// + [JsonPropertyName("PrefetchFailedNon2XX")] + PrefetchFailedNon2XX, + /// + /// PrefetchEvictedAfterBrowsingDataRemoved + /// + [JsonPropertyName("PrefetchEvictedAfterBrowsingDataRemoved")] + PrefetchEvictedAfterBrowsingDataRemoved, + /// + /// PrefetchEvictedAfterCandidateRemoved + /// + [JsonPropertyName("PrefetchEvictedAfterCandidateRemoved")] + PrefetchEvictedAfterCandidateRemoved, + /// + /// PrefetchEvictedForNewerPrefetch + /// + [JsonPropertyName("PrefetchEvictedForNewerPrefetch")] + PrefetchEvictedForNewerPrefetch, + /// + /// PrefetchHeldback + /// + [JsonPropertyName("PrefetchHeldback")] + PrefetchHeldback, + /// + /// PrefetchIneligibleRetryAfter + /// + [JsonPropertyName("PrefetchIneligibleRetryAfter")] + PrefetchIneligibleRetryAfter, + /// + /// PrefetchIsPrivacyDecoy + /// + [JsonPropertyName("PrefetchIsPrivacyDecoy")] + PrefetchIsPrivacyDecoy, + /// + /// PrefetchIsStale + /// + [JsonPropertyName("PrefetchIsStale")] + PrefetchIsStale, + /// + /// PrefetchNotEligibleBrowserContextOffTheRecord + /// + [JsonPropertyName("PrefetchNotEligibleBrowserContextOffTheRecord")] + PrefetchNotEligibleBrowserContextOffTheRecord, + /// + /// PrefetchNotEligibleDataSaverEnabled + /// + [JsonPropertyName("PrefetchNotEligibleDataSaverEnabled")] + PrefetchNotEligibleDataSaverEnabled, + /// + /// PrefetchNotEligibleExistingProxy + /// + [JsonPropertyName("PrefetchNotEligibleExistingProxy")] + PrefetchNotEligibleExistingProxy, + /// + /// PrefetchNotEligibleHostIsNonUnique + /// + [JsonPropertyName("PrefetchNotEligibleHostIsNonUnique")] + PrefetchNotEligibleHostIsNonUnique, + /// + /// PrefetchNotEligibleNonDefaultStoragePartition + /// + [JsonPropertyName("PrefetchNotEligibleNonDefaultStoragePartition")] + PrefetchNotEligibleNonDefaultStoragePartition, + /// + /// PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy + /// + [JsonPropertyName("PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy")] + PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy, + /// + /// PrefetchNotEligibleSchemeIsNotHttps + /// + [JsonPropertyName("PrefetchNotEligibleSchemeIsNotHttps")] + PrefetchNotEligibleSchemeIsNotHttps, + /// + /// PrefetchNotEligibleUserHasCookies + /// + [JsonPropertyName("PrefetchNotEligibleUserHasCookies")] + PrefetchNotEligibleUserHasCookies, + /// + /// PrefetchNotEligibleUserHasServiceWorker + /// + [JsonPropertyName("PrefetchNotEligibleUserHasServiceWorker")] + PrefetchNotEligibleUserHasServiceWorker, + /// + /// PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler + /// + [JsonPropertyName("PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler")] + PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler, + /// + /// PrefetchNotEligibleRedirectFromServiceWorker + /// + [JsonPropertyName("PrefetchNotEligibleRedirectFromServiceWorker")] + PrefetchNotEligibleRedirectFromServiceWorker, + /// + /// PrefetchNotEligibleRedirectToServiceWorker + /// + [JsonPropertyName("PrefetchNotEligibleRedirectToServiceWorker")] + PrefetchNotEligibleRedirectToServiceWorker, + /// + /// PrefetchNotEligibleBatterySaverEnabled + /// + [JsonPropertyName("PrefetchNotEligibleBatterySaverEnabled")] + PrefetchNotEligibleBatterySaverEnabled, + /// + /// PrefetchNotEligiblePreloadingDisabled + /// + [JsonPropertyName("PrefetchNotEligiblePreloadingDisabled")] + PrefetchNotEligiblePreloadingDisabled, + /// + /// PrefetchNotFinishedInTime + /// + [JsonPropertyName("PrefetchNotFinishedInTime")] + PrefetchNotFinishedInTime, + /// + /// PrefetchNotStarted + /// + [JsonPropertyName("PrefetchNotStarted")] + PrefetchNotStarted, + /// + /// PrefetchNotUsedCookiesChanged + /// + [JsonPropertyName("PrefetchNotUsedCookiesChanged")] + PrefetchNotUsedCookiesChanged, + /// + /// PrefetchProxyNotAvailable + /// + [JsonPropertyName("PrefetchProxyNotAvailable")] + PrefetchProxyNotAvailable, + /// + /// PrefetchResponseUsed + /// + [JsonPropertyName("PrefetchResponseUsed")] + PrefetchResponseUsed, + /// + /// PrefetchSuccessfulButNotUsed + /// + [JsonPropertyName("PrefetchSuccessfulButNotUsed")] + PrefetchSuccessfulButNotUsed, + /// + /// PrefetchNotUsedProbeFailed + /// + [JsonPropertyName("PrefetchNotUsedProbeFailed")] + PrefetchNotUsedProbeFailed + } + + /// + /// Information of headers to be displayed when the header mismatch occurred. + /// + public partial class PrerenderMismatchedHeaders : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// HeaderName + /// + [JsonPropertyName("headerName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string HeaderName + { + get; + set; + } + + /// + /// InitialValue + /// + [JsonPropertyName("initialValue")] + public string InitialValue + { + get; + set; + } + + /// + /// ActivationValue + /// + [JsonPropertyName("activationValue")] + public string ActivationValue + { + get; + set; + } + } + + /// + /// Upsert. Currently, it is only emitted when a rule set added. + /// + public class RuleSetUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RuleSet + /// + [JsonInclude] + [JsonPropertyName("ruleSet")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Preload.RuleSet RuleSet + { + get; + private set; + } + } + + /// + /// ruleSetRemoved + /// + public class RuleSetRemovedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id + /// + [JsonInclude] + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + private set; + } + } + + /// + /// Fired when a preload enabled state is updated. + /// + public class PreloadEnabledStateUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// DisabledByPreference + /// + [JsonInclude] + [JsonPropertyName("disabledByPreference")] + public bool DisabledByPreference + { + get; + private set; + } + + /// + /// DisabledByDataSaver + /// + [JsonInclude] + [JsonPropertyName("disabledByDataSaver")] + public bool DisabledByDataSaver + { + get; + private set; + } + + /// + /// DisabledByBatterySaver + /// + [JsonInclude] + [JsonPropertyName("disabledByBatterySaver")] + public bool DisabledByBatterySaver + { + get; + private set; + } + + /// + /// DisabledByHoldbackPrefetchSpeculationRules + /// + [JsonInclude] + [JsonPropertyName("disabledByHoldbackPrefetchSpeculationRules")] + public bool DisabledByHoldbackPrefetchSpeculationRules + { + get; + private set; + } + + /// + /// DisabledByHoldbackPrerenderSpeculationRules + /// + [JsonInclude] + [JsonPropertyName("disabledByHoldbackPrerenderSpeculationRules")] + public bool DisabledByHoldbackPrerenderSpeculationRules + { + get; + private set; + } + } + + /// + /// Fired when a prefetch attempt is updated. + /// + public class PrefetchStatusUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Key + /// + [JsonInclude] + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Preload.PreloadingAttemptKey Key + { + get; + private set; + } + + /// + /// PipelineId + /// + [JsonInclude] + [JsonPropertyName("pipelineId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PipelineId + { + get; + private set; + } + + /// + /// The frame id of the frame initiating prefetch. + /// + [JsonInclude] + [JsonPropertyName("initiatingFrameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string InitiatingFrameId + { + get; + private set; + } + + /// + /// PrefetchUrl + /// + [JsonInclude] + [JsonPropertyName("prefetchUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PrefetchUrl + { + get; + private set; + } + + /// + /// Status + /// + [JsonInclude] + [JsonPropertyName("status")] + public CefSharp.DevTools.Preload.PreloadingStatus Status + { + get; + private set; + } + + /// + /// PrefetchStatus + /// + [JsonInclude] + [JsonPropertyName("prefetchStatus")] + public CefSharp.DevTools.Preload.PrefetchStatus PrefetchStatus + { + get; + private set; + } + + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + } + + /// + /// Fired when a prerender attempt is updated. + /// + public class PrerenderStatusUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Key + /// + [JsonInclude] + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Preload.PreloadingAttemptKey Key + { + get; + private set; + } + + /// + /// PipelineId + /// + [JsonInclude] + [JsonPropertyName("pipelineId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string PipelineId + { + get; + private set; + } + + /// + /// Status + /// + [JsonInclude] + [JsonPropertyName("status")] + public CefSharp.DevTools.Preload.PreloadingStatus Status + { + get; + private set; + } + + /// + /// PrerenderStatus + /// + [JsonInclude] + [JsonPropertyName("prerenderStatus")] + public CefSharp.DevTools.Preload.PrerenderFinalStatus? PrerenderStatus + { + get; + private set; + } + + /// + /// This is used to give users more information about the name of Mojo interface + /// that is incompatible with prerender and has caused the cancellation of the attempt. + /// + [JsonInclude] + [JsonPropertyName("disallowedMojoInterface")] + public string DisallowedMojoInterface + { + get; + private set; + } + + /// + /// MismatchedHeaders + /// + [JsonInclude] + [JsonPropertyName("mismatchedHeaders")] + public System.Collections.Generic.IList MismatchedHeaders + { + get; + private set; + } + } + + /// + /// Send a list of sources for all preloading attempts in a document. + /// + public class PreloadingAttemptSourcesUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// LoaderId + /// + [JsonInclude] + [JsonPropertyName("loaderId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LoaderId + { + get; + private set; + } + + /// + /// PreloadingAttemptSources + /// + [JsonInclude] + [JsonPropertyName("preloadingAttemptSources")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList PreloadingAttemptSources + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Security +{ + /// + /// A description of mixed content (HTTP resources on HTTPS pages), as defined by + /// https://www.w3.org/TR/mixed-content/#categories + /// + public enum MixedContentType + { + /// + /// blockable + /// + [JsonPropertyName("blockable")] + Blockable, + /// + /// optionally-blockable + /// + [JsonPropertyName("optionally-blockable")] + OptionallyBlockable, + /// + /// none + /// + [JsonPropertyName("none")] + None + } + + /// + /// The security level of a page or resource. + /// + public enum SecurityState + { + /// + /// unknown + /// + [JsonPropertyName("unknown")] + Unknown, + /// + /// neutral + /// + [JsonPropertyName("neutral")] + Neutral, + /// + /// insecure + /// + [JsonPropertyName("insecure")] + Insecure, + /// + /// secure + /// + [JsonPropertyName("secure")] + Secure, + /// + /// info + /// + [JsonPropertyName("info")] + Info, + /// + /// insecure-broken + /// + [JsonPropertyName("insecure-broken")] + InsecureBroken + } + + /// + /// Details about the security state of the page certificate. + /// + public partial class CertificateSecurityState : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Protocol name (e.g. "TLS 1.2" or "QUIC"). + /// + [JsonPropertyName("protocol")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Protocol + { + get; + set; + } + + /// + /// Key Exchange used by the connection, or the empty string if not applicable. + /// + [JsonPropertyName("keyExchange")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string KeyExchange + { + get; + set; + } + + /// + /// (EC)DH group used by the connection, if applicable. + /// + [JsonPropertyName("keyExchangeGroup")] + public string KeyExchangeGroup + { + get; + set; + } + + /// + /// Cipher name. + /// + [JsonPropertyName("cipher")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Cipher + { + get; + set; + } + + /// + /// TLS MAC. Note that AEAD ciphers do not have separate MACs. + /// + [JsonPropertyName("mac")] + public string Mac + { + get; + set; + } + + /// + /// Page certificate. + /// + [JsonPropertyName("certificate")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Certificate + { + get; + set; + } + + /// + /// Certificate subject name. + /// + [JsonPropertyName("subjectName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SubjectName + { + get; + set; + } + + /// + /// Name of the issuing CA. + /// + [JsonPropertyName("issuer")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Issuer + { + get; + set; + } + + /// + /// Certificate valid from date. + /// + [JsonPropertyName("validFrom")] + public double ValidFrom + { + get; + set; + } + + /// + /// Certificate valid to (expiration) date + /// + [JsonPropertyName("validTo")] + public double ValidTo + { + get; + set; + } + + /// + /// The highest priority network error code, if the certificate has an error. + /// + [JsonPropertyName("certificateNetworkError")] + public string CertificateNetworkError + { + get; + set; + } + + /// + /// True if the certificate uses a weak signature algorithm. + /// + [JsonPropertyName("certificateHasWeakSignature")] + public bool CertificateHasWeakSignature + { + get; + set; + } + + /// + /// True if the certificate has a SHA1 signature in the chain. + /// + [JsonPropertyName("certificateHasSha1Signature")] + public bool CertificateHasSha1Signature + { + get; + set; + } + + /// + /// True if modern SSL + /// + [JsonPropertyName("modernSSL")] + public bool ModernSSL + { + get; + set; + } + + /// + /// True if the connection is using an obsolete SSL protocol. + /// + [JsonPropertyName("obsoleteSslProtocol")] + public bool ObsoleteSslProtocol + { + get; + set; + } + + /// + /// True if the connection is using an obsolete SSL key exchange. + /// + [JsonPropertyName("obsoleteSslKeyExchange")] + public bool ObsoleteSslKeyExchange + { + get; + set; + } + + /// + /// True if the connection is using an obsolete SSL cipher. + /// + [JsonPropertyName("obsoleteSslCipher")] + public bool ObsoleteSslCipher + { + get; + set; + } + + /// + /// True if the connection is using an obsolete SSL signature. + /// + [JsonPropertyName("obsoleteSslSignature")] + public bool ObsoleteSslSignature + { + get; + set; + } + } + + /// + /// SafetyTipStatus + /// + public enum SafetyTipStatus + { + /// + /// badReputation + /// + [JsonPropertyName("badReputation")] + BadReputation, + /// + /// lookalike + /// + [JsonPropertyName("lookalike")] + Lookalike + } + + /// + /// SafetyTipInfo + /// + public partial class SafetyTipInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Describes whether the page triggers any safety tips or reputation warnings. Default is unknown. + /// + [JsonPropertyName("safetyTipStatus")] + public CefSharp.DevTools.Security.SafetyTipStatus SafetyTipStatus + { + get; + set; + } + + /// + /// The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches. + /// + [JsonPropertyName("safeUrl")] + public string SafeUrl + { + get; + set; + } + } + + /// + /// Security state information about the page. + /// + public partial class VisibleSecurityState : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The security level of the page. + /// + [JsonPropertyName("securityState")] + public CefSharp.DevTools.Security.SecurityState SecurityState + { + get; + set; + } + + /// + /// Security state details about the page certificate. + /// + [JsonPropertyName("certificateSecurityState")] + public CefSharp.DevTools.Security.CertificateSecurityState CertificateSecurityState + { + get; + set; + } + + /// + /// The type of Safety Tip triggered on the page. Note that this field will be set even if the Safety Tip UI was not actually shown. + /// + [JsonPropertyName("safetyTipInfo")] + public CefSharp.DevTools.Security.SafetyTipInfo SafetyTipInfo + { + get; + set; + } + + /// + /// Array of security state issues ids. + /// + [JsonPropertyName("securityStateIssueIds")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] SecurityStateIssueIds + { + get; + set; + } + } + + /// + /// An explanation of an factor contributing to the security state. + /// + public partial class SecurityStateExplanation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Security state representing the severity of the factor being explained. + /// + [JsonPropertyName("securityState")] + public CefSharp.DevTools.Security.SecurityState SecurityState + { + get; + set; + } + + /// + /// Title describing the type of factor. + /// + [JsonPropertyName("title")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Title + { + get; + set; + } + + /// + /// Short phrase describing the type of factor. + /// + [JsonPropertyName("summary")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Summary + { + get; + set; + } + + /// + /// Full text explanation of the factor. + /// + [JsonPropertyName("description")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Description + { + get; + set; + } + + /// + /// The type of mixed content described by the explanation. + /// + [JsonPropertyName("mixedContentType")] + public CefSharp.DevTools.Security.MixedContentType MixedContentType + { + get; + set; + } + + /// + /// Page certificate. + /// + [JsonPropertyName("certificate")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Certificate + { + get; + set; + } + + /// + /// Recommendations to fix any issues. + /// + [JsonPropertyName("recommendations")] + public string[] Recommendations + { + get; + set; + } + } + + /// + /// Information about insecure content on the page. + /// + public partial class InsecureContentStatus : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Always false. + /// + [JsonPropertyName("ranMixedContent")] + public bool RanMixedContent + { + get; + set; + } + + /// + /// Always false. + /// + [JsonPropertyName("displayedMixedContent")] + public bool DisplayedMixedContent + { + get; + set; + } + + /// + /// Always false. + /// + [JsonPropertyName("containedMixedForm")] + public bool ContainedMixedForm + { + get; + set; + } + + /// + /// Always false. + /// + [JsonPropertyName("ranContentWithCertErrors")] + public bool RanContentWithCertErrors + { + get; + set; + } + + /// + /// Always false. + /// + [JsonPropertyName("displayedContentWithCertErrors")] + public bool DisplayedContentWithCertErrors + { + get; + set; + } + + /// + /// Always set to unknown. + /// + [JsonPropertyName("ranInsecureContentStyle")] + public CefSharp.DevTools.Security.SecurityState RanInsecureContentStyle + { + get; + set; + } + + /// + /// Always set to unknown. + /// + [JsonPropertyName("displayedInsecureContentStyle")] + public CefSharp.DevTools.Security.SecurityState DisplayedInsecureContentStyle + { + get; + set; + } + } + + /// + /// The action to take when a certificate error occurs. continue will continue processing the + /// request and cancel will cancel the request. + /// + public enum CertificateErrorAction + { + /// + /// continue + /// + [JsonPropertyName("continue")] + Continue, + /// + /// cancel + /// + [JsonPropertyName("cancel")] + Cancel + } + + /// + /// There is a certificate error. If overriding certificate errors is enabled, then it should be + /// handled with the `handleCertificateError` command. Note: this event does not fire if the + /// certificate error has been allowed internally. Only one client per target should override + /// certificate errors at the same time. + /// + public class CertificateErrorEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// The ID of the event. + /// + [JsonInclude] + [JsonPropertyName("eventId")] + public int EventId + { + get; + private set; + } + + /// + /// The type of the error. + /// + [JsonInclude] + [JsonPropertyName("errorType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ErrorType + { + get; + private set; + } + + /// + /// The url that was requested. + /// + [JsonInclude] + [JsonPropertyName("requestURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestURL + { + get; + private set; + } + } + + /// + /// The security state of the page changed. + /// + public class VisibleSecurityStateChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Security state information about the page. + /// + [JsonInclude] + [JsonPropertyName("visibleSecurityState")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Security.VisibleSecurityState VisibleSecurityState + { + get; + private set; + } + } + + /// + /// The security state of the page changed. No longer being sent. + /// + public class SecurityStateChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Security state. + /// + [JsonInclude] + [JsonPropertyName("securityState")] + public CefSharp.DevTools.Security.SecurityState SecurityState + { + get; + private set; + } + + /// + /// True if the page was loaded over cryptographic transport such as HTTPS. + /// + [JsonInclude] + [JsonPropertyName("schemeIsCryptographic")] + public bool SchemeIsCryptographic + { + get; + private set; + } + + /// + /// Previously a list of explanations for the security state. Now always + /// empty. + /// + [JsonInclude] + [JsonPropertyName("explanations")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Explanations + { + get; + private set; + } + + /// + /// Information about insecure content on the page. + /// + [JsonInclude] + [JsonPropertyName("insecureContentStatus")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Security.InsecureContentStatus InsecureContentStatus + { + get; + private set; + } + + /// + /// Overrides user-visible description of the state. Always omitted. + /// + [JsonInclude] + [JsonPropertyName("summary")] + public string Summary + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.ServiceWorker +{ + /// + /// ServiceWorker registration. + /// + public partial class ServiceWorkerRegistration : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// RegistrationId + /// + [JsonPropertyName("registrationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RegistrationId + { + get; + set; + } + + /// + /// ScopeURL + /// + [JsonPropertyName("scopeURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScopeURL + { + get; + set; + } + + /// + /// IsDeleted + /// + [JsonPropertyName("isDeleted")] + public bool IsDeleted + { + get; + set; + } + } + + /// + /// ServiceWorkerVersionRunningStatus + /// + public enum ServiceWorkerVersionRunningStatus + { + /// + /// stopped + /// + [JsonPropertyName("stopped")] + Stopped, + /// + /// starting + /// + [JsonPropertyName("starting")] + Starting, + /// + /// running + /// + [JsonPropertyName("running")] + Running, + /// + /// stopping + /// + [JsonPropertyName("stopping")] + Stopping + } + + /// + /// ServiceWorkerVersionStatus + /// + public enum ServiceWorkerVersionStatus + { + /// + /// new + /// + [JsonPropertyName("new")] + New, + /// + /// installing + /// + [JsonPropertyName("installing")] + Installing, + /// + /// installed + /// + [JsonPropertyName("installed")] + Installed, + /// + /// activating + /// + [JsonPropertyName("activating")] + Activating, + /// + /// activated + /// + [JsonPropertyName("activated")] + Activated, + /// + /// redundant + /// + [JsonPropertyName("redundant")] + Redundant + } + + /// + /// ServiceWorker version. + /// + public partial class ServiceWorkerVersion : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// VersionId + /// + [JsonPropertyName("versionId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string VersionId + { + get; + set; + } + + /// + /// RegistrationId + /// + [JsonPropertyName("registrationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RegistrationId + { + get; + set; + } + + /// + /// ScriptURL + /// + [JsonPropertyName("scriptURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptURL + { + get; + set; + } + + /// + /// RunningStatus + /// + [JsonPropertyName("runningStatus")] + public CefSharp.DevTools.ServiceWorker.ServiceWorkerVersionRunningStatus RunningStatus + { + get; + set; + } + + /// + /// Status + /// + [JsonPropertyName("status")] + public CefSharp.DevTools.ServiceWorker.ServiceWorkerVersionStatus Status + { + get; + set; + } + + /// + /// The Last-Modified header value of the main script. + /// + [JsonPropertyName("scriptLastModified")] + public double? ScriptLastModified + { + get; + set; + } + + /// + /// The time at which the response headers of the main script were received from the server. + /// For cached script it is the last time the cache entry was validated. + /// + [JsonPropertyName("scriptResponseTime")] + public double? ScriptResponseTime + { + get; + set; + } + + /// + /// ControlledClients + /// + [JsonPropertyName("controlledClients")] + public string[] ControlledClients + { + get; + set; + } + + /// + /// TargetId + /// + [JsonPropertyName("targetId")] + public string TargetId + { + get; + set; + } + + /// + /// RouterRules + /// + [JsonPropertyName("routerRules")] + public string RouterRules + { + get; + set; + } + } + + /// + /// ServiceWorker error message. + /// + public partial class ServiceWorkerErrorMessage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ErrorMessage + /// + [JsonPropertyName("errorMessage")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ErrorMessage + { + get; + set; + } + + /// + /// RegistrationId + /// + [JsonPropertyName("registrationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RegistrationId + { + get; + set; + } + + /// + /// VersionId + /// + [JsonPropertyName("versionId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string VersionId + { + get; + set; + } + + /// + /// SourceURL + /// + [JsonPropertyName("sourceURL")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SourceURL + { + get; + set; + } + + /// + /// LineNumber + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// ColumnNumber + /// + [JsonPropertyName("columnNumber")] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// workerErrorReported + /// + public class WorkerErrorReportedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ErrorMessage + /// + [JsonInclude] + [JsonPropertyName("errorMessage")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.ServiceWorker.ServiceWorkerErrorMessage ErrorMessage + { + get; + private set; + } + } + + /// + /// workerRegistrationUpdated + /// + public class WorkerRegistrationUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Registrations + /// + [JsonInclude] + [JsonPropertyName("registrations")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Registrations + { + get; + private set; + } + } + + /// + /// workerVersionUpdated + /// + public class WorkerVersionUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Versions + /// + [JsonInclude] + [JsonPropertyName("versions")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Versions + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.SmartCardEmulation +{ + /// + /// Indicates the PC/SC error code. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__ErrorCodes.html + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/secauthn/authentication-return-values + /// + public enum ResultCode + { + /// + /// success + /// + [JsonPropertyName("success")] + Success, + /// + /// removed-card + /// + [JsonPropertyName("removed-card")] + RemovedCard, + /// + /// reset-card + /// + [JsonPropertyName("reset-card")] + ResetCard, + /// + /// unpowered-card + /// + [JsonPropertyName("unpowered-card")] + UnpoweredCard, + /// + /// unresponsive-card + /// + [JsonPropertyName("unresponsive-card")] + UnresponsiveCard, + /// + /// unsupported-card + /// + [JsonPropertyName("unsupported-card")] + UnsupportedCard, + /// + /// reader-unavailable + /// + [JsonPropertyName("reader-unavailable")] + ReaderUnavailable, + /// + /// sharing-violation + /// + [JsonPropertyName("sharing-violation")] + SharingViolation, + /// + /// not-transacted + /// + [JsonPropertyName("not-transacted")] + NotTransacted, + /// + /// no-smartcard + /// + [JsonPropertyName("no-smartcard")] + NoSmartcard, + /// + /// proto-mismatch + /// + [JsonPropertyName("proto-mismatch")] + ProtoMismatch, + /// + /// system-cancelled + /// + [JsonPropertyName("system-cancelled")] + SystemCancelled, + /// + /// not-ready + /// + [JsonPropertyName("not-ready")] + NotReady, + /// + /// cancelled + /// + [JsonPropertyName("cancelled")] + Cancelled, + /// + /// insufficient-buffer + /// + [JsonPropertyName("insufficient-buffer")] + InsufficientBuffer, + /// + /// invalid-handle + /// + [JsonPropertyName("invalid-handle")] + InvalidHandle, + /// + /// invalid-parameter + /// + [JsonPropertyName("invalid-parameter")] + InvalidParameter, + /// + /// invalid-value + /// + [JsonPropertyName("invalid-value")] + InvalidValue, + /// + /// no-memory + /// + [JsonPropertyName("no-memory")] + NoMemory, + /// + /// timeout + /// + [JsonPropertyName("timeout")] + Timeout, + /// + /// unknown-reader + /// + [JsonPropertyName("unknown-reader")] + UnknownReader, + /// + /// unsupported-feature + /// + [JsonPropertyName("unsupported-feature")] + UnsupportedFeature, + /// + /// no-readers-available + /// + [JsonPropertyName("no-readers-available")] + NoReadersAvailable, + /// + /// service-stopped + /// + [JsonPropertyName("service-stopped")] + ServiceStopped, + /// + /// no-service + /// + [JsonPropertyName("no-service")] + NoService, + /// + /// comm-error + /// + [JsonPropertyName("comm-error")] + CommError, + /// + /// internal-error + /// + [JsonPropertyName("internal-error")] + InternalError, + /// + /// server-too-busy + /// + [JsonPropertyName("server-too-busy")] + ServerTooBusy, + /// + /// unexpected + /// + [JsonPropertyName("unexpected")] + Unexpected, + /// + /// shutdown + /// + [JsonPropertyName("shutdown")] + Shutdown, + /// + /// unknown-card + /// + [JsonPropertyName("unknown-card")] + UnknownCard, + /// + /// unknown + /// + [JsonPropertyName("unknown")] + Unknown + } + + /// + /// Maps to the |SCARD_SHARE_*| values. + /// + public enum ShareMode + { + /// + /// shared + /// + [JsonPropertyName("shared")] + Shared, + /// + /// exclusive + /// + [JsonPropertyName("exclusive")] + Exclusive, + /// + /// direct + /// + [JsonPropertyName("direct")] + Direct + } + + /// + /// Indicates what the reader should do with the card. + /// + public enum Disposition + { + /// + /// leave-card + /// + [JsonPropertyName("leave-card")] + LeaveCard, + /// + /// reset-card + /// + [JsonPropertyName("reset-card")] + ResetCard, + /// + /// unpower-card + /// + [JsonPropertyName("unpower-card")] + UnpowerCard, + /// + /// eject-card + /// + [JsonPropertyName("eject-card")] + EjectCard + } + + /// + /// Maps to |SCARD_*| connection state values. + /// + public enum ConnectionState + { + /// + /// absent + /// + [JsonPropertyName("absent")] + Absent, + /// + /// present + /// + [JsonPropertyName("present")] + Present, + /// + /// swallowed + /// + [JsonPropertyName("swallowed")] + Swallowed, + /// + /// powered + /// + [JsonPropertyName("powered")] + Powered, + /// + /// negotiable + /// + [JsonPropertyName("negotiable")] + Negotiable, + /// + /// specific + /// + [JsonPropertyName("specific")] + Specific + } + + /// + /// Maps to the |SCARD_STATE_*| flags. + /// + public partial class ReaderStateFlags : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unaware + /// + [JsonPropertyName("unaware")] + public bool? Unaware + { + get; + set; + } + + /// + /// Ignore + /// + [JsonPropertyName("ignore")] + public bool? Ignore + { + get; + set; + } + + /// + /// Changed + /// + [JsonPropertyName("changed")] + public bool? Changed + { + get; + set; + } + + /// + /// Unknown + /// + [JsonPropertyName("unknown")] + public bool? Unknown + { + get; + set; + } + + /// + /// Unavailable + /// + [JsonPropertyName("unavailable")] + public bool? Unavailable + { + get; + set; + } + + /// + /// Empty + /// + [JsonPropertyName("empty")] + public bool? Empty + { + get; + set; + } + + /// + /// Present + /// + [JsonPropertyName("present")] + public bool? Present + { + get; + set; + } + + /// + /// Exclusive + /// + [JsonPropertyName("exclusive")] + public bool? Exclusive + { + get; + set; + } + + /// + /// Inuse + /// + [JsonPropertyName("inuse")] + public bool? Inuse + { + get; + set; + } + + /// + /// Mute + /// + [JsonPropertyName("mute")] + public bool? Mute + { + get; + set; + } + + /// + /// Unpowered + /// + [JsonPropertyName("unpowered")] + public bool? Unpowered + { + get; + set; + } + } + + /// + /// Maps to the |SCARD_PROTOCOL_*| flags. + /// + public partial class ProtocolSet : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// T0 + /// + [JsonPropertyName("t0")] + public bool? T0 + { + get; + set; + } + + /// + /// T1 + /// + [JsonPropertyName("t1")] + public bool? T1 + { + get; + set; + } + + /// + /// Raw + /// + [JsonPropertyName("raw")] + public bool? Raw + { + get; + set; + } + } + + /// + /// Maps to the |SCARD_PROTOCOL_*| values. + /// + public enum Protocol + { + /// + /// t0 + /// + [JsonPropertyName("t0")] + T0, + /// + /// t1 + /// + [JsonPropertyName("t1")] + T1, + /// + /// raw + /// + [JsonPropertyName("raw")] + Raw + } + + /// + /// ReaderStateIn + /// + public partial class ReaderStateIn : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Reader + /// + [JsonPropertyName("reader")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Reader + { + get; + set; + } + + /// + /// CurrentState + /// + [JsonPropertyName("currentState")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.SmartCardEmulation.ReaderStateFlags CurrentState + { + get; + set; + } + + /// + /// CurrentInsertionCount + /// + [JsonPropertyName("currentInsertionCount")] + public int CurrentInsertionCount + { + get; + set; + } + } + + /// + /// ReaderStateOut + /// + public partial class ReaderStateOut : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Reader + /// + [JsonPropertyName("reader")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Reader + { + get; + set; + } + + /// + /// EventState + /// + [JsonPropertyName("eventState")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.SmartCardEmulation.ReaderStateFlags EventState + { + get; + set; + } + + /// + /// EventCount + /// + [JsonPropertyName("eventCount")] + public int EventCount + { + get; + set; + } + + /// + /// Atr + /// + [JsonPropertyName("atr")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Atr + { + get; + set; + } + } + + /// + /// Fired when |SCardEstablishContext| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext + /// + public class EstablishContextRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + } + + /// + /// Fired when |SCardReleaseContext| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext + /// + public class ReleaseContextRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + public int ContextId + { + get; + private set; + } + } + + /// + /// Fired when |SCardListReaders| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa + /// + public class ListReadersRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + public int ContextId + { + get; + private set; + } + } + + /// + /// Fired when |SCardGetStatusChange| is called. Timeout is specified in milliseconds. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea + /// + public class GetStatusChangeRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + public int ContextId + { + get; + private set; + } + + /// + /// ReaderStates + /// + [JsonInclude] + [JsonPropertyName("readerStates")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList ReaderStates + { + get; + private set; + } + + /// + /// in milliseconds, if absent, it means "infinite" + /// + [JsonInclude] + [JsonPropertyName("timeout")] + public int? Timeout + { + get; + private set; + } + } + + /// + /// Fired when |SCardCancel| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel + /// + public class CancelRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + public int ContextId + { + get; + private set; + } + } + + /// + /// Fired when |SCardConnect| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta + /// + public class ConnectRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + public int ContextId + { + get; + private set; + } + + /// + /// Reader + /// + [JsonInclude] + [JsonPropertyName("reader")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Reader + { + get; + private set; + } + + /// + /// ShareMode + /// + [JsonInclude] + [JsonPropertyName("shareMode")] + public CefSharp.DevTools.SmartCardEmulation.ShareMode ShareMode + { + get; + private set; + } + + /// + /// PreferredProtocols + /// + [JsonInclude] + [JsonPropertyName("preferredProtocols")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.SmartCardEmulation.ProtocolSet PreferredProtocols + { + get; + private set; + } + } + + /// + /// Fired when |SCardDisconnect| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect + /// + public class DisconnectRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [JsonInclude] + [JsonPropertyName("handle")] + public int Handle + { + get; + private set; + } + + /// + /// Disposition + /// + [JsonInclude] + [JsonPropertyName("disposition")] + public CefSharp.DevTools.SmartCardEmulation.Disposition Disposition + { + get; + private set; + } + } + + /// + /// Fired when |SCardTransmit| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit + /// + public class TransmitRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [JsonInclude] + [JsonPropertyName("handle")] + public int Handle + { + get; + private set; + } + + /// + /// Data + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + private set; + } + + /// + /// Protocol + /// + [JsonInclude] + [JsonPropertyName("protocol")] + public CefSharp.DevTools.SmartCardEmulation.Protocol? Protocol + { + get; + private set; + } + } + + /// + /// Fired when |SCardControl| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol + /// + public class ControlRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [JsonInclude] + [JsonPropertyName("handle")] + public int Handle + { + get; + private set; + } + + /// + /// ControlCode + /// + [JsonInclude] + [JsonPropertyName("controlCode")] + public int ControlCode + { + get; + private set; + } + + /// + /// Data + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + private set; + } + } + + /// + /// Fired when |SCardGetAttrib| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib + /// + public class GetAttribRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [JsonInclude] + [JsonPropertyName("handle")] + public int Handle + { + get; + private set; + } + + /// + /// AttribId + /// + [JsonInclude] + [JsonPropertyName("attribId")] + public int AttribId + { + get; + private set; + } + } + + /// + /// Fired when |SCardSetAttrib| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib + /// + public class SetAttribRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [JsonInclude] + [JsonPropertyName("handle")] + public int Handle + { + get; + private set; + } + + /// + /// AttribId + /// + [JsonInclude] + [JsonPropertyName("attribId")] + public int AttribId + { + get; + private set; + } + + /// + /// Data + /// + [JsonInclude] + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] Data + { + get; + private set; + } + } + + /// + /// Fired when |SCardStatus| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa + /// + public class StatusRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [JsonInclude] + [JsonPropertyName("handle")] + public int Handle + { + get; + private set; + } + } + + /// + /// Fired when |SCardBeginTransaction| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction + /// + public class BeginTransactionRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [JsonInclude] + [JsonPropertyName("handle")] + public int Handle + { + get; + private set; + } + } + + /// + /// Fired when |SCardEndTransaction| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction + /// + public class EndTransactionRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// Handle + /// + [JsonInclude] + [JsonPropertyName("handle")] + public int Handle + { + get; + private set; + } + + /// + /// Disposition + /// + [JsonInclude] + [JsonPropertyName("disposition")] + public CefSharp.DevTools.SmartCardEmulation.Disposition Disposition + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// Enum of possible storage types. + /// + public enum StorageType + { + /// + /// cookies + /// + [JsonPropertyName("cookies")] + Cookies, + /// + /// file_systems + /// + [JsonPropertyName("file_systems")] + FileSystems, + /// + /// indexeddb + /// + [JsonPropertyName("indexeddb")] + Indexeddb, + /// + /// local_storage + /// + [JsonPropertyName("local_storage")] + LocalStorage, + /// + /// shader_cache + /// + [JsonPropertyName("shader_cache")] + ShaderCache, + /// + /// websql + /// + [JsonPropertyName("websql")] + Websql, + /// + /// service_workers + /// + [JsonPropertyName("service_workers")] + ServiceWorkers, + /// + /// cache_storage + /// + [JsonPropertyName("cache_storage")] + CacheStorage, + /// + /// interest_groups + /// + [JsonPropertyName("interest_groups")] + InterestGroups, + /// + /// shared_storage + /// + [JsonPropertyName("shared_storage")] + SharedStorage, + /// + /// storage_buckets + /// + [JsonPropertyName("storage_buckets")] + StorageBuckets, + /// + /// all + /// + [JsonPropertyName("all")] + All, + /// + /// other + /// + [JsonPropertyName("other")] + Other + } + + /// + /// Usage for a storage type. + /// + public partial class UsageForType : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name of storage type. + /// + [JsonPropertyName("storageType")] + public CefSharp.DevTools.Storage.StorageType StorageType + { + get; + set; + } + + /// + /// Storage usage (bytes). + /// + [JsonPropertyName("usage")] + public double Usage + { + get; + set; + } + } + + /// + /// Pair of issuer origin and number of available (signed, but not used) Trust + /// Tokens from that issuer. + /// + public partial class TrustTokens : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// IssuerOrigin + /// + [JsonPropertyName("issuerOrigin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string IssuerOrigin + { + get; + set; + } + + /// + /// Count + /// + [JsonPropertyName("count")] + public double Count + { + get; + set; + } + } + + /// + /// Enum of interest group access types. + /// + public enum InterestGroupAccessType + { + /// + /// join + /// + [JsonPropertyName("join")] + Join, + /// + /// leave + /// + [JsonPropertyName("leave")] + Leave, + /// + /// update + /// + [JsonPropertyName("update")] + Update, + /// + /// loaded + /// + [JsonPropertyName("loaded")] + Loaded, + /// + /// bid + /// + [JsonPropertyName("bid")] + Bid, + /// + /// win + /// + [JsonPropertyName("win")] + Win, + /// + /// additionalBid + /// + [JsonPropertyName("additionalBid")] + AdditionalBid, + /// + /// additionalBidWin + /// + [JsonPropertyName("additionalBidWin")] + AdditionalBidWin, + /// + /// topLevelBid + /// + [JsonPropertyName("topLevelBid")] + TopLevelBid, + /// + /// topLevelAdditionalBid + /// + [JsonPropertyName("topLevelAdditionalBid")] + TopLevelAdditionalBid, + /// + /// clear + /// + [JsonPropertyName("clear")] + Clear + } + + /// + /// Enum of auction events. + /// + public enum InterestGroupAuctionEventType + { + /// + /// started + /// + [JsonPropertyName("started")] + Started, + /// + /// configResolved + /// + [JsonPropertyName("configResolved")] + ConfigResolved + } + + /// + /// Enum of network fetches auctions can do. + /// + public enum InterestGroupAuctionFetchType + { + /// + /// bidderJs + /// + [JsonPropertyName("bidderJs")] + BidderJs, + /// + /// bidderWasm + /// + [JsonPropertyName("bidderWasm")] + BidderWasm, + /// + /// sellerJs + /// + [JsonPropertyName("sellerJs")] + SellerJs, + /// + /// bidderTrustedSignals + /// + [JsonPropertyName("bidderTrustedSignals")] + BidderTrustedSignals, + /// + /// sellerTrustedSignals + /// + [JsonPropertyName("sellerTrustedSignals")] + SellerTrustedSignals + } + + /// + /// Enum of shared storage access scopes. + /// + public enum SharedStorageAccessScope + { + /// + /// window + /// + [JsonPropertyName("window")] + Window, + /// + /// sharedStorageWorklet + /// + [JsonPropertyName("sharedStorageWorklet")] + SharedStorageWorklet, + /// + /// protectedAudienceWorklet + /// + [JsonPropertyName("protectedAudienceWorklet")] + ProtectedAudienceWorklet, + /// + /// header + /// + [JsonPropertyName("header")] + Header + } + + /// + /// Enum of shared storage access methods. + /// + public enum SharedStorageAccessMethod + { + /// + /// addModule + /// + [JsonPropertyName("addModule")] + AddModule, + /// + /// createWorklet + /// + [JsonPropertyName("createWorklet")] + CreateWorklet, + /// + /// selectURL + /// + [JsonPropertyName("selectURL")] + SelectURL, + /// + /// run + /// + [JsonPropertyName("run")] + Run, + /// + /// batchUpdate + /// + [JsonPropertyName("batchUpdate")] + BatchUpdate, + /// + /// set + /// + [JsonPropertyName("set")] + Set, + /// + /// append + /// + [JsonPropertyName("append")] + Append, + /// + /// delete + /// + [JsonPropertyName("delete")] + Delete, + /// + /// clear + /// + [JsonPropertyName("clear")] + Clear, + /// + /// get + /// + [JsonPropertyName("get")] + Get, + /// + /// keys + /// + [JsonPropertyName("keys")] + Keys, + /// + /// values + /// + [JsonPropertyName("values")] + Values, + /// + /// entries + /// + [JsonPropertyName("entries")] + Entries, + /// + /// length + /// + [JsonPropertyName("length")] + Length, + /// + /// remainingBudget + /// + [JsonPropertyName("remainingBudget")] + RemainingBudget + } + + /// + /// Struct for a single key-value pair in an origin's shared storage. + /// + public partial class SharedStorageEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Key + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// Details for an origin's shared storage. + /// + public partial class SharedStorageMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Time when the origin's shared storage was last created. + /// + [JsonPropertyName("creationTime")] + public double CreationTime + { + get; + set; + } + + /// + /// Number of key-value pairs stored in origin's shared storage. + /// + [JsonPropertyName("length")] + public int Length + { + get; + set; + } + + /// + /// Current amount of bits of entropy remaining in the navigation budget. + /// + [JsonPropertyName("remainingBudget")] + public double RemainingBudget + { + get; + set; + } + + /// + /// Total number of bytes stored as key-value pairs in origin's shared + /// storage. + /// + [JsonPropertyName("bytesUsed")] + public int BytesUsed + { + get; + set; + } + } + + /// + /// Represents a dictionary object passed in as privateAggregationConfig to + /// run or selectURL. + /// + public partial class SharedStoragePrivateAggregationConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The chosen aggregation service deployment. + /// + [JsonPropertyName("aggregationCoordinatorOrigin")] + public string AggregationCoordinatorOrigin + { + get; + set; + } + + /// + /// The context ID provided. + /// + [JsonPropertyName("contextId")] + public string ContextId + { + get; + set; + } + + /// + /// Configures the maximum size allowed for filtering IDs. + /// + [JsonPropertyName("filteringIdMaxBytes")] + public int FilteringIdMaxBytes + { + get; + set; + } + + /// + /// The limit on the number of contributions in the final report. + /// + [JsonPropertyName("maxContributions")] + public int? MaxContributions + { + get; + set; + } + } + + /// + /// Pair of reporting metadata details for a candidate URL for `selectURL()`. + /// + public partial class SharedStorageReportingMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// EventType + /// + [JsonPropertyName("eventType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string EventType + { + get; + set; + } + + /// + /// ReportingUrl + /// + [JsonPropertyName("reportingUrl")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ReportingUrl + { + get; + set; + } + } + + /// + /// Bundles a candidate URL with its reporting metadata. + /// + public partial class SharedStorageUrlWithMetadata : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Spec of candidate URL. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Any associated reporting metadata. + /// + [JsonPropertyName("reportingMetadata")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList ReportingMetadata + { + get; + set; + } + } + + /// + /// Bundles the parameters for shared storage access events whose + /// presence/absence can vary according to SharedStorageAccessType. + /// + public partial class SharedStorageAccessParams : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Spec of the module script URL. + /// Present only for SharedStorageAccessMethods: addModule and + /// createWorklet. + /// + [JsonPropertyName("scriptSourceUrl")] + public string ScriptSourceUrl + { + get; + set; + } + + /// + /// String denoting "context-origin", "script-origin", or a custom + /// origin to be used as the worklet's data origin. + /// Present only for SharedStorageAccessMethod: createWorklet. + /// + [JsonPropertyName("dataOrigin")] + public string DataOrigin + { + get; + set; + } + + /// + /// Name of the registered operation to be run. + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// + [JsonPropertyName("operationName")] + public string OperationName + { + get; + set; + } + + /// + /// ID of the operation call. + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// + [JsonPropertyName("operationId")] + public string OperationId + { + get; + set; + } + + /// + /// Whether or not to keep the worket alive for future run or selectURL + /// calls. + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// + [JsonPropertyName("keepAlive")] + public bool? KeepAlive + { + get; + set; + } + + /// + /// Configures the private aggregation options. + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// + [JsonPropertyName("privateAggregationConfig")] + public CefSharp.DevTools.Storage.SharedStoragePrivateAggregationConfig PrivateAggregationConfig + { + get; + set; + } + + /// + /// The operation's serialized data in bytes (converted to a string). + /// Present only for SharedStorageAccessMethods: run and selectURL. + /// TODO(crbug.com/401011862): Consider updating this parameter to binary. + /// + [JsonPropertyName("serializedData")] + public string SerializedData + { + get; + set; + } + + /// + /// Array of candidate URLs' specs, along with any associated metadata. + /// Present only for SharedStorageAccessMethod: selectURL. + /// + [JsonPropertyName("urlsWithMetadata")] + public System.Collections.Generic.IList UrlsWithMetadata + { + get; + set; + } + + /// + /// Spec of the URN:UUID generated for a selectURL call. + /// Present only for SharedStorageAccessMethod: selectURL. + /// + [JsonPropertyName("urnUuid")] + public string UrnUuid + { + get; + set; + } + + /// + /// Key for a specific entry in an origin's shared storage. + /// Present only for SharedStorageAccessMethods: set, append, delete, and + /// get. + /// + [JsonPropertyName("key")] + public string Key + { + get; + set; + } + + /// + /// Value for a specific entry in an origin's shared storage. + /// Present only for SharedStorageAccessMethods: set and append. + /// + [JsonPropertyName("value")] + public string Value + { + get; + set; + } + + /// + /// Whether or not to set an entry for a key if that key is already present. + /// Present only for SharedStorageAccessMethod: set. + /// + [JsonPropertyName("ignoreIfPresent")] + public bool? IgnoreIfPresent + { + get; + set; + } + + /// + /// A number denoting the (0-based) order of the worklet's + /// creation relative to all other shared storage worklets created by + /// documents using the current storage partition. + /// Present only for SharedStorageAccessMethods: addModule, createWorklet. + /// + [JsonPropertyName("workletOrdinal")] + public int? WorkletOrdinal + { + get; + set; + } + + /// + /// Hex representation of the DevTools token used as the TargetID for the + /// associated shared storage worklet. + /// Present only for SharedStorageAccessMethods: addModule, createWorklet, + /// run, selectURL, and any other SharedStorageAccessMethod when the + /// SharedStorageAccessScope is sharedStorageWorklet. + /// + [JsonPropertyName("workletTargetId")] + public string WorkletTargetId + { + get; + set; + } + + /// + /// Name of the lock to be acquired, if present. + /// Optionally present only for SharedStorageAccessMethods: batchUpdate, + /// set, append, delete, and clear. + /// + [JsonPropertyName("withLock")] + public string WithLock + { + get; + set; + } + + /// + /// If the method has been called as part of a batchUpdate, then this + /// number identifies the batch to which it belongs. + /// Optionally present only for SharedStorageAccessMethods: + /// batchUpdate (required), set, append, delete, and clear. + /// + [JsonPropertyName("batchUpdateId")] + public string BatchUpdateId + { + get; + set; + } + + /// + /// Number of modifier methods sent in batch. + /// Present only for SharedStorageAccessMethod: batchUpdate. + /// + [JsonPropertyName("batchSize")] + public int? BatchSize + { + get; + set; + } + } + + /// + /// StorageBucketsDurability + /// + public enum StorageBucketsDurability + { + /// + /// relaxed + /// + [JsonPropertyName("relaxed")] + Relaxed, + /// + /// strict + /// + [JsonPropertyName("strict")] + Strict + } + + /// + /// StorageBucket + /// + public partial class StorageBucket : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// StorageKey + /// + [JsonPropertyName("storageKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StorageKey + { + get; + set; + } + + /// + /// If not specified, it is the default bucket of the storageKey. + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + } + + /// + /// StorageBucketInfo + /// + public partial class StorageBucketInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Bucket + /// + [JsonPropertyName("bucket")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.StorageBucket Bucket + { + get; + set; + } + + /// + /// Id + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// Expiration + /// + [JsonPropertyName("expiration")] + public double Expiration + { + get; + set; + } + + /// + /// Storage quota (bytes). + /// + [JsonPropertyName("quota")] + public double Quota + { + get; + set; + } + + /// + /// Persistent + /// + [JsonPropertyName("persistent")] + public bool Persistent + { + get; + set; + } + + /// + /// Durability + /// + [JsonPropertyName("durability")] + public CefSharp.DevTools.Storage.StorageBucketsDurability Durability + { + get; + set; + } + } + + /// + /// AttributionReportingSourceType + /// + public enum AttributionReportingSourceType + { + /// + /// navigation + /// + [JsonPropertyName("navigation")] + Navigation, + /// + /// event + /// + [JsonPropertyName("event")] + Event + } + + /// + /// AttributionReportingFilterDataEntry + /// + public partial class AttributionReportingFilterDataEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Key + { + get; + set; + } + + /// + /// Values + /// + [JsonPropertyName("values")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Values + { + get; + set; + } + } + + /// + /// AttributionReportingFilterConfig + /// + public partial class AttributionReportingFilterConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// FilterValues + /// + [JsonPropertyName("filterValues")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList FilterValues + { + get; + set; + } + + /// + /// duration in seconds + /// + [JsonPropertyName("lookbackWindow")] + public int? LookbackWindow + { + get; + set; + } + } + + /// + /// AttributionReportingFilterPair + /// + public partial class AttributionReportingFilterPair : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Filters + /// + [JsonPropertyName("filters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Filters + { + get; + set; + } + + /// + /// NotFilters + /// + [JsonPropertyName("notFilters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList NotFilters + { + get; + set; + } + } + + /// + /// AttributionReportingAggregationKeysEntry + /// + public partial class AttributionReportingAggregationKeysEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Key + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Value + { + get; + set; + } + } + + /// + /// AttributionReportingEventReportWindows + /// + public partial class AttributionReportingEventReportWindows : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// duration in seconds + /// + [JsonPropertyName("start")] + public int Start + { + get; + set; + } + + /// + /// duration in seconds + /// + [JsonPropertyName("ends")] + public int[] Ends + { + get; + set; + } + } + + /// + /// AttributionReportingTriggerDataMatching + /// + public enum AttributionReportingTriggerDataMatching + { + /// + /// exact + /// + [JsonPropertyName("exact")] + Exact, + /// + /// modulus + /// + [JsonPropertyName("modulus")] + Modulus + } + + /// + /// AttributionReportingAggregatableDebugReportingData + /// + public partial class AttributionReportingAggregatableDebugReportingData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// KeyPiece + /// + [JsonPropertyName("keyPiece")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string KeyPiece + { + get; + set; + } + + /// + /// number instead of integer because not all uint32 can be represented by + /// int + /// + [JsonPropertyName("value")] + public double Value + { + get; + set; + } + + /// + /// Types + /// + [JsonPropertyName("types")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Types + { + get; + set; + } + } + + /// + /// AttributionReportingAggregatableDebugReportingConfig + /// + public partial class AttributionReportingAggregatableDebugReportingConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// number instead of integer because not all uint32 can be represented by + /// int, only present for source registrations + /// + [JsonPropertyName("budget")] + public double? Budget + { + get; + set; + } + + /// + /// KeyPiece + /// + [JsonPropertyName("keyPiece")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string KeyPiece + { + get; + set; + } + + /// + /// DebugData + /// + [JsonPropertyName("debugData")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList DebugData + { + get; + set; + } + + /// + /// AggregationCoordinatorOrigin + /// + [JsonPropertyName("aggregationCoordinatorOrigin")] + public string AggregationCoordinatorOrigin + { + get; + set; + } + } + + /// + /// AttributionScopesData + /// + public partial class AttributionScopesData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Values + /// + [JsonPropertyName("values")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Values + { + get; + set; + } + + /// + /// number instead of integer because not all uint32 can be represented by + /// int + /// + [JsonPropertyName("limit")] + public double Limit + { + get; + set; + } + + /// + /// MaxEventStates + /// + [JsonPropertyName("maxEventStates")] + public double MaxEventStates + { + get; + set; + } + } + + /// + /// AttributionReportingNamedBudgetDef + /// + public partial class AttributionReportingNamedBudgetDef : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Budget + /// + [JsonPropertyName("budget")] + public int Budget + { + get; + set; + } + } + + /// + /// AttributionReportingSourceRegistration + /// + public partial class AttributionReportingSourceRegistration : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Time + /// + [JsonPropertyName("time")] + public double Time + { + get; + set; + } + + /// + /// duration in seconds + /// + [JsonPropertyName("expiry")] + public int Expiry + { + get; + set; + } + + /// + /// number instead of integer because not all uint32 can be represented by + /// int + /// + [JsonPropertyName("triggerData")] + public double[] TriggerData + { + get; + set; + } + + /// + /// EventReportWindows + /// + [JsonPropertyName("eventReportWindows")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingEventReportWindows EventReportWindows + { + get; + set; + } + + /// + /// duration in seconds + /// + [JsonPropertyName("aggregatableReportWindow")] + public int AggregatableReportWindow + { + get; + set; + } + + /// + /// Type + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Storage.AttributionReportingSourceType Type + { + get; + set; + } + + /// + /// SourceOrigin + /// + [JsonPropertyName("sourceOrigin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SourceOrigin + { + get; + set; + } + + /// + /// ReportingOrigin + /// + [JsonPropertyName("reportingOrigin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ReportingOrigin + { + get; + set; + } + + /// + /// DestinationSites + /// + [JsonPropertyName("destinationSites")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] DestinationSites + { + get; + set; + } + + /// + /// EventId + /// + [JsonPropertyName("eventId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string EventId + { + get; + set; + } + + /// + /// Priority + /// + [JsonPropertyName("priority")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Priority + { + get; + set; + } + + /// + /// FilterData + /// + [JsonPropertyName("filterData")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList FilterData + { + get; + set; + } + + /// + /// AggregationKeys + /// + [JsonPropertyName("aggregationKeys")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList AggregationKeys + { + get; + set; + } + + /// + /// DebugKey + /// + [JsonPropertyName("debugKey")] + public string DebugKey + { + get; + set; + } + + /// + /// TriggerDataMatching + /// + [JsonPropertyName("triggerDataMatching")] + public CefSharp.DevTools.Storage.AttributionReportingTriggerDataMatching TriggerDataMatching + { + get; + set; + } + + /// + /// DestinationLimitPriority + /// + [JsonPropertyName("destinationLimitPriority")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DestinationLimitPriority + { + get; + set; + } + + /// + /// AggregatableDebugReportingConfig + /// + [JsonPropertyName("aggregatableDebugReportingConfig")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingAggregatableDebugReportingConfig AggregatableDebugReportingConfig + { + get; + set; + } + + /// + /// ScopesData + /// + [JsonPropertyName("scopesData")] + public CefSharp.DevTools.Storage.AttributionScopesData ScopesData + { + get; + set; + } + + /// + /// MaxEventLevelReports + /// + [JsonPropertyName("maxEventLevelReports")] + public int MaxEventLevelReports + { + get; + set; + } + + /// + /// NamedBudgets + /// + [JsonPropertyName("namedBudgets")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList NamedBudgets + { + get; + set; + } + + /// + /// DebugReporting + /// + [JsonPropertyName("debugReporting")] + public bool DebugReporting + { + get; + set; + } + + /// + /// EventLevelEpsilon + /// + [JsonPropertyName("eventLevelEpsilon")] + public double EventLevelEpsilon + { + get; + set; + } + } + + /// + /// AttributionReportingSourceRegistrationResult + /// + public enum AttributionReportingSourceRegistrationResult + { + /// + /// success + /// + [JsonPropertyName("success")] + Success, + /// + /// internalError + /// + [JsonPropertyName("internalError")] + InternalError, + /// + /// insufficientSourceCapacity + /// + [JsonPropertyName("insufficientSourceCapacity")] + InsufficientSourceCapacity, + /// + /// insufficientUniqueDestinationCapacity + /// + [JsonPropertyName("insufficientUniqueDestinationCapacity")] + InsufficientUniqueDestinationCapacity, + /// + /// excessiveReportingOrigins + /// + [JsonPropertyName("excessiveReportingOrigins")] + ExcessiveReportingOrigins, + /// + /// prohibitedByBrowserPolicy + /// + [JsonPropertyName("prohibitedByBrowserPolicy")] + ProhibitedByBrowserPolicy, + /// + /// successNoised + /// + [JsonPropertyName("successNoised")] + SuccessNoised, + /// + /// destinationReportingLimitReached + /// + [JsonPropertyName("destinationReportingLimitReached")] + DestinationReportingLimitReached, + /// + /// destinationGlobalLimitReached + /// + [JsonPropertyName("destinationGlobalLimitReached")] + DestinationGlobalLimitReached, + /// + /// destinationBothLimitsReached + /// + [JsonPropertyName("destinationBothLimitsReached")] + DestinationBothLimitsReached, + /// + /// reportingOriginsPerSiteLimitReached + /// + [JsonPropertyName("reportingOriginsPerSiteLimitReached")] + ReportingOriginsPerSiteLimitReached, + /// + /// exceedsMaxChannelCapacity + /// + [JsonPropertyName("exceedsMaxChannelCapacity")] + ExceedsMaxChannelCapacity, + /// + /// exceedsMaxScopesChannelCapacity + /// + [JsonPropertyName("exceedsMaxScopesChannelCapacity")] + ExceedsMaxScopesChannelCapacity, + /// + /// exceedsMaxTriggerStateCardinality + /// + [JsonPropertyName("exceedsMaxTriggerStateCardinality")] + ExceedsMaxTriggerStateCardinality, + /// + /// exceedsMaxEventStatesLimit + /// + [JsonPropertyName("exceedsMaxEventStatesLimit")] + ExceedsMaxEventStatesLimit, + /// + /// destinationPerDayReportingLimitReached + /// + [JsonPropertyName("destinationPerDayReportingLimitReached")] + DestinationPerDayReportingLimitReached + } + + /// + /// AttributionReportingSourceRegistrationTimeConfig + /// + public enum AttributionReportingSourceRegistrationTimeConfig + { + /// + /// include + /// + [JsonPropertyName("include")] + Include, + /// + /// exclude + /// + [JsonPropertyName("exclude")] + Exclude + } + + /// + /// AttributionReportingAggregatableValueDictEntry + /// + public partial class AttributionReportingAggregatableValueDictEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Key + /// + [JsonPropertyName("key")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Key + { + get; + set; + } + + /// + /// number instead of integer because not all uint32 can be represented by + /// int + /// + [JsonPropertyName("value")] + public double Value + { + get; + set; + } + + /// + /// FilteringId + /// + [JsonPropertyName("filteringId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FilteringId + { + get; + set; + } + } + + /// + /// AttributionReportingAggregatableValueEntry + /// + public partial class AttributionReportingAggregatableValueEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Values + /// + [JsonPropertyName("values")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Values + { + get; + set; + } + + /// + /// Filters + /// + [JsonPropertyName("filters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingEventTriggerData + /// + public partial class AttributionReportingEventTriggerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Data + /// + [JsonPropertyName("data")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Data + { + get; + set; + } + + /// + /// Priority + /// + [JsonPropertyName("priority")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Priority + { + get; + set; + } + + /// + /// DedupKey + /// + [JsonPropertyName("dedupKey")] + public string DedupKey + { + get; + set; + } + + /// + /// Filters + /// + [JsonPropertyName("filters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingAggregatableTriggerData + /// + public partial class AttributionReportingAggregatableTriggerData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// KeyPiece + /// + [JsonPropertyName("keyPiece")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string KeyPiece + { + get; + set; + } + + /// + /// SourceKeys + /// + [JsonPropertyName("sourceKeys")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] SourceKeys + { + get; + set; + } + + /// + /// Filters + /// + [JsonPropertyName("filters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingAggregatableDedupKey + /// + public partial class AttributionReportingAggregatableDedupKey : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// DedupKey + /// + [JsonPropertyName("dedupKey")] + public string DedupKey + { + get; + set; + } + + /// + /// Filters + /// + [JsonPropertyName("filters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingNamedBudgetCandidate + /// + public partial class AttributionReportingNamedBudgetCandidate : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Name + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// Filters + /// + [JsonPropertyName("filters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + } + + /// + /// AttributionReportingTriggerRegistration + /// + public partial class AttributionReportingTriggerRegistration : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Filters + /// + [JsonPropertyName("filters")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingFilterPair Filters + { + get; + set; + } + + /// + /// DebugKey + /// + [JsonPropertyName("debugKey")] + public string DebugKey + { + get; + set; + } + + /// + /// AggregatableDedupKeys + /// + [JsonPropertyName("aggregatableDedupKeys")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList AggregatableDedupKeys + { + get; + set; + } + + /// + /// EventTriggerData + /// + [JsonPropertyName("eventTriggerData")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList EventTriggerData + { + get; + set; + } + + /// + /// AggregatableTriggerData + /// + [JsonPropertyName("aggregatableTriggerData")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList AggregatableTriggerData + { + get; + set; + } + + /// + /// AggregatableValues + /// + [JsonPropertyName("aggregatableValues")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList AggregatableValues + { + get; + set; + } + + /// + /// AggregatableFilteringIdMaxBytes + /// + [JsonPropertyName("aggregatableFilteringIdMaxBytes")] + public int AggregatableFilteringIdMaxBytes + { + get; + set; + } + + /// + /// DebugReporting + /// + [JsonPropertyName("debugReporting")] + public bool DebugReporting + { + get; + set; + } + + /// + /// AggregationCoordinatorOrigin + /// + [JsonPropertyName("aggregationCoordinatorOrigin")] + public string AggregationCoordinatorOrigin + { + get; + set; + } + + /// + /// SourceRegistrationTimeConfig + /// + [JsonPropertyName("sourceRegistrationTimeConfig")] + public CefSharp.DevTools.Storage.AttributionReportingSourceRegistrationTimeConfig SourceRegistrationTimeConfig + { + get; + set; + } + + /// + /// TriggerContextId + /// + [JsonPropertyName("triggerContextId")] + public string TriggerContextId + { + get; + set; + } + + /// + /// AggregatableDebugReportingConfig + /// + [JsonPropertyName("aggregatableDebugReportingConfig")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingAggregatableDebugReportingConfig AggregatableDebugReportingConfig + { + get; + set; + } + + /// + /// Scopes + /// + [JsonPropertyName("scopes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Scopes + { + get; + set; + } + + /// + /// NamedBudgets + /// + [JsonPropertyName("namedBudgets")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList NamedBudgets + { + get; + set; + } + } + + /// + /// AttributionReportingEventLevelResult + /// + public enum AttributionReportingEventLevelResult + { + /// + /// success + /// + [JsonPropertyName("success")] + Success, + /// + /// successDroppedLowerPriority + /// + [JsonPropertyName("successDroppedLowerPriority")] + SuccessDroppedLowerPriority, + /// + /// internalError + /// + [JsonPropertyName("internalError")] + InternalError, + /// + /// noCapacityForAttributionDestination + /// + [JsonPropertyName("noCapacityForAttributionDestination")] + NoCapacityForAttributionDestination, + /// + /// noMatchingSources + /// + [JsonPropertyName("noMatchingSources")] + NoMatchingSources, + /// + /// deduplicated + /// + [JsonPropertyName("deduplicated")] + Deduplicated, + /// + /// excessiveAttributions + /// + [JsonPropertyName("excessiveAttributions")] + ExcessiveAttributions, + /// + /// priorityTooLow + /// + [JsonPropertyName("priorityTooLow")] + PriorityTooLow, + /// + /// neverAttributedSource + /// + [JsonPropertyName("neverAttributedSource")] + NeverAttributedSource, + /// + /// excessiveReportingOrigins + /// + [JsonPropertyName("excessiveReportingOrigins")] + ExcessiveReportingOrigins, + /// + /// noMatchingSourceFilterData + /// + [JsonPropertyName("noMatchingSourceFilterData")] + NoMatchingSourceFilterData, + /// + /// prohibitedByBrowserPolicy + /// + [JsonPropertyName("prohibitedByBrowserPolicy")] + ProhibitedByBrowserPolicy, + /// + /// noMatchingConfigurations + /// + [JsonPropertyName("noMatchingConfigurations")] + NoMatchingConfigurations, + /// + /// excessiveReports + /// + [JsonPropertyName("excessiveReports")] + ExcessiveReports, + /// + /// falselyAttributedSource + /// + [JsonPropertyName("falselyAttributedSource")] + FalselyAttributedSource, + /// + /// reportWindowPassed + /// + [JsonPropertyName("reportWindowPassed")] + ReportWindowPassed, + /// + /// notRegistered + /// + [JsonPropertyName("notRegistered")] + NotRegistered, + /// + /// reportWindowNotStarted + /// + [JsonPropertyName("reportWindowNotStarted")] + ReportWindowNotStarted, + /// + /// noMatchingTriggerData + /// + [JsonPropertyName("noMatchingTriggerData")] + NoMatchingTriggerData + } + + /// + /// AttributionReportingAggregatableResult + /// + public enum AttributionReportingAggregatableResult + { + /// + /// success + /// + [JsonPropertyName("success")] + Success, + /// + /// internalError + /// + [JsonPropertyName("internalError")] + InternalError, + /// + /// noCapacityForAttributionDestination + /// + [JsonPropertyName("noCapacityForAttributionDestination")] + NoCapacityForAttributionDestination, + /// + /// noMatchingSources + /// + [JsonPropertyName("noMatchingSources")] + NoMatchingSources, + /// + /// excessiveAttributions + /// + [JsonPropertyName("excessiveAttributions")] + ExcessiveAttributions, + /// + /// excessiveReportingOrigins + /// + [JsonPropertyName("excessiveReportingOrigins")] + ExcessiveReportingOrigins, + /// + /// noHistograms + /// + [JsonPropertyName("noHistograms")] + NoHistograms, + /// + /// insufficientBudget + /// + [JsonPropertyName("insufficientBudget")] + InsufficientBudget, + /// + /// insufficientNamedBudget + /// + [JsonPropertyName("insufficientNamedBudget")] + InsufficientNamedBudget, + /// + /// noMatchingSourceFilterData + /// + [JsonPropertyName("noMatchingSourceFilterData")] + NoMatchingSourceFilterData, + /// + /// notRegistered + /// + [JsonPropertyName("notRegistered")] + NotRegistered, + /// + /// prohibitedByBrowserPolicy + /// + [JsonPropertyName("prohibitedByBrowserPolicy")] + ProhibitedByBrowserPolicy, + /// + /// deduplicated + /// + [JsonPropertyName("deduplicated")] + Deduplicated, + /// + /// reportWindowPassed + /// + [JsonPropertyName("reportWindowPassed")] + ReportWindowPassed, + /// + /// excessiveReports + /// + [JsonPropertyName("excessiveReports")] + ExcessiveReports + } + + /// + /// AttributionReportingReportResult + /// + public enum AttributionReportingReportResult + { + /// + /// sent + /// + [JsonPropertyName("sent")] + Sent, + /// + /// prohibited + /// + [JsonPropertyName("prohibited")] + Prohibited, + /// + /// failedToAssemble + /// + [JsonPropertyName("failedToAssemble")] + FailedToAssemble, + /// + /// expired + /// + [JsonPropertyName("expired")] + Expired + } + + /// + /// A single Related Website Set object. + /// + public partial class RelatedWebsiteSet : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The primary site of this set, along with the ccTLDs if there is any. + /// + [JsonPropertyName("primarySites")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] PrimarySites + { + get; + set; + } + + /// + /// The associated sites of this set, along with the ccTLDs if there is any. + /// + [JsonPropertyName("associatedSites")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] AssociatedSites + { + get; + set; + } + + /// + /// The service sites of this set, along with the ccTLDs if there is any. + /// + [JsonPropertyName("serviceSites")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] ServiceSites + { + get; + set; + } + } + + /// + /// A cache's contents have been modified. + /// + public class CacheStorageContentUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin to update. + /// + [JsonInclude] + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + private set; + } + + /// + /// Storage key to update. + /// + [JsonInclude] + [JsonPropertyName("storageKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StorageKey + { + get; + private set; + } + + /// + /// Storage bucket to update. + /// + [JsonInclude] + [JsonPropertyName("bucketId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BucketId + { + get; + private set; + } + + /// + /// Name of cache in origin. + /// + [JsonInclude] + [JsonPropertyName("cacheName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string CacheName + { + get; + private set; + } + } + + /// + /// A cache has been added/deleted. + /// + public class CacheStorageListUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin to update. + /// + [JsonInclude] + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + private set; + } + + /// + /// Storage key to update. + /// + [JsonInclude] + [JsonPropertyName("storageKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StorageKey + { + get; + private set; + } + + /// + /// Storage bucket to update. + /// + [JsonInclude] + [JsonPropertyName("bucketId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BucketId + { + get; + private set; + } + } + + /// + /// The origin's IndexedDB object store has been modified. + /// + public class IndexedDBContentUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin to update. + /// + [JsonInclude] + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + private set; + } + + /// + /// Storage key to update. + /// + [JsonInclude] + [JsonPropertyName("storageKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StorageKey + { + get; + private set; + } + + /// + /// Storage bucket to update. + /// + [JsonInclude] + [JsonPropertyName("bucketId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BucketId + { + get; + private set; + } + + /// + /// Database to update. + /// + [JsonInclude] + [JsonPropertyName("databaseName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DatabaseName + { + get; + private set; + } + + /// + /// ObjectStore to update. + /// + [JsonInclude] + [JsonPropertyName("objectStoreName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ObjectStoreName + { + get; + private set; + } + } + + /// + /// The origin's IndexedDB database list has been modified. + /// + public class IndexedDBListUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Origin to update. + /// + [JsonInclude] + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + private set; + } + + /// + /// Storage key to update. + /// + [JsonInclude] + [JsonPropertyName("storageKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string StorageKey + { + get; + private set; + } + + /// + /// Storage bucket to update. + /// + [JsonInclude] + [JsonPropertyName("bucketId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BucketId + { + get; + private set; + } + } + + /// + /// One of the interest groups was accessed. Note that these events are global + /// to all targets sharing an interest group store. + /// + public class InterestGroupAccessedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AccessTime + /// + [JsonInclude] + [JsonPropertyName("accessTime")] + public double AccessTime + { + get; + private set; + } + + /// + /// Type + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Storage.InterestGroupAccessType Type + { + get; + private set; + } + + /// + /// OwnerOrigin + /// + [JsonInclude] + [JsonPropertyName("ownerOrigin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string OwnerOrigin + { + get; + private set; + } + + /// + /// Name + /// + [JsonInclude] + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + private set; + } + + /// + /// For topLevelBid/topLevelAdditionalBid, and when appropriate, + /// win and additionalBidWin + /// + [JsonInclude] + [JsonPropertyName("componentSellerOrigin")] + public string ComponentSellerOrigin + { + get; + private set; + } + + /// + /// For bid or somethingBid event, if done locally and not on a server. + /// + [JsonInclude] + [JsonPropertyName("bid")] + public double? Bid + { + get; + private set; + } + + /// + /// BidCurrency + /// + [JsonInclude] + [JsonPropertyName("bidCurrency")] + public string BidCurrency + { + get; + private set; + } + + /// + /// For non-global events --- links to interestGroupAuctionEvent + /// + [JsonInclude] + [JsonPropertyName("uniqueAuctionId")] + public string UniqueAuctionId + { + get; + private set; + } + } + + /// + /// An auction involving interest groups is taking place. These events are + /// target-specific. + /// + public class InterestGroupAuctionEventOccurredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// EventTime + /// + [JsonInclude] + [JsonPropertyName("eventTime")] + public double EventTime + { + get; + private set; + } + + /// + /// Type + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Storage.InterestGroupAuctionEventType Type + { + get; + private set; + } + + /// + /// UniqueAuctionId + /// + [JsonInclude] + [JsonPropertyName("uniqueAuctionId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string UniqueAuctionId + { + get; + private set; + } + + /// + /// Set for child auctions. + /// + [JsonInclude] + [JsonPropertyName("parentAuctionId")] + public string ParentAuctionId + { + get; + private set; + } + + /// + /// Set for started and configResolved + /// + [JsonInclude] + [JsonPropertyName("auctionConfig")] + public object AuctionConfig + { + get; + private set; + } + } + + /// + /// Specifies which auctions a particular network fetch may be related to, and + /// in what role. Note that it is not ordered with respect to + /// Network.requestWillBeSent (but will happen before loadingFinished + /// loadingFailed). + /// + public class InterestGroupAuctionNetworkRequestCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Type + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Storage.InterestGroupAuctionFetchType Type + { + get; + private set; + } + + /// + /// RequestId + /// + [JsonInclude] + [JsonPropertyName("requestId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string RequestId + { + get; + private set; + } + + /// + /// This is the set of the auctions using the worklet that issued this + /// request. In the case of trusted signals, it's possible that only some of + /// them actually care about the keys being queried. + /// + [JsonInclude] + [JsonPropertyName("auctions")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Auctions + { + get; + private set; + } + } + + /// + /// Shared storage was accessed by the associated page. + /// The following parameters are included in all events. + /// + public class SharedStorageAccessedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Time of the access. + /// + [JsonInclude] + [JsonPropertyName("accessTime")] + public double AccessTime + { + get; + private set; + } + + /// + /// Enum value indicating the access scope. + /// + [JsonInclude] + [JsonPropertyName("scope")] + public CefSharp.DevTools.Storage.SharedStorageAccessScope Scope + { + get; + private set; + } + + /// + /// Enum value indicating the Shared Storage API method invoked. + /// + [JsonInclude] + [JsonPropertyName("method")] + public CefSharp.DevTools.Storage.SharedStorageAccessMethod Method + { + get; + private set; + } + + /// + /// DevTools Frame Token for the primary frame tree's root. + /// + [JsonInclude] + [JsonPropertyName("mainFrameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string MainFrameId + { + get; + private set; + } + + /// + /// Serialization of the origin owning the Shared Storage data. + /// + [JsonInclude] + [JsonPropertyName("ownerOrigin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string OwnerOrigin + { + get; + private set; + } + + /// + /// Serialization of the site owning the Shared Storage data. + /// + [JsonInclude] + [JsonPropertyName("ownerSite")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string OwnerSite + { + get; + private set; + } + + /// + /// The sub-parameters wrapped by `params` are all optional and their + /// presence/absence depends on `type`. + /// + [JsonInclude] + [JsonPropertyName("params")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.SharedStorageAccessParams Params + { + get; + private set; + } + } + + /// + /// A shared storage run or selectURL operation finished its execution. + /// The following parameters are included in all events. + /// + public class SharedStorageWorkletOperationExecutionFinishedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Time that the operation finished. + /// + [JsonInclude] + [JsonPropertyName("finishedTime")] + public double FinishedTime + { + get; + private set; + } + + /// + /// Time, in microseconds, from start of shared storage JS API call until + /// end of operation execution in the worklet. + /// + [JsonInclude] + [JsonPropertyName("executionTime")] + public int ExecutionTime + { + get; + private set; + } + + /// + /// Enum value indicating the Shared Storage API method invoked. + /// + [JsonInclude] + [JsonPropertyName("method")] + public CefSharp.DevTools.Storage.SharedStorageAccessMethod Method + { + get; + private set; + } + + /// + /// ID of the operation call. + /// + [JsonInclude] + [JsonPropertyName("operationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string OperationId + { + get; + private set; + } + + /// + /// Hex representation of the DevTools token used as the TargetID for the + /// associated shared storage worklet. + /// + [JsonInclude] + [JsonPropertyName("workletTargetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string WorkletTargetId + { + get; + private set; + } + + /// + /// DevTools Frame Token for the primary frame tree's root. + /// + [JsonInclude] + [JsonPropertyName("mainFrameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string MainFrameId + { + get; + private set; + } + + /// + /// Serialization of the origin owning the Shared Storage data. + /// + [JsonInclude] + [JsonPropertyName("ownerOrigin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string OwnerOrigin + { + get; + private set; + } + } + + /// + /// storageBucketCreatedOrUpdated + /// + public class StorageBucketCreatedOrUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// BucketInfo + /// + [JsonInclude] + [JsonPropertyName("bucketInfo")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.StorageBucketInfo BucketInfo + { + get; + private set; + } + } + + /// + /// storageBucketDeleted + /// + public class StorageBucketDeletedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// BucketId + /// + [JsonInclude] + [JsonPropertyName("bucketId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BucketId + { + get; + private set; + } + } + + /// + /// attributionReportingSourceRegistered + /// + public class AttributionReportingSourceRegisteredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Registration + /// + [JsonInclude] + [JsonPropertyName("registration")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingSourceRegistration Registration + { + get; + private set; + } + + /// + /// Result + /// + [JsonInclude] + [JsonPropertyName("result")] + public CefSharp.DevTools.Storage.AttributionReportingSourceRegistrationResult Result + { + get; + private set; + } + } + + /// + /// attributionReportingTriggerRegistered + /// + public class AttributionReportingTriggerRegisteredEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Registration + /// + [JsonInclude] + [JsonPropertyName("registration")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Storage.AttributionReportingTriggerRegistration Registration + { + get; + private set; + } + + /// + /// EventLevel + /// + [JsonInclude] + [JsonPropertyName("eventLevel")] + public CefSharp.DevTools.Storage.AttributionReportingEventLevelResult EventLevel + { + get; + private set; + } + + /// + /// Aggregatable + /// + [JsonInclude] + [JsonPropertyName("aggregatable")] + public CefSharp.DevTools.Storage.AttributionReportingAggregatableResult Aggregatable + { + get; + private set; + } + } + + /// + /// attributionReportingReportSent + /// + public class AttributionReportingReportSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Url + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Body + /// + [JsonInclude] + [JsonPropertyName("body")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public object Body + { + get; + private set; + } + + /// + /// Result + /// + [JsonInclude] + [JsonPropertyName("result")] + public CefSharp.DevTools.Storage.AttributionReportingReportResult Result + { + get; + private set; + } + + /// + /// If result is `sent`, populated with net/HTTP status. + /// + [JsonInclude] + [JsonPropertyName("netError")] + public int? NetError + { + get; + private set; + } + + /// + /// NetErrorName + /// + [JsonInclude] + [JsonPropertyName("netErrorName")] + public string NetErrorName + { + get; + private set; + } + + /// + /// HttpStatusCode + /// + [JsonInclude] + [JsonPropertyName("httpStatusCode")] + public int? HttpStatusCode + { + get; + private set; + } + } + + /// + /// attributionReportingVerboseDebugReportSent + /// + public class AttributionReportingVerboseDebugReportSentEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Url + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Body + /// + [JsonInclude] + [JsonPropertyName("body")] + public System.Collections.Generic.IList Body + { + get; + private set; + } + + /// + /// NetError + /// + [JsonInclude] + [JsonPropertyName("netError")] + public int? NetError + { + get; + private set; + } + + /// + /// NetErrorName + /// + [JsonInclude] + [JsonPropertyName("netErrorName")] + public string NetErrorName + { + get; + private set; + } + + /// + /// HttpStatusCode + /// + [JsonInclude] + [JsonPropertyName("httpStatusCode")] + public int? HttpStatusCode + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + /// + /// Describes a single graphics processor (GPU). + /// + public partial class GPUDevice : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// PCI ID of the GPU vendor, if available; 0 otherwise. + /// + [JsonPropertyName("vendorId")] + public double VendorId + { + get; + set; + } + + /// + /// PCI ID of the GPU device, if available; 0 otherwise. + /// + [JsonPropertyName("deviceId")] + public double DeviceId + { + get; + set; + } + + /// + /// Sub sys ID of the GPU, only available on Windows. + /// + [JsonPropertyName("subSysId")] + public double? SubSysId + { + get; + set; + } + + /// + /// Revision of the GPU, only available on Windows. + /// + [JsonPropertyName("revision")] + public double? Revision + { + get; + set; + } + + /// + /// String description of the GPU vendor, if the PCI ID is not available. + /// + [JsonPropertyName("vendorString")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string VendorString + { + get; + set; + } + + /// + /// String description of the GPU device, if the PCI ID is not available. + /// + [JsonPropertyName("deviceString")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DeviceString + { + get; + set; + } + + /// + /// String description of the GPU driver vendor. + /// + [JsonPropertyName("driverVendor")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DriverVendor + { + get; + set; + } + + /// + /// String description of the GPU driver version. + /// + [JsonPropertyName("driverVersion")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DriverVersion + { + get; + set; + } + } + + /// + /// Describes the width and height dimensions of an entity. + /// + public partial class Size : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Width in pixels. + /// + [JsonPropertyName("width")] + public int Width + { + get; + set; + } + + /// + /// Height in pixels. + /// + [JsonPropertyName("height")] + public int Height + { + get; + set; + } + } + + /// + /// Describes a supported video decoding profile with its associated minimum and + /// maximum resolutions. + /// + public partial class VideoDecodeAcceleratorCapability : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Video codec profile that is supported, e.g. VP9 Profile 2. + /// + [JsonPropertyName("profile")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Profile + { + get; + set; + } + + /// + /// Maximum video dimensions in pixels supported for this |profile|. + /// + [JsonPropertyName("maxResolution")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.SystemInfo.Size MaxResolution + { + get; + set; + } + + /// + /// Minimum video dimensions in pixels supported for this |profile|. + /// + [JsonPropertyName("minResolution")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.SystemInfo.Size MinResolution + { + get; + set; + } + } + + /// + /// Describes a supported video encoding profile with its associated maximum + /// resolution and maximum framerate. + /// + public partial class VideoEncodeAcceleratorCapability : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Video codec profile that is supported, e.g H264 Main. + /// + [JsonPropertyName("profile")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Profile + { + get; + set; + } + + /// + /// Maximum video dimensions in pixels supported for this |profile|. + /// + [JsonPropertyName("maxResolution")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.SystemInfo.Size MaxResolution + { + get; + set; + } + + /// + /// Maximum encoding framerate in frames per second supported for this + /// |profile|, as fraction's numerator and denominator, e.g. 24/1 fps, + /// 24000/1001 fps, etc. + /// + [JsonPropertyName("maxFramerateNumerator")] + public int MaxFramerateNumerator + { + get; + set; + } + + /// + /// MaxFramerateDenominator + /// + [JsonPropertyName("maxFramerateDenominator")] + public int MaxFramerateDenominator + { + get; + set; + } + } + + /// + /// YUV subsampling type of the pixels of a given image. + /// + public enum SubsamplingFormat + { + /// + /// yuv420 + /// + [JsonPropertyName("yuv420")] + Yuv420, + /// + /// yuv422 + /// + [JsonPropertyName("yuv422")] + Yuv422, + /// + /// yuv444 + /// + [JsonPropertyName("yuv444")] + Yuv444 + } + + /// + /// Image format of a given image. + /// + public enum ImageType + { + /// + /// jpeg + /// + [JsonPropertyName("jpeg")] + Jpeg, + /// + /// webp + /// + [JsonPropertyName("webp")] + Webp, + /// + /// unknown + /// + [JsonPropertyName("unknown")] + Unknown + } + + /// + /// Provides information about the GPU(s) on the system. + /// + public partial class GPUInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The graphics devices on the system. Element 0 is the primary GPU. + /// + [JsonPropertyName("devices")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Devices + { + get; + set; + } + + /// + /// An optional dictionary of additional GPU related attributes. + /// + [JsonPropertyName("auxAttributes")] + public object AuxAttributes + { + get; + set; + } + + /// + /// An optional dictionary of graphics features and their status. + /// + [JsonPropertyName("featureStatus")] + public object FeatureStatus + { + get; + set; + } + + /// + /// An optional array of GPU driver bug workarounds. + /// + [JsonPropertyName("driverBugWorkarounds")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] DriverBugWorkarounds + { + get; + set; + } + + /// + /// Supported accelerated video decoding capabilities. + /// + [JsonPropertyName("videoDecoding")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList VideoDecoding + { + get; + set; + } + + /// + /// Supported accelerated video encoding capabilities. + /// + [JsonPropertyName("videoEncoding")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList VideoEncoding + { + get; + set; + } + } + + /// + /// Represents process info. + /// + public partial class ProcessInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Specifies process type. + /// + [JsonPropertyName("type")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Type + { + get; + set; + } + + /// + /// Specifies process id. + /// + [JsonPropertyName("id")] + public int Id + { + get; + set; + } + + /// + /// Specifies cumulative CPU usage in seconds across all threads of the + /// process since the process start. + /// + [JsonPropertyName("cpuTime")] + public double CpuTime + { + get; + set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// TargetInfo + /// + public partial class TargetInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// TargetId + /// + [JsonPropertyName("targetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TargetId + { + get; + set; + } + + /// + /// List of types: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_agent_host_impl.cc?ss=chromium&q=f:devtools%20-f:out%20%22::kTypeTab%5B%5D%22 + /// + [JsonPropertyName("type")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Type + { + get; + set; + } + + /// + /// Title + /// + [JsonPropertyName("title")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Title + { + get; + set; + } + + /// + /// Url + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Whether the target has an attached client. + /// + [JsonPropertyName("attached")] + public bool Attached + { + get; + set; + } + + /// + /// Opener target Id + /// + [JsonPropertyName("openerId")] + public string OpenerId + { + get; + set; + } + + /// + /// Whether the target has access to the originating window. + /// + [JsonPropertyName("canAccessOpener")] + public bool CanAccessOpener + { + get; + set; + } + + /// + /// Frame id of originating window (is only set if target has an opener). + /// + [JsonPropertyName("openerFrameId")] + public string OpenerFrameId + { + get; + set; + } + + /// + /// Id of the parent frame, only present for the "iframe" targets. + /// + [JsonPropertyName("parentFrameId")] + public string ParentFrameId + { + get; + set; + } + + /// + /// BrowserContextId + /// + [JsonPropertyName("browserContextId")] + public string BrowserContextId + { + get; + set; + } + + /// + /// Provides additional details for specific target types. For example, for + /// the type of "page", this may be set to "prerender". + /// + [JsonPropertyName("subtype")] + public string Subtype + { + get; + set; + } + } + + /// + /// A filter used by target query/discovery/auto-attach operations. + /// + public partial class FilterEntry : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// If set, causes exclusion of matching targets from the list. + /// + [JsonPropertyName("exclude")] + public bool? Exclude + { + get; + set; + } + + /// + /// If not present, matches any type. + /// + [JsonPropertyName("type")] + public string Type + { + get; + set; + } + } + + /// + /// RemoteLocation + /// + public partial class RemoteLocation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Host + /// + [JsonPropertyName("host")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Host + { + get; + set; + } + + /// + /// Port + /// + [JsonPropertyName("port")] + public int Port + { + get; + set; + } + } + + /// + /// The state of the target window. + /// + public enum WindowState + { + /// + /// normal + /// + [JsonPropertyName("normal")] + Normal, + /// + /// minimized + /// + [JsonPropertyName("minimized")] + Minimized, + /// + /// maximized + /// + [JsonPropertyName("maximized")] + Maximized, + /// + /// fullscreen + /// + [JsonPropertyName("fullscreen")] + Fullscreen + } + + /// + /// Issued when attached to target because of auto-attach or `attachToTarget` command. + /// + public class AttachedToTargetEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier assigned to the session used to send/receive messages. + /// + [JsonInclude] + [JsonPropertyName("sessionId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SessionId + { + get; + private set; + } + + /// + /// TargetInfo + /// + [JsonInclude] + [JsonPropertyName("targetInfo")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Target.TargetInfo TargetInfo + { + get; + private set; + } + + /// + /// WaitingForDebugger + /// + [JsonInclude] + [JsonPropertyName("waitingForDebugger")] + public bool WaitingForDebugger + { + get; + private set; + } + } + + /// + /// Issued when detached from target for any reason (including `detachFromTarget` command). Can be + /// issued multiple times per target if multiple sessions have been attached to it. + /// + public class DetachedFromTargetEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Detached session identifier. + /// + [JsonInclude] + [JsonPropertyName("sessionId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SessionId + { + get; + private set; + } + + /// + /// Deprecated. + /// + [JsonInclude] + [JsonPropertyName("targetId")] + public string TargetId + { + get; + private set; + } + } + + /// + /// Notifies about a new protocol message received from the session (as reported in + /// `attachedToTarget` event). + /// + public class ReceivedMessageFromTargetEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier of a session which sends a message. + /// + [JsonInclude] + [JsonPropertyName("sessionId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SessionId + { + get; + private set; + } + + /// + /// Message + /// + [JsonInclude] + [JsonPropertyName("message")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Message + { + get; + private set; + } + + /// + /// Deprecated. + /// + [JsonInclude] + [JsonPropertyName("targetId")] + public string TargetId + { + get; + private set; + } + } + + /// + /// Issued when a possible inspection target is created. + /// + public class TargetCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// TargetInfo + /// + [JsonInclude] + [JsonPropertyName("targetInfo")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Target.TargetInfo TargetInfo + { + get; + private set; + } + } + + /// + /// Issued when a target is destroyed. + /// + public class TargetDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// TargetId + /// + [JsonInclude] + [JsonPropertyName("targetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TargetId + { + get; + private set; + } + } + + /// + /// Issued when a target has crashed. + /// + public class TargetCrashedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// TargetId + /// + [JsonInclude] + [JsonPropertyName("targetId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string TargetId + { + get; + private set; + } + + /// + /// Termination status type. + /// + [JsonInclude] + [JsonPropertyName("status")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Status + { + get; + private set; + } + + /// + /// Termination error code. + /// + [JsonInclude] + [JsonPropertyName("errorCode")] + public int ErrorCode + { + get; + private set; + } + } + + /// + /// Issued when some information about a target has changed. This only happens between + /// `targetCreated` and `targetDestroyed`. + /// + public class TargetInfoChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// TargetInfo + /// + [JsonInclude] + [JsonPropertyName("targetInfo")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Target.TargetInfo TargetInfo + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Tethering +{ + /// + /// Informs that port was successfully bound and got a specified connection id. + /// + public class AcceptedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Port number that was successfully bound. + /// + [JsonInclude] + [JsonPropertyName("port")] + public int Port + { + get; + private set; + } + + /// + /// Connection id to be used. + /// + [JsonInclude] + [JsonPropertyName("connectionId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ConnectionId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + /// + /// Controls how the trace buffer stores data. The default is `recordUntilFull`. + /// + public enum TraceConfigRecordMode + { + /// + /// recordUntilFull + /// + [JsonPropertyName("recordUntilFull")] + RecordUntilFull, + /// + /// recordContinuously + /// + [JsonPropertyName("recordContinuously")] + RecordContinuously, + /// + /// recordAsMuchAsPossible + /// + [JsonPropertyName("recordAsMuchAsPossible")] + RecordAsMuchAsPossible, + /// + /// echoToConsole + /// + [JsonPropertyName("echoToConsole")] + EchoToConsole + } + + /// + /// TraceConfig + /// + public partial class TraceConfig : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Controls how the trace buffer stores data. The default is `recordUntilFull`. + /// + [JsonPropertyName("recordMode")] + public CefSharp.DevTools.Tracing.TraceConfigRecordMode? RecordMode + { + get; + set; + } + + /// + /// Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value + /// of 200 MB would be used. + /// + [JsonPropertyName("traceBufferSizeInKb")] + public double? TraceBufferSizeInKb + { + get; + set; + } + + /// + /// Turns on JavaScript stack sampling. + /// + [JsonPropertyName("enableSampling")] + public bool? EnableSampling + { + get; + set; + } + + /// + /// Turns on system tracing. + /// + [JsonPropertyName("enableSystrace")] + public bool? EnableSystrace + { + get; + set; + } + + /// + /// Turns on argument filter. + /// + [JsonPropertyName("enableArgumentFilter")] + public bool? EnableArgumentFilter + { + get; + set; + } + + /// + /// Included category filters. + /// + [JsonPropertyName("includedCategories")] + public string[] IncludedCategories + { + get; + set; + } + + /// + /// Excluded category filters. + /// + [JsonPropertyName("excludedCategories")] + public string[] ExcludedCategories + { + get; + set; + } + + /// + /// Configuration to synthesize the delays in tracing. + /// + [JsonPropertyName("syntheticDelays")] + public string[] SyntheticDelays + { + get; + set; + } + + /// + /// Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. + /// + [JsonPropertyName("memoryDumpConfig")] + public CefSharp.DevTools.Tracing.MemoryDumpConfig MemoryDumpConfig + { + get; + set; + } + } + + /// + /// Data format of a trace. Can be either the legacy JSON format or the + /// protocol buffer format. Note that the JSON format will be deprecated soon. + /// + public enum StreamFormat + { + /// + /// json + /// + [JsonPropertyName("json")] + Json, + /// + /// proto + /// + [JsonPropertyName("proto")] + Proto + } + + /// + /// Compression type to use for traces returned via streams. + /// + public enum StreamCompression + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// gzip + /// + [JsonPropertyName("gzip")] + Gzip + } + + /// + /// Details exposed when memory request explicitly declared. + /// Keep consistent with memory_dump_request_args.h and + /// memory_instrumentation.mojom + /// + public enum MemoryDumpLevelOfDetail + { + /// + /// background + /// + [JsonPropertyName("background")] + Background, + /// + /// light + /// + [JsonPropertyName("light")] + Light, + /// + /// detailed + /// + [JsonPropertyName("detailed")] + Detailed + } + + /// + /// Backend type to use for tracing. `chrome` uses the Chrome-integrated + /// tracing service and is supported on all platforms. `system` is only + /// supported on Chrome OS and uses the Perfetto system tracing service. + /// `auto` chooses `system` when the perfettoConfig provided to Tracing.start + /// specifies at least one non-Chrome data source; otherwise uses `chrome`. + /// + public enum TracingBackend + { + /// + /// auto + /// + [JsonPropertyName("auto")] + Auto, + /// + /// chrome + /// + [JsonPropertyName("chrome")] + Chrome, + /// + /// system + /// + [JsonPropertyName("system")] + System + } + + /// + /// bufferUsage + /// + public class BufferUsageEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// A number in range [0..1] that indicates the used size of event buffer as a fraction of its + /// total size. + /// + [JsonInclude] + [JsonPropertyName("percentFull")] + public double? PercentFull + { + get; + private set; + } + + /// + /// An approximate number of events in the trace log. + /// + [JsonInclude] + [JsonPropertyName("eventCount")] + public double? EventCount + { + get; + private set; + } + + /// + /// A number in range [0..1] that indicates the used size of event buffer as a fraction of its + /// total size. + /// + [JsonInclude] + [JsonPropertyName("value")] + public double? Value + { + get; + private set; + } + } + + /// + /// Contains a bucket of collected trace events. When tracing is stopped collected events will be + /// sent as a sequence of dataCollected events followed by tracingComplete event. + /// + public class DataCollectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Value + /// + [JsonInclude] + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Value + { + get; + private set; + } + } + + /// + /// Signals that tracing is stopped and there is no trace buffers pending flush, all data were + /// delivered via dataCollected events. + /// + public class TracingCompleteEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Indicates whether some trace data is known to have been lost, e.g. because the trace ring + /// buffer wrapped around. + /// + [JsonInclude] + [JsonPropertyName("dataLossOccurred")] + public bool DataLossOccurred + { + get; + private set; + } + + /// + /// A handle of the stream that holds resulting trace data. + /// + [JsonInclude] + [JsonPropertyName("stream")] + public string Stream + { + get; + private set; + } + + /// + /// Trace data format of returned stream. + /// + [JsonInclude] + [JsonPropertyName("traceFormat")] + public CefSharp.DevTools.Tracing.StreamFormat? TraceFormat + { + get; + private set; + } + + /// + /// Compression format of returned stream. + /// + [JsonInclude] + [JsonPropertyName("streamCompression")] + public CefSharp.DevTools.Tracing.StreamCompression? StreamCompression + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.WebAudio +{ + /// + /// Enum of BaseAudioContext types + /// + public enum ContextType + { + /// + /// realtime + /// + [JsonPropertyName("realtime")] + Realtime, + /// + /// offline + /// + [JsonPropertyName("offline")] + Offline + } + + /// + /// Enum of AudioContextState from the spec + /// + public enum ContextState + { + /// + /// suspended + /// + [JsonPropertyName("suspended")] + Suspended, + /// + /// running + /// + [JsonPropertyName("running")] + Running, + /// + /// closed + /// + [JsonPropertyName("closed")] + Closed, + /// + /// interrupted + /// + [JsonPropertyName("interrupted")] + Interrupted + } + + /// + /// Enum of AudioNode::ChannelCountMode from the spec + /// + public enum ChannelCountMode + { + /// + /// clamped-max + /// + [JsonPropertyName("clamped-max")] + ClampedMax, + /// + /// explicit + /// + [JsonPropertyName("explicit")] + Explicit, + /// + /// max + /// + [JsonPropertyName("max")] + Max + } + + /// + /// Enum of AudioNode::ChannelInterpretation from the spec + /// + public enum ChannelInterpretation + { + /// + /// discrete + /// + [JsonPropertyName("discrete")] + Discrete, + /// + /// speakers + /// + [JsonPropertyName("speakers")] + Speakers + } + + /// + /// Enum of AudioParam::AutomationRate from the spec + /// + public enum AutomationRate + { + /// + /// a-rate + /// + [JsonPropertyName("a-rate")] + ARate, + /// + /// k-rate + /// + [JsonPropertyName("k-rate")] + KRate + } + + /// + /// Fields in AudioContext that change in real-time. + /// + public partial class ContextRealtimeData : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The current context time in second in BaseAudioContext. + /// + [JsonPropertyName("currentTime")] + public double CurrentTime + { + get; + set; + } + + /// + /// The time spent on rendering graph divided by render quantum duration, + /// and multiplied by 100. 100 means the audio renderer reached the full + /// capacity and glitch may occur. + /// + [JsonPropertyName("renderCapacity")] + public double RenderCapacity + { + get; + set; + } + + /// + /// A running mean of callback interval. + /// + [JsonPropertyName("callbackIntervalMean")] + public double CallbackIntervalMean + { + get; + set; + } + + /// + /// A running variance of callback interval. + /// + [JsonPropertyName("callbackIntervalVariance")] + public double CallbackIntervalVariance + { + get; + set; + } + } + + /// + /// Protocol object for BaseAudioContext + /// + public partial class BaseAudioContext : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ContextId + /// + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + set; + } + + /// + /// ContextType + /// + [JsonPropertyName("contextType")] + public CefSharp.DevTools.WebAudio.ContextType ContextType + { + get; + set; + } + + /// + /// ContextState + /// + [JsonPropertyName("contextState")] + public CefSharp.DevTools.WebAudio.ContextState ContextState + { + get; + set; + } + + /// + /// RealtimeData + /// + [JsonPropertyName("realtimeData")] + public CefSharp.DevTools.WebAudio.ContextRealtimeData RealtimeData + { + get; + set; + } + + /// + /// Platform-dependent callback buffer size. + /// + [JsonPropertyName("callbackBufferSize")] + public double CallbackBufferSize + { + get; + set; + } + + /// + /// Number of output channels supported by audio hardware in use. + /// + [JsonPropertyName("maxOutputChannelCount")] + public double MaxOutputChannelCount + { + get; + set; + } + + /// + /// Context sample rate. + /// + [JsonPropertyName("sampleRate")] + public double SampleRate + { + get; + set; + } + } + + /// + /// Protocol object for AudioListener + /// + public partial class AudioListener : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ListenerId + /// + [JsonPropertyName("listenerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ListenerId + { + get; + set; + } + + /// + /// ContextId + /// + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + set; + } + } + + /// + /// Protocol object for AudioNode + /// + public partial class AudioNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// NodeId + /// + [JsonPropertyName("nodeId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeId + { + get; + set; + } + + /// + /// ContextId + /// + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + set; + } + + /// + /// NodeType + /// + [JsonPropertyName("nodeType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeType + { + get; + set; + } + + /// + /// NumberOfInputs + /// + [JsonPropertyName("numberOfInputs")] + public double NumberOfInputs + { + get; + set; + } + + /// + /// NumberOfOutputs + /// + [JsonPropertyName("numberOfOutputs")] + public double NumberOfOutputs + { + get; + set; + } + + /// + /// ChannelCount + /// + [JsonPropertyName("channelCount")] + public double ChannelCount + { + get; + set; + } + + /// + /// ChannelCountMode + /// + [JsonPropertyName("channelCountMode")] + public CefSharp.DevTools.WebAudio.ChannelCountMode ChannelCountMode + { + get; + set; + } + + /// + /// ChannelInterpretation + /// + [JsonPropertyName("channelInterpretation")] + public CefSharp.DevTools.WebAudio.ChannelInterpretation ChannelInterpretation + { + get; + set; + } + } + + /// + /// Protocol object for AudioParam + /// + public partial class AudioParam : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ParamId + /// + [JsonPropertyName("paramId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ParamId + { + get; + set; + } + + /// + /// NodeId + /// + [JsonPropertyName("nodeId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeId + { + get; + set; + } + + /// + /// ContextId + /// + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + set; + } + + /// + /// ParamType + /// + [JsonPropertyName("paramType")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ParamType + { + get; + set; + } + + /// + /// Rate + /// + [JsonPropertyName("rate")] + public CefSharp.DevTools.WebAudio.AutomationRate Rate + { + get; + set; + } + + /// + /// DefaultValue + /// + [JsonPropertyName("defaultValue")] + public double DefaultValue + { + get; + set; + } + + /// + /// MinValue + /// + [JsonPropertyName("minValue")] + public double MinValue + { + get; + set; + } + + /// + /// MaxValue + /// + [JsonPropertyName("maxValue")] + public double MaxValue + { + get; + set; + } + } + + /// + /// Notifies that a new BaseAudioContext has been created. + /// + public class ContextCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Context + /// + [JsonInclude] + [JsonPropertyName("context")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.WebAudio.BaseAudioContext Context + { + get; + private set; + } + } + + /// + /// Notifies that an existing BaseAudioContext will be destroyed. + /// + public class ContextWillBeDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + private set; + } + } + + /// + /// Notifies that existing BaseAudioContext has changed some properties (id stays the same).. + /// + public class ContextChangedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Context + /// + [JsonInclude] + [JsonPropertyName("context")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.WebAudio.BaseAudioContext Context + { + get; + private set; + } + } + + /// + /// Notifies that the construction of an AudioListener has finished. + /// + public class AudioListenerCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Listener + /// + [JsonInclude] + [JsonPropertyName("listener")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.WebAudio.AudioListener Listener + { + get; + private set; + } + } + + /// + /// Notifies that a new AudioListener has been created. + /// + public class AudioListenerWillBeDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + private set; + } + + /// + /// ListenerId + /// + [JsonInclude] + [JsonPropertyName("listenerId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ListenerId + { + get; + private set; + } + } + + /// + /// Notifies that a new AudioNode has been created. + /// + public class AudioNodeCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Node + /// + [JsonInclude] + [JsonPropertyName("node")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.WebAudio.AudioNode Node + { + get; + private set; + } + } + + /// + /// Notifies that an existing AudioNode has been destroyed. + /// + public class AudioNodeWillBeDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + private set; + } + + /// + /// NodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeId + { + get; + private set; + } + } + + /// + /// Notifies that a new AudioParam has been created. + /// + public class AudioParamCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Param + /// + [JsonInclude] + [JsonPropertyName("param")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.WebAudio.AudioParam Param + { + get; + private set; + } + } + + /// + /// Notifies that an existing AudioParam has been destroyed. + /// + public class AudioParamWillBeDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + private set; + } + + /// + /// NodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string NodeId + { + get; + private set; + } + + /// + /// ParamId + /// + [JsonInclude] + [JsonPropertyName("paramId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ParamId + { + get; + private set; + } + } + + /// + /// Notifies that two AudioNodes are connected. + /// + public class NodesConnectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + private set; + } + + /// + /// SourceId + /// + [JsonInclude] + [JsonPropertyName("sourceId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SourceId + { + get; + private set; + } + + /// + /// DestinationId + /// + [JsonInclude] + [JsonPropertyName("destinationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DestinationId + { + get; + private set; + } + + /// + /// SourceOutputIndex + /// + [JsonInclude] + [JsonPropertyName("sourceOutputIndex")] + public double? SourceOutputIndex + { + get; + private set; + } + + /// + /// DestinationInputIndex + /// + [JsonInclude] + [JsonPropertyName("destinationInputIndex")] + public double? DestinationInputIndex + { + get; + private set; + } + } + + /// + /// Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected. + /// + public class NodesDisconnectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + private set; + } + + /// + /// SourceId + /// + [JsonInclude] + [JsonPropertyName("sourceId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SourceId + { + get; + private set; + } + + /// + /// DestinationId + /// + [JsonInclude] + [JsonPropertyName("destinationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DestinationId + { + get; + private set; + } + + /// + /// SourceOutputIndex + /// + [JsonInclude] + [JsonPropertyName("sourceOutputIndex")] + public double? SourceOutputIndex + { + get; + private set; + } + + /// + /// DestinationInputIndex + /// + [JsonInclude] + [JsonPropertyName("destinationInputIndex")] + public double? DestinationInputIndex + { + get; + private set; + } + } + + /// + /// Notifies that an AudioNode is connected to an AudioParam. + /// + public class NodeParamConnectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + private set; + } + + /// + /// SourceId + /// + [JsonInclude] + [JsonPropertyName("sourceId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SourceId + { + get; + private set; + } + + /// + /// DestinationId + /// + [JsonInclude] + [JsonPropertyName("destinationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DestinationId + { + get; + private set; + } + + /// + /// SourceOutputIndex + /// + [JsonInclude] + [JsonPropertyName("sourceOutputIndex")] + public double? SourceOutputIndex + { + get; + private set; + } + } + + /// + /// Notifies that an AudioNode is disconnected to an AudioParam. + /// + public class NodeParamDisconnectedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// ContextId + /// + [JsonInclude] + [JsonPropertyName("contextId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ContextId + { + get; + private set; + } + + /// + /// SourceId + /// + [JsonInclude] + [JsonPropertyName("sourceId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string SourceId + { + get; + private set; + } + + /// + /// DestinationId + /// + [JsonInclude] + [JsonPropertyName("destinationId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string DestinationId + { + get; + private set; + } + + /// + /// SourceOutputIndex + /// + [JsonInclude] + [JsonPropertyName("sourceOutputIndex")] + public double? SourceOutputIndex + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + /// + /// AuthenticatorProtocol + /// + public enum AuthenticatorProtocol + { + /// + /// u2f + /// + [JsonPropertyName("u2f")] + U2f, + /// + /// ctap2 + /// + [JsonPropertyName("ctap2")] + Ctap2 + } + + /// + /// Ctap2Version + /// + public enum Ctap2Version + { + /// + /// ctap2_0 + /// + [JsonPropertyName("ctap2_0")] + Ctap20, + /// + /// ctap2_1 + /// + [JsonPropertyName("ctap2_1")] + Ctap21 + } + + /// + /// AuthenticatorTransport + /// + public enum AuthenticatorTransport + { + /// + /// usb + /// + [JsonPropertyName("usb")] + Usb, + /// + /// nfc + /// + [JsonPropertyName("nfc")] + Nfc, + /// + /// ble + /// + [JsonPropertyName("ble")] + Ble, + /// + /// cable + /// + [JsonPropertyName("cable")] + Cable, + /// + /// internal + /// + [JsonPropertyName("internal")] + Internal + } + + /// + /// VirtualAuthenticatorOptions + /// + public partial class VirtualAuthenticatorOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Protocol + /// + [JsonPropertyName("protocol")] + public CefSharp.DevTools.WebAuthn.AuthenticatorProtocol Protocol + { + get; + set; + } + + /// + /// Defaults to ctap2_0. Ignored if |protocol| == u2f. + /// + [JsonPropertyName("ctap2Version")] + public CefSharp.DevTools.WebAuthn.Ctap2Version? Ctap2Version + { + get; + set; + } + + /// + /// Transport + /// + [JsonPropertyName("transport")] + public CefSharp.DevTools.WebAuthn.AuthenticatorTransport Transport + { + get; + set; + } + + /// + /// Defaults to false. + /// + [JsonPropertyName("hasResidentKey")] + public bool? HasResidentKey + { + get; + set; + } + + /// + /// Defaults to false. + /// + [JsonPropertyName("hasUserVerification")] + public bool? HasUserVerification + { + get; + set; + } + + /// + /// If set to true, the authenticator will support the largeBlob extension. + /// https://w3c.github.io/webauthn#largeBlob + /// Defaults to false. + /// + [JsonPropertyName("hasLargeBlob")] + public bool? HasLargeBlob + { + get; + set; + } + + /// + /// If set to true, the authenticator will support the credBlob extension. + /// https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension + /// Defaults to false. + /// + [JsonPropertyName("hasCredBlob")] + public bool? HasCredBlob + { + get; + set; + } + + /// + /// If set to true, the authenticator will support the minPinLength extension. + /// https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension + /// Defaults to false. + /// + [JsonPropertyName("hasMinPinLength")] + public bool? HasMinPinLength + { + get; + set; + } + + /// + /// If set to true, the authenticator will support the prf extension. + /// https://w3c.github.io/webauthn/#prf-extension + /// Defaults to false. + /// + [JsonPropertyName("hasPrf")] + public bool? HasPrf + { + get; + set; + } + + /// + /// If set to true, tests of user presence will succeed immediately. + /// Otherwise, they will not be resolved. Defaults to true. + /// + [JsonPropertyName("automaticPresenceSimulation")] + public bool? AutomaticPresenceSimulation + { + get; + set; + } + + /// + /// Sets whether User Verification succeeds or fails for an authenticator. + /// Defaults to false. + /// + [JsonPropertyName("isUserVerified")] + public bool? IsUserVerified + { + get; + set; + } + + /// + /// Credentials created by this authenticator will have the backup + /// eligibility (BE) flag set to this value. Defaults to false. + /// https://w3c.github.io/webauthn/#sctn-credential-backup + /// + [JsonPropertyName("defaultBackupEligibility")] + public bool? DefaultBackupEligibility + { + get; + set; + } + + /// + /// Credentials created by this authenticator will have the backup state + /// (BS) flag set to this value. Defaults to false. + /// https://w3c.github.io/webauthn/#sctn-credential-backup + /// + [JsonPropertyName("defaultBackupState")] + public bool? DefaultBackupState + { + get; + set; + } + } + + /// + /// Credential + /// + public partial class Credential : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// CredentialId + /// + [JsonPropertyName("credentialId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] CredentialId + { + get; + set; + } + + /// + /// IsResidentCredential + /// + [JsonPropertyName("isResidentCredential")] + public bool IsResidentCredential + { + get; + set; + } + + /// + /// Relying Party ID the credential is scoped to. Must be set when adding a + /// credential. + /// + [JsonPropertyName("rpId")] + public string RpId + { + get; + set; + } + + /// + /// The ECDSA P-256 private key in PKCS#8 format. + /// + [JsonPropertyName("privateKey")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] PrivateKey + { + get; + set; + } + + /// + /// An opaque byte sequence with a maximum size of 64 bytes mapping the + /// credential to a specific user. + /// + [JsonPropertyName("userHandle")] + public byte[] UserHandle + { + get; + set; + } + + /// + /// Signature counter. This is incremented by one for each successful + /// assertion. + /// See https://w3c.github.io/webauthn/#signature-counter + /// + [JsonPropertyName("signCount")] + public int SignCount + { + get; + set; + } + + /// + /// The large blob associated with the credential. + /// See https://w3c.github.io/webauthn/#sctn-large-blob-extension + /// + [JsonPropertyName("largeBlob")] + public byte[] LargeBlob + { + get; + set; + } + + /// + /// Assertions returned by this credential will have the backup eligibility + /// (BE) flag set to this value. Defaults to the authenticator's + /// defaultBackupEligibility value. + /// + [JsonPropertyName("backupEligibility")] + public bool? BackupEligibility + { + get; + set; + } + + /// + /// Assertions returned by this credential will have the backup state (BS) + /// flag set to this value. Defaults to the authenticator's + /// defaultBackupState value. + /// + [JsonPropertyName("backupState")] + public bool? BackupState + { + get; + set; + } + + /// + /// The credential's user.name property. Equivalent to empty if not set. + /// https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name + /// + [JsonPropertyName("userName")] + public string UserName + { + get; + set; + } + + /// + /// The credential's user.displayName property. Equivalent to empty if + /// not set. + /// https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname + /// + [JsonPropertyName("userDisplayName")] + public string UserDisplayName + { + get; + set; + } + } + + /// + /// Triggered when a credential is added to an authenticator. + /// + public class CredentialAddedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AuthenticatorId + /// + [JsonInclude] + [JsonPropertyName("authenticatorId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string AuthenticatorId + { + get; + private set; + } + + /// + /// Credential + /// + [JsonInclude] + [JsonPropertyName("credential")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.WebAuthn.Credential Credential + { + get; + private set; + } + } + + /// + /// Triggered when a credential is deleted, e.g. through + /// PublicKeyCredential.signalUnknownCredential(). + /// + public class CredentialDeletedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AuthenticatorId + /// + [JsonInclude] + [JsonPropertyName("authenticatorId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string AuthenticatorId + { + get; + private set; + } + + /// + /// CredentialId + /// + [JsonInclude] + [JsonPropertyName("credentialId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public byte[] CredentialId + { + get; + private set; + } + } + + /// + /// Triggered when a credential is updated, e.g. through + /// PublicKeyCredential.signalCurrentUserDetails(). + /// + public class CredentialUpdatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AuthenticatorId + /// + [JsonInclude] + [JsonPropertyName("authenticatorId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string AuthenticatorId + { + get; + private set; + } + + /// + /// Credential + /// + [JsonInclude] + [JsonPropertyName("credential")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.WebAuthn.Credential Credential + { + get; + private set; + } + } + + /// + /// Triggered when a credential is used in a webauthn assertion. + /// + public class CredentialAssertedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// AuthenticatorId + /// + [JsonInclude] + [JsonPropertyName("authenticatorId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string AuthenticatorId + { + get; + private set; + } + + /// + /// Credential + /// + [JsonInclude] + [JsonPropertyName("credential")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.WebAuthn.Credential Credential + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// Location in the source code. + /// + public partial class Location : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Script identifier as reported in the `Debugger.scriptParsed`. + /// + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + set; + } + + /// + /// Line number in the script (0-based). + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// Column number in the script (0-based). + /// + [JsonPropertyName("columnNumber")] + public int? ColumnNumber + { + get; + set; + } + } + + /// + /// Location in the source code. + /// + public partial class ScriptPosition : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// LineNumber + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// ColumnNumber + /// + [JsonPropertyName("columnNumber")] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// Location range within one script. + /// + public partial class LocationRange : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// ScriptId + /// + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + set; + } + + /// + /// Start + /// + [JsonPropertyName("start")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Debugger.ScriptPosition Start + { + get; + set; + } + + /// + /// End + /// + [JsonPropertyName("end")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Debugger.ScriptPosition End + { + get; + set; + } + } + + /// + /// JavaScript call frame. Array of call frames form the call stack. + /// + public partial class CallFrame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Call frame identifier. This identifier is only valid while the virtual machine is paused. + /// + [JsonPropertyName("callFrameId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string CallFrameId + { + get; + set; + } + + /// + /// Name of the JavaScript function called on this call frame. + /// + [JsonPropertyName("functionName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FunctionName + { + get; + set; + } + + /// + /// Location in the source code. + /// + [JsonPropertyName("functionLocation")] + public CefSharp.DevTools.Debugger.Location FunctionLocation + { + get; + set; + } + + /// + /// Location in the source code. + /// + [JsonPropertyName("location")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Debugger.Location Location + { + get; + set; + } + + /// + /// JavaScript script name or url. + /// Deprecated in favor of using the `location.scriptId` to resolve the URL via a previously + /// sent `Debugger.scriptParsed` event. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Scope chain for this call frame. + /// + [JsonPropertyName("scopeChain")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList ScopeChain + { + get; + set; + } + + /// + /// `this` object for this call frame. + /// + [JsonPropertyName("this")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.RemoteObject This + { + get; + set; + } + + /// + /// The value being returned, if the function is at return point. + /// + [JsonPropertyName("returnValue")] + public CefSharp.DevTools.Runtime.RemoteObject ReturnValue + { + get; + set; + } + + /// + /// Valid only while the VM is paused and indicates whether this frame + /// can be restarted or not. Note that a `true` value here does not + /// guarantee that Debugger#restartFrame with this CallFrameId will be + /// successful, but it is very likely. + /// + [JsonPropertyName("canBeRestarted")] + public bool? CanBeRestarted + { + get; + set; + } + } + + /// + /// Scope type. + /// + public enum ScopeType + { + /// + /// global + /// + [JsonPropertyName("global")] + Global, + /// + /// local + /// + [JsonPropertyName("local")] + Local, + /// + /// with + /// + [JsonPropertyName("with")] + With, + /// + /// closure + /// + [JsonPropertyName("closure")] + Closure, + /// + /// catch + /// + [JsonPropertyName("catch")] + Catch, + /// + /// block + /// + [JsonPropertyName("block")] + Block, + /// + /// script + /// + [JsonPropertyName("script")] + Script, + /// + /// eval + /// + [JsonPropertyName("eval")] + Eval, + /// + /// module + /// + [JsonPropertyName("module")] + Module, + /// + /// wasm-expression-stack + /// + [JsonPropertyName("wasm-expression-stack")] + WasmExpressionStack + } + + /// + /// Scope description. + /// + public partial class Scope : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Scope type. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Debugger.ScopeType Type + { + get; + set; + } + + /// + /// Object representing the scope. For `global` and `with` scopes it represents the actual + /// object; for the rest of the scopes, it is artificial transient object enumerating scope + /// variables as its properties. + /// + [JsonPropertyName("object")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.RemoteObject Object + { + get; + set; + } + + /// + /// Name + /// + [JsonPropertyName("name")] + public string Name + { + get; + set; + } + + /// + /// Location in the source code where scope starts + /// + [JsonPropertyName("startLocation")] + public CefSharp.DevTools.Debugger.Location StartLocation + { + get; + set; + } + + /// + /// Location in the source code where scope ends + /// + [JsonPropertyName("endLocation")] + public CefSharp.DevTools.Debugger.Location EndLocation + { + get; + set; + } + } + + /// + /// Search match for resource. + /// + public partial class SearchMatch : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Line number in resource content. + /// + [JsonPropertyName("lineNumber")] + public double LineNumber + { + get; + set; + } + + /// + /// Line with match content. + /// + [JsonPropertyName("lineContent")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string LineContent + { + get; + set; + } + } + + /// + /// BreakLocationType + /// + public enum BreakLocationType + { + /// + /// debuggerStatement + /// + [JsonPropertyName("debuggerStatement")] + DebuggerStatement, + /// + /// call + /// + [JsonPropertyName("call")] + Call, + /// + /// return + /// + [JsonPropertyName("return")] + Return + } + + /// + /// BreakLocation + /// + public partial class BreakLocation : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Script identifier as reported in the `Debugger.scriptParsed`. + /// + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + set; + } + + /// + /// Line number in the script (0-based). + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// Column number in the script (0-based). + /// + [JsonPropertyName("columnNumber")] + public int? ColumnNumber + { + get; + set; + } + + /// + /// Type + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Debugger.BreakLocationType? Type + { + get; + set; + } + } + + /// + /// WasmDisassemblyChunk + /// + public partial class WasmDisassemblyChunk : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The next chunk of disassembled lines. + /// + [JsonPropertyName("lines")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string[] Lines + { + get; + set; + } + + /// + /// The bytecode offsets describing the start of each line. + /// + [JsonPropertyName("bytecodeOffsets")] + public int[] BytecodeOffsets + { + get; + set; + } + } + + /// + /// Enum of possible script languages. + /// + public enum ScriptLanguage + { + /// + /// JavaScript + /// + [JsonPropertyName("JavaScript")] + JavaScript, + /// + /// WebAssembly + /// + [JsonPropertyName("WebAssembly")] + WebAssembly + } + + /// + /// Type of the debug symbols. + /// + public enum DebugSymbolsType + { + /// + /// SourceMap + /// + [JsonPropertyName("SourceMap")] + SourceMap, + /// + /// EmbeddedDWARF + /// + [JsonPropertyName("EmbeddedDWARF")] + EmbeddedDWARF, + /// + /// ExternalDWARF + /// + [JsonPropertyName("ExternalDWARF")] + ExternalDWARF + } + + /// + /// Debug symbols available for a wasm script. + /// + public partial class DebugSymbols : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type of the debug symbols. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Debugger.DebugSymbolsType Type + { + get; + set; + } + + /// + /// URL of the external symbol source. + /// + [JsonPropertyName("externalURL")] + public string ExternalURL + { + get; + set; + } + } + + /// + /// ResolvedBreakpoint + /// + public partial class ResolvedBreakpoint : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Breakpoint unique identifier. + /// + [JsonPropertyName("breakpointId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BreakpointId + { + get; + set; + } + + /// + /// Actual breakpoint location. + /// + [JsonPropertyName("location")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Debugger.Location Location + { + get; + set; + } + } + + /// + /// Fired when breakpoint is resolved to an actual script and location. + /// Deprecated in favor of `resolvedBreakpoints` in the `scriptParsed` event. + /// + public class BreakpointResolvedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Breakpoint unique identifier. + /// + [JsonInclude] + [JsonPropertyName("breakpointId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BreakpointId + { + get; + private set; + } + + /// + /// Actual breakpoint location. + /// + [JsonInclude] + [JsonPropertyName("location")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Debugger.Location Location + { + get; + private set; + } + } + + /// + /// Pause reason. + /// + public enum PausedReason + { + /// + /// ambiguous + /// + [JsonPropertyName("ambiguous")] + Ambiguous, + /// + /// assert + /// + [JsonPropertyName("assert")] + Assert, + /// + /// CSPViolation + /// + [JsonPropertyName("CSPViolation")] + CSPViolation, + /// + /// debugCommand + /// + [JsonPropertyName("debugCommand")] + DebugCommand, + /// + /// DOM + /// + [JsonPropertyName("DOM")] + DOM, + /// + /// EventListener + /// + [JsonPropertyName("EventListener")] + EventListener, + /// + /// exception + /// + [JsonPropertyName("exception")] + Exception, + /// + /// instrumentation + /// + [JsonPropertyName("instrumentation")] + Instrumentation, + /// + /// OOM + /// + [JsonPropertyName("OOM")] + OOM, + /// + /// other + /// + [JsonPropertyName("other")] + Other, + /// + /// promiseRejection + /// + [JsonPropertyName("promiseRejection")] + PromiseRejection, + /// + /// XHR + /// + [JsonPropertyName("XHR")] + XHR, + /// + /// step + /// + [JsonPropertyName("step")] + Step + } + + /// + /// Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + /// + public class PausedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Call stack the virtual machine stopped on. + /// + [JsonInclude] + [JsonPropertyName("callFrames")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList CallFrames + { + get; + private set; + } + + /// + /// Pause reason. + /// + [JsonInclude] + [JsonPropertyName("reason")] + public CefSharp.DevTools.Debugger.PausedReason Reason + { + get; + private set; + } + + /// + /// Object containing break-specific auxiliary properties. + /// + [JsonInclude] + [JsonPropertyName("data")] + public object Data + { + get; + private set; + } + + /// + /// Hit breakpoints IDs + /// + [JsonInclude] + [JsonPropertyName("hitBreakpoints")] + public string[] HitBreakpoints + { + get; + private set; + } + + /// + /// Async stack trace, if any. + /// + [JsonInclude] + [JsonPropertyName("asyncStackTrace")] + public CefSharp.DevTools.Runtime.StackTrace AsyncStackTrace + { + get; + private set; + } + + /// + /// Async stack trace, if any. + /// + [JsonInclude] + [JsonPropertyName("asyncStackTraceId")] + public CefSharp.DevTools.Runtime.StackTraceId AsyncStackTraceId + { + get; + private set; + } + + /// + /// Never present, will be removed. + /// + [JsonInclude] + [JsonPropertyName("asyncCallStackTraceId")] + public CefSharp.DevTools.Runtime.StackTraceId AsyncCallStackTraceId + { + get; + private set; + } + } + + /// + /// Fired when virtual machine fails to parse the script. + /// + public class ScriptFailedToParseEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier of the script parsed. + /// + [JsonInclude] + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + private set; + } + + /// + /// URL or name of the script parsed (if any). + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Line offset of the script within the resource with given URL (for script tags). + /// + [JsonInclude] + [JsonPropertyName("startLine")] + public int StartLine + { + get; + private set; + } + + /// + /// Column offset of the script within the resource with given URL. + /// + [JsonInclude] + [JsonPropertyName("startColumn")] + public int StartColumn + { + get; + private set; + } + + /// + /// Last line of the script. + /// + [JsonInclude] + [JsonPropertyName("endLine")] + public int EndLine + { + get; + private set; + } + + /// + /// Length of the last line of the script. + /// + [JsonInclude] + [JsonPropertyName("endColumn")] + public int EndColumn + { + get; + private set; + } + + /// + /// Specifies script creation context. + /// + [JsonInclude] + [JsonPropertyName("executionContextId")] + public int ExecutionContextId + { + get; + private set; + } + + /// + /// Content hash of the script, SHA-256. + /// + [JsonInclude] + [JsonPropertyName("hash")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Hash + { + get; + private set; + } + + /// + /// For Wasm modules, the content of the `build_id` custom section. For JavaScript the `debugId` magic comment. + /// + [JsonInclude] + [JsonPropertyName("buildId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BuildId + { + get; + private set; + } + + /// + /// Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string} + /// + [JsonInclude] + [JsonPropertyName("executionContextAuxData")] + public object ExecutionContextAuxData + { + get; + private set; + } + + /// + /// URL of source map associated with script (if any). + /// + [JsonInclude] + [JsonPropertyName("sourceMapURL")] + public string SourceMapURL + { + get; + private set; + } + + /// + /// True, if this script has sourceURL. + /// + [JsonInclude] + [JsonPropertyName("hasSourceURL")] + public bool? HasSourceURL + { + get; + private set; + } + + /// + /// True, if this script is ES6 module. + /// + [JsonInclude] + [JsonPropertyName("isModule")] + public bool? IsModule + { + get; + private set; + } + + /// + /// This script length. + /// + [JsonInclude] + [JsonPropertyName("length")] + public int? Length + { + get; + private set; + } + + /// + /// JavaScript top stack frame of where the script parsed event was triggered if available. + /// + [JsonInclude] + [JsonPropertyName("stackTrace")] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + private set; + } + + /// + /// If the scriptLanguage is WebAssembly, the code section offset in the module. + /// + [JsonInclude] + [JsonPropertyName("codeOffset")] + public int? CodeOffset + { + get; + private set; + } + + /// + /// The language of the script. + /// + [JsonInclude] + [JsonPropertyName("scriptLanguage")] + public CefSharp.DevTools.Debugger.ScriptLanguage? ScriptLanguage + { + get; + private set; + } + + /// + /// The name the embedder supplied for this script. + /// + [JsonInclude] + [JsonPropertyName("embedderName")] + public string EmbedderName + { + get; + private set; + } + } + + /// + /// Fired when virtual machine parses script. This event is also fired for all known and uncollected + /// scripts upon enabling debugger. + /// + public class ScriptParsedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Identifier of the script parsed. + /// + [JsonInclude] + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + private set; + } + + /// + /// URL or name of the script parsed (if any). + /// + [JsonInclude] + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + private set; + } + + /// + /// Line offset of the script within the resource with given URL (for script tags). + /// + [JsonInclude] + [JsonPropertyName("startLine")] + public int StartLine + { + get; + private set; + } + + /// + /// Column offset of the script within the resource with given URL. + /// + [JsonInclude] + [JsonPropertyName("startColumn")] + public int StartColumn + { + get; + private set; + } + + /// + /// Last line of the script. + /// + [JsonInclude] + [JsonPropertyName("endLine")] + public int EndLine + { + get; + private set; + } + + /// + /// Length of the last line of the script. + /// + [JsonInclude] + [JsonPropertyName("endColumn")] + public int EndColumn + { + get; + private set; + } + + /// + /// Specifies script creation context. + /// + [JsonInclude] + [JsonPropertyName("executionContextId")] + public int ExecutionContextId + { + get; + private set; + } + + /// + /// Content hash of the script, SHA-256. + /// + [JsonInclude] + [JsonPropertyName("hash")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Hash + { + get; + private set; + } + + /// + /// For Wasm modules, the content of the `build_id` custom section. For JavaScript the `debugId` magic comment. + /// + [JsonInclude] + [JsonPropertyName("buildId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string BuildId + { + get; + private set; + } + + /// + /// Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string} + /// + [JsonInclude] + [JsonPropertyName("executionContextAuxData")] + public object ExecutionContextAuxData + { + get; + private set; + } + + /// + /// True, if this script is generated as a result of the live edit operation. + /// + [JsonInclude] + [JsonPropertyName("isLiveEdit")] + public bool? IsLiveEdit + { + get; + private set; + } + + /// + /// URL of source map associated with script (if any). + /// + [JsonInclude] + [JsonPropertyName("sourceMapURL")] + public string SourceMapURL + { + get; + private set; + } + + /// + /// True, if this script has sourceURL. + /// + [JsonInclude] + [JsonPropertyName("hasSourceURL")] + public bool? HasSourceURL + { + get; + private set; + } + + /// + /// True, if this script is ES6 module. + /// + [JsonInclude] + [JsonPropertyName("isModule")] + public bool? IsModule + { + get; + private set; + } + + /// + /// This script length. + /// + [JsonInclude] + [JsonPropertyName("length")] + public int? Length + { + get; + private set; + } + + /// + /// JavaScript top stack frame of where the script parsed event was triggered if available. + /// + [JsonInclude] + [JsonPropertyName("stackTrace")] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + private set; + } + + /// + /// If the scriptLanguage is WebAssembly, the code section offset in the module. + /// + [JsonInclude] + [JsonPropertyName("codeOffset")] + public int? CodeOffset + { + get; + private set; + } + + /// + /// The language of the script. + /// + [JsonInclude] + [JsonPropertyName("scriptLanguage")] + public CefSharp.DevTools.Debugger.ScriptLanguage? ScriptLanguage + { + get; + private set; + } + + /// + /// If the scriptLanguage is WebAssembly, the source of debug symbols for the module. + /// + [JsonInclude] + [JsonPropertyName("debugSymbols")] + public System.Collections.Generic.IList DebugSymbols + { + get; + private set; + } + + /// + /// The name the embedder supplied for this script. + /// + [JsonInclude] + [JsonPropertyName("embedderName")] + public string EmbedderName + { + get; + private set; + } + + /// + /// The list of set breakpoints in this script if calls to `setBreakpointByUrl` + /// matches this script's URL or hash. Clients that use this list can ignore the + /// `breakpointResolved` event. They are equivalent. + /// + [JsonInclude] + [JsonPropertyName("resolvedBreakpoints")] + public System.Collections.Generic.IList ResolvedBreakpoints + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + /// + public partial class SamplingHeapProfileNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Function location. + /// + [JsonPropertyName("callFrame")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.CallFrame CallFrame + { + get; + set; + } + + /// + /// Allocations size in bytes for the node excluding children. + /// + [JsonPropertyName("selfSize")] + public double SelfSize + { + get; + set; + } + + /// + /// Node id. Ids are unique across all profiles collected between startSampling and stopSampling. + /// + [JsonPropertyName("id")] + public int Id + { + get; + set; + } + + /// + /// Child nodes. + /// + [JsonPropertyName("children")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Children + { + get; + set; + } + } + + /// + /// A single sample from a sampling profile. + /// + public partial class SamplingHeapProfileSample : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Allocation size in bytes attributed to the sample. + /// + [JsonPropertyName("size")] + public double Size + { + get; + set; + } + + /// + /// Id of the corresponding profile tree node. + /// + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + set; + } + + /// + /// Time-ordered sample ordinal number. It is unique across all profiles retrieved + /// between startSampling and stopSampling. + /// + [JsonPropertyName("ordinal")] + public double Ordinal + { + get; + set; + } + } + + /// + /// Sampling profile. + /// + public partial class SamplingHeapProfile : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Head + /// + [JsonPropertyName("head")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.HeapProfiler.SamplingHeapProfileNode Head + { + get; + set; + } + + /// + /// Samples + /// + [JsonPropertyName("samples")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Samples + { + get; + set; + } + } + + /// + /// addHeapSnapshotChunk + /// + public class AddHeapSnapshotChunkEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Chunk + /// + [JsonInclude] + [JsonPropertyName("chunk")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Chunk + { + get; + private set; + } + } + + /// + /// If heap objects tracking has been started then backend may send update for one or more fragments + /// + public class HeapStatsUpdateEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// An array of triplets. Each triplet describes a fragment. The first integer is the fragment + /// index, the second integer is a total count of objects for the fragment, the third integer is + /// a total size of the objects for the fragment. + /// + [JsonInclude] + [JsonPropertyName("statsUpdate")] + public int[] StatsUpdate + { + get; + private set; + } + } + + /// + /// If heap objects tracking has been started then backend regularly sends a current value for last + /// seen object id and corresponding timestamp. If the were changes in the heap since last event + /// then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + /// + public class LastSeenObjectIdEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// LastSeenObjectId + /// + [JsonInclude] + [JsonPropertyName("lastSeenObjectId")] + public int LastSeenObjectId + { + get; + private set; + } + + /// + /// Timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } + + /// + /// reportHeapSnapshotProgress + /// + public class ReportHeapSnapshotProgressEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Done + /// + [JsonInclude] + [JsonPropertyName("done")] + public int Done + { + get; + private set; + } + + /// + /// Total + /// + [JsonInclude] + [JsonPropertyName("total")] + public int Total + { + get; + private set; + } + + /// + /// Finished + /// + [JsonInclude] + [JsonPropertyName("finished")] + public bool? Finished + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// Profile node. Holds callsite information, execution statistics and child nodes. + /// + public partial class ProfileNode : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unique id of the node. + /// + [JsonPropertyName("id")] + public int Id + { + get; + set; + } + + /// + /// Function location. + /// + [JsonPropertyName("callFrame")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.CallFrame CallFrame + { + get; + set; + } + + /// + /// Number of samples where this node was on top of the call stack. + /// + [JsonPropertyName("hitCount")] + public int? HitCount + { + get; + set; + } + + /// + /// Child node ids. + /// + [JsonPropertyName("children")] + public int[] Children + { + get; + set; + } + + /// + /// The reason of being not optimized. The function may be deoptimized or marked as don't + /// optimize. + /// + [JsonPropertyName("deoptReason")] + public string DeoptReason + { + get; + set; + } + + /// + /// An array of source position ticks. + /// + [JsonPropertyName("positionTicks")] + public System.Collections.Generic.IList PositionTicks + { + get; + set; + } + } + + /// + /// Profile. + /// + public partial class Profile : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The list of profile nodes. First item is the root node. + /// + [JsonPropertyName("nodes")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Nodes + { + get; + set; + } + + /// + /// Profiling start timestamp in microseconds. + /// + [JsonPropertyName("startTime")] + public double StartTime + { + get; + set; + } + + /// + /// Profiling end timestamp in microseconds. + /// + [JsonPropertyName("endTime")] + public double EndTime + { + get; + set; + } + + /// + /// Ids of samples top nodes. + /// + [JsonPropertyName("samples")] + public int[] Samples + { + get; + set; + } + + /// + /// Time intervals between adjacent samples in microseconds. The first delta is relative to the + /// profile startTime. + /// + [JsonPropertyName("timeDeltas")] + public int[] TimeDeltas + { + get; + set; + } + } + + /// + /// Specifies a number of samples attributed to a certain source position. + /// + public partial class PositionTickInfo : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Source line number (1-based). + /// + [JsonPropertyName("line")] + public int Line + { + get; + set; + } + + /// + /// Number of samples attributed to the source line. + /// + [JsonPropertyName("ticks")] + public int Ticks + { + get; + set; + } + } + + /// + /// Coverage data for a source range. + /// + public partial class CoverageRange : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// JavaScript script source offset for the range start. + /// + [JsonPropertyName("startOffset")] + public int StartOffset + { + get; + set; + } + + /// + /// JavaScript script source offset for the range end. + /// + [JsonPropertyName("endOffset")] + public int EndOffset + { + get; + set; + } + + /// + /// Collected execution count of the source range. + /// + [JsonPropertyName("count")] + public int Count + { + get; + set; + } + } + + /// + /// Coverage data for a JavaScript function. + /// + public partial class FunctionCoverage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// JavaScript function name. + /// + [JsonPropertyName("functionName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FunctionName + { + get; + set; + } + + /// + /// Source ranges inside the function with coverage data. + /// + [JsonPropertyName("ranges")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Ranges + { + get; + set; + } + + /// + /// Whether coverage data for this function has block granularity. + /// + [JsonPropertyName("isBlockCoverage")] + public bool IsBlockCoverage + { + get; + set; + } + } + + /// + /// Coverage data for a JavaScript script. + /// + public partial class ScriptCoverage : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// JavaScript script id. + /// + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + set; + } + + /// + /// JavaScript script name or url. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// Functions contained in the script that has coverage data. + /// + [JsonPropertyName("functions")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Functions + { + get; + set; + } + } + + /// + /// consoleProfileFinished + /// + public class ConsoleProfileFinishedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id + /// + [JsonInclude] + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + private set; + } + + /// + /// Location of console.profileEnd(). + /// + [JsonInclude] + [JsonPropertyName("location")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Debugger.Location Location + { + get; + private set; + } + + /// + /// Profile + /// + [JsonInclude] + [JsonPropertyName("profile")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Profiler.Profile Profile + { + get; + private set; + } + + /// + /// Profile title passed as an argument to console.profile(). + /// + [JsonInclude] + [JsonPropertyName("title")] + public string Title + { + get; + private set; + } + } + + /// + /// Sent when new profile recording is started using console.profile() call. + /// + public class ConsoleProfileStartedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id + /// + [JsonInclude] + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + private set; + } + + /// + /// Location of console.profile(). + /// + [JsonInclude] + [JsonPropertyName("location")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Debugger.Location Location + { + get; + private set; + } + + /// + /// Profile title passed as an argument to console.profile(). + /// + [JsonInclude] + [JsonPropertyName("title")] + public string Title + { + get; + private set; + } + } + + /// + /// Reports coverage delta since the last poll (either from an event like this, or from + /// `takePreciseCoverage` for the current isolate. May only be sent if precise code + /// coverage has been started. This event can be trigged by the embedder to, for example, + /// trigger collection of coverage data immediately at a certain point in time. + /// + public class PreciseCoverageDeltaUpdateEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Identifier for distinguishing coverage events. + /// + [JsonInclude] + [JsonPropertyName("occasion")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Occasion + { + get; + private set; + } + + /// + /// Coverage data for the current isolate. + /// + [JsonInclude] + [JsonPropertyName("result")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Result + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// SerializationOptionsSerialization + /// + public enum SerializationOptionsSerialization + { + /// + /// deep + /// + [JsonPropertyName("deep")] + Deep, + /// + /// json + /// + [JsonPropertyName("json")] + Json, + /// + /// idOnly + /// + [JsonPropertyName("idOnly")] + IdOnly + } + + /// + /// Represents options for serialization. Overrides `generatePreview` and `returnByValue`. + /// + public partial class SerializationOptions : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Serialization + /// + [JsonPropertyName("serialization")] + public CefSharp.DevTools.Runtime.SerializationOptionsSerialization Serialization + { + get; + set; + } + + /// + /// Deep serialization depth. Default is full depth. Respected only in `deep` serialization mode. + /// + [JsonPropertyName("maxDepth")] + public int? MaxDepth + { + get; + set; + } + + /// + /// Embedder-specific parameters. For example if connected to V8 in Chrome these control DOM + /// serialization via `maxNodeDepth: integer` and `includeShadowTree: "none" | "open" | "all"`. + /// Values can be only of type string or integer. + /// + [JsonPropertyName("additionalParameters")] + public object AdditionalParameters + { + get; + set; + } + } + + /// + /// DeepSerializedValueType + /// + public enum DeepSerializedValueType + { + /// + /// undefined + /// + [JsonPropertyName("undefined")] + Undefined, + /// + /// null + /// + [JsonPropertyName("null")] + Null, + /// + /// string + /// + [JsonPropertyName("string")] + String, + /// + /// number + /// + [JsonPropertyName("number")] + Number, + /// + /// boolean + /// + [JsonPropertyName("boolean")] + Boolean, + /// + /// bigint + /// + [JsonPropertyName("bigint")] + Bigint, + /// + /// regexp + /// + [JsonPropertyName("regexp")] + Regexp, + /// + /// date + /// + [JsonPropertyName("date")] + Date, + /// + /// symbol + /// + [JsonPropertyName("symbol")] + Symbol, + /// + /// array + /// + [JsonPropertyName("array")] + Array, + /// + /// object + /// + [JsonPropertyName("object")] + Object, + /// + /// function + /// + [JsonPropertyName("function")] + Function, + /// + /// map + /// + [JsonPropertyName("map")] + Map, + /// + /// set + /// + [JsonPropertyName("set")] + Set, + /// + /// weakmap + /// + [JsonPropertyName("weakmap")] + Weakmap, + /// + /// weakset + /// + [JsonPropertyName("weakset")] + Weakset, + /// + /// error + /// + [JsonPropertyName("error")] + Error, + /// + /// proxy + /// + [JsonPropertyName("proxy")] + Proxy, + /// + /// promise + /// + [JsonPropertyName("promise")] + Promise, + /// + /// typedarray + /// + [JsonPropertyName("typedarray")] + Typedarray, + /// + /// arraybuffer + /// + [JsonPropertyName("arraybuffer")] + Arraybuffer, + /// + /// node + /// + [JsonPropertyName("node")] + Node, + /// + /// window + /// + [JsonPropertyName("window")] + Window, + /// + /// generator + /// + [JsonPropertyName("generator")] + Generator + } + + /// + /// Represents deep serialized value. + /// + public partial class DeepSerializedValue : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Type + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Runtime.DeepSerializedValueType Type + { + get; + set; + } + + /// + /// Value + /// + [JsonPropertyName("value")] + public object Value + { + get; + set; + } + + /// + /// ObjectId + /// + [JsonPropertyName("objectId")] + public string ObjectId + { + get; + set; + } + + /// + /// Set if value reference met more then once during serialization. In such + /// case, value is provided only to one of the serialized values. Unique + /// per value in the scope of one CDP call. + /// + [JsonPropertyName("weakLocalObjectReference")] + public int? WeakLocalObjectReference + { + get; + set; + } + } + + /// + /// Object type. + /// + public enum RemoteObjectType + { + /// + /// object + /// + [JsonPropertyName("object")] + Object, + /// + /// function + /// + [JsonPropertyName("function")] + Function, + /// + /// undefined + /// + [JsonPropertyName("undefined")] + Undefined, + /// + /// string + /// + [JsonPropertyName("string")] + String, + /// + /// number + /// + [JsonPropertyName("number")] + Number, + /// + /// boolean + /// + [JsonPropertyName("boolean")] + Boolean, + /// + /// symbol + /// + [JsonPropertyName("symbol")] + Symbol, + /// + /// bigint + /// + [JsonPropertyName("bigint")] + Bigint + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// NOTE: If you change anything here, make sure to also update + /// `subtype` in `ObjectPreview` and `PropertyPreview` below. + /// + public enum RemoteObjectSubtype + { + /// + /// array + /// + [JsonPropertyName("array")] + Array, + /// + /// null + /// + [JsonPropertyName("null")] + Null, + /// + /// node + /// + [JsonPropertyName("node")] + Node, + /// + /// regexp + /// + [JsonPropertyName("regexp")] + Regexp, + /// + /// date + /// + [JsonPropertyName("date")] + Date, + /// + /// map + /// + [JsonPropertyName("map")] + Map, + /// + /// set + /// + [JsonPropertyName("set")] + Set, + /// + /// weakmap + /// + [JsonPropertyName("weakmap")] + Weakmap, + /// + /// weakset + /// + [JsonPropertyName("weakset")] + Weakset, + /// + /// iterator + /// + [JsonPropertyName("iterator")] + Iterator, + /// + /// generator + /// + [JsonPropertyName("generator")] + Generator, + /// + /// error + /// + [JsonPropertyName("error")] + Error, + /// + /// proxy + /// + [JsonPropertyName("proxy")] + Proxy, + /// + /// promise + /// + [JsonPropertyName("promise")] + Promise, + /// + /// typedarray + /// + [JsonPropertyName("typedarray")] + Typedarray, + /// + /// arraybuffer + /// + [JsonPropertyName("arraybuffer")] + Arraybuffer, + /// + /// dataview + /// + [JsonPropertyName("dataview")] + Dataview, + /// + /// webassemblymemory + /// + [JsonPropertyName("webassemblymemory")] + Webassemblymemory, + /// + /// wasmvalue + /// + [JsonPropertyName("wasmvalue")] + Wasmvalue, + /// + /// trustedtype + /// + [JsonPropertyName("trustedtype")] + Trustedtype + } + + /// + /// Mirror object referencing original JavaScript object. + /// + public partial class RemoteObject : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Object type. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Runtime.RemoteObjectType Type + { + get; + set; + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// NOTE: If you change anything here, make sure to also update + /// `subtype` in `ObjectPreview` and `PropertyPreview` below. + /// + [JsonPropertyName("subtype")] + public CefSharp.DevTools.Runtime.RemoteObjectSubtype? Subtype + { + get; + set; + } + + /// + /// Object class (constructor) name. Specified for `object` type values only. + /// + [JsonPropertyName("className")] + public string ClassName + { + get; + set; + } + + /// + /// Remote object value in case of primitive values or JSON values (if it was requested). + /// + [JsonPropertyName("value")] + public object Value + { + get; + set; + } + + /// + /// Primitive value which can not be JSON-stringified does not have `value`, but gets this + /// property. + /// + [JsonPropertyName("unserializableValue")] + public string UnserializableValue + { + get; + set; + } + + /// + /// String representation of the object. + /// + [JsonPropertyName("description")] + public string Description + { + get; + set; + } + + /// + /// Deep serialized value. + /// + [JsonPropertyName("deepSerializedValue")] + public CefSharp.DevTools.Runtime.DeepSerializedValue DeepSerializedValue + { + get; + set; + } + + /// + /// Unique object identifier (for non-primitive values). + /// + [JsonPropertyName("objectId")] + public string ObjectId + { + get; + set; + } + + /// + /// Preview containing abbreviated property values. Specified for `object` type values only. + /// + [JsonPropertyName("preview")] + public CefSharp.DevTools.Runtime.ObjectPreview Preview + { + get; + set; + } + + /// + /// CustomPreview + /// + [JsonPropertyName("customPreview")] + public CefSharp.DevTools.Runtime.CustomPreview CustomPreview + { + get; + set; + } + } + + /// + /// CustomPreview + /// + public partial class CustomPreview : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// The JSON-stringified result of formatter.header(object, config) call. + /// It contains json ML array that represents RemoteObject. + /// + [JsonPropertyName("header")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Header + { + get; + set; + } + + /// + /// If formatter returns true as a result of formatter.hasBody call then bodyGetterId will + /// contain RemoteObjectId for the function that returns result of formatter.body(object, config) call. + /// The result value is json ML array. + /// + [JsonPropertyName("bodyGetterId")] + public string BodyGetterId + { + get; + set; + } + } + + /// + /// Object type. + /// + public enum ObjectPreviewType + { + /// + /// object + /// + [JsonPropertyName("object")] + Object, + /// + /// function + /// + [JsonPropertyName("function")] + Function, + /// + /// undefined + /// + [JsonPropertyName("undefined")] + Undefined, + /// + /// string + /// + [JsonPropertyName("string")] + String, + /// + /// number + /// + [JsonPropertyName("number")] + Number, + /// + /// boolean + /// + [JsonPropertyName("boolean")] + Boolean, + /// + /// symbol + /// + [JsonPropertyName("symbol")] + Symbol, + /// + /// bigint + /// + [JsonPropertyName("bigint")] + Bigint + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + public enum ObjectPreviewSubtype + { + /// + /// array + /// + [JsonPropertyName("array")] + Array, + /// + /// null + /// + [JsonPropertyName("null")] + Null, + /// + /// node + /// + [JsonPropertyName("node")] + Node, + /// + /// regexp + /// + [JsonPropertyName("regexp")] + Regexp, + /// + /// date + /// + [JsonPropertyName("date")] + Date, + /// + /// map + /// + [JsonPropertyName("map")] + Map, + /// + /// set + /// + [JsonPropertyName("set")] + Set, + /// + /// weakmap + /// + [JsonPropertyName("weakmap")] + Weakmap, + /// + /// weakset + /// + [JsonPropertyName("weakset")] + Weakset, + /// + /// iterator + /// + [JsonPropertyName("iterator")] + Iterator, + /// + /// generator + /// + [JsonPropertyName("generator")] + Generator, + /// + /// error + /// + [JsonPropertyName("error")] + Error, + /// + /// proxy + /// + [JsonPropertyName("proxy")] + Proxy, + /// + /// promise + /// + [JsonPropertyName("promise")] + Promise, + /// + /// typedarray + /// + [JsonPropertyName("typedarray")] + Typedarray, + /// + /// arraybuffer + /// + [JsonPropertyName("arraybuffer")] + Arraybuffer, + /// + /// dataview + /// + [JsonPropertyName("dataview")] + Dataview, + /// + /// webassemblymemory + /// + [JsonPropertyName("webassemblymemory")] + Webassemblymemory, + /// + /// wasmvalue + /// + [JsonPropertyName("wasmvalue")] + Wasmvalue, + /// + /// trustedtype + /// + [JsonPropertyName("trustedtype")] + Trustedtype + } + + /// + /// Object containing abbreviated remote object value. + /// + public partial class ObjectPreview : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Object type. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Runtime.ObjectPreviewType Type + { + get; + set; + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + [JsonPropertyName("subtype")] + public CefSharp.DevTools.Runtime.ObjectPreviewSubtype? Subtype + { + get; + set; + } + + /// + /// String representation of the object. + /// + [JsonPropertyName("description")] + public string Description + { + get; + set; + } + + /// + /// True iff some of the properties or entries of the original object did not fit. + /// + [JsonPropertyName("overflow")] + public bool Overflow + { + get; + set; + } + + /// + /// List of the properties. + /// + [JsonPropertyName("properties")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Properties + { + get; + set; + } + + /// + /// List of the entries. Specified for `map` and `set` subtype values only. + /// + [JsonPropertyName("entries")] + public System.Collections.Generic.IList Entries + { + get; + set; + } + } + + /// + /// Object type. Accessor means that the property itself is an accessor property. + /// + public enum PropertyPreviewType + { + /// + /// object + /// + [JsonPropertyName("object")] + Object, + /// + /// function + /// + [JsonPropertyName("function")] + Function, + /// + /// undefined + /// + [JsonPropertyName("undefined")] + Undefined, + /// + /// string + /// + [JsonPropertyName("string")] + String, + /// + /// number + /// + [JsonPropertyName("number")] + Number, + /// + /// boolean + /// + [JsonPropertyName("boolean")] + Boolean, + /// + /// symbol + /// + [JsonPropertyName("symbol")] + Symbol, + /// + /// accessor + /// + [JsonPropertyName("accessor")] + Accessor, + /// + /// bigint + /// + [JsonPropertyName("bigint")] + Bigint + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + public enum PropertyPreviewSubtype + { + /// + /// array + /// + [JsonPropertyName("array")] + Array, + /// + /// null + /// + [JsonPropertyName("null")] + Null, + /// + /// node + /// + [JsonPropertyName("node")] + Node, + /// + /// regexp + /// + [JsonPropertyName("regexp")] + Regexp, + /// + /// date + /// + [JsonPropertyName("date")] + Date, + /// + /// map + /// + [JsonPropertyName("map")] + Map, + /// + /// set + /// + [JsonPropertyName("set")] + Set, + /// + /// weakmap + /// + [JsonPropertyName("weakmap")] + Weakmap, + /// + /// weakset + /// + [JsonPropertyName("weakset")] + Weakset, + /// + /// iterator + /// + [JsonPropertyName("iterator")] + Iterator, + /// + /// generator + /// + [JsonPropertyName("generator")] + Generator, + /// + /// error + /// + [JsonPropertyName("error")] + Error, + /// + /// proxy + /// + [JsonPropertyName("proxy")] + Proxy, + /// + /// promise + /// + [JsonPropertyName("promise")] + Promise, + /// + /// typedarray + /// + [JsonPropertyName("typedarray")] + Typedarray, + /// + /// arraybuffer + /// + [JsonPropertyName("arraybuffer")] + Arraybuffer, + /// + /// dataview + /// + [JsonPropertyName("dataview")] + Dataview, + /// + /// webassemblymemory + /// + [JsonPropertyName("webassemblymemory")] + Webassemblymemory, + /// + /// wasmvalue + /// + [JsonPropertyName("wasmvalue")] + Wasmvalue, + /// + /// trustedtype + /// + [JsonPropertyName("trustedtype")] + Trustedtype + } + + /// + /// PropertyPreview + /// + public partial class PropertyPreview : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Property name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// Object type. Accessor means that the property itself is an accessor property. + /// + [JsonPropertyName("type")] + public CefSharp.DevTools.Runtime.PropertyPreviewType Type + { + get; + set; + } + + /// + /// User-friendly property value string. + /// + [JsonPropertyName("value")] + public string Value + { + get; + set; + } + + /// + /// Nested value preview. + /// + [JsonPropertyName("valuePreview")] + public CefSharp.DevTools.Runtime.ObjectPreview ValuePreview + { + get; + set; + } + + /// + /// Object subtype hint. Specified for `object` type values only. + /// + [JsonPropertyName("subtype")] + public CefSharp.DevTools.Runtime.PropertyPreviewSubtype? Subtype + { + get; + set; + } + } + + /// + /// EntryPreview + /// + public partial class EntryPreview : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Preview of the key. Specified for map-like collection entries. + /// + [JsonPropertyName("key")] + public CefSharp.DevTools.Runtime.ObjectPreview Key + { + get; + set; + } + + /// + /// Preview of the value. + /// + [JsonPropertyName("value")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.ObjectPreview Value + { + get; + set; + } + } + + /// + /// Object property descriptor. + /// + public partial class PropertyDescriptor : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Property name or symbol description. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// The value associated with the property. + /// + [JsonPropertyName("value")] + public CefSharp.DevTools.Runtime.RemoteObject Value + { + get; + set; + } + + /// + /// True if the value associated with the property may be changed (data descriptors only). + /// + [JsonPropertyName("writable")] + public bool? Writable + { + get; + set; + } + + /// + /// A function which serves as a getter for the property, or `undefined` if there is no getter + /// (accessor descriptors only). + /// + [JsonPropertyName("get")] + public CefSharp.DevTools.Runtime.RemoteObject Get + { + get; + set; + } + + /// + /// A function which serves as a setter for the property, or `undefined` if there is no setter + /// (accessor descriptors only). + /// + [JsonPropertyName("set")] + public CefSharp.DevTools.Runtime.RemoteObject Set + { + get; + set; + } + + /// + /// True if the type of this property descriptor may be changed and if the property may be + /// deleted from the corresponding object. + /// + [JsonPropertyName("configurable")] + public bool Configurable + { + get; + set; + } + + /// + /// True if this property shows up during enumeration of the properties on the corresponding + /// object. + /// + [JsonPropertyName("enumerable")] + public bool Enumerable + { + get; + set; + } + + /// + /// True if the result was thrown during the evaluation. + /// + [JsonPropertyName("wasThrown")] + public bool? WasThrown + { + get; + set; + } + + /// + /// True if the property is owned for the object. + /// + [JsonPropertyName("isOwn")] + public bool? IsOwn + { + get; + set; + } + + /// + /// Property symbol object, if the property is of the `symbol` type. + /// + [JsonPropertyName("symbol")] + public CefSharp.DevTools.Runtime.RemoteObject Symbol + { + get; + set; + } + } + + /// + /// Object internal property descriptor. This property isn't normally visible in JavaScript code. + /// + public partial class InternalPropertyDescriptor : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Conventional property name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// The value associated with the property. + /// + [JsonPropertyName("value")] + public CefSharp.DevTools.Runtime.RemoteObject Value + { + get; + set; + } + } + + /// + /// Object private field descriptor. + /// + public partial class PrivatePropertyDescriptor : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Private property name. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// The value associated with the private property. + /// + [JsonPropertyName("value")] + public CefSharp.DevTools.Runtime.RemoteObject Value + { + get; + set; + } + + /// + /// A function which serves as a getter for the private property, + /// or `undefined` if there is no getter (accessor descriptors only). + /// + [JsonPropertyName("get")] + public CefSharp.DevTools.Runtime.RemoteObject Get + { + get; + set; + } + + /// + /// A function which serves as a setter for the private property, + /// or `undefined` if there is no setter (accessor descriptors only). + /// + [JsonPropertyName("set")] + public CefSharp.DevTools.Runtime.RemoteObject Set + { + get; + set; + } + } + + /// + /// Represents function call argument. Either remote object id `objectId`, primitive `value`, + /// unserializable primitive value or neither of (for undefined) them should be specified. + /// + public partial class CallArgument : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Primitive value or serializable javascript object. + /// + [JsonPropertyName("value")] + public object Value + { + get; + set; + } + + /// + /// Primitive value which can not be JSON-stringified. + /// + [JsonPropertyName("unserializableValue")] + public string UnserializableValue + { + get; + set; + } + + /// + /// Remote object handle. + /// + [JsonPropertyName("objectId")] + public string ObjectId + { + get; + set; + } + } + + /// + /// Description of an isolated world. + /// + public partial class ExecutionContextDescription : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Unique id of the execution context. It can be used to specify in which execution context + /// script evaluation should be performed. + /// + [JsonPropertyName("id")] + public int Id + { + get; + set; + } + + /// + /// Execution context origin. + /// + [JsonPropertyName("origin")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Origin + { + get; + set; + } + + /// + /// Human readable name describing given context. + /// + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + set; + } + + /// + /// A system-unique execution context identifier. Unlike the id, this is unique across + /// multiple processes, so can be reliably used to identify specific context while backend + /// performs a cross-process navigation. + /// + [JsonPropertyName("uniqueId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string UniqueId + { + get; + set; + } + + /// + /// Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string} + /// + [JsonPropertyName("auxData")] + public object AuxData + { + get; + set; + } + } + + /// + /// Detailed information about exception (or error) that was thrown during script compilation or + /// execution. + /// + public partial class ExceptionDetails : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Exception id. + /// + [JsonPropertyName("exceptionId")] + public int ExceptionId + { + get; + set; + } + + /// + /// Exception text, which should be used together with exception object when available. + /// + [JsonPropertyName("text")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Text + { + get; + set; + } + + /// + /// Line number of the exception location (0-based). + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// Column number of the exception location (0-based). + /// + [JsonPropertyName("columnNumber")] + public int ColumnNumber + { + get; + set; + } + + /// + /// Script ID of the exception location. + /// + [JsonPropertyName("scriptId")] + public string ScriptId + { + get; + set; + } + + /// + /// URL of the exception location, to be used when the script was not reported. + /// + [JsonPropertyName("url")] + public string Url + { + get; + set; + } + + /// + /// JavaScript stack trace if available. + /// + [JsonPropertyName("stackTrace")] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + set; + } + + /// + /// Exception object if available. + /// + [JsonPropertyName("exception")] + public CefSharp.DevTools.Runtime.RemoteObject Exception + { + get; + set; + } + + /// + /// Identifier of the context where exception happened. + /// + [JsonPropertyName("executionContextId")] + public int? ExecutionContextId + { + get; + set; + } + + /// + /// Dictionary with entries of meta data that the client associated + /// with this exception, such as information about associated network + /// requests, etc. + /// + [JsonPropertyName("exceptionMetaData")] + public object ExceptionMetaData + { + get; + set; + } + } + + /// + /// Stack entry for runtime errors and assertions. + /// + public partial class CallFrame : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// JavaScript function name. + /// + [JsonPropertyName("functionName")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string FunctionName + { + get; + set; + } + + /// + /// JavaScript script id. + /// + [JsonPropertyName("scriptId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ScriptId + { + get; + set; + } + + /// + /// JavaScript script name or url. + /// + [JsonPropertyName("url")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Url + { + get; + set; + } + + /// + /// JavaScript script line number (0-based). + /// + [JsonPropertyName("lineNumber")] + public int LineNumber + { + get; + set; + } + + /// + /// JavaScript script column number (0-based). + /// + [JsonPropertyName("columnNumber")] + public int ColumnNumber + { + get; + set; + } + } + + /// + /// Call frames for assertions or error messages. + /// + public partial class StackTrace : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// String label of this stack trace. For async traces this may be a name of the function that + /// initiated the async call. + /// + [JsonPropertyName("description")] + public string Description + { + get; + set; + } + + /// + /// JavaScript function name. + /// + [JsonPropertyName("callFrames")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList CallFrames + { + get; + set; + } + + /// + /// Asynchronous JavaScript stack trace that preceded this stack, if available. + /// + [JsonPropertyName("parent")] + public CefSharp.DevTools.Runtime.StackTrace Parent + { + get; + set; + } + + /// + /// Asynchronous JavaScript stack trace that preceded this stack, if available. + /// + [JsonPropertyName("parentId")] + public CefSharp.DevTools.Runtime.StackTraceId ParentId + { + get; + set; + } + } + + /// + /// If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This + /// allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages. + /// + public partial class StackTraceId : CefSharp.DevTools.DevToolsDomainEntityBase + { + /// + /// Id + /// + [JsonPropertyName("id")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Id + { + get; + set; + } + + /// + /// DebuggerId + /// + [JsonPropertyName("debuggerId")] + public string DebuggerId + { + get; + set; + } + } + + /// + /// Notification is issued every time when binding is called. + /// + public class BindingCalledEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Name + /// + [JsonInclude] + [JsonPropertyName("name")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Name + { + get; + private set; + } + + /// + /// Payload + /// + [JsonInclude] + [JsonPropertyName("payload")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Payload + { + get; + private set; + } + + /// + /// Identifier of the context where the call was made. + /// + [JsonInclude] + [JsonPropertyName("executionContextId")] + public int ExecutionContextId + { + get; + private set; + } + } + + /// + /// Type of the call. + /// + public enum ConsoleAPICalledType + { + /// + /// log + /// + [JsonPropertyName("log")] + Log, + /// + /// debug + /// + [JsonPropertyName("debug")] + Debug, + /// + /// info + /// + [JsonPropertyName("info")] + Info, + /// + /// error + /// + [JsonPropertyName("error")] + Error, + /// + /// warning + /// + [JsonPropertyName("warning")] + Warning, + /// + /// dir + /// + [JsonPropertyName("dir")] + Dir, + /// + /// dirxml + /// + [JsonPropertyName("dirxml")] + Dirxml, + /// + /// table + /// + [JsonPropertyName("table")] + Table, + /// + /// trace + /// + [JsonPropertyName("trace")] + Trace, + /// + /// clear + /// + [JsonPropertyName("clear")] + Clear, + /// + /// startGroup + /// + [JsonPropertyName("startGroup")] + StartGroup, + /// + /// startGroupCollapsed + /// + [JsonPropertyName("startGroupCollapsed")] + StartGroupCollapsed, + /// + /// endGroup + /// + [JsonPropertyName("endGroup")] + EndGroup, + /// + /// assert + /// + [JsonPropertyName("assert")] + Assert, + /// + /// profile + /// + [JsonPropertyName("profile")] + Profile, + /// + /// profileEnd + /// + [JsonPropertyName("profileEnd")] + ProfileEnd, + /// + /// count + /// + [JsonPropertyName("count")] + Count, + /// + /// timeEnd + /// + [JsonPropertyName("timeEnd")] + TimeEnd + } + + /// + /// Issued when console API was called. + /// + public class ConsoleAPICalledEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Type of the call. + /// + [JsonInclude] + [JsonPropertyName("type")] + public CefSharp.DevTools.Runtime.ConsoleAPICalledType Type + { + get; + private set; + } + + /// + /// Call arguments. + /// + [JsonInclude] + [JsonPropertyName("args")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public System.Collections.Generic.IList Args + { + get; + private set; + } + + /// + /// Identifier of the context where the call was made. + /// + [JsonInclude] + [JsonPropertyName("executionContextId")] + public int ExecutionContextId + { + get; + private set; + } + + /// + /// Call timestamp. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// Stack trace captured when the call was made. The async stack chain is automatically reported for + /// the following call types: `assert`, `error`, `trace`, `warning`. For other types the async call + /// chain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field. + /// + [JsonInclude] + [JsonPropertyName("stackTrace")] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + private set; + } + + /// + /// Console context descriptor for calls on non-default console context (not console.*): + /// 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call + /// on named context. + /// + [JsonInclude] + [JsonPropertyName("context")] + public string Context + { + get; + private set; + } + } + + /// + /// Issued when unhandled exception was revoked. + /// + public class ExceptionRevokedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Reason describing why exception was revoked. + /// + [JsonInclude] + [JsonPropertyName("reason")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string Reason + { + get; + private set; + } + + /// + /// The id of revoked exception, as reported in `exceptionThrown`. + /// + [JsonInclude] + [JsonPropertyName("exceptionId")] + public int ExceptionId + { + get; + private set; + } + } + + /// + /// Issued when exception was thrown and unhandled. + /// + public class ExceptionThrownEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Timestamp of the exception. + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + + /// + /// ExceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } + + /// + /// Issued when new execution context is created. + /// + public class ExecutionContextCreatedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// A newly created execution context. + /// + [JsonInclude] + [JsonPropertyName("context")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.ExecutionContextDescription Context + { + get; + private set; + } + } + + /// + /// Issued when execution context is destroyed. + /// + public class ExecutionContextDestroyedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Id of the destroyed context + /// + [JsonInclude] + [JsonPropertyName("executionContextId")] + public int ExecutionContextId + { + get; + private set; + } + + /// + /// Unique Id of the destroyed context + /// + [JsonInclude] + [JsonPropertyName("executionContextUniqueId")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public string ExecutionContextUniqueId + { + get; + private set; + } + } + + /// + /// Issued when object should be inspected (for example, as a result of inspect() command line API + /// call). + /// + public class InspectRequestedEventArgs : CefSharp.DevTools.DevToolsDomainEventArgsBase + { + /// + /// Object + /// + [JsonInclude] + [JsonPropertyName("object")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public CefSharp.DevTools.Runtime.RemoteObject Object + { + get; + private set; + } + + /// + /// Hints + /// + [JsonInclude] + [JsonPropertyName("hints")] + [System.Diagnostics.CodeAnalysis.DisallowNull] + public object Hints + { + get; + private set; + } + + /// + /// Identifier of the context where the call was made. + /// + [JsonInclude] + [JsonPropertyName("executionContextId")] + public int? ExecutionContextId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetPartialAXTreeResponse + /// + public class GetPartialAXTreeResponse : DevToolsDomainResponseBase + { + /// + /// nodes + /// + [JsonInclude] + [JsonPropertyName("nodes")] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetFullAXTreeResponse + /// + public class GetFullAXTreeResponse : DevToolsDomainResponseBase + { + /// + /// nodes + /// + [JsonInclude] + [JsonPropertyName("nodes")] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetRootAXNodeResponse + /// + public class GetRootAXNodeResponse : DevToolsDomainResponseBase + { + /// + /// node + /// + [JsonInclude] + [JsonPropertyName("node")] + public CefSharp.DevTools.Accessibility.AXNode Node + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetAXNodeAndAncestorsResponse + /// + public class GetAXNodeAndAncestorsResponse : DevToolsDomainResponseBase + { + /// + /// nodes + /// + [JsonInclude] + [JsonPropertyName("nodes")] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// GetChildAXNodesResponse + /// + public class GetChildAXNodesResponse : DevToolsDomainResponseBase + { + /// + /// nodes + /// + [JsonInclude] + [JsonPropertyName("nodes")] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + /// + /// QueryAXTreeResponse + /// + public class QueryAXTreeResponse : DevToolsDomainResponseBase + { + /// + /// nodes + /// + [JsonInclude] + [JsonPropertyName("nodes")] + public System.Collections.Generic.IList Nodes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Accessibility +{ + using System.Linq; + + /// + /// Accessibility + /// + public partial class AccessibilityClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Accessibility + /// + /// DevToolsClient + public AccessibilityClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// The loadComplete event mirrors the load complete event sent by the browser to assistive + /// technology when the web page has finished loading. + /// + public event System.EventHandler LoadComplete + { + add + { + _client.AddEventHandler("Accessibility.loadComplete", value); + } + + remove + { + _client.RemoveEventHandler("Accessibility.loadComplete", value); + } + } + + /// + /// The nodesUpdated event is sent every time a previously requested node has changed the in tree. + /// + public event System.EventHandler NodesUpdated + { + add + { + _client.AddEventHandler("Accessibility.nodesUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Accessibility.nodesUpdated", value); + } + } + + /// + /// Disables the accessibility domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Accessibility.disable", dict); + } + + /// + /// Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls. + /// This turns on accessibility for the page, which can impact performance until accessibility is disabled. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Accessibility.enable", dict); + } + + partial void ValidateGetPartialAXTree(int? nodeId = null, int? backendNodeId = null, string objectId = null, bool? fetchRelatives = null); + /// + /// Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists. + /// + /// Identifier of the node to get the partial accessibility tree for. + /// Identifier of the backend node to get the partial accessibility tree for. + /// JavaScript object id of the node wrapper to get the partial accessibility tree for. + /// Whether to fetch this node's ancestors, siblings and children. Defaults to true. + /// returns System.Threading.Tasks.Task<GetPartialAXTreeResponse> + public System.Threading.Tasks.Task GetPartialAXTreeAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, bool? fetchRelatives = null) + { + ValidateGetPartialAXTree(nodeId, backendNodeId, objectId, fetchRelatives); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (fetchRelatives.HasValue) + { + dict.Add("fetchRelatives", fetchRelatives.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getPartialAXTree", dict); + } + + partial void ValidateGetFullAXTree(int? depth = null, string frameId = null); + /// + /// Fetches the entire accessibility tree for the root Document + /// + /// The maximum depth at which descendants of the root node should be retrieved.If omitted, the full tree is returned. + /// The frame for whose document the AX tree should be retrieved.If omitted, the root frame is used. + /// returns System.Threading.Tasks.Task<GetFullAXTreeResponse> + public System.Threading.Tasks.Task GetFullAXTreeAsync(int? depth = null, string frameId = null) + { + ValidateGetFullAXTree(depth, frameId); + var dict = new System.Collections.Generic.Dictionary(); + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getFullAXTree", dict); + } + + partial void ValidateGetRootAXNode(string frameId = null); + /// + /// Fetches the root node. + /// Requires `enable()` to have been called previously. + /// + /// The frame in whose document the node resides.If omitted, the root frame is used. + /// returns System.Threading.Tasks.Task<GetRootAXNodeResponse> + public System.Threading.Tasks.Task GetRootAXNodeAsync(string frameId = null) + { + ValidateGetRootAXNode(frameId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getRootAXNode", dict); + } + + partial void ValidateGetAXNodeAndAncestors(int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Fetches a node and all ancestors up to and including the root. + /// Requires `enable()` to have been called previously. + /// + /// Identifier of the node to get. + /// Identifier of the backend node to get. + /// JavaScript object id of the node wrapper to get. + /// returns System.Threading.Tasks.Task<GetAXNodeAndAncestorsResponse> + public System.Threading.Tasks.Task GetAXNodeAndAncestorsAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateGetAXNodeAndAncestors(nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getAXNodeAndAncestors", dict); + } + + partial void ValidateGetChildAXNodes(string id, string frameId = null); + /// + /// Fetches a particular accessibility node by AXNodeId. + /// Requires `enable()` to have been called previously. + /// + /// id + /// The frame in whose document the node resides.If omitted, the root frame is used. + /// returns System.Threading.Tasks.Task<GetChildAXNodesResponse> + public System.Threading.Tasks.Task GetChildAXNodesAsync(string id, string frameId = null) + { + ValidateGetChildAXNodes(id, frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.getChildAXNodes", dict); + } + + partial void ValidateQueryAXTree(int? nodeId = null, int? backendNodeId = null, string objectId = null, string accessibleName = null, string role = null); + /// + /// Query a DOM node's accessibility subtree for accessible name and role. + /// This command computes the name and role for all nodes in the subtree, including those that are + /// ignored for accessibility, and returns those that match the specified name and role. If no DOM + /// node is specified, or the DOM node does not exist, the command returns an error. If neither + /// `accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree. + /// + /// Identifier of the node for the root to query. + /// Identifier of the backend node for the root to query. + /// JavaScript object id of the node wrapper for the root to query. + /// Find nodes with this computed name. + /// Find nodes with this computed role. + /// returns System.Threading.Tasks.Task<QueryAXTreeResponse> + public System.Threading.Tasks.Task QueryAXTreeAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, string accessibleName = null, string role = null) + { + ValidateQueryAXTree(nodeId, backendNodeId, objectId, accessibleName, role); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (!(string.IsNullOrEmpty(accessibleName))) + { + dict.Add("accessibleName", accessibleName); + } + + if (!(string.IsNullOrEmpty(role))) + { + dict.Add("role", role); + } + + return _client.ExecuteDevToolsMethodAsync("Accessibility.queryAXTree", dict); + } + } +} + +namespace CefSharp.DevTools.Animation +{ + /// + /// GetCurrentTimeResponse + /// + public class GetCurrentTimeResponse : DevToolsDomainResponseBase + { + /// + /// currentTime + /// + [JsonInclude] + [JsonPropertyName("currentTime")] + public double CurrentTime + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Animation +{ + /// + /// GetPlaybackRateResponse + /// + public class GetPlaybackRateResponse : DevToolsDomainResponseBase + { + /// + /// playbackRate + /// + [JsonInclude] + [JsonPropertyName("playbackRate")] + public double PlaybackRate + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Animation +{ + /// + /// ResolveAnimationResponse + /// + public class ResolveAnimationResponse : DevToolsDomainResponseBase + { + /// + /// remoteObject + /// + [JsonInclude] + [JsonPropertyName("remoteObject")] + public CefSharp.DevTools.Runtime.RemoteObject RemoteObject + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Animation +{ + using System.Linq; + + /// + /// Animation + /// + public partial class AnimationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Animation + /// + /// DevToolsClient + public AnimationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Event for when an animation has been cancelled. + /// + public event System.EventHandler AnimationCanceled + { + add + { + _client.AddEventHandler("Animation.animationCanceled", value); + } + + remove + { + _client.RemoveEventHandler("Animation.animationCanceled", value); + } + } + + /// + /// Event for each animation that has been created. + /// + public event System.EventHandler AnimationCreated + { + add + { + _client.AddEventHandler("Animation.animationCreated", value); + } + + remove + { + _client.RemoveEventHandler("Animation.animationCreated", value); + } + } + + /// + /// Event for animation that has been started. + /// + public event System.EventHandler AnimationStarted + { + add + { + _client.AddEventHandler("Animation.animationStarted", value); + } + + remove + { + _client.RemoveEventHandler("Animation.animationStarted", value); + } + } + + /// + /// Event for animation that has been updated. + /// + public event System.EventHandler AnimationUpdated + { + add + { + _client.AddEventHandler("Animation.animationUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Animation.animationUpdated", value); + } + } + + /// + /// Disables animation domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Animation.disable", dict); + } + + /// + /// Enables animation domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Animation.enable", dict); + } + + partial void ValidateGetCurrentTime(string id); + /// + /// Returns the current time of the an animation. + /// + /// Id of animation. + /// returns System.Threading.Tasks.Task<GetCurrentTimeResponse> + public System.Threading.Tasks.Task GetCurrentTimeAsync(string id) + { + ValidateGetCurrentTime(id); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + return _client.ExecuteDevToolsMethodAsync("Animation.getCurrentTime", dict); + } + + /// + /// Gets the playback rate of the document timeline. + /// + /// returns System.Threading.Tasks.Task<GetPlaybackRateResponse> + public System.Threading.Tasks.Task GetPlaybackRateAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Animation.getPlaybackRate", dict); + } + + partial void ValidateReleaseAnimations(string[] animations); + /// + /// Releases a set of animations to no longer be manipulated. + /// + /// List of animation ids to seek. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReleaseAnimationsAsync(string[] animations) + { + ValidateReleaseAnimations(animations); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animations", animations); + return _client.ExecuteDevToolsMethodAsync("Animation.releaseAnimations", dict); + } + + partial void ValidateResolveAnimation(string animationId); + /// + /// Gets the remote object of the Animation. + /// + /// Animation id. + /// returns System.Threading.Tasks.Task<ResolveAnimationResponse> + public System.Threading.Tasks.Task ResolveAnimationAsync(string animationId) + { + ValidateResolveAnimation(animationId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animationId", animationId); + return _client.ExecuteDevToolsMethodAsync("Animation.resolveAnimation", dict); + } + + partial void ValidateSeekAnimations(string[] animations, double currentTime); + /// + /// Seek a set of animations to a particular time within each animation. + /// + /// List of animation ids to seek. + /// Set the current time of each animation. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SeekAnimationsAsync(string[] animations, double currentTime) + { + ValidateSeekAnimations(animations, currentTime); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animations", animations); + dict.Add("currentTime", currentTime); + return _client.ExecuteDevToolsMethodAsync("Animation.seekAnimations", dict); + } + + partial void ValidateSetPaused(string[] animations, bool paused); + /// + /// Sets the paused state of a set of animations. + /// + /// Animations to set the pause state of. + /// Paused state to set to. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPausedAsync(string[] animations, bool paused) + { + ValidateSetPaused(animations, paused); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animations", animations); + dict.Add("paused", paused); + return _client.ExecuteDevToolsMethodAsync("Animation.setPaused", dict); + } + + partial void ValidateSetPlaybackRate(double playbackRate); + /// + /// Sets the playback rate of the document timeline. + /// + /// Playback rate for animations on page + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPlaybackRateAsync(double playbackRate) + { + ValidateSetPlaybackRate(playbackRate); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("playbackRate", playbackRate); + return _client.ExecuteDevToolsMethodAsync("Animation.setPlaybackRate", dict); + } + + partial void ValidateSetTiming(string animationId, double duration, double delay); + /// + /// Sets the timing of an animation node. + /// + /// Animation id. + /// Duration of the animation. + /// Delay of the animation. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetTimingAsync(string animationId, double duration, double delay) + { + ValidateSetTiming(animationId, duration, delay); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("animationId", animationId); + dict.Add("duration", duration); + dict.Add("delay", delay); + return _client.ExecuteDevToolsMethodAsync("Animation.setTiming", dict); + } + } +} + +namespace CefSharp.DevTools.Audits +{ + /// + /// GetEncodedResponseResponse + /// + public class GetEncodedResponseResponse : DevToolsDomainResponseBase + { + /// + /// body + /// + [JsonInclude] + [JsonPropertyName("body")] + public byte[] Body + { + get; + private set; + } + + /// + /// originalSize + /// + [JsonInclude] + [JsonPropertyName("originalSize")] + public int OriginalSize + { + get; + private set; + } + + /// + /// encodedSize + /// + [JsonInclude] + [JsonPropertyName("encodedSize")] + public int EncodedSize + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Audits +{ + /// + /// CheckFormsIssuesResponse + /// + public class CheckFormsIssuesResponse : DevToolsDomainResponseBase + { + /// + /// formIssues + /// + [JsonInclude] + [JsonPropertyName("formIssues")] + public System.Collections.Generic.IList FormIssues + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Audits +{ + using System.Linq; + + /// + /// The encoding to use. + /// + public enum GetEncodedResponseEncoding + { + /// + /// webp + /// + [JsonPropertyName("webp")] + Webp, + /// + /// jpeg + /// + [JsonPropertyName("jpeg")] + Jpeg, + /// + /// png + /// + [JsonPropertyName("png")] + Png + } + + /// + /// Audits domain allows investigation of page violations and possible improvements. + /// + public partial class AuditsClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Audits + /// + /// DevToolsClient + public AuditsClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// IssueAdded + /// + public event System.EventHandler IssueAdded + { + add + { + _client.AddEventHandler("Audits.issueAdded", value); + } + + remove + { + _client.RemoveEventHandler("Audits.issueAdded", value); + } + } + + partial void ValidateGetEncodedResponse(string requestId, CefSharp.DevTools.Audits.GetEncodedResponseEncoding encoding, double? quality = null, bool? sizeOnly = null); + /// + /// Returns the response body and size if it were re-encoded with the specified settings. Only + /// applies to images. + /// + /// Identifier of the network request to get content for. + /// The encoding to use. + /// The quality of the encoding (0-1). (defaults to 1) + /// Whether to only return the size information (defaults to false). + /// returns System.Threading.Tasks.Task<GetEncodedResponseResponse> + public System.Threading.Tasks.Task GetEncodedResponseAsync(string requestId, CefSharp.DevTools.Audits.GetEncodedResponseEncoding encoding, double? quality = null, bool? sizeOnly = null) + { + ValidateGetEncodedResponse(requestId, encoding, quality, sizeOnly); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("encoding", EnumToString(encoding)); + if (quality.HasValue) + { + dict.Add("quality", quality.Value); + } + + if (sizeOnly.HasValue) + { + dict.Add("sizeOnly", sizeOnly.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Audits.getEncodedResponse", dict); + } + + /// + /// Disables issues domain, prevents further issues from being reported to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Audits.disable", dict); + } + + /// + /// Enables issues domain, sends the issues collected so far to the client by means of the + /// `issueAdded` event. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Audits.enable", dict); + } + + partial void ValidateCheckContrast(bool? reportAAA = null); + /// + /// Runs the contrast check for the target page. Found issues are reported + /// using Audits.issueAdded event. + /// + /// Whether to report WCAG AAA level issues. Default is false. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CheckContrastAsync(bool? reportAAA = null) + { + ValidateCheckContrast(reportAAA); + var dict = new System.Collections.Generic.Dictionary(); + if (reportAAA.HasValue) + { + dict.Add("reportAAA", reportAAA.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Audits.checkContrast", dict); + } + + /// + /// Runs the form issues check for the target page. Found issues are reported + /// using Audits.issueAdded event. + /// + /// returns System.Threading.Tasks.Task<CheckFormsIssuesResponse> + public System.Threading.Tasks.Task CheckFormsIssuesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Audits.checkFormsIssues", dict); + } + } +} + +namespace CefSharp.DevTools.Autofill +{ + using System.Linq; + + /// + /// Defines commands and events for Autofill. + /// + public partial class AutofillClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Autofill + /// + /// DevToolsClient + public AutofillClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Emitted when an address form is filled. + /// + public event System.EventHandler AddressFormFilled + { + add + { + _client.AddEventHandler("Autofill.addressFormFilled", value); + } + + remove + { + _client.RemoveEventHandler("Autofill.addressFormFilled", value); + } + } + + partial void ValidateTrigger(int fieldId, string frameId = null, CefSharp.DevTools.Autofill.CreditCard card = null, CefSharp.DevTools.Autofill.Address address = null); + /// + /// Trigger autofill on a form identified by the fieldId. + /// If the field and related form cannot be autofilled, returns an error. + /// + /// Identifies a field that serves as an anchor for autofill. + /// Identifies the frame that field belongs to. + /// Credit card information to fill out the form. Credit card data is not saved. Mutually exclusive with `address`. + /// Address to fill out the form. Address data is not saved. Mutually exclusive with `card`. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TriggerAsync(int fieldId, string frameId = null, CefSharp.DevTools.Autofill.CreditCard card = null, CefSharp.DevTools.Autofill.Address address = null) + { + ValidateTrigger(fieldId, frameId, card, address); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("fieldId", fieldId); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + if ((card) != (null)) + { + dict.Add("card", card.ToDictionary()); + } + + if ((address) != (null)) + { + dict.Add("address", address.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Autofill.trigger", dict); + } + + partial void ValidateSetAddresses(System.Collections.Generic.IList addresses); + /// + /// Set addresses so that developers can verify their forms implementation. + /// + /// addresses + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAddressesAsync(System.Collections.Generic.IList addresses) + { + ValidateSetAddresses(addresses); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("addresses", addresses.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Autofill.setAddresses", dict); + } + + /// + /// Disables autofill domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Autofill.disable", dict); + } + + /// + /// Enables autofill domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Autofill.enable", dict); + } + } +} + +namespace CefSharp.DevTools.BackgroundService +{ + using System.Linq; + + /// + /// Defines events for background web platform features. + /// + public partial class BackgroundServiceClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// BackgroundService + /// + /// DevToolsClient + public BackgroundServiceClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Called when the recording state for the service has been updated. + /// + public event System.EventHandler RecordingStateChanged + { + add + { + _client.AddEventHandler("BackgroundService.recordingStateChanged", value); + } + + remove + { + _client.RemoveEventHandler("BackgroundService.recordingStateChanged", value); + } + } + + /// + /// Called with all existing backgroundServiceEvents when enabled, and all new + /// events afterwards if enabled and recording. + /// + public event System.EventHandler BackgroundServiceEventReceived + { + add + { + _client.AddEventHandler("BackgroundService.backgroundServiceEventReceived", value); + } + + remove + { + _client.RemoveEventHandler("BackgroundService.backgroundServiceEventReceived", value); + } + } + + partial void ValidateStartObserving(CefSharp.DevTools.BackgroundService.ServiceName service); + /// + /// Enables event updates for the service. + /// + /// service + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartObservingAsync(CefSharp.DevTools.BackgroundService.ServiceName service) + { + ValidateStartObserving(service); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("service", EnumToString(service)); + return _client.ExecuteDevToolsMethodAsync("BackgroundService.startObserving", dict); + } + + partial void ValidateStopObserving(CefSharp.DevTools.BackgroundService.ServiceName service); + /// + /// Disables event updates for the service. + /// + /// service + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopObservingAsync(CefSharp.DevTools.BackgroundService.ServiceName service) + { + ValidateStopObserving(service); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("service", EnumToString(service)); + return _client.ExecuteDevToolsMethodAsync("BackgroundService.stopObserving", dict); + } + + partial void ValidateSetRecording(bool shouldRecord, CefSharp.DevTools.BackgroundService.ServiceName service); + /// + /// Set the recording state for the service. + /// + /// shouldRecord + /// service + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetRecordingAsync(bool shouldRecord, CefSharp.DevTools.BackgroundService.ServiceName service) + { + ValidateSetRecording(shouldRecord, service); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("shouldRecord", shouldRecord); + dict.Add("service", EnumToString(service)); + return _client.ExecuteDevToolsMethodAsync("BackgroundService.setRecording", dict); + } + + partial void ValidateClearEvents(CefSharp.DevTools.BackgroundService.ServiceName service); + /// + /// Clears all stored data for the service. + /// + /// service + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearEventsAsync(CefSharp.DevTools.BackgroundService.ServiceName service) + { + ValidateClearEvents(service); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("service", EnumToString(service)); + return _client.ExecuteDevToolsMethodAsync("BackgroundService.clearEvents", dict); + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + /// + /// AddServiceResponse + /// + public class AddServiceResponse : DevToolsDomainResponseBase + { + /// + /// serviceId + /// + [JsonInclude] + [JsonPropertyName("serviceId")] + public string ServiceId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + /// + /// AddCharacteristicResponse + /// + public class AddCharacteristicResponse : DevToolsDomainResponseBase + { + /// + /// characteristicId + /// + [JsonInclude] + [JsonPropertyName("characteristicId")] + public string CharacteristicId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + /// + /// AddDescriptorResponse + /// + public class AddDescriptorResponse : DevToolsDomainResponseBase + { + /// + /// descriptorId + /// + [JsonInclude] + [JsonPropertyName("descriptorId")] + public string DescriptorId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.BluetoothEmulation +{ + using System.Linq; + + /// + /// This domain allows configuring virtual Bluetooth devices to test + /// the web-bluetooth API. + /// + public partial class BluetoothEmulationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// BluetoothEmulation + /// + /// DevToolsClient + public BluetoothEmulationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Event for when a GATT operation of |type| to the peripheral with |address| + /// happened. + /// + public event System.EventHandler GattOperationReceived + { + add + { + _client.AddEventHandler("BluetoothEmulation.gattOperationReceived", value); + } + + remove + { + _client.RemoveEventHandler("BluetoothEmulation.gattOperationReceived", value); + } + } + + /// + /// Event for when a characteristic operation of |type| to the characteristic + /// respresented by |characteristicId| happened. |data| and |writeType| is + /// expected to exist when |type| is write. + /// + public event System.EventHandler CharacteristicOperationReceived + { + add + { + _client.AddEventHandler("BluetoothEmulation.characteristicOperationReceived", value); + } + + remove + { + _client.RemoveEventHandler("BluetoothEmulation.characteristicOperationReceived", value); + } + } + + /// + /// Event for when a descriptor operation of |type| to the descriptor + /// respresented by |descriptorId| happened. |data| is expected to exist when + /// |type| is write. + /// + public event System.EventHandler DescriptorOperationReceived + { + add + { + _client.AddEventHandler("BluetoothEmulation.descriptorOperationReceived", value); + } + + remove + { + _client.RemoveEventHandler("BluetoothEmulation.descriptorOperationReceived", value); + } + } + + partial void ValidateEnable(CefSharp.DevTools.BluetoothEmulation.CentralState state, bool leSupported); + /// + /// Enable the BluetoothEmulation domain. + /// + /// State of the simulated central. + /// If the simulated central supports low-energy. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(CefSharp.DevTools.BluetoothEmulation.CentralState state, bool leSupported) + { + ValidateEnable(state, leSupported); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("state", EnumToString(state)); + dict.Add("leSupported", leSupported); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.enable", dict); + } + + partial void ValidateSetSimulatedCentralState(CefSharp.DevTools.BluetoothEmulation.CentralState state); + /// + /// Set the state of the simulated central. + /// + /// State of the simulated central. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSimulatedCentralStateAsync(CefSharp.DevTools.BluetoothEmulation.CentralState state) + { + ValidateSetSimulatedCentralState(state); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("state", EnumToString(state)); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.setSimulatedCentralState", dict); + } + + /// + /// Disable the BluetoothEmulation domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.disable", dict); + } + + partial void ValidateSimulatePreconnectedPeripheral(string address, string name, System.Collections.Generic.IList manufacturerData, string[] knownServiceUuids); + /// + /// Simulates a peripheral with |address|, |name| and |knownServiceUuids| + /// that has already been connected to the system. + /// + /// address + /// name + /// manufacturerData + /// knownServiceUuids + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulatePreconnectedPeripheralAsync(string address, string name, System.Collections.Generic.IList manufacturerData, string[] knownServiceUuids) + { + ValidateSimulatePreconnectedPeripheral(address, name, manufacturerData, knownServiceUuids); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("address", address); + dict.Add("name", name); + dict.Add("manufacturerData", manufacturerData.Select(x => x.ToDictionary())); + dict.Add("knownServiceUuids", knownServiceUuids); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulatePreconnectedPeripheral", dict); + } + + partial void ValidateSimulateAdvertisement(CefSharp.DevTools.BluetoothEmulation.ScanEntry entry); + /// + /// Simulates an advertisement packet described in |entry| being received by + /// the central. + /// + /// entry + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateAdvertisementAsync(CefSharp.DevTools.BluetoothEmulation.ScanEntry entry) + { + ValidateSimulateAdvertisement(entry); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("entry", entry.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateAdvertisement", dict); + } + + partial void ValidateSimulateGATTOperationResponse(string address, CefSharp.DevTools.BluetoothEmulation.GATTOperationType type, int code); + /// + /// Simulates the response code from the peripheral with |address| for a + /// GATT operation of |type|. The |code| value follows the HCI Error Codes from + /// Bluetooth Core Specification Vol 2 Part D 1.3 List Of Error Codes. + /// + /// address + /// type + /// code + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateGATTOperationResponseAsync(string address, CefSharp.DevTools.BluetoothEmulation.GATTOperationType type, int code) + { + ValidateSimulateGATTOperationResponse(address, type, code); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("address", address); + dict.Add("type", EnumToString(type)); + dict.Add("code", code); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateGATTOperationResponse", dict); + } + + partial void ValidateSimulateCharacteristicOperationResponse(string characteristicId, CefSharp.DevTools.BluetoothEmulation.CharacteristicOperationType type, int code, byte[] data = null); + /// + /// Simulates the response from the characteristic with |characteristicId| for a + /// characteristic operation of |type|. The |code| value follows the Error + /// Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. + /// The |data| is expected to exist when simulating a successful read operation + /// response. + /// + /// characteristicId + /// type + /// code + /// data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateCharacteristicOperationResponseAsync(string characteristicId, CefSharp.DevTools.BluetoothEmulation.CharacteristicOperationType type, int code, byte[] data = null) + { + ValidateSimulateCharacteristicOperationResponse(characteristicId, type, code, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("characteristicId", characteristicId); + dict.Add("type", EnumToString(type)); + dict.Add("code", code); + if ((data) != (null)) + { + dict.Add("data", ToBase64String(data)); + } + + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateCharacteristicOperationResponse", dict); + } + + partial void ValidateSimulateDescriptorOperationResponse(string descriptorId, CefSharp.DevTools.BluetoothEmulation.DescriptorOperationType type, int code, byte[] data = null); + /// + /// Simulates the response from the descriptor with |descriptorId| for a + /// descriptor operation of |type|. The |code| value follows the Error + /// Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. + /// The |data| is expected to exist when simulating a successful read operation + /// response. + /// + /// descriptorId + /// type + /// code + /// data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateDescriptorOperationResponseAsync(string descriptorId, CefSharp.DevTools.BluetoothEmulation.DescriptorOperationType type, int code, byte[] data = null) + { + ValidateSimulateDescriptorOperationResponse(descriptorId, type, code, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("descriptorId", descriptorId); + dict.Add("type", EnumToString(type)); + dict.Add("code", code); + if ((data) != (null)) + { + dict.Add("data", ToBase64String(data)); + } + + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateDescriptorOperationResponse", dict); + } + + partial void ValidateAddService(string address, string serviceUuid); + /// + /// Adds a service with |serviceUuid| to the peripheral with |address|. + /// + /// address + /// serviceUuid + /// returns System.Threading.Tasks.Task<AddServiceResponse> + public System.Threading.Tasks.Task AddServiceAsync(string address, string serviceUuid) + { + ValidateAddService(address, serviceUuid); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("address", address); + dict.Add("serviceUuid", serviceUuid); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.addService", dict); + } + + partial void ValidateRemoveService(string serviceId); + /// + /// Removes the service respresented by |serviceId| from the simulated central. + /// + /// serviceId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveServiceAsync(string serviceId) + { + ValidateRemoveService(serviceId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("serviceId", serviceId); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.removeService", dict); + } + + partial void ValidateAddCharacteristic(string serviceId, string characteristicUuid, CefSharp.DevTools.BluetoothEmulation.CharacteristicProperties properties); + /// + /// Adds a characteristic with |characteristicUuid| and |properties| to the + /// service represented by |serviceId|. + /// + /// serviceId + /// characteristicUuid + /// properties + /// returns System.Threading.Tasks.Task<AddCharacteristicResponse> + public System.Threading.Tasks.Task AddCharacteristicAsync(string serviceId, string characteristicUuid, CefSharp.DevTools.BluetoothEmulation.CharacteristicProperties properties) + { + ValidateAddCharacteristic(serviceId, characteristicUuid, properties); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("serviceId", serviceId); + dict.Add("characteristicUuid", characteristicUuid); + dict.Add("properties", properties.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.addCharacteristic", dict); + } + + partial void ValidateRemoveCharacteristic(string characteristicId); + /// + /// Removes the characteristic respresented by |characteristicId| from the + /// simulated central. + /// + /// characteristicId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveCharacteristicAsync(string characteristicId) + { + ValidateRemoveCharacteristic(characteristicId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("characteristicId", characteristicId); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.removeCharacteristic", dict); + } + + partial void ValidateAddDescriptor(string characteristicId, string descriptorUuid); + /// + /// Adds a descriptor with |descriptorUuid| to the characteristic respresented + /// by |characteristicId|. + /// + /// characteristicId + /// descriptorUuid + /// returns System.Threading.Tasks.Task<AddDescriptorResponse> + public System.Threading.Tasks.Task AddDescriptorAsync(string characteristicId, string descriptorUuid) + { + ValidateAddDescriptor(characteristicId, descriptorUuid); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("characteristicId", characteristicId); + dict.Add("descriptorUuid", descriptorUuid); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.addDescriptor", dict); + } + + partial void ValidateRemoveDescriptor(string descriptorId); + /// + /// Removes the descriptor with |descriptorId| from the simulated central. + /// + /// descriptorId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveDescriptorAsync(string descriptorId) + { + ValidateRemoveDescriptor(descriptorId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("descriptorId", descriptorId); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.removeDescriptor", dict); + } + + partial void ValidateSimulateGATTDisconnection(string address); + /// + /// Simulates a GATT disconnection from the peripheral with |address|. + /// + /// address + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulateGATTDisconnectionAsync(string address) + { + ValidateSimulateGATTDisconnection(address); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("address", address); + return _client.ExecuteDevToolsMethodAsync("BluetoothEmulation.simulateGATTDisconnection", dict); + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetVersionResponse + /// + public class GetVersionResponse : DevToolsDomainResponseBase + { + /// + /// protocolVersion + /// + [JsonInclude] + [JsonPropertyName("protocolVersion")] + public string ProtocolVersion + { + get; + private set; + } + + /// + /// product + /// + [JsonInclude] + [JsonPropertyName("product")] + public string Product + { + get; + private set; + } + + /// + /// revision + /// + [JsonInclude] + [JsonPropertyName("revision")] + public string Revision + { + get; + private set; + } + + /// + /// userAgent + /// + [JsonInclude] + [JsonPropertyName("userAgent")] + public string UserAgent + { + get; + private set; + } + + /// + /// jsVersion + /// + [JsonInclude] + [JsonPropertyName("jsVersion")] + public string JsVersion + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetBrowserCommandLineResponse + /// + public class GetBrowserCommandLineResponse : DevToolsDomainResponseBase + { + /// + /// arguments + /// + [JsonInclude] + [JsonPropertyName("arguments")] + public string[] Arguments + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetHistogramsResponse + /// + public class GetHistogramsResponse : DevToolsDomainResponseBase + { + /// + /// histograms + /// + [JsonInclude] + [JsonPropertyName("histograms")] + public System.Collections.Generic.IList Histograms + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetHistogramResponse + /// + public class GetHistogramResponse : DevToolsDomainResponseBase + { + /// + /// histogram + /// + [JsonInclude] + [JsonPropertyName("histogram")] + public CefSharp.DevTools.Browser.Histogram Histogram + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetWindowBoundsResponse + /// + public class GetWindowBoundsResponse : DevToolsDomainResponseBase + { + /// + /// bounds + /// + [JsonInclude] + [JsonPropertyName("bounds")] + public CefSharp.DevTools.Browser.Bounds Bounds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Browser +{ + /// + /// GetWindowForTargetResponse + /// + public class GetWindowForTargetResponse : DevToolsDomainResponseBase + { + /// + /// windowId + /// + [JsonInclude] + [JsonPropertyName("windowId")] + public int WindowId + { + get; + private set; + } + + /// + /// bounds + /// + [JsonInclude] + [JsonPropertyName("bounds")] + public CefSharp.DevTools.Browser.Bounds Bounds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Browser +{ + using System.Linq; + + /// + /// Whether to allow all or deny all download requests, or use default Chrome behavior if + /// available (otherwise deny). |allowAndName| allows download and names files according to + /// their download guids. + /// + public enum SetDownloadBehaviorBehavior + { + /// + /// deny + /// + [JsonPropertyName("deny")] + Deny, + /// + /// allow + /// + [JsonPropertyName("allow")] + Allow, + /// + /// allowAndName + /// + [JsonPropertyName("allowAndName")] + AllowAndName, + /// + /// default + /// + [JsonPropertyName("default")] + Default + } + + /// + /// The Browser domain defines methods and events for browser managing. + /// + public partial class BrowserClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Browser + /// + /// DevToolsClient + public BrowserClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when page is about to start a download. + /// + public event System.EventHandler DownloadWillBegin + { + add + { + _client.AddEventHandler("Browser.downloadWillBegin", value); + } + + remove + { + _client.RemoveEventHandler("Browser.downloadWillBegin", value); + } + } + + /// + /// Fired when download makes progress. Last call has |done| == true. + /// + public event System.EventHandler DownloadProgress + { + add + { + _client.AddEventHandler("Browser.downloadProgress", value); + } + + remove + { + _client.RemoveEventHandler("Browser.downloadProgress", value); + } + } + + partial void ValidateSetPermission(CefSharp.DevTools.Browser.PermissionDescriptor permission, CefSharp.DevTools.Browser.PermissionSetting setting, string origin = null, string embeddedOrigin = null, string browserContextId = null); + /// + /// Set permission settings for given embedding and embedded origins. + /// + /// Descriptor of permission to override. + /// Setting of the permission. + /// Embedding origin the permission applies to, all origins if not specified. + /// Embedded origin the permission applies to. It is ignored unless the embedding origin ispresent and valid. If the embedding origin is provided but the embedded origin isn't, theembedding origin is used as the embedded origin. + /// Context to override. When omitted, default browser context is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPermissionAsync(CefSharp.DevTools.Browser.PermissionDescriptor permission, CefSharp.DevTools.Browser.PermissionSetting setting, string origin = null, string embeddedOrigin = null, string browserContextId = null) + { + ValidateSetPermission(permission, setting, origin, embeddedOrigin, browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("permission", permission.ToDictionary()); + dict.Add("setting", EnumToString(setting)); + if (!(string.IsNullOrEmpty(origin))) + { + dict.Add("origin", origin); + } + + if (!(string.IsNullOrEmpty(embeddedOrigin))) + { + dict.Add("embeddedOrigin", embeddedOrigin); + } + + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.setPermission", dict); + } + + partial void ValidateResetPermissions(string browserContextId = null); + /// + /// Reset all permission management for all origins. + /// + /// BrowserContext to reset permissions. When omitted, default browser context is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetPermissionsAsync(string browserContextId = null) + { + ValidateResetPermissions(browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.resetPermissions", dict); + } + + partial void ValidateSetDownloadBehavior(CefSharp.DevTools.Browser.SetDownloadBehaviorBehavior behavior, string browserContextId = null, string downloadPath = null, bool? eventsEnabled = null); + /// + /// Set the behavior when downloading a file. + /// + /// Whether to allow all or deny all download requests, or use default Chrome behavior ifavailable (otherwise deny). |allowAndName| allows download and names files according totheir download guids. + /// BrowserContext to set download behavior. When omitted, default browser context is used. + /// The default path to save downloaded files to. This is required if behavior is set to 'allow'or 'allowAndName'. + /// Whether to emit download events (defaults to false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDownloadBehaviorAsync(CefSharp.DevTools.Browser.SetDownloadBehaviorBehavior behavior, string browserContextId = null, string downloadPath = null, bool? eventsEnabled = null) + { + ValidateSetDownloadBehavior(behavior, browserContextId, downloadPath, eventsEnabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("behavior", EnumToString(behavior)); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + if (!(string.IsNullOrEmpty(downloadPath))) + { + dict.Add("downloadPath", downloadPath); + } + + if (eventsEnabled.HasValue) + { + dict.Add("eventsEnabled", eventsEnabled.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.setDownloadBehavior", dict); + } + + partial void ValidateCancelDownload(string guid, string browserContextId = null); + /// + /// Cancel a download if in progress + /// + /// Global unique identifier of the download. + /// BrowserContext to perform the action in. When omitted, default browser context is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CancelDownloadAsync(string guid, string browserContextId = null) + { + ValidateCancelDownload(guid, browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("guid", guid); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.cancelDownload", dict); + } + + /// + /// Close browser gracefully. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CloseAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.close", dict); + } + + /// + /// Crashes browser on the main thread. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CrashAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.crash", dict); + } + + /// + /// Crashes GPU process. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CrashGpuProcessAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.crashGpuProcess", dict); + } + + /// + /// Returns version information. + /// + /// returns System.Threading.Tasks.Task<GetVersionResponse> + public System.Threading.Tasks.Task GetVersionAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.getVersion", dict); + } + + /// + /// Returns the command line switches for the browser process if, and only if + /// --enable-automation is on the commandline. + /// + /// returns System.Threading.Tasks.Task<GetBrowserCommandLineResponse> + public System.Threading.Tasks.Task GetBrowserCommandLineAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Browser.getBrowserCommandLine", dict); + } + + partial void ValidateGetHistograms(string query = null, bool? delta = null); + /// + /// Get Chrome histograms. + /// + /// Requested substring in name. Only histograms which have query as asubstring in their name are extracted. An empty or absent query returnsall histograms. + /// If true, retrieve delta since last delta call. + /// returns System.Threading.Tasks.Task<GetHistogramsResponse> + public System.Threading.Tasks.Task GetHistogramsAsync(string query = null, bool? delta = null) + { + ValidateGetHistograms(query, delta); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(query))) + { + dict.Add("query", query); + } + + if (delta.HasValue) + { + dict.Add("delta", delta.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.getHistograms", dict); + } + + partial void ValidateGetHistogram(string name, bool? delta = null); + /// + /// Get a Chrome histogram by name. + /// + /// Requested histogram name. + /// If true, retrieve delta since last delta call. + /// returns System.Threading.Tasks.Task<GetHistogramResponse> + public System.Threading.Tasks.Task GetHistogramAsync(string name, bool? delta = null) + { + ValidateGetHistogram(name, delta); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + if (delta.HasValue) + { + dict.Add("delta", delta.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.getHistogram", dict); + } + + partial void ValidateGetWindowBounds(int windowId); + /// + /// Get position and size of the browser window. + /// + /// Browser window id. + /// returns System.Threading.Tasks.Task<GetWindowBoundsResponse> + public System.Threading.Tasks.Task GetWindowBoundsAsync(int windowId) + { + ValidateGetWindowBounds(windowId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("windowId", windowId); + return _client.ExecuteDevToolsMethodAsync("Browser.getWindowBounds", dict); + } + + partial void ValidateGetWindowForTarget(string targetId = null); + /// + /// Get the browser window that contains the devtools target. + /// + /// Devtools agent host id. If called as a part of the session, associated targetId is used. + /// returns System.Threading.Tasks.Task<GetWindowForTargetResponse> + public System.Threading.Tasks.Task GetWindowForTargetAsync(string targetId = null) + { + ValidateGetWindowForTarget(targetId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(targetId))) + { + dict.Add("targetId", targetId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.getWindowForTarget", dict); + } + + partial void ValidateSetWindowBounds(int windowId, CefSharp.DevTools.Browser.Bounds bounds); + /// + /// Set position and/or size of the browser window. + /// + /// Browser window id. + /// New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combinedwith 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetWindowBoundsAsync(int windowId, CefSharp.DevTools.Browser.Bounds bounds) + { + ValidateSetWindowBounds(windowId, bounds); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("windowId", windowId); + dict.Add("bounds", bounds.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Browser.setWindowBounds", dict); + } + + partial void ValidateSetContentsSize(int windowId, int? width = null, int? height = null); + /// + /// Set size of the browser contents resizing browser window as necessary. + /// + /// Browser window id. + /// The window contents width in DIP. Assumes current width if omitted.Must be specified if 'height' is omitted. + /// The window contents height in DIP. Assumes current height if omitted.Must be specified if 'width' is omitted. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetContentsSizeAsync(int windowId, int? width = null, int? height = null) + { + ValidateSetContentsSize(windowId, width, height); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("windowId", windowId); + if (width.HasValue) + { + dict.Add("width", width.Value); + } + + if (height.HasValue) + { + dict.Add("height", height.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.setContentsSize", dict); + } + + partial void ValidateSetDockTile(string badgeLabel = null, byte[] image = null); + /// + /// Set dock tile details, platform-specific. + /// + /// badgeLabel + /// Png encoded image. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDockTileAsync(string badgeLabel = null, byte[] image = null) + { + ValidateSetDockTile(badgeLabel, image); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(badgeLabel))) + { + dict.Add("badgeLabel", badgeLabel); + } + + if ((image) != (null)) + { + dict.Add("image", ToBase64String(image)); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.setDockTile", dict); + } + + partial void ValidateExecuteBrowserCommand(CefSharp.DevTools.Browser.BrowserCommandId commandId); + /// + /// Invoke custom browser commands used by telemetry. + /// + /// commandId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ExecuteBrowserCommandAsync(CefSharp.DevTools.Browser.BrowserCommandId commandId) + { + ValidateExecuteBrowserCommand(commandId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("commandId", EnumToString(commandId)); + return _client.ExecuteDevToolsMethodAsync("Browser.executeBrowserCommand", dict); + } + + partial void ValidateAddPrivacySandboxEnrollmentOverride(string url); + /// + /// Allows a site to use privacy sandbox features that require enrollment + /// without the site actually being enrolled. Only supported on page targets. + /// + /// url + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddPrivacySandboxEnrollmentOverrideAsync(string url) + { + ValidateAddPrivacySandboxEnrollmentOverride(url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + return _client.ExecuteDevToolsMethodAsync("Browser.addPrivacySandboxEnrollmentOverride", dict); + } + + partial void ValidateAddPrivacySandboxCoordinatorKeyConfig(CefSharp.DevTools.Browser.PrivacySandboxAPI api, string coordinatorOrigin, string keyConfig, string browserContextId = null); + /// + /// Configures encryption keys used with a given privacy sandbox API to talk + /// to a trusted coordinator. Since this is intended for test automation only, + /// coordinatorOrigin must be a .test domain. No existing coordinator + /// configuration for the origin may exist. + /// + /// api + /// coordinatorOrigin + /// keyConfig + /// BrowserContext to perform the action in. When omitted, default browsercontext is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddPrivacySandboxCoordinatorKeyConfigAsync(CefSharp.DevTools.Browser.PrivacySandboxAPI api, string coordinatorOrigin, string keyConfig, string browserContextId = null) + { + ValidateAddPrivacySandboxCoordinatorKeyConfig(api, coordinatorOrigin, keyConfig, browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("api", EnumToString(api)); + dict.Add("coordinatorOrigin", coordinatorOrigin); + dict.Add("keyConfig", keyConfig); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Browser.addPrivacySandboxCoordinatorKeyConfig", dict); + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// AddRuleResponse + /// + public class AddRuleResponse : DevToolsDomainResponseBase + { + /// + /// rule + /// + [JsonInclude] + [JsonPropertyName("rule")] + public CefSharp.DevTools.CSS.CSSRule Rule + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// CollectClassNamesResponse + /// + public class CollectClassNamesResponse : DevToolsDomainResponseBase + { + /// + /// classNames + /// + [JsonInclude] + [JsonPropertyName("classNames")] + public string[] ClassNames + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// CreateStyleSheetResponse + /// + public class CreateStyleSheetResponse : DevToolsDomainResponseBase + { + /// + /// styleSheetId + /// + [JsonInclude] + [JsonPropertyName("styleSheetId")] + public string StyleSheetId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetBackgroundColorsResponse + /// + public class GetBackgroundColorsResponse : DevToolsDomainResponseBase + { + /// + /// backgroundColors + /// + [JsonInclude] + [JsonPropertyName("backgroundColors")] + public string[] BackgroundColors + { + get; + private set; + } + + /// + /// computedFontSize + /// + [JsonInclude] + [JsonPropertyName("computedFontSize")] + public string ComputedFontSize + { + get; + private set; + } + + /// + /// computedFontWeight + /// + [JsonInclude] + [JsonPropertyName("computedFontWeight")] + public string ComputedFontWeight + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetComputedStyleForNodeResponse + /// + public class GetComputedStyleForNodeResponse : DevToolsDomainResponseBase + { + /// + /// computedStyle + /// + [JsonInclude] + [JsonPropertyName("computedStyle")] + public System.Collections.Generic.IList ComputedStyle + { + get; + private set; + } + + /// + /// extraFields + /// + [JsonInclude] + [JsonPropertyName("extraFields")] + public CefSharp.DevTools.CSS.ComputedStyleExtraFields ExtraFields + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// ResolveValuesResponse + /// + public class ResolveValuesResponse : DevToolsDomainResponseBase + { + /// + /// results + /// + [JsonInclude] + [JsonPropertyName("results")] + public string[] Results + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetLonghandPropertiesResponse + /// + public class GetLonghandPropertiesResponse : DevToolsDomainResponseBase + { + /// + /// longhandProperties + /// + [JsonInclude] + [JsonPropertyName("longhandProperties")] + public System.Collections.Generic.IList LonghandProperties + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetInlineStylesForNodeResponse + /// + public class GetInlineStylesForNodeResponse : DevToolsDomainResponseBase + { + /// + /// inlineStyle + /// + [JsonInclude] + [JsonPropertyName("inlineStyle")] + public CefSharp.DevTools.CSS.CSSStyle InlineStyle + { + get; + private set; + } + + /// + /// attributesStyle + /// + [JsonInclude] + [JsonPropertyName("attributesStyle")] + public CefSharp.DevTools.CSS.CSSStyle AttributesStyle + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetAnimatedStylesForNodeResponse + /// + public class GetAnimatedStylesForNodeResponse : DevToolsDomainResponseBase + { + /// + /// animationStyles + /// + [JsonInclude] + [JsonPropertyName("animationStyles")] + public System.Collections.Generic.IList AnimationStyles + { + get; + private set; + } + + /// + /// transitionsStyle + /// + [JsonInclude] + [JsonPropertyName("transitionsStyle")] + public CefSharp.DevTools.CSS.CSSStyle TransitionsStyle + { + get; + private set; + } + + /// + /// inherited + /// + [JsonInclude] + [JsonPropertyName("inherited")] + public System.Collections.Generic.IList Inherited + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetMatchedStylesForNodeResponse + /// + public class GetMatchedStylesForNodeResponse : DevToolsDomainResponseBase + { + /// + /// inlineStyle + /// + [JsonInclude] + [JsonPropertyName("inlineStyle")] + public CefSharp.DevTools.CSS.CSSStyle InlineStyle + { + get; + private set; + } + + /// + /// attributesStyle + /// + [JsonInclude] + [JsonPropertyName("attributesStyle")] + public CefSharp.DevTools.CSS.CSSStyle AttributesStyle + { + get; + private set; + } + + /// + /// matchedCSSRules + /// + [JsonInclude] + [JsonPropertyName("matchedCSSRules")] + public System.Collections.Generic.IList MatchedCSSRules + { + get; + private set; + } + + /// + /// pseudoElements + /// + [JsonInclude] + [JsonPropertyName("pseudoElements")] + public System.Collections.Generic.IList PseudoElements + { + get; + private set; + } + + /// + /// inherited + /// + [JsonInclude] + [JsonPropertyName("inherited")] + public System.Collections.Generic.IList Inherited + { + get; + private set; + } + + /// + /// inheritedPseudoElements + /// + [JsonInclude] + [JsonPropertyName("inheritedPseudoElements")] + public System.Collections.Generic.IList InheritedPseudoElements + { + get; + private set; + } + + /// + /// cssKeyframesRules + /// + [JsonInclude] + [JsonPropertyName("cssKeyframesRules")] + public System.Collections.Generic.IList CssKeyframesRules + { + get; + private set; + } + + /// + /// cssPositionTryRules + /// + [JsonInclude] + [JsonPropertyName("cssPositionTryRules")] + public System.Collections.Generic.IList CssPositionTryRules + { + get; + private set; + } + + /// + /// activePositionFallbackIndex + /// + [JsonInclude] + [JsonPropertyName("activePositionFallbackIndex")] + public int? ActivePositionFallbackIndex + { + get; + private set; + } + + /// + /// cssPropertyRules + /// + [JsonInclude] + [JsonPropertyName("cssPropertyRules")] + public System.Collections.Generic.IList CssPropertyRules + { + get; + private set; + } + + /// + /// cssPropertyRegistrations + /// + [JsonInclude] + [JsonPropertyName("cssPropertyRegistrations")] + public System.Collections.Generic.IList CssPropertyRegistrations + { + get; + private set; + } + + /// + /// cssAtRules + /// + [JsonInclude] + [JsonPropertyName("cssAtRules")] + public System.Collections.Generic.IList CssAtRules + { + get; + private set; + } + + /// + /// parentLayoutNodeId + /// + [JsonInclude] + [JsonPropertyName("parentLayoutNodeId")] + public int? ParentLayoutNodeId + { + get; + private set; + } + + /// + /// cssFunctionRules + /// + [JsonInclude] + [JsonPropertyName("cssFunctionRules")] + public System.Collections.Generic.IList CssFunctionRules + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetEnvironmentVariablesResponse + /// + public class GetEnvironmentVariablesResponse : DevToolsDomainResponseBase + { + /// + /// environmentVariables + /// + [JsonInclude] + [JsonPropertyName("environmentVariables")] + public object EnvironmentVariables + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetMediaQueriesResponse + /// + public class GetMediaQueriesResponse : DevToolsDomainResponseBase + { + /// + /// medias + /// + [JsonInclude] + [JsonPropertyName("medias")] + public System.Collections.Generic.IList Medias + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetPlatformFontsForNodeResponse + /// + public class GetPlatformFontsForNodeResponse : DevToolsDomainResponseBase + { + /// + /// fonts + /// + [JsonInclude] + [JsonPropertyName("fonts")] + public System.Collections.Generic.IList Fonts + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetStyleSheetTextResponse + /// + public class GetStyleSheetTextResponse : DevToolsDomainResponseBase + { + /// + /// text + /// + [JsonInclude] + [JsonPropertyName("text")] + public string Text + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetLayersForNodeResponse + /// + public class GetLayersForNodeResponse : DevToolsDomainResponseBase + { + /// + /// rootLayer + /// + [JsonInclude] + [JsonPropertyName("rootLayer")] + public CefSharp.DevTools.CSS.CSSLayerData RootLayer + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// GetLocationForSelectorResponse + /// + public class GetLocationForSelectorResponse : DevToolsDomainResponseBase + { + /// + /// ranges + /// + [JsonInclude] + [JsonPropertyName("ranges")] + public System.Collections.Generic.IList Ranges + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// TakeComputedStyleUpdatesResponse + /// + public class TakeComputedStyleUpdatesResponse : DevToolsDomainResponseBase + { + /// + /// nodeIds + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetPropertyRulePropertyNameResponse + /// + public class SetPropertyRulePropertyNameResponse : DevToolsDomainResponseBase + { + /// + /// propertyName + /// + [JsonInclude] + [JsonPropertyName("propertyName")] + public CefSharp.DevTools.CSS.Value PropertyName + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetKeyframeKeyResponse + /// + public class SetKeyframeKeyResponse : DevToolsDomainResponseBase + { + /// + /// keyText + /// + [JsonInclude] + [JsonPropertyName("keyText")] + public CefSharp.DevTools.CSS.Value KeyText + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetMediaTextResponse + /// + public class SetMediaTextResponse : DevToolsDomainResponseBase + { + /// + /// media + /// + [JsonInclude] + [JsonPropertyName("media")] + public CefSharp.DevTools.CSS.CSSMedia Media + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetContainerQueryTextResponse + /// + public class SetContainerQueryTextResponse : DevToolsDomainResponseBase + { + /// + /// containerQuery + /// + [JsonInclude] + [JsonPropertyName("containerQuery")] + public CefSharp.DevTools.CSS.CSSContainerQuery ContainerQuery + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetSupportsTextResponse + /// + public class SetSupportsTextResponse : DevToolsDomainResponseBase + { + /// + /// supports + /// + [JsonInclude] + [JsonPropertyName("supports")] + public CefSharp.DevTools.CSS.CSSSupports Supports + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetScopeTextResponse + /// + public class SetScopeTextResponse : DevToolsDomainResponseBase + { + /// + /// scope + /// + [JsonInclude] + [JsonPropertyName("scope")] + public CefSharp.DevTools.CSS.CSSScope Scope + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetRuleSelectorResponse + /// + public class SetRuleSelectorResponse : DevToolsDomainResponseBase + { + /// + /// selectorList + /// + [JsonInclude] + [JsonPropertyName("selectorList")] + public CefSharp.DevTools.CSS.SelectorList SelectorList + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetStyleSheetTextResponse + /// + public class SetStyleSheetTextResponse : DevToolsDomainResponseBase + { + /// + /// sourceMapURL + /// + [JsonInclude] + [JsonPropertyName("sourceMapURL")] + public string SourceMapURL + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// SetStyleTextsResponse + /// + public class SetStyleTextsResponse : DevToolsDomainResponseBase + { + /// + /// styles + /// + [JsonInclude] + [JsonPropertyName("styles")] + public System.Collections.Generic.IList Styles + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// StopRuleUsageTrackingResponse + /// + public class StopRuleUsageTrackingResponse : DevToolsDomainResponseBase + { + /// + /// ruleUsage + /// + [JsonInclude] + [JsonPropertyName("ruleUsage")] + public System.Collections.Generic.IList RuleUsage + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + /// + /// TakeCoverageDeltaResponse + /// + public class TakeCoverageDeltaResponse : DevToolsDomainResponseBase + { + /// + /// coverage + /// + [JsonInclude] + [JsonPropertyName("coverage")] + public System.Collections.Generic.IList Coverage + { + get; + private set; + } + + /// + /// timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CSS +{ + using System.Linq; + + /// + /// This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) + /// have an associated `id` used in subsequent operations on the related object. Each object type has + /// a specific `id` structure, and those are not interchangeable between objects of different kinds. + /// CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client + /// can also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and + /// subsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods. + /// + public partial class CSSClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// CSS + /// + /// DevToolsClient + public CSSClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded + /// web font. + /// + public event System.EventHandler FontsUpdated + { + add + { + _client.AddEventHandler("CSS.fontsUpdated", value); + } + + remove + { + _client.RemoveEventHandler("CSS.fontsUpdated", value); + } + } + + /// + /// Fires whenever a MediaQuery result changes (for example, after a browser window has been + /// resized.) The current implementation considers only viewport-dependent media features. + /// + public event System.EventHandler MediaQueryResultChanged + { + add + { + _client.AddEventHandler("CSS.mediaQueryResultChanged", value); + } + + remove + { + _client.RemoveEventHandler("CSS.mediaQueryResultChanged", value); + } + } + + /// + /// Fired whenever an active document stylesheet is added. + /// + public event System.EventHandler StyleSheetAdded + { + add + { + _client.AddEventHandler("CSS.styleSheetAdded", value); + } + + remove + { + _client.RemoveEventHandler("CSS.styleSheetAdded", value); + } + } + + /// + /// Fired whenever a stylesheet is changed as a result of the client operation. + /// + public event System.EventHandler StyleSheetChanged + { + add + { + _client.AddEventHandler("CSS.styleSheetChanged", value); + } + + remove + { + _client.RemoveEventHandler("CSS.styleSheetChanged", value); + } + } + + /// + /// Fired whenever an active document stylesheet is removed. + /// + public event System.EventHandler StyleSheetRemoved + { + add + { + _client.AddEventHandler("CSS.styleSheetRemoved", value); + } + + remove + { + _client.RemoveEventHandler("CSS.styleSheetRemoved", value); + } + } + + /// + /// ComputedStyleUpdated + /// + public event System.EventHandler ComputedStyleUpdated + { + add + { + _client.AddEventHandler("CSS.computedStyleUpdated", value); + } + + remove + { + _client.RemoveEventHandler("CSS.computedStyleUpdated", value); + } + } + + partial void ValidateAddRule(string styleSheetId, string ruleText, CefSharp.DevTools.CSS.SourceRange location, int? nodeForPropertySyntaxValidation = null); + /// + /// Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the + /// position specified by `location`. + /// + /// The css style sheet identifier where a new rule should be inserted. + /// The text of a new rule. + /// Text position of a new rule in the target style sheet. + /// NodeId for the DOM node in whose context custom property declarations for registered properties should bevalidated. If omitted, declarations in the new rule text can only be validated statically, which may produceincorrect results if the declaration contains a var() for example. + /// returns System.Threading.Tasks.Task<AddRuleResponse> + public System.Threading.Tasks.Task AddRuleAsync(string styleSheetId, string ruleText, CefSharp.DevTools.CSS.SourceRange location, int? nodeForPropertySyntaxValidation = null) + { + ValidateAddRule(styleSheetId, ruleText, location, nodeForPropertySyntaxValidation); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("ruleText", ruleText); + dict.Add("location", location.ToDictionary()); + if (nodeForPropertySyntaxValidation.HasValue) + { + dict.Add("nodeForPropertySyntaxValidation", nodeForPropertySyntaxValidation.Value); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.addRule", dict); + } + + partial void ValidateCollectClassNames(string styleSheetId); + /// + /// Returns all class names from specified stylesheet. + /// + /// styleSheetId + /// returns System.Threading.Tasks.Task<CollectClassNamesResponse> + public System.Threading.Tasks.Task CollectClassNamesAsync(string styleSheetId) + { + ValidateCollectClassNames(styleSheetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + return _client.ExecuteDevToolsMethodAsync("CSS.collectClassNames", dict); + } + + partial void ValidateCreateStyleSheet(string frameId, bool? force = null); + /// + /// Creates a new special "via-inspector" stylesheet in the frame with given `frameId`. + /// + /// Identifier of the frame where "via-inspector" stylesheet should be created. + /// If true, creates a new stylesheet for every call. If false,returns a stylesheet previously created by a call with force=falsefor the frame's document if it exists or creates a new stylesheet(default: false). + /// returns System.Threading.Tasks.Task<CreateStyleSheetResponse> + public System.Threading.Tasks.Task CreateStyleSheetAsync(string frameId, bool? force = null) + { + ValidateCreateStyleSheet(frameId, force); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + if (force.HasValue) + { + dict.Add("force", force.Value); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.createStyleSheet", dict); + } + + /// + /// Disables the CSS agent for the given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.disable", dict); + } + + /// + /// Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been + /// enabled until the result of this command is received. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.enable", dict); + } + + partial void ValidateForcePseudoState(int nodeId, string[] forcedPseudoClasses); + /// + /// Ensures that the given node will have specified pseudo-classes whenever its style is computed by + /// the browser. + /// + /// The element id for which to force the pseudo state. + /// Element pseudo classes to force when computing the element's style. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ForcePseudoStateAsync(int nodeId, string[] forcedPseudoClasses) + { + ValidateForcePseudoState(nodeId, forcedPseudoClasses); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("forcedPseudoClasses", forcedPseudoClasses); + return _client.ExecuteDevToolsMethodAsync("CSS.forcePseudoState", dict); + } + + partial void ValidateForceStartingStyle(int nodeId, bool forced); + /// + /// Ensures that the given node is in its starting-style state. + /// + /// The element id for which to force the starting-style state. + /// Boolean indicating if this is on or off. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ForceStartingStyleAsync(int nodeId, bool forced) + { + ValidateForceStartingStyle(nodeId, forced); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("forced", forced); + return _client.ExecuteDevToolsMethodAsync("CSS.forceStartingStyle", dict); + } + + partial void ValidateGetBackgroundColors(int nodeId); + /// + /// GetBackgroundColors + /// + /// Id of the node to get background colors for. + /// returns System.Threading.Tasks.Task<GetBackgroundColorsResponse> + public System.Threading.Tasks.Task GetBackgroundColorsAsync(int nodeId) + { + ValidateGetBackgroundColors(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getBackgroundColors", dict); + } + + partial void ValidateGetComputedStyleForNode(int nodeId); + /// + /// Returns the computed style for a DOM node identified by `nodeId`. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetComputedStyleForNodeResponse> + public System.Threading.Tasks.Task GetComputedStyleForNodeAsync(int nodeId) + { + ValidateGetComputedStyleForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getComputedStyleForNode", dict); + } + + partial void ValidateResolveValues(string[] values, int nodeId, string propertyName = null, CefSharp.DevTools.DOM.PseudoType? pseudoType = null, string pseudoIdentifier = null); + /// + /// Resolve the specified values in the context of the provided element. + /// For example, a value of '1em' is evaluated according to the computed + /// 'font-size' of the element and a value 'calc(1px + 2px)' will be + /// resolved to '3px'. + /// If the `propertyName` was specified the `values` are resolved as if + /// they were property's declaration. If a value cannot be parsed according + /// to the provided property syntax, the value is parsed using combined + /// syntax as if null `propertyName` was provided. If the value cannot be + /// resolved even then, return the provided value without any changes. + /// Note: this function currently does not resolve CSS random() function, + /// it returns unmodified random() function parts.` + /// + /// Cascade-dependent keywords (revert/revert-layer) do not work. + /// Id of the node in whose context the expression is evaluated + /// Only longhands and custom property names are accepted. + /// Pseudo element type, only works for pseudo elements that generateelements in the tree, such as ::before and ::after. + /// Pseudo element custom ident. + /// returns System.Threading.Tasks.Task<ResolveValuesResponse> + public System.Threading.Tasks.Task ResolveValuesAsync(string[] values, int nodeId, string propertyName = null, CefSharp.DevTools.DOM.PseudoType? pseudoType = null, string pseudoIdentifier = null) + { + ValidateResolveValues(values, nodeId, propertyName, pseudoType, pseudoIdentifier); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("values", values); + dict.Add("nodeId", nodeId); + if (!(string.IsNullOrEmpty(propertyName))) + { + dict.Add("propertyName", propertyName); + } + + if (pseudoType.HasValue) + { + dict.Add("pseudoType", EnumToString(pseudoType)); + } + + if (!(string.IsNullOrEmpty(pseudoIdentifier))) + { + dict.Add("pseudoIdentifier", pseudoIdentifier); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.resolveValues", dict); + } + + partial void ValidateGetLonghandProperties(string shorthandName, string value); + /// + /// GetLonghandProperties + /// + /// shorthandName + /// value + /// returns System.Threading.Tasks.Task<GetLonghandPropertiesResponse> + public System.Threading.Tasks.Task GetLonghandPropertiesAsync(string shorthandName, string value) + { + ValidateGetLonghandProperties(shorthandName, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("shorthandName", shorthandName); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("CSS.getLonghandProperties", dict); + } + + partial void ValidateGetInlineStylesForNode(int nodeId); + /// + /// Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM + /// attributes) for a DOM node identified by `nodeId`. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetInlineStylesForNodeResponse> + public System.Threading.Tasks.Task GetInlineStylesForNodeAsync(int nodeId) + { + ValidateGetInlineStylesForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getInlineStylesForNode", dict); + } + + partial void ValidateGetAnimatedStylesForNode(int nodeId); + /// + /// Returns the styles coming from animations & transitions + /// including the animation & transition styles coming from inheritance chain. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetAnimatedStylesForNodeResponse> + public System.Threading.Tasks.Task GetAnimatedStylesForNodeAsync(int nodeId) + { + ValidateGetAnimatedStylesForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getAnimatedStylesForNode", dict); + } + + partial void ValidateGetMatchedStylesForNode(int nodeId); + /// + /// Returns requested styles for a DOM node identified by `nodeId`. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetMatchedStylesForNodeResponse> + public System.Threading.Tasks.Task GetMatchedStylesForNodeAsync(int nodeId) + { + ValidateGetMatchedStylesForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getMatchedStylesForNode", dict); + } + + /// + /// Returns the values of the default UA-defined environment variables used in env() + /// + /// returns System.Threading.Tasks.Task<GetEnvironmentVariablesResponse> + public System.Threading.Tasks.Task GetEnvironmentVariablesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.getEnvironmentVariables", dict); + } + + /// + /// Returns all media queries parsed by the rendering engine. + /// + /// returns System.Threading.Tasks.Task<GetMediaQueriesResponse> + public System.Threading.Tasks.Task GetMediaQueriesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.getMediaQueries", dict); + } + + partial void ValidateGetPlatformFontsForNode(int nodeId); + /// + /// Requests information about platform fonts which we used to render child TextNodes in the given + /// node. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetPlatformFontsForNodeResponse> + public System.Threading.Tasks.Task GetPlatformFontsForNodeAsync(int nodeId) + { + ValidateGetPlatformFontsForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getPlatformFontsForNode", dict); + } + + partial void ValidateGetStyleSheetText(string styleSheetId); + /// + /// Returns the current textual content for a stylesheet. + /// + /// styleSheetId + /// returns System.Threading.Tasks.Task<GetStyleSheetTextResponse> + public System.Threading.Tasks.Task GetStyleSheetTextAsync(string styleSheetId) + { + ValidateGetStyleSheetText(styleSheetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + return _client.ExecuteDevToolsMethodAsync("CSS.getStyleSheetText", dict); + } + + partial void ValidateGetLayersForNode(int nodeId); + /// + /// Returns all layers parsed by the rendering engine for the tree scope of a node. + /// Given a DOM element identified by nodeId, getLayersForNode returns the root + /// layer for the nearest ancestor document or shadow root. The layer root contains + /// the full layer tree for the tree scope and their ordering. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<GetLayersForNodeResponse> + public System.Threading.Tasks.Task GetLayersForNodeAsync(int nodeId) + { + ValidateGetLayersForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("CSS.getLayersForNode", dict); + } + + partial void ValidateGetLocationForSelector(string styleSheetId, string selectorText); + /// + /// Given a CSS selector text and a style sheet ID, getLocationForSelector + /// returns an array of locations of the CSS selector in the style sheet. + /// + /// styleSheetId + /// selectorText + /// returns System.Threading.Tasks.Task<GetLocationForSelectorResponse> + public System.Threading.Tasks.Task GetLocationForSelectorAsync(string styleSheetId, string selectorText) + { + ValidateGetLocationForSelector(styleSheetId, selectorText); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("selectorText", selectorText); + return _client.ExecuteDevToolsMethodAsync("CSS.getLocationForSelector", dict); + } + + partial void ValidateTrackComputedStyleUpdatesForNode(int? nodeId = null); + /// + /// Starts tracking the given node for the computed style updates + /// and whenever the computed style is updated for node, it queues + /// a `computedStyleUpdated` event with throttling. + /// There can only be 1 node tracked for computed style updates + /// so passing a new node id removes tracking from the previous node. + /// Pass `undefined` to disable tracking. + /// + /// nodeId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackComputedStyleUpdatesForNodeAsync(int? nodeId = null) + { + ValidateTrackComputedStyleUpdatesForNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.trackComputedStyleUpdatesForNode", dict); + } + + partial void ValidateTrackComputedStyleUpdates(System.Collections.Generic.IList propertiesToTrack); + /// + /// Starts tracking the given computed styles for updates. The specified array of properties + /// replaces the one previously specified. Pass empty array to disable tracking. + /// Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified. + /// The changes to computed style properties are only tracked for nodes pushed to the front-end + /// by the DOM agent. If no changes to the tracked properties occur after the node has been pushed + /// to the front-end, no updates will be issued for the node. + /// + /// propertiesToTrack + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackComputedStyleUpdatesAsync(System.Collections.Generic.IList propertiesToTrack) + { + ValidateTrackComputedStyleUpdates(propertiesToTrack); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("propertiesToTrack", propertiesToTrack.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("CSS.trackComputedStyleUpdates", dict); + } + + /// + /// Polls the next batch of computed style updates. + /// + /// returns System.Threading.Tasks.Task<TakeComputedStyleUpdatesResponse> + public System.Threading.Tasks.Task TakeComputedStyleUpdatesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.takeComputedStyleUpdates", dict); + } + + partial void ValidateSetEffectivePropertyValueForNode(int nodeId, string propertyName, string value); + /// + /// Find a rule with the given active property for the given node and set the new value for this + /// property + /// + /// The element id for which to set property. + /// propertyName + /// value + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEffectivePropertyValueForNodeAsync(int nodeId, string propertyName, string value) + { + ValidateSetEffectivePropertyValueForNode(nodeId, propertyName, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("propertyName", propertyName); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("CSS.setEffectivePropertyValueForNode", dict); + } + + partial void ValidateSetPropertyRulePropertyName(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string propertyName); + /// + /// Modifies the property rule property name. + /// + /// styleSheetId + /// range + /// propertyName + /// returns System.Threading.Tasks.Task<SetPropertyRulePropertyNameResponse> + public System.Threading.Tasks.Task SetPropertyRulePropertyNameAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string propertyName) + { + ValidateSetPropertyRulePropertyName(styleSheetId, range, propertyName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("propertyName", propertyName); + return _client.ExecuteDevToolsMethodAsync("CSS.setPropertyRulePropertyName", dict); + } + + partial void ValidateSetKeyframeKey(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string keyText); + /// + /// Modifies the keyframe rule key text. + /// + /// styleSheetId + /// range + /// keyText + /// returns System.Threading.Tasks.Task<SetKeyframeKeyResponse> + public System.Threading.Tasks.Task SetKeyframeKeyAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string keyText) + { + ValidateSetKeyframeKey(styleSheetId, range, keyText); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("keyText", keyText); + return _client.ExecuteDevToolsMethodAsync("CSS.setKeyframeKey", dict); + } + + partial void ValidateSetMediaText(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text); + /// + /// Modifies the rule selector. + /// + /// styleSheetId + /// range + /// text + /// returns System.Threading.Tasks.Task<SetMediaTextResponse> + public System.Threading.Tasks.Task SetMediaTextAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text) + { + ValidateSetMediaText(styleSheetId, range, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setMediaText", dict); + } + + partial void ValidateSetContainerQueryText(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text); + /// + /// Modifies the expression of a container query. + /// + /// styleSheetId + /// range + /// text + /// returns System.Threading.Tasks.Task<SetContainerQueryTextResponse> + public System.Threading.Tasks.Task SetContainerQueryTextAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text) + { + ValidateSetContainerQueryText(styleSheetId, range, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setContainerQueryText", dict); + } + + partial void ValidateSetSupportsText(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text); + /// + /// Modifies the expression of a supports at-rule. + /// + /// styleSheetId + /// range + /// text + /// returns System.Threading.Tasks.Task<SetSupportsTextResponse> + public System.Threading.Tasks.Task SetSupportsTextAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text) + { + ValidateSetSupportsText(styleSheetId, range, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setSupportsText", dict); + } + + partial void ValidateSetScopeText(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text); + /// + /// Modifies the expression of a scope at-rule. + /// + /// styleSheetId + /// range + /// text + /// returns System.Threading.Tasks.Task<SetScopeTextResponse> + public System.Threading.Tasks.Task SetScopeTextAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string text) + { + ValidateSetScopeText(styleSheetId, range, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setScopeText", dict); + } + + partial void ValidateSetRuleSelector(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string selector); + /// + /// Modifies the rule selector. + /// + /// styleSheetId + /// range + /// selector + /// returns System.Threading.Tasks.Task<SetRuleSelectorResponse> + public System.Threading.Tasks.Task SetRuleSelectorAsync(string styleSheetId, CefSharp.DevTools.CSS.SourceRange range, string selector) + { + ValidateSetRuleSelector(styleSheetId, range, selector); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("range", range.ToDictionary()); + dict.Add("selector", selector); + return _client.ExecuteDevToolsMethodAsync("CSS.setRuleSelector", dict); + } + + partial void ValidateSetStyleSheetText(string styleSheetId, string text); + /// + /// Sets the new stylesheet text. + /// + /// styleSheetId + /// text + /// returns System.Threading.Tasks.Task<SetStyleSheetTextResponse> + public System.Threading.Tasks.Task SetStyleSheetTextAsync(string styleSheetId, string text) + { + ValidateSetStyleSheetText(styleSheetId, text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("styleSheetId", styleSheetId); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("CSS.setStyleSheetText", dict); + } + + partial void ValidateSetStyleTexts(System.Collections.Generic.IList edits, int? nodeForPropertySyntaxValidation = null); + /// + /// Applies specified style edits one after another in the given order. + /// + /// edits + /// NodeId for the DOM node in whose context custom property declarations for registered properties should bevalidated. If omitted, declarations in the new rule text can only be validated statically, which may produceincorrect results if the declaration contains a var() for example. + /// returns System.Threading.Tasks.Task<SetStyleTextsResponse> + public System.Threading.Tasks.Task SetStyleTextsAsync(System.Collections.Generic.IList edits, int? nodeForPropertySyntaxValidation = null) + { + ValidateSetStyleTexts(edits, nodeForPropertySyntaxValidation); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("edits", edits.Select(x => x.ToDictionary())); + if (nodeForPropertySyntaxValidation.HasValue) + { + dict.Add("nodeForPropertySyntaxValidation", nodeForPropertySyntaxValidation.Value); + } + + return _client.ExecuteDevToolsMethodAsync("CSS.setStyleTexts", dict); + } + + /// + /// Enables the selector recording. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartRuleUsageTrackingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.startRuleUsageTracking", dict); + } + + /// + /// Stop tracking rule usage and return the list of rules that were used since last call to + /// `takeCoverageDelta` (or since start of coverage instrumentation). + /// + /// returns System.Threading.Tasks.Task<StopRuleUsageTrackingResponse> + public System.Threading.Tasks.Task StopRuleUsageTrackingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.stopRuleUsageTracking", dict); + } + + /// + /// Obtain list of rules that became used since last call to this method (or since start of coverage + /// instrumentation). + /// + /// returns System.Threading.Tasks.Task<TakeCoverageDeltaResponse> + public System.Threading.Tasks.Task TakeCoverageDeltaAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("CSS.takeCoverageDelta", dict); + } + + partial void ValidateSetLocalFontsEnabled(bool enabled); + /// + /// Enables/disables rendering of local CSS fonts (enabled by default). + /// + /// Whether rendering of local fonts is enabled. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetLocalFontsEnabledAsync(bool enabled) + { + ValidateSetLocalFontsEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("CSS.setLocalFontsEnabled", dict); + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + /// + /// RequestCacheNamesResponse + /// + public class RequestCacheNamesResponse : DevToolsDomainResponseBase + { + /// + /// caches + /// + [JsonInclude] + [JsonPropertyName("caches")] + public System.Collections.Generic.IList Caches + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + /// + /// RequestCachedResponseResponse + /// + public class RequestCachedResponseResponse : DevToolsDomainResponseBase + { + /// + /// response + /// + [JsonInclude] + [JsonPropertyName("response")] + public CefSharp.DevTools.CacheStorage.CachedResponse Response + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + /// + /// RequestEntriesResponse + /// + public class RequestEntriesResponse : DevToolsDomainResponseBase + { + /// + /// cacheDataEntries + /// + [JsonInclude] + [JsonPropertyName("cacheDataEntries")] + public System.Collections.Generic.IList CacheDataEntries + { + get; + private set; + } + + /// + /// returnCount + /// + [JsonInclude] + [JsonPropertyName("returnCount")] + public double ReturnCount + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.CacheStorage +{ + using System.Linq; + + /// + /// CacheStorage + /// + public partial class CacheStorageClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// CacheStorage + /// + /// DevToolsClient + public CacheStorageClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateDeleteCache(string cacheId); + /// + /// Deletes a cache. + /// + /// Id of cache for deletion. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteCacheAsync(string cacheId) + { + ValidateDeleteCache(cacheId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheId", cacheId); + return _client.ExecuteDevToolsMethodAsync("CacheStorage.deleteCache", dict); + } + + partial void ValidateDeleteEntry(string cacheId, string request); + /// + /// Deletes a cache entry. + /// + /// Id of cache where the entry will be deleted. + /// URL spec of the request. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteEntryAsync(string cacheId, string request) + { + ValidateDeleteEntry(cacheId, request); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheId", cacheId); + dict.Add("request", request); + return _client.ExecuteDevToolsMethodAsync("CacheStorage.deleteEntry", dict); + } + + partial void ValidateRequestCacheNames(string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Requests cache names. + /// + /// At least and at most one of securityOrigin, storageKey, storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<RequestCacheNamesResponse> + public System.Threading.Tasks.Task RequestCacheNamesAsync(string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateRequestCacheNames(securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("CacheStorage.requestCacheNames", dict); + } + + partial void ValidateRequestCachedResponse(string cacheId, string requestURL, System.Collections.Generic.IList requestHeaders); + /// + /// Fetches cache entry. + /// + /// Id of cache that contains the entry. + /// URL spec of the request. + /// headers of the request. + /// returns System.Threading.Tasks.Task<RequestCachedResponseResponse> + public System.Threading.Tasks.Task RequestCachedResponseAsync(string cacheId, string requestURL, System.Collections.Generic.IList requestHeaders) + { + ValidateRequestCachedResponse(cacheId, requestURL, requestHeaders); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheId", cacheId); + dict.Add("requestURL", requestURL); + dict.Add("requestHeaders", requestHeaders.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("CacheStorage.requestCachedResponse", dict); + } + + partial void ValidateRequestEntries(string cacheId, int? skipCount = null, int? pageSize = null, string pathFilter = null); + /// + /// Requests data from cache. + /// + /// ID of cache to get entries from. + /// Number of records to skip. + /// Number of records to fetch. + /// If present, only return the entries containing this substring in the path + /// returns System.Threading.Tasks.Task<RequestEntriesResponse> + public System.Threading.Tasks.Task RequestEntriesAsync(string cacheId, int? skipCount = null, int? pageSize = null, string pathFilter = null) + { + ValidateRequestEntries(cacheId, skipCount, pageSize, pathFilter); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheId", cacheId); + if (skipCount.HasValue) + { + dict.Add("skipCount", skipCount.Value); + } + + if (pageSize.HasValue) + { + dict.Add("pageSize", pageSize.Value); + } + + if (!(string.IsNullOrEmpty(pathFilter))) + { + dict.Add("pathFilter", pathFilter); + } + + return _client.ExecuteDevToolsMethodAsync("CacheStorage.requestEntries", dict); + } + } +} + +namespace CefSharp.DevTools.Cast +{ + using System.Linq; + + /// + /// A domain for interacting with Cast, Presentation API, and Remote Playback API + /// functionalities. + /// + public partial class CastClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Cast + /// + /// DevToolsClient + public CastClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// This is fired whenever the list of available sinks changes. A sink is a + /// device or a software surface that you can cast to. + /// + public event System.EventHandler SinksUpdated + { + add + { + _client.AddEventHandler("Cast.sinksUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Cast.sinksUpdated", value); + } + } + + /// + /// This is fired whenever the outstanding issue/error message changes. + /// |issueMessage| is empty if there is no issue. + /// + public event System.EventHandler IssueUpdated + { + add + { + _client.AddEventHandler("Cast.issueUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Cast.issueUpdated", value); + } + } + + partial void ValidateEnable(string presentationUrl = null); + /// + /// Starts observing for sinks that can be used for tab mirroring, and if set, + /// sinks compatible with |presentationUrl| as well. When sinks are found, a + /// |sinksUpdated| event is fired. + /// Also starts observing for issue messages. When an issue is added or removed, + /// an |issueUpdated| event is fired. + /// + /// presentationUrl + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(string presentationUrl = null) + { + ValidateEnable(presentationUrl); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(presentationUrl))) + { + dict.Add("presentationUrl", presentationUrl); + } + + return _client.ExecuteDevToolsMethodAsync("Cast.enable", dict); + } + + /// + /// Stops observing for sinks and issues. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Cast.disable", dict); + } + + partial void ValidateSetSinkToUse(string sinkName); + /// + /// Sets a sink to be used when the web page requests the browser to choose a + /// sink via Presentation API, Remote Playback API, or Cast SDK. + /// + /// sinkName + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSinkToUseAsync(string sinkName) + { + ValidateSetSinkToUse(sinkName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sinkName", sinkName); + return _client.ExecuteDevToolsMethodAsync("Cast.setSinkToUse", dict); + } + + partial void ValidateStartDesktopMirroring(string sinkName); + /// + /// Starts mirroring the desktop to the sink. + /// + /// sinkName + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartDesktopMirroringAsync(string sinkName) + { + ValidateStartDesktopMirroring(sinkName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sinkName", sinkName); + return _client.ExecuteDevToolsMethodAsync("Cast.startDesktopMirroring", dict); + } + + partial void ValidateStartTabMirroring(string sinkName); + /// + /// Starts mirroring the tab to the sink. + /// + /// sinkName + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartTabMirroringAsync(string sinkName) + { + ValidateStartTabMirroring(sinkName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sinkName", sinkName); + return _client.ExecuteDevToolsMethodAsync("Cast.startTabMirroring", dict); + } + + partial void ValidateStopCasting(string sinkName); + /// + /// Stops the active Cast session on the sink. + /// + /// sinkName + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopCastingAsync(string sinkName) + { + ValidateStopCasting(sinkName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sinkName", sinkName); + return _client.ExecuteDevToolsMethodAsync("Cast.stopCasting", dict); + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// CollectClassNamesFromSubtreeResponse + /// + public class CollectClassNamesFromSubtreeResponse : DevToolsDomainResponseBase + { + /// + /// classNames + /// + [JsonInclude] + [JsonPropertyName("classNames")] + public string[] ClassNames + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// CopyToResponse + /// + public class CopyToResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// DescribeNodeResponse + /// + public class DescribeNodeResponse : DevToolsDomainResponseBase + { + /// + /// node + /// + [JsonInclude] + [JsonPropertyName("node")] + public CefSharp.DevTools.DOM.Node Node + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetAttributesResponse + /// + public class GetAttributesResponse : DevToolsDomainResponseBase + { + /// + /// attributes + /// + [JsonInclude] + [JsonPropertyName("attributes")] + public string[] Attributes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetBoxModelResponse + /// + public class GetBoxModelResponse : DevToolsDomainResponseBase + { + /// + /// model + /// + [JsonInclude] + [JsonPropertyName("model")] + public CefSharp.DevTools.DOM.BoxModel Model + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetContentQuadsResponse + /// + public class GetContentQuadsResponse : DevToolsDomainResponseBase + { + /// + /// quads + /// + [JsonInclude] + [JsonPropertyName("quads")] + public double[] Quads + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetDocumentResponse + /// + public class GetDocumentResponse : DevToolsDomainResponseBase + { + /// + /// root + /// + [JsonInclude] + [JsonPropertyName("root")] + public CefSharp.DevTools.DOM.Node Root + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetNodesForSubtreeByStyleResponse + /// + public class GetNodesForSubtreeByStyleResponse : DevToolsDomainResponseBase + { + /// + /// nodeIds + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetNodeForLocationResponse + /// + public class GetNodeForLocationResponse : DevToolsDomainResponseBase + { + /// + /// backendNodeId + /// + [JsonInclude] + [JsonPropertyName("backendNodeId")] + public int BackendNodeId + { + get; + private set; + } + + /// + /// frameId + /// + [JsonInclude] + [JsonPropertyName("frameId")] + public string FrameId + { + get; + private set; + } + + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int? NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetOuterHTMLResponse + /// + public class GetOuterHTMLResponse : DevToolsDomainResponseBase + { + /// + /// outerHTML + /// + [JsonInclude] + [JsonPropertyName("outerHTML")] + public string OuterHTML + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetRelayoutBoundaryResponse + /// + public class GetRelayoutBoundaryResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetSearchResultsResponse + /// + public class GetSearchResultsResponse : DevToolsDomainResponseBase + { + /// + /// nodeIds + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// MoveToResponse + /// + public class MoveToResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// PerformSearchResponse + /// + public class PerformSearchResponse : DevToolsDomainResponseBase + { + /// + /// searchId + /// + [JsonInclude] + [JsonPropertyName("searchId")] + public string SearchId + { + get; + private set; + } + + /// + /// resultCount + /// + [JsonInclude] + [JsonPropertyName("resultCount")] + public int ResultCount + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// PushNodeByPathToFrontendResponse + /// + public class PushNodeByPathToFrontendResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// PushNodesByBackendIdsToFrontendResponse + /// + public class PushNodesByBackendIdsToFrontendResponse : DevToolsDomainResponseBase + { + /// + /// nodeIds + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// QuerySelectorResponse + /// + public class QuerySelectorResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// QuerySelectorAllResponse + /// + public class QuerySelectorAllResponse : DevToolsDomainResponseBase + { + /// + /// nodeIds + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetTopLayerElementsResponse + /// + public class GetTopLayerElementsResponse : DevToolsDomainResponseBase + { + /// + /// nodeIds + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetElementByRelationResponse + /// + public class GetElementByRelationResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// RequestNodeResponse + /// + public class RequestNodeResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// ResolveNodeResponse + /// + public class ResolveNodeResponse : DevToolsDomainResponseBase + { + /// + /// object + /// + [JsonInclude] + [JsonPropertyName("object")] + public CefSharp.DevTools.Runtime.RemoteObject Object + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetNodeStackTracesResponse + /// + public class GetNodeStackTracesResponse : DevToolsDomainResponseBase + { + /// + /// creation + /// + [JsonInclude] + [JsonPropertyName("creation")] + public CefSharp.DevTools.Runtime.StackTrace Creation + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetFileInfoResponse + /// + public class GetFileInfoResponse : DevToolsDomainResponseBase + { + /// + /// path + /// + [JsonInclude] + [JsonPropertyName("path")] + public string Path + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetDetachedDomNodesResponse + /// + public class GetDetachedDomNodesResponse : DevToolsDomainResponseBase + { + /// + /// detachedNodes + /// + [JsonInclude] + [JsonPropertyName("detachedNodes")] + public System.Collections.Generic.IList DetachedNodes + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// SetNodeNameResponse + /// + public class SetNodeNameResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetFrameOwnerResponse + /// + public class GetFrameOwnerResponse : DevToolsDomainResponseBase + { + /// + /// backendNodeId + /// + [JsonInclude] + [JsonPropertyName("backendNodeId")] + public int BackendNodeId + { + get; + private set; + } + + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int? NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetContainerForNodeResponse + /// + public class GetContainerForNodeResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int? NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetQueryingDescendantsForContainerResponse + /// + public class GetQueryingDescendantsForContainerResponse : DevToolsDomainResponseBase + { + /// + /// nodeIds + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// GetAnchorElementResponse + /// + public class GetAnchorElementResponse : DevToolsDomainResponseBase + { + /// + /// nodeId + /// + [JsonInclude] + [JsonPropertyName("nodeId")] + public int NodeId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + /// + /// ForceShowPopoverResponse + /// + public class ForceShowPopoverResponse : DevToolsDomainResponseBase + { + /// + /// nodeIds + /// + [JsonInclude] + [JsonPropertyName("nodeIds")] + public int[] NodeIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOM +{ + using System.Linq; + + /// + /// Whether to include whitespaces in the children array of returned Nodes. + /// + public enum EnableIncludeWhitespace + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// all + /// + [JsonPropertyName("all")] + All + } + + /// + /// Type of relation to get. + /// + public enum GetElementByRelationRelation + { + /// + /// PopoverTarget + /// + [JsonPropertyName("PopoverTarget")] + PopoverTarget, + /// + /// InterestTarget + /// + [JsonPropertyName("InterestTarget")] + InterestTarget, + /// + /// CommandFor + /// + [JsonPropertyName("CommandFor")] + CommandFor + } + + /// + /// This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object + /// that has an `id`. This `id` can be used to get additional information on the Node, resolve it into + /// the JavaScript object wrapper, etc. It is important that client receives DOM events only for the + /// nodes that are known to the client. Backend keeps track of the nodes that were sent to the client + /// and never sends the same node twice. It is client's responsibility to collect information about + /// the nodes that were sent to the client. Note that `iframe` owner elements will return + /// corresponding document elements as their child nodes. + /// + public partial class DOMClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DOM + /// + /// DevToolsClient + public DOMClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when `Element`'s attribute is modified. + /// + public event System.EventHandler AttributeModified + { + add + { + _client.AddEventHandler("DOM.attributeModified", value); + } + + remove + { + _client.RemoveEventHandler("DOM.attributeModified", value); + } + } + + /// + /// Fired when `Element`'s adoptedStyleSheets are modified. + /// + public event System.EventHandler AdoptedStyleSheetsModified + { + add + { + _client.AddEventHandler("DOM.adoptedStyleSheetsModified", value); + } + + remove + { + _client.RemoveEventHandler("DOM.adoptedStyleSheetsModified", value); + } + } + + /// + /// Fired when `Element`'s attribute is removed. + /// + public event System.EventHandler AttributeRemoved + { + add + { + _client.AddEventHandler("DOM.attributeRemoved", value); + } + + remove + { + _client.RemoveEventHandler("DOM.attributeRemoved", value); + } + } + + /// + /// Mirrors `DOMCharacterDataModified` event. + /// + public event System.EventHandler CharacterDataModified + { + add + { + _client.AddEventHandler("DOM.characterDataModified", value); + } + + remove + { + _client.RemoveEventHandler("DOM.characterDataModified", value); + } + } + + /// + /// Fired when `Container`'s child node count has changed. + /// + public event System.EventHandler ChildNodeCountUpdated + { + add + { + _client.AddEventHandler("DOM.childNodeCountUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.childNodeCountUpdated", value); + } + } + + /// + /// Mirrors `DOMNodeInserted` event. + /// + public event System.EventHandler ChildNodeInserted + { + add + { + _client.AddEventHandler("DOM.childNodeInserted", value); + } + + remove + { + _client.RemoveEventHandler("DOM.childNodeInserted", value); + } + } + + /// + /// Mirrors `DOMNodeRemoved` event. + /// + public event System.EventHandler ChildNodeRemoved + { + add + { + _client.AddEventHandler("DOM.childNodeRemoved", value); + } + + remove + { + _client.RemoveEventHandler("DOM.childNodeRemoved", value); + } + } + + /// + /// Called when distribution is changed. + /// + public event System.EventHandler DistributedNodesUpdated + { + add + { + _client.AddEventHandler("DOM.distributedNodesUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.distributedNodesUpdated", value); + } + } + + /// + /// Fired when `Document` has been totally updated. Node ids are no longer valid. + /// + public event System.EventHandler DocumentUpdated + { + add + { + _client.AddEventHandler("DOM.documentUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.documentUpdated", value); + } + } + + /// + /// Fired when `Element`'s inline style is modified via a CSS property modification. + /// + public event System.EventHandler InlineStyleInvalidated + { + add + { + _client.AddEventHandler("DOM.inlineStyleInvalidated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.inlineStyleInvalidated", value); + } + } + + /// + /// Called when a pseudo element is added to an element. + /// + public event System.EventHandler PseudoElementAdded + { + add + { + _client.AddEventHandler("DOM.pseudoElementAdded", value); + } + + remove + { + _client.RemoveEventHandler("DOM.pseudoElementAdded", value); + } + } + + /// + /// Called when top layer elements are changed. + /// + public event System.EventHandler TopLayerElementsUpdated + { + add + { + _client.AddEventHandler("DOM.topLayerElementsUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.topLayerElementsUpdated", value); + } + } + + /// + /// Fired when a node's scrollability state changes. + /// + public event System.EventHandler ScrollableFlagUpdated + { + add + { + _client.AddEventHandler("DOM.scrollableFlagUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.scrollableFlagUpdated", value); + } + } + + /// + /// Fired when a node's starting styles changes. + /// + public event System.EventHandler AffectedByStartingStylesFlagUpdated + { + add + { + _client.AddEventHandler("DOM.affectedByStartingStylesFlagUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOM.affectedByStartingStylesFlagUpdated", value); + } + } + + /// + /// Called when a pseudo element is removed from an element. + /// + public event System.EventHandler PseudoElementRemoved + { + add + { + _client.AddEventHandler("DOM.pseudoElementRemoved", value); + } + + remove + { + _client.RemoveEventHandler("DOM.pseudoElementRemoved", value); + } + } + + /// + /// Fired when backend wants to provide client with the missing DOM structure. This happens upon + /// most of the calls requesting node ids. + /// + public event System.EventHandler SetChildNodes + { + add + { + _client.AddEventHandler("DOM.setChildNodes", value); + } + + remove + { + _client.RemoveEventHandler("DOM.setChildNodes", value); + } + } + + /// + /// Called when shadow root is popped from the element. + /// + public event System.EventHandler ShadowRootPopped + { + add + { + _client.AddEventHandler("DOM.shadowRootPopped", value); + } + + remove + { + _client.RemoveEventHandler("DOM.shadowRootPopped", value); + } + } + + /// + /// Called when shadow root is pushed into the element. + /// + public event System.EventHandler ShadowRootPushed + { + add + { + _client.AddEventHandler("DOM.shadowRootPushed", value); + } + + remove + { + _client.RemoveEventHandler("DOM.shadowRootPushed", value); + } + } + + partial void ValidateCollectClassNamesFromSubtree(int nodeId); + /// + /// Collects class names for the node with given id and all of it's child nodes. + /// + /// Id of the node to collect class names. + /// returns System.Threading.Tasks.Task<CollectClassNamesFromSubtreeResponse> + public System.Threading.Tasks.Task CollectClassNamesFromSubtreeAsync(int nodeId) + { + ValidateCollectClassNamesFromSubtree(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.collectClassNamesFromSubtree", dict); + } + + partial void ValidateCopyTo(int nodeId, int targetNodeId, int? insertBeforeNodeId = null); + /// + /// Creates a deep copy of the specified node and places it into the target container before the + /// given anchor. + /// + /// Id of the node to copy. + /// Id of the element to drop the copy into. + /// Drop the copy before this node (if absent, the copy becomes the last child of`targetNodeId`). + /// returns System.Threading.Tasks.Task<CopyToResponse> + public System.Threading.Tasks.Task CopyToAsync(int nodeId, int targetNodeId, int? insertBeforeNodeId = null) + { + ValidateCopyTo(nodeId, targetNodeId, insertBeforeNodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("targetNodeId", targetNodeId); + if (insertBeforeNodeId.HasValue) + { + dict.Add("insertBeforeNodeId", insertBeforeNodeId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.copyTo", dict); + } + + partial void ValidateDescribeNode(int? nodeId = null, int? backendNodeId = null, string objectId = null, int? depth = null, bool? pierce = null); + /// + /// Describes node given its id, does not require domain to be enabled. Does not start tracking any + /// objects, can be used for automation. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for theentire subtree or provide an integer larger than 0. + /// Whether or not iframes and shadow roots should be traversed when returning the subtree(default is false). + /// returns System.Threading.Tasks.Task<DescribeNodeResponse> + public System.Threading.Tasks.Task DescribeNodeAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, int? depth = null, bool? pierce = null) + { + ValidateDescribeNode(nodeId, backendNodeId, objectId, depth, pierce); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.describeNode", dict); + } + + partial void ValidateScrollIntoViewIfNeeded(int? nodeId = null, int? backendNodeId = null, string objectId = null, CefSharp.DevTools.DOM.Rect rect = null); + /// + /// Scrolls the specified rect of the given node into view if not already visible. + /// Note: exactly one between nodeId, backendNodeId and objectId should be passed + /// to identify the node. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// The rect to be scrolled into view, relative to the node's border box, in CSS pixels.When omitted, center of the node will be used, similar to Element.scrollIntoView. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ScrollIntoViewIfNeededAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, CefSharp.DevTools.DOM.Rect rect = null) + { + ValidateScrollIntoViewIfNeeded(nodeId, backendNodeId, objectId, rect); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if ((rect) != (null)) + { + dict.Add("rect", rect.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.scrollIntoViewIfNeeded", dict); + } + + /// + /// Disables DOM agent for the given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.disable", dict); + } + + partial void ValidateDiscardSearchResults(string searchId); + /// + /// Discards search results from the session with the given id. `getSearchResults` should no longer + /// be called for that search. + /// + /// Unique search session identifier. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DiscardSearchResultsAsync(string searchId) + { + ValidateDiscardSearchResults(searchId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("searchId", searchId); + return _client.ExecuteDevToolsMethodAsync("DOM.discardSearchResults", dict); + } + + partial void ValidateEnable(CefSharp.DevTools.DOM.EnableIncludeWhitespace? includeWhitespace = null); + /// + /// Enables DOM agent for the given page. + /// + /// Whether to include whitespaces in the children array of returned Nodes. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(CefSharp.DevTools.DOM.EnableIncludeWhitespace? includeWhitespace = null) + { + ValidateEnable(includeWhitespace); + var dict = new System.Collections.Generic.Dictionary(); + if (includeWhitespace.HasValue) + { + dict.Add("includeWhitespace", EnumToString(includeWhitespace)); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.enable", dict); + } + + partial void ValidateFocus(int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Focuses the given element. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task FocusAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateFocus(nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.focus", dict); + } + + partial void ValidateGetAttributes(int nodeId); + /// + /// Returns attributes for the specified node. + /// + /// Id of the node to retrieve attributes for. + /// returns System.Threading.Tasks.Task<GetAttributesResponse> + public System.Threading.Tasks.Task GetAttributesAsync(int nodeId) + { + ValidateGetAttributes(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.getAttributes", dict); + } + + partial void ValidateGetBoxModel(int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Returns boxes for the given node. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<GetBoxModelResponse> + public System.Threading.Tasks.Task GetBoxModelAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateGetBoxModel(nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getBoxModel", dict); + } + + partial void ValidateGetContentQuads(int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Returns quads that describe node position on the page. This method + /// might return multiple quads for inline nodes. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<GetContentQuadsResponse> + public System.Threading.Tasks.Task GetContentQuadsAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateGetContentQuads(nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getContentQuads", dict); + } + + partial void ValidateGetDocument(int? depth = null, bool? pierce = null); + /// + /// Returns the root DOM node (and optionally the subtree) to the caller. + /// Implicitly enables the DOM domain events for the current target. + /// + /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for theentire subtree or provide an integer larger than 0. + /// Whether or not iframes and shadow roots should be traversed when returning the subtree(default is false). + /// returns System.Threading.Tasks.Task<GetDocumentResponse> + public System.Threading.Tasks.Task GetDocumentAsync(int? depth = null, bool? pierce = null) + { + ValidateGetDocument(depth, pierce); + var dict = new System.Collections.Generic.Dictionary(); + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getDocument", dict); + } + + partial void ValidateGetNodesForSubtreeByStyle(int nodeId, System.Collections.Generic.IList computedStyles, bool? pierce = null); + /// + /// Finds nodes with a given computed style in a subtree. + /// + /// Node ID pointing to the root of a subtree. + /// The style to filter nodes by (includes nodes if any of properties matches). + /// Whether or not iframes and shadow roots in the same target should be traversed when returning theresults (default is false). + /// returns System.Threading.Tasks.Task<GetNodesForSubtreeByStyleResponse> + public System.Threading.Tasks.Task GetNodesForSubtreeByStyleAsync(int nodeId, System.Collections.Generic.IList computedStyles, bool? pierce = null) + { + ValidateGetNodesForSubtreeByStyle(nodeId, computedStyles, pierce); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("computedStyles", computedStyles.Select(x => x.ToDictionary())); + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getNodesForSubtreeByStyle", dict); + } + + partial void ValidateGetNodeForLocation(int x, int y, bool? includeUserAgentShadowDOM = null, bool? ignorePointerEventsNone = null); + /// + /// Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is + /// either returned or not. + /// + /// X coordinate. + /// Y coordinate. + /// False to skip to the nearest non-UA shadow root ancestor (default: false). + /// Whether to ignore pointer-events: none on elements and hit test them. + /// returns System.Threading.Tasks.Task<GetNodeForLocationResponse> + public System.Threading.Tasks.Task GetNodeForLocationAsync(int x, int y, bool? includeUserAgentShadowDOM = null, bool? ignorePointerEventsNone = null) + { + ValidateGetNodeForLocation(x, y, includeUserAgentShadowDOM, ignorePointerEventsNone); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + if (includeUserAgentShadowDOM.HasValue) + { + dict.Add("includeUserAgentShadowDOM", includeUserAgentShadowDOM.Value); + } + + if (ignorePointerEventsNone.HasValue) + { + dict.Add("ignorePointerEventsNone", ignorePointerEventsNone.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getNodeForLocation", dict); + } + + partial void ValidateGetOuterHTML(int? nodeId = null, int? backendNodeId = null, string objectId = null, bool? includeShadowDOM = null); + /// + /// Returns node's HTML markup. + /// + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// Include all shadow roots. Equals to false if not specified. + /// returns System.Threading.Tasks.Task<GetOuterHTMLResponse> + public System.Threading.Tasks.Task GetOuterHTMLAsync(int? nodeId = null, int? backendNodeId = null, string objectId = null, bool? includeShadowDOM = null) + { + ValidateGetOuterHTML(nodeId, backendNodeId, objectId, includeShadowDOM); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (includeShadowDOM.HasValue) + { + dict.Add("includeShadowDOM", includeShadowDOM.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getOuterHTML", dict); + } + + partial void ValidateGetRelayoutBoundary(int nodeId); + /// + /// Returns the id of the nearest ancestor that is a relayout boundary. + /// + /// Id of the node. + /// returns System.Threading.Tasks.Task<GetRelayoutBoundaryResponse> + public System.Threading.Tasks.Task GetRelayoutBoundaryAsync(int nodeId) + { + ValidateGetRelayoutBoundary(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.getRelayoutBoundary", dict); + } + + partial void ValidateGetSearchResults(string searchId, int fromIndex, int toIndex); + /// + /// Returns search results from given `fromIndex` to given `toIndex` from the search with the given + /// identifier. + /// + /// Unique search session identifier. + /// Start index of the search result to be returned. + /// End index of the search result to be returned. + /// returns System.Threading.Tasks.Task<GetSearchResultsResponse> + public System.Threading.Tasks.Task GetSearchResultsAsync(string searchId, int fromIndex, int toIndex) + { + ValidateGetSearchResults(searchId, fromIndex, toIndex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("searchId", searchId); + dict.Add("fromIndex", fromIndex); + dict.Add("toIndex", toIndex); + return _client.ExecuteDevToolsMethodAsync("DOM.getSearchResults", dict); + } + + /// + /// Hides any highlight. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HideHighlightAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.hideHighlight", dict); + } + + /// + /// Highlights DOM node. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightNodeAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.highlightNode", dict); + } + + /// + /// Highlights given rectangle. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightRectAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.highlightRect", dict); + } + + /// + /// Marks last undoable state. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task MarkUndoableStateAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.markUndoableState", dict); + } + + partial void ValidateMoveTo(int nodeId, int targetNodeId, int? insertBeforeNodeId = null); + /// + /// Moves node into the new container, places it before the given anchor. + /// + /// Id of the node to move. + /// Id of the element to drop the moved node into. + /// Drop node before this one (if absent, the moved node becomes the last child of`targetNodeId`). + /// returns System.Threading.Tasks.Task<MoveToResponse> + public System.Threading.Tasks.Task MoveToAsync(int nodeId, int targetNodeId, int? insertBeforeNodeId = null) + { + ValidateMoveTo(nodeId, targetNodeId, insertBeforeNodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("targetNodeId", targetNodeId); + if (insertBeforeNodeId.HasValue) + { + dict.Add("insertBeforeNodeId", insertBeforeNodeId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.moveTo", dict); + } + + partial void ValidatePerformSearch(string query, bool? includeUserAgentShadowDOM = null); + /// + /// Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or + /// `cancelSearch` to end this search session. + /// + /// Plain text or query selector or XPath search query. + /// True to search in user agent shadow DOM. + /// returns System.Threading.Tasks.Task<PerformSearchResponse> + public System.Threading.Tasks.Task PerformSearchAsync(string query, bool? includeUserAgentShadowDOM = null) + { + ValidatePerformSearch(query, includeUserAgentShadowDOM); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("query", query); + if (includeUserAgentShadowDOM.HasValue) + { + dict.Add("includeUserAgentShadowDOM", includeUserAgentShadowDOM.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.performSearch", dict); + } + + partial void ValidatePushNodeByPathToFrontend(string path); + /// + /// Requests that the node is sent to the caller given its path. // FIXME, use XPath + /// + /// Path to node in the proprietary format. + /// returns System.Threading.Tasks.Task<PushNodeByPathToFrontendResponse> + public System.Threading.Tasks.Task PushNodeByPathToFrontendAsync(string path) + { + ValidatePushNodeByPathToFrontend(path); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("path", path); + return _client.ExecuteDevToolsMethodAsync("DOM.pushNodeByPathToFrontend", dict); + } + + partial void ValidatePushNodesByBackendIdsToFrontend(int[] backendNodeIds); + /// + /// Requests that a batch of nodes is sent to the caller given their backend node ids. + /// + /// The array of backend node ids. + /// returns System.Threading.Tasks.Task<PushNodesByBackendIdsToFrontendResponse> + public System.Threading.Tasks.Task PushNodesByBackendIdsToFrontendAsync(int[] backendNodeIds) + { + ValidatePushNodesByBackendIdsToFrontend(backendNodeIds); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("backendNodeIds", backendNodeIds); + return _client.ExecuteDevToolsMethodAsync("DOM.pushNodesByBackendIdsToFrontend", dict); + } + + partial void ValidateQuerySelector(int nodeId, string selector); + /// + /// Executes `querySelector` on a given node. + /// + /// Id of the node to query upon. + /// Selector string. + /// returns System.Threading.Tasks.Task<QuerySelectorResponse> + public System.Threading.Tasks.Task QuerySelectorAsync(int nodeId, string selector) + { + ValidateQuerySelector(nodeId, selector); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("selector", selector); + return _client.ExecuteDevToolsMethodAsync("DOM.querySelector", dict); + } + + partial void ValidateQuerySelectorAll(int nodeId, string selector); + /// + /// Executes `querySelectorAll` on a given node. + /// + /// Id of the node to query upon. + /// Selector string. + /// returns System.Threading.Tasks.Task<QuerySelectorAllResponse> + public System.Threading.Tasks.Task QuerySelectorAllAsync(int nodeId, string selector) + { + ValidateQuerySelectorAll(nodeId, selector); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("selector", selector); + return _client.ExecuteDevToolsMethodAsync("DOM.querySelectorAll", dict); + } + + /// + /// Returns NodeIds of current top layer elements. + /// Top layer is rendered closest to the user within a viewport, therefore its elements always + /// appear on top of all other content. + /// + /// returns System.Threading.Tasks.Task<GetTopLayerElementsResponse> + public System.Threading.Tasks.Task GetTopLayerElementsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.getTopLayerElements", dict); + } + + partial void ValidateGetElementByRelation(int nodeId, CefSharp.DevTools.DOM.GetElementByRelationRelation relation); + /// + /// Returns the NodeId of the matched element according to certain relations. + /// + /// Id of the node from which to query the relation. + /// Type of relation to get. + /// returns System.Threading.Tasks.Task<GetElementByRelationResponse> + public System.Threading.Tasks.Task GetElementByRelationAsync(int nodeId, CefSharp.DevTools.DOM.GetElementByRelationRelation relation) + { + ValidateGetElementByRelation(nodeId, relation); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("relation", EnumToString(relation)); + return _client.ExecuteDevToolsMethodAsync("DOM.getElementByRelation", dict); + } + + /// + /// Re-does the last undone action. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RedoAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.redo", dict); + } + + partial void ValidateRemoveAttribute(int nodeId, string name); + /// + /// Removes attribute with given name from an element with given id. + /// + /// Id of the element to remove attribute from. + /// Name of the attribute to remove. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveAttributeAsync(int nodeId, string name) + { + ValidateRemoveAttribute(nodeId, name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("name", name); + return _client.ExecuteDevToolsMethodAsync("DOM.removeAttribute", dict); + } + + partial void ValidateRemoveNode(int nodeId); + /// + /// Removes node with given id. + /// + /// Id of the node to remove. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveNodeAsync(int nodeId) + { + ValidateRemoveNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.removeNode", dict); + } + + partial void ValidateRequestChildNodes(int nodeId, int? depth = null, bool? pierce = null); + /// + /// Requests that children of the node with given id are returned to the caller in form of + /// `setChildNodes` events where not only immediate children are retrieved, but all children down to + /// the specified depth. + /// + /// Id of the node to get children for. + /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for theentire subtree or provide an integer larger than 0. + /// Whether or not iframes and shadow roots should be traversed when returning the sub-tree(default is false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RequestChildNodesAsync(int nodeId, int? depth = null, bool? pierce = null) + { + ValidateRequestChildNodes(nodeId, depth, pierce); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.requestChildNodes", dict); + } + + partial void ValidateRequestNode(string objectId); + /// + /// Requests that the node is sent to the caller given the JavaScript node object reference. All + /// nodes that form the path from the node to the root are also sent to the client as a series of + /// `setChildNodes` notifications. + /// + /// JavaScript object id to convert into node. + /// returns System.Threading.Tasks.Task<RequestNodeResponse> + public System.Threading.Tasks.Task RequestNodeAsync(string objectId) + { + ValidateRequestNode(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("DOM.requestNode", dict); + } + + partial void ValidateResolveNode(int? nodeId = null, int? backendNodeId = null, string objectGroup = null, int? executionContextId = null); + /// + /// Resolves the JavaScript node object for a given NodeId or BackendNodeId. + /// + /// Id of the node to resolve. + /// Backend identifier of the node to resolve. + /// Symbolic group name that can be used to release multiple objects. + /// Execution context in which to resolve the node. + /// returns System.Threading.Tasks.Task<ResolveNodeResponse> + public System.Threading.Tasks.Task ResolveNodeAsync(int? nodeId = null, int? backendNodeId = null, string objectGroup = null, int? executionContextId = null) + { + ValidateResolveNode(nodeId, backendNodeId, objectGroup, executionContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.resolveNode", dict); + } + + partial void ValidateSetAttributeValue(int nodeId, string name, string value); + /// + /// Sets attribute for an element with given id. + /// + /// Id of the element to set attribute for. + /// Attribute name. + /// Attribute value. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttributeValueAsync(int nodeId, string name, string value) + { + ValidateSetAttributeValue(nodeId, name, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("name", name); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("DOM.setAttributeValue", dict); + } + + partial void ValidateSetAttributesAsText(int nodeId, string text, string name = null); + /// + /// Sets attributes on element with given id. This method is useful when user edits some existing + /// attribute value and types in several attribute name/value pairs. + /// + /// Id of the element to set attributes for. + /// Text with a number of attributes. Will parse this text using HTML parser. + /// Attribute name to replace with new attributes derived from text in case text parsedsuccessfully. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttributesAsTextAsync(int nodeId, string text, string name = null) + { + ValidateSetAttributesAsText(nodeId, text, name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("text", text); + if (!(string.IsNullOrEmpty(name))) + { + dict.Add("name", name); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.setAttributesAsText", dict); + } + + partial void ValidateSetFileInputFiles(string[] files, int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Sets files for the given file input element. + /// + /// Array of file paths to set. + /// Identifier of the node. + /// Identifier of the backend node. + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetFileInputFilesAsync(string[] files, int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateSetFileInputFiles(files, nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("files", files); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.setFileInputFiles", dict); + } + + partial void ValidateSetNodeStackTracesEnabled(bool enable); + /// + /// Sets if stack traces should be captured for Nodes. See `Node.getNodeStackTraces`. Default is disabled. + /// + /// Enable or disable. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetNodeStackTracesEnabledAsync(bool enable) + { + ValidateSetNodeStackTracesEnabled(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("DOM.setNodeStackTracesEnabled", dict); + } + + partial void ValidateGetNodeStackTraces(int nodeId); + /// + /// Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation. + /// + /// Id of the node to get stack traces for. + /// returns System.Threading.Tasks.Task<GetNodeStackTracesResponse> + public System.Threading.Tasks.Task GetNodeStackTracesAsync(int nodeId) + { + ValidateGetNodeStackTraces(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.getNodeStackTraces", dict); + } + + partial void ValidateGetFileInfo(string objectId); + /// + /// Returns file information for the given + /// File wrapper. + /// + /// JavaScript object id of the node wrapper. + /// returns System.Threading.Tasks.Task<GetFileInfoResponse> + public System.Threading.Tasks.Task GetFileInfoAsync(string objectId) + { + ValidateGetFileInfo(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("DOM.getFileInfo", dict); + } + + /// + /// Returns list of detached nodes + /// + /// returns System.Threading.Tasks.Task<GetDetachedDomNodesResponse> + public System.Threading.Tasks.Task GetDetachedDomNodesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.getDetachedDomNodes", dict); + } + + partial void ValidateSetInspectedNode(int nodeId); + /// + /// Enables console to refer to the node with given id via $x (see Command Line API for more details + /// $x functions). + /// + /// DOM node id to be accessible by means of $x command line API. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInspectedNodeAsync(int nodeId) + { + ValidateSetInspectedNode(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.setInspectedNode", dict); + } + + partial void ValidateSetNodeName(int nodeId, string name); + /// + /// Sets node name for a node with given id. + /// + /// Id of the node to set name for. + /// New node's name. + /// returns System.Threading.Tasks.Task<SetNodeNameResponse> + public System.Threading.Tasks.Task SetNodeNameAsync(int nodeId, string name) + { + ValidateSetNodeName(nodeId, name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("name", name); + return _client.ExecuteDevToolsMethodAsync("DOM.setNodeName", dict); + } + + partial void ValidateSetNodeValue(int nodeId, string value); + /// + /// Sets node value for a node with given id. + /// + /// Id of the node to set value for. + /// New node's value. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetNodeValueAsync(int nodeId, string value) + { + ValidateSetNodeValue(nodeId, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("DOM.setNodeValue", dict); + } + + partial void ValidateSetOuterHTML(int nodeId, string outerHTML); + /// + /// Sets node HTML markup, returns new node id. + /// + /// Id of the node to set markup for. + /// Outer HTML markup to set. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetOuterHTMLAsync(int nodeId, string outerHTML) + { + ValidateSetOuterHTML(nodeId, outerHTML); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("outerHTML", outerHTML); + return _client.ExecuteDevToolsMethodAsync("DOM.setOuterHTML", dict); + } + + /// + /// Undoes the last performed action. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UndoAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOM.undo", dict); + } + + partial void ValidateGetFrameOwner(string frameId); + /// + /// Returns iframe node that owns iframe with the given domain. + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetFrameOwnerResponse> + public System.Threading.Tasks.Task GetFrameOwnerAsync(string frameId) + { + ValidateGetFrameOwner(frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + return _client.ExecuteDevToolsMethodAsync("DOM.getFrameOwner", dict); + } + + partial void ValidateGetContainerForNode(int nodeId, string containerName = null, CefSharp.DevTools.DOM.PhysicalAxes? physicalAxes = null, CefSharp.DevTools.DOM.LogicalAxes? logicalAxes = null, bool? queriesScrollState = null, bool? queriesAnchored = null); + /// + /// Returns the query container of the given node based on container query + /// conditions: containerName, physical and logical axes, and whether it queries + /// scroll-state or anchored elements. If no axes are provided and + /// queriesScrollState is false, the style container is returned, which is the + /// direct parent or the closest element with a matching container-name. + /// + /// nodeId + /// containerName + /// physicalAxes + /// logicalAxes + /// queriesScrollState + /// queriesAnchored + /// returns System.Threading.Tasks.Task<GetContainerForNodeResponse> + public System.Threading.Tasks.Task GetContainerForNodeAsync(int nodeId, string containerName = null, CefSharp.DevTools.DOM.PhysicalAxes? physicalAxes = null, CefSharp.DevTools.DOM.LogicalAxes? logicalAxes = null, bool? queriesScrollState = null, bool? queriesAnchored = null) + { + ValidateGetContainerForNode(nodeId, containerName, physicalAxes, logicalAxes, queriesScrollState, queriesAnchored); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + if (!(string.IsNullOrEmpty(containerName))) + { + dict.Add("containerName", containerName); + } + + if (physicalAxes.HasValue) + { + dict.Add("physicalAxes", EnumToString(physicalAxes)); + } + + if (logicalAxes.HasValue) + { + dict.Add("logicalAxes", EnumToString(logicalAxes)); + } + + if (queriesScrollState.HasValue) + { + dict.Add("queriesScrollState", queriesScrollState.Value); + } + + if (queriesAnchored.HasValue) + { + dict.Add("queriesAnchored", queriesAnchored.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getContainerForNode", dict); + } + + partial void ValidateGetQueryingDescendantsForContainer(int nodeId); + /// + /// Returns the descendants of a container query container that have + /// container queries against this container. + /// + /// Id of the container node to find querying descendants from. + /// returns System.Threading.Tasks.Task<GetQueryingDescendantsForContainerResponse> + public System.Threading.Tasks.Task GetQueryingDescendantsForContainerAsync(int nodeId) + { + ValidateGetQueryingDescendantsForContainer(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("DOM.getQueryingDescendantsForContainer", dict); + } + + partial void ValidateGetAnchorElement(int nodeId, string anchorSpecifier = null); + /// + /// Returns the target anchor element of the given anchor query according to + /// https://www.w3.org/TR/css-anchor-position-1/#target. + /// + /// Id of the positioned element from which to find the anchor. + /// An optional anchor specifier, as defined inhttps://www.w3.org/TR/css-anchor-position-1/#anchor-specifier.If not provided, it will return the implicit anchor element forthe given positioned element. + /// returns System.Threading.Tasks.Task<GetAnchorElementResponse> + public System.Threading.Tasks.Task GetAnchorElementAsync(int nodeId, string anchorSpecifier = null) + { + ValidateGetAnchorElement(nodeId, anchorSpecifier); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + if (!(string.IsNullOrEmpty(anchorSpecifier))) + { + dict.Add("anchorSpecifier", anchorSpecifier); + } + + return _client.ExecuteDevToolsMethodAsync("DOM.getAnchorElement", dict); + } + + partial void ValidateForceShowPopover(int nodeId, bool enable); + /// + /// When enabling, this API force-opens the popover identified by nodeId + /// and keeps it open until disabled. + /// + /// Id of the popover HTMLElement + /// If true, opens the popover and keeps it open. If false, closes thepopover if it was previously force-opened. + /// returns System.Threading.Tasks.Task<ForceShowPopoverResponse> + public System.Threading.Tasks.Task ForceShowPopoverAsync(int nodeId, bool enable) + { + ValidateForceShowPopover(nodeId, enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("DOM.forceShowPopover", dict); + } + } +} + +namespace CefSharp.DevTools.DOMDebugger +{ + /// + /// GetEventListenersResponse + /// + public class GetEventListenersResponse : DevToolsDomainResponseBase + { + /// + /// listeners + /// + [JsonInclude] + [JsonPropertyName("listeners")] + public System.Collections.Generic.IList Listeners + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOMDebugger +{ + using System.Linq; + + /// + /// DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript + /// execution will stop on these operations as if there was a regular breakpoint set. + /// + public partial class DOMDebuggerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DOMDebugger + /// + /// DevToolsClient + public DOMDebuggerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateGetEventListeners(string objectId, int? depth = null, bool? pierce = null); + /// + /// Returns event listeners of the given object. + /// + /// Identifier of the object to return listeners for. + /// The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for theentire subtree or provide an integer larger than 0. + /// Whether or not iframes and shadow roots should be traversed when returning the subtree(default is false). Reports listeners for all contexts if pierce is enabled. + /// returns System.Threading.Tasks.Task<GetEventListenersResponse> + public System.Threading.Tasks.Task GetEventListenersAsync(string objectId, int? depth = null, bool? pierce = null) + { + ValidateGetEventListeners(objectId, depth, pierce); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + if (depth.HasValue) + { + dict.Add("depth", depth.Value); + } + + if (pierce.HasValue) + { + dict.Add("pierce", pierce.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.getEventListeners", dict); + } + + partial void ValidateRemoveDOMBreakpoint(int nodeId, CefSharp.DevTools.DOMDebugger.DOMBreakpointType type); + /// + /// Removes DOM breakpoint that was set using `setDOMBreakpoint`. + /// + /// Identifier of the node to remove breakpoint from. + /// Type of the breakpoint to remove. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveDOMBreakpointAsync(int nodeId, CefSharp.DevTools.DOMDebugger.DOMBreakpointType type) + { + ValidateRemoveDOMBreakpoint(nodeId, type); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("type", EnumToString(type)); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.removeDOMBreakpoint", dict); + } + + partial void ValidateRemoveEventListenerBreakpoint(string eventName, string targetName = null); + /// + /// Removes breakpoint on particular DOM event. + /// + /// Event name. + /// EventTarget interface name. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveEventListenerBreakpointAsync(string eventName, string targetName = null) + { + ValidateRemoveEventListenerBreakpoint(eventName, targetName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventName", eventName); + if (!(string.IsNullOrEmpty(targetName))) + { + dict.Add("targetName", targetName); + } + + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.removeEventListenerBreakpoint", dict); + } + + partial void ValidateRemoveXHRBreakpoint(string url); + /// + /// Removes breakpoint from XMLHttpRequest. + /// + /// Resource URL substring. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveXHRBreakpointAsync(string url) + { + ValidateRemoveXHRBreakpoint(url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.removeXHRBreakpoint", dict); + } + + partial void ValidateSetBreakOnCSPViolation(CefSharp.DevTools.DOMDebugger.CSPViolationType[] violationTypes); + /// + /// Sets breakpoint on particular CSP violations. + /// + /// CSP Violations to stop upon. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBreakOnCSPViolationAsync(CefSharp.DevTools.DOMDebugger.CSPViolationType[] violationTypes) + { + ValidateSetBreakOnCSPViolation(violationTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("violationTypes", EnumToString(violationTypes)); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.setBreakOnCSPViolation", dict); + } + + partial void ValidateSetDOMBreakpoint(int nodeId, CefSharp.DevTools.DOMDebugger.DOMBreakpointType type); + /// + /// Sets breakpoint on particular operation with DOM. + /// + /// Identifier of the node to set breakpoint on. + /// Type of the operation to stop upon. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDOMBreakpointAsync(int nodeId, CefSharp.DevTools.DOMDebugger.DOMBreakpointType type) + { + ValidateSetDOMBreakpoint(nodeId, type); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + dict.Add("type", EnumToString(type)); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.setDOMBreakpoint", dict); + } + + partial void ValidateSetEventListenerBreakpoint(string eventName, string targetName = null); + /// + /// Sets breakpoint on particular DOM event. + /// + /// DOM Event name to stop on (any DOM event will do). + /// EventTarget interface name to stop on. If equal to `"*"` or not provided, will stop on anyEventTarget. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEventListenerBreakpointAsync(string eventName, string targetName = null) + { + ValidateSetEventListenerBreakpoint(eventName, targetName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventName", eventName); + if (!(string.IsNullOrEmpty(targetName))) + { + dict.Add("targetName", targetName); + } + + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.setEventListenerBreakpoint", dict); + } + + partial void ValidateSetXHRBreakpoint(string url); + /// + /// Sets breakpoint on XMLHttpRequest. + /// + /// Resource URL substring. All XHRs having this substring in the URL will get stopped upon. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetXHRBreakpointAsync(string url) + { + ValidateSetXHRBreakpoint(url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + return _client.ExecuteDevToolsMethodAsync("DOMDebugger.setXHRBreakpoint", dict); + } + } +} + +namespace CefSharp.DevTools.DOMSnapshot +{ + /// + /// CaptureSnapshotResponse + /// + public class CaptureSnapshotResponse : DevToolsDomainResponseBase + { + /// + /// documents + /// + [JsonInclude] + [JsonPropertyName("documents")] + public System.Collections.Generic.IList Documents + { + get; + private set; + } + + /// + /// strings + /// + [JsonInclude] + [JsonPropertyName("strings")] + public string[] Strings + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOMSnapshot +{ + using System.Linq; + + /// + /// This domain facilitates obtaining document snapshots with DOM, layout, and style information. + /// + public partial class DOMSnapshotClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DOMSnapshot + /// + /// DevToolsClient + public DOMSnapshotClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Disables DOM snapshot agent for the given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOMSnapshot.disable", dict); + } + + /// + /// Enables DOM snapshot agent for the given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOMSnapshot.enable", dict); + } + + partial void ValidateCaptureSnapshot(string[] computedStyles, bool? includePaintOrder = null, bool? includeDOMRects = null, bool? includeBlendedBackgroundColors = null, bool? includeTextColorOpacities = null); + /// + /// Returns a document snapshot, including the full DOM tree of the root node (including iframes, + /// template contents, and imported documents) in a flattened array, as well as layout and + /// white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is + /// flattened. + /// + /// Whitelist of computed styles to return. + /// Whether to include layout object paint orders into the snapshot. + /// Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot + /// Whether to include blended background colors in the snapshot (default: false).Blended background color is achieved by blending background colors of all elementsthat overlap with the current element. + /// Whether to include text color opacity in the snapshot (default: false).An element might have the opacity property set that affects the text color of the element.The final text color opacity is computed based on the opacity of all overlapping elements. + /// returns System.Threading.Tasks.Task<CaptureSnapshotResponse> + public System.Threading.Tasks.Task CaptureSnapshotAsync(string[] computedStyles, bool? includePaintOrder = null, bool? includeDOMRects = null, bool? includeBlendedBackgroundColors = null, bool? includeTextColorOpacities = null) + { + ValidateCaptureSnapshot(computedStyles, includePaintOrder, includeDOMRects, includeBlendedBackgroundColors, includeTextColorOpacities); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("computedStyles", computedStyles); + if (includePaintOrder.HasValue) + { + dict.Add("includePaintOrder", includePaintOrder.Value); + } + + if (includeDOMRects.HasValue) + { + dict.Add("includeDOMRects", includeDOMRects.Value); + } + + if (includeBlendedBackgroundColors.HasValue) + { + dict.Add("includeBlendedBackgroundColors", includeBlendedBackgroundColors.Value); + } + + if (includeTextColorOpacities.HasValue) + { + dict.Add("includeTextColorOpacities", includeTextColorOpacities.Value); + } + + return _client.ExecuteDevToolsMethodAsync("DOMSnapshot.captureSnapshot", dict); + } + } +} + +namespace CefSharp.DevTools.DOMStorage +{ + /// + /// GetDOMStorageItemsResponse + /// + public class GetDOMStorageItemsResponse : DevToolsDomainResponseBase + { + /// + /// entries + /// + [JsonInclude] + [JsonPropertyName("entries")] + public string[] Entries + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.DOMStorage +{ + using System.Linq; + + /// + /// Query and modify DOM storage. + /// + public partial class DOMStorageClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DOMStorage + /// + /// DevToolsClient + public DOMStorageClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// DomStorageItemAdded + /// + public event System.EventHandler DomStorageItemAdded + { + add + { + _client.AddEventHandler("DOMStorage.domStorageItemAdded", value); + } + + remove + { + _client.RemoveEventHandler("DOMStorage.domStorageItemAdded", value); + } + } + + /// + /// DomStorageItemRemoved + /// + public event System.EventHandler DomStorageItemRemoved + { + add + { + _client.AddEventHandler("DOMStorage.domStorageItemRemoved", value); + } + + remove + { + _client.RemoveEventHandler("DOMStorage.domStorageItemRemoved", value); + } + } + + /// + /// DomStorageItemUpdated + /// + public event System.EventHandler DomStorageItemUpdated + { + add + { + _client.AddEventHandler("DOMStorage.domStorageItemUpdated", value); + } + + remove + { + _client.RemoveEventHandler("DOMStorage.domStorageItemUpdated", value); + } + } + + /// + /// DomStorageItemsCleared + /// + public event System.EventHandler DomStorageItemsCleared + { + add + { + _client.AddEventHandler("DOMStorage.domStorageItemsCleared", value); + } + + remove + { + _client.RemoveEventHandler("DOMStorage.domStorageItemsCleared", value); + } + } + + partial void ValidateClear(CefSharp.DevTools.DOMStorage.StorageId storageId); + /// + /// Clear + /// + /// storageId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearAsync(CefSharp.DevTools.DOMStorage.StorageId storageId) + { + ValidateClear(storageId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageId", storageId.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("DOMStorage.clear", dict); + } + + /// + /// Disables storage tracking, prevents storage events from being sent to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOMStorage.disable", dict); + } + + /// + /// Enables storage tracking, storage events will now be delivered to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DOMStorage.enable", dict); + } + + partial void ValidateGetDOMStorageItems(CefSharp.DevTools.DOMStorage.StorageId storageId); + /// + /// GetDOMStorageItems + /// + /// storageId + /// returns System.Threading.Tasks.Task<GetDOMStorageItemsResponse> + public System.Threading.Tasks.Task GetDOMStorageItemsAsync(CefSharp.DevTools.DOMStorage.StorageId storageId) + { + ValidateGetDOMStorageItems(storageId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageId", storageId.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("DOMStorage.getDOMStorageItems", dict); + } + + partial void ValidateRemoveDOMStorageItem(CefSharp.DevTools.DOMStorage.StorageId storageId, string key); + /// + /// RemoveDOMStorageItem + /// + /// storageId + /// key + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveDOMStorageItemAsync(CefSharp.DevTools.DOMStorage.StorageId storageId, string key) + { + ValidateRemoveDOMStorageItem(storageId, key); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageId", storageId.ToDictionary()); + dict.Add("key", key); + return _client.ExecuteDevToolsMethodAsync("DOMStorage.removeDOMStorageItem", dict); + } + + partial void ValidateSetDOMStorageItem(CefSharp.DevTools.DOMStorage.StorageId storageId, string key, string value); + /// + /// SetDOMStorageItem + /// + /// storageId + /// key + /// value + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDOMStorageItemAsync(CefSharp.DevTools.DOMStorage.StorageId storageId, string key, string value) + { + ValidateSetDOMStorageItem(storageId, key, value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageId", storageId.ToDictionary()); + dict.Add("key", key); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("DOMStorage.setDOMStorageItem", dict); + } + } +} + +namespace CefSharp.DevTools.DeviceAccess +{ + using System.Linq; + + /// + /// DeviceAccess + /// + public partial class DeviceAccessClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DeviceAccess + /// + /// DevToolsClient + public DeviceAccessClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// A device request opened a user prompt to select a device. Respond with the + /// selectPrompt or cancelPrompt command. + /// + public event System.EventHandler DeviceRequestPrompted + { + add + { + _client.AddEventHandler("DeviceAccess.deviceRequestPrompted", value); + } + + remove + { + _client.RemoveEventHandler("DeviceAccess.deviceRequestPrompted", value); + } + } + + /// + /// Enable events in this domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DeviceAccess.enable", dict); + } + + /// + /// Disable events in this domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DeviceAccess.disable", dict); + } + + partial void ValidateSelectPrompt(string id, string deviceId); + /// + /// Select a device in response to a DeviceAccess.deviceRequestPrompted event. + /// + /// id + /// deviceId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SelectPromptAsync(string id, string deviceId) + { + ValidateSelectPrompt(id, deviceId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("deviceId", deviceId); + return _client.ExecuteDevToolsMethodAsync("DeviceAccess.selectPrompt", dict); + } + + partial void ValidateCancelPrompt(string id); + /// + /// Cancel a prompt in response to a DeviceAccess.deviceRequestPrompted event. + /// + /// id + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CancelPromptAsync(string id) + { + ValidateCancelPrompt(id); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + return _client.ExecuteDevToolsMethodAsync("DeviceAccess.cancelPrompt", dict); + } + } +} + +namespace CefSharp.DevTools.DeviceOrientation +{ + using System.Linq; + + /// + /// DeviceOrientation + /// + public partial class DeviceOrientationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// DeviceOrientation + /// + /// DevToolsClient + public DeviceOrientationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Clears the overridden Device Orientation. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDeviceOrientationOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("DeviceOrientation.clearDeviceOrientationOverride", dict); + } + + partial void ValidateSetDeviceOrientationOverride(double alpha, double beta, double gamma); + /// + /// Overrides the Device Orientation. + /// + /// Mock alpha + /// Mock beta + /// Mock gamma + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDeviceOrientationOverrideAsync(double alpha, double beta, double gamma) + { + ValidateSetDeviceOrientationOverride(alpha, beta, gamma); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("alpha", alpha); + dict.Add("beta", beta); + dict.Add("gamma", gamma); + return _client.ExecuteDevToolsMethodAsync("DeviceOrientation.setDeviceOrientationOverride", dict); + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// GetOverriddenSensorInformationResponse + /// + public class GetOverriddenSensorInformationResponse : DevToolsDomainResponseBase + { + /// + /// requestedSamplingFrequency + /// + [JsonInclude] + [JsonPropertyName("requestedSamplingFrequency")] + public double RequestedSamplingFrequency + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// SetVirtualTimePolicyResponse + /// + public class SetVirtualTimePolicyResponse : DevToolsDomainResponseBase + { + /// + /// virtualTimeTicksBase + /// + [JsonInclude] + [JsonPropertyName("virtualTimeTicksBase")] + public double VirtualTimeTicksBase + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// GetScreenInfosResponse + /// + public class GetScreenInfosResponse : DevToolsDomainResponseBase + { + /// + /// screenInfos + /// + [JsonInclude] + [JsonPropertyName("screenInfos")] + public System.Collections.Generic.IList ScreenInfos + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + /// + /// AddScreenResponse + /// + public class AddScreenResponse : DevToolsDomainResponseBase + { + /// + /// screenInfo + /// + [JsonInclude] + [JsonPropertyName("screenInfo")] + public CefSharp.DevTools.Emulation.ScreenInfo ScreenInfo + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Emulation +{ + using System.Linq; + + /// + /// Touch/gesture events configuration. Default: current platform. + /// + public enum SetEmitTouchEventsForMouseConfiguration + { + /// + /// mobile + /// + [JsonPropertyName("mobile")] + Mobile, + /// + /// desktop + /// + [JsonPropertyName("desktop")] + Desktop + } + + /// + /// Vision deficiency to emulate. Order: best-effort emulations come first, followed by any + /// physiologically accurate emulations for medically recognized color vision deficiencies. + /// + public enum SetEmulatedVisionDeficiencyType + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// blurredVision + /// + [JsonPropertyName("blurredVision")] + BlurredVision, + /// + /// reducedContrast + /// + [JsonPropertyName("reducedContrast")] + ReducedContrast, + /// + /// achromatopsia + /// + [JsonPropertyName("achromatopsia")] + Achromatopsia, + /// + /// deuteranopia + /// + [JsonPropertyName("deuteranopia")] + Deuteranopia, + /// + /// protanopia + /// + [JsonPropertyName("protanopia")] + Protanopia, + /// + /// tritanopia + /// + [JsonPropertyName("tritanopia")] + Tritanopia + } + + /// + /// This domain emulates different environments for the page. + /// + public partial class EmulationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Emulation + /// + /// DevToolsClient + public EmulationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Notification sent after the virtual time budget for the current VirtualTimePolicy has run out. + /// + public event System.EventHandler VirtualTimeBudgetExpired + { + add + { + _client.AddEventHandler("Emulation.virtualTimeBudgetExpired", value); + } + + remove + { + _client.RemoveEventHandler("Emulation.virtualTimeBudgetExpired", value); + } + } + + /// + /// Clears the overridden device metrics. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDeviceMetricsOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearDeviceMetricsOverride", dict); + } + + /// + /// Clears the overridden Geolocation Position and Error. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearGeolocationOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearGeolocationOverride", dict); + } + + /// + /// Requests that page scale factor is reset to initial values. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetPageScaleFactorAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.resetPageScaleFactor", dict); + } + + partial void ValidateSetFocusEmulationEnabled(bool enabled); + /// + /// Enables or disables simulating a focused and active page. + /// + /// Whether to enable to disable focus emulation. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetFocusEmulationEnabledAsync(bool enabled) + { + ValidateSetFocusEmulationEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Emulation.setFocusEmulationEnabled", dict); + } + + partial void ValidateSetAutoDarkModeOverride(bool? enabled = null); + /// + /// Automatically render all web contents using a dark theme. + /// + /// Whether to enable or disable automatic dark mode.If not specified, any existing override will be cleared. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAutoDarkModeOverrideAsync(bool? enabled = null) + { + ValidateSetAutoDarkModeOverride(enabled); + var dict = new System.Collections.Generic.Dictionary(); + if (enabled.HasValue) + { + dict.Add("enabled", enabled.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setAutoDarkModeOverride", dict); + } + + partial void ValidateSetCPUThrottlingRate(double rate); + /// + /// Enables CPU throttling to emulate slow CPUs. + /// + /// Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCPUThrottlingRateAsync(double rate) + { + ValidateSetCPUThrottlingRate(rate); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("rate", rate); + return _client.ExecuteDevToolsMethodAsync("Emulation.setCPUThrottlingRate", dict); + } + + partial void ValidateSetDefaultBackgroundColorOverride(CefSharp.DevTools.DOM.RGBA color = null); + /// + /// Sets or clears an override of the default background color of the frame. This override is used + /// if the content does not specify one. + /// + /// RGBA of the default background color. If not specified, any existing override will becleared. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDefaultBackgroundColorOverrideAsync(CefSharp.DevTools.DOM.RGBA color = null) + { + ValidateSetDefaultBackgroundColorOverride(color); + var dict = new System.Collections.Generic.Dictionary(); + if ((color) != (null)) + { + dict.Add("color", color.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setDefaultBackgroundColorOverride", dict); + } + + partial void ValidateSetSafeAreaInsetsOverride(CefSharp.DevTools.Emulation.SafeAreaInsets insets); + /// + /// Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the + /// respective variables to be undefined, even if previously overridden. + /// + /// insets + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSafeAreaInsetsOverrideAsync(CefSharp.DevTools.Emulation.SafeAreaInsets insets) + { + ValidateSetSafeAreaInsetsOverride(insets); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("insets", insets.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Emulation.setSafeAreaInsetsOverride", dict); + } + + partial void ValidateSetDeviceMetricsOverride(int width, int height, double deviceScaleFactor, bool mobile, double? scale = null, int? screenWidth = null, int? screenHeight = null, int? positionX = null, int? positionY = null, bool? dontSetVisibleSize = null, CefSharp.DevTools.Emulation.ScreenOrientation screenOrientation = null, CefSharp.DevTools.Page.Viewport viewport = null, CefSharp.DevTools.Emulation.DisplayFeature displayFeature = null, CefSharp.DevTools.Emulation.DevicePosture devicePosture = null); + /// + /// Overrides the values of device screen dimensions (window.screen.width, window.screen.height, + /// window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media + /// query results). + /// + /// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. + /// Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override. + /// Overriding device scale factor value. 0 disables the override. + /// Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, textautosizing and more. + /// Scale to apply to resulting view image. + /// Overriding screen width value in pixels (minimum 0, maximum 10000000). + /// Overriding screen height value in pixels (minimum 0, maximum 10000000). + /// Overriding view X position on screen in pixels (minimum 0, maximum 10000000). + /// Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). + /// Do not set visible view size, rely upon explicit setVisibleSize call. + /// Screen orientation override. + /// If set, the visible area of the page will be overridden to this viewport. This viewportchange is not observed by the page, e.g. viewport-relative elements do not change positions. + /// If set, the display feature of a multi-segment screen. If not set, multi-segment supportis turned-off.Deprecated, use Emulation.setDisplayFeaturesOverride. + /// If set, the posture of a foldable device. If not set the posture is setto continuous.Deprecated, use Emulation.setDevicePostureOverride. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDeviceMetricsOverrideAsync(int width, int height, double deviceScaleFactor, bool mobile, double? scale = null, int? screenWidth = null, int? screenHeight = null, int? positionX = null, int? positionY = null, bool? dontSetVisibleSize = null, CefSharp.DevTools.Emulation.ScreenOrientation screenOrientation = null, CefSharp.DevTools.Page.Viewport viewport = null, CefSharp.DevTools.Emulation.DisplayFeature displayFeature = null, CefSharp.DevTools.Emulation.DevicePosture devicePosture = null) + { + ValidateSetDeviceMetricsOverride(width, height, deviceScaleFactor, mobile, scale, screenWidth, screenHeight, positionX, positionY, dontSetVisibleSize, screenOrientation, viewport, displayFeature, devicePosture); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("width", width); + dict.Add("height", height); + dict.Add("deviceScaleFactor", deviceScaleFactor); + dict.Add("mobile", mobile); + if (scale.HasValue) + { + dict.Add("scale", scale.Value); + } + + if (screenWidth.HasValue) + { + dict.Add("screenWidth", screenWidth.Value); + } + + if (screenHeight.HasValue) + { + dict.Add("screenHeight", screenHeight.Value); + } + + if (positionX.HasValue) + { + dict.Add("positionX", positionX.Value); + } + + if (positionY.HasValue) + { + dict.Add("positionY", positionY.Value); + } + + if (dontSetVisibleSize.HasValue) + { + dict.Add("dontSetVisibleSize", dontSetVisibleSize.Value); + } + + if ((screenOrientation) != (null)) + { + dict.Add("screenOrientation", screenOrientation.ToDictionary()); + } + + if ((viewport) != (null)) + { + dict.Add("viewport", viewport.ToDictionary()); + } + + if ((displayFeature) != (null)) + { + dict.Add("displayFeature", displayFeature.ToDictionary()); + } + + if ((devicePosture) != (null)) + { + dict.Add("devicePosture", devicePosture.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setDeviceMetricsOverride", dict); + } + + partial void ValidateSetDevicePostureOverride(CefSharp.DevTools.Emulation.DevicePosture posture); + /// + /// Start reporting the given posture value to the Device Posture API. + /// This override can also be set in setDeviceMetricsOverride(). + /// + /// posture + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDevicePostureOverrideAsync(CefSharp.DevTools.Emulation.DevicePosture posture) + { + ValidateSetDevicePostureOverride(posture); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("posture", posture.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Emulation.setDevicePostureOverride", dict); + } + + /// + /// Clears a device posture override set with either setDeviceMetricsOverride() + /// or setDevicePostureOverride() and starts using posture information from the + /// platform again. + /// Does nothing if no override is set. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDevicePostureOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearDevicePostureOverride", dict); + } + + partial void ValidateSetDisplayFeaturesOverride(System.Collections.Generic.IList features); + /// + /// Start using the given display features to pupulate the Viewport Segments API. + /// This override can also be set in setDeviceMetricsOverride(). + /// + /// features + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDisplayFeaturesOverrideAsync(System.Collections.Generic.IList features) + { + ValidateSetDisplayFeaturesOverride(features); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("features", features.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Emulation.setDisplayFeaturesOverride", dict); + } + + /// + /// Clears the display features override set with either setDeviceMetricsOverride() + /// or setDisplayFeaturesOverride() and starts using display features from the + /// platform again. + /// Does nothing if no override is set. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDisplayFeaturesOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearDisplayFeaturesOverride", dict); + } + + partial void ValidateSetScrollbarsHidden(bool hidden); + /// + /// SetScrollbarsHidden + /// + /// Whether scrollbars should be always hidden. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetScrollbarsHiddenAsync(bool hidden) + { + ValidateSetScrollbarsHidden(hidden); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("hidden", hidden); + return _client.ExecuteDevToolsMethodAsync("Emulation.setScrollbarsHidden", dict); + } + + partial void ValidateSetDocumentCookieDisabled(bool disabled); + /// + /// SetDocumentCookieDisabled + /// + /// Whether document.coookie API should be disabled. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDocumentCookieDisabledAsync(bool disabled) + { + ValidateSetDocumentCookieDisabled(disabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("disabled", disabled); + return _client.ExecuteDevToolsMethodAsync("Emulation.setDocumentCookieDisabled", dict); + } + + partial void ValidateSetEmitTouchEventsForMouse(bool enabled, CefSharp.DevTools.Emulation.SetEmitTouchEventsForMouseConfiguration? configuration = null); + /// + /// SetEmitTouchEventsForMouse + /// + /// Whether touch emulation based on mouse input should be enabled. + /// Touch/gesture events configuration. Default: current platform. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEmitTouchEventsForMouseAsync(bool enabled, CefSharp.DevTools.Emulation.SetEmitTouchEventsForMouseConfiguration? configuration = null) + { + ValidateSetEmitTouchEventsForMouse(enabled, configuration); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + if (configuration.HasValue) + { + dict.Add("configuration", EnumToString(configuration)); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setEmitTouchEventsForMouse", dict); + } + + partial void ValidateSetEmulatedMedia(string media = null, System.Collections.Generic.IList features = null); + /// + /// Emulates the given media type or media feature for CSS media queries. + /// + /// Media type to emulate. Empty string disables the override. + /// Media features to emulate. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEmulatedMediaAsync(string media = null, System.Collections.Generic.IList features = null) + { + ValidateSetEmulatedMedia(media, features); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(media))) + { + dict.Add("media", media); + } + + if ((features) != (null)) + { + dict.Add("features", features.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setEmulatedMedia", dict); + } + + partial void ValidateSetEmulatedVisionDeficiency(CefSharp.DevTools.Emulation.SetEmulatedVisionDeficiencyType type); + /// + /// Emulates the given vision deficiency. + /// + /// Vision deficiency to emulate. Order: best-effort emulations come first, followed by anyphysiologically accurate emulations for medically recognized color vision deficiencies. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEmulatedVisionDeficiencyAsync(CefSharp.DevTools.Emulation.SetEmulatedVisionDeficiencyType type) + { + ValidateSetEmulatedVisionDeficiency(type); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + return _client.ExecuteDevToolsMethodAsync("Emulation.setEmulatedVisionDeficiency", dict); + } + + partial void ValidateSetEmulatedOSTextScale(double? scale = null); + /// + /// Emulates the given OS text scale. + /// + /// scale + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetEmulatedOSTextScaleAsync(double? scale = null) + { + ValidateSetEmulatedOSTextScale(scale); + var dict = new System.Collections.Generic.Dictionary(); + if (scale.HasValue) + { + dict.Add("scale", scale.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setEmulatedOSTextScale", dict); + } + + partial void ValidateSetGeolocationOverride(double? latitude = null, double? longitude = null, double? accuracy = null, double? altitude = null, double? altitudeAccuracy = null, double? heading = null, double? speed = null); + /// + /// Overrides the Geolocation Position or Error. Omitting latitude, longitude or + /// accuracy emulates position unavailable. + /// + /// Mock latitude + /// Mock longitude + /// Mock accuracy + /// Mock altitude + /// Mock altitudeAccuracy + /// Mock heading + /// Mock speed + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetGeolocationOverrideAsync(double? latitude = null, double? longitude = null, double? accuracy = null, double? altitude = null, double? altitudeAccuracy = null, double? heading = null, double? speed = null) + { + ValidateSetGeolocationOverride(latitude, longitude, accuracy, altitude, altitudeAccuracy, heading, speed); + var dict = new System.Collections.Generic.Dictionary(); + if (latitude.HasValue) + { + dict.Add("latitude", latitude.Value); + } + + if (longitude.HasValue) + { + dict.Add("longitude", longitude.Value); + } + + if (accuracy.HasValue) + { + dict.Add("accuracy", accuracy.Value); + } + + if (altitude.HasValue) + { + dict.Add("altitude", altitude.Value); + } + + if (altitudeAccuracy.HasValue) + { + dict.Add("altitudeAccuracy", altitudeAccuracy.Value); + } + + if (heading.HasValue) + { + dict.Add("heading", heading.Value); + } + + if (speed.HasValue) + { + dict.Add("speed", speed.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setGeolocationOverride", dict); + } + + partial void ValidateGetOverriddenSensorInformation(CefSharp.DevTools.Emulation.SensorType type); + /// + /// GetOverriddenSensorInformation + /// + /// type + /// returns System.Threading.Tasks.Task<GetOverriddenSensorInformationResponse> + public System.Threading.Tasks.Task GetOverriddenSensorInformationAsync(CefSharp.DevTools.Emulation.SensorType type) + { + ValidateGetOverriddenSensorInformation(type); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + return _client.ExecuteDevToolsMethodAsync("Emulation.getOverriddenSensorInformation", dict); + } + + partial void ValidateSetSensorOverrideEnabled(bool enabled, CefSharp.DevTools.Emulation.SensorType type, CefSharp.DevTools.Emulation.SensorMetadata metadata = null); + /// + /// Overrides a platform sensor of a given type. If |enabled| is true, calls to + /// Sensor.start() will use a virtual sensor as backend rather than fetching + /// data from a real hardware sensor. Otherwise, existing virtual + /// sensor-backend Sensor objects will fire an error event and new calls to + /// Sensor.start() will attempt to use a real sensor instead. + /// + /// enabled + /// type + /// metadata + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSensorOverrideEnabledAsync(bool enabled, CefSharp.DevTools.Emulation.SensorType type, CefSharp.DevTools.Emulation.SensorMetadata metadata = null) + { + ValidateSetSensorOverrideEnabled(enabled, type, metadata); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + dict.Add("type", EnumToString(type)); + if ((metadata) != (null)) + { + dict.Add("metadata", metadata.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setSensorOverrideEnabled", dict); + } + + partial void ValidateSetSensorOverrideReadings(CefSharp.DevTools.Emulation.SensorType type, CefSharp.DevTools.Emulation.SensorReading reading); + /// + /// Updates the sensor readings reported by a sensor type previously overridden + /// by setSensorOverrideEnabled. + /// + /// type + /// reading + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSensorOverrideReadingsAsync(CefSharp.DevTools.Emulation.SensorType type, CefSharp.DevTools.Emulation.SensorReading reading) + { + ValidateSetSensorOverrideReadings(type, reading); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("reading", reading.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Emulation.setSensorOverrideReadings", dict); + } + + partial void ValidateSetPressureSourceOverrideEnabled(bool enabled, CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureMetadata metadata = null); + /// + /// Overrides a pressure source of a given type, as used by the Compute + /// Pressure API, so that updates to PressureObserver.observe() are provided + /// via setPressureStateOverride instead of being retrieved from + /// platform-provided telemetry data. + /// + /// enabled + /// source + /// metadata + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPressureSourceOverrideEnabledAsync(bool enabled, CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureMetadata metadata = null) + { + ValidateSetPressureSourceOverrideEnabled(enabled, source, metadata); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + dict.Add("source", EnumToString(source)); + if ((metadata) != (null)) + { + dict.Add("metadata", metadata.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setPressureSourceOverrideEnabled", dict); + } + + partial void ValidateSetPressureStateOverride(CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureState state); + /// + /// TODO: OBSOLETE: To remove when setPressureDataOverride is merged. + /// Provides a given pressure state that will be processed and eventually be + /// delivered to PressureObserver users. |source| must have been previously + /// overridden by setPressureSourceOverrideEnabled. + /// + /// source + /// state + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPressureStateOverrideAsync(CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureState state) + { + ValidateSetPressureStateOverride(source, state); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("source", EnumToString(source)); + dict.Add("state", EnumToString(state)); + return _client.ExecuteDevToolsMethodAsync("Emulation.setPressureStateOverride", dict); + } + + partial void ValidateSetPressureDataOverride(CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureState state, double? ownContributionEstimate = null); + /// + /// Provides a given pressure data set that will be processed and eventually be + /// delivered to PressureObserver users. |source| must have been previously + /// overridden by setPressureSourceOverrideEnabled. + /// + /// source + /// state + /// ownContributionEstimate + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPressureDataOverrideAsync(CefSharp.DevTools.Emulation.PressureSource source, CefSharp.DevTools.Emulation.PressureState state, double? ownContributionEstimate = null) + { + ValidateSetPressureDataOverride(source, state, ownContributionEstimate); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("source", EnumToString(source)); + dict.Add("state", EnumToString(state)); + if (ownContributionEstimate.HasValue) + { + dict.Add("ownContributionEstimate", ownContributionEstimate.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setPressureDataOverride", dict); + } + + partial void ValidateSetIdleOverride(bool isUserActive, bool isScreenUnlocked); + /// + /// Overrides the Idle state. + /// + /// Mock isUserActive + /// Mock isScreenUnlocked + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetIdleOverrideAsync(bool isUserActive, bool isScreenUnlocked) + { + ValidateSetIdleOverride(isUserActive, isScreenUnlocked); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("isUserActive", isUserActive); + dict.Add("isScreenUnlocked", isScreenUnlocked); + return _client.ExecuteDevToolsMethodAsync("Emulation.setIdleOverride", dict); + } + + /// + /// Clears Idle state overrides. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearIdleOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.clearIdleOverride", dict); + } + + partial void ValidateSetPageScaleFactor(double pageScaleFactor); + /// + /// Sets a specified page scale factor. + /// + /// Page scale factor. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPageScaleFactorAsync(double pageScaleFactor) + { + ValidateSetPageScaleFactor(pageScaleFactor); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("pageScaleFactor", pageScaleFactor); + return _client.ExecuteDevToolsMethodAsync("Emulation.setPageScaleFactor", dict); + } + + partial void ValidateSetScriptExecutionDisabled(bool value); + /// + /// Switches script execution in the page. + /// + /// Whether script execution should be disabled in the page. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetScriptExecutionDisabledAsync(bool value) + { + ValidateSetScriptExecutionDisabled(value); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("value", value); + return _client.ExecuteDevToolsMethodAsync("Emulation.setScriptExecutionDisabled", dict); + } + + partial void ValidateSetTouchEmulationEnabled(bool enabled, int? maxTouchPoints = null); + /// + /// Enables touch on platforms which do not support them. + /// + /// Whether the touch event emulation should be enabled. + /// Maximum touch points supported. Defaults to one. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetTouchEmulationEnabledAsync(bool enabled, int? maxTouchPoints = null) + { + ValidateSetTouchEmulationEnabled(enabled, maxTouchPoints); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + if (maxTouchPoints.HasValue) + { + dict.Add("maxTouchPoints", maxTouchPoints.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setTouchEmulationEnabled", dict); + } + + partial void ValidateSetVirtualTimePolicy(CefSharp.DevTools.Emulation.VirtualTimePolicy policy, double? budget = null, int? maxVirtualTimeTaskStarvationCount = null, double? initialVirtualTime = null); + /// + /// Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets + /// the current virtual time policy. Note this supersedes any previous time budget. + /// + /// policy + /// If set, after this many virtual milliseconds have elapsed virtual time will be paused and avirtualTimeBudgetExpired event is sent. + /// If set this specifies the maximum number of tasks that can be run before virtual is forcedforwards to prevent deadlock. + /// If set, base::Time::Now will be overridden to initially return this value. + /// returns System.Threading.Tasks.Task<SetVirtualTimePolicyResponse> + public System.Threading.Tasks.Task SetVirtualTimePolicyAsync(CefSharp.DevTools.Emulation.VirtualTimePolicy policy, double? budget = null, int? maxVirtualTimeTaskStarvationCount = null, double? initialVirtualTime = null) + { + ValidateSetVirtualTimePolicy(policy, budget, maxVirtualTimeTaskStarvationCount, initialVirtualTime); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("policy", EnumToString(policy)); + if (budget.HasValue) + { + dict.Add("budget", budget.Value); + } + + if (maxVirtualTimeTaskStarvationCount.HasValue) + { + dict.Add("maxVirtualTimeTaskStarvationCount", maxVirtualTimeTaskStarvationCount.Value); + } + + if (initialVirtualTime.HasValue) + { + dict.Add("initialVirtualTime", initialVirtualTime.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setVirtualTimePolicy", dict); + } + + partial void ValidateSetLocaleOverride(string locale = null); + /// + /// Overrides default host system locale with the specified one. + /// + /// ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override andrestores default host system locale. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetLocaleOverrideAsync(string locale = null) + { + ValidateSetLocaleOverride(locale); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(locale))) + { + dict.Add("locale", locale); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setLocaleOverride", dict); + } + + partial void ValidateSetTimezoneOverride(string timezoneId); + /// + /// Overrides default host system timezone with the specified one. + /// + /// The timezone identifier. List of supported timezones:https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txtIf empty, disables the override and restores default host system timezone. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetTimezoneOverrideAsync(string timezoneId) + { + ValidateSetTimezoneOverride(timezoneId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("timezoneId", timezoneId); + return _client.ExecuteDevToolsMethodAsync("Emulation.setTimezoneOverride", dict); + } + + partial void ValidateSetDisabledImageTypes(CefSharp.DevTools.Emulation.DisabledImageType[] imageTypes); + /// + /// SetDisabledImageTypes + /// + /// Image types to disable. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDisabledImageTypesAsync(CefSharp.DevTools.Emulation.DisabledImageType[] imageTypes) + { + ValidateSetDisabledImageTypes(imageTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("imageTypes", EnumToString(imageTypes)); + return _client.ExecuteDevToolsMethodAsync("Emulation.setDisabledImageTypes", dict); + } + + partial void ValidateSetDataSaverOverride(bool? dataSaverEnabled = null); + /// + /// Override the value of navigator.connection.saveData + /// + /// Override value. Omitting the parameter disables the override. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDataSaverOverrideAsync(bool? dataSaverEnabled = null) + { + ValidateSetDataSaverOverride(dataSaverEnabled); + var dict = new System.Collections.Generic.Dictionary(); + if (dataSaverEnabled.HasValue) + { + dict.Add("dataSaverEnabled", dataSaverEnabled.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setDataSaverOverride", dict); + } + + partial void ValidateSetHardwareConcurrencyOverride(int hardwareConcurrency); + /// + /// SetHardwareConcurrencyOverride + /// + /// Hardware concurrency to report + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetHardwareConcurrencyOverrideAsync(int hardwareConcurrency) + { + ValidateSetHardwareConcurrencyOverride(hardwareConcurrency); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("hardwareConcurrency", hardwareConcurrency); + return _client.ExecuteDevToolsMethodAsync("Emulation.setHardwareConcurrencyOverride", dict); + } + + partial void ValidateSetUserAgentOverride(string userAgent, string acceptLanguage = null, string platform = null, CefSharp.DevTools.Emulation.UserAgentMetadata userAgentMetadata = null); + /// + /// Allows overriding user agent with the given string. + /// `userAgentMetadata` must be set for Client Hint headers to be sent. + /// + /// User agent to use. + /// Browser language to emulate. + /// The platform navigator.platform should return. + /// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetUserAgentOverrideAsync(string userAgent, string acceptLanguage = null, string platform = null, CefSharp.DevTools.Emulation.UserAgentMetadata userAgentMetadata = null) + { + ValidateSetUserAgentOverride(userAgent, acceptLanguage, platform, userAgentMetadata); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("userAgent", userAgent); + if (!(string.IsNullOrEmpty(acceptLanguage))) + { + dict.Add("acceptLanguage", acceptLanguage); + } + + if (!(string.IsNullOrEmpty(platform))) + { + dict.Add("platform", platform); + } + + if ((userAgentMetadata) != (null)) + { + dict.Add("userAgentMetadata", userAgentMetadata.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.setUserAgentOverride", dict); + } + + partial void ValidateSetAutomationOverride(bool enabled); + /// + /// Allows overriding the automation flag. + /// + /// Whether the override should be enabled. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAutomationOverrideAsync(bool enabled) + { + ValidateSetAutomationOverride(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Emulation.setAutomationOverride", dict); + } + + partial void ValidateSetSmallViewportHeightDifferenceOverride(int difference); + /// + /// Allows overriding the difference between the small and large viewport sizes, which determine the + /// value of the `svh` and `lvh` unit, respectively. Only supported for top-level frames. + /// + /// This will cause an element of size 100svh to be `difference` pixels smaller than an elementof size 100lvh. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSmallViewportHeightDifferenceOverrideAsync(int difference) + { + ValidateSetSmallViewportHeightDifferenceOverride(difference); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("difference", difference); + return _client.ExecuteDevToolsMethodAsync("Emulation.setSmallViewportHeightDifferenceOverride", dict); + } + + /// + /// Returns device's screen configuration. + /// + /// returns System.Threading.Tasks.Task<GetScreenInfosResponse> + public System.Threading.Tasks.Task GetScreenInfosAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Emulation.getScreenInfos", dict); + } + + partial void ValidateAddScreen(int left, int top, int width, int height, CefSharp.DevTools.Emulation.WorkAreaInsets workAreaInsets = null, double? devicePixelRatio = null, int? rotation = null, int? colorDepth = null, string label = null, bool? isInternal = null); + /// + /// Add a new screen to the device. Only supported in headless mode. + /// + /// Offset of the left edge of the screen in pixels. + /// Offset of the top edge of the screen in pixels. + /// The width of the screen in pixels. + /// The height of the screen in pixels. + /// Specifies the screen's work area. Default is entire screen. + /// Specifies the screen's device pixel ratio. Default is 1. + /// Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0. + /// Specifies the screen's color depth in bits. Default is 24. + /// Specifies the descriptive label for the screen. Default is none. + /// Indicates whether the screen is internal to the device or external, attached to the device. Default is false. + /// returns System.Threading.Tasks.Task<AddScreenResponse> + public System.Threading.Tasks.Task AddScreenAsync(int left, int top, int width, int height, CefSharp.DevTools.Emulation.WorkAreaInsets workAreaInsets = null, double? devicePixelRatio = null, int? rotation = null, int? colorDepth = null, string label = null, bool? isInternal = null) + { + ValidateAddScreen(left, top, width, height, workAreaInsets, devicePixelRatio, rotation, colorDepth, label, isInternal); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("left", left); + dict.Add("top", top); + dict.Add("width", width); + dict.Add("height", height); + if ((workAreaInsets) != (null)) + { + dict.Add("workAreaInsets", workAreaInsets.ToDictionary()); + } + + if (devicePixelRatio.HasValue) + { + dict.Add("devicePixelRatio", devicePixelRatio.Value); + } + + if (rotation.HasValue) + { + dict.Add("rotation", rotation.Value); + } + + if (colorDepth.HasValue) + { + dict.Add("colorDepth", colorDepth.Value); + } + + if (!(string.IsNullOrEmpty(label))) + { + dict.Add("label", label); + } + + if (isInternal.HasValue) + { + dict.Add("isInternal", isInternal.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Emulation.addScreen", dict); + } + + partial void ValidateRemoveScreen(string screenId); + /// + /// Remove screen from the device. Only supported in headless mode. + /// + /// screenId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveScreenAsync(string screenId) + { + ValidateRemoveScreen(screenId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("screenId", screenId); + return _client.ExecuteDevToolsMethodAsync("Emulation.removeScreen", dict); + } + } +} + +namespace CefSharp.DevTools.EventBreakpoints +{ + using System.Linq; + + /// + /// EventBreakpoints permits setting JavaScript breakpoints on operations and events + /// occurring in native code invoked from JavaScript. Once breakpoint is hit, it is + /// reported through Debugger domain, similarly to regular breakpoints being hit. + /// + public partial class EventBreakpointsClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// EventBreakpoints + /// + /// DevToolsClient + public EventBreakpointsClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateSetInstrumentationBreakpoint(string eventName); + /// + /// Sets breakpoint on particular native event. + /// + /// Instrumentation name to stop on. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInstrumentationBreakpointAsync(string eventName) + { + ValidateSetInstrumentationBreakpoint(eventName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventName", eventName); + return _client.ExecuteDevToolsMethodAsync("EventBreakpoints.setInstrumentationBreakpoint", dict); + } + + partial void ValidateRemoveInstrumentationBreakpoint(string eventName); + /// + /// Removes breakpoint on particular native event. + /// + /// Instrumentation name to stop on. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveInstrumentationBreakpointAsync(string eventName) + { + ValidateRemoveInstrumentationBreakpoint(eventName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventName", eventName); + return _client.ExecuteDevToolsMethodAsync("EventBreakpoints.removeInstrumentationBreakpoint", dict); + } + + /// + /// Removes all breakpoints + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("EventBreakpoints.disable", dict); + } + } +} + +namespace CefSharp.DevTools.Extensions +{ + /// + /// LoadUnpackedResponse + /// + public class LoadUnpackedResponse : DevToolsDomainResponseBase + { + /// + /// id + /// + [JsonInclude] + [JsonPropertyName("id")] + public string Id + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Extensions +{ + /// + /// GetStorageItemsResponse + /// + public class GetStorageItemsResponse : DevToolsDomainResponseBase + { + /// + /// data + /// + [JsonInclude] + [JsonPropertyName("data")] + public object Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Extensions +{ + using System.Linq; + + /// + /// Defines commands and events for browser extensions. + /// + public partial class ExtensionsClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Extensions + /// + /// DevToolsClient + public ExtensionsClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateTriggerAction(string id, string targetId); + /// + /// Runs an extension default action. + /// Available if the client is connected using the --remote-debugging-pipe + /// flag and the --enable-unsafe-extension-debugging flag is set. + /// + /// Extension id. + /// A tab target ID to trigger the default extension action on. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TriggerActionAsync(string id, string targetId) + { + ValidateTriggerAction(id, targetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("targetId", targetId); + return _client.ExecuteDevToolsMethodAsync("Extensions.triggerAction", dict); + } + + partial void ValidateLoadUnpacked(string path, bool? enableInIncognito = null); + /// + /// Installs an unpacked extension from the filesystem similar to + /// --load-extension CLI flags. Returns extension ID once the extension + /// has been installed. Available if the client is connected using the + /// --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging + /// flag is set. + /// + /// Absolute file path. + /// Enable the extension in incognito + /// returns System.Threading.Tasks.Task<LoadUnpackedResponse> + public System.Threading.Tasks.Task LoadUnpackedAsync(string path, bool? enableInIncognito = null) + { + ValidateLoadUnpacked(path, enableInIncognito); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("path", path); + if (enableInIncognito.HasValue) + { + dict.Add("enableInIncognito", enableInIncognito.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Extensions.loadUnpacked", dict); + } + + partial void ValidateUninstall(string id); + /// + /// Uninstalls an unpacked extension (others not supported) from the profile. + /// Available if the client is connected using the --remote-debugging-pipe flag + /// and the --enable-unsafe-extension-debugging. + /// + /// Extension id. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UninstallAsync(string id) + { + ValidateUninstall(id); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + return _client.ExecuteDevToolsMethodAsync("Extensions.uninstall", dict); + } + + partial void ValidateGetStorageItems(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, string[] keys = null); + /// + /// Gets data from extension storage in the given `storageArea`. If `keys` is + /// specified, these are used to filter the result. + /// + /// ID of extension. + /// StorageArea to retrieve data from. + /// Keys to retrieve. + /// returns System.Threading.Tasks.Task<GetStorageItemsResponse> + public System.Threading.Tasks.Task GetStorageItemsAsync(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, string[] keys = null) + { + ValidateGetStorageItems(id, storageArea, keys); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("storageArea", EnumToString(storageArea)); + if ((keys) != (null)) + { + dict.Add("keys", keys); + } + + return _client.ExecuteDevToolsMethodAsync("Extensions.getStorageItems", dict); + } + + partial void ValidateRemoveStorageItems(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, string[] keys); + /// + /// Removes `keys` from extension storage in the given `storageArea`. + /// + /// ID of extension. + /// StorageArea to remove data from. + /// Keys to remove. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveStorageItemsAsync(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, string[] keys) + { + ValidateRemoveStorageItems(id, storageArea, keys); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("storageArea", EnumToString(storageArea)); + dict.Add("keys", keys); + return _client.ExecuteDevToolsMethodAsync("Extensions.removeStorageItems", dict); + } + + partial void ValidateClearStorageItems(string id, CefSharp.DevTools.Extensions.StorageArea storageArea); + /// + /// Clears extension storage in the given `storageArea`. + /// + /// ID of extension. + /// StorageArea to remove data from. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearStorageItemsAsync(string id, CefSharp.DevTools.Extensions.StorageArea storageArea) + { + ValidateClearStorageItems(id, storageArea); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("storageArea", EnumToString(storageArea)); + return _client.ExecuteDevToolsMethodAsync("Extensions.clearStorageItems", dict); + } + + partial void ValidateSetStorageItems(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, object values); + /// + /// Sets `values` in extension storage in the given `storageArea`. The provided `values` + /// will be merged with existing values in the storage area. + /// + /// ID of extension. + /// StorageArea to set data in. + /// Values to set. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetStorageItemsAsync(string id, CefSharp.DevTools.Extensions.StorageArea storageArea, object values) + { + ValidateSetStorageItems(id, storageArea, values); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("id", id); + dict.Add("storageArea", EnumToString(storageArea)); + dict.Add("values", values); + return _client.ExecuteDevToolsMethodAsync("Extensions.setStorageItems", dict); + } + } +} + +namespace CefSharp.DevTools.FedCm +{ + using System.Linq; + + /// + /// This domain allows interacting with the FedCM dialog. + /// + public partial class FedCmClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// FedCm + /// + /// DevToolsClient + public FedCmClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// DialogShown + /// + public event System.EventHandler DialogShown + { + add + { + _client.AddEventHandler("FedCm.dialogShown", value); + } + + remove + { + _client.RemoveEventHandler("FedCm.dialogShown", value); + } + } + + /// + /// Triggered when a dialog is closed, either by user action, JS abort, + /// or a command below. + /// + public event System.EventHandler DialogClosed + { + add + { + _client.AddEventHandler("FedCm.dialogClosed", value); + } + + remove + { + _client.RemoveEventHandler("FedCm.dialogClosed", value); + } + } + + partial void ValidateEnable(bool? disableRejectionDelay = null); + /// + /// Enable + /// + /// Allows callers to disable the promise rejection delay that wouldnormally happen, if this is unimportant to what's being tested.(step 4 of https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in) + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(bool? disableRejectionDelay = null) + { + ValidateEnable(disableRejectionDelay); + var dict = new System.Collections.Generic.Dictionary(); + if (disableRejectionDelay.HasValue) + { + dict.Add("disableRejectionDelay", disableRejectionDelay.Value); + } + + return _client.ExecuteDevToolsMethodAsync("FedCm.enable", dict); + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("FedCm.disable", dict); + } + + partial void ValidateSelectAccount(string dialogId, int accountIndex); + /// + /// SelectAccount + /// + /// dialogId + /// accountIndex + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SelectAccountAsync(string dialogId, int accountIndex) + { + ValidateSelectAccount(dialogId, accountIndex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("dialogId", dialogId); + dict.Add("accountIndex", accountIndex); + return _client.ExecuteDevToolsMethodAsync("FedCm.selectAccount", dict); + } + + partial void ValidateClickDialogButton(string dialogId, CefSharp.DevTools.FedCm.DialogButton dialogButton); + /// + /// ClickDialogButton + /// + /// dialogId + /// dialogButton + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClickDialogButtonAsync(string dialogId, CefSharp.DevTools.FedCm.DialogButton dialogButton) + { + ValidateClickDialogButton(dialogId, dialogButton); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("dialogId", dialogId); + dict.Add("dialogButton", EnumToString(dialogButton)); + return _client.ExecuteDevToolsMethodAsync("FedCm.clickDialogButton", dict); + } + + partial void ValidateOpenUrl(string dialogId, int accountIndex, CefSharp.DevTools.FedCm.AccountUrlType accountUrlType); + /// + /// OpenUrl + /// + /// dialogId + /// accountIndex + /// accountUrlType + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task OpenUrlAsync(string dialogId, int accountIndex, CefSharp.DevTools.FedCm.AccountUrlType accountUrlType) + { + ValidateOpenUrl(dialogId, accountIndex, accountUrlType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("dialogId", dialogId); + dict.Add("accountIndex", accountIndex); + dict.Add("accountUrlType", EnumToString(accountUrlType)); + return _client.ExecuteDevToolsMethodAsync("FedCm.openUrl", dict); + } + + partial void ValidateDismissDialog(string dialogId, bool? triggerCooldown = null); + /// + /// DismissDialog + /// + /// dialogId + /// triggerCooldown + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DismissDialogAsync(string dialogId, bool? triggerCooldown = null) + { + ValidateDismissDialog(dialogId, triggerCooldown); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("dialogId", dialogId); + if (triggerCooldown.HasValue) + { + dict.Add("triggerCooldown", triggerCooldown.Value); + } + + return _client.ExecuteDevToolsMethodAsync("FedCm.dismissDialog", dict); + } + + /// + /// Resets the cooldown time, if any, to allow the next FedCM call to show + /// a dialog even if one was recently dismissed by the user. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetCooldownAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("FedCm.resetCooldown", dict); + } + } +} + +namespace CefSharp.DevTools.Fetch +{ + /// + /// GetResponseBodyResponse + /// + public class GetResponseBodyResponse : DevToolsDomainResponseBase + { + /// + /// body + /// + [JsonInclude] + [JsonPropertyName("body")] + public string Body + { + get; + private set; + } + + /// + /// base64Encoded + /// + [JsonInclude] + [JsonPropertyName("base64Encoded")] + public bool Base64Encoded + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Fetch +{ + /// + /// TakeResponseBodyAsStreamResponse + /// + public class TakeResponseBodyAsStreamResponse : DevToolsDomainResponseBase + { + /// + /// stream + /// + [JsonInclude] + [JsonPropertyName("stream")] + public string Stream + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Fetch +{ + using System.Linq; + + /// + /// A domain for letting clients substitute browser's network layer with client code. + /// + public partial class FetchClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Fetch + /// + /// DevToolsClient + public FetchClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Issued when the domain is enabled and the request URL matches the + /// specified filter. The request is paused until the client responds + /// with one of continueRequest, failRequest or fulfillRequest. + /// The stage of the request can be determined by presence of responseErrorReason + /// and responseStatusCode -- the request is at the response stage if either + /// of these fields is present and in the request stage otherwise. + /// Redirect responses and subsequent requests are reported similarly to regular + /// responses and requests. Redirect responses may be distinguished by the value + /// of `responseStatusCode` (which is one of 301, 302, 303, 307, 308) along with + /// presence of the `location` header. Requests resulting from a redirect will + /// have `redirectedRequestId` field set. + /// + public event System.EventHandler RequestPaused + { + add + { + _client.AddEventHandler("Fetch.requestPaused", value); + } + + remove + { + _client.RemoveEventHandler("Fetch.requestPaused", value); + } + } + + /// + /// Issued when the domain is enabled with handleAuthRequests set to true. + /// The request is paused until client responds with continueWithAuth. + /// + public event System.EventHandler AuthRequired + { + add + { + _client.AddEventHandler("Fetch.authRequired", value); + } + + remove + { + _client.RemoveEventHandler("Fetch.authRequired", value); + } + } + + /// + /// Disables the fetch domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Fetch.disable", dict); + } + + partial void ValidateEnable(System.Collections.Generic.IList patterns = null, bool? handleAuthRequests = null); + /// + /// Enables issuing of requestPaused events. A request will be paused until client + /// calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth. + /// + /// If specified, only requests matching any of these patterns will producefetchRequested event and will be paused until clients response. If not set,all requests will be affected. + /// If true, authRequired events will be issued and requests will be pausedexpecting a call to continueWithAuth. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(System.Collections.Generic.IList patterns = null, bool? handleAuthRequests = null) + { + ValidateEnable(patterns, handleAuthRequests); + var dict = new System.Collections.Generic.Dictionary(); + if ((patterns) != (null)) + { + dict.Add("patterns", patterns.Select(x => x.ToDictionary())); + } + + if (handleAuthRequests.HasValue) + { + dict.Add("handleAuthRequests", handleAuthRequests.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Fetch.enable", dict); + } + + partial void ValidateFailRequest(string requestId, CefSharp.DevTools.Network.ErrorReason errorReason); + /// + /// Causes the request to fail with specified reason. + /// + /// An id the client received in requestPaused event. + /// Causes the request to fail with the given reason. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task FailRequestAsync(string requestId, CefSharp.DevTools.Network.ErrorReason errorReason) + { + ValidateFailRequest(requestId, errorReason); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("errorReason", EnumToString(errorReason)); + return _client.ExecuteDevToolsMethodAsync("Fetch.failRequest", dict); + } + + partial void ValidateFulfillRequest(string requestId, int responseCode, System.Collections.Generic.IList responseHeaders = null, byte[] binaryResponseHeaders = null, byte[] body = null, string responsePhrase = null); + /// + /// Provides response to the request. + /// + /// An id the client received in requestPaused event. + /// An HTTP response code. + /// Response headers. + /// Alternative way of specifying response headers as a \0-separatedseries of name: value pairs. Prefer the above method unless youneed to represent some non-UTF8 values that can't be transmittedover the protocol as text. + /// A response body. If absent, original response body will be used ifthe request is intercepted at the response stage and empty bodywill be used if the request is intercepted at the request stage. + /// A textual representation of responseCode.If absent, a standard phrase matching responseCode is used. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task FulfillRequestAsync(string requestId, int responseCode, System.Collections.Generic.IList responseHeaders = null, byte[] binaryResponseHeaders = null, byte[] body = null, string responsePhrase = null) + { + ValidateFulfillRequest(requestId, responseCode, responseHeaders, binaryResponseHeaders, body, responsePhrase); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("responseCode", responseCode); + if ((responseHeaders) != (null)) + { + dict.Add("responseHeaders", responseHeaders.Select(x => x.ToDictionary())); + } + + if ((binaryResponseHeaders) != (null)) + { + dict.Add("binaryResponseHeaders", ToBase64String(binaryResponseHeaders)); + } + + if ((body) != (null)) + { + dict.Add("body", ToBase64String(body)); + } + + if (!(string.IsNullOrEmpty(responsePhrase))) + { + dict.Add("responsePhrase", responsePhrase); + } + + return _client.ExecuteDevToolsMethodAsync("Fetch.fulfillRequest", dict); + } + + partial void ValidateContinueRequest(string requestId, string url = null, string method = null, byte[] postData = null, System.Collections.Generic.IList headers = null, bool? interceptResponse = null); + /// + /// Continues the request, optionally modifying some of its parameters. + /// + /// An id the client received in requestPaused event. + /// If set, the request url will be modified in a way that's not observable by page. + /// If set, the request method is overridden. + /// If set, overrides the post data in the request. + /// If set, overrides the request headers. Note that the overrides do notextend to subsequent redirect hops, if a redirect happens. Another overridemay be applied to a different request produced by a redirect. + /// If set, overrides response interception behavior for this request. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ContinueRequestAsync(string requestId, string url = null, string method = null, byte[] postData = null, System.Collections.Generic.IList headers = null, bool? interceptResponse = null) + { + ValidateContinueRequest(requestId, url, method, postData, headers, interceptResponse); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + if (!(string.IsNullOrEmpty(method))) + { + dict.Add("method", method); + } + + if ((postData) != (null)) + { + dict.Add("postData", ToBase64String(postData)); + } + + if ((headers) != (null)) + { + dict.Add("headers", headers.Select(x => x.ToDictionary())); + } + + if (interceptResponse.HasValue) + { + dict.Add("interceptResponse", interceptResponse.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Fetch.continueRequest", dict); + } + + partial void ValidateContinueWithAuth(string requestId, CefSharp.DevTools.Fetch.AuthChallengeResponse authChallengeResponse); + /// + /// Continues a request supplying authChallengeResponse following authRequired event. + /// + /// An id the client received in authRequired event. + /// Response to with an authChallenge. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ContinueWithAuthAsync(string requestId, CefSharp.DevTools.Fetch.AuthChallengeResponse authChallengeResponse) + { + ValidateContinueWithAuth(requestId, authChallengeResponse); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("authChallengeResponse", authChallengeResponse.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Fetch.continueWithAuth", dict); + } + + partial void ValidateContinueResponse(string requestId, int? responseCode = null, string responsePhrase = null, System.Collections.Generic.IList responseHeaders = null, byte[] binaryResponseHeaders = null); + /// + /// Continues loading of the paused response, optionally modifying the + /// response headers. If either responseCode or headers are modified, all of them + /// must be present. + /// + /// An id the client received in requestPaused event. + /// An HTTP response code. If absent, original response code will be used. + /// A textual representation of responseCode.If absent, a standard phrase matching responseCode is used. + /// Response headers. If absent, original response headers will be used. + /// Alternative way of specifying response headers as a \0-separatedseries of name: value pairs. Prefer the above method unless youneed to represent some non-UTF8 values that can't be transmittedover the protocol as text. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ContinueResponseAsync(string requestId, int? responseCode = null, string responsePhrase = null, System.Collections.Generic.IList responseHeaders = null, byte[] binaryResponseHeaders = null) + { + ValidateContinueResponse(requestId, responseCode, responsePhrase, responseHeaders, binaryResponseHeaders); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + if (responseCode.HasValue) + { + dict.Add("responseCode", responseCode.Value); + } + + if (!(string.IsNullOrEmpty(responsePhrase))) + { + dict.Add("responsePhrase", responsePhrase); + } + + if ((responseHeaders) != (null)) + { + dict.Add("responseHeaders", responseHeaders.Select(x => x.ToDictionary())); + } + + if ((binaryResponseHeaders) != (null)) + { + dict.Add("binaryResponseHeaders", ToBase64String(binaryResponseHeaders)); + } + + return _client.ExecuteDevToolsMethodAsync("Fetch.continueResponse", dict); + } + + partial void ValidateGetResponseBody(string requestId); + /// + /// Causes the body of the response to be received from the server and + /// returned as a single string. May only be issued for a request that + /// is paused in the Response stage and is mutually exclusive with + /// takeResponseBodyForInterceptionAsStream. Calling other methods that + /// affect the request or disabling fetch domain before body is received + /// results in an undefined behavior. + /// Note that the response body is not available for redirects. Requests + /// paused in the _redirect received_ state may be differentiated by + /// `responseCode` and presence of `location` response header, see + /// comments to `requestPaused` for details. + /// + /// Identifier for the intercepted request to get body for. + /// returns System.Threading.Tasks.Task<GetResponseBodyResponse> + public System.Threading.Tasks.Task GetResponseBodyAsync(string requestId) + { + ValidateGetResponseBody(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Fetch.getResponseBody", dict); + } + + partial void ValidateTakeResponseBodyAsStream(string requestId); + /// + /// Returns a handle to the stream representing the response body. + /// The request must be paused in the HeadersReceived stage. + /// Note that after this command the request can't be continued + /// as is -- client either needs to cancel it or to provide the + /// response body. + /// The stream only supports sequential read, IO.read will fail if the position + /// is specified. + /// This method is mutually exclusive with getResponseBody. + /// Calling other methods that affect the request or disabling fetch + /// domain before body is received results in an undefined behavior. + /// + /// requestId + /// returns System.Threading.Tasks.Task<TakeResponseBodyAsStreamResponse> + public System.Threading.Tasks.Task TakeResponseBodyAsStreamAsync(string requestId) + { + ValidateTakeResponseBodyAsStream(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Fetch.takeResponseBodyAsStream", dict); + } + } +} + +namespace CefSharp.DevTools.FileSystem +{ + /// + /// GetDirectoryResponse + /// + public class GetDirectoryResponse : DevToolsDomainResponseBase + { + /// + /// directory + /// + [JsonInclude] + [JsonPropertyName("directory")] + public CefSharp.DevTools.FileSystem.Directory Directory + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.FileSystem +{ + using System.Linq; + + /// + /// FileSystem + /// + public partial class FileSystemClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// FileSystem + /// + /// DevToolsClient + public FileSystemClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateGetDirectory(CefSharp.DevTools.FileSystem.BucketFileSystemLocator bucketFileSystemLocator); + /// + /// GetDirectory + /// + /// bucketFileSystemLocator + /// returns System.Threading.Tasks.Task<GetDirectoryResponse> + public System.Threading.Tasks.Task GetDirectoryAsync(CefSharp.DevTools.FileSystem.BucketFileSystemLocator bucketFileSystemLocator) + { + ValidateGetDirectory(bucketFileSystemLocator); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("bucketFileSystemLocator", bucketFileSystemLocator.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("FileSystem.getDirectory", dict); + } + } +} + +namespace CefSharp.DevTools.HeadlessExperimental +{ + /// + /// BeginFrameResponse + /// + public class BeginFrameResponse : DevToolsDomainResponseBase + { + /// + /// hasDamage + /// + [JsonInclude] + [JsonPropertyName("hasDamage")] + public bool HasDamage + { + get; + private set; + } + + /// + /// screenshotData + /// + [JsonInclude] + [JsonPropertyName("screenshotData")] + public byte[] ScreenshotData + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.HeadlessExperimental +{ + using System.Linq; + + /// + /// This domain provides experimental commands only supported in headless mode. + /// + public partial class HeadlessExperimentalClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// HeadlessExperimental + /// + /// DevToolsClient + public HeadlessExperimentalClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateBeginFrame(double? frameTimeTicks = null, double? interval = null, bool? noDisplayUpdates = null, CefSharp.DevTools.HeadlessExperimental.ScreenshotParams screenshot = null); + /// + /// Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a + /// screenshot from the resulting frame. Requires that the target was created with enabled + /// BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also + /// https://goo.gle/chrome-headless-rendering for more background. + /// + /// Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set,the current time will be used. + /// The interval between BeginFrames that is reported to the compositor, in milliseconds.Defaults to a 60 frames/second interval, i.e. about 16.666 milliseconds. + /// Whether updates should not be committed and drawn onto the display. False by default. Iftrue, only side effects of the BeginFrame will be run, such as layout and animations, butany visual updates may not be visible on the display or in screenshots. + /// If set, a screenshot of the frame will be captured and returned in the response. Otherwise,no screenshot will be captured. Note that capturing a screenshot can fail, for example,during renderer initialization. In such a case, no screenshot data will be returned. + /// returns System.Threading.Tasks.Task<BeginFrameResponse> + public System.Threading.Tasks.Task BeginFrameAsync(double? frameTimeTicks = null, double? interval = null, bool? noDisplayUpdates = null, CefSharp.DevTools.HeadlessExperimental.ScreenshotParams screenshot = null) + { + ValidateBeginFrame(frameTimeTicks, interval, noDisplayUpdates, screenshot); + var dict = new System.Collections.Generic.Dictionary(); + if (frameTimeTicks.HasValue) + { + dict.Add("frameTimeTicks", frameTimeTicks.Value); + } + + if (interval.HasValue) + { + dict.Add("interval", interval.Value); + } + + if (noDisplayUpdates.HasValue) + { + dict.Add("noDisplayUpdates", noDisplayUpdates.Value); + } + + if ((screenshot) != (null)) + { + dict.Add("screenshot", screenshot.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("HeadlessExperimental.beginFrame", dict); + } + } +} + +namespace CefSharp.DevTools.IO +{ + /// + /// ReadResponse + /// + public class ReadResponse : DevToolsDomainResponseBase + { + /// + /// base64Encoded + /// + [JsonInclude] + [JsonPropertyName("base64Encoded")] + public bool? Base64Encoded + { + get; + private set; + } + + /// + /// data + /// + [JsonInclude] + [JsonPropertyName("data")] + public string Data + { + get; + private set; + } + + /// + /// eof + /// + [JsonInclude] + [JsonPropertyName("eof")] + public bool Eof + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.IO +{ + /// + /// ResolveBlobResponse + /// + public class ResolveBlobResponse : DevToolsDomainResponseBase + { + /// + /// uuid + /// + [JsonInclude] + [JsonPropertyName("uuid")] + public string Uuid + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.IO +{ + using System.Linq; + + /// + /// Input/Output operations for streams produced by DevTools. + /// + public partial class IOClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// IO + /// + /// DevToolsClient + public IOClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateClose(string handle); + /// + /// Close the stream, discard any temporary backing storage. + /// + /// Handle of the stream to close. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CloseAsync(string handle) + { + ValidateClose(handle); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("handle", handle); + return _client.ExecuteDevToolsMethodAsync("IO.close", dict); + } + + partial void ValidateRead(string handle, int? offset = null, int? size = null); + /// + /// Read a chunk of the stream + /// + /// Handle of the stream to read. + /// Seek to the specified offset before reading (if not specified, proceed with offsetfollowing the last read). Some types of streams may only support sequential reads. + /// Maximum number of bytes to read (left upon the agent discretion if not specified). + /// returns System.Threading.Tasks.Task<ReadResponse> + public System.Threading.Tasks.Task ReadAsync(string handle, int? offset = null, int? size = null) + { + ValidateRead(handle, offset, size); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("handle", handle); + if (offset.HasValue) + { + dict.Add("offset", offset.Value); + } + + if (size.HasValue) + { + dict.Add("size", size.Value); + } + + return _client.ExecuteDevToolsMethodAsync("IO.read", dict); + } + + partial void ValidateResolveBlob(string objectId); + /// + /// Return UUID of Blob object specified by a remote object id. + /// + /// Object id of a Blob object wrapper. + /// returns System.Threading.Tasks.Task<ResolveBlobResponse> + public System.Threading.Tasks.Task ResolveBlobAsync(string objectId) + { + ValidateResolveBlob(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("IO.resolveBlob", dict); + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// RequestDataResponse + /// + public class RequestDataResponse : DevToolsDomainResponseBase + { + /// + /// objectStoreDataEntries + /// + [JsonInclude] + [JsonPropertyName("objectStoreDataEntries")] + public System.Collections.Generic.IList ObjectStoreDataEntries + { + get; + private set; + } + + /// + /// hasMore + /// + [JsonInclude] + [JsonPropertyName("hasMore")] + public bool HasMore + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// GetMetadataResponse + /// + public class GetMetadataResponse : DevToolsDomainResponseBase + { + /// + /// entriesCount + /// + [JsonInclude] + [JsonPropertyName("entriesCount")] + public double EntriesCount + { + get; + private set; + } + + /// + /// keyGeneratorValue + /// + [JsonInclude] + [JsonPropertyName("keyGeneratorValue")] + public double KeyGeneratorValue + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// RequestDatabaseResponse + /// + public class RequestDatabaseResponse : DevToolsDomainResponseBase + { + /// + /// databaseWithObjectStores + /// + [JsonInclude] + [JsonPropertyName("databaseWithObjectStores")] + public CefSharp.DevTools.IndexedDB.DatabaseWithObjectStores DatabaseWithObjectStores + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + /// + /// RequestDatabaseNamesResponse + /// + public class RequestDatabaseNamesResponse : DevToolsDomainResponseBase + { + /// + /// databaseNames + /// + [JsonInclude] + [JsonPropertyName("databaseNames")] + public string[] DatabaseNames + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.IndexedDB +{ + using System.Linq; + + /// + /// IndexedDB + /// + public partial class IndexedDBClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// IndexedDB + /// + /// DevToolsClient + public IndexedDBClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateClearObjectStore(string databaseName, string objectStoreName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Clears all entries from an object store. + /// + /// Database name. + /// Object store name. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearObjectStoreAsync(string databaseName, string objectStoreName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateClearObjectStore(databaseName, objectStoreName, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + dict.Add("objectStoreName", objectStoreName); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.clearObjectStore", dict); + } + + partial void ValidateDeleteDatabase(string databaseName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Deletes a database. + /// + /// Database name. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteDatabaseAsync(string databaseName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateDeleteDatabase(databaseName, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.deleteDatabase", dict); + } + + partial void ValidateDeleteObjectStoreEntries(string databaseName, string objectStoreName, CefSharp.DevTools.IndexedDB.KeyRange keyRange, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Delete a range of entries from an object store + /// + /// databaseName + /// objectStoreName + /// Range of entry keys to delete + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteObjectStoreEntriesAsync(string databaseName, string objectStoreName, CefSharp.DevTools.IndexedDB.KeyRange keyRange, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateDeleteObjectStoreEntries(databaseName, objectStoreName, keyRange, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + dict.Add("objectStoreName", objectStoreName); + dict.Add("keyRange", keyRange.ToDictionary()); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.deleteObjectStoreEntries", dict); + } + + /// + /// Disables events from backend. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("IndexedDB.disable", dict); + } + + /// + /// Enables events from backend. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("IndexedDB.enable", dict); + } + + partial void ValidateRequestData(string databaseName, string objectStoreName, int skipCount, int pageSize, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null, string indexName = null, CefSharp.DevTools.IndexedDB.KeyRange keyRange = null); + /// + /// Requests data from object store or index. + /// + /// Database name. + /// Object store name. + /// Number of records to skip. + /// Number of records to fetch. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// Index name. If not specified, it performs an object store data request. + /// Key range. + /// returns System.Threading.Tasks.Task<RequestDataResponse> + public System.Threading.Tasks.Task RequestDataAsync(string databaseName, string objectStoreName, int skipCount, int pageSize, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null, string indexName = null, CefSharp.DevTools.IndexedDB.KeyRange keyRange = null) + { + ValidateRequestData(databaseName, objectStoreName, skipCount, pageSize, securityOrigin, storageKey, storageBucket, indexName, keyRange); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + dict.Add("objectStoreName", objectStoreName); + dict.Add("skipCount", skipCount); + dict.Add("pageSize", pageSize); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + if (!(string.IsNullOrEmpty(indexName))) + { + dict.Add("indexName", indexName); + } + + if ((keyRange) != (null)) + { + dict.Add("keyRange", keyRange.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.requestData", dict); + } + + partial void ValidateGetMetadata(string databaseName, string objectStoreName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Gets metadata of an object store. + /// + /// Database name. + /// Object store name. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<GetMetadataResponse> + public System.Threading.Tasks.Task GetMetadataAsync(string databaseName, string objectStoreName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateGetMetadata(databaseName, objectStoreName, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + dict.Add("objectStoreName", objectStoreName); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.getMetadata", dict); + } + + partial void ValidateRequestDatabase(string databaseName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Requests database with given name in given frame. + /// + /// Database name. + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<RequestDatabaseResponse> + public System.Threading.Tasks.Task RequestDatabaseAsync(string databaseName, string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateRequestDatabase(databaseName, securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("databaseName", databaseName); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.requestDatabase", dict); + } + + partial void ValidateRequestDatabaseNames(string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null); + /// + /// Requests database names for given security origin. + /// + /// At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.Security origin. + /// Storage key. + /// Storage bucket. If not specified, it uses the default bucket. + /// returns System.Threading.Tasks.Task<RequestDatabaseNamesResponse> + public System.Threading.Tasks.Task RequestDatabaseNamesAsync(string securityOrigin = null, string storageKey = null, CefSharp.DevTools.Storage.StorageBucket storageBucket = null) + { + ValidateRequestDatabaseNames(securityOrigin, storageKey, storageBucket); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(securityOrigin))) + { + dict.Add("securityOrigin", securityOrigin); + } + + if (!(string.IsNullOrEmpty(storageKey))) + { + dict.Add("storageKey", storageKey); + } + + if ((storageBucket) != (null)) + { + dict.Add("storageBucket", storageBucket.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("IndexedDB.requestDatabaseNames", dict); + } + } +} + +namespace CefSharp.DevTools.Input +{ + using System.Linq; + + /// + /// Type of the drag event. + /// + public enum DispatchDragEventType + { + /// + /// dragEnter + /// + [JsonPropertyName("dragEnter")] + DragEnter, + /// + /// dragOver + /// + [JsonPropertyName("dragOver")] + DragOver, + /// + /// drop + /// + [JsonPropertyName("drop")] + Drop, + /// + /// dragCancel + /// + [JsonPropertyName("dragCancel")] + DragCancel + } + + /// + /// Type of the key event. + /// + public enum DispatchKeyEventType + { + /// + /// keyDown + /// + [JsonPropertyName("keyDown")] + KeyDown, + /// + /// keyUp + /// + [JsonPropertyName("keyUp")] + KeyUp, + /// + /// rawKeyDown + /// + [JsonPropertyName("rawKeyDown")] + RawKeyDown, + /// + /// char + /// + [JsonPropertyName("char")] + Char + } + + /// + /// Type of the mouse event. + /// + public enum DispatchMouseEventType + { + /// + /// mousePressed + /// + [JsonPropertyName("mousePressed")] + MousePressed, + /// + /// mouseReleased + /// + [JsonPropertyName("mouseReleased")] + MouseReleased, + /// + /// mouseMoved + /// + [JsonPropertyName("mouseMoved")] + MouseMoved, + /// + /// mouseWheel + /// + [JsonPropertyName("mouseWheel")] + MouseWheel + } + + /// + /// Pointer type (default: "mouse"). + /// + public enum DispatchMouseEventPointerType + { + /// + /// mouse + /// + [JsonPropertyName("mouse")] + Mouse, + /// + /// pen + /// + [JsonPropertyName("pen")] + Pen + } + + /// + /// Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while + /// TouchStart and TouchMove must contains at least one. + /// + public enum DispatchTouchEventType + { + /// + /// touchStart + /// + [JsonPropertyName("touchStart")] + TouchStart, + /// + /// touchEnd + /// + [JsonPropertyName("touchEnd")] + TouchEnd, + /// + /// touchMove + /// + [JsonPropertyName("touchMove")] + TouchMove, + /// + /// touchCancel + /// + [JsonPropertyName("touchCancel")] + TouchCancel + } + + /// + /// Type of the mouse event. + /// + public enum EmulateTouchFromMouseEventType + { + /// + /// mousePressed + /// + [JsonPropertyName("mousePressed")] + MousePressed, + /// + /// mouseReleased + /// + [JsonPropertyName("mouseReleased")] + MouseReleased, + /// + /// mouseMoved + /// + [JsonPropertyName("mouseMoved")] + MouseMoved, + /// + /// mouseWheel + /// + [JsonPropertyName("mouseWheel")] + MouseWheel + } + + /// + /// Input + /// + public partial class InputClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Input + /// + /// DevToolsClient + public InputClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to + /// restore normal drag and drop behavior. + /// + public event System.EventHandler DragIntercepted + { + add + { + _client.AddEventHandler("Input.dragIntercepted", value); + } + + remove + { + _client.RemoveEventHandler("Input.dragIntercepted", value); + } + } + + partial void ValidateDispatchDragEvent(CefSharp.DevTools.Input.DispatchDragEventType type, double x, double y, CefSharp.DevTools.Input.DragData data, int? modifiers = null); + /// + /// Dispatches a drag event into the page. + /// + /// Type of the drag event. + /// X coordinate of the event relative to the main frame's viewport in CSS pixels. + /// Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers tothe top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + /// data + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchDragEventAsync(CefSharp.DevTools.Input.DispatchDragEventType type, double x, double y, CefSharp.DevTools.Input.DragData data, int? modifiers = null) + { + ValidateDispatchDragEvent(type, x, y, data, modifiers); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("x", x); + dict.Add("y", y); + dict.Add("data", data.ToDictionary()); + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Input.dispatchDragEvent", dict); + } + + partial void ValidateDispatchKeyEvent(CefSharp.DevTools.Input.DispatchKeyEventType type, int? modifiers = null, double? timestamp = null, string text = null, string unmodifiedText = null, string keyIdentifier = null, string code = null, string key = null, int? windowsVirtualKeyCode = null, int? nativeVirtualKeyCode = null, bool? autoRepeat = null, bool? isKeypad = null, bool? isSystemKey = null, int? location = null, string[] commands = null); + /// + /// Dispatches a key event to the page. + /// + /// Type of the key event. + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// Time at which the event occurred. + /// Text as generated by processing a virtual key code with a keyboard layout. Not needed forfor `keyUp` and `rawKeyDown` events (default: "") + /// Text that would have been generated by the keyboard if no modifiers were pressed (except forshift). Useful for shortcut (accelerator) key handling (default: ""). + /// Unique key identifier (e.g., 'U+0041') (default: ""). + /// Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: ""). + /// Unique DOM defined string value describing the meaning of the key in the context of activemodifiers, keyboard layout, etc (e.g., 'AltGr') (default: ""). + /// Windows virtual key code (default: 0). + /// Native virtual key code (default: 0). + /// Whether the event was generated from auto repeat (default: false). + /// Whether the event was generated from the keypad (default: false). + /// Whether the event was a system key event (default: false). + /// Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default:0). + /// Editing commands to send with the key event (e.g., 'selectAll') (default: []).These are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding.See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchKeyEventAsync(CefSharp.DevTools.Input.DispatchKeyEventType type, int? modifiers = null, double? timestamp = null, string text = null, string unmodifiedText = null, string keyIdentifier = null, string code = null, string key = null, int? windowsVirtualKeyCode = null, int? nativeVirtualKeyCode = null, bool? autoRepeat = null, bool? isKeypad = null, bool? isSystemKey = null, int? location = null, string[] commands = null) + { + ValidateDispatchKeyEvent(type, modifiers, timestamp, text, unmodifiedText, keyIdentifier, code, key, windowsVirtualKeyCode, nativeVirtualKeyCode, autoRepeat, isKeypad, isSystemKey, location, commands); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + if (timestamp.HasValue) + { + dict.Add("timestamp", timestamp.Value); + } + + if (!(string.IsNullOrEmpty(text))) + { + dict.Add("text", text); + } + + if (!(string.IsNullOrEmpty(unmodifiedText))) + { + dict.Add("unmodifiedText", unmodifiedText); + } + + if (!(string.IsNullOrEmpty(keyIdentifier))) + { + dict.Add("keyIdentifier", keyIdentifier); + } + + if (!(string.IsNullOrEmpty(code))) + { + dict.Add("code", code); + } + + if (!(string.IsNullOrEmpty(key))) + { + dict.Add("key", key); + } + + if (windowsVirtualKeyCode.HasValue) + { + dict.Add("windowsVirtualKeyCode", windowsVirtualKeyCode.Value); + } + + if (nativeVirtualKeyCode.HasValue) + { + dict.Add("nativeVirtualKeyCode", nativeVirtualKeyCode.Value); + } + + if (autoRepeat.HasValue) + { + dict.Add("autoRepeat", autoRepeat.Value); + } + + if (isKeypad.HasValue) + { + dict.Add("isKeypad", isKeypad.Value); + } + + if (isSystemKey.HasValue) + { + dict.Add("isSystemKey", isSystemKey.Value); + } + + if (location.HasValue) + { + dict.Add("location", location.Value); + } + + if ((commands) != (null)) + { + dict.Add("commands", commands); + } + + return _client.ExecuteDevToolsMethodAsync("Input.dispatchKeyEvent", dict); + } + + partial void ValidateInsertText(string text); + /// + /// This method emulates inserting text that doesn't come from a key press, + /// for example an emoji keyboard or an IME. + /// + /// The text to insert. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task InsertTextAsync(string text) + { + ValidateInsertText(text); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("text", text); + return _client.ExecuteDevToolsMethodAsync("Input.insertText", dict); + } + + partial void ValidateImeSetComposition(string text, int selectionStart, int selectionEnd, int? replacementStart = null, int? replacementEnd = null); + /// + /// This method sets the current candidate text for IME. + /// Use imeCommitComposition to commit the final text. + /// Use imeSetComposition with empty string as text to cancel composition. + /// + /// The text to insert + /// selection start + /// selection end + /// replacement start + /// replacement end + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ImeSetCompositionAsync(string text, int selectionStart, int selectionEnd, int? replacementStart = null, int? replacementEnd = null) + { + ValidateImeSetComposition(text, selectionStart, selectionEnd, replacementStart, replacementEnd); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("text", text); + dict.Add("selectionStart", selectionStart); + dict.Add("selectionEnd", selectionEnd); + if (replacementStart.HasValue) + { + dict.Add("replacementStart", replacementStart.Value); + } + + if (replacementEnd.HasValue) + { + dict.Add("replacementEnd", replacementEnd.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Input.imeSetComposition", dict); + } + + partial void ValidateDispatchMouseEvent(CefSharp.DevTools.Input.DispatchMouseEventType type, double x, double y, int? modifiers = null, double? timestamp = null, CefSharp.DevTools.Input.MouseButton? button = null, int? buttons = null, int? clickCount = null, double? force = null, double? tangentialPressure = null, double? tiltX = null, double? tiltY = null, int? twist = null, double? deltaX = null, double? deltaY = null, CefSharp.DevTools.Input.DispatchMouseEventPointerType? pointerType = null); + /// + /// Dispatches a mouse event to the page. + /// + /// Type of the mouse event. + /// X coordinate of the event relative to the main frame's viewport in CSS pixels. + /// Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers tothe top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// Time at which the event occurred. + /// Mouse button (default: "none"). + /// A number indicating which buttons are pressed on the mouse when a mouse event is triggered.Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0. + /// Number of times the mouse button was clicked (default: 0). + /// The normalized pressure, which has a range of [0,1] (default: 0). + /// The normalized tangential pressure, which has a range of [-1,1] (default: 0). + /// The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0). + /// The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0). + /// The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0). + /// X delta in CSS pixels for mouse wheel event (default: 0). + /// Y delta in CSS pixels for mouse wheel event (default: 0). + /// Pointer type (default: "mouse"). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchMouseEventAsync(CefSharp.DevTools.Input.DispatchMouseEventType type, double x, double y, int? modifiers = null, double? timestamp = null, CefSharp.DevTools.Input.MouseButton? button = null, int? buttons = null, int? clickCount = null, double? force = null, double? tangentialPressure = null, double? tiltX = null, double? tiltY = null, int? twist = null, double? deltaX = null, double? deltaY = null, CefSharp.DevTools.Input.DispatchMouseEventPointerType? pointerType = null) + { + ValidateDispatchMouseEvent(type, x, y, modifiers, timestamp, button, buttons, clickCount, force, tangentialPressure, tiltX, tiltY, twist, deltaX, deltaY, pointerType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("x", x); + dict.Add("y", y); + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + if (timestamp.HasValue) + { + dict.Add("timestamp", timestamp.Value); + } + + if (button.HasValue) + { + dict.Add("button", EnumToString(button)); + } + + if (buttons.HasValue) + { + dict.Add("buttons", buttons.Value); + } + + if (clickCount.HasValue) + { + dict.Add("clickCount", clickCount.Value); + } + + if (force.HasValue) + { + dict.Add("force", force.Value); + } + + if (tangentialPressure.HasValue) + { + dict.Add("tangentialPressure", tangentialPressure.Value); + } + + if (tiltX.HasValue) + { + dict.Add("tiltX", tiltX.Value); + } + + if (tiltY.HasValue) + { + dict.Add("tiltY", tiltY.Value); + } + + if (twist.HasValue) + { + dict.Add("twist", twist.Value); + } + + if (deltaX.HasValue) + { + dict.Add("deltaX", deltaX.Value); + } + + if (deltaY.HasValue) + { + dict.Add("deltaY", deltaY.Value); + } + + if (pointerType.HasValue) + { + dict.Add("pointerType", EnumToString(pointerType)); + } + + return _client.ExecuteDevToolsMethodAsync("Input.dispatchMouseEvent", dict); + } + + partial void ValidateDispatchTouchEvent(CefSharp.DevTools.Input.DispatchTouchEventType type, System.Collections.Generic.IList touchPoints, int? modifiers = null, double? timestamp = null); + /// + /// Dispatches a touch event to the page. + /// + /// Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, whileTouchStart and TouchMove must contains at least one. + /// Active touch points on the touch device. One event per any changed point (compared toprevious touch event in a sequence) is generated, emulating pressing/moving/releasing pointsone by one. + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// Time at which the event occurred. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchTouchEventAsync(CefSharp.DevTools.Input.DispatchTouchEventType type, System.Collections.Generic.IList touchPoints, int? modifiers = null, double? timestamp = null) + { + ValidateDispatchTouchEvent(type, touchPoints, modifiers, timestamp); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("touchPoints", touchPoints.Select(x => x.ToDictionary())); + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + if (timestamp.HasValue) + { + dict.Add("timestamp", timestamp.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Input.dispatchTouchEvent", dict); + } + + /// + /// Cancels any active dragging in the page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CancelDraggingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Input.cancelDragging", dict); + } + + partial void ValidateEmulateTouchFromMouseEvent(CefSharp.DevTools.Input.EmulateTouchFromMouseEventType type, int x, int y, CefSharp.DevTools.Input.MouseButton button, double? timestamp = null, double? deltaX = null, double? deltaY = null, int? modifiers = null, int? clickCount = null); + /// + /// Emulates touch event from the mouse event parameters. + /// + /// Type of the mouse event. + /// X coordinate of the mouse pointer in DIP. + /// Y coordinate of the mouse pointer in DIP. + /// Mouse button. Only "none", "left", "right" are supported. + /// Time at which the event occurred (default: current time). + /// X delta in DIP for mouse wheel event (default: 0). + /// Y delta in DIP for mouse wheel event (default: 0). + /// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8(default: 0). + /// Number of times the mouse button was clicked (default: 0). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EmulateTouchFromMouseEventAsync(CefSharp.DevTools.Input.EmulateTouchFromMouseEventType type, int x, int y, CefSharp.DevTools.Input.MouseButton button, double? timestamp = null, double? deltaX = null, double? deltaY = null, int? modifiers = null, int? clickCount = null) + { + ValidateEmulateTouchFromMouseEvent(type, x, y, button, timestamp, deltaX, deltaY, modifiers, clickCount); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("type", EnumToString(type)); + dict.Add("x", x); + dict.Add("y", y); + dict.Add("button", EnumToString(button)); + if (timestamp.HasValue) + { + dict.Add("timestamp", timestamp.Value); + } + + if (deltaX.HasValue) + { + dict.Add("deltaX", deltaX.Value); + } + + if (deltaY.HasValue) + { + dict.Add("deltaY", deltaY.Value); + } + + if (modifiers.HasValue) + { + dict.Add("modifiers", modifiers.Value); + } + + if (clickCount.HasValue) + { + dict.Add("clickCount", clickCount.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Input.emulateTouchFromMouseEvent", dict); + } + + partial void ValidateSetIgnoreInputEvents(bool ignore); + /// + /// Ignores input events (useful while auditing page). + /// + /// Ignores input events processing when set to true. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetIgnoreInputEventsAsync(bool ignore) + { + ValidateSetIgnoreInputEvents(ignore); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ignore", ignore); + return _client.ExecuteDevToolsMethodAsync("Input.setIgnoreInputEvents", dict); + } + + partial void ValidateSetInterceptDrags(bool enabled); + /// + /// Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events. + /// Drag and drop behavior can be directly controlled via `Input.dispatchDragEvent`. + /// + /// enabled + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInterceptDragsAsync(bool enabled) + { + ValidateSetInterceptDrags(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Input.setInterceptDrags", dict); + } + + partial void ValidateSynthesizePinchGesture(double x, double y, double scaleFactor, int? relativeSpeed = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null); + /// + /// Synthesizes a pinch gesture over a time period by issuing appropriate touch events. + /// + /// X coordinate of the start of the gesture in CSS pixels. + /// Y coordinate of the start of the gesture in CSS pixels. + /// Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out). + /// Relative pointer speed in pixels per second (default: 800). + /// Which type of input events to be generated (default: 'default', which queries the platformfor the preferred input type). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SynthesizePinchGestureAsync(double x, double y, double scaleFactor, int? relativeSpeed = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null) + { + ValidateSynthesizePinchGesture(x, y, scaleFactor, relativeSpeed, gestureSourceType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + dict.Add("scaleFactor", scaleFactor); + if (relativeSpeed.HasValue) + { + dict.Add("relativeSpeed", relativeSpeed.Value); + } + + if (gestureSourceType.HasValue) + { + dict.Add("gestureSourceType", EnumToString(gestureSourceType)); + } + + return _client.ExecuteDevToolsMethodAsync("Input.synthesizePinchGesture", dict); + } + + partial void ValidateSynthesizeScrollGesture(double x, double y, double? xDistance = null, double? yDistance = null, double? xOverscroll = null, double? yOverscroll = null, bool? preventFling = null, int? speed = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null, int? repeatCount = null, int? repeatDelayMs = null, string interactionMarkerName = null); + /// + /// Synthesizes a scroll gesture over a time period by issuing appropriate touch events. + /// + /// X coordinate of the start of the gesture in CSS pixels. + /// Y coordinate of the start of the gesture in CSS pixels. + /// The distance to scroll along the X axis (positive to scroll left). + /// The distance to scroll along the Y axis (positive to scroll up). + /// The number of additional pixels to scroll back along the X axis, in addition to the givendistance. + /// The number of additional pixels to scroll back along the Y axis, in addition to the givendistance. + /// Prevent fling (default: true). + /// Swipe speed in pixels per second (default: 800). + /// Which type of input events to be generated (default: 'default', which queries the platformfor the preferred input type). + /// The number of times to repeat the gesture (default: 0). + /// The number of milliseconds delay between each repeat. (default: 250). + /// The name of the interaction markers to generate, if not empty (default: ""). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SynthesizeScrollGestureAsync(double x, double y, double? xDistance = null, double? yDistance = null, double? xOverscroll = null, double? yOverscroll = null, bool? preventFling = null, int? speed = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null, int? repeatCount = null, int? repeatDelayMs = null, string interactionMarkerName = null) + { + ValidateSynthesizeScrollGesture(x, y, xDistance, yDistance, xOverscroll, yOverscroll, preventFling, speed, gestureSourceType, repeatCount, repeatDelayMs, interactionMarkerName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + if (xDistance.HasValue) + { + dict.Add("xDistance", xDistance.Value); + } + + if (yDistance.HasValue) + { + dict.Add("yDistance", yDistance.Value); + } + + if (xOverscroll.HasValue) + { + dict.Add("xOverscroll", xOverscroll.Value); + } + + if (yOverscroll.HasValue) + { + dict.Add("yOverscroll", yOverscroll.Value); + } + + if (preventFling.HasValue) + { + dict.Add("preventFling", preventFling.Value); + } + + if (speed.HasValue) + { + dict.Add("speed", speed.Value); + } + + if (gestureSourceType.HasValue) + { + dict.Add("gestureSourceType", EnumToString(gestureSourceType)); + } + + if (repeatCount.HasValue) + { + dict.Add("repeatCount", repeatCount.Value); + } + + if (repeatDelayMs.HasValue) + { + dict.Add("repeatDelayMs", repeatDelayMs.Value); + } + + if (!(string.IsNullOrEmpty(interactionMarkerName))) + { + dict.Add("interactionMarkerName", interactionMarkerName); + } + + return _client.ExecuteDevToolsMethodAsync("Input.synthesizeScrollGesture", dict); + } + + partial void ValidateSynthesizeTapGesture(double x, double y, int? duration = null, int? tapCount = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null); + /// + /// Synthesizes a tap gesture over a time period by issuing appropriate touch events. + /// + /// X coordinate of the start of the gesture in CSS pixels. + /// Y coordinate of the start of the gesture in CSS pixels. + /// Duration between touchdown and touchup events in ms (default: 50). + /// Number of times to perform the tap (e.g. 2 for double tap, default: 1). + /// Which type of input events to be generated (default: 'default', which queries the platformfor the preferred input type). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SynthesizeTapGestureAsync(double x, double y, int? duration = null, int? tapCount = null, CefSharp.DevTools.Input.GestureSourceType? gestureSourceType = null) + { + ValidateSynthesizeTapGesture(x, y, duration, tapCount, gestureSourceType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + if (duration.HasValue) + { + dict.Add("duration", duration.Value); + } + + if (tapCount.HasValue) + { + dict.Add("tapCount", tapCount.Value); + } + + if (gestureSourceType.HasValue) + { + dict.Add("gestureSourceType", EnumToString(gestureSourceType)); + } + + return _client.ExecuteDevToolsMethodAsync("Input.synthesizeTapGesture", dict); + } + } +} + +namespace CefSharp.DevTools.Inspector +{ + using System.Linq; + + /// + /// Inspector + /// + public partial class InspectorClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Inspector + /// + /// DevToolsClient + public InspectorClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when remote debugging connection is about to be terminated. Contains detach reason. + /// + public event System.EventHandler Detached + { + add + { + _client.AddEventHandler("Inspector.detached", value); + } + + remove + { + _client.RemoveEventHandler("Inspector.detached", value); + } + } + + /// + /// Fired when debugging target has crashed + /// + public event System.EventHandler TargetCrashed + { + add + { + _client.AddEventHandler("Inspector.targetCrashed", value); + } + + remove + { + _client.RemoveEventHandler("Inspector.targetCrashed", value); + } + } + + /// + /// Fired when debugging target has reloaded after crash + /// + public event System.EventHandler TargetReloadedAfterCrash + { + add + { + _client.AddEventHandler("Inspector.targetReloadedAfterCrash", value); + } + + remove + { + _client.RemoveEventHandler("Inspector.targetReloadedAfterCrash", value); + } + } + + /// + /// Fired on worker targets when main worker script and any imported scripts have been evaluated. + /// + public event System.EventHandler WorkerScriptLoaded + { + add + { + _client.AddEventHandler("Inspector.workerScriptLoaded", value); + } + + remove + { + _client.RemoveEventHandler("Inspector.workerScriptLoaded", value); + } + } + + /// + /// Disables inspector domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Inspector.disable", dict); + } + + /// + /// Enables inspector domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Inspector.enable", dict); + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// CompositingReasonsResponse + /// + public class CompositingReasonsResponse : DevToolsDomainResponseBase + { + /// + /// compositingReasons + /// + [JsonInclude] + [JsonPropertyName("compositingReasons")] + public string[] CompositingReasons + { + get; + private set; + } + + /// + /// compositingReasonIds + /// + [JsonInclude] + [JsonPropertyName("compositingReasonIds")] + public string[] CompositingReasonIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// LoadSnapshotResponse + /// + public class LoadSnapshotResponse : DevToolsDomainResponseBase + { + /// + /// snapshotId + /// + [JsonInclude] + [JsonPropertyName("snapshotId")] + public string SnapshotId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// MakeSnapshotResponse + /// + public class MakeSnapshotResponse : DevToolsDomainResponseBase + { + /// + /// snapshotId + /// + [JsonInclude] + [JsonPropertyName("snapshotId")] + public string SnapshotId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// ProfileSnapshotResponse + /// + public class ProfileSnapshotResponse : DevToolsDomainResponseBase + { + /// + /// timings + /// + [JsonInclude] + [JsonPropertyName("timings")] + public double[] Timings + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// ReplaySnapshotResponse + /// + public class ReplaySnapshotResponse : DevToolsDomainResponseBase + { + /// + /// dataURL + /// + [JsonInclude] + [JsonPropertyName("dataURL")] + public string DataURL + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + /// + /// SnapshotCommandLogResponse + /// + public class SnapshotCommandLogResponse : DevToolsDomainResponseBase + { + /// + /// commandLog + /// + [JsonInclude] + [JsonPropertyName("commandLog")] + public System.Collections.Generic.IList CommandLog + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.LayerTree +{ + using System.Linq; + + /// + /// LayerTree + /// + public partial class LayerTreeClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// LayerTree + /// + /// DevToolsClient + public LayerTreeClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// LayerPainted + /// + public event System.EventHandler LayerPainted + { + add + { + _client.AddEventHandler("LayerTree.layerPainted", value); + } + + remove + { + _client.RemoveEventHandler("LayerTree.layerPainted", value); + } + } + + /// + /// LayerTreeDidChange + /// + public event System.EventHandler LayerTreeDidChange + { + add + { + _client.AddEventHandler("LayerTree.layerTreeDidChange", value); + } + + remove + { + _client.RemoveEventHandler("LayerTree.layerTreeDidChange", value); + } + } + + partial void ValidateCompositingReasons(string layerId); + /// + /// Provides the reasons why the given layer was composited. + /// + /// The id of the layer for which we want to get the reasons it was composited. + /// returns System.Threading.Tasks.Task<CompositingReasonsResponse> + public System.Threading.Tasks.Task CompositingReasonsAsync(string layerId) + { + ValidateCompositingReasons(layerId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("layerId", layerId); + return _client.ExecuteDevToolsMethodAsync("LayerTree.compositingReasons", dict); + } + + /// + /// Disables compositing tree inspection. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("LayerTree.disable", dict); + } + + /// + /// Enables compositing tree inspection. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("LayerTree.enable", dict); + } + + partial void ValidateLoadSnapshot(System.Collections.Generic.IList tiles); + /// + /// Returns the snapshot identifier. + /// + /// An array of tiles composing the snapshot. + /// returns System.Threading.Tasks.Task<LoadSnapshotResponse> + public System.Threading.Tasks.Task LoadSnapshotAsync(System.Collections.Generic.IList tiles) + { + ValidateLoadSnapshot(tiles); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("tiles", tiles.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("LayerTree.loadSnapshot", dict); + } + + partial void ValidateMakeSnapshot(string layerId); + /// + /// Returns the layer snapshot identifier. + /// + /// The id of the layer. + /// returns System.Threading.Tasks.Task<MakeSnapshotResponse> + public System.Threading.Tasks.Task MakeSnapshotAsync(string layerId) + { + ValidateMakeSnapshot(layerId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("layerId", layerId); + return _client.ExecuteDevToolsMethodAsync("LayerTree.makeSnapshot", dict); + } + + partial void ValidateProfileSnapshot(string snapshotId, int? minRepeatCount = null, double? minDuration = null, CefSharp.DevTools.DOM.Rect clipRect = null); + /// + /// ProfileSnapshot + /// + /// The id of the layer snapshot. + /// The maximum number of times to replay the snapshot (1, if not specified). + /// The minimum duration (in seconds) to replay the snapshot. + /// The clip rectangle to apply when replaying the snapshot. + /// returns System.Threading.Tasks.Task<ProfileSnapshotResponse> + public System.Threading.Tasks.Task ProfileSnapshotAsync(string snapshotId, int? minRepeatCount = null, double? minDuration = null, CefSharp.DevTools.DOM.Rect clipRect = null) + { + ValidateProfileSnapshot(snapshotId, minRepeatCount, minDuration, clipRect); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("snapshotId", snapshotId); + if (minRepeatCount.HasValue) + { + dict.Add("minRepeatCount", minRepeatCount.Value); + } + + if (minDuration.HasValue) + { + dict.Add("minDuration", minDuration.Value); + } + + if ((clipRect) != (null)) + { + dict.Add("clipRect", clipRect.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("LayerTree.profileSnapshot", dict); + } + + partial void ValidateReleaseSnapshot(string snapshotId); + /// + /// Releases layer snapshot captured by the back-end. + /// + /// The id of the layer snapshot. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReleaseSnapshotAsync(string snapshotId) + { + ValidateReleaseSnapshot(snapshotId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("snapshotId", snapshotId); + return _client.ExecuteDevToolsMethodAsync("LayerTree.releaseSnapshot", dict); + } + + partial void ValidateReplaySnapshot(string snapshotId, int? fromStep = null, int? toStep = null, double? scale = null); + /// + /// Replays the layer snapshot and returns the resulting bitmap. + /// + /// The id of the layer snapshot. + /// The first step to replay from (replay from the very start if not specified). + /// The last step to replay to (replay till the end if not specified). + /// The scale to apply while replaying (defaults to 1). + /// returns System.Threading.Tasks.Task<ReplaySnapshotResponse> + public System.Threading.Tasks.Task ReplaySnapshotAsync(string snapshotId, int? fromStep = null, int? toStep = null, double? scale = null) + { + ValidateReplaySnapshot(snapshotId, fromStep, toStep, scale); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("snapshotId", snapshotId); + if (fromStep.HasValue) + { + dict.Add("fromStep", fromStep.Value); + } + + if (toStep.HasValue) + { + dict.Add("toStep", toStep.Value); + } + + if (scale.HasValue) + { + dict.Add("scale", scale.Value); + } + + return _client.ExecuteDevToolsMethodAsync("LayerTree.replaySnapshot", dict); + } + + partial void ValidateSnapshotCommandLog(string snapshotId); + /// + /// Replays the layer snapshot and returns canvas log. + /// + /// The id of the layer snapshot. + /// returns System.Threading.Tasks.Task<SnapshotCommandLogResponse> + public System.Threading.Tasks.Task SnapshotCommandLogAsync(string snapshotId) + { + ValidateSnapshotCommandLog(snapshotId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("snapshotId", snapshotId); + return _client.ExecuteDevToolsMethodAsync("LayerTree.snapshotCommandLog", dict); + } + } +} + +namespace CefSharp.DevTools.Log +{ + using System.Linq; + + /// + /// Provides access to log entries. + /// + public partial class LogClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Log + /// + /// DevToolsClient + public LogClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Issued when new message was logged. + /// + public event System.EventHandler EntryAdded + { + add + { + _client.AddEventHandler("Log.entryAdded", value); + } + + remove + { + _client.RemoveEventHandler("Log.entryAdded", value); + } + } + + /// + /// Clears the log. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Log.clear", dict); + } + + /// + /// Disables log domain, prevents further log entries from being reported to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Log.disable", dict); + } + + /// + /// Enables log domain, sends the entries collected so far to the client by means of the + /// `entryAdded` notification. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Log.enable", dict); + } + + partial void ValidateStartViolationsReport(System.Collections.Generic.IList config); + /// + /// start violation reporting. + /// + /// Configuration for violations. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartViolationsReportAsync(System.Collections.Generic.IList config) + { + ValidateStartViolationsReport(config); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("config", config.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Log.startViolationsReport", dict); + } + + /// + /// Stop violation reporting. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopViolationsReportAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Log.stopViolationsReport", dict); + } + } +} + +namespace CefSharp.DevTools.Media +{ + using System.Linq; + + /// + /// This domain allows detailed inspection of media elements. + /// + public partial class MediaClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Media + /// + /// DevToolsClient + public MediaClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// This can be called multiple times, and can be used to set / override / + /// remove player properties. A null propValue indicates removal. + /// + public event System.EventHandler PlayerPropertiesChanged + { + add + { + _client.AddEventHandler("Media.playerPropertiesChanged", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerPropertiesChanged", value); + } + } + + /// + /// Send events as a list, allowing them to be batched on the browser for less + /// congestion. If batched, events must ALWAYS be in chronological order. + /// + public event System.EventHandler PlayerEventsAdded + { + add + { + _client.AddEventHandler("Media.playerEventsAdded", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerEventsAdded", value); + } + } + + /// + /// Send a list of any messages that need to be delivered. + /// + public event System.EventHandler PlayerMessagesLogged + { + add + { + _client.AddEventHandler("Media.playerMessagesLogged", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerMessagesLogged", value); + } + } + + /// + /// Send a list of any errors that need to be delivered. + /// + public event System.EventHandler PlayerErrorsRaised + { + add + { + _client.AddEventHandler("Media.playerErrorsRaised", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerErrorsRaised", value); + } + } + + /// + /// Called whenever a player is created, or when a new agent joins and receives + /// a list of active players. If an agent is restored, it will receive one + /// event for each active player. + /// + public event System.EventHandler PlayerCreated + { + add + { + _client.AddEventHandler("Media.playerCreated", value); + } + + remove + { + _client.RemoveEventHandler("Media.playerCreated", value); + } + } + + /// + /// Enables the Media domain + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Media.enable", dict); + } + + /// + /// Disables the Media domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Media.disable", dict); + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetDOMCountersResponse + /// + public class GetDOMCountersResponse : DevToolsDomainResponseBase + { + /// + /// documents + /// + [JsonInclude] + [JsonPropertyName("documents")] + public int Documents + { + get; + private set; + } + + /// + /// nodes + /// + [JsonInclude] + [JsonPropertyName("nodes")] + public int Nodes + { + get; + private set; + } + + /// + /// jsEventListeners + /// + [JsonInclude] + [JsonPropertyName("jsEventListeners")] + public int JsEventListeners + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetDOMCountersForLeakDetectionResponse + /// + public class GetDOMCountersForLeakDetectionResponse : DevToolsDomainResponseBase + { + /// + /// counters + /// + [JsonInclude] + [JsonPropertyName("counters")] + public System.Collections.Generic.IList Counters + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetAllTimeSamplingProfileResponse + /// + public class GetAllTimeSamplingProfileResponse : DevToolsDomainResponseBase + { + /// + /// profile + /// + [JsonInclude] + [JsonPropertyName("profile")] + public CefSharp.DevTools.Memory.SamplingProfile Profile + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetBrowserSamplingProfileResponse + /// + public class GetBrowserSamplingProfileResponse : DevToolsDomainResponseBase + { + /// + /// profile + /// + [JsonInclude] + [JsonPropertyName("profile")] + public CefSharp.DevTools.Memory.SamplingProfile Profile + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Memory +{ + /// + /// GetSamplingProfileResponse + /// + public class GetSamplingProfileResponse : DevToolsDomainResponseBase + { + /// + /// profile + /// + [JsonInclude] + [JsonPropertyName("profile")] + public CefSharp.DevTools.Memory.SamplingProfile Profile + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Memory +{ + using System.Linq; + + /// + /// Memory + /// + public partial class MemoryClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Memory + /// + /// DevToolsClient + public MemoryClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Retruns current DOM object counters. + /// + /// returns System.Threading.Tasks.Task<GetDOMCountersResponse> + public System.Threading.Tasks.Task GetDOMCountersAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getDOMCounters", dict); + } + + /// + /// Retruns DOM object counters after preparing renderer for leak detection. + /// + /// returns System.Threading.Tasks.Task<GetDOMCountersForLeakDetectionResponse> + public System.Threading.Tasks.Task GetDOMCountersForLeakDetectionAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getDOMCountersForLeakDetection", dict); + } + + /// + /// Prepares for leak detection by terminating workers, stopping spellcheckers, + /// dropping non-essential internal caches, running garbage collections, etc. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task PrepareForLeakDetectionAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.prepareForLeakDetection", dict); + } + + /// + /// Simulate OomIntervention by purging V8 memory. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ForciblyPurgeJavaScriptMemoryAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.forciblyPurgeJavaScriptMemory", dict); + } + + partial void ValidateSetPressureNotificationsSuppressed(bool suppressed); + /// + /// Enable/disable suppressing memory pressure notifications in all processes. + /// + /// If true, memory pressure notifications will be suppressed. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPressureNotificationsSuppressedAsync(bool suppressed) + { + ValidateSetPressureNotificationsSuppressed(suppressed); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("suppressed", suppressed); + return _client.ExecuteDevToolsMethodAsync("Memory.setPressureNotificationsSuppressed", dict); + } + + partial void ValidateSimulatePressureNotification(CefSharp.DevTools.Memory.PressureLevel level); + /// + /// Simulate a memory pressure notification in all processes. + /// + /// Memory pressure level of the notification. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SimulatePressureNotificationAsync(CefSharp.DevTools.Memory.PressureLevel level) + { + ValidateSimulatePressureNotification(level); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("level", EnumToString(level)); + return _client.ExecuteDevToolsMethodAsync("Memory.simulatePressureNotification", dict); + } + + partial void ValidateStartSampling(int? samplingInterval = null, bool? suppressRandomness = null); + /// + /// Start collecting native memory profile. + /// + /// Average number of bytes between samples. + /// Do not randomize intervals between samples. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartSamplingAsync(int? samplingInterval = null, bool? suppressRandomness = null) + { + ValidateStartSampling(samplingInterval, suppressRandomness); + var dict = new System.Collections.Generic.Dictionary(); + if (samplingInterval.HasValue) + { + dict.Add("samplingInterval", samplingInterval.Value); + } + + if (suppressRandomness.HasValue) + { + dict.Add("suppressRandomness", suppressRandomness.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Memory.startSampling", dict); + } + + /// + /// Stop collecting native memory profile. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopSamplingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.stopSampling", dict); + } + + /// + /// Retrieve native memory allocations profile + /// collected since renderer process startup. + /// + /// returns System.Threading.Tasks.Task<GetAllTimeSamplingProfileResponse> + public System.Threading.Tasks.Task GetAllTimeSamplingProfileAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getAllTimeSamplingProfile", dict); + } + + /// + /// Retrieve native memory allocations profile + /// collected since browser process startup. + /// + /// returns System.Threading.Tasks.Task<GetBrowserSamplingProfileResponse> + public System.Threading.Tasks.Task GetBrowserSamplingProfileAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getBrowserSamplingProfile", dict); + } + + /// + /// Retrieve native memory allocations profile collected since last + /// `startSampling` call. + /// + /// returns System.Threading.Tasks.Task<GetSamplingProfileResponse> + public System.Threading.Tasks.Task GetSamplingProfileAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Memory.getSamplingProfile", dict); + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// EmulateNetworkConditionsByRuleResponse + /// + public class EmulateNetworkConditionsByRuleResponse : DevToolsDomainResponseBase + { + /// + /// ruleIds + /// + [JsonInclude] + [JsonPropertyName("ruleIds")] + public string[] RuleIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetCertificateResponse + /// + public class GetCertificateResponse : DevToolsDomainResponseBase + { + /// + /// tableNames + /// + [JsonInclude] + [JsonPropertyName("tableNames")] + public string[] TableNames + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetCookiesResponse + /// + public class GetCookiesResponse : DevToolsDomainResponseBase + { + /// + /// cookies + /// + [JsonInclude] + [JsonPropertyName("cookies")] + public System.Collections.Generic.IList Cookies + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetResponseBodyResponse + /// + public class GetResponseBodyResponse : DevToolsDomainResponseBase + { + /// + /// body + /// + [JsonInclude] + [JsonPropertyName("body")] + public string Body + { + get; + private set; + } + + /// + /// base64Encoded + /// + [JsonInclude] + [JsonPropertyName("base64Encoded")] + public bool Base64Encoded + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetRequestPostDataResponse + /// + public class GetRequestPostDataResponse : DevToolsDomainResponseBase + { + /// + /// postData + /// + [JsonInclude] + [JsonPropertyName("postData")] + public string PostData + { + get; + private set; + } + + /// + /// base64Encoded + /// + [JsonInclude] + [JsonPropertyName("base64Encoded")] + public bool Base64Encoded + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetResponseBodyForInterceptionResponse + /// + public class GetResponseBodyForInterceptionResponse : DevToolsDomainResponseBase + { + /// + /// body + /// + [JsonInclude] + [JsonPropertyName("body")] + public string Body + { + get; + private set; + } + + /// + /// base64Encoded + /// + [JsonInclude] + [JsonPropertyName("base64Encoded")] + public bool Base64Encoded + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// TakeResponseBodyForInterceptionAsStreamResponse + /// + public class TakeResponseBodyForInterceptionAsStreamResponse : DevToolsDomainResponseBase + { + /// + /// stream + /// + [JsonInclude] + [JsonPropertyName("stream")] + public string Stream + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// SearchInResponseBodyResponse + /// + public class SearchInResponseBodyResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public System.Collections.Generic.IList Result + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// SetCookieResponse + /// + public class SetCookieResponse : DevToolsDomainResponseBase + { + /// + /// success + /// + [JsonInclude] + [JsonPropertyName("success")] + public bool Success + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// StreamResourceContentResponse + /// + public class StreamResourceContentResponse : DevToolsDomainResponseBase + { + /// + /// bufferedData + /// + [JsonInclude] + [JsonPropertyName("bufferedData")] + public byte[] BufferedData + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// GetSecurityIsolationStatusResponse + /// + public class GetSecurityIsolationStatusResponse : DevToolsDomainResponseBase + { + /// + /// status + /// + [JsonInclude] + [JsonPropertyName("status")] + public CefSharp.DevTools.Network.SecurityIsolationStatus Status + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// FetchSchemefulSiteResponse + /// + public class FetchSchemefulSiteResponse : DevToolsDomainResponseBase + { + /// + /// schemefulSite + /// + [JsonInclude] + [JsonPropertyName("schemefulSite")] + public string SchemefulSite + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + /// + /// LoadNetworkResourceResponse + /// + public class LoadNetworkResourceResponse : DevToolsDomainResponseBase + { + /// + /// resource + /// + [JsonInclude] + [JsonPropertyName("resource")] + public CefSharp.DevTools.Network.LoadNetworkResourcePageResult Resource + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Network +{ + using System.Linq; + + /// + /// Network domain allows tracking network activities of the page. It exposes information about http, + /// file, data and other requests and responses, their headers, bodies, timing, etc. + /// + public partial class NetworkClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Network + /// + /// DevToolsClient + public NetworkClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when data chunk was received over the network. + /// + public event System.EventHandler DataReceived + { + add + { + _client.AddEventHandler("Network.dataReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.dataReceived", value); + } + } + + /// + /// Fired when EventSource message is received. + /// + public event System.EventHandler EventSourceMessageReceived + { + add + { + _client.AddEventHandler("Network.eventSourceMessageReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.eventSourceMessageReceived", value); + } + } + + /// + /// Fired when HTTP request has failed to load. + /// + public event System.EventHandler LoadingFailed + { + add + { + _client.AddEventHandler("Network.loadingFailed", value); + } + + remove + { + _client.RemoveEventHandler("Network.loadingFailed", value); + } + } + + /// + /// Fired when HTTP request has finished loading. + /// + public event System.EventHandler LoadingFinished + { + add + { + _client.AddEventHandler("Network.loadingFinished", value); + } + + remove + { + _client.RemoveEventHandler("Network.loadingFinished", value); + } + } + + /// + /// Fired if request ended up loading from cache. + /// + public event System.EventHandler RequestServedFromCache + { + add + { + _client.AddEventHandler("Network.requestServedFromCache", value); + } + + remove + { + _client.RemoveEventHandler("Network.requestServedFromCache", value); + } + } + + /// + /// Fired when page is about to send HTTP request. + /// + public event System.EventHandler RequestWillBeSent + { + add + { + _client.AddEventHandler("Network.requestWillBeSent", value); + } + + remove + { + _client.RemoveEventHandler("Network.requestWillBeSent", value); + } + } + + /// + /// Fired when resource loading priority is changed + /// + public event System.EventHandler ResourceChangedPriority + { + add + { + _client.AddEventHandler("Network.resourceChangedPriority", value); + } + + remove + { + _client.RemoveEventHandler("Network.resourceChangedPriority", value); + } + } + + /// + /// Fired when a signed exchange was received over the network + /// + public event System.EventHandler SignedExchangeReceived + { + add + { + _client.AddEventHandler("Network.signedExchangeReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.signedExchangeReceived", value); + } + } + + /// + /// Fired when HTTP response is available. + /// + public event System.EventHandler ResponseReceived + { + add + { + _client.AddEventHandler("Network.responseReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.responseReceived", value); + } + } + + /// + /// Fired when WebSocket is closed. + /// + public event System.EventHandler WebSocketClosed + { + add + { + _client.AddEventHandler("Network.webSocketClosed", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketClosed", value); + } + } + + /// + /// Fired upon WebSocket creation. + /// + public event System.EventHandler WebSocketCreated + { + add + { + _client.AddEventHandler("Network.webSocketCreated", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketCreated", value); + } + } + + /// + /// Fired when WebSocket message error occurs. + /// + public event System.EventHandler WebSocketFrameError + { + add + { + _client.AddEventHandler("Network.webSocketFrameError", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketFrameError", value); + } + } + + /// + /// Fired when WebSocket message is received. + /// + public event System.EventHandler WebSocketFrameReceived + { + add + { + _client.AddEventHandler("Network.webSocketFrameReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketFrameReceived", value); + } + } + + /// + /// Fired when WebSocket message is sent. + /// + public event System.EventHandler WebSocketFrameSent + { + add + { + _client.AddEventHandler("Network.webSocketFrameSent", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketFrameSent", value); + } + } + + /// + /// Fired when WebSocket handshake response becomes available. + /// + public event System.EventHandler WebSocketHandshakeResponseReceived + { + add + { + _client.AddEventHandler("Network.webSocketHandshakeResponseReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketHandshakeResponseReceived", value); + } + } + + /// + /// Fired when WebSocket is about to initiate handshake. + /// + public event System.EventHandler WebSocketWillSendHandshakeRequest + { + add + { + _client.AddEventHandler("Network.webSocketWillSendHandshakeRequest", value); + } + + remove + { + _client.RemoveEventHandler("Network.webSocketWillSendHandshakeRequest", value); + } + } + + /// + /// Fired upon WebTransport creation. + /// + public event System.EventHandler WebTransportCreated + { + add + { + _client.AddEventHandler("Network.webTransportCreated", value); + } + + remove + { + _client.RemoveEventHandler("Network.webTransportCreated", value); + } + } + + /// + /// Fired when WebTransport handshake is finished. + /// + public event System.EventHandler WebTransportConnectionEstablished + { + add + { + _client.AddEventHandler("Network.webTransportConnectionEstablished", value); + } + + remove + { + _client.RemoveEventHandler("Network.webTransportConnectionEstablished", value); + } + } + + /// + /// Fired when WebTransport is disposed. + /// + public event System.EventHandler WebTransportClosed + { + add + { + _client.AddEventHandler("Network.webTransportClosed", value); + } + + remove + { + _client.RemoveEventHandler("Network.webTransportClosed", value); + } + } + + /// + /// Fired upon direct_socket.TCPSocket creation. + /// + public event System.EventHandler DirectTCPSocketCreated + { + add + { + _client.AddEventHandler("Network.directTCPSocketCreated", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketCreated", value); + } + } + + /// + /// Fired when direct_socket.TCPSocket connection is opened. + /// + public event System.EventHandler DirectTCPSocketOpened + { + add + { + _client.AddEventHandler("Network.directTCPSocketOpened", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketOpened", value); + } + } + + /// + /// Fired when direct_socket.TCPSocket is aborted. + /// + public event System.EventHandler DirectTCPSocketAborted + { + add + { + _client.AddEventHandler("Network.directTCPSocketAborted", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketAborted", value); + } + } + + /// + /// Fired when direct_socket.TCPSocket is closed. + /// + public event System.EventHandler DirectTCPSocketClosed + { + add + { + _client.AddEventHandler("Network.directTCPSocketClosed", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketClosed", value); + } + } + + /// + /// Fired when data is sent to tcp direct socket stream. + /// + public event System.EventHandler DirectTCPSocketChunkSent + { + add + { + _client.AddEventHandler("Network.directTCPSocketChunkSent", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketChunkSent", value); + } + } + + /// + /// Fired when data is received from tcp direct socket stream. + /// + public event System.EventHandler DirectTCPSocketChunkReceived + { + add + { + _client.AddEventHandler("Network.directTCPSocketChunkReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.directTCPSocketChunkReceived", value); + } + } + + /// + /// DirectUDPSocketJoinedMulticastGroup + /// + public event System.EventHandler DirectUDPSocketJoinedMulticastGroup + { + add + { + _client.AddEventHandler("Network.directUDPSocketJoinedMulticastGroup", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketJoinedMulticastGroup", value); + } + } + + /// + /// DirectUDPSocketLeftMulticastGroup + /// + public event System.EventHandler DirectUDPSocketLeftMulticastGroup + { + add + { + _client.AddEventHandler("Network.directUDPSocketLeftMulticastGroup", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketLeftMulticastGroup", value); + } + } + + /// + /// Fired upon direct_socket.UDPSocket creation. + /// + public event System.EventHandler DirectUDPSocketCreated + { + add + { + _client.AddEventHandler("Network.directUDPSocketCreated", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketCreated", value); + } + } + + /// + /// Fired when direct_socket.UDPSocket connection is opened. + /// + public event System.EventHandler DirectUDPSocketOpened + { + add + { + _client.AddEventHandler("Network.directUDPSocketOpened", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketOpened", value); + } + } + + /// + /// Fired when direct_socket.UDPSocket is aborted. + /// + public event System.EventHandler DirectUDPSocketAborted + { + add + { + _client.AddEventHandler("Network.directUDPSocketAborted", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketAborted", value); + } + } + + /// + /// Fired when direct_socket.UDPSocket is closed. + /// + public event System.EventHandler DirectUDPSocketClosed + { + add + { + _client.AddEventHandler("Network.directUDPSocketClosed", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketClosed", value); + } + } + + /// + /// Fired when message is sent to udp direct socket stream. + /// + public event System.EventHandler DirectUDPSocketChunkSent + { + add + { + _client.AddEventHandler("Network.directUDPSocketChunkSent", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketChunkSent", value); + } + } + + /// + /// Fired when message is received from udp direct socket stream. + /// + public event System.EventHandler DirectUDPSocketChunkReceived + { + add + { + _client.AddEventHandler("Network.directUDPSocketChunkReceived", value); + } + + remove + { + _client.RemoveEventHandler("Network.directUDPSocketChunkReceived", value); + } + } + + /// + /// Fired when additional information about a requestWillBeSent event is available from the + /// network stack. Not every requestWillBeSent event will have an additional + /// requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent + /// or requestWillBeSentExtraInfo will be fired first for the same request. + /// + public event System.EventHandler RequestWillBeSentExtraInfo + { + add + { + _client.AddEventHandler("Network.requestWillBeSentExtraInfo", value); + } + + remove + { + _client.RemoveEventHandler("Network.requestWillBeSentExtraInfo", value); + } + } + + /// + /// Fired when additional information about a responseReceived event is available from the network + /// stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for + /// it, and responseReceivedExtraInfo may be fired before or after responseReceived. + /// + public event System.EventHandler ResponseReceivedExtraInfo + { + add + { + _client.AddEventHandler("Network.responseReceivedExtraInfo", value); + } + + remove + { + _client.RemoveEventHandler("Network.responseReceivedExtraInfo", value); + } + } + + /// + /// Fired when 103 Early Hints headers is received in addition to the common response. + /// Not every responseReceived event will have an responseReceivedEarlyHints fired. + /// Only one responseReceivedEarlyHints may be fired for eached responseReceived event. + /// + public event System.EventHandler ResponseReceivedEarlyHints + { + add + { + _client.AddEventHandler("Network.responseReceivedEarlyHints", value); + } + + remove + { + _client.RemoveEventHandler("Network.responseReceivedEarlyHints", value); + } + } + + /// + /// Fired exactly once for each Trust Token operation. Depending on + /// the type of the operation and whether the operation succeeded or + /// failed, the event is fired before the corresponding request was sent + /// or after the response was received. + /// + public event System.EventHandler TrustTokenOperationDone + { + add + { + _client.AddEventHandler("Network.trustTokenOperationDone", value); + } + + remove + { + _client.RemoveEventHandler("Network.trustTokenOperationDone", value); + } + } + + /// + /// Fired once security policy has been updated. + /// + public event System.EventHandler PolicyUpdated + { + add + { + _client.AddEventHandler("Network.policyUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Network.policyUpdated", value); + } + } + + /// + /// Is sent whenever a new report is added. + /// And after 'enableReportingApi' for all existing reports. + /// + public event System.EventHandler ReportingApiReportAdded + { + add + { + _client.AddEventHandler("Network.reportingApiReportAdded", value); + } + + remove + { + _client.RemoveEventHandler("Network.reportingApiReportAdded", value); + } + } + + /// + /// ReportingApiReportUpdated + /// + public event System.EventHandler ReportingApiReportUpdated + { + add + { + _client.AddEventHandler("Network.reportingApiReportUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Network.reportingApiReportUpdated", value); + } + } + + /// + /// ReportingApiEndpointsChangedForOrigin + /// + public event System.EventHandler ReportingApiEndpointsChangedForOrigin + { + add + { + _client.AddEventHandler("Network.reportingApiEndpointsChangedForOrigin", value); + } + + remove + { + _client.RemoveEventHandler("Network.reportingApiEndpointsChangedForOrigin", value); + } + } + + /// + /// Triggered when the initial set of device bound sessions is added. + /// + public event System.EventHandler DeviceBoundSessionsAdded + { + add + { + _client.AddEventHandler("Network.deviceBoundSessionsAdded", value); + } + + remove + { + _client.RemoveEventHandler("Network.deviceBoundSessionsAdded", value); + } + } + + /// + /// Triggered when a device bound session event occurs. + /// + public event System.EventHandler DeviceBoundSessionEventOccurred + { + add + { + _client.AddEventHandler("Network.deviceBoundSessionEventOccurred", value); + } + + remove + { + _client.RemoveEventHandler("Network.deviceBoundSessionEventOccurred", value); + } + } + + partial void ValidateSetAcceptedEncodings(CefSharp.DevTools.Network.ContentEncoding[] encodings); + /// + /// Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted. + /// + /// List of accepted content encodings. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAcceptedEncodingsAsync(CefSharp.DevTools.Network.ContentEncoding[] encodings) + { + ValidateSetAcceptedEncodings(encodings); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("encodings", EnumToString(encodings)); + return _client.ExecuteDevToolsMethodAsync("Network.setAcceptedEncodings", dict); + } + + /// + /// Clears accepted encodings set by setAcceptedEncodings + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearAcceptedEncodingsOverrideAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Network.clearAcceptedEncodingsOverride", dict); + } + + /// + /// Clears browser cache. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearBrowserCacheAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Network.clearBrowserCache", dict); + } + + /// + /// Clears browser cookies. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearBrowserCookiesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Network.clearBrowserCookies", dict); + } + + partial void ValidateDeleteCookies(string name, string url = null, string domain = null, string path = null, CefSharp.DevTools.Network.CookiePartitionKey partitionKey = null); + /// + /// Deletes browser cookies with matching name and url or domain/path/partitionKey pair. + /// + /// Name of the cookies to remove. + /// If specified, deletes all the cookies with the given name where domain and path matchprovided URL. + /// If specified, deletes only cookies with the exact domain. + /// If specified, deletes only cookies with the exact path. + /// If specified, deletes only cookies with the the given name and partitionKey whereall partition key attributes match the cookie partition key attribute. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteCookiesAsync(string name, string url = null, string domain = null, string path = null, CefSharp.DevTools.Network.CookiePartitionKey partitionKey = null) + { + ValidateDeleteCookies(name, url, domain, path, partitionKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + if (!(string.IsNullOrEmpty(domain))) + { + dict.Add("domain", domain); + } + + if (!(string.IsNullOrEmpty(path))) + { + dict.Add("path", path); + } + + if ((partitionKey) != (null)) + { + dict.Add("partitionKey", partitionKey.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Network.deleteCookies", dict); + } + + /// + /// Disables network tracking, prevents network events from being sent to the client. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Network.disable", dict); + } + + partial void ValidateEmulateNetworkConditionsByRule(bool offline, System.Collections.Generic.IList matchedNetworkConditions); + /// + /// Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated + /// Network.emulateNetworkConditions this method does not affect `navigator` state. Use Network.overrideNetworkState to + /// explicitly modify `navigator` behavior. + /// + /// True to emulate internet disconnection. + /// Configure conditions for matching requests. If multiple entries match a request, the first entry wins. Globalconditions can be configured by leaving the urlPattern for the conditions empty. These global conditions arealso applied for throttling of p2p connections. + /// returns System.Threading.Tasks.Task<EmulateNetworkConditionsByRuleResponse> + public System.Threading.Tasks.Task EmulateNetworkConditionsByRuleAsync(bool offline, System.Collections.Generic.IList matchedNetworkConditions) + { + ValidateEmulateNetworkConditionsByRule(offline, matchedNetworkConditions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("offline", offline); + dict.Add("matchedNetworkConditions", matchedNetworkConditions.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Network.emulateNetworkConditionsByRule", dict); + } + + partial void ValidateOverrideNetworkState(bool offline, double latency, double downloadThroughput, double uploadThroughput, CefSharp.DevTools.Network.ConnectionType? connectionType = null); + /// + /// Override the state of navigator.onLine and navigator.connection. + /// + /// True to emulate internet disconnection. + /// Minimum latency from request sent to response headers received (ms). + /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. + /// Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. + /// Connection type if known. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task OverrideNetworkStateAsync(bool offline, double latency, double downloadThroughput, double uploadThroughput, CefSharp.DevTools.Network.ConnectionType? connectionType = null) + { + ValidateOverrideNetworkState(offline, latency, downloadThroughput, uploadThroughput, connectionType); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("offline", offline); + dict.Add("latency", latency); + dict.Add("downloadThroughput", downloadThroughput); + dict.Add("uploadThroughput", uploadThroughput); + if (connectionType.HasValue) + { + dict.Add("connectionType", EnumToString(connectionType)); + } + + return _client.ExecuteDevToolsMethodAsync("Network.overrideNetworkState", dict); + } + + partial void ValidateEnable(int? maxTotalBufferSize = null, int? maxResourceBufferSize = null, int? maxPostDataSize = null, bool? reportDirectSocketTraffic = null, bool? enableDurableMessages = null); + /// + /// Enables network tracking, network events will now be delivered to the client. + /// + /// Buffer size in bytes to use when preserving network payloads (XHRs, etc). + /// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). + /// Longest post body size (in bytes) that would be included in requestWillBeSent notification + /// Whether DirectSocket chunk send/receive events should be reported. + /// Enable storing response bodies outside of renderer, so that these survivea cross-process navigation. Requires maxTotalBufferSize to be set.Currently defaults to false. This field is being deprecated in favor of the dedicatedconfigureDurableMessages command, due to the possibility of deadlocks when awaitingNetwork.enable before issuing Runtime.runIfWaitingForDebugger. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(int? maxTotalBufferSize = null, int? maxResourceBufferSize = null, int? maxPostDataSize = null, bool? reportDirectSocketTraffic = null, bool? enableDurableMessages = null) + { + ValidateEnable(maxTotalBufferSize, maxResourceBufferSize, maxPostDataSize, reportDirectSocketTraffic, enableDurableMessages); + var dict = new System.Collections.Generic.Dictionary(); + if (maxTotalBufferSize.HasValue) + { + dict.Add("maxTotalBufferSize", maxTotalBufferSize.Value); + } + + if (maxResourceBufferSize.HasValue) + { + dict.Add("maxResourceBufferSize", maxResourceBufferSize.Value); + } + + if (maxPostDataSize.HasValue) + { + dict.Add("maxPostDataSize", maxPostDataSize.Value); + } + + if (reportDirectSocketTraffic.HasValue) + { + dict.Add("reportDirectSocketTraffic", reportDirectSocketTraffic.Value); + } + + if (enableDurableMessages.HasValue) + { + dict.Add("enableDurableMessages", enableDurableMessages.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Network.enable", dict); + } + + partial void ValidateConfigureDurableMessages(int? maxTotalBufferSize = null, int? maxResourceBufferSize = null); + /// + /// Configures storing response bodies outside of renderer, so that these survive + /// a cross-process navigation. + /// If maxTotalBufferSize is not set, durable messages are disabled. + /// + /// Buffer size in bytes to use when preserving network payloads (XHRs, etc). + /// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ConfigureDurableMessagesAsync(int? maxTotalBufferSize = null, int? maxResourceBufferSize = null) + { + ValidateConfigureDurableMessages(maxTotalBufferSize, maxResourceBufferSize); + var dict = new System.Collections.Generic.Dictionary(); + if (maxTotalBufferSize.HasValue) + { + dict.Add("maxTotalBufferSize", maxTotalBufferSize.Value); + } + + if (maxResourceBufferSize.HasValue) + { + dict.Add("maxResourceBufferSize", maxResourceBufferSize.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Network.configureDurableMessages", dict); + } + + partial void ValidateGetCertificate(string origin); + /// + /// Returns the DER-encoded certificate. + /// + /// Origin to get certificate for. + /// returns System.Threading.Tasks.Task<GetCertificateResponse> + public System.Threading.Tasks.Task GetCertificateAsync(string origin) + { + ValidateGetCertificate(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Network.getCertificate", dict); + } + + partial void ValidateGetCookies(string[] urls = null); + /// + /// Returns all browser cookies for the current URL. Depending on the backend support, will return + /// detailed cookie information in the `cookies` field. + /// + /// The list of URLs for which applicable cookies will be fetched.If not specified, it's assumed to be set to the list containingthe URLs of the page and all of its subframes. + /// returns System.Threading.Tasks.Task<GetCookiesResponse> + public System.Threading.Tasks.Task GetCookiesAsync(string[] urls = null) + { + ValidateGetCookies(urls); + var dict = new System.Collections.Generic.Dictionary(); + if ((urls) != (null)) + { + dict.Add("urls", urls); + } + + return _client.ExecuteDevToolsMethodAsync("Network.getCookies", dict); + } + + partial void ValidateGetResponseBody(string requestId); + /// + /// Returns content served for the given request. + /// + /// Identifier of the network request to get content for. + /// returns System.Threading.Tasks.Task<GetResponseBodyResponse> + public System.Threading.Tasks.Task GetResponseBodyAsync(string requestId) + { + ValidateGetResponseBody(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Network.getResponseBody", dict); + } + + partial void ValidateGetRequestPostData(string requestId); + /// + /// Returns post data sent with the request. Returns an error when no data was sent with the request. + /// + /// Identifier of the network request to get content for. + /// returns System.Threading.Tasks.Task<GetRequestPostDataResponse> + public System.Threading.Tasks.Task GetRequestPostDataAsync(string requestId) + { + ValidateGetRequestPostData(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Network.getRequestPostData", dict); + } + + partial void ValidateGetResponseBodyForInterception(string interceptionId); + /// + /// Returns content served for the given currently intercepted request. + /// + /// Identifier for the intercepted request to get body for. + /// returns System.Threading.Tasks.Task<GetResponseBodyForInterceptionResponse> + public System.Threading.Tasks.Task GetResponseBodyForInterceptionAsync(string interceptionId) + { + ValidateGetResponseBodyForInterception(interceptionId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("interceptionId", interceptionId); + return _client.ExecuteDevToolsMethodAsync("Network.getResponseBodyForInterception", dict); + } + + partial void ValidateTakeResponseBodyForInterceptionAsStream(string interceptionId); + /// + /// Returns a handle to the stream representing the response body. Note that after this command, + /// the intercepted request can't be continued as is -- you either need to cancel it or to provide + /// the response body. The stream only supports sequential read, IO.read will fail if the position + /// is specified. + /// + /// interceptionId + /// returns System.Threading.Tasks.Task<TakeResponseBodyForInterceptionAsStreamResponse> + public System.Threading.Tasks.Task TakeResponseBodyForInterceptionAsStreamAsync(string interceptionId) + { + ValidateTakeResponseBodyForInterceptionAsStream(interceptionId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("interceptionId", interceptionId); + return _client.ExecuteDevToolsMethodAsync("Network.takeResponseBodyForInterceptionAsStream", dict); + } + + partial void ValidateReplayXHR(string requestId); + /// + /// This method sends a new XMLHttpRequest which is identical to the original one. The following + /// parameters should be identical: method, url, async, request body, extra headers, withCredentials + /// attribute, user, password. + /// + /// Identifier of XHR to replay. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReplayXHRAsync(string requestId) + { + ValidateReplayXHR(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Network.replayXHR", dict); + } + + partial void ValidateSearchInResponseBody(string requestId, string query, bool? caseSensitive = null, bool? isRegex = null); + /// + /// Searches for given string in response content. + /// + /// Identifier of the network response to search. + /// String to search for. + /// If true, search is case sensitive. + /// If true, treats string parameter as regex. + /// returns System.Threading.Tasks.Task<SearchInResponseBodyResponse> + public System.Threading.Tasks.Task SearchInResponseBodyAsync(string requestId, string query, bool? caseSensitive = null, bool? isRegex = null) + { + ValidateSearchInResponseBody(requestId, query, caseSensitive, isRegex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("query", query); + if (caseSensitive.HasValue) + { + dict.Add("caseSensitive", caseSensitive.Value); + } + + if (isRegex.HasValue) + { + dict.Add("isRegex", isRegex.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Network.searchInResponseBody", dict); + } + + partial void ValidateSetBlockedURLs(System.Collections.Generic.IList urlPatterns = null, string[] urls = null); + /// + /// Blocks URLs from loading. + /// + /// Patterns to match in the order in which they are given. These patternsalso take precedence over any wildcard patterns defined in `urls`. + /// URL patterns to block. Wildcards ('*') are allowed. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBlockedURLsAsync(System.Collections.Generic.IList urlPatterns = null, string[] urls = null) + { + ValidateSetBlockedURLs(urlPatterns, urls); + var dict = new System.Collections.Generic.Dictionary(); + if ((urlPatterns) != (null)) + { + dict.Add("urlPatterns", urlPatterns.Select(x => x.ToDictionary())); + } + + if ((urls) != (null)) + { + dict.Add("urls", urls); + } + + return _client.ExecuteDevToolsMethodAsync("Network.setBlockedURLs", dict); + } + + partial void ValidateSetBypassServiceWorker(bool bypass); + /// + /// Toggles ignoring of service worker for each request. + /// + /// Bypass service worker and load from network. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBypassServiceWorkerAsync(bool bypass) + { + ValidateSetBypassServiceWorker(bypass); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("bypass", bypass); + return _client.ExecuteDevToolsMethodAsync("Network.setBypassServiceWorker", dict); + } + + partial void ValidateSetCacheDisabled(bool cacheDisabled); + /// + /// Toggles ignoring cache for each request. If `true`, cache will not be used. + /// + /// Cache disabled state. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCacheDisabledAsync(bool cacheDisabled) + { + ValidateSetCacheDisabled(cacheDisabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cacheDisabled", cacheDisabled); + return _client.ExecuteDevToolsMethodAsync("Network.setCacheDisabled", dict); + } + + partial void ValidateSetCookie(string name, string value, string url = null, string domain = null, string path = null, bool? secure = null, bool? httpOnly = null, CefSharp.DevTools.Network.CookieSameSite? sameSite = null, double? expires = null, CefSharp.DevTools.Network.CookiePriority? priority = null, CefSharp.DevTools.Network.CookieSourceScheme? sourceScheme = null, int? sourcePort = null, CefSharp.DevTools.Network.CookiePartitionKey partitionKey = null); + /// + /// Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. + /// + /// Cookie name. + /// Cookie value. + /// The request-URI to associate with the setting of the cookie. This value can affect thedefault domain, path, source port, and source scheme values of the created cookie. + /// Cookie domain. + /// Cookie path. + /// True if cookie is secure. + /// True if cookie is http-only. + /// Cookie SameSite type. + /// Cookie expiration date, session cookie if not set + /// Cookie Priority type. + /// Cookie source scheme type. + /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port.An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.This is a temporary ability and it will be removed in the future. + /// Cookie partition key. If not set, the cookie will be set as not partitioned. + /// returns System.Threading.Tasks.Task<SetCookieResponse> + public System.Threading.Tasks.Task SetCookieAsync(string name, string value, string url = null, string domain = null, string path = null, bool? secure = null, bool? httpOnly = null, CefSharp.DevTools.Network.CookieSameSite? sameSite = null, double? expires = null, CefSharp.DevTools.Network.CookiePriority? priority = null, CefSharp.DevTools.Network.CookieSourceScheme? sourceScheme = null, int? sourcePort = null, CefSharp.DevTools.Network.CookiePartitionKey partitionKey = null) + { + ValidateSetCookie(name, value, url, domain, path, secure, httpOnly, sameSite, expires, priority, sourceScheme, sourcePort, partitionKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + dict.Add("value", value); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + if (!(string.IsNullOrEmpty(domain))) + { + dict.Add("domain", domain); + } + + if (!(string.IsNullOrEmpty(path))) + { + dict.Add("path", path); + } + + if (secure.HasValue) + { + dict.Add("secure", secure.Value); + } + + if (httpOnly.HasValue) + { + dict.Add("httpOnly", httpOnly.Value); + } + + if (sameSite.HasValue) + { + dict.Add("sameSite", EnumToString(sameSite)); + } + + if (expires.HasValue) + { + dict.Add("expires", expires.Value); + } + + if (priority.HasValue) + { + dict.Add("priority", EnumToString(priority)); + } + + if (sourceScheme.HasValue) + { + dict.Add("sourceScheme", EnumToString(sourceScheme)); + } + + if (sourcePort.HasValue) + { + dict.Add("sourcePort", sourcePort.Value); + } + + if ((partitionKey) != (null)) + { + dict.Add("partitionKey", partitionKey.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Network.setCookie", dict); + } + + partial void ValidateSetCookies(System.Collections.Generic.IList cookies); + /// + /// Sets given cookies. + /// + /// Cookies to be set. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCookiesAsync(System.Collections.Generic.IList cookies) + { + ValidateSetCookies(cookies); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cookies", cookies.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Network.setCookies", dict); + } + + partial void ValidateSetExtraHTTPHeaders(CefSharp.DevTools.Network.Headers headers); + /// + /// Specifies whether to always send extra HTTP headers with the requests from this page. + /// + /// Map with extra HTTP headers. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetExtraHTTPHeadersAsync(CefSharp.DevTools.Network.Headers headers) + { + ValidateSetExtraHTTPHeaders(headers); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("headers", headers.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Network.setExtraHTTPHeaders", dict); + } + + partial void ValidateSetAttachDebugStack(bool enabled); + /// + /// Specifies whether to attach a page script stack id in requests + /// + /// Whether to attach a page script stack for debugging purpose. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttachDebugStackAsync(bool enabled) + { + ValidateSetAttachDebugStack(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Network.setAttachDebugStack", dict); + } + + partial void ValidateSetUserAgentOverride(string userAgent, string acceptLanguage = null, string platform = null, CefSharp.DevTools.Emulation.UserAgentMetadata userAgentMetadata = null); + /// + /// Allows overriding user agent with the given string. + /// + /// User agent to use. + /// Browser language to emulate. + /// The platform navigator.platform should return. + /// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetUserAgentOverrideAsync(string userAgent, string acceptLanguage = null, string platform = null, CefSharp.DevTools.Emulation.UserAgentMetadata userAgentMetadata = null) + { + ValidateSetUserAgentOverride(userAgent, acceptLanguage, platform, userAgentMetadata); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("userAgent", userAgent); + if (!(string.IsNullOrEmpty(acceptLanguage))) + { + dict.Add("acceptLanguage", acceptLanguage); + } + + if (!(string.IsNullOrEmpty(platform))) + { + dict.Add("platform", platform); + } + + if ((userAgentMetadata) != (null)) + { + dict.Add("userAgentMetadata", userAgentMetadata.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Network.setUserAgentOverride", dict); + } + + partial void ValidateStreamResourceContent(string requestId); + /// + /// Enables streaming of the response for the given requestId. + /// If enabled, the dataReceived event contains the data that was received during streaming. + /// + /// Identifier of the request to stream. + /// returns System.Threading.Tasks.Task<StreamResourceContentResponse> + public System.Threading.Tasks.Task StreamResourceContentAsync(string requestId) + { + ValidateStreamResourceContent(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("Network.streamResourceContent", dict); + } + + partial void ValidateGetSecurityIsolationStatus(string frameId = null); + /// + /// Returns information about the COEP/COOP isolation status. + /// + /// If no frameId is provided, the status of the target is provided. + /// returns System.Threading.Tasks.Task<GetSecurityIsolationStatusResponse> + public System.Threading.Tasks.Task GetSecurityIsolationStatusAsync(string frameId = null) + { + ValidateGetSecurityIsolationStatus(frameId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Network.getSecurityIsolationStatus", dict); + } + + partial void ValidateEnableReportingApi(bool enable); + /// + /// Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client. + /// Enabling triggers 'reportingApiReportAdded' for all existing reports. + /// + /// Whether to enable or disable events for the Reporting API + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableReportingApiAsync(bool enable) + { + ValidateEnableReportingApi(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Network.enableReportingApi", dict); + } + + partial void ValidateEnableDeviceBoundSessions(bool enable); + /// + /// Sets up tracking device bound sessions and fetching of initial set of sessions. + /// + /// Whether to enable or disable events. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableDeviceBoundSessionsAsync(bool enable) + { + ValidateEnableDeviceBoundSessions(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Network.enableDeviceBoundSessions", dict); + } + + partial void ValidateFetchSchemefulSite(string origin); + /// + /// Fetches the schemeful site for a specific origin. + /// + /// The URL origin. + /// returns System.Threading.Tasks.Task<FetchSchemefulSiteResponse> + public System.Threading.Tasks.Task FetchSchemefulSiteAsync(string origin) + { + ValidateFetchSchemefulSite(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Network.fetchSchemefulSite", dict); + } + + partial void ValidateLoadNetworkResource(string url, CefSharp.DevTools.Network.LoadNetworkResourceOptions options, string frameId = null); + /// + /// Fetches the resource and returns the content. + /// + /// URL of the resource to get content for. + /// Options for the request. + /// Frame id to get the resource for. Mandatory for frame targets, andshould be omitted for worker targets. + /// returns System.Threading.Tasks.Task<LoadNetworkResourceResponse> + public System.Threading.Tasks.Task LoadNetworkResourceAsync(string url, CefSharp.DevTools.Network.LoadNetworkResourceOptions options, string frameId = null) + { + ValidateLoadNetworkResource(url, options, frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + dict.Add("options", options.ToDictionary()); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Network.loadNetworkResource", dict); + } + + partial void ValidateSetCookieControls(bool enableThirdPartyCookieRestriction, bool disableThirdPartyCookieMetadata, bool disableThirdPartyCookieHeuristics); + /// + /// Sets Controls for third-party cookie access + /// Page reload is required before the new cookie behavior will be observed + /// + /// Whether 3pc restriction is enabled. + /// Whether 3pc grace period exception should be enabled; false by default. + /// Whether 3pc heuristics exceptions should be enabled; false by default. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCookieControlsAsync(bool enableThirdPartyCookieRestriction, bool disableThirdPartyCookieMetadata, bool disableThirdPartyCookieHeuristics) + { + ValidateSetCookieControls(enableThirdPartyCookieRestriction, disableThirdPartyCookieMetadata, disableThirdPartyCookieHeuristics); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enableThirdPartyCookieRestriction", enableThirdPartyCookieRestriction); + dict.Add("disableThirdPartyCookieMetadata", disableThirdPartyCookieMetadata); + dict.Add("disableThirdPartyCookieHeuristics", disableThirdPartyCookieHeuristics); + return _client.ExecuteDevToolsMethodAsync("Network.setCookieControls", dict); + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + /// + /// GetHighlightObjectForTestResponse + /// + public class GetHighlightObjectForTestResponse : DevToolsDomainResponseBase + { + /// + /// highlight + /// + [JsonInclude] + [JsonPropertyName("highlight")] + public object Highlight + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + /// + /// GetGridHighlightObjectsForTestResponse + /// + public class GetGridHighlightObjectsForTestResponse : DevToolsDomainResponseBase + { + /// + /// highlights + /// + [JsonInclude] + [JsonPropertyName("highlights")] + public object Highlights + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + /// + /// GetSourceOrderHighlightObjectForTestResponse + /// + public class GetSourceOrderHighlightObjectForTestResponse : DevToolsDomainResponseBase + { + /// + /// highlight + /// + [JsonInclude] + [JsonPropertyName("highlight")] + public object Highlight + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Overlay +{ + using System.Linq; + + /// + /// This domain provides various functionality related to drawing atop the inspected page. + /// + public partial class OverlayClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Overlay + /// + /// DevToolsClient + public OverlayClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when the node should be inspected. This happens after call to `setInspectMode` or when + /// user manually inspects an element. + /// + public event System.EventHandler InspectNodeRequested + { + add + { + _client.AddEventHandler("Overlay.inspectNodeRequested", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.inspectNodeRequested", value); + } + } + + /// + /// Fired when the node should be highlighted. This happens after call to `setInspectMode`. + /// + public event System.EventHandler NodeHighlightRequested + { + add + { + _client.AddEventHandler("Overlay.nodeHighlightRequested", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.nodeHighlightRequested", value); + } + } + + /// + /// Fired when user asks to capture screenshot of some area on the page. + /// + public event System.EventHandler ScreenshotRequested + { + add + { + _client.AddEventHandler("Overlay.screenshotRequested", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.screenshotRequested", value); + } + } + + /// + /// Fired when user asks to show the Inspect panel. + /// + public event System.EventHandler InspectPanelShowRequested + { + add + { + _client.AddEventHandler("Overlay.inspectPanelShowRequested", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.inspectPanelShowRequested", value); + } + } + + /// + /// Fired when user asks to restore the Inspected Element floating window. + /// + public event System.EventHandler InspectedElementWindowRestored + { + add + { + _client.AddEventHandler("Overlay.inspectedElementWindowRestored", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.inspectedElementWindowRestored", value); + } + } + + /// + /// Fired when user cancels the inspect mode. + /// + public event System.EventHandler InspectModeCanceled + { + add + { + _client.AddEventHandler("Overlay.inspectModeCanceled", value); + } + + remove + { + _client.RemoveEventHandler("Overlay.inspectModeCanceled", value); + } + } + + /// + /// Disables domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Overlay.disable", dict); + } + + /// + /// Enables domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Overlay.enable", dict); + } + + partial void ValidateGetHighlightObjectForTest(int nodeId, bool? includeDistance = null, bool? includeStyle = null, CefSharp.DevTools.Overlay.ColorFormat? colorFormat = null, bool? showAccessibilityInfo = null); + /// + /// For testing. + /// + /// Id of the node to get highlight object for. + /// Whether to include distance info. + /// Whether to include style info. + /// The color format to get config with (default: hex). + /// Whether to show accessibility info (default: true). + /// returns System.Threading.Tasks.Task<GetHighlightObjectForTestResponse> + public System.Threading.Tasks.Task GetHighlightObjectForTestAsync(int nodeId, bool? includeDistance = null, bool? includeStyle = null, CefSharp.DevTools.Overlay.ColorFormat? colorFormat = null, bool? showAccessibilityInfo = null) + { + ValidateGetHighlightObjectForTest(nodeId, includeDistance, includeStyle, colorFormat, showAccessibilityInfo); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + if (includeDistance.HasValue) + { + dict.Add("includeDistance", includeDistance.Value); + } + + if (includeStyle.HasValue) + { + dict.Add("includeStyle", includeStyle.Value); + } + + if (colorFormat.HasValue) + { + dict.Add("colorFormat", EnumToString(colorFormat)); + } + + if (showAccessibilityInfo.HasValue) + { + dict.Add("showAccessibilityInfo", showAccessibilityInfo.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.getHighlightObjectForTest", dict); + } + + partial void ValidateGetGridHighlightObjectsForTest(int[] nodeIds); + /// + /// For Persistent Grid testing. + /// + /// Ids of the node to get highlight object for. + /// returns System.Threading.Tasks.Task<GetGridHighlightObjectsForTestResponse> + public System.Threading.Tasks.Task GetGridHighlightObjectsForTestAsync(int[] nodeIds) + { + ValidateGetGridHighlightObjectsForTest(nodeIds); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeIds", nodeIds); + return _client.ExecuteDevToolsMethodAsync("Overlay.getGridHighlightObjectsForTest", dict); + } + + partial void ValidateGetSourceOrderHighlightObjectForTest(int nodeId); + /// + /// For Source Order Viewer testing. + /// + /// Id of the node to highlight. + /// returns System.Threading.Tasks.Task<GetSourceOrderHighlightObjectForTestResponse> + public System.Threading.Tasks.Task GetSourceOrderHighlightObjectForTestAsync(int nodeId) + { + ValidateGetSourceOrderHighlightObjectForTest(nodeId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("nodeId", nodeId); + return _client.ExecuteDevToolsMethodAsync("Overlay.getSourceOrderHighlightObjectForTest", dict); + } + + /// + /// Hides any highlight. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HideHighlightAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Overlay.hideHighlight", dict); + } + + partial void ValidateHighlightNode(CefSharp.DevTools.Overlay.HighlightConfig highlightConfig, int? nodeId = null, int? backendNodeId = null, string objectId = null, string selector = null); + /// + /// Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or + /// objectId must be specified. + /// + /// A descriptor for the highlight appearance. + /// Identifier of the node to highlight. + /// Identifier of the backend node to highlight. + /// JavaScript object id of the node to be highlighted. + /// Selectors to highlight relevant nodes. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightNodeAsync(CefSharp.DevTools.Overlay.HighlightConfig highlightConfig, int? nodeId = null, int? backendNodeId = null, string objectId = null, string selector = null) + { + ValidateHighlightNode(highlightConfig, nodeId, backendNodeId, objectId, selector); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("highlightConfig", highlightConfig.ToDictionary()); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if (!(string.IsNullOrEmpty(selector))) + { + dict.Add("selector", selector); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.highlightNode", dict); + } + + partial void ValidateHighlightQuad(double[] quad, CefSharp.DevTools.DOM.RGBA color = null, CefSharp.DevTools.DOM.RGBA outlineColor = null); + /// + /// Highlights given quad. Coordinates are absolute with respect to the main frame viewport. + /// + /// Quad to highlight + /// The highlight fill color (default: transparent). + /// The highlight outline color (default: transparent). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightQuadAsync(double[] quad, CefSharp.DevTools.DOM.RGBA color = null, CefSharp.DevTools.DOM.RGBA outlineColor = null) + { + ValidateHighlightQuad(quad, color, outlineColor); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("quad", quad); + if ((color) != (null)) + { + dict.Add("color", color.ToDictionary()); + } + + if ((outlineColor) != (null)) + { + dict.Add("outlineColor", outlineColor.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.highlightQuad", dict); + } + + partial void ValidateHighlightRect(int x, int y, int width, int height, CefSharp.DevTools.DOM.RGBA color = null, CefSharp.DevTools.DOM.RGBA outlineColor = null); + /// + /// Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport. + /// Issue: the method does not handle device pixel ratio (DPR) correctly. + /// The coordinates currently have to be adjusted by the client + /// if DPR is not 1 (see crbug.com/437807128). + /// + /// X coordinate + /// Y coordinate + /// Rectangle width + /// Rectangle height + /// The highlight fill color (default: transparent). + /// The highlight outline color (default: transparent). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightRectAsync(int x, int y, int width, int height, CefSharp.DevTools.DOM.RGBA color = null, CefSharp.DevTools.DOM.RGBA outlineColor = null) + { + ValidateHighlightRect(x, y, width, height, color, outlineColor); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("x", x); + dict.Add("y", y); + dict.Add("width", width); + dict.Add("height", height); + if ((color) != (null)) + { + dict.Add("color", color.ToDictionary()); + } + + if ((outlineColor) != (null)) + { + dict.Add("outlineColor", outlineColor.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.highlightRect", dict); + } + + partial void ValidateHighlightSourceOrder(CefSharp.DevTools.Overlay.SourceOrderConfig sourceOrderConfig, int? nodeId = null, int? backendNodeId = null, string objectId = null); + /// + /// Highlights the source order of the children of the DOM node with given id or with the given + /// JavaScript object wrapper. Either nodeId or objectId must be specified. + /// + /// A descriptor for the appearance of the overlay drawing. + /// Identifier of the node to highlight. + /// Identifier of the backend node to highlight. + /// JavaScript object id of the node to be highlighted. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HighlightSourceOrderAsync(CefSharp.DevTools.Overlay.SourceOrderConfig sourceOrderConfig, int? nodeId = null, int? backendNodeId = null, string objectId = null) + { + ValidateHighlightSourceOrder(sourceOrderConfig, nodeId, backendNodeId, objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sourceOrderConfig", sourceOrderConfig.ToDictionary()); + if (nodeId.HasValue) + { + dict.Add("nodeId", nodeId.Value); + } + + if (backendNodeId.HasValue) + { + dict.Add("backendNodeId", backendNodeId.Value); + } + + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.highlightSourceOrder", dict); + } + + partial void ValidateSetInspectMode(CefSharp.DevTools.Overlay.InspectMode mode, CefSharp.DevTools.Overlay.HighlightConfig highlightConfig = null); + /// + /// Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. + /// Backend then generates 'inspectNodeRequested' event upon element selection. + /// + /// Set an inspection mode. + /// A descriptor for the highlight appearance of hovered-over nodes. May be omitted if `enabled== false`. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInspectModeAsync(CefSharp.DevTools.Overlay.InspectMode mode, CefSharp.DevTools.Overlay.HighlightConfig highlightConfig = null) + { + ValidateSetInspectMode(mode, highlightConfig); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("mode", EnumToString(mode)); + if ((highlightConfig) != (null)) + { + dict.Add("highlightConfig", highlightConfig.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.setInspectMode", dict); + } + + partial void ValidateSetShowAdHighlights(bool show); + /// + /// Highlights owner element of all frames detected to be ads. + /// + /// True for showing ad highlights + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowAdHighlightsAsync(bool show) + { + ValidateSetShowAdHighlights(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowAdHighlights", dict); + } + + partial void ValidateSetPausedInDebuggerMessage(string message = null); + /// + /// SetPausedInDebuggerMessage + /// + /// The message to display, also triggers resume and step over controls. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPausedInDebuggerMessageAsync(string message = null) + { + ValidateSetPausedInDebuggerMessage(message); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(message))) + { + dict.Add("message", message); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.setPausedInDebuggerMessage", dict); + } + + partial void ValidateSetShowDebugBorders(bool show); + /// + /// Requests that backend shows debug borders on layers + /// + /// True for showing debug borders + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowDebugBordersAsync(bool show) + { + ValidateSetShowDebugBorders(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowDebugBorders", dict); + } + + partial void ValidateSetShowFPSCounter(bool show); + /// + /// Requests that backend shows the FPS counter + /// + /// True for showing the FPS counter + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowFPSCounterAsync(bool show) + { + ValidateSetShowFPSCounter(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowFPSCounter", dict); + } + + partial void ValidateSetShowGridOverlays(System.Collections.Generic.IList gridNodeHighlightConfigs); + /// + /// Highlight multiple elements with the CSS Grid overlay. + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowGridOverlaysAsync(System.Collections.Generic.IList gridNodeHighlightConfigs) + { + ValidateSetShowGridOverlays(gridNodeHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("gridNodeHighlightConfigs", gridNodeHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowGridOverlays", dict); + } + + partial void ValidateSetShowFlexOverlays(System.Collections.Generic.IList flexNodeHighlightConfigs); + /// + /// SetShowFlexOverlays + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowFlexOverlaysAsync(System.Collections.Generic.IList flexNodeHighlightConfigs) + { + ValidateSetShowFlexOverlays(flexNodeHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("flexNodeHighlightConfigs", flexNodeHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowFlexOverlays", dict); + } + + partial void ValidateSetShowScrollSnapOverlays(System.Collections.Generic.IList scrollSnapHighlightConfigs); + /// + /// SetShowScrollSnapOverlays + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowScrollSnapOverlaysAsync(System.Collections.Generic.IList scrollSnapHighlightConfigs) + { + ValidateSetShowScrollSnapOverlays(scrollSnapHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scrollSnapHighlightConfigs", scrollSnapHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowScrollSnapOverlays", dict); + } + + partial void ValidateSetShowContainerQueryOverlays(System.Collections.Generic.IList containerQueryHighlightConfigs); + /// + /// SetShowContainerQueryOverlays + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowContainerQueryOverlaysAsync(System.Collections.Generic.IList containerQueryHighlightConfigs) + { + ValidateSetShowContainerQueryOverlays(containerQueryHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("containerQueryHighlightConfigs", containerQueryHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowContainerQueryOverlays", dict); + } + + partial void ValidateSetShowInspectedElementAnchor(CefSharp.DevTools.Overlay.InspectedElementAnchorConfig inspectedElementAnchorConfig); + /// + /// SetShowInspectedElementAnchor + /// + /// Node identifier for which to show an anchor for. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowInspectedElementAnchorAsync(CefSharp.DevTools.Overlay.InspectedElementAnchorConfig inspectedElementAnchorConfig) + { + ValidateSetShowInspectedElementAnchor(inspectedElementAnchorConfig); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("inspectedElementAnchorConfig", inspectedElementAnchorConfig.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowInspectedElementAnchor", dict); + } + + partial void ValidateSetShowPaintRects(bool result); + /// + /// Requests that backend shows paint rectangles + /// + /// True for showing paint rectangles + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowPaintRectsAsync(bool result) + { + ValidateSetShowPaintRects(result); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("result", result); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowPaintRects", dict); + } + + partial void ValidateSetShowLayoutShiftRegions(bool result); + /// + /// Requests that backend shows layout shift regions + /// + /// True for showing layout shift regions + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowLayoutShiftRegionsAsync(bool result) + { + ValidateSetShowLayoutShiftRegions(result); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("result", result); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowLayoutShiftRegions", dict); + } + + partial void ValidateSetShowScrollBottleneckRects(bool show); + /// + /// Requests that backend shows scroll bottleneck rects + /// + /// True for showing scroll bottleneck rects + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowScrollBottleneckRectsAsync(bool show) + { + ValidateSetShowScrollBottleneckRects(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowScrollBottleneckRects", dict); + } + + partial void ValidateSetShowViewportSizeOnResize(bool show); + /// + /// Paints viewport size upon main frame resize. + /// + /// Whether to paint size or not. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowViewportSizeOnResizeAsync(bool show) + { + ValidateSetShowViewportSizeOnResize(show); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("show", show); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowViewportSizeOnResize", dict); + } + + partial void ValidateSetShowHinge(CefSharp.DevTools.Overlay.HingeConfig hingeConfig = null); + /// + /// Add a dual screen device hinge + /// + /// hinge data, null means hideHinge + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowHingeAsync(CefSharp.DevTools.Overlay.HingeConfig hingeConfig = null) + { + ValidateSetShowHinge(hingeConfig); + var dict = new System.Collections.Generic.Dictionary(); + if ((hingeConfig) != (null)) + { + dict.Add("hingeConfig", hingeConfig.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowHinge", dict); + } + + partial void ValidateSetShowIsolatedElements(System.Collections.Generic.IList isolatedElementHighlightConfigs); + /// + /// Show elements in isolation mode with overlays. + /// + /// An array of node identifiers and descriptors for the highlight appearance. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowIsolatedElementsAsync(System.Collections.Generic.IList isolatedElementHighlightConfigs) + { + ValidateSetShowIsolatedElements(isolatedElementHighlightConfigs); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("isolatedElementHighlightConfigs", isolatedElementHighlightConfigs.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowIsolatedElements", dict); + } + + partial void ValidateSetShowWindowControlsOverlay(CefSharp.DevTools.Overlay.WindowControlsOverlayConfig windowControlsOverlayConfig = null); + /// + /// Show Window Controls Overlay for PWA + /// + /// Window Controls Overlay data, null means hide Window Controls Overlay + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetShowWindowControlsOverlayAsync(CefSharp.DevTools.Overlay.WindowControlsOverlayConfig windowControlsOverlayConfig = null) + { + ValidateSetShowWindowControlsOverlay(windowControlsOverlayConfig); + var dict = new System.Collections.Generic.Dictionary(); + if ((windowControlsOverlayConfig) != (null)) + { + dict.Add("windowControlsOverlayConfig", windowControlsOverlayConfig.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Overlay.setShowWindowControlsOverlay", dict); + } + } +} + +namespace CefSharp.DevTools.PWA +{ + /// + /// GetOsAppStateResponse + /// + public class GetOsAppStateResponse : DevToolsDomainResponseBase + { + /// + /// badgeCount + /// + [JsonInclude] + [JsonPropertyName("badgeCount")] + public int BadgeCount + { + get; + private set; + } + + /// + /// fileHandlers + /// + [JsonInclude] + [JsonPropertyName("fileHandlers")] + public System.Collections.Generic.IList FileHandlers + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.PWA +{ + /// + /// LaunchResponse + /// + public class LaunchResponse : DevToolsDomainResponseBase + { + /// + /// targetId + /// + [JsonInclude] + [JsonPropertyName("targetId")] + public string TargetId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.PWA +{ + /// + /// LaunchFilesInAppResponse + /// + public class LaunchFilesInAppResponse : DevToolsDomainResponseBase + { + /// + /// targetIds + /// + [JsonInclude] + [JsonPropertyName("targetIds")] + public string[] TargetIds + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.PWA +{ + using System.Linq; + + /// + /// This domain allows interacting with the browser to control PWAs. + /// + public partial class PWAClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// PWA + /// + /// DevToolsClient + public PWAClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + partial void ValidateGetOsAppState(string manifestId); + /// + /// Returns the following OS state for the given manifest id. + /// + /// The id from the webapp's manifest file, commonly it's the url of thesite installing the webapp. Seehttps://web.dev/learn/pwa/web-app-manifest. + /// returns System.Threading.Tasks.Task<GetOsAppStateResponse> + public System.Threading.Tasks.Task GetOsAppStateAsync(string manifestId) + { + ValidateGetOsAppState(manifestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + return _client.ExecuteDevToolsMethodAsync("PWA.getOsAppState", dict); + } + + partial void ValidateInstall(string manifestId, string installUrlOrBundleUrl = null); + /// + /// Installs the given manifest identity, optionally using the given installUrlOrBundleUrl + /// + /// IWA-specific install description: + /// manifestId corresponds to isolated-app:// + web_package::SignedWebBundleId + /// + /// File installation mode: + /// The installUrlOrBundleUrl can be either file:// or http(s):// pointing + /// to a signed web bundle (.swbn). In this case SignedWebBundleId must correspond to + /// The .swbn file's signing key. + /// + /// Dev proxy installation mode: + /// installUrlOrBundleUrl must be http(s):// that serves dev mode IWA. + /// web_package::SignedWebBundleId must be of type dev proxy. + /// + /// The advantage of dev proxy mode is that all changes to IWA + /// automatically will be reflected in the running app without + /// reinstallation. + /// + /// To generate bundle id for proxy mode: + /// 1. Generate 32 random bytes. + /// 2. Add a specific suffix at the end following the documentation + /// https://github.com/WICG/isolated-web-apps/blob/main/Scheme.md#suffix + /// 3. Encode the entire sequence using Base32 without padding. + /// + /// If Chrome is not in IWA dev + /// mode, the installation will fail, regardless of the state of the allowlist. + /// + /// manifestId + /// The location of the app or bundle overriding the one derived from themanifestId. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task InstallAsync(string manifestId, string installUrlOrBundleUrl = null) + { + ValidateInstall(manifestId, installUrlOrBundleUrl); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + if (!(string.IsNullOrEmpty(installUrlOrBundleUrl))) + { + dict.Add("installUrlOrBundleUrl", installUrlOrBundleUrl); + } + + return _client.ExecuteDevToolsMethodAsync("PWA.install", dict); + } + + partial void ValidateUninstall(string manifestId); + /// + /// Uninstalls the given manifest_id and closes any opened app windows. + /// + /// manifestId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UninstallAsync(string manifestId) + { + ValidateUninstall(manifestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + return _client.ExecuteDevToolsMethodAsync("PWA.uninstall", dict); + } + + partial void ValidateLaunch(string manifestId, string url = null); + /// + /// Launches the installed web app, or an url in the same web app instead of the + /// default start url if it is provided. Returns a page Target.TargetID which + /// can be used to attach to via Target.attachToTarget or similar APIs. + /// + /// manifestId + /// url + /// returns System.Threading.Tasks.Task<LaunchResponse> + public System.Threading.Tasks.Task LaunchAsync(string manifestId, string url = null) + { + ValidateLaunch(manifestId, url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + return _client.ExecuteDevToolsMethodAsync("PWA.launch", dict); + } + + partial void ValidateLaunchFilesInApp(string manifestId, string[] files); + /// + /// Opens one or more local files from an installed web app identified by its + /// manifestId. The web app needs to have file handlers registered to process + /// the files. The API returns one or more page Target.TargetIDs which can be + /// used to attach to via Target.attachToTarget or similar APIs. + /// If some files in the parameters cannot be handled by the web app, they will + /// be ignored. If none of the files can be handled, this API returns an error. + /// If no files are provided as the parameter, this API also returns an error. + /// + /// According to the definition of the file handlers in the manifest file, one + /// Target.TargetID may represent a page handling one or more files. The order + /// of the returned Target.TargetIDs is not guaranteed. + /// + /// TODO(crbug.com/339454034): Check the existences of the input files. + /// + /// manifestId + /// files + /// returns System.Threading.Tasks.Task<LaunchFilesInAppResponse> + public System.Threading.Tasks.Task LaunchFilesInAppAsync(string manifestId, string[] files) + { + ValidateLaunchFilesInApp(manifestId, files); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + dict.Add("files", files); + return _client.ExecuteDevToolsMethodAsync("PWA.launchFilesInApp", dict); + } + + partial void ValidateOpenCurrentPageInApp(string manifestId); + /// + /// Opens the current page in its web app identified by the manifest id, needs + /// to be called on a page target. This function returns immediately without + /// waiting for the app to finish loading. + /// + /// manifestId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task OpenCurrentPageInAppAsync(string manifestId) + { + ValidateOpenCurrentPageInApp(manifestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + return _client.ExecuteDevToolsMethodAsync("PWA.openCurrentPageInApp", dict); + } + + partial void ValidateChangeAppUserSettings(string manifestId, bool? linkCapturing = null, CefSharp.DevTools.PWA.DisplayMode? displayMode = null); + /// + /// Changes user settings of the web app identified by its manifestId. If the + /// app was not installed, this command returns an error. Unset parameters will + /// be ignored; unrecognized values will cause an error. + /// + /// Unlike the ones defined in the manifest files of the web apps, these + /// settings are provided by the browser and controlled by the users, they + /// impact the way the browser handling the web apps. + /// + /// See the comment of each parameter. + /// + /// manifestId + /// If user allows the links clicked on by the user in the app's scope, orextended scope if the manifest has scope extensions and the flags`DesktopPWAsLinkCapturingWithScopeExtensions` and`WebAppEnableScopeExtensions` are enabled.Note, the API does not support resetting the linkCapturing to theinitial value, uninstalling and installing the web app again will resetit.TODO(crbug.com/339453269): Setting this value on ChromeOS is notsupported yet. + /// displayMode + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ChangeAppUserSettingsAsync(string manifestId, bool? linkCapturing = null, CefSharp.DevTools.PWA.DisplayMode? displayMode = null) + { + ValidateChangeAppUserSettings(manifestId, linkCapturing, displayMode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("manifestId", manifestId); + if (linkCapturing.HasValue) + { + dict.Add("linkCapturing", linkCapturing.Value); + } + + if (displayMode.HasValue) + { + dict.Add("displayMode", EnumToString(displayMode)); + } + + return _client.ExecuteDevToolsMethodAsync("PWA.changeAppUserSettings", dict); + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// AddScriptToEvaluateOnNewDocumentResponse + /// + public class AddScriptToEvaluateOnNewDocumentResponse : DevToolsDomainResponseBase + { + /// + /// identifier + /// + [JsonInclude] + [JsonPropertyName("identifier")] + public string Identifier + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// CaptureScreenshotResponse + /// + public class CaptureScreenshotResponse : DevToolsDomainResponseBase + { + /// + /// data + /// + [JsonInclude] + [JsonPropertyName("data")] + public byte[] Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// CaptureSnapshotResponse + /// + public class CaptureSnapshotResponse : DevToolsDomainResponseBase + { + /// + /// data + /// + [JsonInclude] + [JsonPropertyName("data")] + public string Data + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// CreateIsolatedWorldResponse + /// + public class CreateIsolatedWorldResponse : DevToolsDomainResponseBase + { + /// + /// executionContextId + /// + [JsonInclude] + [JsonPropertyName("executionContextId")] + public int ExecutionContextId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetAppManifestResponse + /// + public class GetAppManifestResponse : DevToolsDomainResponseBase + { + /// + /// url + /// + [JsonInclude] + [JsonPropertyName("url")] + public string Url + { + get; + private set; + } + + /// + /// errors + /// + [JsonInclude] + [JsonPropertyName("errors")] + public System.Collections.Generic.IList Errors + { + get; + private set; + } + + /// + /// data + /// + [JsonInclude] + [JsonPropertyName("data")] + public string Data + { + get; + private set; + } + + /// + /// parsed + /// + [JsonInclude] + [JsonPropertyName("parsed")] + public CefSharp.DevTools.Page.AppManifestParsedProperties Parsed + { + get; + private set; + } + + /// + /// manifest + /// + [JsonInclude] + [JsonPropertyName("manifest")] + public CefSharp.DevTools.Page.WebAppManifest Manifest + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetInstallabilityErrorsResponse + /// + public class GetInstallabilityErrorsResponse : DevToolsDomainResponseBase + { + /// + /// installabilityErrors + /// + [JsonInclude] + [JsonPropertyName("installabilityErrors")] + public System.Collections.Generic.IList InstallabilityErrors + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetAppIdResponse + /// + public class GetAppIdResponse : DevToolsDomainResponseBase + { + /// + /// appId + /// + [JsonInclude] + [JsonPropertyName("appId")] + public string AppId + { + get; + private set; + } + + /// + /// recommendedId + /// + [JsonInclude] + [JsonPropertyName("recommendedId")] + public string RecommendedId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetAdScriptAncestryResponse + /// + public class GetAdScriptAncestryResponse : DevToolsDomainResponseBase + { + /// + /// adScriptAncestry + /// + [JsonInclude] + [JsonPropertyName("adScriptAncestry")] + public CefSharp.DevTools.Page.AdScriptAncestry AdScriptAncestry + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetFrameTreeResponse + /// + public class GetFrameTreeResponse : DevToolsDomainResponseBase + { + /// + /// frameTree + /// + [JsonInclude] + [JsonPropertyName("frameTree")] + public CefSharp.DevTools.Page.FrameTree FrameTree + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetLayoutMetricsResponse + /// + public class GetLayoutMetricsResponse : DevToolsDomainResponseBase + { + /// + /// layoutViewport + /// + [JsonInclude] + [JsonPropertyName("layoutViewport")] + public CefSharp.DevTools.Page.LayoutViewport LayoutViewport + { + get; + private set; + } + + /// + /// visualViewport + /// + [JsonInclude] + [JsonPropertyName("visualViewport")] + public CefSharp.DevTools.Page.VisualViewport VisualViewport + { + get; + private set; + } + + /// + /// contentSize + /// + [JsonInclude] + [JsonPropertyName("contentSize")] + public CefSharp.DevTools.DOM.Rect ContentSize + { + get; + private set; + } + + /// + /// cssLayoutViewport + /// + [JsonInclude] + [JsonPropertyName("cssLayoutViewport")] + public CefSharp.DevTools.Page.LayoutViewport CssLayoutViewport + { + get; + private set; + } + + /// + /// cssVisualViewport + /// + [JsonInclude] + [JsonPropertyName("cssVisualViewport")] + public CefSharp.DevTools.Page.VisualViewport CssVisualViewport + { + get; + private set; + } + + /// + /// cssContentSize + /// + [JsonInclude] + [JsonPropertyName("cssContentSize")] + public CefSharp.DevTools.DOM.Rect CssContentSize + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetNavigationHistoryResponse + /// + public class GetNavigationHistoryResponse : DevToolsDomainResponseBase + { + /// + /// currentIndex + /// + [JsonInclude] + [JsonPropertyName("currentIndex")] + public int CurrentIndex + { + get; + private set; + } + + /// + /// entries + /// + [JsonInclude] + [JsonPropertyName("entries")] + public System.Collections.Generic.IList Entries + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetResourceContentResponse + /// + public class GetResourceContentResponse : DevToolsDomainResponseBase + { + /// + /// content + /// + [JsonInclude] + [JsonPropertyName("content")] + public string Content + { + get; + private set; + } + + /// + /// base64Encoded + /// + [JsonInclude] + [JsonPropertyName("base64Encoded")] + public bool Base64Encoded + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetResourceTreeResponse + /// + public class GetResourceTreeResponse : DevToolsDomainResponseBase + { + /// + /// frameTree + /// + [JsonInclude] + [JsonPropertyName("frameTree")] + public CefSharp.DevTools.Page.FrameResourceTree FrameTree + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// NavigateResponse + /// + public class NavigateResponse : DevToolsDomainResponseBase + { + /// + /// frameId + /// + [JsonInclude] + [JsonPropertyName("frameId")] + public string FrameId + { + get; + private set; + } + + /// + /// loaderId + /// + [JsonInclude] + [JsonPropertyName("loaderId")] + public string LoaderId + { + get; + private set; + } + + /// + /// errorText + /// + [JsonInclude] + [JsonPropertyName("errorText")] + public string ErrorText + { + get; + private set; + } + + /// + /// isDownload + /// + [JsonInclude] + [JsonPropertyName("isDownload")] + public bool? IsDownload + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// PrintToPDFResponse + /// + public class PrintToPDFResponse : DevToolsDomainResponseBase + { + /// + /// data + /// + [JsonInclude] + [JsonPropertyName("data")] + public byte[] Data + { + get; + private set; + } + + /// + /// stream + /// + [JsonInclude] + [JsonPropertyName("stream")] + public string Stream + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// SearchInResourceResponse + /// + public class SearchInResourceResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public System.Collections.Generic.IList Result + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetPermissionsPolicyStateResponse + /// + public class GetPermissionsPolicyStateResponse : DevToolsDomainResponseBase + { + /// + /// states + /// + [JsonInclude] + [JsonPropertyName("states")] + public System.Collections.Generic.IList States + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetOriginTrialsResponse + /// + public class GetOriginTrialsResponse : DevToolsDomainResponseBase + { + /// + /// originTrials + /// + [JsonInclude] + [JsonPropertyName("originTrials")] + public System.Collections.Generic.IList OriginTrials + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + /// + /// GetAnnotatedPageContentResponse + /// + public class GetAnnotatedPageContentResponse : DevToolsDomainResponseBase + { + /// + /// content + /// + [JsonInclude] + [JsonPropertyName("content")] + public byte[] Content + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Page +{ + using System.Linq; + + /// + /// Image compression format (defaults to png). + /// + public enum CaptureScreenshotFormat + { + /// + /// jpeg + /// + [JsonPropertyName("jpeg")] + Jpeg, + /// + /// png + /// + [JsonPropertyName("png")] + Png, + /// + /// webp + /// + [JsonPropertyName("webp")] + Webp + } + + /// + /// Format (defaults to mhtml). + /// + public enum CaptureSnapshotFormat + { + /// + /// mhtml + /// + [JsonPropertyName("mhtml")] + Mhtml + } + + /// + /// return as stream + /// + public enum PrintToPDFTransferMode + { + /// + /// ReturnAsBase64 + /// + [JsonPropertyName("ReturnAsBase64")] + ReturnAsBase64, + /// + /// ReturnAsStream + /// + [JsonPropertyName("ReturnAsStream")] + ReturnAsStream + } + + /// + /// Image compression format. + /// + public enum StartScreencastFormat + { + /// + /// jpeg + /// + [JsonPropertyName("jpeg")] + Jpeg, + /// + /// png + /// + [JsonPropertyName("png")] + Png + } + + /// + /// Target lifecycle state + /// + public enum SetWebLifecycleStateState + { + /// + /// frozen + /// + [JsonPropertyName("frozen")] + Frozen, + /// + /// active + /// + [JsonPropertyName("active")] + Active + } + + /// + /// SetSPCTransactionModeMode + /// + public enum SetSPCTransactionModeMode + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// autoAccept + /// + [JsonPropertyName("autoAccept")] + AutoAccept, + /// + /// autoChooseToAuthAnotherWay + /// + [JsonPropertyName("autoChooseToAuthAnotherWay")] + AutoChooseToAuthAnotherWay, + /// + /// autoReject + /// + [JsonPropertyName("autoReject")] + AutoReject, + /// + /// autoOptOut + /// + [JsonPropertyName("autoOptOut")] + AutoOptOut + } + + /// + /// SetRPHRegistrationModeMode + /// + public enum SetRPHRegistrationModeMode + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// autoAccept + /// + [JsonPropertyName("autoAccept")] + AutoAccept, + /// + /// autoReject + /// + [JsonPropertyName("autoReject")] + AutoReject + } + + /// + /// Actions and events related to the inspected page belong to the page domain. + /// + public partial class PageClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Page + /// + /// DevToolsClient + public PageClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// DomContentEventFired + /// + public event System.EventHandler DomContentEventFired + { + add + { + _client.AddEventHandler("Page.domContentEventFired", value); + } + + remove + { + _client.RemoveEventHandler("Page.domContentEventFired", value); + } + } + + /// + /// Emitted only when `page.interceptFileChooser` is enabled. + /// + public event System.EventHandler FileChooserOpened + { + add + { + _client.AddEventHandler("Page.fileChooserOpened", value); + } + + remove + { + _client.RemoveEventHandler("Page.fileChooserOpened", value); + } + } + + /// + /// Fired when frame has been attached to its parent. + /// + public event System.EventHandler FrameAttached + { + add + { + _client.AddEventHandler("Page.frameAttached", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameAttached", value); + } + } + + /// + /// Fired when frame has been detached from its parent. + /// + public event System.EventHandler FrameDetached + { + add + { + _client.AddEventHandler("Page.frameDetached", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameDetached", value); + } + } + + /// + /// Fired before frame subtree is detached. Emitted before any frame of the + /// subtree is actually detached. + /// + public event System.EventHandler FrameSubtreeWillBeDetached + { + add + { + _client.AddEventHandler("Page.frameSubtreeWillBeDetached", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameSubtreeWillBeDetached", value); + } + } + + /// + /// Fired once navigation of the frame has completed. Frame is now associated with the new loader. + /// + public event System.EventHandler FrameNavigated + { + add + { + _client.AddEventHandler("Page.frameNavigated", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameNavigated", value); + } + } + + /// + /// Fired when opening document to write to. + /// + public event System.EventHandler DocumentOpened + { + add + { + _client.AddEventHandler("Page.documentOpened", value); + } + + remove + { + _client.RemoveEventHandler("Page.documentOpened", value); + } + } + + /// + /// FrameResized + /// + public event System.EventHandler FrameResized + { + add + { + _client.AddEventHandler("Page.frameResized", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameResized", value); + } + } + + /// + /// Fired when a navigation starts. This event is fired for both + /// renderer-initiated and browser-initiated navigations. For renderer-initiated + /// navigations, the event is fired after `frameRequestedNavigation`. + /// Navigation may still be cancelled after the event is issued. Multiple events + /// can be fired for a single navigation, for example, when a same-document + /// navigation becomes a cross-document navigation (such as in the case of a + /// frameset). + /// + public event System.EventHandler FrameStartedNavigating + { + add + { + _client.AddEventHandler("Page.frameStartedNavigating", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameStartedNavigating", value); + } + } + + /// + /// Fired when a renderer-initiated navigation is requested. + /// Navigation may still be cancelled after the event is issued. + /// + public event System.EventHandler FrameRequestedNavigation + { + add + { + _client.AddEventHandler("Page.frameRequestedNavigation", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameRequestedNavigation", value); + } + } + + /// + /// Fired when frame has started loading. + /// + public event System.EventHandler FrameStartedLoading + { + add + { + _client.AddEventHandler("Page.frameStartedLoading", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameStartedLoading", value); + } + } + + /// + /// Fired when frame has stopped loading. + /// + public event System.EventHandler FrameStoppedLoading + { + add + { + _client.AddEventHandler("Page.frameStoppedLoading", value); + } + + remove + { + _client.RemoveEventHandler("Page.frameStoppedLoading", value); + } + } + + /// + /// Fired when interstitial page was hidden + /// + public event System.EventHandler InterstitialHidden + { + add + { + _client.AddEventHandler("Page.interstitialHidden", value); + } + + remove + { + _client.RemoveEventHandler("Page.interstitialHidden", value); + } + } + + /// + /// Fired when interstitial page was shown + /// + public event System.EventHandler InterstitialShown + { + add + { + _client.AddEventHandler("Page.interstitialShown", value); + } + + remove + { + _client.RemoveEventHandler("Page.interstitialShown", value); + } + } + + /// + /// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been + /// closed. + /// + public event System.EventHandler JavascriptDialogClosed + { + add + { + _client.AddEventHandler("Page.javascriptDialogClosed", value); + } + + remove + { + _client.RemoveEventHandler("Page.javascriptDialogClosed", value); + } + } + + /// + /// Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to + /// open. + /// + public event System.EventHandler JavascriptDialogOpening + { + add + { + _client.AddEventHandler("Page.javascriptDialogOpening", value); + } + + remove + { + _client.RemoveEventHandler("Page.javascriptDialogOpening", value); + } + } + + /// + /// Fired for lifecycle events (navigation, load, paint, etc) in the current + /// target (including local frames). + /// + public event System.EventHandler LifecycleEvent + { + add + { + _client.AddEventHandler("Page.lifecycleEvent", value); + } + + remove + { + _client.RemoveEventHandler("Page.lifecycleEvent", value); + } + } + + /// + /// Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do + /// not assume any ordering with the Page.frameNavigated event. This event is fired only for + /// main-frame history navigation where the document changes (non-same-document navigations), + /// when bfcache navigation fails. + /// + public event System.EventHandler BackForwardCacheNotUsed + { + add + { + _client.AddEventHandler("Page.backForwardCacheNotUsed", value); + } + + remove + { + _client.RemoveEventHandler("Page.backForwardCacheNotUsed", value); + } + } + + /// + /// LoadEventFired + /// + public event System.EventHandler LoadEventFired + { + add + { + _client.AddEventHandler("Page.loadEventFired", value); + } + + remove + { + _client.RemoveEventHandler("Page.loadEventFired", value); + } + } + + /// + /// Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. + /// + public event System.EventHandler NavigatedWithinDocument + { + add + { + _client.AddEventHandler("Page.navigatedWithinDocument", value); + } + + remove + { + _client.RemoveEventHandler("Page.navigatedWithinDocument", value); + } + } + + /// + /// Compressed image data requested by the `startScreencast`. + /// + public event System.EventHandler ScreencastFrame + { + add + { + _client.AddEventHandler("Page.screencastFrame", value); + } + + remove + { + _client.RemoveEventHandler("Page.screencastFrame", value); + } + } + + /// + /// Fired when the page with currently enabled screencast was shown or hidden `. + /// + public event System.EventHandler ScreencastVisibilityChanged + { + add + { + _client.AddEventHandler("Page.screencastVisibilityChanged", value); + } + + remove + { + _client.RemoveEventHandler("Page.screencastVisibilityChanged", value); + } + } + + /// + /// Fired when a new window is going to be opened, via window.open(), link click, form submission, + /// etc. + /// + public event System.EventHandler WindowOpen + { + add + { + _client.AddEventHandler("Page.windowOpen", value); + } + + remove + { + _client.RemoveEventHandler("Page.windowOpen", value); + } + } + + /// + /// Issued for every compilation cache generated. + /// + public event System.EventHandler CompilationCacheProduced + { + add + { + _client.AddEventHandler("Page.compilationCacheProduced", value); + } + + remove + { + _client.RemoveEventHandler("Page.compilationCacheProduced", value); + } + } + + partial void ValidateAddScriptToEvaluateOnNewDocument(string source, string worldName = null, bool? includeCommandLineAPI = null, bool? runImmediately = null); + /// + /// Evaluates given script in every frame upon creation (before loading frame's scripts). + /// + /// source + /// If specified, creates an isolated world with the given name and evaluates given script in it.This world name will be used as the ExecutionContextDescription::name when the correspondingevent is emitted. + /// Specifies whether command line API should be available to the script, defaultsto false. + /// If true, runs the script immediately on existing execution contexts or worlds.Default: false. + /// returns System.Threading.Tasks.Task<AddScriptToEvaluateOnNewDocumentResponse> + public System.Threading.Tasks.Task AddScriptToEvaluateOnNewDocumentAsync(string source, string worldName = null, bool? includeCommandLineAPI = null, bool? runImmediately = null) + { + ValidateAddScriptToEvaluateOnNewDocument(source, worldName, includeCommandLineAPI, runImmediately); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("source", source); + if (!(string.IsNullOrEmpty(worldName))) + { + dict.Add("worldName", worldName); + } + + if (includeCommandLineAPI.HasValue) + { + dict.Add("includeCommandLineAPI", includeCommandLineAPI.Value); + } + + if (runImmediately.HasValue) + { + dict.Add("runImmediately", runImmediately.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.addScriptToEvaluateOnNewDocument", dict); + } + + /// + /// Brings page to front (activates tab). + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task BringToFrontAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.bringToFront", dict); + } + + partial void ValidateCaptureScreenshot(CefSharp.DevTools.Page.CaptureScreenshotFormat? format = null, int? quality = null, CefSharp.DevTools.Page.Viewport clip = null, bool? fromSurface = null, bool? captureBeyondViewport = null, bool? optimizeForSpeed = null); + /// + /// Capture page screenshot. + /// + /// Image compression format (defaults to png). + /// Compression quality from range [0..100] (jpeg only). + /// Capture the screenshot of a given region only. + /// Capture the screenshot from the surface, rather than the view. Defaults to true. + /// Capture the screenshot beyond the viewport. Defaults to false. + /// Optimize image encoding for speed, not for resulting size (defaults to false) + /// returns System.Threading.Tasks.Task<CaptureScreenshotResponse> + public System.Threading.Tasks.Task CaptureScreenshotAsync(CefSharp.DevTools.Page.CaptureScreenshotFormat? format = null, int? quality = null, CefSharp.DevTools.Page.Viewport clip = null, bool? fromSurface = null, bool? captureBeyondViewport = null, bool? optimizeForSpeed = null) + { + ValidateCaptureScreenshot(format, quality, clip, fromSurface, captureBeyondViewport, optimizeForSpeed); + var dict = new System.Collections.Generic.Dictionary(); + if (format.HasValue) + { + dict.Add("format", EnumToString(format)); + } + + if (quality.HasValue) + { + dict.Add("quality", quality.Value); + } + + if ((clip) != (null)) + { + dict.Add("clip", clip.ToDictionary()); + } + + if (fromSurface.HasValue) + { + dict.Add("fromSurface", fromSurface.Value); + } + + if (captureBeyondViewport.HasValue) + { + dict.Add("captureBeyondViewport", captureBeyondViewport.Value); + } + + if (optimizeForSpeed.HasValue) + { + dict.Add("optimizeForSpeed", optimizeForSpeed.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.captureScreenshot", dict); + } + + partial void ValidateCaptureSnapshot(CefSharp.DevTools.Page.CaptureSnapshotFormat? format = null); + /// + /// Returns a snapshot of the page as a string. For MHTML format, the serialization includes + /// iframes, shadow DOM, external resources, and element-inline styles. + /// + /// Format (defaults to mhtml). + /// returns System.Threading.Tasks.Task<CaptureSnapshotResponse> + public System.Threading.Tasks.Task CaptureSnapshotAsync(CefSharp.DevTools.Page.CaptureSnapshotFormat? format = null) + { + ValidateCaptureSnapshot(format); + var dict = new System.Collections.Generic.Dictionary(); + if (format.HasValue) + { + dict.Add("format", EnumToString(format)); + } + + return _client.ExecuteDevToolsMethodAsync("Page.captureSnapshot", dict); + } + + partial void ValidateCreateIsolatedWorld(string frameId, string worldName = null, bool? grantUniveralAccess = null); + /// + /// Creates an isolated world for the given frame. + /// + /// Id of the frame in which the isolated world should be created. + /// An optional name which is reported in the Execution Context. + /// Whether or not universal access should be granted to the isolated world. This is a powerfuloption, use with caution. + /// returns System.Threading.Tasks.Task<CreateIsolatedWorldResponse> + public System.Threading.Tasks.Task CreateIsolatedWorldAsync(string frameId, string worldName = null, bool? grantUniveralAccess = null) + { + ValidateCreateIsolatedWorld(frameId, worldName, grantUniveralAccess); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + if (!(string.IsNullOrEmpty(worldName))) + { + dict.Add("worldName", worldName); + } + + if (grantUniveralAccess.HasValue) + { + dict.Add("grantUniveralAccess", grantUniveralAccess.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.createIsolatedWorld", dict); + } + + /// + /// Disables page domain notifications. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.disable", dict); + } + + partial void ValidateEnable(bool? enableFileChooserOpenedEvent = null); + /// + /// Enables page domain notifications. + /// + /// If true, the `Page.fileChooserOpened` event will be emitted regardless of the state set by`Page.setInterceptFileChooserDialog` command (default: false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(bool? enableFileChooserOpenedEvent = null) + { + ValidateEnable(enableFileChooserOpenedEvent); + var dict = new System.Collections.Generic.Dictionary(); + if (enableFileChooserOpenedEvent.HasValue) + { + dict.Add("enableFileChooserOpenedEvent", enableFileChooserOpenedEvent.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.enable", dict); + } + + partial void ValidateGetAppManifest(string manifestId = null); + /// + /// Gets the processed manifest for this current document. + /// This API always waits for the manifest to be loaded. + /// If manifestId is provided, and it does not match the manifest of the + /// current document, this API errors out. + /// If there is not a loaded page, this API errors out immediately. + /// + /// manifestId + /// returns System.Threading.Tasks.Task<GetAppManifestResponse> + public System.Threading.Tasks.Task GetAppManifestAsync(string manifestId = null) + { + ValidateGetAppManifest(manifestId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(manifestId))) + { + dict.Add("manifestId", manifestId); + } + + return _client.ExecuteDevToolsMethodAsync("Page.getAppManifest", dict); + } + + /// + /// GetInstallabilityErrors + /// + /// returns System.Threading.Tasks.Task<GetInstallabilityErrorsResponse> + public System.Threading.Tasks.Task GetInstallabilityErrorsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getInstallabilityErrors", dict); + } + + /// + /// Returns the unique (PWA) app id. + /// Only returns values if the feature flag 'WebAppEnableManifestId' is enabled + /// + /// returns System.Threading.Tasks.Task<GetAppIdResponse> + public System.Threading.Tasks.Task GetAppIdAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getAppId", dict); + } + + partial void ValidateGetAdScriptAncestry(string frameId); + /// + /// GetAdScriptAncestry + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetAdScriptAncestryResponse> + public System.Threading.Tasks.Task GetAdScriptAncestryAsync(string frameId) + { + ValidateGetAdScriptAncestry(frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + return _client.ExecuteDevToolsMethodAsync("Page.getAdScriptAncestry", dict); + } + + /// + /// Returns present frame tree structure. + /// + /// returns System.Threading.Tasks.Task<GetFrameTreeResponse> + public System.Threading.Tasks.Task GetFrameTreeAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getFrameTree", dict); + } + + /// + /// Returns metrics relating to the layouting of the page, such as viewport bounds/scale. + /// + /// returns System.Threading.Tasks.Task<GetLayoutMetricsResponse> + public System.Threading.Tasks.Task GetLayoutMetricsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getLayoutMetrics", dict); + } + + /// + /// Returns navigation history for the current page. + /// + /// returns System.Threading.Tasks.Task<GetNavigationHistoryResponse> + public System.Threading.Tasks.Task GetNavigationHistoryAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getNavigationHistory", dict); + } + + /// + /// Resets navigation history for the current page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetNavigationHistoryAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.resetNavigationHistory", dict); + } + + partial void ValidateGetResourceContent(string frameId, string url); + /// + /// Returns content of the given resource. + /// + /// Frame id to get resource for. + /// URL of the resource to get content for. + /// returns System.Threading.Tasks.Task<GetResourceContentResponse> + public System.Threading.Tasks.Task GetResourceContentAsync(string frameId, string url) + { + ValidateGetResourceContent(frameId, url); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + dict.Add("url", url); + return _client.ExecuteDevToolsMethodAsync("Page.getResourceContent", dict); + } + + /// + /// Returns present frame / resource tree structure. + /// + /// returns System.Threading.Tasks.Task<GetResourceTreeResponse> + public System.Threading.Tasks.Task GetResourceTreeAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.getResourceTree", dict); + } + + partial void ValidateHandleJavaScriptDialog(bool accept, string promptText = null); + /// + /// Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). + /// + /// Whether to accept or dismiss the dialog. + /// The text to enter into the dialog prompt before accepting. Used only if this is a promptdialog. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task HandleJavaScriptDialogAsync(bool accept, string promptText = null) + { + ValidateHandleJavaScriptDialog(accept, promptText); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("accept", accept); + if (!(string.IsNullOrEmpty(promptText))) + { + dict.Add("promptText", promptText); + } + + return _client.ExecuteDevToolsMethodAsync("Page.handleJavaScriptDialog", dict); + } + + partial void ValidateNavigate(string url, string referrer = null, CefSharp.DevTools.Page.TransitionType? transitionType = null, string frameId = null, CefSharp.DevTools.Page.ReferrerPolicy? referrerPolicy = null); + /// + /// Navigates current page to the given URL. + /// + /// URL to navigate the page to. + /// Referrer URL. + /// Intended transition type. + /// Frame id to navigate, if not specified navigates the top frame. + /// Referrer-policy used for the navigation. + /// returns System.Threading.Tasks.Task<NavigateResponse> + public System.Threading.Tasks.Task NavigateAsync(string url, string referrer = null, CefSharp.DevTools.Page.TransitionType? transitionType = null, string frameId = null, CefSharp.DevTools.Page.ReferrerPolicy? referrerPolicy = null) + { + ValidateNavigate(url, referrer, transitionType, frameId, referrerPolicy); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + if (!(string.IsNullOrEmpty(referrer))) + { + dict.Add("referrer", referrer); + } + + if (transitionType.HasValue) + { + dict.Add("transitionType", EnumToString(transitionType)); + } + + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + if (referrerPolicy.HasValue) + { + dict.Add("referrerPolicy", EnumToString(referrerPolicy)); + } + + return _client.ExecuteDevToolsMethodAsync("Page.navigate", dict); + } + + partial void ValidateNavigateToHistoryEntry(int entryId); + /// + /// Navigates current page to the given history entry. + /// + /// Unique id of the entry to navigate to. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task NavigateToHistoryEntryAsync(int entryId) + { + ValidateNavigateToHistoryEntry(entryId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("entryId", entryId); + return _client.ExecuteDevToolsMethodAsync("Page.navigateToHistoryEntry", dict); + } + + partial void ValidatePrintToPDF(bool? landscape = null, bool? displayHeaderFooter = null, bool? printBackground = null, double? scale = null, double? paperWidth = null, double? paperHeight = null, double? marginTop = null, double? marginBottom = null, double? marginLeft = null, double? marginRight = null, string pageRanges = null, string headerTemplate = null, string footerTemplate = null, bool? preferCSSPageSize = null, CefSharp.DevTools.Page.PrintToPDFTransferMode? transferMode = null, bool? generateTaggedPDF = null, bool? generateDocumentOutline = null); + /// + /// Print page as PDF. + /// + /// Paper orientation. Defaults to false. + /// Display header and footer. Defaults to false. + /// Print background graphics. Defaults to false. + /// Scale of the webpage rendering. Defaults to 1. + /// Paper width in inches. Defaults to 8.5 inches. + /// Paper height in inches. Defaults to 11 inches. + /// Top margin in inches. Defaults to 1cm (~0.4 inches). + /// Bottom margin in inches. Defaults to 1cm (~0.4 inches). + /// Left margin in inches. Defaults to 1cm (~0.4 inches). + /// Right margin in inches. Defaults to 1cm (~0.4 inches). + /// Paper ranges to print, one based, e.g., '1-5, 8, 11-13'. Pages areprinted in the document order, not in the order specified, and nomore than once.Defaults to empty string, which implies the entire document is printed.The page numbers are quietly capped to actual page count of thedocument, and ranges beyond the end of the document are ignored.If this results in no pages to print, an error is reported.It is an error to specify a range with start greater than end. + /// HTML template for the print header. Should be valid HTML markup with followingclasses used to inject printing values into them:- `date`: formatted print date- `title`: document title- `url`: document location- `pageNumber`: current page number- `totalPages`: total pages in the documentFor example, `<span class=title> </span>` would generate span containing the title. + /// HTML template for the print footer. Should use the same format as the `headerTemplate`. + /// Whether or not to prefer page size as defined by css. Defaults to false,in which case the content will be scaled to fit the paper size. + /// return as stream + /// Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice. + /// Whether or not to embed the document outline into the PDF. + /// returns System.Threading.Tasks.Task<PrintToPDFResponse> + public System.Threading.Tasks.Task PrintToPDFAsync(bool? landscape = null, bool? displayHeaderFooter = null, bool? printBackground = null, double? scale = null, double? paperWidth = null, double? paperHeight = null, double? marginTop = null, double? marginBottom = null, double? marginLeft = null, double? marginRight = null, string pageRanges = null, string headerTemplate = null, string footerTemplate = null, bool? preferCSSPageSize = null, CefSharp.DevTools.Page.PrintToPDFTransferMode? transferMode = null, bool? generateTaggedPDF = null, bool? generateDocumentOutline = null) + { + ValidatePrintToPDF(landscape, displayHeaderFooter, printBackground, scale, paperWidth, paperHeight, marginTop, marginBottom, marginLeft, marginRight, pageRanges, headerTemplate, footerTemplate, preferCSSPageSize, transferMode, generateTaggedPDF, generateDocumentOutline); + var dict = new System.Collections.Generic.Dictionary(); + if (landscape.HasValue) + { + dict.Add("landscape", landscape.Value); + } + + if (displayHeaderFooter.HasValue) + { + dict.Add("displayHeaderFooter", displayHeaderFooter.Value); + } + + if (printBackground.HasValue) + { + dict.Add("printBackground", printBackground.Value); + } + + if (scale.HasValue) + { + dict.Add("scale", scale.Value); + } + + if (paperWidth.HasValue) + { + dict.Add("paperWidth", paperWidth.Value); + } + + if (paperHeight.HasValue) + { + dict.Add("paperHeight", paperHeight.Value); + } + + if (marginTop.HasValue) + { + dict.Add("marginTop", marginTop.Value); + } + + if (marginBottom.HasValue) + { + dict.Add("marginBottom", marginBottom.Value); + } + + if (marginLeft.HasValue) + { + dict.Add("marginLeft", marginLeft.Value); + } + + if (marginRight.HasValue) + { + dict.Add("marginRight", marginRight.Value); + } + + if (!(string.IsNullOrEmpty(pageRanges))) + { + dict.Add("pageRanges", pageRanges); + } + + if (!(string.IsNullOrEmpty(headerTemplate))) + { + dict.Add("headerTemplate", headerTemplate); + } + + if (!(string.IsNullOrEmpty(footerTemplate))) + { + dict.Add("footerTemplate", footerTemplate); + } + + if (preferCSSPageSize.HasValue) + { + dict.Add("preferCSSPageSize", preferCSSPageSize.Value); + } + + if (transferMode.HasValue) + { + dict.Add("transferMode", EnumToString(transferMode)); + } + + if (generateTaggedPDF.HasValue) + { + dict.Add("generateTaggedPDF", generateTaggedPDF.Value); + } + + if (generateDocumentOutline.HasValue) + { + dict.Add("generateDocumentOutline", generateDocumentOutline.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.printToPDF", dict); + } + + partial void ValidateReload(bool? ignoreCache = null, string scriptToEvaluateOnLoad = null, string loaderId = null); + /// + /// Reloads given page optionally ignoring the cache. + /// + /// If true, browser cache is ignored (as if the user pressed Shift+refresh). + /// If set, the script will be injected into all frames of the inspected page after reload.Argument will be ignored if reloading dataURL origin. + /// If set, an error will be thrown if the target page's main frame'sloader id does not match the provided id. This prevents accidentallyreloading an unintended target in case there's a racing navigation. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReloadAsync(bool? ignoreCache = null, string scriptToEvaluateOnLoad = null, string loaderId = null) + { + ValidateReload(ignoreCache, scriptToEvaluateOnLoad, loaderId); + var dict = new System.Collections.Generic.Dictionary(); + if (ignoreCache.HasValue) + { + dict.Add("ignoreCache", ignoreCache.Value); + } + + if (!(string.IsNullOrEmpty(scriptToEvaluateOnLoad))) + { + dict.Add("scriptToEvaluateOnLoad", scriptToEvaluateOnLoad); + } + + if (!(string.IsNullOrEmpty(loaderId))) + { + dict.Add("loaderId", loaderId); + } + + return _client.ExecuteDevToolsMethodAsync("Page.reload", dict); + } + + partial void ValidateRemoveScriptToEvaluateOnNewDocument(string identifier); + /// + /// Removes given script from the list. + /// + /// identifier + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveScriptToEvaluateOnNewDocumentAsync(string identifier) + { + ValidateRemoveScriptToEvaluateOnNewDocument(identifier); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("identifier", identifier); + return _client.ExecuteDevToolsMethodAsync("Page.removeScriptToEvaluateOnNewDocument", dict); + } + + partial void ValidateScreencastFrameAck(int sessionId); + /// + /// Acknowledges that a screencast frame has been received by the frontend. + /// + /// Frame number. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ScreencastFrameAckAsync(int sessionId) + { + ValidateScreencastFrameAck(sessionId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("sessionId", sessionId); + return _client.ExecuteDevToolsMethodAsync("Page.screencastFrameAck", dict); + } + + partial void ValidateSearchInResource(string frameId, string url, string query, bool? caseSensitive = null, bool? isRegex = null); + /// + /// Searches for given string in resource content. + /// + /// Frame id for resource to search in. + /// URL of the resource to search in. + /// String to search for. + /// If true, search is case sensitive. + /// If true, treats string parameter as regex. + /// returns System.Threading.Tasks.Task<SearchInResourceResponse> + public System.Threading.Tasks.Task SearchInResourceAsync(string frameId, string url, string query, bool? caseSensitive = null, bool? isRegex = null) + { + ValidateSearchInResource(frameId, url, query, caseSensitive, isRegex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + dict.Add("url", url); + dict.Add("query", query); + if (caseSensitive.HasValue) + { + dict.Add("caseSensitive", caseSensitive.Value); + } + + if (isRegex.HasValue) + { + dict.Add("isRegex", isRegex.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.searchInResource", dict); + } + + partial void ValidateSetAdBlockingEnabled(bool enabled); + /// + /// Enable Chrome's experimental ad filter on all sites. + /// + /// Whether to block ads. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAdBlockingEnabledAsync(bool enabled) + { + ValidateSetAdBlockingEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Page.setAdBlockingEnabled", dict); + } + + partial void ValidateSetBypassCSP(bool enabled); + /// + /// Enable page Content Security Policy by-passing. + /// + /// Whether to bypass page CSP. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBypassCSPAsync(bool enabled) + { + ValidateSetBypassCSP(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Page.setBypassCSP", dict); + } + + partial void ValidateGetPermissionsPolicyState(string frameId); + /// + /// Get Permissions Policy state on given frame. + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetPermissionsPolicyStateResponse> + public System.Threading.Tasks.Task GetPermissionsPolicyStateAsync(string frameId) + { + ValidateGetPermissionsPolicyState(frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + return _client.ExecuteDevToolsMethodAsync("Page.getPermissionsPolicyState", dict); + } + + partial void ValidateGetOriginTrials(string frameId); + /// + /// Get Origin Trials on given frame. + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetOriginTrialsResponse> + public System.Threading.Tasks.Task GetOriginTrialsAsync(string frameId) + { + ValidateGetOriginTrials(frameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + return _client.ExecuteDevToolsMethodAsync("Page.getOriginTrials", dict); + } + + partial void ValidateSetFontFamilies(CefSharp.DevTools.Page.FontFamilies fontFamilies, System.Collections.Generic.IList forScripts = null); + /// + /// Set generic font families. + /// + /// Specifies font families to set. If a font family is not specified, it won't be changed. + /// Specifies font families to set for individual scripts. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetFontFamiliesAsync(CefSharp.DevTools.Page.FontFamilies fontFamilies, System.Collections.Generic.IList forScripts = null) + { + ValidateSetFontFamilies(fontFamilies, forScripts); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("fontFamilies", fontFamilies.ToDictionary()); + if ((forScripts) != (null)) + { + dict.Add("forScripts", forScripts.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Page.setFontFamilies", dict); + } + + partial void ValidateSetFontSizes(CefSharp.DevTools.Page.FontSizes fontSizes); + /// + /// Set default font sizes. + /// + /// Specifies font sizes to set. If a font size is not specified, it won't be changed. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetFontSizesAsync(CefSharp.DevTools.Page.FontSizes fontSizes) + { + ValidateSetFontSizes(fontSizes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("fontSizes", fontSizes.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Page.setFontSizes", dict); + } + + partial void ValidateSetDocumentContent(string frameId, string html); + /// + /// Sets given markup as the document's HTML. + /// + /// Frame id to set HTML for. + /// HTML content to set. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDocumentContentAsync(string frameId, string html) + { + ValidateSetDocumentContent(frameId, html); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("frameId", frameId); + dict.Add("html", html); + return _client.ExecuteDevToolsMethodAsync("Page.setDocumentContent", dict); + } + + partial void ValidateSetLifecycleEventsEnabled(bool enabled); + /// + /// Controls whether page will emit lifecycle events. + /// + /// If true, starts emitting lifecycle events. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetLifecycleEventsEnabledAsync(bool enabled) + { + ValidateSetLifecycleEventsEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Page.setLifecycleEventsEnabled", dict); + } + + partial void ValidateStartScreencast(CefSharp.DevTools.Page.StartScreencastFormat? format = null, int? quality = null, int? maxWidth = null, int? maxHeight = null, int? everyNthFrame = null); + /// + /// Starts sending each frame using the `screencastFrame` event. + /// + /// Image compression format. + /// Compression quality from range [0..100]. + /// Maximum screenshot width. + /// Maximum screenshot height. + /// Send every n-th frame. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartScreencastAsync(CefSharp.DevTools.Page.StartScreencastFormat? format = null, int? quality = null, int? maxWidth = null, int? maxHeight = null, int? everyNthFrame = null) + { + ValidateStartScreencast(format, quality, maxWidth, maxHeight, everyNthFrame); + var dict = new System.Collections.Generic.Dictionary(); + if (format.HasValue) + { + dict.Add("format", EnumToString(format)); + } + + if (quality.HasValue) + { + dict.Add("quality", quality.Value); + } + + if (maxWidth.HasValue) + { + dict.Add("maxWidth", maxWidth.Value); + } + + if (maxHeight.HasValue) + { + dict.Add("maxHeight", maxHeight.Value); + } + + if (everyNthFrame.HasValue) + { + dict.Add("everyNthFrame", everyNthFrame.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.startScreencast", dict); + } + + /// + /// Force the page stop all navigations and pending resource fetches. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopLoadingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.stopLoading", dict); + } + + /// + /// Crashes renderer on the IO thread, generates minidumps. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CrashAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.crash", dict); + } + + /// + /// Tries to close page, running its beforeunload hooks, if any. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CloseAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.close", dict); + } + + partial void ValidateSetWebLifecycleState(CefSharp.DevTools.Page.SetWebLifecycleStateState state); + /// + /// Tries to update the web lifecycle state of the page. + /// It will transition the page to the given state according to: + /// https://github.com/WICG/web-lifecycle/ + /// + /// Target lifecycle state + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetWebLifecycleStateAsync(CefSharp.DevTools.Page.SetWebLifecycleStateState state) + { + ValidateSetWebLifecycleState(state); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("state", EnumToString(state)); + return _client.ExecuteDevToolsMethodAsync("Page.setWebLifecycleState", dict); + } + + /// + /// Stops sending each frame in the `screencastFrame`. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopScreencastAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.stopScreencast", dict); + } + + partial void ValidateProduceCompilationCache(System.Collections.Generic.IList scripts); + /// + /// Requests backend to produce compilation cache for the specified scripts. + /// `scripts` are appended to the list of scripts for which the cache + /// would be produced. The list may be reset during page navigation. + /// When script with a matching URL is encountered, the cache is optionally + /// produced upon backend discretion, based on internal heuristics. + /// See also: `Page.compilationCacheProduced`. + /// + /// scripts + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ProduceCompilationCacheAsync(System.Collections.Generic.IList scripts) + { + ValidateProduceCompilationCache(scripts); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scripts", scripts.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Page.produceCompilationCache", dict); + } + + partial void ValidateAddCompilationCache(string url, byte[] data); + /// + /// Seeds compilation cache for given url. Compilation cache does not survive + /// cross-process navigation. + /// + /// url + /// Base64-encoded data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddCompilationCacheAsync(string url, byte[] data) + { + ValidateAddCompilationCache(url, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + dict.Add("data", ToBase64String(data)); + return _client.ExecuteDevToolsMethodAsync("Page.addCompilationCache", dict); + } + + /// + /// Clears seeded compilation cache. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearCompilationCacheAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.clearCompilationCache", dict); + } + + partial void ValidateSetSPCTransactionMode(CefSharp.DevTools.Page.SetSPCTransactionModeMode mode); + /// + /// Sets the Secure Payment Confirmation transaction mode. + /// https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode + /// + /// mode + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSPCTransactionModeAsync(CefSharp.DevTools.Page.SetSPCTransactionModeMode mode) + { + ValidateSetSPCTransactionMode(mode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("mode", EnumToString(mode)); + return _client.ExecuteDevToolsMethodAsync("Page.setSPCTransactionMode", dict); + } + + partial void ValidateSetRPHRegistrationMode(CefSharp.DevTools.Page.SetRPHRegistrationModeMode mode); + /// + /// Extensions for Custom Handlers API: + /// https://html.spec.whatwg.org/multipage/system-state.html#rph-automation + /// + /// mode + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetRPHRegistrationModeAsync(CefSharp.DevTools.Page.SetRPHRegistrationModeMode mode) + { + ValidateSetRPHRegistrationMode(mode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("mode", EnumToString(mode)); + return _client.ExecuteDevToolsMethodAsync("Page.setRPHRegistrationMode", dict); + } + + partial void ValidateGenerateTestReport(string message, string group = null); + /// + /// Generates a report for testing. + /// + /// Message to be displayed in the report. + /// Specifies the endpoint group to deliver the report to. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task GenerateTestReportAsync(string message, string group = null) + { + ValidateGenerateTestReport(message, group); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("message", message); + if (!(string.IsNullOrEmpty(group))) + { + dict.Add("group", group); + } + + return _client.ExecuteDevToolsMethodAsync("Page.generateTestReport", dict); + } + + /// + /// Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task WaitForDebuggerAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Page.waitForDebugger", dict); + } + + partial void ValidateSetInterceptFileChooserDialog(bool enabled, bool? cancel = null); + /// + /// Intercept file chooser requests and transfer control to protocol clients. + /// When file chooser interception is enabled, native file chooser dialog is not shown. + /// Instead, a protocol event `Page.fileChooserOpened` is emitted. + /// + /// enabled + /// If true, cancels the dialog by emitting relevant events (if any)in addition to not showing it if the interception is enabled(default: false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInterceptFileChooserDialogAsync(bool enabled, bool? cancel = null) + { + ValidateSetInterceptFileChooserDialog(enabled, cancel); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + if (cancel.HasValue) + { + dict.Add("cancel", cancel.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.setInterceptFileChooserDialog", dict); + } + + partial void ValidateSetPrerenderingAllowed(bool isAllowed); + /// + /// Enable/disable prerendering manually. + /// + /// This command is a short-term solution for https://crbug.com/1440085. + /// See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA + /// for more details. + /// + /// TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets. + /// + /// isAllowed + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPrerenderingAllowedAsync(bool isAllowed) + { + ValidateSetPrerenderingAllowed(isAllowed); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("isAllowed", isAllowed); + return _client.ExecuteDevToolsMethodAsync("Page.setPrerenderingAllowed", dict); + } + + partial void ValidateGetAnnotatedPageContent(bool? includeActionableInformation = null); + /// + /// Get the annotated page content for the main frame. + /// This is an experimental command that is subject to change. + /// + /// Whether to include actionable information. Defaults to true. + /// returns System.Threading.Tasks.Task<GetAnnotatedPageContentResponse> + public System.Threading.Tasks.Task GetAnnotatedPageContentAsync(bool? includeActionableInformation = null) + { + ValidateGetAnnotatedPageContent(includeActionableInformation); + var dict = new System.Collections.Generic.Dictionary(); + if (includeActionableInformation.HasValue) + { + dict.Add("includeActionableInformation", includeActionableInformation.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Page.getAnnotatedPageContent", dict); + } + } +} + +namespace CefSharp.DevTools.Performance +{ + /// + /// GetMetricsResponse + /// + public class GetMetricsResponse : DevToolsDomainResponseBase + { + /// + /// metrics + /// + [JsonInclude] + [JsonPropertyName("metrics")] + public System.Collections.Generic.IList Metrics + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Performance +{ + using System.Linq; + + /// + /// Time domain to use for collecting and reporting duration metrics. + /// + public enum EnableTimeDomain + { + /// + /// timeTicks + /// + [JsonPropertyName("timeTicks")] + TimeTicks, + /// + /// threadTicks + /// + [JsonPropertyName("threadTicks")] + ThreadTicks + } + + /// + /// Performance + /// + public partial class PerformanceClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Performance + /// + /// DevToolsClient + public PerformanceClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Current values of the metrics. + /// + public event System.EventHandler Metrics + { + add + { + _client.AddEventHandler("Performance.metrics", value); + } + + remove + { + _client.RemoveEventHandler("Performance.metrics", value); + } + } + + /// + /// Disable collecting and reporting metrics. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Performance.disable", dict); + } + + partial void ValidateEnable(CefSharp.DevTools.Performance.EnableTimeDomain? timeDomain = null); + /// + /// Enable collecting and reporting metrics. + /// + /// Time domain to use for collecting and reporting duration metrics. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(CefSharp.DevTools.Performance.EnableTimeDomain? timeDomain = null) + { + ValidateEnable(timeDomain); + var dict = new System.Collections.Generic.Dictionary(); + if (timeDomain.HasValue) + { + dict.Add("timeDomain", EnumToString(timeDomain)); + } + + return _client.ExecuteDevToolsMethodAsync("Performance.enable", dict); + } + + /// + /// Retrieve current values of run-time metrics. + /// + /// returns System.Threading.Tasks.Task<GetMetricsResponse> + public System.Threading.Tasks.Task GetMetricsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Performance.getMetrics", dict); + } + } +} + +namespace CefSharp.DevTools.PerformanceTimeline +{ + using System.Linq; + + /// + /// Reporting of performance timeline events, as specified in + /// https://w3c.github.io/performance-timeline/#dom-performanceobserver. + /// + public partial class PerformanceTimelineClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// PerformanceTimeline + /// + /// DevToolsClient + public PerformanceTimelineClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Sent when a performance timeline event is added. See reportPerformanceTimeline method. + /// + public event System.EventHandler TimelineEventAdded + { + add + { + _client.AddEventHandler("PerformanceTimeline.timelineEventAdded", value); + } + + remove + { + _client.RemoveEventHandler("PerformanceTimeline.timelineEventAdded", value); + } + } + + partial void ValidateEnable(string[] eventTypes); + /// + /// Previously buffered events would be reported before method returns. + /// See also: timelineEventAdded + /// + /// The types of event to report, as specified inhttps://w3c.github.io/performance-timeline/#dom-performanceentry-entrytypeThe specified filter overrides any previous filters, passing emptyfilter disables recording.Note that not all types exposed to the web platform are currently supported. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(string[] eventTypes) + { + ValidateEnable(eventTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("eventTypes", eventTypes); + return _client.ExecuteDevToolsMethodAsync("PerformanceTimeline.enable", dict); + } + } +} + +namespace CefSharp.DevTools.Preload +{ + using System.Linq; + + /// + /// Preload + /// + public partial class PreloadClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Preload + /// + /// DevToolsClient + public PreloadClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Upsert. Currently, it is only emitted when a rule set added. + /// + public event System.EventHandler RuleSetUpdated + { + add + { + _client.AddEventHandler("Preload.ruleSetUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.ruleSetUpdated", value); + } + } + + /// + /// RuleSetRemoved + /// + public event System.EventHandler RuleSetRemoved + { + add + { + _client.AddEventHandler("Preload.ruleSetRemoved", value); + } + + remove + { + _client.RemoveEventHandler("Preload.ruleSetRemoved", value); + } + } + + /// + /// Fired when a preload enabled state is updated. + /// + public event System.EventHandler PreloadEnabledStateUpdated + { + add + { + _client.AddEventHandler("Preload.preloadEnabledStateUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.preloadEnabledStateUpdated", value); + } + } + + /// + /// Fired when a prefetch attempt is updated. + /// + public event System.EventHandler PrefetchStatusUpdated + { + add + { + _client.AddEventHandler("Preload.prefetchStatusUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.prefetchStatusUpdated", value); + } + } + + /// + /// Fired when a prerender attempt is updated. + /// + public event System.EventHandler PrerenderStatusUpdated + { + add + { + _client.AddEventHandler("Preload.prerenderStatusUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.prerenderStatusUpdated", value); + } + } + + /// + /// Send a list of sources for all preloading attempts in a document. + /// + public event System.EventHandler PreloadingAttemptSourcesUpdated + { + add + { + _client.AddEventHandler("Preload.preloadingAttemptSourcesUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Preload.preloadingAttemptSourcesUpdated", value); + } + } + + /// + /// Enable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Preload.enable", dict); + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Preload.disable", dict); + } + } +} + +namespace CefSharp.DevTools.Security +{ + using System.Linq; + + /// + /// Security + /// + public partial class SecurityClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Security + /// + /// DevToolsClient + public SecurityClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// The security state of the page changed. + /// + public event System.EventHandler VisibleSecurityStateChanged + { + add + { + _client.AddEventHandler("Security.visibleSecurityStateChanged", value); + } + + remove + { + _client.RemoveEventHandler("Security.visibleSecurityStateChanged", value); + } + } + + /// + /// Disables tracking security state changes. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Security.disable", dict); + } + + /// + /// Enables tracking security state changes. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Security.enable", dict); + } + + partial void ValidateSetIgnoreCertificateErrors(bool ignore); + /// + /// Enable/disable whether all certificate errors should be ignored. + /// + /// If true, all certificate errors will be ignored. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetIgnoreCertificateErrorsAsync(bool ignore) + { + ValidateSetIgnoreCertificateErrors(ignore); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ignore", ignore); + return _client.ExecuteDevToolsMethodAsync("Security.setIgnoreCertificateErrors", dict); + } + } +} + +namespace CefSharp.DevTools.ServiceWorker +{ + using System.Linq; + + /// + /// ServiceWorker + /// + public partial class ServiceWorkerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// ServiceWorker + /// + /// DevToolsClient + public ServiceWorkerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// WorkerErrorReported + /// + public event System.EventHandler WorkerErrorReported + { + add + { + _client.AddEventHandler("ServiceWorker.workerErrorReported", value); + } + + remove + { + _client.RemoveEventHandler("ServiceWorker.workerErrorReported", value); + } + } + + /// + /// WorkerRegistrationUpdated + /// + public event System.EventHandler WorkerRegistrationUpdated + { + add + { + _client.AddEventHandler("ServiceWorker.workerRegistrationUpdated", value); + } + + remove + { + _client.RemoveEventHandler("ServiceWorker.workerRegistrationUpdated", value); + } + } + + /// + /// WorkerVersionUpdated + /// + public event System.EventHandler WorkerVersionUpdated + { + add + { + _client.AddEventHandler("ServiceWorker.workerVersionUpdated", value); + } + + remove + { + _client.RemoveEventHandler("ServiceWorker.workerVersionUpdated", value); + } + } + + partial void ValidateDeliverPushMessage(string origin, string registrationId, string data); + /// + /// DeliverPushMessage + /// + /// origin + /// registrationId + /// data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeliverPushMessageAsync(string origin, string registrationId, string data) + { + ValidateDeliverPushMessage(origin, registrationId, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + dict.Add("registrationId", registrationId); + dict.Add("data", data); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.deliverPushMessage", dict); + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.disable", dict); + } + + partial void ValidateDispatchSyncEvent(string origin, string registrationId, string tag, bool lastChance); + /// + /// DispatchSyncEvent + /// + /// origin + /// registrationId + /// tag + /// lastChance + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchSyncEventAsync(string origin, string registrationId, string tag, bool lastChance) + { + ValidateDispatchSyncEvent(origin, registrationId, tag, lastChance); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + dict.Add("registrationId", registrationId); + dict.Add("tag", tag); + dict.Add("lastChance", lastChance); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.dispatchSyncEvent", dict); + } + + partial void ValidateDispatchPeriodicSyncEvent(string origin, string registrationId, string tag); + /// + /// DispatchPeriodicSyncEvent + /// + /// origin + /// registrationId + /// tag + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DispatchPeriodicSyncEventAsync(string origin, string registrationId, string tag) + { + ValidateDispatchPeriodicSyncEvent(origin, registrationId, tag); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + dict.Add("registrationId", registrationId); + dict.Add("tag", tag); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.dispatchPeriodicSyncEvent", dict); + } + + /// + /// Enable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.enable", dict); + } + + partial void ValidateSetForceUpdateOnPageLoad(bool forceUpdateOnPageLoad); + /// + /// SetForceUpdateOnPageLoad + /// + /// forceUpdateOnPageLoad + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetForceUpdateOnPageLoadAsync(bool forceUpdateOnPageLoad) + { + ValidateSetForceUpdateOnPageLoad(forceUpdateOnPageLoad); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("forceUpdateOnPageLoad", forceUpdateOnPageLoad); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.setForceUpdateOnPageLoad", dict); + } + + partial void ValidateSkipWaiting(string scopeURL); + /// + /// SkipWaiting + /// + /// scopeURL + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SkipWaitingAsync(string scopeURL) + { + ValidateSkipWaiting(scopeURL); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeURL", scopeURL); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.skipWaiting", dict); + } + + partial void ValidateStartWorker(string scopeURL); + /// + /// StartWorker + /// + /// scopeURL + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartWorkerAsync(string scopeURL) + { + ValidateStartWorker(scopeURL); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeURL", scopeURL); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.startWorker", dict); + } + + /// + /// StopAllWorkers + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopAllWorkersAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.stopAllWorkers", dict); + } + + partial void ValidateStopWorker(string versionId); + /// + /// StopWorker + /// + /// versionId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopWorkerAsync(string versionId) + { + ValidateStopWorker(versionId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("versionId", versionId); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.stopWorker", dict); + } + + partial void ValidateUnregister(string scopeURL); + /// + /// Unregister + /// + /// scopeURL + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UnregisterAsync(string scopeURL) + { + ValidateUnregister(scopeURL); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeURL", scopeURL); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.unregister", dict); + } + + partial void ValidateUpdateRegistration(string scopeURL); + /// + /// UpdateRegistration + /// + /// scopeURL + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UpdateRegistrationAsync(string scopeURL) + { + ValidateUpdateRegistration(scopeURL); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeURL", scopeURL); + return _client.ExecuteDevToolsMethodAsync("ServiceWorker.updateRegistration", dict); + } + } +} + +namespace CefSharp.DevTools.SmartCardEmulation +{ + using System.Linq; + + /// + /// SmartCardEmulation + /// + public partial class SmartCardEmulationClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// SmartCardEmulation + /// + /// DevToolsClient + public SmartCardEmulationClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when |SCardEstablishContext| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext + /// + public event System.EventHandler EstablishContextRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.establishContextRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.establishContextRequested", value); + } + } + + /// + /// Fired when |SCardReleaseContext| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext + /// + public event System.EventHandler ReleaseContextRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.releaseContextRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.releaseContextRequested", value); + } + } + + /// + /// Fired when |SCardListReaders| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa + /// + public event System.EventHandler ListReadersRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.listReadersRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.listReadersRequested", value); + } + } + + /// + /// Fired when |SCardGetStatusChange| is called. Timeout is specified in milliseconds. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea + /// + public event System.EventHandler GetStatusChangeRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.getStatusChangeRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.getStatusChangeRequested", value); + } + } + + /// + /// Fired when |SCardCancel| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel + /// + public event System.EventHandler CancelRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.cancelRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.cancelRequested", value); + } + } + + /// + /// Fired when |SCardConnect| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta + /// + public event System.EventHandler ConnectRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.connectRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.connectRequested", value); + } + } + + /// + /// Fired when |SCardDisconnect| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect + /// + public event System.EventHandler DisconnectRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.disconnectRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.disconnectRequested", value); + } + } + + /// + /// Fired when |SCardTransmit| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit + /// + public event System.EventHandler TransmitRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.transmitRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.transmitRequested", value); + } + } + + /// + /// Fired when |SCardControl| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol + /// + public event System.EventHandler ControlRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.controlRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.controlRequested", value); + } + } + + /// + /// Fired when |SCardGetAttrib| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib + /// + public event System.EventHandler GetAttribRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.getAttribRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.getAttribRequested", value); + } + } + + /// + /// Fired when |SCardSetAttrib| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib + /// + public event System.EventHandler SetAttribRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.setAttribRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.setAttribRequested", value); + } + } + + /// + /// Fired when |SCardStatus| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa + /// + public event System.EventHandler StatusRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.statusRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.statusRequested", value); + } + } + + /// + /// Fired when |SCardBeginTransaction| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction + /// + public event System.EventHandler BeginTransactionRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.beginTransactionRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.beginTransactionRequested", value); + } + } + + /// + /// Fired when |SCardEndTransaction| is called. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction + /// + public event System.EventHandler EndTransactionRequested + { + add + { + _client.AddEventHandler("SmartCardEmulation.endTransactionRequested", value); + } + + remove + { + _client.RemoveEventHandler("SmartCardEmulation.endTransactionRequested", value); + } + } + + /// + /// Enables the |SmartCardEmulation| domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.enable", dict); + } + + /// + /// Disables the |SmartCardEmulation| domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.disable", dict); + } + + partial void ValidateReportEstablishContextResult(string requestId, int contextId); + /// + /// Reports the successful result of a |SCardEstablishContext| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext + /// + /// requestId + /// contextId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportEstablishContextResultAsync(string requestId, int contextId) + { + ValidateReportEstablishContextResult(requestId, contextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("contextId", contextId); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportEstablishContextResult", dict); + } + + partial void ValidateReportReleaseContextResult(string requestId); + /// + /// Reports the successful result of a |SCardReleaseContext| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext + /// + /// requestId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportReleaseContextResultAsync(string requestId) + { + ValidateReportReleaseContextResult(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportReleaseContextResult", dict); + } + + partial void ValidateReportListReadersResult(string requestId, string[] readers); + /// + /// Reports the successful result of a |SCardListReaders| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa + /// + /// requestId + /// readers + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportListReadersResultAsync(string requestId, string[] readers) + { + ValidateReportListReadersResult(requestId, readers); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("readers", readers); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportListReadersResult", dict); + } + + partial void ValidateReportGetStatusChangeResult(string requestId, System.Collections.Generic.IList readerStates); + /// + /// Reports the successful result of a |SCardGetStatusChange| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea + /// + /// requestId + /// readerStates + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportGetStatusChangeResultAsync(string requestId, System.Collections.Generic.IList readerStates) + { + ValidateReportGetStatusChangeResult(requestId, readerStates); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("readerStates", readerStates.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportGetStatusChangeResult", dict); + } + + partial void ValidateReportBeginTransactionResult(string requestId, int handle); + /// + /// Reports the result of a |SCardBeginTransaction| call. + /// On success, this creates a new transaction object. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction + /// + /// requestId + /// handle + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportBeginTransactionResultAsync(string requestId, int handle) + { + ValidateReportBeginTransactionResult(requestId, handle); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("handle", handle); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportBeginTransactionResult", dict); + } + + partial void ValidateReportPlainResult(string requestId); + /// + /// Reports the successful result of a call that returns only a result code. + /// Used for: |SCardCancel|, |SCardDisconnect|, |SCardSetAttrib|, |SCardEndTransaction|. + /// + /// This maps to: + /// 1. SCardCancel + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel + /// + /// 2. SCardDisconnect + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect + /// + /// 3. SCardSetAttrib + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib + /// + /// 4. SCardEndTransaction + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction + /// + /// requestId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportPlainResultAsync(string requestId) + { + ValidateReportPlainResult(requestId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportPlainResult", dict); + } + + partial void ValidateReportConnectResult(string requestId, int handle, CefSharp.DevTools.SmartCardEmulation.Protocol? activeProtocol = null); + /// + /// Reports the successful result of a |SCardConnect| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta + /// + /// requestId + /// handle + /// activeProtocol + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportConnectResultAsync(string requestId, int handle, CefSharp.DevTools.SmartCardEmulation.Protocol? activeProtocol = null) + { + ValidateReportConnectResult(requestId, handle, activeProtocol); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("handle", handle); + if (activeProtocol.HasValue) + { + dict.Add("activeProtocol", EnumToString(activeProtocol)); + } + + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportConnectResult", dict); + } + + partial void ValidateReportDataResult(string requestId, byte[] data); + /// + /// Reports the successful result of a call that sends back data on success. + /// Used for |SCardTransmit|, |SCardControl|, and |SCardGetAttrib|. + /// + /// This maps to: + /// 1. SCardTransmit + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit + /// + /// 2. SCardControl + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol + /// + /// 3. SCardGetAttrib + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib + /// + /// requestId + /// data + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportDataResultAsync(string requestId, byte[] data) + { + ValidateReportDataResult(requestId, data); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("data", ToBase64String(data)); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportDataResult", dict); + } + + partial void ValidateReportStatusResult(string requestId, string readerName, CefSharp.DevTools.SmartCardEmulation.ConnectionState state, byte[] atr, CefSharp.DevTools.SmartCardEmulation.Protocol? protocol = null); + /// + /// Reports the successful result of a |SCardStatus| call. + /// + /// This maps to: + /// PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 + /// Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa + /// + /// requestId + /// readerName + /// state + /// atr + /// protocol + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportStatusResultAsync(string requestId, string readerName, CefSharp.DevTools.SmartCardEmulation.ConnectionState state, byte[] atr, CefSharp.DevTools.SmartCardEmulation.Protocol? protocol = null) + { + ValidateReportStatusResult(requestId, readerName, state, atr, protocol); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("readerName", readerName); + dict.Add("state", EnumToString(state)); + dict.Add("atr", ToBase64String(atr)); + if (protocol.HasValue) + { + dict.Add("protocol", EnumToString(protocol)); + } + + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportStatusResult", dict); + } + + partial void ValidateReportError(string requestId, CefSharp.DevTools.SmartCardEmulation.ResultCode resultCode); + /// + /// Reports an error result for the given request. + /// + /// requestId + /// resultCode + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReportErrorAsync(string requestId, CefSharp.DevTools.SmartCardEmulation.ResultCode resultCode) + { + ValidateReportError(requestId, resultCode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("requestId", requestId); + dict.Add("resultCode", EnumToString(resultCode)); + return _client.ExecuteDevToolsMethodAsync("SmartCardEmulation.reportError", dict); + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetStorageKeyResponse + /// + public class GetStorageKeyResponse : DevToolsDomainResponseBase + { + /// + /// storageKey + /// + [JsonInclude] + [JsonPropertyName("storageKey")] + public string StorageKey + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetCookiesResponse + /// + public class GetCookiesResponse : DevToolsDomainResponseBase + { + /// + /// cookies + /// + [JsonInclude] + [JsonPropertyName("cookies")] + public System.Collections.Generic.IList Cookies + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetUsageAndQuotaResponse + /// + public class GetUsageAndQuotaResponse : DevToolsDomainResponseBase + { + /// + /// usage + /// + [JsonInclude] + [JsonPropertyName("usage")] + public double Usage + { + get; + private set; + } + + /// + /// quota + /// + [JsonInclude] + [JsonPropertyName("quota")] + public double Quota + { + get; + private set; + } + + /// + /// overrideActive + /// + [JsonInclude] + [JsonPropertyName("overrideActive")] + public bool OverrideActive + { + get; + private set; + } + + /// + /// usageBreakdown + /// + [JsonInclude] + [JsonPropertyName("usageBreakdown")] + public System.Collections.Generic.IList UsageBreakdown + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetTrustTokensResponse + /// + public class GetTrustTokensResponse : DevToolsDomainResponseBase + { + /// + /// tokens + /// + [JsonInclude] + [JsonPropertyName("tokens")] + public System.Collections.Generic.IList Tokens + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// ClearTrustTokensResponse + /// + public class ClearTrustTokensResponse : DevToolsDomainResponseBase + { + /// + /// didDeleteTokens + /// + [JsonInclude] + [JsonPropertyName("didDeleteTokens")] + public bool DidDeleteTokens + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetInterestGroupDetailsResponse + /// + public class GetInterestGroupDetailsResponse : DevToolsDomainResponseBase + { + /// + /// details + /// + [JsonInclude] + [JsonPropertyName("details")] + public object Details + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetSharedStorageMetadataResponse + /// + public class GetSharedStorageMetadataResponse : DevToolsDomainResponseBase + { + /// + /// metadata + /// + [JsonInclude] + [JsonPropertyName("metadata")] + public CefSharp.DevTools.Storage.SharedStorageMetadata Metadata + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetSharedStorageEntriesResponse + /// + public class GetSharedStorageEntriesResponse : DevToolsDomainResponseBase + { + /// + /// entries + /// + [JsonInclude] + [JsonPropertyName("entries")] + public System.Collections.Generic.IList Entries + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// RunBounceTrackingMitigationsResponse + /// + public class RunBounceTrackingMitigationsResponse : DevToolsDomainResponseBase + { + /// + /// deletedSites + /// + [JsonInclude] + [JsonPropertyName("deletedSites")] + public string[] DeletedSites + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// SendPendingAttributionReportsResponse + /// + public class SendPendingAttributionReportsResponse : DevToolsDomainResponseBase + { + /// + /// numSent + /// + [JsonInclude] + [JsonPropertyName("numSent")] + public int NumSent + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetRelatedWebsiteSetsResponse + /// + public class GetRelatedWebsiteSetsResponse : DevToolsDomainResponseBase + { + /// + /// sets + /// + [JsonInclude] + [JsonPropertyName("sets")] + public System.Collections.Generic.IList Sets + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + /// + /// GetAffectedUrlsForThirdPartyCookieMetadataResponse + /// + public class GetAffectedUrlsForThirdPartyCookieMetadataResponse : DevToolsDomainResponseBase + { + /// + /// matchedUrls + /// + [JsonInclude] + [JsonPropertyName("matchedUrls")] + public string[] MatchedUrls + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Storage +{ + using System.Linq; + + /// + /// Storage + /// + public partial class StorageClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Storage + /// + /// DevToolsClient + public StorageClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// A cache's contents have been modified. + /// + public event System.EventHandler CacheStorageContentUpdated + { + add + { + _client.AddEventHandler("Storage.cacheStorageContentUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.cacheStorageContentUpdated", value); + } + } + + /// + /// A cache has been added/deleted. + /// + public event System.EventHandler CacheStorageListUpdated + { + add + { + _client.AddEventHandler("Storage.cacheStorageListUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.cacheStorageListUpdated", value); + } + } + + /// + /// The origin's IndexedDB object store has been modified. + /// + public event System.EventHandler IndexedDBContentUpdated + { + add + { + _client.AddEventHandler("Storage.indexedDBContentUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.indexedDBContentUpdated", value); + } + } + + /// + /// The origin's IndexedDB database list has been modified. + /// + public event System.EventHandler IndexedDBListUpdated + { + add + { + _client.AddEventHandler("Storage.indexedDBListUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.indexedDBListUpdated", value); + } + } + + /// + /// One of the interest groups was accessed. Note that these events are global + /// to all targets sharing an interest group store. + /// + public event System.EventHandler InterestGroupAccessed + { + add + { + _client.AddEventHandler("Storage.interestGroupAccessed", value); + } + + remove + { + _client.RemoveEventHandler("Storage.interestGroupAccessed", value); + } + } + + /// + /// An auction involving interest groups is taking place. These events are + /// target-specific. + /// + public event System.EventHandler InterestGroupAuctionEventOccurred + { + add + { + _client.AddEventHandler("Storage.interestGroupAuctionEventOccurred", value); + } + + remove + { + _client.RemoveEventHandler("Storage.interestGroupAuctionEventOccurred", value); + } + } + + /// + /// Specifies which auctions a particular network fetch may be related to, and + /// in what role. Note that it is not ordered with respect to + /// Network.requestWillBeSent (but will happen before loadingFinished + /// loadingFailed). + /// + public event System.EventHandler InterestGroupAuctionNetworkRequestCreated + { + add + { + _client.AddEventHandler("Storage.interestGroupAuctionNetworkRequestCreated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.interestGroupAuctionNetworkRequestCreated", value); + } + } + + /// + /// Shared storage was accessed by the associated page. + /// The following parameters are included in all events. + /// + public event System.EventHandler SharedStorageAccessed + { + add + { + _client.AddEventHandler("Storage.sharedStorageAccessed", value); + } + + remove + { + _client.RemoveEventHandler("Storage.sharedStorageAccessed", value); + } + } + + /// + /// A shared storage run or selectURL operation finished its execution. + /// The following parameters are included in all events. + /// + public event System.EventHandler SharedStorageWorkletOperationExecutionFinished + { + add + { + _client.AddEventHandler("Storage.sharedStorageWorkletOperationExecutionFinished", value); + } + + remove + { + _client.RemoveEventHandler("Storage.sharedStorageWorkletOperationExecutionFinished", value); + } + } + + /// + /// StorageBucketCreatedOrUpdated + /// + public event System.EventHandler StorageBucketCreatedOrUpdated + { + add + { + _client.AddEventHandler("Storage.storageBucketCreatedOrUpdated", value); + } + + remove + { + _client.RemoveEventHandler("Storage.storageBucketCreatedOrUpdated", value); + } + } + + /// + /// StorageBucketDeleted + /// + public event System.EventHandler StorageBucketDeleted + { + add + { + _client.AddEventHandler("Storage.storageBucketDeleted", value); + } + + remove + { + _client.RemoveEventHandler("Storage.storageBucketDeleted", value); + } + } + + /// + /// AttributionReportingSourceRegistered + /// + public event System.EventHandler AttributionReportingSourceRegistered + { + add + { + _client.AddEventHandler("Storage.attributionReportingSourceRegistered", value); + } + + remove + { + _client.RemoveEventHandler("Storage.attributionReportingSourceRegistered", value); + } + } + + /// + /// AttributionReportingTriggerRegistered + /// + public event System.EventHandler AttributionReportingTriggerRegistered + { + add + { + _client.AddEventHandler("Storage.attributionReportingTriggerRegistered", value); + } + + remove + { + _client.RemoveEventHandler("Storage.attributionReportingTriggerRegistered", value); + } + } + + /// + /// AttributionReportingReportSent + /// + public event System.EventHandler AttributionReportingReportSent + { + add + { + _client.AddEventHandler("Storage.attributionReportingReportSent", value); + } + + remove + { + _client.RemoveEventHandler("Storage.attributionReportingReportSent", value); + } + } + + /// + /// AttributionReportingVerboseDebugReportSent + /// + public event System.EventHandler AttributionReportingVerboseDebugReportSent + { + add + { + _client.AddEventHandler("Storage.attributionReportingVerboseDebugReportSent", value); + } + + remove + { + _client.RemoveEventHandler("Storage.attributionReportingVerboseDebugReportSent", value); + } + } + + partial void ValidateGetStorageKey(string frameId = null); + /// + /// Returns storage key for the given frame. If no frame ID is provided, + /// the storage key of the target executing this command is returned. + /// + /// frameId + /// returns System.Threading.Tasks.Task<GetStorageKeyResponse> + public System.Threading.Tasks.Task GetStorageKeyAsync(string frameId = null) + { + ValidateGetStorageKey(frameId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.getStorageKey", dict); + } + + partial void ValidateClearDataForOrigin(string origin, string storageTypes); + /// + /// Clears storage for origin. + /// + /// Security origin. + /// Comma separated list of StorageType to clear. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDataForOriginAsync(string origin, string storageTypes) + { + ValidateClearDataForOrigin(origin, storageTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + dict.Add("storageTypes", storageTypes); + return _client.ExecuteDevToolsMethodAsync("Storage.clearDataForOrigin", dict); + } + + partial void ValidateClearDataForStorageKey(string storageKey, string storageTypes); + /// + /// Clears storage for storage key. + /// + /// Storage key. + /// Comma separated list of StorageType to clear. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearDataForStorageKeyAsync(string storageKey, string storageTypes) + { + ValidateClearDataForStorageKey(storageKey, storageTypes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + dict.Add("storageTypes", storageTypes); + return _client.ExecuteDevToolsMethodAsync("Storage.clearDataForStorageKey", dict); + } + + partial void ValidateGetCookies(string browserContextId = null); + /// + /// Returns all browser cookies. + /// + /// Browser context to use when called on the browser endpoint. + /// returns System.Threading.Tasks.Task<GetCookiesResponse> + public System.Threading.Tasks.Task GetCookiesAsync(string browserContextId = null) + { + ValidateGetCookies(browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.getCookies", dict); + } + + partial void ValidateSetCookies(System.Collections.Generic.IList cookies, string browserContextId = null); + /// + /// Sets given cookies. + /// + /// Cookies to be set. + /// Browser context to use when called on the browser endpoint. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCookiesAsync(System.Collections.Generic.IList cookies, string browserContextId = null) + { + ValidateSetCookies(cookies, browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("cookies", cookies.Select(x => x.ToDictionary())); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.setCookies", dict); + } + + partial void ValidateClearCookies(string browserContextId = null); + /// + /// Clears cookies. + /// + /// Browser context to use when called on the browser endpoint. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearCookiesAsync(string browserContextId = null) + { + ValidateClearCookies(browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.clearCookies", dict); + } + + partial void ValidateGetUsageAndQuota(string origin); + /// + /// Returns usage and quota in bytes. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<GetUsageAndQuotaResponse> + public System.Threading.Tasks.Task GetUsageAndQuotaAsync(string origin) + { + ValidateGetUsageAndQuota(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.getUsageAndQuota", dict); + } + + partial void ValidateOverrideQuotaForOrigin(string origin, double? quotaSize = null); + /// + /// Override quota for the specified origin + /// + /// Security origin. + /// The quota size (in bytes) to override the original quota with.If this is called multiple times, the overridden quota will be equal tothe quotaSize provided in the final call. If this is called withoutspecifying a quotaSize, the quota will be reset to the default value forthe specified origin. If this is called multiple times with differentorigins, the override will be maintained for each origin until it isdisabled (called without a quotaSize). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task OverrideQuotaForOriginAsync(string origin, double? quotaSize = null) + { + ValidateOverrideQuotaForOrigin(origin, quotaSize); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + if (quotaSize.HasValue) + { + dict.Add("quotaSize", quotaSize.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.overrideQuotaForOrigin", dict); + } + + partial void ValidateTrackCacheStorageForOrigin(string origin); + /// + /// Registers origin to be notified when an update occurs to its cache storage list. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackCacheStorageForOriginAsync(string origin) + { + ValidateTrackCacheStorageForOrigin(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.trackCacheStorageForOrigin", dict); + } + + partial void ValidateTrackCacheStorageForStorageKey(string storageKey); + /// + /// Registers storage key to be notified when an update occurs to its cache storage list. + /// + /// Storage key. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackCacheStorageForStorageKeyAsync(string storageKey) + { + ValidateTrackCacheStorageForStorageKey(storageKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + return _client.ExecuteDevToolsMethodAsync("Storage.trackCacheStorageForStorageKey", dict); + } + + partial void ValidateTrackIndexedDBForOrigin(string origin); + /// + /// Registers origin to be notified when an update occurs to its IndexedDB. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackIndexedDBForOriginAsync(string origin) + { + ValidateTrackIndexedDBForOrigin(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.trackIndexedDBForOrigin", dict); + } + + partial void ValidateTrackIndexedDBForStorageKey(string storageKey); + /// + /// Registers storage key to be notified when an update occurs to its IndexedDB. + /// + /// Storage key. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TrackIndexedDBForStorageKeyAsync(string storageKey) + { + ValidateTrackIndexedDBForStorageKey(storageKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + return _client.ExecuteDevToolsMethodAsync("Storage.trackIndexedDBForStorageKey", dict); + } + + partial void ValidateUntrackCacheStorageForOrigin(string origin); + /// + /// Unregisters origin from receiving notifications for cache storage. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UntrackCacheStorageForOriginAsync(string origin) + { + ValidateUntrackCacheStorageForOrigin(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.untrackCacheStorageForOrigin", dict); + } + + partial void ValidateUntrackCacheStorageForStorageKey(string storageKey); + /// + /// Unregisters storage key from receiving notifications for cache storage. + /// + /// Storage key. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UntrackCacheStorageForStorageKeyAsync(string storageKey) + { + ValidateUntrackCacheStorageForStorageKey(storageKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + return _client.ExecuteDevToolsMethodAsync("Storage.untrackCacheStorageForStorageKey", dict); + } + + partial void ValidateUntrackIndexedDBForOrigin(string origin); + /// + /// Unregisters origin from receiving notifications for IndexedDB. + /// + /// Security origin. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UntrackIndexedDBForOriginAsync(string origin) + { + ValidateUntrackIndexedDBForOrigin(origin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("origin", origin); + return _client.ExecuteDevToolsMethodAsync("Storage.untrackIndexedDBForOrigin", dict); + } + + partial void ValidateUntrackIndexedDBForStorageKey(string storageKey); + /// + /// Unregisters storage key from receiving notifications for IndexedDB. + /// + /// Storage key. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UntrackIndexedDBForStorageKeyAsync(string storageKey) + { + ValidateUntrackIndexedDBForStorageKey(storageKey); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + return _client.ExecuteDevToolsMethodAsync("Storage.untrackIndexedDBForStorageKey", dict); + } + + /// + /// Returns the number of stored Trust Tokens per issuer for the + /// current browsing context. + /// + /// returns System.Threading.Tasks.Task<GetTrustTokensResponse> + public System.Threading.Tasks.Task GetTrustTokensAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Storage.getTrustTokens", dict); + } + + partial void ValidateClearTrustTokens(string issuerOrigin); + /// + /// Removes all Trust Tokens issued by the provided issuerOrigin. + /// Leaves other stored data, including the issuer's Redemption Records, intact. + /// + /// issuerOrigin + /// returns System.Threading.Tasks.Task<ClearTrustTokensResponse> + public System.Threading.Tasks.Task ClearTrustTokensAsync(string issuerOrigin) + { + ValidateClearTrustTokens(issuerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("issuerOrigin", issuerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.clearTrustTokens", dict); + } + + partial void ValidateGetInterestGroupDetails(string ownerOrigin, string name); + /// + /// Gets details for a named interest group. + /// + /// ownerOrigin + /// name + /// returns System.Threading.Tasks.Task<GetInterestGroupDetailsResponse> + public System.Threading.Tasks.Task GetInterestGroupDetailsAsync(string ownerOrigin, string name) + { + ValidateGetInterestGroupDetails(ownerOrigin, name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + dict.Add("name", name); + return _client.ExecuteDevToolsMethodAsync("Storage.getInterestGroupDetails", dict); + } + + partial void ValidateSetInterestGroupTracking(bool enable); + /// + /// Enables/Disables issuing of interestGroupAccessed events. + /// + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInterestGroupTrackingAsync(bool enable) + { + ValidateSetInterestGroupTracking(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setInterestGroupTracking", dict); + } + + partial void ValidateSetInterestGroupAuctionTracking(bool enable); + /// + /// Enables/Disables issuing of interestGroupAuctionEventOccurred and + /// interestGroupAuctionNetworkRequestCreated. + /// + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetInterestGroupAuctionTrackingAsync(bool enable) + { + ValidateSetInterestGroupAuctionTracking(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setInterestGroupAuctionTracking", dict); + } + + partial void ValidateGetSharedStorageMetadata(string ownerOrigin); + /// + /// Gets metadata for an origin's shared storage. + /// + /// ownerOrigin + /// returns System.Threading.Tasks.Task<GetSharedStorageMetadataResponse> + public System.Threading.Tasks.Task GetSharedStorageMetadataAsync(string ownerOrigin) + { + ValidateGetSharedStorageMetadata(ownerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.getSharedStorageMetadata", dict); + } + + partial void ValidateGetSharedStorageEntries(string ownerOrigin); + /// + /// Gets the entries in an given origin's shared storage. + /// + /// ownerOrigin + /// returns System.Threading.Tasks.Task<GetSharedStorageEntriesResponse> + public System.Threading.Tasks.Task GetSharedStorageEntriesAsync(string ownerOrigin) + { + ValidateGetSharedStorageEntries(ownerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.getSharedStorageEntries", dict); + } + + partial void ValidateSetSharedStorageEntry(string ownerOrigin, string key, string value, bool? ignoreIfPresent = null); + /// + /// Sets entry with `key` and `value` for a given origin's shared storage. + /// + /// ownerOrigin + /// key + /// value + /// If `ignoreIfPresent` is included and true, then only sets the entry if`key` doesn't already exist. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSharedStorageEntryAsync(string ownerOrigin, string key, string value, bool? ignoreIfPresent = null) + { + ValidateSetSharedStorageEntry(ownerOrigin, key, value, ignoreIfPresent); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + dict.Add("key", key); + dict.Add("value", value); + if (ignoreIfPresent.HasValue) + { + dict.Add("ignoreIfPresent", ignoreIfPresent.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Storage.setSharedStorageEntry", dict); + } + + partial void ValidateDeleteSharedStorageEntry(string ownerOrigin, string key); + /// + /// Deletes entry for `key` (if it exists) for a given origin's shared storage. + /// + /// ownerOrigin + /// key + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteSharedStorageEntryAsync(string ownerOrigin, string key) + { + ValidateDeleteSharedStorageEntry(ownerOrigin, key); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + dict.Add("key", key); + return _client.ExecuteDevToolsMethodAsync("Storage.deleteSharedStorageEntry", dict); + } + + partial void ValidateClearSharedStorageEntries(string ownerOrigin); + /// + /// Clears all entries for a given origin's shared storage. + /// + /// ownerOrigin + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearSharedStorageEntriesAsync(string ownerOrigin) + { + ValidateClearSharedStorageEntries(ownerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.clearSharedStorageEntries", dict); + } + + partial void ValidateResetSharedStorageBudget(string ownerOrigin); + /// + /// Resets the budget for `ownerOrigin` by clearing all budget withdrawals. + /// + /// ownerOrigin + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResetSharedStorageBudgetAsync(string ownerOrigin) + { + ValidateResetSharedStorageBudget(ownerOrigin); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("ownerOrigin", ownerOrigin); + return _client.ExecuteDevToolsMethodAsync("Storage.resetSharedStorageBudget", dict); + } + + partial void ValidateSetSharedStorageTracking(bool enable); + /// + /// Enables/disables issuing of sharedStorageAccessed events. + /// + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSharedStorageTrackingAsync(bool enable) + { + ValidateSetSharedStorageTracking(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setSharedStorageTracking", dict); + } + + partial void ValidateSetStorageBucketTracking(string storageKey, bool enable); + /// + /// Set tracking for a storage key's buckets. + /// + /// storageKey + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetStorageBucketTrackingAsync(string storageKey, bool enable) + { + ValidateSetStorageBucketTracking(storageKey, enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("storageKey", storageKey); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setStorageBucketTracking", dict); + } + + partial void ValidateDeleteStorageBucket(CefSharp.DevTools.Storage.StorageBucket bucket); + /// + /// Deletes the Storage Bucket with the given storage key and bucket name. + /// + /// bucket + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DeleteStorageBucketAsync(CefSharp.DevTools.Storage.StorageBucket bucket) + { + ValidateDeleteStorageBucket(bucket); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("bucket", bucket.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Storage.deleteStorageBucket", dict); + } + + /// + /// Deletes state for sites identified as potential bounce trackers, immediately. + /// + /// returns System.Threading.Tasks.Task<RunBounceTrackingMitigationsResponse> + public System.Threading.Tasks.Task RunBounceTrackingMitigationsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Storage.runBounceTrackingMitigations", dict); + } + + partial void ValidateSetAttributionReportingLocalTestingMode(bool enabled); + /// + /// https://wicg.github.io/attribution-reporting-api/ + /// + /// If enabled, noise is suppressed and reports are sent immediately. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttributionReportingLocalTestingModeAsync(bool enabled) + { + ValidateSetAttributionReportingLocalTestingMode(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Storage.setAttributionReportingLocalTestingMode", dict); + } + + partial void ValidateSetAttributionReportingTracking(bool enable); + /// + /// Enables/disables issuing of Attribution Reporting events. + /// + /// enable + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAttributionReportingTrackingAsync(bool enable) + { + ValidateSetAttributionReportingTracking(enable); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enable", enable); + return _client.ExecuteDevToolsMethodAsync("Storage.setAttributionReportingTracking", dict); + } + + /// + /// Sends all pending Attribution Reports immediately, regardless of their + /// scheduled report time. + /// + /// returns System.Threading.Tasks.Task<SendPendingAttributionReportsResponse> + public System.Threading.Tasks.Task SendPendingAttributionReportsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Storage.sendPendingAttributionReports", dict); + } + + /// + /// Returns the effective Related Website Sets in use by this profile for the browser + /// session. The effective Related Website Sets will not change during a browser session. + /// + /// returns System.Threading.Tasks.Task<GetRelatedWebsiteSetsResponse> + public System.Threading.Tasks.Task GetRelatedWebsiteSetsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Storage.getRelatedWebsiteSets", dict); + } + + partial void ValidateGetAffectedUrlsForThirdPartyCookieMetadata(string firstPartyUrl, string[] thirdPartyUrls); + /// + /// Returns the list of URLs from a page and its embedded resources that match + /// existing grace period URL pattern rules. + /// https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period + /// + /// The URL of the page currently being visited. + /// The list of embedded resource URLs from the page. + /// returns System.Threading.Tasks.Task<GetAffectedUrlsForThirdPartyCookieMetadataResponse> + public System.Threading.Tasks.Task GetAffectedUrlsForThirdPartyCookieMetadataAsync(string firstPartyUrl, string[] thirdPartyUrls) + { + ValidateGetAffectedUrlsForThirdPartyCookieMetadata(firstPartyUrl, thirdPartyUrls); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("firstPartyUrl", firstPartyUrl); + dict.Add("thirdPartyUrls", thirdPartyUrls); + return _client.ExecuteDevToolsMethodAsync("Storage.getAffectedUrlsForThirdPartyCookieMetadata", dict); + } + + partial void ValidateSetProtectedAudienceKAnonymity(string owner, string name, byte[][] hashes); + /// + /// SetProtectedAudienceKAnonymity + /// + /// owner + /// name + /// hashes + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetProtectedAudienceKAnonymityAsync(string owner, string name, byte[][] hashes) + { + ValidateSetProtectedAudienceKAnonymity(owner, name, hashes); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("owner", owner); + dict.Add("name", name); + dict.Add("hashes", ToBase64String(hashes)); + return _client.ExecuteDevToolsMethodAsync("Storage.setProtectedAudienceKAnonymity", dict); + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + /// + /// GetInfoResponse + /// + public class GetInfoResponse : DevToolsDomainResponseBase + { + /// + /// gpu + /// + [JsonInclude] + [JsonPropertyName("gpu")] + public CefSharp.DevTools.SystemInfo.GPUInfo Gpu + { + get; + private set; + } + + /// + /// modelName + /// + [JsonInclude] + [JsonPropertyName("modelName")] + public string ModelName + { + get; + private set; + } + + /// + /// modelVersion + /// + [JsonInclude] + [JsonPropertyName("modelVersion")] + public string ModelVersion + { + get; + private set; + } + + /// + /// commandLine + /// + [JsonInclude] + [JsonPropertyName("commandLine")] + public string CommandLine + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + /// + /// GetFeatureStateResponse + /// + public class GetFeatureStateResponse : DevToolsDomainResponseBase + { + /// + /// featureEnabled + /// + [JsonInclude] + [JsonPropertyName("featureEnabled")] + public bool FeatureEnabled + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + /// + /// GetProcessInfoResponse + /// + public class GetProcessInfoResponse : DevToolsDomainResponseBase + { + /// + /// processInfo + /// + [JsonInclude] + [JsonPropertyName("processInfo")] + public System.Collections.Generic.IList ProcessInfo + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.SystemInfo +{ + using System.Linq; + + /// + /// The SystemInfo domain defines methods and events for querying low-level system information. + /// + public partial class SystemInfoClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// SystemInfo + /// + /// DevToolsClient + public SystemInfoClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Returns information about the system. + /// + /// returns System.Threading.Tasks.Task<GetInfoResponse> + public System.Threading.Tasks.Task GetInfoAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("SystemInfo.getInfo", dict); + } + + partial void ValidateGetFeatureState(string featureState); + /// + /// Returns information about the feature state. + /// + /// featureState + /// returns System.Threading.Tasks.Task<GetFeatureStateResponse> + public System.Threading.Tasks.Task GetFeatureStateAsync(string featureState) + { + ValidateGetFeatureState(featureState); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("featureState", featureState); + return _client.ExecuteDevToolsMethodAsync("SystemInfo.getFeatureState", dict); + } + + /// + /// Returns information about all running processes. + /// + /// returns System.Threading.Tasks.Task<GetProcessInfoResponse> + public System.Threading.Tasks.Task GetProcessInfoAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("SystemInfo.getProcessInfo", dict); + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// AttachToTargetResponse + /// + public class AttachToTargetResponse : DevToolsDomainResponseBase + { + /// + /// sessionId + /// + [JsonInclude] + [JsonPropertyName("sessionId")] + public string SessionId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// AttachToBrowserTargetResponse + /// + public class AttachToBrowserTargetResponse : DevToolsDomainResponseBase + { + /// + /// sessionId + /// + [JsonInclude] + [JsonPropertyName("sessionId")] + public string SessionId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// CloseTargetResponse + /// + public class CloseTargetResponse : DevToolsDomainResponseBase + { + /// + /// success + /// + [JsonInclude] + [JsonPropertyName("success")] + public bool Success + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// CreateBrowserContextResponse + /// + public class CreateBrowserContextResponse : DevToolsDomainResponseBase + { + /// + /// browserContextId + /// + [JsonInclude] + [JsonPropertyName("browserContextId")] + public string BrowserContextId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// GetBrowserContextsResponse + /// + public class GetBrowserContextsResponse : DevToolsDomainResponseBase + { + /// + /// browserContextIds + /// + [JsonInclude] + [JsonPropertyName("browserContextIds")] + public string[] BrowserContextIds + { + get; + private set; + } + + /// + /// defaultBrowserContextId + /// + [JsonInclude] + [JsonPropertyName("defaultBrowserContextId")] + public string DefaultBrowserContextId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// CreateTargetResponse + /// + public class CreateTargetResponse : DevToolsDomainResponseBase + { + /// + /// targetId + /// + [JsonInclude] + [JsonPropertyName("targetId")] + public string TargetId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// GetTargetInfoResponse + /// + public class GetTargetInfoResponse : DevToolsDomainResponseBase + { + /// + /// targetInfo + /// + [JsonInclude] + [JsonPropertyName("targetInfo")] + public CefSharp.DevTools.Target.TargetInfo TargetInfo + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// GetTargetsResponse + /// + public class GetTargetsResponse : DevToolsDomainResponseBase + { + /// + /// targetInfos + /// + [JsonInclude] + [JsonPropertyName("targetInfos")] + public System.Collections.Generic.IList TargetInfos + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// GetDevToolsTargetResponse + /// + public class GetDevToolsTargetResponse : DevToolsDomainResponseBase + { + /// + /// targetId + /// + [JsonInclude] + [JsonPropertyName("targetId")] + public string TargetId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + /// + /// OpenDevToolsResponse + /// + public class OpenDevToolsResponse : DevToolsDomainResponseBase + { + /// + /// targetId + /// + [JsonInclude] + [JsonPropertyName("targetId")] + public string TargetId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Target +{ + using System.Linq; + + /// + /// Supports additional targets discovery and allows to attach to them. + /// + public partial class TargetClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Target + /// + /// DevToolsClient + public TargetClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Issued when attached to target because of auto-attach or `attachToTarget` command. + /// + public event System.EventHandler AttachedToTarget + { + add + { + _client.AddEventHandler("Target.attachedToTarget", value); + } + + remove + { + _client.RemoveEventHandler("Target.attachedToTarget", value); + } + } + + /// + /// Issued when detached from target for any reason (including `detachFromTarget` command). Can be + /// issued multiple times per target if multiple sessions have been attached to it. + /// + public event System.EventHandler DetachedFromTarget + { + add + { + _client.AddEventHandler("Target.detachedFromTarget", value); + } + + remove + { + _client.RemoveEventHandler("Target.detachedFromTarget", value); + } + } + + /// + /// Notifies about a new protocol message received from the session (as reported in + /// `attachedToTarget` event). + /// + public event System.EventHandler ReceivedMessageFromTarget + { + add + { + _client.AddEventHandler("Target.receivedMessageFromTarget", value); + } + + remove + { + _client.RemoveEventHandler("Target.receivedMessageFromTarget", value); + } + } + + /// + /// Issued when a possible inspection target is created. + /// + public event System.EventHandler TargetCreated + { + add + { + _client.AddEventHandler("Target.targetCreated", value); + } + + remove + { + _client.RemoveEventHandler("Target.targetCreated", value); + } + } + + /// + /// Issued when a target is destroyed. + /// + public event System.EventHandler TargetDestroyed + { + add + { + _client.AddEventHandler("Target.targetDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("Target.targetDestroyed", value); + } + } + + /// + /// Issued when a target has crashed. + /// + public event System.EventHandler TargetCrashed + { + add + { + _client.AddEventHandler("Target.targetCrashed", value); + } + + remove + { + _client.RemoveEventHandler("Target.targetCrashed", value); + } + } + + /// + /// Issued when some information about a target has changed. This only happens between + /// `targetCreated` and `targetDestroyed`. + /// + public event System.EventHandler TargetInfoChanged + { + add + { + _client.AddEventHandler("Target.targetInfoChanged", value); + } + + remove + { + _client.RemoveEventHandler("Target.targetInfoChanged", value); + } + } + + partial void ValidateActivateTarget(string targetId); + /// + /// Activates (focuses) the target. + /// + /// targetId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ActivateTargetAsync(string targetId) + { + ValidateActivateTarget(targetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + return _client.ExecuteDevToolsMethodAsync("Target.activateTarget", dict); + } + + partial void ValidateAttachToTarget(string targetId, bool? flatten = null); + /// + /// Attaches to the target with given id. + /// + /// targetId + /// Enables "flat" access to the session via specifying sessionId attribute in the commands.We plan to make this the default, deprecate non-flattened mode,and eventually retire it. See crbug.com/991325. + /// returns System.Threading.Tasks.Task<AttachToTargetResponse> + public System.Threading.Tasks.Task AttachToTargetAsync(string targetId, bool? flatten = null) + { + ValidateAttachToTarget(targetId, flatten); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + if (flatten.HasValue) + { + dict.Add("flatten", flatten.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Target.attachToTarget", dict); + } + + /// + /// Attaches to the browser target, only uses flat sessionId mode. + /// + /// returns System.Threading.Tasks.Task<AttachToBrowserTargetResponse> + public System.Threading.Tasks.Task AttachToBrowserTargetAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Target.attachToBrowserTarget", dict); + } + + partial void ValidateCloseTarget(string targetId); + /// + /// Closes the target. If the target is a page that gets closed too. + /// + /// targetId + /// returns System.Threading.Tasks.Task<CloseTargetResponse> + public System.Threading.Tasks.Task CloseTargetAsync(string targetId) + { + ValidateCloseTarget(targetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + return _client.ExecuteDevToolsMethodAsync("Target.closeTarget", dict); + } + + partial void ValidateExposeDevToolsProtocol(string targetId, string bindingName = null, bool? inheritPermissions = null); + /// + /// Inject object to the target's main frame that provides a communication + /// channel with browser target. + /// + /// Injected object will be available as `window[bindingName]`. + /// + /// The object has the following API: + /// - `binding.send(json)` - a method to send messages over the remote debugging protocol + /// - `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses. + /// + /// targetId + /// Binding name, 'cdp' if not specified. + /// If true, inherits the current root session's permissions (default: false). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ExposeDevToolsProtocolAsync(string targetId, string bindingName = null, bool? inheritPermissions = null) + { + ValidateExposeDevToolsProtocol(targetId, bindingName, inheritPermissions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + if (!(string.IsNullOrEmpty(bindingName))) + { + dict.Add("bindingName", bindingName); + } + + if (inheritPermissions.HasValue) + { + dict.Add("inheritPermissions", inheritPermissions.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Target.exposeDevToolsProtocol", dict); + } + + partial void ValidateCreateBrowserContext(bool? disposeOnDetach = null, string proxyServer = null, string proxyBypassList = null, string[] originsWithUniversalNetworkAccess = null); + /// + /// Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than + /// one. + /// + /// If specified, disposes this context when debugging session disconnects. + /// Proxy server, similar to the one passed to --proxy-server + /// Proxy bypass list, similar to the one passed to --proxy-bypass-list + /// An optional list of origins to grant unlimited cross-origin access to.Parts of the URL other than those constituting origin are ignored. + /// returns System.Threading.Tasks.Task<CreateBrowserContextResponse> + public System.Threading.Tasks.Task CreateBrowserContextAsync(bool? disposeOnDetach = null, string proxyServer = null, string proxyBypassList = null, string[] originsWithUniversalNetworkAccess = null) + { + ValidateCreateBrowserContext(disposeOnDetach, proxyServer, proxyBypassList, originsWithUniversalNetworkAccess); + var dict = new System.Collections.Generic.Dictionary(); + if (disposeOnDetach.HasValue) + { + dict.Add("disposeOnDetach", disposeOnDetach.Value); + } + + if (!(string.IsNullOrEmpty(proxyServer))) + { + dict.Add("proxyServer", proxyServer); + } + + if (!(string.IsNullOrEmpty(proxyBypassList))) + { + dict.Add("proxyBypassList", proxyBypassList); + } + + if ((originsWithUniversalNetworkAccess) != (null)) + { + dict.Add("originsWithUniversalNetworkAccess", originsWithUniversalNetworkAccess); + } + + return _client.ExecuteDevToolsMethodAsync("Target.createBrowserContext", dict); + } + + /// + /// Returns all browser contexts created with `Target.createBrowserContext` method. + /// + /// returns System.Threading.Tasks.Task<GetBrowserContextsResponse> + public System.Threading.Tasks.Task GetBrowserContextsAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Target.getBrowserContexts", dict); + } + + partial void ValidateCreateTarget(string url, int? left = null, int? top = null, int? width = null, int? height = null, CefSharp.DevTools.Target.WindowState? windowState = null, string browserContextId = null, bool? enableBeginFrameControl = null, bool? newWindow = null, bool? background = null, bool? forTab = null, bool? hidden = null, bool? focus = null); + /// + /// Creates a new page. + /// + /// The initial URL the page will be navigated to. An empty string indicates about:blank. + /// Frame left origin in DIP (requires newWindow to be true or headless shell). + /// Frame top origin in DIP (requires newWindow to be true or headless shell). + /// Frame width in DIP (requires newWindow to be true or headless shell). + /// Frame height in DIP (requires newWindow to be true or headless shell). + /// Frame window state (requires newWindow to be true or headless shell).Default is normal. + /// The browser context to create the page in. + /// Whether BeginFrames for this target will be controlled via DevTools (headless shell only,not supported on MacOS yet, false by default). + /// Whether to create a new Window or Tab (false by default, not supported by headless shell). + /// Whether to create the target in background or foreground (false by default, not supportedby headless shell). + /// Whether to create the target of type "tab". + /// Whether to create a hidden target. The hidden target is observable via protocol, but notpresent in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or`background: false`. The life-time of the tab is limited to the life-time of the session. + /// If specified, the option is used to determine if the new target shouldbe focused or not. By default, the focus behavior depends on thevalue of the background field. For example, background=false and focus=falsewill result in the target tab being opened but the browser window remainunchanged (if it was in the background, it will remain in the background)and background=false with focus=undefined will result in the window being focused.Using background: true and focus: true is not supported and will result in an error. + /// returns System.Threading.Tasks.Task<CreateTargetResponse> + public System.Threading.Tasks.Task CreateTargetAsync(string url, int? left = null, int? top = null, int? width = null, int? height = null, CefSharp.DevTools.Target.WindowState? windowState = null, string browserContextId = null, bool? enableBeginFrameControl = null, bool? newWindow = null, bool? background = null, bool? forTab = null, bool? hidden = null, bool? focus = null) + { + ValidateCreateTarget(url, left, top, width, height, windowState, browserContextId, enableBeginFrameControl, newWindow, background, forTab, hidden, focus); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("url", url); + if (left.HasValue) + { + dict.Add("left", left.Value); + } + + if (top.HasValue) + { + dict.Add("top", top.Value); + } + + if (width.HasValue) + { + dict.Add("width", width.Value); + } + + if (height.HasValue) + { + dict.Add("height", height.Value); + } + + if (windowState.HasValue) + { + dict.Add("windowState", EnumToString(windowState)); + } + + if (!(string.IsNullOrEmpty(browserContextId))) + { + dict.Add("browserContextId", browserContextId); + } + + if (enableBeginFrameControl.HasValue) + { + dict.Add("enableBeginFrameControl", enableBeginFrameControl.Value); + } + + if (newWindow.HasValue) + { + dict.Add("newWindow", newWindow.Value); + } + + if (background.HasValue) + { + dict.Add("background", background.Value); + } + + if (forTab.HasValue) + { + dict.Add("forTab", forTab.Value); + } + + if (hidden.HasValue) + { + dict.Add("hidden", hidden.Value); + } + + if (focus.HasValue) + { + dict.Add("focus", focus.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Target.createTarget", dict); + } + + partial void ValidateDetachFromTarget(string sessionId = null, string targetId = null); + /// + /// Detaches session with given id. + /// + /// Session to detach. + /// Deprecated. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DetachFromTargetAsync(string sessionId = null, string targetId = null) + { + ValidateDetachFromTarget(sessionId, targetId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(sessionId))) + { + dict.Add("sessionId", sessionId); + } + + if (!(string.IsNullOrEmpty(targetId))) + { + dict.Add("targetId", targetId); + } + + return _client.ExecuteDevToolsMethodAsync("Target.detachFromTarget", dict); + } + + partial void ValidateDisposeBrowserContext(string browserContextId); + /// + /// Deletes a BrowserContext. All the belonging pages will be closed without calling their + /// beforeunload hooks. + /// + /// browserContextId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisposeBrowserContextAsync(string browserContextId) + { + ValidateDisposeBrowserContext(browserContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("browserContextId", browserContextId); + return _client.ExecuteDevToolsMethodAsync("Target.disposeBrowserContext", dict); + } + + partial void ValidateGetTargetInfo(string targetId = null); + /// + /// Returns information about a target. + /// + /// targetId + /// returns System.Threading.Tasks.Task<GetTargetInfoResponse> + public System.Threading.Tasks.Task GetTargetInfoAsync(string targetId = null) + { + ValidateGetTargetInfo(targetId); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(targetId))) + { + dict.Add("targetId", targetId); + } + + return _client.ExecuteDevToolsMethodAsync("Target.getTargetInfo", dict); + } + + partial void ValidateGetTargets(System.Collections.Generic.IList filter = null); + /// + /// Retrieves a list of available targets. + /// + /// Only targets matching filter will be reported. If filter is not specifiedand target discovery is currently enabled, a filter used for target discoveryis used for consistency. + /// returns System.Threading.Tasks.Task<GetTargetsResponse> + public System.Threading.Tasks.Task GetTargetsAsync(System.Collections.Generic.IList filter = null) + { + ValidateGetTargets(filter); + var dict = new System.Collections.Generic.Dictionary(); + if ((filter) != (null)) + { + dict.Add("filter", filter.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Target.getTargets", dict); + } + + partial void ValidateSetAutoAttach(bool autoAttach, bool waitForDebuggerOnStart, bool? flatten = null, System.Collections.Generic.IList filter = null); + /// + /// Controls whether to automatically attach to new targets which are considered + /// to be directly related to this one (for example, iframes or workers). + /// When turned on, attaches to all existing related targets as well. When turned off, + /// automatically detaches from all currently attached targets. + /// This also clears all targets added by `autoAttachRelated` from the list of targets to watch + /// for creation of related targets. + /// You might want to call this recursively for auto-attached targets to attach + /// to all available targets. + /// + /// Whether to auto-attach to related targets. + /// Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`to run paused targets. + /// Enables "flat" access to the session via specifying sessionId attribute in the commands.We plan to make this the default, deprecate non-flattened mode,and eventually retire it. See crbug.com/991325. + /// Only targets matching filter will be attached. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAutoAttachAsync(bool autoAttach, bool waitForDebuggerOnStart, bool? flatten = null, System.Collections.Generic.IList filter = null) + { + ValidateSetAutoAttach(autoAttach, waitForDebuggerOnStart, flatten, filter); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("autoAttach", autoAttach); + dict.Add("waitForDebuggerOnStart", waitForDebuggerOnStart); + if (flatten.HasValue) + { + dict.Add("flatten", flatten.Value); + } + + if ((filter) != (null)) + { + dict.Add("filter", filter.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Target.setAutoAttach", dict); + } + + partial void ValidateAutoAttachRelated(string targetId, bool waitForDebuggerOnStart, System.Collections.Generic.IList filter = null); + /// + /// Adds the specified target to the list of targets that will be monitored for any related target + /// creation (such as child frames, child workers and new versions of service worker) and reported + /// through `attachedToTarget`. The specified target is also auto-attached. + /// This cancels the effect of any previous `setAutoAttach` and is also cancelled by subsequent + /// `setAutoAttach`. Only available at the Browser target. + /// + /// targetId + /// Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`to run paused targets. + /// Only targets matching filter will be attached. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AutoAttachRelatedAsync(string targetId, bool waitForDebuggerOnStart, System.Collections.Generic.IList filter = null) + { + ValidateAutoAttachRelated(targetId, waitForDebuggerOnStart, filter); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + dict.Add("waitForDebuggerOnStart", waitForDebuggerOnStart); + if ((filter) != (null)) + { + dict.Add("filter", filter.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Target.autoAttachRelated", dict); + } + + partial void ValidateSetDiscoverTargets(bool discover, System.Collections.Generic.IList filter = null); + /// + /// Controls whether to discover available targets and notify via + /// `targetCreated/targetInfoChanged/targetDestroyed` events. + /// + /// Whether to discover available targets. + /// Only targets matching filter will be attached. If `discover` is false,`filter` must be omitted or empty. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetDiscoverTargetsAsync(bool discover, System.Collections.Generic.IList filter = null) + { + ValidateSetDiscoverTargets(discover, filter); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("discover", discover); + if ((filter) != (null)) + { + dict.Add("filter", filter.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Target.setDiscoverTargets", dict); + } + + partial void ValidateSetRemoteLocations(System.Collections.Generic.IList locations); + /// + /// Enables target discovery for the specified locations, when `setDiscoverTargets` was set to + /// `true`. + /// + /// List of remote locations. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetRemoteLocationsAsync(System.Collections.Generic.IList locations) + { + ValidateSetRemoteLocations(locations); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("locations", locations.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Target.setRemoteLocations", dict); + } + + partial void ValidateGetDevToolsTarget(string targetId); + /// + /// Gets the targetId of the DevTools page target opened for the given target + /// (if any). + /// + /// Page or tab target ID. + /// returns System.Threading.Tasks.Task<GetDevToolsTargetResponse> + public System.Threading.Tasks.Task GetDevToolsTargetAsync(string targetId) + { + ValidateGetDevToolsTarget(targetId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + return _client.ExecuteDevToolsMethodAsync("Target.getDevToolsTarget", dict); + } + + partial void ValidateOpenDevTools(string targetId, string panelId = null); + /// + /// Opens a DevTools window for the target. + /// + /// This can be the page or tab target ID. + /// The id of the panel we want DevTools to open initially. Currentlysupported panels are elements, console, network, sources, resourcesand performance. + /// returns System.Threading.Tasks.Task<OpenDevToolsResponse> + public System.Threading.Tasks.Task OpenDevToolsAsync(string targetId, string panelId = null) + { + ValidateOpenDevTools(targetId, panelId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("targetId", targetId); + if (!(string.IsNullOrEmpty(panelId))) + { + dict.Add("panelId", panelId); + } + + return _client.ExecuteDevToolsMethodAsync("Target.openDevTools", dict); + } + } +} + +namespace CefSharp.DevTools.Tethering +{ + using System.Linq; + + /// + /// The Tethering domain defines methods and events for browser port binding. + /// + public partial class TetheringClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Tethering + /// + /// DevToolsClient + public TetheringClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Informs that port was successfully bound and got a specified connection id. + /// + public event System.EventHandler Accepted + { + add + { + _client.AddEventHandler("Tethering.accepted", value); + } + + remove + { + _client.RemoveEventHandler("Tethering.accepted", value); + } + } + + partial void ValidateBind(int port); + /// + /// Request browser port binding. + /// + /// Port number to bind. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task BindAsync(int port) + { + ValidateBind(port); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("port", port); + return _client.ExecuteDevToolsMethodAsync("Tethering.bind", dict); + } + + partial void ValidateUnbind(int port); + /// + /// Request browser port unbinding. + /// + /// Port number to unbind. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task UnbindAsync(int port) + { + ValidateUnbind(port); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("port", port); + return _client.ExecuteDevToolsMethodAsync("Tethering.unbind", dict); + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + /// + /// GetCategoriesResponse + /// + public class GetCategoriesResponse : DevToolsDomainResponseBase + { + /// + /// categories + /// + [JsonInclude] + [JsonPropertyName("categories")] + public string[] Categories + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + /// + /// GetTrackEventDescriptorResponse + /// + public class GetTrackEventDescriptorResponse : DevToolsDomainResponseBase + { + /// + /// descriptor + /// + [JsonInclude] + [JsonPropertyName("descriptor")] + public byte[] Descriptor + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + /// + /// RequestMemoryDumpResponse + /// + public class RequestMemoryDumpResponse : DevToolsDomainResponseBase + { + /// + /// dumpGuid + /// + [JsonInclude] + [JsonPropertyName("dumpGuid")] + public string DumpGuid + { + get; + private set; + } + + /// + /// success + /// + [JsonInclude] + [JsonPropertyName("success")] + public bool Success + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Tracing +{ + using System.Linq; + + /// + /// Whether to report trace events as series of dataCollected events or to save trace to a + /// stream (defaults to `ReportEvents`). + /// + public enum StartTransferMode + { + /// + /// ReportEvents + /// + [JsonPropertyName("ReportEvents")] + ReportEvents, + /// + /// ReturnAsStream + /// + [JsonPropertyName("ReturnAsStream")] + ReturnAsStream + } + + /// + /// Tracing + /// + public partial class TracingClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Tracing + /// + /// DevToolsClient + public TracingClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// BufferUsage + /// + public event System.EventHandler BufferUsage + { + add + { + _client.AddEventHandler("Tracing.bufferUsage", value); + } + + remove + { + _client.RemoveEventHandler("Tracing.bufferUsage", value); + } + } + + /// + /// Contains a bucket of collected trace events. When tracing is stopped collected events will be + /// sent as a sequence of dataCollected events followed by tracingComplete event. + /// + public event System.EventHandler DataCollected + { + add + { + _client.AddEventHandler("Tracing.dataCollected", value); + } + + remove + { + _client.RemoveEventHandler("Tracing.dataCollected", value); + } + } + + /// + /// Signals that tracing is stopped and there is no trace buffers pending flush, all data were + /// delivered via dataCollected events. + /// + public event System.EventHandler TracingComplete + { + add + { + _client.AddEventHandler("Tracing.tracingComplete", value); + } + + remove + { + _client.RemoveEventHandler("Tracing.tracingComplete", value); + } + } + + /// + /// Stop trace events collection. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EndAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Tracing.end", dict); + } + + /// + /// Gets supported tracing categories. + /// + /// returns System.Threading.Tasks.Task<GetCategoriesResponse> + public System.Threading.Tasks.Task GetCategoriesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Tracing.getCategories", dict); + } + + /// + /// Return a descriptor for all available tracing categories. + /// + /// returns System.Threading.Tasks.Task<GetTrackEventDescriptorResponse> + public System.Threading.Tasks.Task GetTrackEventDescriptorAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Tracing.getTrackEventDescriptor", dict); + } + + partial void ValidateRecordClockSyncMarker(string syncId); + /// + /// Record a clock sync marker in the trace. + /// + /// The ID of this clock sync marker + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RecordClockSyncMarkerAsync(string syncId) + { + ValidateRecordClockSyncMarker(syncId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("syncId", syncId); + return _client.ExecuteDevToolsMethodAsync("Tracing.recordClockSyncMarker", dict); + } + + partial void ValidateRequestMemoryDump(bool? deterministic = null, CefSharp.DevTools.Tracing.MemoryDumpLevelOfDetail? levelOfDetail = null); + /// + /// Request a global memory dump. + /// + /// Enables more deterministic results by forcing garbage collection + /// Specifies level of details in memory dump. Defaults to "detailed". + /// returns System.Threading.Tasks.Task<RequestMemoryDumpResponse> + public System.Threading.Tasks.Task RequestMemoryDumpAsync(bool? deterministic = null, CefSharp.DevTools.Tracing.MemoryDumpLevelOfDetail? levelOfDetail = null) + { + ValidateRequestMemoryDump(deterministic, levelOfDetail); + var dict = new System.Collections.Generic.Dictionary(); + if (deterministic.HasValue) + { + dict.Add("deterministic", deterministic.Value); + } + + if (levelOfDetail.HasValue) + { + dict.Add("levelOfDetail", EnumToString(levelOfDetail)); + } + + return _client.ExecuteDevToolsMethodAsync("Tracing.requestMemoryDump", dict); + } + + partial void ValidateStart(string categories = null, string options = null, double? bufferUsageReportingInterval = null, CefSharp.DevTools.Tracing.StartTransferMode? transferMode = null, CefSharp.DevTools.Tracing.StreamFormat? streamFormat = null, CefSharp.DevTools.Tracing.StreamCompression? streamCompression = null, CefSharp.DevTools.Tracing.TraceConfig traceConfig = null, byte[] perfettoConfig = null, CefSharp.DevTools.Tracing.TracingBackend? tracingBackend = null); + /// + /// Start trace events collection. + /// + /// Category/tag filter + /// Tracing options + /// If set, the agent will issue bufferUsage events at this interval, specified in milliseconds + /// Whether to report trace events as series of dataCollected events or to save trace to astream (defaults to `ReportEvents`). + /// Trace data format to use. This only applies when using `ReturnAsStream`transfer mode (defaults to `json`). + /// Compression format to use. This only applies when using `ReturnAsStream`transfer mode (defaults to `none`) + /// traceConfig + /// Base64-encoded serialized perfetto.protos.TraceConfig protobuf messageWhen specified, the parameters `categories`, `options`, `traceConfig`are ignored. + /// Backend type (defaults to `auto`) + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartAsync(string categories = null, string options = null, double? bufferUsageReportingInterval = null, CefSharp.DevTools.Tracing.StartTransferMode? transferMode = null, CefSharp.DevTools.Tracing.StreamFormat? streamFormat = null, CefSharp.DevTools.Tracing.StreamCompression? streamCompression = null, CefSharp.DevTools.Tracing.TraceConfig traceConfig = null, byte[] perfettoConfig = null, CefSharp.DevTools.Tracing.TracingBackend? tracingBackend = null) + { + ValidateStart(categories, options, bufferUsageReportingInterval, transferMode, streamFormat, streamCompression, traceConfig, perfettoConfig, tracingBackend); + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(categories))) + { + dict.Add("categories", categories); + } + + if (!(string.IsNullOrEmpty(options))) + { + dict.Add("options", options); + } + + if (bufferUsageReportingInterval.HasValue) + { + dict.Add("bufferUsageReportingInterval", bufferUsageReportingInterval.Value); + } + + if (transferMode.HasValue) + { + dict.Add("transferMode", EnumToString(transferMode)); + } + + if (streamFormat.HasValue) + { + dict.Add("streamFormat", EnumToString(streamFormat)); + } + + if (streamCompression.HasValue) + { + dict.Add("streamCompression", EnumToString(streamCompression)); + } + + if ((traceConfig) != (null)) + { + dict.Add("traceConfig", traceConfig.ToDictionary()); + } + + if ((perfettoConfig) != (null)) + { + dict.Add("perfettoConfig", ToBase64String(perfettoConfig)); + } + + if (tracingBackend.HasValue) + { + dict.Add("tracingBackend", EnumToString(tracingBackend)); + } + + return _client.ExecuteDevToolsMethodAsync("Tracing.start", dict); + } + } +} + +namespace CefSharp.DevTools.WebAudio +{ + /// + /// GetRealtimeDataResponse + /// + public class GetRealtimeDataResponse : DevToolsDomainResponseBase + { + /// + /// realtimeData + /// + [JsonInclude] + [JsonPropertyName("realtimeData")] + public CefSharp.DevTools.WebAudio.ContextRealtimeData RealtimeData + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.WebAudio +{ + using System.Linq; + + /// + /// This domain allows inspection of Web Audio API. + /// https://webaudio.github.io/web-audio-api/ + /// + public partial class WebAudioClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// WebAudio + /// + /// DevToolsClient + public WebAudioClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Notifies that a new BaseAudioContext has been created. + /// + public event System.EventHandler ContextCreated + { + add + { + _client.AddEventHandler("WebAudio.contextCreated", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.contextCreated", value); + } + } + + /// + /// Notifies that an existing BaseAudioContext will be destroyed. + /// + public event System.EventHandler ContextWillBeDestroyed + { + add + { + _client.AddEventHandler("WebAudio.contextWillBeDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.contextWillBeDestroyed", value); + } + } + + /// + /// Notifies that existing BaseAudioContext has changed some properties (id stays the same).. + /// + public event System.EventHandler ContextChanged + { + add + { + _client.AddEventHandler("WebAudio.contextChanged", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.contextChanged", value); + } + } + + /// + /// Notifies that the construction of an AudioListener has finished. + /// + public event System.EventHandler AudioListenerCreated + { + add + { + _client.AddEventHandler("WebAudio.audioListenerCreated", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioListenerCreated", value); + } + } + + /// + /// Notifies that a new AudioListener has been created. + /// + public event System.EventHandler AudioListenerWillBeDestroyed + { + add + { + _client.AddEventHandler("WebAudio.audioListenerWillBeDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioListenerWillBeDestroyed", value); + } + } + + /// + /// Notifies that a new AudioNode has been created. + /// + public event System.EventHandler AudioNodeCreated + { + add + { + _client.AddEventHandler("WebAudio.audioNodeCreated", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioNodeCreated", value); + } + } + + /// + /// Notifies that an existing AudioNode has been destroyed. + /// + public event System.EventHandler AudioNodeWillBeDestroyed + { + add + { + _client.AddEventHandler("WebAudio.audioNodeWillBeDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioNodeWillBeDestroyed", value); + } + } + + /// + /// Notifies that a new AudioParam has been created. + /// + public event System.EventHandler AudioParamCreated + { + add + { + _client.AddEventHandler("WebAudio.audioParamCreated", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioParamCreated", value); + } + } + + /// + /// Notifies that an existing AudioParam has been destroyed. + /// + public event System.EventHandler AudioParamWillBeDestroyed + { + add + { + _client.AddEventHandler("WebAudio.audioParamWillBeDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.audioParamWillBeDestroyed", value); + } + } + + /// + /// Notifies that two AudioNodes are connected. + /// + public event System.EventHandler NodesConnected + { + add + { + _client.AddEventHandler("WebAudio.nodesConnected", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.nodesConnected", value); + } + } + + /// + /// Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected. + /// + public event System.EventHandler NodesDisconnected + { + add + { + _client.AddEventHandler("WebAudio.nodesDisconnected", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.nodesDisconnected", value); + } + } + + /// + /// Notifies that an AudioNode is connected to an AudioParam. + /// + public event System.EventHandler NodeParamConnected + { + add + { + _client.AddEventHandler("WebAudio.nodeParamConnected", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.nodeParamConnected", value); + } + } + + /// + /// Notifies that an AudioNode is disconnected to an AudioParam. + /// + public event System.EventHandler NodeParamDisconnected + { + add + { + _client.AddEventHandler("WebAudio.nodeParamDisconnected", value); + } + + remove + { + _client.RemoveEventHandler("WebAudio.nodeParamDisconnected", value); + } + } + + /// + /// Enables the WebAudio domain and starts sending context lifetime events. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("WebAudio.enable", dict); + } + + /// + /// Disables the WebAudio domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("WebAudio.disable", dict); + } + + partial void ValidateGetRealtimeData(string contextId); + /// + /// Fetch the realtime data from the registered contexts. + /// + /// contextId + /// returns System.Threading.Tasks.Task<GetRealtimeDataResponse> + public System.Threading.Tasks.Task GetRealtimeDataAsync(string contextId) + { + ValidateGetRealtimeData(contextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("contextId", contextId); + return _client.ExecuteDevToolsMethodAsync("WebAudio.getRealtimeData", dict); + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + /// + /// AddVirtualAuthenticatorResponse + /// + public class AddVirtualAuthenticatorResponse : DevToolsDomainResponseBase + { + /// + /// authenticatorId + /// + [JsonInclude] + [JsonPropertyName("authenticatorId")] + public string AuthenticatorId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + /// + /// GetCredentialResponse + /// + public class GetCredentialResponse : DevToolsDomainResponseBase + { + /// + /// credential + /// + [JsonInclude] + [JsonPropertyName("credential")] + public CefSharp.DevTools.WebAuthn.Credential Credential + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + /// + /// GetCredentialsResponse + /// + public class GetCredentialsResponse : DevToolsDomainResponseBase + { + /// + /// credentials + /// + [JsonInclude] + [JsonPropertyName("credentials")] + public System.Collections.Generic.IList Credentials + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.WebAuthn +{ + using System.Linq; + + /// + /// This domain allows configuring virtual authenticators to test the WebAuthn + /// API. + /// + public partial class WebAuthnClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// WebAuthn + /// + /// DevToolsClient + public WebAuthnClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Triggered when a credential is added to an authenticator. + /// + public event System.EventHandler CredentialAdded + { + add + { + _client.AddEventHandler("WebAuthn.credentialAdded", value); + } + + remove + { + _client.RemoveEventHandler("WebAuthn.credentialAdded", value); + } + } + + /// + /// Triggered when a credential is deleted, e.g. through + /// PublicKeyCredential.signalUnknownCredential(). + /// + public event System.EventHandler CredentialDeleted + { + add + { + _client.AddEventHandler("WebAuthn.credentialDeleted", value); + } + + remove + { + _client.RemoveEventHandler("WebAuthn.credentialDeleted", value); + } + } + + /// + /// Triggered when a credential is updated, e.g. through + /// PublicKeyCredential.signalCurrentUserDetails(). + /// + public event System.EventHandler CredentialUpdated + { + add + { + _client.AddEventHandler("WebAuthn.credentialUpdated", value); + } + + remove + { + _client.RemoveEventHandler("WebAuthn.credentialUpdated", value); + } + } + + /// + /// Triggered when a credential is used in a webauthn assertion. + /// + public event System.EventHandler CredentialAsserted + { + add + { + _client.AddEventHandler("WebAuthn.credentialAsserted", value); + } + + remove + { + _client.RemoveEventHandler("WebAuthn.credentialAsserted", value); + } + } + + partial void ValidateEnable(bool? enableUI = null); + /// + /// Enable the WebAuthn domain and start intercepting credential storage and + /// retrieval with a virtual authenticator. + /// + /// Whether to enable the WebAuthn user interface. Enabling the UI isrecommended for debugging and demo purposes, as it is closer to the realexperience. Disabling the UI is recommended for automated testing.Supported at the embedder's discretion if UI is available.Defaults to false. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync(bool? enableUI = null) + { + ValidateEnable(enableUI); + var dict = new System.Collections.Generic.Dictionary(); + if (enableUI.HasValue) + { + dict.Add("enableUI", enableUI.Value); + } + + return _client.ExecuteDevToolsMethodAsync("WebAuthn.enable", dict); + } + + /// + /// Disable the WebAuthn domain. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("WebAuthn.disable", dict); + } + + partial void ValidateAddVirtualAuthenticator(CefSharp.DevTools.WebAuthn.VirtualAuthenticatorOptions options); + /// + /// Creates and adds a virtual authenticator. + /// + /// options + /// returns System.Threading.Tasks.Task<AddVirtualAuthenticatorResponse> + public System.Threading.Tasks.Task AddVirtualAuthenticatorAsync(CefSharp.DevTools.WebAuthn.VirtualAuthenticatorOptions options) + { + ValidateAddVirtualAuthenticator(options); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("options", options.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.addVirtualAuthenticator", dict); + } + + partial void ValidateSetResponseOverrideBits(string authenticatorId, bool? isBogusSignature = null, bool? isBadUV = null, bool? isBadUP = null); + /// + /// Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present. + /// + /// authenticatorId + /// If isBogusSignature is set, overrides the signature in the authenticator response to be zero.Defaults to false. + /// If isBadUV is set, overrides the UV bit in the flags in the authenticator response tobe zero. Defaults to false. + /// If isBadUP is set, overrides the UP bit in the flags in the authenticator response tobe zero. Defaults to false. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetResponseOverrideBitsAsync(string authenticatorId, bool? isBogusSignature = null, bool? isBadUV = null, bool? isBadUP = null) + { + ValidateSetResponseOverrideBits(authenticatorId, isBogusSignature, isBadUV, isBadUP); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + if (isBogusSignature.HasValue) + { + dict.Add("isBogusSignature", isBogusSignature.Value); + } + + if (isBadUV.HasValue) + { + dict.Add("isBadUV", isBadUV.Value); + } + + if (isBadUP.HasValue) + { + dict.Add("isBadUP", isBadUP.Value); + } + + return _client.ExecuteDevToolsMethodAsync("WebAuthn.setResponseOverrideBits", dict); + } + + partial void ValidateRemoveVirtualAuthenticator(string authenticatorId); + /// + /// Removes the given authenticator. + /// + /// authenticatorId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveVirtualAuthenticatorAsync(string authenticatorId) + { + ValidateRemoveVirtualAuthenticator(authenticatorId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.removeVirtualAuthenticator", dict); + } + + partial void ValidateAddCredential(string authenticatorId, CefSharp.DevTools.WebAuthn.Credential credential); + /// + /// Adds the credential to the specified authenticator. + /// + /// authenticatorId + /// credential + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddCredentialAsync(string authenticatorId, CefSharp.DevTools.WebAuthn.Credential credential) + { + ValidateAddCredential(authenticatorId, credential); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("credential", credential.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.addCredential", dict); + } + + partial void ValidateGetCredential(string authenticatorId, byte[] credentialId); + /// + /// Returns a single credential stored in the given virtual authenticator that + /// matches the credential ID. + /// + /// authenticatorId + /// credentialId + /// returns System.Threading.Tasks.Task<GetCredentialResponse> + public System.Threading.Tasks.Task GetCredentialAsync(string authenticatorId, byte[] credentialId) + { + ValidateGetCredential(authenticatorId, credentialId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("credentialId", ToBase64String(credentialId)); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.getCredential", dict); + } + + partial void ValidateGetCredentials(string authenticatorId); + /// + /// Returns all the credentials stored in the given virtual authenticator. + /// + /// authenticatorId + /// returns System.Threading.Tasks.Task<GetCredentialsResponse> + public System.Threading.Tasks.Task GetCredentialsAsync(string authenticatorId) + { + ValidateGetCredentials(authenticatorId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.getCredentials", dict); + } + + partial void ValidateRemoveCredential(string authenticatorId, byte[] credentialId); + /// + /// Removes a credential from the authenticator. + /// + /// authenticatorId + /// credentialId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveCredentialAsync(string authenticatorId, byte[] credentialId) + { + ValidateRemoveCredential(authenticatorId, credentialId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("credentialId", ToBase64String(credentialId)); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.removeCredential", dict); + } + + partial void ValidateClearCredentials(string authenticatorId); + /// + /// Clears all the credentials from the specified device. + /// + /// authenticatorId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ClearCredentialsAsync(string authenticatorId) + { + ValidateClearCredentials(authenticatorId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.clearCredentials", dict); + } + + partial void ValidateSetUserVerified(string authenticatorId, bool isUserVerified); + /// + /// Sets whether User Verification succeeds or fails for an authenticator. + /// The default is true. + /// + /// authenticatorId + /// isUserVerified + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetUserVerifiedAsync(string authenticatorId, bool isUserVerified) + { + ValidateSetUserVerified(authenticatorId, isUserVerified); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("isUserVerified", isUserVerified); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.setUserVerified", dict); + } + + partial void ValidateSetAutomaticPresenceSimulation(string authenticatorId, bool enabled); + /// + /// Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. + /// The default is true. + /// + /// authenticatorId + /// enabled + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAutomaticPresenceSimulationAsync(string authenticatorId, bool enabled) + { + ValidateSetAutomaticPresenceSimulation(authenticatorId, enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("WebAuthn.setAutomaticPresenceSimulation", dict); + } + + partial void ValidateSetCredentialProperties(string authenticatorId, byte[] credentialId, bool? backupEligibility = null, bool? backupState = null); + /// + /// Allows setting credential properties. + /// https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties + /// + /// authenticatorId + /// credentialId + /// backupEligibility + /// backupState + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCredentialPropertiesAsync(string authenticatorId, byte[] credentialId, bool? backupEligibility = null, bool? backupState = null) + { + ValidateSetCredentialProperties(authenticatorId, credentialId, backupEligibility, backupState); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("authenticatorId", authenticatorId); + dict.Add("credentialId", ToBase64String(credentialId)); + if (backupEligibility.HasValue) + { + dict.Add("backupEligibility", backupEligibility.Value); + } + + if (backupState.HasValue) + { + dict.Add("backupState", backupState.Value); + } + + return _client.ExecuteDevToolsMethodAsync("WebAuthn.setCredentialProperties", dict); + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// EnableResponse + /// + public class EnableResponse : DevToolsDomainResponseBase + { + /// + /// debuggerId + /// + [JsonInclude] + [JsonPropertyName("debuggerId")] + public string DebuggerId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// EvaluateOnCallFrameResponse + /// + public class EvaluateOnCallFrameResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get; + private set; + } + + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// GetPossibleBreakpointsResponse + /// + public class GetPossibleBreakpointsResponse : DevToolsDomainResponseBase + { + /// + /// locations + /// + [JsonInclude] + [JsonPropertyName("locations")] + public System.Collections.Generic.IList Locations + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// GetScriptSourceResponse + /// + public class GetScriptSourceResponse : DevToolsDomainResponseBase + { + /// + /// scriptSource + /// + [JsonInclude] + [JsonPropertyName("scriptSource")] + public string ScriptSource + { + get; + private set; + } + + /// + /// bytecode + /// + [JsonInclude] + [JsonPropertyName("bytecode")] + public byte[] Bytecode + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// DisassembleWasmModuleResponse + /// + public class DisassembleWasmModuleResponse : DevToolsDomainResponseBase + { + /// + /// streamId + /// + [JsonInclude] + [JsonPropertyName("streamId")] + public string StreamId + { + get; + private set; + } + + /// + /// totalNumberOfLines + /// + [JsonInclude] + [JsonPropertyName("totalNumberOfLines")] + public int TotalNumberOfLines + { + get; + private set; + } + + /// + /// functionBodyOffsets + /// + [JsonInclude] + [JsonPropertyName("functionBodyOffsets")] + public int[] FunctionBodyOffsets + { + get; + private set; + } + + /// + /// chunk + /// + [JsonInclude] + [JsonPropertyName("chunk")] + public CefSharp.DevTools.Debugger.WasmDisassemblyChunk Chunk + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// NextWasmDisassemblyChunkResponse + /// + public class NextWasmDisassemblyChunkResponse : DevToolsDomainResponseBase + { + /// + /// chunk + /// + [JsonInclude] + [JsonPropertyName("chunk")] + public CefSharp.DevTools.Debugger.WasmDisassemblyChunk Chunk + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// GetStackTraceResponse + /// + public class GetStackTraceResponse : DevToolsDomainResponseBase + { + /// + /// stackTrace + /// + [JsonInclude] + [JsonPropertyName("stackTrace")] + public CefSharp.DevTools.Runtime.StackTrace StackTrace + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// RestartFrameResponse + /// + public class RestartFrameResponse : DevToolsDomainResponseBase + { + /// + /// callFrames + /// + [JsonInclude] + [JsonPropertyName("callFrames")] + public System.Collections.Generic.IList CallFrames + { + get; + private set; + } + + /// + /// asyncStackTrace + /// + [JsonInclude] + [JsonPropertyName("asyncStackTrace")] + public CefSharp.DevTools.Runtime.StackTrace AsyncStackTrace + { + get; + private set; + } + + /// + /// asyncStackTraceId + /// + [JsonInclude] + [JsonPropertyName("asyncStackTraceId")] + public CefSharp.DevTools.Runtime.StackTraceId AsyncStackTraceId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SearchInContentResponse + /// + public class SearchInContentResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public System.Collections.Generic.IList Result + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetBreakpointResponse + /// + public class SetBreakpointResponse : DevToolsDomainResponseBase + { + /// + /// breakpointId + /// + [JsonInclude] + [JsonPropertyName("breakpointId")] + public string BreakpointId + { + get; + private set; + } + + /// + /// actualLocation + /// + [JsonInclude] + [JsonPropertyName("actualLocation")] + public CefSharp.DevTools.Debugger.Location ActualLocation + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetInstrumentationBreakpointResponse + /// + public class SetInstrumentationBreakpointResponse : DevToolsDomainResponseBase + { + /// + /// breakpointId + /// + [JsonInclude] + [JsonPropertyName("breakpointId")] + public string BreakpointId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetBreakpointByUrlResponse + /// + public class SetBreakpointByUrlResponse : DevToolsDomainResponseBase + { + /// + /// breakpointId + /// + [JsonInclude] + [JsonPropertyName("breakpointId")] + public string BreakpointId + { + get; + private set; + } + + /// + /// locations + /// + [JsonInclude] + [JsonPropertyName("locations")] + public System.Collections.Generic.IList Locations + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetBreakpointOnFunctionCallResponse + /// + public class SetBreakpointOnFunctionCallResponse : DevToolsDomainResponseBase + { + /// + /// breakpointId + /// + [JsonInclude] + [JsonPropertyName("breakpointId")] + public string BreakpointId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + /// + /// SetScriptSourceResponse + /// + public class SetScriptSourceResponse : DevToolsDomainResponseBase + { + /// + /// callFrames + /// + [JsonInclude] + [JsonPropertyName("callFrames")] + public System.Collections.Generic.IList CallFrames + { + get; + private set; + } + + /// + /// stackChanged + /// + [JsonInclude] + [JsonPropertyName("stackChanged")] + public bool? StackChanged + { + get; + private set; + } + + /// + /// asyncStackTrace + /// + [JsonInclude] + [JsonPropertyName("asyncStackTrace")] + public CefSharp.DevTools.Runtime.StackTrace AsyncStackTrace + { + get; + private set; + } + + /// + /// asyncStackTraceId + /// + [JsonInclude] + [JsonPropertyName("asyncStackTraceId")] + public CefSharp.DevTools.Runtime.StackTraceId AsyncStackTraceId + { + get; + private set; + } + + /// + /// status + /// + [JsonInclude] + [JsonPropertyName("status")] + public string Status + { + get; + private set; + } + + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Debugger +{ + using System.Linq; + + /// + /// ContinueToLocationTargetCallFrames + /// + public enum ContinueToLocationTargetCallFrames + { + /// + /// any + /// + [JsonPropertyName("any")] + Any, + /// + /// current + /// + [JsonPropertyName("current")] + Current + } + + /// + /// The `mode` parameter must be present and set to 'StepInto', otherwise + /// `restartFrame` will error out. + /// + public enum RestartFrameMode + { + /// + /// StepInto + /// + [JsonPropertyName("StepInto")] + StepInto + } + + /// + /// Instrumentation name. + /// + public enum SetInstrumentationBreakpointInstrumentation + { + /// + /// beforeScriptExecution + /// + [JsonPropertyName("beforeScriptExecution")] + BeforeScriptExecution, + /// + /// beforeScriptWithSourceMapExecution + /// + [JsonPropertyName("beforeScriptWithSourceMapExecution")] + BeforeScriptWithSourceMapExecution + } + + /// + /// Pause on exceptions mode. + /// + public enum SetPauseOnExceptionsState + { + /// + /// none + /// + [JsonPropertyName("none")] + None, + /// + /// caught + /// + [JsonPropertyName("caught")] + Caught, + /// + /// uncaught + /// + [JsonPropertyName("uncaught")] + Uncaught, + /// + /// all + /// + [JsonPropertyName("all")] + All + } + + /// + /// Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing + /// breakpoints, stepping through execution, exploring stack traces, etc. + /// + public partial class DebuggerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Debugger + /// + /// DevToolsClient + public DebuggerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + /// + public event System.EventHandler Paused + { + add + { + _client.AddEventHandler("Debugger.paused", value); + } + + remove + { + _client.RemoveEventHandler("Debugger.paused", value); + } + } + + /// + /// Fired when the virtual machine resumed execution. + /// + public event System.EventHandler Resumed + { + add + { + _client.AddEventHandler("Debugger.resumed", value); + } + + remove + { + _client.RemoveEventHandler("Debugger.resumed", value); + } + } + + /// + /// Fired when virtual machine fails to parse the script. + /// + public event System.EventHandler ScriptFailedToParse + { + add + { + _client.AddEventHandler("Debugger.scriptFailedToParse", value); + } + + remove + { + _client.RemoveEventHandler("Debugger.scriptFailedToParse", value); + } + } + + /// + /// Fired when virtual machine parses script. This event is also fired for all known and uncollected + /// scripts upon enabling debugger. + /// + public event System.EventHandler ScriptParsed + { + add + { + _client.AddEventHandler("Debugger.scriptParsed", value); + } + + remove + { + _client.RemoveEventHandler("Debugger.scriptParsed", value); + } + } + + partial void ValidateContinueToLocation(CefSharp.DevTools.Debugger.Location location, CefSharp.DevTools.Debugger.ContinueToLocationTargetCallFrames? targetCallFrames = null); + /// + /// Continues execution until specific location is reached. + /// + /// Location to continue to. + /// targetCallFrames + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ContinueToLocationAsync(CefSharp.DevTools.Debugger.Location location, CefSharp.DevTools.Debugger.ContinueToLocationTargetCallFrames? targetCallFrames = null) + { + ValidateContinueToLocation(location, targetCallFrames); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("location", location.ToDictionary()); + if (targetCallFrames.HasValue) + { + dict.Add("targetCallFrames", EnumToString(targetCallFrames)); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.continueToLocation", dict); + } + + /// + /// Disables debugger for given page. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Debugger.disable", dict); + } + + partial void ValidateEnable(double? maxScriptsCacheSize = null); + /// + /// Enables debugger for the given page. Clients should not assume that the debugging has been + /// enabled until the result for this command is received. + /// + /// The maximum size in bytes of collected scripts (not referenced by other heap objects)the debugger can hold. Puts no limit if parameter is omitted. + /// returns System.Threading.Tasks.Task<EnableResponse> + public System.Threading.Tasks.Task EnableAsync(double? maxScriptsCacheSize = null) + { + ValidateEnable(maxScriptsCacheSize); + var dict = new System.Collections.Generic.Dictionary(); + if (maxScriptsCacheSize.HasValue) + { + dict.Add("maxScriptsCacheSize", maxScriptsCacheSize.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.enable", dict); + } + + partial void ValidateEvaluateOnCallFrame(string callFrameId, string expression, string objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? throwOnSideEffect = null, double? timeout = null); + /// + /// Evaluates expression on a given call frame. + /// + /// Call frame identifier to evaluate on. + /// Expression to evaluate. + /// String object group name to put result into (allows rapid releasing resulting object handlesusing `releaseObjectGroup`). + /// Specifies whether command line API should be available to the evaluated expression, defaultsto false. + /// In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state. + /// Whether the result is expected to be a JSON object that should be sent by value. + /// Whether preview should be generated for the result. + /// Whether to throw an exception if side effect cannot be ruled out during evaluation. + /// Terminate execution after timing out (number of milliseconds). + /// returns System.Threading.Tasks.Task<EvaluateOnCallFrameResponse> + public System.Threading.Tasks.Task EvaluateOnCallFrameAsync(string callFrameId, string expression, string objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? throwOnSideEffect = null, double? timeout = null) + { + ValidateEvaluateOnCallFrame(callFrameId, expression, objectGroup, includeCommandLineAPI, silent, returnByValue, generatePreview, throwOnSideEffect, timeout); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("callFrameId", callFrameId); + dict.Add("expression", expression); + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (includeCommandLineAPI.HasValue) + { + dict.Add("includeCommandLineAPI", includeCommandLineAPI.Value); + } + + if (silent.HasValue) + { + dict.Add("silent", silent.Value); + } + + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (throwOnSideEffect.HasValue) + { + dict.Add("throwOnSideEffect", throwOnSideEffect.Value); + } + + if (timeout.HasValue) + { + dict.Add("timeout", timeout.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.evaluateOnCallFrame", dict); + } + + partial void ValidateGetPossibleBreakpoints(CefSharp.DevTools.Debugger.Location start, CefSharp.DevTools.Debugger.Location end = null, bool? restrictToFunction = null); + /// + /// Returns possible locations for breakpoint. scriptId in start and end range locations should be + /// the same. + /// + /// Start of range to search possible breakpoint locations in. + /// End of range to search possible breakpoint locations in (excluding). When not specified, endof scripts is used as end of range. + /// Only consider locations which are in the same (non-nested) function as start. + /// returns System.Threading.Tasks.Task<GetPossibleBreakpointsResponse> + public System.Threading.Tasks.Task GetPossibleBreakpointsAsync(CefSharp.DevTools.Debugger.Location start, CefSharp.DevTools.Debugger.Location end = null, bool? restrictToFunction = null) + { + ValidateGetPossibleBreakpoints(start, end, restrictToFunction); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("start", start.ToDictionary()); + if ((end) != (null)) + { + dict.Add("end", end.ToDictionary()); + } + + if (restrictToFunction.HasValue) + { + dict.Add("restrictToFunction", restrictToFunction.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.getPossibleBreakpoints", dict); + } + + partial void ValidateGetScriptSource(string scriptId); + /// + /// Returns source for the script with given id. + /// + /// Id of the script to get source for. + /// returns System.Threading.Tasks.Task<GetScriptSourceResponse> + public System.Threading.Tasks.Task GetScriptSourceAsync(string scriptId) + { + ValidateGetScriptSource(scriptId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + return _client.ExecuteDevToolsMethodAsync("Debugger.getScriptSource", dict); + } + + partial void ValidateDisassembleWasmModule(string scriptId); + /// + /// DisassembleWasmModule + /// + /// Id of the script to disassemble + /// returns System.Threading.Tasks.Task<DisassembleWasmModuleResponse> + public System.Threading.Tasks.Task DisassembleWasmModuleAsync(string scriptId) + { + ValidateDisassembleWasmModule(scriptId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + return _client.ExecuteDevToolsMethodAsync("Debugger.disassembleWasmModule", dict); + } + + partial void ValidateNextWasmDisassemblyChunk(string streamId); + /// + /// Disassemble the next chunk of lines for the module corresponding to the + /// stream. If disassembly is complete, this API will invalidate the streamId + /// and return an empty chunk. Any subsequent calls for the now invalid stream + /// will return errors. + /// + /// streamId + /// returns System.Threading.Tasks.Task<NextWasmDisassemblyChunkResponse> + public System.Threading.Tasks.Task NextWasmDisassemblyChunkAsync(string streamId) + { + ValidateNextWasmDisassemblyChunk(streamId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("streamId", streamId); + return _client.ExecuteDevToolsMethodAsync("Debugger.nextWasmDisassemblyChunk", dict); + } + + partial void ValidateGetStackTrace(CefSharp.DevTools.Runtime.StackTraceId stackTraceId); + /// + /// Returns stack trace with given `stackTraceId`. + /// + /// stackTraceId + /// returns System.Threading.Tasks.Task<GetStackTraceResponse> + public System.Threading.Tasks.Task GetStackTraceAsync(CefSharp.DevTools.Runtime.StackTraceId stackTraceId) + { + ValidateGetStackTrace(stackTraceId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("stackTraceId", stackTraceId.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Debugger.getStackTrace", dict); + } + + /// + /// Stops on the next JavaScript statement. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task PauseAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Debugger.pause", dict); + } + + partial void ValidateRemoveBreakpoint(string breakpointId); + /// + /// Removes JavaScript breakpoint. + /// + /// breakpointId + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveBreakpointAsync(string breakpointId) + { + ValidateRemoveBreakpoint(breakpointId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("breakpointId", breakpointId); + return _client.ExecuteDevToolsMethodAsync("Debugger.removeBreakpoint", dict); + } + + partial void ValidateRestartFrame(string callFrameId, CefSharp.DevTools.Debugger.RestartFrameMode? mode = null); + /// + /// Restarts particular call frame from the beginning. The old, deprecated + /// behavior of `restartFrame` is to stay paused and allow further CDP commands + /// after a restart was scheduled. This can cause problems with restarting, so + /// we now continue execution immediatly after it has been scheduled until we + /// reach the beginning of the restarted frame. + /// + /// To stay back-wards compatible, `restartFrame` now expects a `mode` + /// parameter to be present. If the `mode` parameter is missing, `restartFrame` + /// errors out. + /// + /// The various return values are deprecated and `callFrames` is always empty. + /// Use the call frames from the `Debugger#paused` events instead, that fires + /// once V8 pauses at the beginning of the restarted function. + /// + /// Call frame identifier to evaluate on. + /// The `mode` parameter must be present and set to 'StepInto', otherwise`restartFrame` will error out. + /// returns System.Threading.Tasks.Task<RestartFrameResponse> + public System.Threading.Tasks.Task RestartFrameAsync(string callFrameId, CefSharp.DevTools.Debugger.RestartFrameMode? mode = null) + { + ValidateRestartFrame(callFrameId, mode); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("callFrameId", callFrameId); + if (mode.HasValue) + { + dict.Add("mode", EnumToString(mode)); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.restartFrame", dict); + } + + partial void ValidateResume(bool? terminateOnResume = null); + /// + /// Resumes JavaScript execution. + /// + /// Set to true to terminate execution upon resuming execution. In contrastto Runtime.terminateExecution, this will allows to execute furtherJavaScript (i.e. via evaluation) until execution of the paused codeis actually resumed, at which point termination is triggered.If execution is currently not paused, this parameter has no effect. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ResumeAsync(bool? terminateOnResume = null) + { + ValidateResume(terminateOnResume); + var dict = new System.Collections.Generic.Dictionary(); + if (terminateOnResume.HasValue) + { + dict.Add("terminateOnResume", terminateOnResume.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.resume", dict); + } + + partial void ValidateSearchInContent(string scriptId, string query, bool? caseSensitive = null, bool? isRegex = null); + /// + /// Searches for given string in script content. + /// + /// Id of the script to search in. + /// String to search for. + /// If true, search is case sensitive. + /// If true, treats string parameter as regex. + /// returns System.Threading.Tasks.Task<SearchInContentResponse> + public System.Threading.Tasks.Task SearchInContentAsync(string scriptId, string query, bool? caseSensitive = null, bool? isRegex = null) + { + ValidateSearchInContent(scriptId, query, caseSensitive, isRegex); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + dict.Add("query", query); + if (caseSensitive.HasValue) + { + dict.Add("caseSensitive", caseSensitive.Value); + } + + if (isRegex.HasValue) + { + dict.Add("isRegex", isRegex.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.searchInContent", dict); + } + + partial void ValidateSetAsyncCallStackDepth(int maxDepth); + /// + /// Enables or disables async call stacks tracking. + /// + /// Maximum depth of async call stacks. Setting to `0` will effectively disable collecting asynccall stacks (default). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAsyncCallStackDepthAsync(int maxDepth) + { + ValidateSetAsyncCallStackDepth(maxDepth); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("maxDepth", maxDepth); + return _client.ExecuteDevToolsMethodAsync("Debugger.setAsyncCallStackDepth", dict); + } + + partial void ValidateSetBlackboxExecutionContexts(string[] uniqueIds); + /// + /// Replace previous blackbox execution contexts with passed ones. Forces backend to skip + /// stepping/pausing in scripts in these execution contexts. VM will try to leave blackboxed script by + /// performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + /// + /// Array of execution context unique ids for the debugger to ignore. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBlackboxExecutionContextsAsync(string[] uniqueIds) + { + ValidateSetBlackboxExecutionContexts(uniqueIds); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("uniqueIds", uniqueIds); + return _client.ExecuteDevToolsMethodAsync("Debugger.setBlackboxExecutionContexts", dict); + } + + partial void ValidateSetBlackboxPatterns(string[] patterns, bool? skipAnonymous = null); + /// + /// Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in + /// scripts with url matching one of the patterns. VM will try to leave blackboxed script by + /// performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + /// + /// Array of regexps that will be used to check script url for blackbox state. + /// If true, also ignore scripts with no source url. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBlackboxPatternsAsync(string[] patterns, bool? skipAnonymous = null) + { + ValidateSetBlackboxPatterns(patterns, skipAnonymous); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("patterns", patterns); + if (skipAnonymous.HasValue) + { + dict.Add("skipAnonymous", skipAnonymous.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setBlackboxPatterns", dict); + } + + partial void ValidateSetBlackboxedRanges(string scriptId, System.Collections.Generic.IList positions); + /// + /// Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted + /// scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + /// Positions array contains positions where blackbox state is changed. First interval isn't + /// blackboxed. Array should be sorted. + /// + /// Id of the script. + /// positions + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBlackboxedRangesAsync(string scriptId, System.Collections.Generic.IList positions) + { + ValidateSetBlackboxedRanges(scriptId, positions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + dict.Add("positions", positions.Select(x => x.ToDictionary())); + return _client.ExecuteDevToolsMethodAsync("Debugger.setBlackboxedRanges", dict); + } + + partial void ValidateSetBreakpoint(CefSharp.DevTools.Debugger.Location location, string condition = null); + /// + /// Sets JavaScript breakpoint at a given location. + /// + /// Location to set breakpoint in. + /// Expression to use as a breakpoint condition. When specified, debugger will only stop on thebreakpoint if this expression evaluates to true. + /// returns System.Threading.Tasks.Task<SetBreakpointResponse> + public System.Threading.Tasks.Task SetBreakpointAsync(CefSharp.DevTools.Debugger.Location location, string condition = null) + { + ValidateSetBreakpoint(location, condition); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("location", location.ToDictionary()); + if (!(string.IsNullOrEmpty(condition))) + { + dict.Add("condition", condition); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setBreakpoint", dict); + } + + partial void ValidateSetInstrumentationBreakpoint(CefSharp.DevTools.Debugger.SetInstrumentationBreakpointInstrumentation instrumentation); + /// + /// Sets instrumentation breakpoint. + /// + /// Instrumentation name. + /// returns System.Threading.Tasks.Task<SetInstrumentationBreakpointResponse> + public System.Threading.Tasks.Task SetInstrumentationBreakpointAsync(CefSharp.DevTools.Debugger.SetInstrumentationBreakpointInstrumentation instrumentation) + { + ValidateSetInstrumentationBreakpoint(instrumentation); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("instrumentation", EnumToString(instrumentation)); + return _client.ExecuteDevToolsMethodAsync("Debugger.setInstrumentationBreakpoint", dict); + } + + partial void ValidateSetBreakpointByUrl(int lineNumber, string url = null, string urlRegex = null, string scriptHash = null, int? columnNumber = null, string condition = null); + /// + /// Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this + /// command is issued, all existing parsed scripts will have breakpoints resolved and returned in + /// `locations` property. Further matching script parsing will result in subsequent + /// `breakpointResolved` events issued. This logical breakpoint will survive page reloads. + /// + /// Line number to set breakpoint at. + /// URL of the resources to set breakpoint on. + /// Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or`urlRegex` must be specified. + /// Script hash of the resources to set breakpoint on. + /// Offset in the line to set breakpoint at. + /// Expression to use as a breakpoint condition. When specified, debugger will only stop on thebreakpoint if this expression evaluates to true. + /// returns System.Threading.Tasks.Task<SetBreakpointByUrlResponse> + public System.Threading.Tasks.Task SetBreakpointByUrlAsync(int lineNumber, string url = null, string urlRegex = null, string scriptHash = null, int? columnNumber = null, string condition = null) + { + ValidateSetBreakpointByUrl(lineNumber, url, urlRegex, scriptHash, columnNumber, condition); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("lineNumber", lineNumber); + if (!(string.IsNullOrEmpty(url))) + { + dict.Add("url", url); + } + + if (!(string.IsNullOrEmpty(urlRegex))) + { + dict.Add("urlRegex", urlRegex); + } + + if (!(string.IsNullOrEmpty(scriptHash))) + { + dict.Add("scriptHash", scriptHash); + } + + if (columnNumber.HasValue) + { + dict.Add("columnNumber", columnNumber.Value); + } + + if (!(string.IsNullOrEmpty(condition))) + { + dict.Add("condition", condition); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setBreakpointByUrl", dict); + } + + partial void ValidateSetBreakpointOnFunctionCall(string objectId, string condition = null); + /// + /// Sets JavaScript breakpoint before each call to the given function. + /// If another function was created from the same source as a given one, + /// calling it will also trigger the breakpoint. + /// + /// Function object id. + /// Expression to use as a breakpoint condition. When specified, debugger willstop on the breakpoint if this expression evaluates to true. + /// returns System.Threading.Tasks.Task<SetBreakpointOnFunctionCallResponse> + public System.Threading.Tasks.Task SetBreakpointOnFunctionCallAsync(string objectId, string condition = null) + { + ValidateSetBreakpointOnFunctionCall(objectId, condition); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + if (!(string.IsNullOrEmpty(condition))) + { + dict.Add("condition", condition); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setBreakpointOnFunctionCall", dict); + } + + partial void ValidateSetBreakpointsActive(bool active); + /// + /// Activates / deactivates all breakpoints on the page. + /// + /// New value for breakpoints active state. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetBreakpointsActiveAsync(bool active) + { + ValidateSetBreakpointsActive(active); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("active", active); + return _client.ExecuteDevToolsMethodAsync("Debugger.setBreakpointsActive", dict); + } + + partial void ValidateSetPauseOnExceptions(CefSharp.DevTools.Debugger.SetPauseOnExceptionsState state); + /// + /// Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions, + /// or caught exceptions, no exceptions. Initial pause on exceptions state is `none`. + /// + /// Pause on exceptions mode. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetPauseOnExceptionsAsync(CefSharp.DevTools.Debugger.SetPauseOnExceptionsState state) + { + ValidateSetPauseOnExceptions(state); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("state", EnumToString(state)); + return _client.ExecuteDevToolsMethodAsync("Debugger.setPauseOnExceptions", dict); + } + + partial void ValidateSetReturnValue(CefSharp.DevTools.Runtime.CallArgument newValue); + /// + /// Changes return value in top frame. Available only at return break position. + /// + /// New return value. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetReturnValueAsync(CefSharp.DevTools.Runtime.CallArgument newValue) + { + ValidateSetReturnValue(newValue); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("newValue", newValue.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Debugger.setReturnValue", dict); + } + + partial void ValidateSetScriptSource(string scriptId, string scriptSource, bool? dryRun = null, bool? allowTopFrameEditing = null); + /// + /// Edits JavaScript source live. + /// + /// In general, functions that are currently on the stack can not be edited with + /// a single exception: If the edited function is the top-most stack frame and + /// that is the only activation of that function on the stack. In this case + /// the live edit will be successful and a `Debugger.restartFrame` for the + /// top-most function is automatically triggered. + /// + /// Id of the script to edit. + /// New content of the script. + /// If true the change will not actually be applied. Dry run may be used to get resultdescription without actually modifying the code. + /// If true, then `scriptSource` is allowed to change the function on top of the stackas long as the top-most stack frame is the only activation of that function. + /// returns System.Threading.Tasks.Task<SetScriptSourceResponse> + public System.Threading.Tasks.Task SetScriptSourceAsync(string scriptId, string scriptSource, bool? dryRun = null, bool? allowTopFrameEditing = null) + { + ValidateSetScriptSource(scriptId, scriptSource, dryRun, allowTopFrameEditing); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + dict.Add("scriptSource", scriptSource); + if (dryRun.HasValue) + { + dict.Add("dryRun", dryRun.Value); + } + + if (allowTopFrameEditing.HasValue) + { + dict.Add("allowTopFrameEditing", allowTopFrameEditing.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.setScriptSource", dict); + } + + partial void ValidateSetSkipAllPauses(bool skip); + /// + /// Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + /// + /// New value for skip pauses state. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSkipAllPausesAsync(bool skip) + { + ValidateSetSkipAllPauses(skip); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("skip", skip); + return _client.ExecuteDevToolsMethodAsync("Debugger.setSkipAllPauses", dict); + } + + partial void ValidateSetVariableValue(int scopeNumber, string variableName, CefSharp.DevTools.Runtime.CallArgument newValue, string callFrameId); + /// + /// Changes value of variable in a callframe. Object-based scopes are not supported and must be + /// mutated manually. + /// + /// 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'scope types are allowed. Other scopes could be manipulated manually. + /// Variable name. + /// New variable value. + /// Id of callframe that holds variable. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetVariableValueAsync(int scopeNumber, string variableName, CefSharp.DevTools.Runtime.CallArgument newValue, string callFrameId) + { + ValidateSetVariableValue(scopeNumber, variableName, newValue, callFrameId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scopeNumber", scopeNumber); + dict.Add("variableName", variableName); + dict.Add("newValue", newValue.ToDictionary()); + dict.Add("callFrameId", callFrameId); + return _client.ExecuteDevToolsMethodAsync("Debugger.setVariableValue", dict); + } + + partial void ValidateStepInto(bool? breakOnAsyncCall = null, System.Collections.Generic.IList skipList = null); + /// + /// Steps into the function call. + /// + /// Debugger will pause on the execution of the first async task which was scheduledbefore next pause. + /// The skipList specifies location ranges that should be skipped on step into. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StepIntoAsync(bool? breakOnAsyncCall = null, System.Collections.Generic.IList skipList = null) + { + ValidateStepInto(breakOnAsyncCall, skipList); + var dict = new System.Collections.Generic.Dictionary(); + if (breakOnAsyncCall.HasValue) + { + dict.Add("breakOnAsyncCall", breakOnAsyncCall.Value); + } + + if ((skipList) != (null)) + { + dict.Add("skipList", skipList.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.stepInto", dict); + } + + /// + /// Steps out of the function call. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StepOutAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Debugger.stepOut", dict); + } + + partial void ValidateStepOver(System.Collections.Generic.IList skipList = null); + /// + /// Steps over the statement. + /// + /// The skipList specifies location ranges that should be skipped on step over. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StepOverAsync(System.Collections.Generic.IList skipList = null) + { + ValidateStepOver(skipList); + var dict = new System.Collections.Generic.Dictionary(); + if ((skipList) != (null)) + { + dict.Add("skipList", skipList.Select(x => x.ToDictionary())); + } + + return _client.ExecuteDevToolsMethodAsync("Debugger.stepOver", dict); + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// GetHeapObjectIdResponse + /// + public class GetHeapObjectIdResponse : DevToolsDomainResponseBase + { + /// + /// heapSnapshotObjectId + /// + [JsonInclude] + [JsonPropertyName("heapSnapshotObjectId")] + public string HeapSnapshotObjectId + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// GetObjectByHeapObjectIdResponse + /// + public class GetObjectByHeapObjectIdResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// GetSamplingProfileResponse + /// + public class GetSamplingProfileResponse : DevToolsDomainResponseBase + { + /// + /// profile + /// + [JsonInclude] + [JsonPropertyName("profile")] + public CefSharp.DevTools.HeapProfiler.SamplingHeapProfile Profile + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + /// + /// StopSamplingResponse + /// + public class StopSamplingResponse : DevToolsDomainResponseBase + { + /// + /// profile + /// + [JsonInclude] + [JsonPropertyName("profile")] + public CefSharp.DevTools.HeapProfiler.SamplingHeapProfile Profile + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.HeapProfiler +{ + using System.Linq; + + /// + /// HeapProfiler + /// + public partial class HeapProfilerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// HeapProfiler + /// + /// DevToolsClient + public HeapProfilerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// AddHeapSnapshotChunk + /// + public event System.EventHandler AddHeapSnapshotChunk + { + add + { + _client.AddEventHandler("HeapProfiler.addHeapSnapshotChunk", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.addHeapSnapshotChunk", value); + } + } + + /// + /// If heap objects tracking has been started then backend may send update for one or more fragments + /// + public event System.EventHandler HeapStatsUpdate + { + add + { + _client.AddEventHandler("HeapProfiler.heapStatsUpdate", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.heapStatsUpdate", value); + } + } + + /// + /// If heap objects tracking has been started then backend regularly sends a current value for last + /// seen object id and corresponding timestamp. If the were changes in the heap since last event + /// then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + /// + public event System.EventHandler LastSeenObjectId + { + add + { + _client.AddEventHandler("HeapProfiler.lastSeenObjectId", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.lastSeenObjectId", value); + } + } + + /// + /// ReportHeapSnapshotProgress + /// + public event System.EventHandler ReportHeapSnapshotProgress + { + add + { + _client.AddEventHandler("HeapProfiler.reportHeapSnapshotProgress", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.reportHeapSnapshotProgress", value); + } + } + + /// + /// ResetProfiles + /// + public event System.EventHandler ResetProfiles + { + add + { + _client.AddEventHandler("HeapProfiler.resetProfiles", value); + } + + remove + { + _client.RemoveEventHandler("HeapProfiler.resetProfiles", value); + } + } + + partial void ValidateAddInspectedHeapObject(string heapObjectId); + /// + /// Enables console to refer to the node with given id via $x (see Command Line API for more details + /// $x functions). + /// + /// Heap snapshot object id to be accessible by means of $x command line API. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddInspectedHeapObjectAsync(string heapObjectId) + { + ValidateAddInspectedHeapObject(heapObjectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("heapObjectId", heapObjectId); + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.addInspectedHeapObject", dict); + } + + /// + /// CollectGarbage + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task CollectGarbageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.collectGarbage", dict); + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.disable", dict); + } + + /// + /// Enable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.enable", dict); + } + + partial void ValidateGetHeapObjectId(string objectId); + /// + /// GetHeapObjectId + /// + /// Identifier of the object to get heap object id for. + /// returns System.Threading.Tasks.Task<GetHeapObjectIdResponse> + public System.Threading.Tasks.Task GetHeapObjectIdAsync(string objectId) + { + ValidateGetHeapObjectId(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.getHeapObjectId", dict); + } + + partial void ValidateGetObjectByHeapObjectId(string objectId, string objectGroup = null); + /// + /// GetObjectByHeapObjectId + /// + /// objectId + /// Symbolic group name that can be used to release multiple objects. + /// returns System.Threading.Tasks.Task<GetObjectByHeapObjectIdResponse> + public System.Threading.Tasks.Task GetObjectByHeapObjectIdAsync(string objectId, string objectGroup = null) + { + ValidateGetObjectByHeapObjectId(objectId, objectGroup); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.getObjectByHeapObjectId", dict); + } + + /// + /// GetSamplingProfile + /// + /// returns System.Threading.Tasks.Task<GetSamplingProfileResponse> + public System.Threading.Tasks.Task GetSamplingProfileAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.getSamplingProfile", dict); + } + + partial void ValidateStartSampling(double? samplingInterval = null, double? stackDepth = null, bool? includeObjectsCollectedByMajorGC = null, bool? includeObjectsCollectedByMinorGC = null); + /// + /// StartSampling + /// + /// Average sample interval in bytes. Poisson distribution is used for the intervals. Thedefault value is 32768 bytes. + /// Maximum stack depth. The default value is 128. + /// By default, the sampling heap profiler reports only objects which arestill alive when the profile is returned via getSamplingProfile orstopSampling, which is useful for determining what functions contributethe most to steady-state memory usage. This flag instructs the samplingheap profiler to also include information about objects discarded bymajor GC, which will show which functions cause large temporary memoryusage or long GC pauses. + /// By default, the sampling heap profiler reports only objects which arestill alive when the profile is returned via getSamplingProfile orstopSampling, which is useful for determining what functions contributethe most to steady-state memory usage. This flag instructs the samplingheap profiler to also include information about objects discarded byminor GC, which is useful when tuning a latency-sensitive applicationfor minimal GC activity. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartSamplingAsync(double? samplingInterval = null, double? stackDepth = null, bool? includeObjectsCollectedByMajorGC = null, bool? includeObjectsCollectedByMinorGC = null) + { + ValidateStartSampling(samplingInterval, stackDepth, includeObjectsCollectedByMajorGC, includeObjectsCollectedByMinorGC); + var dict = new System.Collections.Generic.Dictionary(); + if (samplingInterval.HasValue) + { + dict.Add("samplingInterval", samplingInterval.Value); + } + + if (stackDepth.HasValue) + { + dict.Add("stackDepth", stackDepth.Value); + } + + if (includeObjectsCollectedByMajorGC.HasValue) + { + dict.Add("includeObjectsCollectedByMajorGC", includeObjectsCollectedByMajorGC.Value); + } + + if (includeObjectsCollectedByMinorGC.HasValue) + { + dict.Add("includeObjectsCollectedByMinorGC", includeObjectsCollectedByMinorGC.Value); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.startSampling", dict); + } + + partial void ValidateStartTrackingHeapObjects(bool? trackAllocations = null); + /// + /// StartTrackingHeapObjects + /// + /// trackAllocations + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartTrackingHeapObjectsAsync(bool? trackAllocations = null) + { + ValidateStartTrackingHeapObjects(trackAllocations); + var dict = new System.Collections.Generic.Dictionary(); + if (trackAllocations.HasValue) + { + dict.Add("trackAllocations", trackAllocations.Value); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.startTrackingHeapObjects", dict); + } + + /// + /// StopSampling + /// + /// returns System.Threading.Tasks.Task<StopSamplingResponse> + public System.Threading.Tasks.Task StopSamplingAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.stopSampling", dict); + } + + partial void ValidateStopTrackingHeapObjects(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null); + /// + /// StopTrackingHeapObjects + /// + /// If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being takenwhen the tracking is stopped. + /// Deprecated in favor of `exposeInternals`. + /// If true, numerical values are included in the snapshot + /// If true, exposes internals of the snapshot. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopTrackingHeapObjectsAsync(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null) + { + ValidateStopTrackingHeapObjects(reportProgress, treatGlobalObjectsAsRoots, captureNumericValue, exposeInternals); + var dict = new System.Collections.Generic.Dictionary(); + if (reportProgress.HasValue) + { + dict.Add("reportProgress", reportProgress.Value); + } + + if (treatGlobalObjectsAsRoots.HasValue) + { + dict.Add("treatGlobalObjectsAsRoots", treatGlobalObjectsAsRoots.Value); + } + + if (captureNumericValue.HasValue) + { + dict.Add("captureNumericValue", captureNumericValue.Value); + } + + if (exposeInternals.HasValue) + { + dict.Add("exposeInternals", exposeInternals.Value); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.stopTrackingHeapObjects", dict); + } + + partial void ValidateTakeHeapSnapshot(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null); + /// + /// TakeHeapSnapshot + /// + /// If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + /// If true, a raw snapshot without artificial roots will be generated.Deprecated in favor of `exposeInternals`. + /// If true, numerical values are included in the snapshot + /// If true, exposes internals of the snapshot. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TakeHeapSnapshotAsync(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null) + { + ValidateTakeHeapSnapshot(reportProgress, treatGlobalObjectsAsRoots, captureNumericValue, exposeInternals); + var dict = new System.Collections.Generic.Dictionary(); + if (reportProgress.HasValue) + { + dict.Add("reportProgress", reportProgress.Value); + } + + if (treatGlobalObjectsAsRoots.HasValue) + { + dict.Add("treatGlobalObjectsAsRoots", treatGlobalObjectsAsRoots.Value); + } + + if (captureNumericValue.HasValue) + { + dict.Add("captureNumericValue", captureNumericValue.Value); + } + + if (exposeInternals.HasValue) + { + dict.Add("exposeInternals", exposeInternals.Value); + } + + return _client.ExecuteDevToolsMethodAsync("HeapProfiler.takeHeapSnapshot", dict); + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// GetBestEffortCoverageResponse + /// + public class GetBestEffortCoverageResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public System.Collections.Generic.IList Result + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// StartPreciseCoverageResponse + /// + public class StartPreciseCoverageResponse : DevToolsDomainResponseBase + { + /// + /// timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// StopResponse + /// + public class StopResponse : DevToolsDomainResponseBase + { + /// + /// profile + /// + [JsonInclude] + [JsonPropertyName("profile")] + public CefSharp.DevTools.Profiler.Profile Profile + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + /// + /// TakePreciseCoverageResponse + /// + public class TakePreciseCoverageResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public System.Collections.Generic.IList Result + { + get; + private set; + } + + /// + /// timestamp + /// + [JsonInclude] + [JsonPropertyName("timestamp")] + public double Timestamp + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Profiler +{ + using System.Linq; + + /// + /// Profiler + /// + public partial class ProfilerClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Profiler + /// + /// DevToolsClient + public ProfilerClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// ConsoleProfileFinished + /// + public event System.EventHandler ConsoleProfileFinished + { + add + { + _client.AddEventHandler("Profiler.consoleProfileFinished", value); + } + + remove + { + _client.RemoveEventHandler("Profiler.consoleProfileFinished", value); + } + } + + /// + /// Sent when new profile recording is started using console.profile() call. + /// + public event System.EventHandler ConsoleProfileStarted + { + add + { + _client.AddEventHandler("Profiler.consoleProfileStarted", value); + } + + remove + { + _client.RemoveEventHandler("Profiler.consoleProfileStarted", value); + } + } + + /// + /// Reports coverage delta since the last poll (either from an event like this, or from + /// `takePreciseCoverage` for the current isolate. May only be sent if precise code + /// coverage has been started. This event can be trigged by the embedder to, for example, + /// trigger collection of coverage data immediately at a certain point in time. + /// + public event System.EventHandler PreciseCoverageDeltaUpdate + { + add + { + _client.AddEventHandler("Profiler.preciseCoverageDeltaUpdate", value); + } + + remove + { + _client.RemoveEventHandler("Profiler.preciseCoverageDeltaUpdate", value); + } + } + + /// + /// Disable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.disable", dict); + } + + /// + /// Enable + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.enable", dict); + } + + /// + /// Collect coverage data for the current isolate. The coverage data may be incomplete due to + /// garbage collection. + /// + /// returns System.Threading.Tasks.Task<GetBestEffortCoverageResponse> + public System.Threading.Tasks.Task GetBestEffortCoverageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.getBestEffortCoverage", dict); + } + + partial void ValidateSetSamplingInterval(int interval); + /// + /// Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + /// + /// New sampling interval in microseconds. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetSamplingIntervalAsync(int interval) + { + ValidateSetSamplingInterval(interval); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("interval", interval); + return _client.ExecuteDevToolsMethodAsync("Profiler.setSamplingInterval", dict); + } + + /// + /// Start + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StartAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.start", dict); + } + + partial void ValidateStartPreciseCoverage(bool? callCount = null, bool? detailed = null, bool? allowTriggeredUpdates = null); + /// + /// Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code + /// coverage may be incomplete. Enabling prevents running optimized code and resets execution + /// counters. + /// + /// Collect accurate call counts beyond simple 'covered' or 'not covered'. + /// Collect block-based coverage. + /// Allow the backend to send updates on its own initiative + /// returns System.Threading.Tasks.Task<StartPreciseCoverageResponse> + public System.Threading.Tasks.Task StartPreciseCoverageAsync(bool? callCount = null, bool? detailed = null, bool? allowTriggeredUpdates = null) + { + ValidateStartPreciseCoverage(callCount, detailed, allowTriggeredUpdates); + var dict = new System.Collections.Generic.Dictionary(); + if (callCount.HasValue) + { + dict.Add("callCount", callCount.Value); + } + + if (detailed.HasValue) + { + dict.Add("detailed", detailed.Value); + } + + if (allowTriggeredUpdates.HasValue) + { + dict.Add("allowTriggeredUpdates", allowTriggeredUpdates.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Profiler.startPreciseCoverage", dict); + } + + /// + /// Stop + /// + /// returns System.Threading.Tasks.Task<StopResponse> + public System.Threading.Tasks.Task StopAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.stop", dict); + } + + /// + /// Disable precise code coverage. Disabling releases unnecessary execution count records and allows + /// executing optimized code. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task StopPreciseCoverageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.stopPreciseCoverage", dict); + } + + /// + /// Collect coverage data for the current isolate, and resets execution counters. Precise code + /// coverage needs to have started. + /// + /// returns System.Threading.Tasks.Task<TakePreciseCoverageResponse> + public System.Threading.Tasks.Task TakePreciseCoverageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Profiler.takePreciseCoverage", dict); + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// AwaitPromiseResponse + /// + public class AwaitPromiseResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get; + private set; + } + + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// CallFunctionOnResponse + /// + public class CallFunctionOnResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get; + private set; + } + + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// CompileScriptResponse + /// + public class CompileScriptResponse : DevToolsDomainResponseBase + { + /// + /// scriptId + /// + [JsonInclude] + [JsonPropertyName("scriptId")] + public string ScriptId + { + get; + private set; + } + + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// EvaluateResponse + /// + public class EvaluateResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get; + private set; + } + + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GetIsolateIdResponse + /// + public class GetIsolateIdResponse : DevToolsDomainResponseBase + { + /// + /// id + /// + [JsonInclude] + [JsonPropertyName("id")] + public string Id + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GetHeapUsageResponse + /// + public class GetHeapUsageResponse : DevToolsDomainResponseBase + { + /// + /// usedSize + /// + [JsonInclude] + [JsonPropertyName("usedSize")] + public double UsedSize + { + get; + private set; + } + + /// + /// totalSize + /// + [JsonInclude] + [JsonPropertyName("totalSize")] + public double TotalSize + { + get; + private set; + } + + /// + /// embedderHeapUsedSize + /// + [JsonInclude] + [JsonPropertyName("embedderHeapUsedSize")] + public double EmbedderHeapUsedSize + { + get; + private set; + } + + /// + /// backingStorageSize + /// + [JsonInclude] + [JsonPropertyName("backingStorageSize")] + public double BackingStorageSize + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GetPropertiesResponse + /// + public class GetPropertiesResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public System.Collections.Generic.IList Result + { + get; + private set; + } + + /// + /// internalProperties + /// + [JsonInclude] + [JsonPropertyName("internalProperties")] + public System.Collections.Generic.IList InternalProperties + { + get; + private set; + } + + /// + /// privateProperties + /// + [JsonInclude] + [JsonPropertyName("privateProperties")] + public System.Collections.Generic.IList PrivateProperties + { + get; + private set; + } + + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GlobalLexicalScopeNamesResponse + /// + public class GlobalLexicalScopeNamesResponse : DevToolsDomainResponseBase + { + /// + /// names + /// + [JsonInclude] + [JsonPropertyName("names")] + public string[] Names + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// QueryObjectsResponse + /// + public class QueryObjectsResponse : DevToolsDomainResponseBase + { + /// + /// objects + /// + [JsonInclude] + [JsonPropertyName("objects")] + public CefSharp.DevTools.Runtime.RemoteObject Objects + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// RunScriptResponse + /// + public class RunScriptResponse : DevToolsDomainResponseBase + { + /// + /// result + /// + [JsonInclude] + [JsonPropertyName("result")] + public CefSharp.DevTools.Runtime.RemoteObject Result + { + get; + private set; + } + + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + /// + /// GetExceptionDetailsResponse + /// + public class GetExceptionDetailsResponse : DevToolsDomainResponseBase + { + /// + /// exceptionDetails + /// + [JsonInclude] + [JsonPropertyName("exceptionDetails")] + public CefSharp.DevTools.Runtime.ExceptionDetails ExceptionDetails + { + get; + private set; + } + } +} + +namespace CefSharp.DevTools.Runtime +{ + using System.Linq; + + /// + /// Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. + /// Evaluation results are returned as mirror object that expose object type, string representation + /// and unique identifier that can be used for further object reference. Original objects are + /// maintained in memory unless they are either explicitly released or are released along with the + /// other objects in their object group. + /// + public partial class RuntimeClient : DevToolsDomainBase + { + private CefSharp.DevTools.IDevToolsClient _client; + /// + /// Runtime + /// + /// DevToolsClient + public RuntimeClient(CefSharp.DevTools.IDevToolsClient client) + { + _client = (client); + } + + /// + /// Notification is issued every time when binding is called. + /// + public event System.EventHandler BindingCalled + { + add + { + _client.AddEventHandler("Runtime.bindingCalled", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.bindingCalled", value); + } + } + + /// + /// Issued when console API was called. + /// + public event System.EventHandler ConsoleAPICalled + { + add + { + _client.AddEventHandler("Runtime.consoleAPICalled", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.consoleAPICalled", value); + } + } + + /// + /// Issued when unhandled exception was revoked. + /// + public event System.EventHandler ExceptionRevoked + { + add + { + _client.AddEventHandler("Runtime.exceptionRevoked", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.exceptionRevoked", value); + } + } + + /// + /// Issued when exception was thrown and unhandled. + /// + public event System.EventHandler ExceptionThrown + { + add + { + _client.AddEventHandler("Runtime.exceptionThrown", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.exceptionThrown", value); + } + } + + /// + /// Issued when new execution context is created. + /// + public event System.EventHandler ExecutionContextCreated + { + add + { + _client.AddEventHandler("Runtime.executionContextCreated", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.executionContextCreated", value); + } + } + + /// + /// Issued when execution context is destroyed. + /// + public event System.EventHandler ExecutionContextDestroyed + { + add + { + _client.AddEventHandler("Runtime.executionContextDestroyed", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.executionContextDestroyed", value); + } + } + + /// + /// Issued when all executionContexts were cleared in browser + /// + public event System.EventHandler ExecutionContextsCleared + { + add + { + _client.AddEventHandler("Runtime.executionContextsCleared", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.executionContextsCleared", value); + } + } + + /// + /// Issued when object should be inspected (for example, as a result of inspect() command line API + /// call). + /// + public event System.EventHandler InspectRequested + { + add + { + _client.AddEventHandler("Runtime.inspectRequested", value); + } + + remove + { + _client.RemoveEventHandler("Runtime.inspectRequested", value); + } + } + + partial void ValidateAwaitPromise(string promiseObjectId, bool? returnByValue = null, bool? generatePreview = null); + /// + /// Add handler to promise with given promise object id. + /// + /// Identifier of the promise. + /// Whether the result is expected to be a JSON object that should be sent by value. + /// Whether preview should be generated for the result. + /// returns System.Threading.Tasks.Task<AwaitPromiseResponse> + public System.Threading.Tasks.Task AwaitPromiseAsync(string promiseObjectId, bool? returnByValue = null, bool? generatePreview = null) + { + ValidateAwaitPromise(promiseObjectId, returnByValue, generatePreview); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("promiseObjectId", promiseObjectId); + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.awaitPromise", dict); + } + + partial void ValidateCallFunctionOn(string functionDeclaration, string objectId = null, System.Collections.Generic.IList arguments = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? userGesture = null, bool? awaitPromise = null, int? executionContextId = null, string objectGroup = null, bool? throwOnSideEffect = null, string uniqueContextId = null, CefSharp.DevTools.Runtime.SerializationOptions serializationOptions = null); + /// + /// Calls function with given declaration on the given object. Object group of the result is + /// inherited from the target object. + /// + /// Declaration of the function to call. + /// Identifier of the object to call function on. Either objectId or executionContextId shouldbe specified. + /// Call arguments. All call arguments must belong to the same JavaScript world as the targetobject. + /// In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state. + /// Whether the result is expected to be a JSON object which should be sent by value.Can be overriden by `serializationOptions`. + /// Whether preview should be generated for the result. + /// Whether execution should be treated as initiated by user in the UI. + /// Whether execution should `await` for resulting value and return once awaited promise isresolved. + /// Specifies execution context which global object will be used to call function on. EitherexecutionContextId or objectId should be specified. + /// Symbolic group name that can be used to release multiple objects. If objectGroup is notspecified and objectId is, objectGroup will be inherited from object. + /// Whether to throw an exception if side effect cannot be ruled out during evaluation. + /// An alternative way to specify the execution context to call function on.Compared to contextId that may be reused across processes, this is guaranteed to besystem-unique, so it can be used to prevent accidental function callin context different than intended (e.g. as a result of navigation across processboundaries).This is mutually exclusive with `executionContextId`. + /// Specifies the result serialization. If provided, overrides`generatePreview` and `returnByValue`. + /// returns System.Threading.Tasks.Task<CallFunctionOnResponse> + public System.Threading.Tasks.Task CallFunctionOnAsync(string functionDeclaration, string objectId = null, System.Collections.Generic.IList arguments = null, bool? silent = null, bool? returnByValue = null, bool? generatePreview = null, bool? userGesture = null, bool? awaitPromise = null, int? executionContextId = null, string objectGroup = null, bool? throwOnSideEffect = null, string uniqueContextId = null, CefSharp.DevTools.Runtime.SerializationOptions serializationOptions = null) + { + ValidateCallFunctionOn(functionDeclaration, objectId, arguments, silent, returnByValue, generatePreview, userGesture, awaitPromise, executionContextId, objectGroup, throwOnSideEffect, uniqueContextId, serializationOptions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("functionDeclaration", functionDeclaration); + if (!(string.IsNullOrEmpty(objectId))) + { + dict.Add("objectId", objectId); + } + + if ((arguments) != (null)) + { + dict.Add("arguments", arguments.Select(x => x.ToDictionary())); + } + + if (silent.HasValue) + { + dict.Add("silent", silent.Value); + } + + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (userGesture.HasValue) + { + dict.Add("userGesture", userGesture.Value); + } + + if (awaitPromise.HasValue) + { + dict.Add("awaitPromise", awaitPromise.Value); + } + + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (throwOnSideEffect.HasValue) + { + dict.Add("throwOnSideEffect", throwOnSideEffect.Value); + } + + if (!(string.IsNullOrEmpty(uniqueContextId))) + { + dict.Add("uniqueContextId", uniqueContextId); + } + + if ((serializationOptions) != (null)) + { + dict.Add("serializationOptions", serializationOptions.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.callFunctionOn", dict); + } + + partial void ValidateCompileScript(string expression, string sourceURL, bool persistScript, int? executionContextId = null); + /// + /// Compiles expression. + /// + /// Expression to compile. + /// Source url to be set for the script. + /// Specifies whether the compiled script should be persisted. + /// Specifies in which execution context to perform script run. If the parameter is omitted theevaluation will be performed in the context of the inspected page. + /// returns System.Threading.Tasks.Task<CompileScriptResponse> + public System.Threading.Tasks.Task CompileScriptAsync(string expression, string sourceURL, bool persistScript, int? executionContextId = null) + { + ValidateCompileScript(expression, sourceURL, persistScript, executionContextId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("expression", expression); + dict.Add("sourceURL", sourceURL); + dict.Add("persistScript", persistScript); + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.compileScript", dict); + } + + /// + /// Disables reporting of execution contexts creation. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DisableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.disable", dict); + } + + /// + /// Discards collected exceptions and console API calls. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task DiscardConsoleEntriesAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.discardConsoleEntries", dict); + } + + /// + /// Enables reporting of execution contexts creation by means of `executionContextCreated` event. + /// When the reporting gets enabled the event will be sent immediately for each existing execution + /// context. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task EnableAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.enable", dict); + } + + partial void ValidateEvaluate(string expression, string objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, int? contextId = null, bool? returnByValue = null, bool? generatePreview = null, bool? userGesture = null, bool? awaitPromise = null, bool? throwOnSideEffect = null, double? timeout = null, bool? disableBreaks = null, bool? replMode = null, bool? allowUnsafeEvalBlockedByCSP = null, string uniqueContextId = null, CefSharp.DevTools.Runtime.SerializationOptions serializationOptions = null); + /// + /// Evaluates expression on global object. + /// + /// Expression to evaluate. + /// Symbolic group name that can be used to release multiple objects. + /// Determines whether Command Line API should be available during the evaluation. + /// In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state. + /// Specifies in which execution context to perform evaluation. If the parameter is omitted theevaluation will be performed in the context of the inspected page.This is mutually exclusive with `uniqueContextId`, which offers analternative way to identify the execution context that is more reliablein a multi-process environment. + /// Whether the result is expected to be a JSON object that should be sent by value. + /// Whether preview should be generated for the result. + /// Whether execution should be treated as initiated by user in the UI. + /// Whether execution should `await` for resulting value and return once awaited promise isresolved. + /// Whether to throw an exception if side effect cannot be ruled out during evaluation.This implies `disableBreaks` below. + /// Terminate execution after timing out (number of milliseconds). + /// Disable breakpoints during execution. + /// Setting this flag to true enables `let` re-declaration and top-level `await`.Note that `let` variables can only be re-declared if they originate from`replMode` themselves. + /// The Content Security Policy (CSP) for the target might block 'unsafe-eval'which includes eval(), Function(), setTimeout() and setInterval()when called with non-callable arguments. This flag bypasses CSP for thisevaluation and allows unsafe-eval. Defaults to true. + /// An alternative way to specify the execution context to evaluate in.Compared to contextId that may be reused across processes, this is guaranteed to besystem-unique, so it can be used to prevent accidental evaluation of the expressionin context different than intended (e.g. as a result of navigation across processboundaries).This is mutually exclusive with `contextId`. + /// Specifies the result serialization. If provided, overrides`generatePreview` and `returnByValue`. + /// returns System.Threading.Tasks.Task<EvaluateResponse> + public System.Threading.Tasks.Task EvaluateAsync(string expression, string objectGroup = null, bool? includeCommandLineAPI = null, bool? silent = null, int? contextId = null, bool? returnByValue = null, bool? generatePreview = null, bool? userGesture = null, bool? awaitPromise = null, bool? throwOnSideEffect = null, double? timeout = null, bool? disableBreaks = null, bool? replMode = null, bool? allowUnsafeEvalBlockedByCSP = null, string uniqueContextId = null, CefSharp.DevTools.Runtime.SerializationOptions serializationOptions = null) + { + ValidateEvaluate(expression, objectGroup, includeCommandLineAPI, silent, contextId, returnByValue, generatePreview, userGesture, awaitPromise, throwOnSideEffect, timeout, disableBreaks, replMode, allowUnsafeEvalBlockedByCSP, uniqueContextId, serializationOptions); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("expression", expression); + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (includeCommandLineAPI.HasValue) + { + dict.Add("includeCommandLineAPI", includeCommandLineAPI.Value); + } + + if (silent.HasValue) + { + dict.Add("silent", silent.Value); + } + + if (contextId.HasValue) + { + dict.Add("contextId", contextId.Value); + } + + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (userGesture.HasValue) + { + dict.Add("userGesture", userGesture.Value); + } + + if (awaitPromise.HasValue) + { + dict.Add("awaitPromise", awaitPromise.Value); + } + + if (throwOnSideEffect.HasValue) + { + dict.Add("throwOnSideEffect", throwOnSideEffect.Value); + } + + if (timeout.HasValue) + { + dict.Add("timeout", timeout.Value); + } + + if (disableBreaks.HasValue) + { + dict.Add("disableBreaks", disableBreaks.Value); + } + + if (replMode.HasValue) + { + dict.Add("replMode", replMode.Value); + } + + if (allowUnsafeEvalBlockedByCSP.HasValue) + { + dict.Add("allowUnsafeEvalBlockedByCSP", allowUnsafeEvalBlockedByCSP.Value); + } + + if (!(string.IsNullOrEmpty(uniqueContextId))) + { + dict.Add("uniqueContextId", uniqueContextId); + } + + if ((serializationOptions) != (null)) + { + dict.Add("serializationOptions", serializationOptions.ToDictionary()); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.evaluate", dict); + } + + /// + /// Returns the isolate id. + /// + /// returns System.Threading.Tasks.Task<GetIsolateIdResponse> + public System.Threading.Tasks.Task GetIsolateIdAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.getIsolateId", dict); + } + + /// + /// Returns the JavaScript heap usage. + /// It is the total usage of the corresponding isolate not scoped to a particular Runtime. + /// + /// returns System.Threading.Tasks.Task<GetHeapUsageResponse> + public System.Threading.Tasks.Task GetHeapUsageAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.getHeapUsage", dict); + } + + partial void ValidateGetProperties(string objectId, bool? ownProperties = null, bool? accessorPropertiesOnly = null, bool? generatePreview = null, bool? nonIndexedPropertiesOnly = null); + /// + /// Returns properties of a given object. Object group of the result is inherited from the target + /// object. + /// + /// Identifier of the object to return properties for. + /// If true, returns properties belonging only to the element itself, not to its prototypechain. + /// If true, returns accessor properties (with getter/setter) only; internal properties are notreturned either. + /// Whether preview should be generated for the results. + /// If true, returns non-indexed properties only. + /// returns System.Threading.Tasks.Task<GetPropertiesResponse> + public System.Threading.Tasks.Task GetPropertiesAsync(string objectId, bool? ownProperties = null, bool? accessorPropertiesOnly = null, bool? generatePreview = null, bool? nonIndexedPropertiesOnly = null) + { + ValidateGetProperties(objectId, ownProperties, accessorPropertiesOnly, generatePreview, nonIndexedPropertiesOnly); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + if (ownProperties.HasValue) + { + dict.Add("ownProperties", ownProperties.Value); + } + + if (accessorPropertiesOnly.HasValue) + { + dict.Add("accessorPropertiesOnly", accessorPropertiesOnly.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (nonIndexedPropertiesOnly.HasValue) + { + dict.Add("nonIndexedPropertiesOnly", nonIndexedPropertiesOnly.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.getProperties", dict); + } + + partial void ValidateGlobalLexicalScopeNames(int? executionContextId = null); + /// + /// Returns all let, const and class variables from global scope. + /// + /// Specifies in which execution context to lookup global scope variables. + /// returns System.Threading.Tasks.Task<GlobalLexicalScopeNamesResponse> + public System.Threading.Tasks.Task GlobalLexicalScopeNamesAsync(int? executionContextId = null) + { + ValidateGlobalLexicalScopeNames(executionContextId); + var dict = new System.Collections.Generic.Dictionary(); + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.globalLexicalScopeNames", dict); + } + + partial void ValidateQueryObjects(string prototypeObjectId, string objectGroup = null); + /// + /// QueryObjects + /// + /// Identifier of the prototype to return objects for. + /// Symbolic group name that can be used to release the results. + /// returns System.Threading.Tasks.Task<QueryObjectsResponse> + public System.Threading.Tasks.Task QueryObjectsAsync(string prototypeObjectId, string objectGroup = null) + { + ValidateQueryObjects(prototypeObjectId, objectGroup); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("prototypeObjectId", prototypeObjectId); + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.queryObjects", dict); + } + + partial void ValidateReleaseObject(string objectId); + /// + /// Releases remote object with given id. + /// + /// Identifier of the object to release. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReleaseObjectAsync(string objectId) + { + ValidateReleaseObject(objectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectId", objectId); + return _client.ExecuteDevToolsMethodAsync("Runtime.releaseObject", dict); + } + + partial void ValidateReleaseObjectGroup(string objectGroup); + /// + /// Releases all remote objects that belong to a given group. + /// + /// Symbolic object group name. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task ReleaseObjectGroupAsync(string objectGroup) + { + ValidateReleaseObjectGroup(objectGroup); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("objectGroup", objectGroup); + return _client.ExecuteDevToolsMethodAsync("Runtime.releaseObjectGroup", dict); + } + + /// + /// Tells inspected instance to run if it was waiting for debugger to attach. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RunIfWaitingForDebuggerAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.runIfWaitingForDebugger", dict); + } + + partial void ValidateRunScript(string scriptId, int? executionContextId = null, string objectGroup = null, bool? silent = null, bool? includeCommandLineAPI = null, bool? returnByValue = null, bool? generatePreview = null, bool? awaitPromise = null); + /// + /// Runs script with given id in a given context. + /// + /// Id of the script to run. + /// Specifies in which execution context to perform script run. If the parameter is omitted theevaluation will be performed in the context of the inspected page. + /// Symbolic group name that can be used to release multiple objects. + /// In silent mode exceptions thrown during evaluation are not reported and do not pauseexecution. Overrides `setPauseOnException` state. + /// Determines whether Command Line API should be available during the evaluation. + /// Whether the result is expected to be a JSON object which should be sent by value. + /// Whether preview should be generated for the result. + /// Whether execution should `await` for resulting value and return once awaited promise isresolved. + /// returns System.Threading.Tasks.Task<RunScriptResponse> + public System.Threading.Tasks.Task RunScriptAsync(string scriptId, int? executionContextId = null, string objectGroup = null, bool? silent = null, bool? includeCommandLineAPI = null, bool? returnByValue = null, bool? generatePreview = null, bool? awaitPromise = null) + { + ValidateRunScript(scriptId, executionContextId, objectGroup, silent, includeCommandLineAPI, returnByValue, generatePreview, awaitPromise); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("scriptId", scriptId); + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + if (!(string.IsNullOrEmpty(objectGroup))) + { + dict.Add("objectGroup", objectGroup); + } + + if (silent.HasValue) + { + dict.Add("silent", silent.Value); + } + + if (includeCommandLineAPI.HasValue) + { + dict.Add("includeCommandLineAPI", includeCommandLineAPI.Value); + } + + if (returnByValue.HasValue) + { + dict.Add("returnByValue", returnByValue.Value); + } + + if (generatePreview.HasValue) + { + dict.Add("generatePreview", generatePreview.Value); + } + + if (awaitPromise.HasValue) + { + dict.Add("awaitPromise", awaitPromise.Value); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.runScript", dict); + } + + partial void ValidateSetAsyncCallStackDepth(int maxDepth); + /// + /// Enables or disables async call stacks tracking. + /// + /// Maximum depth of async call stacks. Setting to `0` will effectively disable collecting asynccall stacks (default). + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetAsyncCallStackDepthAsync(int maxDepth) + { + ValidateSetAsyncCallStackDepth(maxDepth); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("maxDepth", maxDepth); + return _client.ExecuteDevToolsMethodAsync("Runtime.setAsyncCallStackDepth", dict); + } + + partial void ValidateSetCustomObjectFormatterEnabled(bool enabled); + /// + /// SetCustomObjectFormatterEnabled + /// + /// enabled + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetCustomObjectFormatterEnabledAsync(bool enabled) + { + ValidateSetCustomObjectFormatterEnabled(enabled); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("enabled", enabled); + return _client.ExecuteDevToolsMethodAsync("Runtime.setCustomObjectFormatterEnabled", dict); + } + + partial void ValidateSetMaxCallStackSizeToCapture(int size); + /// + /// SetMaxCallStackSizeToCapture + /// + /// size + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task SetMaxCallStackSizeToCaptureAsync(int size) + { + ValidateSetMaxCallStackSizeToCapture(size); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("size", size); + return _client.ExecuteDevToolsMethodAsync("Runtime.setMaxCallStackSizeToCapture", dict); + } + + /// + /// Terminate current or next JavaScript execution. + /// Will cancel the termination when the outer-most script execution ends. + /// + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task TerminateExecutionAsync() + { + System.Collections.Generic.Dictionary dict = null; + return _client.ExecuteDevToolsMethodAsync("Runtime.terminateExecution", dict); + } + + partial void ValidateAddBinding(string name, int? executionContextId = null, string executionContextName = null); + /// + /// If executionContextId is empty, adds binding with the given name on the + /// global objects of all inspected contexts, including those created later, + /// bindings survive reloads. + /// Binding function takes exactly one argument, this argument should be string, + /// in case of any other input, function throws an exception. + /// Each binding function call produces Runtime.bindingCalled notification. + /// + /// name + /// If specified, the binding would only be exposed to the specifiedexecution context. If omitted and `executionContextName` is not set,the binding is exposed to all execution contexts of the target.This parameter is mutually exclusive with `executionContextName`.Deprecated in favor of `executionContextName` due to an unclear use caseand bugs in implementation (crbug.com/1169639). `executionContextId` will beremoved in the future. + /// If specified, the binding is exposed to the executionContext withmatching name, even for contexts created after the binding is added.See also `ExecutionContext.name` and `worldName` parameter to`Page.addScriptToEvaluateOnNewDocument`.This parameter is mutually exclusive with `executionContextId`. + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task AddBindingAsync(string name, int? executionContextId = null, string executionContextName = null) + { + ValidateAddBinding(name, executionContextId, executionContextName); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + if (executionContextId.HasValue) + { + dict.Add("executionContextId", executionContextId.Value); + } + + if (!(string.IsNullOrEmpty(executionContextName))) + { + dict.Add("executionContextName", executionContextName); + } + + return _client.ExecuteDevToolsMethodAsync("Runtime.addBinding", dict); + } + + partial void ValidateRemoveBinding(string name); + /// + /// This method does not remove binding function from global object but + /// unsubscribes current runtime agent from Runtime.bindingCalled notifications. + /// + /// name + /// returns System.Threading.Tasks.Task<DevToolsMethodResponse> + public System.Threading.Tasks.Task RemoveBindingAsync(string name) + { + ValidateRemoveBinding(name); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("name", name); + return _client.ExecuteDevToolsMethodAsync("Runtime.removeBinding", dict); + } + + partial void ValidateGetExceptionDetails(string errorObjectId); + /// + /// This method tries to lookup and populate exception details for a + /// JavaScript Error object. + /// Note that the stackTrace portion of the resulting exceptionDetails will + /// only be populated if the Runtime domain was enabled at the time when the + /// Error was thrown. + /// + /// The error object for which to resolve the exception details. + /// returns System.Threading.Tasks.Task<GetExceptionDetailsResponse> + public System.Threading.Tasks.Task GetExceptionDetailsAsync(string errorObjectId) + { + ValidateGetExceptionDetails(errorObjectId); + var dict = new System.Collections.Generic.Dictionary(); + dict.Add("errorObjectId", errorObjectId); + return _client.ExecuteDevToolsMethodAsync("Runtime.getExceptionDetails", dict); + } + } +} + +namespace CefSharp.DevTools +{ + /// + /// Generated DevToolsClient methods + /// + public partial class DevToolsClient + { + private CefSharp.DevTools.Accessibility.AccessibilityClient _Accessibility; + /// + /// Accessibility + /// + public CefSharp.DevTools.Accessibility.AccessibilityClient Accessibility + { + get + { + if ((_Accessibility) == (null)) + { + _Accessibility = (new CefSharp.DevTools.Accessibility.AccessibilityClient(this)); + } + + return _Accessibility; + } + } + + private CefSharp.DevTools.Animation.AnimationClient _Animation; + /// + /// Animation + /// + public CefSharp.DevTools.Animation.AnimationClient Animation + { + get + { + if ((_Animation) == (null)) + { + _Animation = (new CefSharp.DevTools.Animation.AnimationClient(this)); + } + + return _Animation; + } + } + + private CefSharp.DevTools.Audits.AuditsClient _Audits; + /// + /// Audits domain allows investigation of page violations and possible improvements. + /// + public CefSharp.DevTools.Audits.AuditsClient Audits + { + get + { + if ((_Audits) == (null)) + { + _Audits = (new CefSharp.DevTools.Audits.AuditsClient(this)); + } + + return _Audits; + } + } + + private CefSharp.DevTools.Autofill.AutofillClient _Autofill; + /// + /// Defines commands and events for Autofill. + /// + public CefSharp.DevTools.Autofill.AutofillClient Autofill + { + get + { + if ((_Autofill) == (null)) + { + _Autofill = (new CefSharp.DevTools.Autofill.AutofillClient(this)); + } + + return _Autofill; + } + } + + private CefSharp.DevTools.BackgroundService.BackgroundServiceClient _BackgroundService; + /// + /// Defines events for background web platform features. + /// + public CefSharp.DevTools.BackgroundService.BackgroundServiceClient BackgroundService + { + get + { + if ((_BackgroundService) == (null)) + { + _BackgroundService = (new CefSharp.DevTools.BackgroundService.BackgroundServiceClient(this)); + } + + return _BackgroundService; + } + } + + private CefSharp.DevTools.BluetoothEmulation.BluetoothEmulationClient _BluetoothEmulation; + /// + /// This domain allows configuring virtual Bluetooth devices to test + /// the web-bluetooth API. + /// + public CefSharp.DevTools.BluetoothEmulation.BluetoothEmulationClient BluetoothEmulation + { + get + { + if ((_BluetoothEmulation) == (null)) + { + _BluetoothEmulation = (new CefSharp.DevTools.BluetoothEmulation.BluetoothEmulationClient(this)); + } + + return _BluetoothEmulation; + } + } + + private CefSharp.DevTools.Browser.BrowserClient _Browser; + /// + /// The Browser domain defines methods and events for browser managing. + /// + public CefSharp.DevTools.Browser.BrowserClient Browser + { + get + { + if ((_Browser) == (null)) + { + _Browser = (new CefSharp.DevTools.Browser.BrowserClient(this)); + } + + return _Browser; + } + } + + private CefSharp.DevTools.CSS.CSSClient _CSS; + /// + /// This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) + /// have an associated `id` used in subsequent operations on the related object. Each object type has + /// a specific `id` structure, and those are not interchangeable between objects of different kinds. + /// CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client + /// can also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and + /// subsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods. + /// + public CefSharp.DevTools.CSS.CSSClient CSS + { + get + { + if ((_CSS) == (null)) + { + _CSS = (new CefSharp.DevTools.CSS.CSSClient(this)); + } + + return _CSS; + } + } + + private CefSharp.DevTools.CacheStorage.CacheStorageClient _CacheStorage; + /// + /// CacheStorage + /// + public CefSharp.DevTools.CacheStorage.CacheStorageClient CacheStorage + { + get + { + if ((_CacheStorage) == (null)) + { + _CacheStorage = (new CefSharp.DevTools.CacheStorage.CacheStorageClient(this)); + } + + return _CacheStorage; + } + } + + private CefSharp.DevTools.Cast.CastClient _Cast; + /// + /// A domain for interacting with Cast, Presentation API, and Remote Playback API + /// functionalities. + /// + public CefSharp.DevTools.Cast.CastClient Cast + { + get + { + if ((_Cast) == (null)) + { + _Cast = (new CefSharp.DevTools.Cast.CastClient(this)); + } + + return _Cast; + } + } + + private CefSharp.DevTools.DOM.DOMClient _DOM; + /// + /// This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object + /// that has an `id`. This `id` can be used to get additional information on the Node, resolve it into + /// the JavaScript object wrapper, etc. It is important that client receives DOM events only for the + /// nodes that are known to the client. Backend keeps track of the nodes that were sent to the client + /// and never sends the same node twice. It is client's responsibility to collect information about + /// the nodes that were sent to the client. Note that `iframe` owner elements will return + /// corresponding document elements as their child nodes. + /// + public CefSharp.DevTools.DOM.DOMClient DOM + { + get + { + if ((_DOM) == (null)) + { + _DOM = (new CefSharp.DevTools.DOM.DOMClient(this)); + } + + return _DOM; + } + } + + private CefSharp.DevTools.DOMDebugger.DOMDebuggerClient _DOMDebugger; + /// + /// DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript + /// execution will stop on these operations as if there was a regular breakpoint set. + /// + public CefSharp.DevTools.DOMDebugger.DOMDebuggerClient DOMDebugger + { + get + { + if ((_DOMDebugger) == (null)) + { + _DOMDebugger = (new CefSharp.DevTools.DOMDebugger.DOMDebuggerClient(this)); + } + + return _DOMDebugger; + } + } + + private CefSharp.DevTools.DOMSnapshot.DOMSnapshotClient _DOMSnapshot; + /// + /// This domain facilitates obtaining document snapshots with DOM, layout, and style information. + /// + public CefSharp.DevTools.DOMSnapshot.DOMSnapshotClient DOMSnapshot + { + get + { + if ((_DOMSnapshot) == (null)) + { + _DOMSnapshot = (new CefSharp.DevTools.DOMSnapshot.DOMSnapshotClient(this)); + } + + return _DOMSnapshot; + } + } + + private CefSharp.DevTools.DOMStorage.DOMStorageClient _DOMStorage; + /// + /// Query and modify DOM storage. + /// + public CefSharp.DevTools.DOMStorage.DOMStorageClient DOMStorage + { + get + { + if ((_DOMStorage) == (null)) + { + _DOMStorage = (new CefSharp.DevTools.DOMStorage.DOMStorageClient(this)); + } + + return _DOMStorage; + } + } + + private CefSharp.DevTools.DeviceAccess.DeviceAccessClient _DeviceAccess; + /// + /// DeviceAccess + /// + public CefSharp.DevTools.DeviceAccess.DeviceAccessClient DeviceAccess + { + get + { + if ((_DeviceAccess) == (null)) + { + _DeviceAccess = (new CefSharp.DevTools.DeviceAccess.DeviceAccessClient(this)); + } + + return _DeviceAccess; + } + } + + private CefSharp.DevTools.DeviceOrientation.DeviceOrientationClient _DeviceOrientation; + /// + /// DeviceOrientation + /// + public CefSharp.DevTools.DeviceOrientation.DeviceOrientationClient DeviceOrientation + { + get + { + if ((_DeviceOrientation) == (null)) + { + _DeviceOrientation = (new CefSharp.DevTools.DeviceOrientation.DeviceOrientationClient(this)); + } + + return _DeviceOrientation; + } + } + + private CefSharp.DevTools.Emulation.EmulationClient _Emulation; + /// + /// This domain emulates different environments for the page. + /// + public CefSharp.DevTools.Emulation.EmulationClient Emulation + { + get + { + if ((_Emulation) == (null)) + { + _Emulation = (new CefSharp.DevTools.Emulation.EmulationClient(this)); + } + + return _Emulation; + } + } + + private CefSharp.DevTools.EventBreakpoints.EventBreakpointsClient _EventBreakpoints; + /// + /// EventBreakpoints permits setting JavaScript breakpoints on operations and events + /// occurring in native code invoked from JavaScript. Once breakpoint is hit, it is + /// reported through Debugger domain, similarly to regular breakpoints being hit. + /// + public CefSharp.DevTools.EventBreakpoints.EventBreakpointsClient EventBreakpoints + { + get + { + if ((_EventBreakpoints) == (null)) + { + _EventBreakpoints = (new CefSharp.DevTools.EventBreakpoints.EventBreakpointsClient(this)); + } + + return _EventBreakpoints; + } + } + + private CefSharp.DevTools.Extensions.ExtensionsClient _Extensions; + /// + /// Defines commands and events for browser extensions. + /// + public CefSharp.DevTools.Extensions.ExtensionsClient Extensions + { + get + { + if ((_Extensions) == (null)) + { + _Extensions = (new CefSharp.DevTools.Extensions.ExtensionsClient(this)); + } + + return _Extensions; + } + } + + private CefSharp.DevTools.FedCm.FedCmClient _FedCm; + /// + /// This domain allows interacting with the FedCM dialog. + /// + public CefSharp.DevTools.FedCm.FedCmClient FedCm + { + get + { + if ((_FedCm) == (null)) + { + _FedCm = (new CefSharp.DevTools.FedCm.FedCmClient(this)); + } + + return _FedCm; + } + } + + private CefSharp.DevTools.Fetch.FetchClient _Fetch; + /// + /// A domain for letting clients substitute browser's network layer with client code. + /// + public CefSharp.DevTools.Fetch.FetchClient Fetch + { + get + { + if ((_Fetch) == (null)) + { + _Fetch = (new CefSharp.DevTools.Fetch.FetchClient(this)); + } + + return _Fetch; + } + } + + private CefSharp.DevTools.FileSystem.FileSystemClient _FileSystem; + /// + /// FileSystem + /// + public CefSharp.DevTools.FileSystem.FileSystemClient FileSystem + { + get + { + if ((_FileSystem) == (null)) + { + _FileSystem = (new CefSharp.DevTools.FileSystem.FileSystemClient(this)); + } + + return _FileSystem; + } + } + + private CefSharp.DevTools.HeadlessExperimental.HeadlessExperimentalClient _HeadlessExperimental; + /// + /// This domain provides experimental commands only supported in headless mode. + /// + public CefSharp.DevTools.HeadlessExperimental.HeadlessExperimentalClient HeadlessExperimental + { + get + { + if ((_HeadlessExperimental) == (null)) + { + _HeadlessExperimental = (new CefSharp.DevTools.HeadlessExperimental.HeadlessExperimentalClient(this)); + } + + return _HeadlessExperimental; + } + } + + private CefSharp.DevTools.IO.IOClient _IO; + /// + /// Input/Output operations for streams produced by DevTools. + /// + public CefSharp.DevTools.IO.IOClient IO + { + get + { + if ((_IO) == (null)) + { + _IO = (new CefSharp.DevTools.IO.IOClient(this)); + } + + return _IO; + } + } + + private CefSharp.DevTools.IndexedDB.IndexedDBClient _IndexedDB; + /// + /// IndexedDB + /// + public CefSharp.DevTools.IndexedDB.IndexedDBClient IndexedDB + { + get + { + if ((_IndexedDB) == (null)) + { + _IndexedDB = (new CefSharp.DevTools.IndexedDB.IndexedDBClient(this)); + } + + return _IndexedDB; + } + } + + private CefSharp.DevTools.Input.InputClient _Input; + /// + /// Input + /// + public CefSharp.DevTools.Input.InputClient Input + { + get + { + if ((_Input) == (null)) + { + _Input = (new CefSharp.DevTools.Input.InputClient(this)); + } + + return _Input; + } + } + + private CefSharp.DevTools.Inspector.InspectorClient _Inspector; + /// + /// Inspector + /// + public CefSharp.DevTools.Inspector.InspectorClient Inspector + { + get + { + if ((_Inspector) == (null)) + { + _Inspector = (new CefSharp.DevTools.Inspector.InspectorClient(this)); + } + + return _Inspector; + } + } + + private CefSharp.DevTools.LayerTree.LayerTreeClient _LayerTree; + /// + /// LayerTree + /// + public CefSharp.DevTools.LayerTree.LayerTreeClient LayerTree + { + get + { + if ((_LayerTree) == (null)) + { + _LayerTree = (new CefSharp.DevTools.LayerTree.LayerTreeClient(this)); + } + + return _LayerTree; + } + } + + private CefSharp.DevTools.Log.LogClient _Log; + /// + /// Provides access to log entries. + /// + public CefSharp.DevTools.Log.LogClient Log + { + get + { + if ((_Log) == (null)) + { + _Log = (new CefSharp.DevTools.Log.LogClient(this)); + } + + return _Log; + } + } + + private CefSharp.DevTools.Media.MediaClient _Media; + /// + /// This domain allows detailed inspection of media elements. + /// + public CefSharp.DevTools.Media.MediaClient Media + { + get + { + if ((_Media) == (null)) + { + _Media = (new CefSharp.DevTools.Media.MediaClient(this)); + } + + return _Media; + } + } + + private CefSharp.DevTools.Memory.MemoryClient _Memory; + /// + /// Memory + /// + public CefSharp.DevTools.Memory.MemoryClient Memory + { + get + { + if ((_Memory) == (null)) + { + _Memory = (new CefSharp.DevTools.Memory.MemoryClient(this)); + } + + return _Memory; + } + } + + private CefSharp.DevTools.Network.NetworkClient _Network; + /// + /// Network domain allows tracking network activities of the page. It exposes information about http, + /// file, data and other requests and responses, their headers, bodies, timing, etc. + /// + public CefSharp.DevTools.Network.NetworkClient Network + { + get + { + if ((_Network) == (null)) + { + _Network = (new CefSharp.DevTools.Network.NetworkClient(this)); + } + + return _Network; + } + } + + private CefSharp.DevTools.Overlay.OverlayClient _Overlay; + /// + /// This domain provides various functionality related to drawing atop the inspected page. + /// + public CefSharp.DevTools.Overlay.OverlayClient Overlay + { + get + { + if ((_Overlay) == (null)) + { + _Overlay = (new CefSharp.DevTools.Overlay.OverlayClient(this)); + } + + return _Overlay; + } + } + + private CefSharp.DevTools.PWA.PWAClient _PWA; + /// + /// This domain allows interacting with the browser to control PWAs. + /// + public CefSharp.DevTools.PWA.PWAClient PWA + { + get + { + if ((_PWA) == (null)) + { + _PWA = (new CefSharp.DevTools.PWA.PWAClient(this)); + } + + return _PWA; + } + } + + private CefSharp.DevTools.Page.PageClient _Page; + /// + /// Actions and events related to the inspected page belong to the page domain. + /// + public CefSharp.DevTools.Page.PageClient Page + { + get + { + if ((_Page) == (null)) + { + _Page = (new CefSharp.DevTools.Page.PageClient(this)); + } + + return _Page; + } + } + + private CefSharp.DevTools.Performance.PerformanceClient _Performance; + /// + /// Performance + /// + public CefSharp.DevTools.Performance.PerformanceClient Performance + { + get + { + if ((_Performance) == (null)) + { + _Performance = (new CefSharp.DevTools.Performance.PerformanceClient(this)); + } + + return _Performance; + } + } + + private CefSharp.DevTools.PerformanceTimeline.PerformanceTimelineClient _PerformanceTimeline; + /// + /// Reporting of performance timeline events, as specified in + /// https://w3c.github.io/performance-timeline/#dom-performanceobserver. + /// + public CefSharp.DevTools.PerformanceTimeline.PerformanceTimelineClient PerformanceTimeline + { + get + { + if ((_PerformanceTimeline) == (null)) + { + _PerformanceTimeline = (new CefSharp.DevTools.PerformanceTimeline.PerformanceTimelineClient(this)); + } + + return _PerformanceTimeline; + } + } + + private CefSharp.DevTools.Preload.PreloadClient _Preload; + /// + /// Preload + /// + public CefSharp.DevTools.Preload.PreloadClient Preload + { + get + { + if ((_Preload) == (null)) + { + _Preload = (new CefSharp.DevTools.Preload.PreloadClient(this)); + } + + return _Preload; + } + } + + private CefSharp.DevTools.Security.SecurityClient _Security; + /// + /// Security + /// + public CefSharp.DevTools.Security.SecurityClient Security + { + get + { + if ((_Security) == (null)) + { + _Security = (new CefSharp.DevTools.Security.SecurityClient(this)); + } + + return _Security; + } + } + + private CefSharp.DevTools.ServiceWorker.ServiceWorkerClient _ServiceWorker; + /// + /// ServiceWorker + /// + public CefSharp.DevTools.ServiceWorker.ServiceWorkerClient ServiceWorker + { + get + { + if ((_ServiceWorker) == (null)) + { + _ServiceWorker = (new CefSharp.DevTools.ServiceWorker.ServiceWorkerClient(this)); + } + + return _ServiceWorker; + } + } + + private CefSharp.DevTools.SmartCardEmulation.SmartCardEmulationClient _SmartCardEmulation; + /// + /// SmartCardEmulation + /// + public CefSharp.DevTools.SmartCardEmulation.SmartCardEmulationClient SmartCardEmulation + { + get + { + if ((_SmartCardEmulation) == (null)) + { + _SmartCardEmulation = (new CefSharp.DevTools.SmartCardEmulation.SmartCardEmulationClient(this)); + } + + return _SmartCardEmulation; + } + } + + private CefSharp.DevTools.Storage.StorageClient _Storage; + /// + /// Storage + /// + public CefSharp.DevTools.Storage.StorageClient Storage + { + get + { + if ((_Storage) == (null)) + { + _Storage = (new CefSharp.DevTools.Storage.StorageClient(this)); + } + + return _Storage; + } + } + + private CefSharp.DevTools.SystemInfo.SystemInfoClient _SystemInfo; + /// + /// The SystemInfo domain defines methods and events for querying low-level system information. + /// + public CefSharp.DevTools.SystemInfo.SystemInfoClient SystemInfo + { + get + { + if ((_SystemInfo) == (null)) + { + _SystemInfo = (new CefSharp.DevTools.SystemInfo.SystemInfoClient(this)); + } + + return _SystemInfo; + } + } + + private CefSharp.DevTools.Target.TargetClient _Target; + /// + /// Supports additional targets discovery and allows to attach to them. + /// + public CefSharp.DevTools.Target.TargetClient Target + { + get + { + if ((_Target) == (null)) + { + _Target = (new CefSharp.DevTools.Target.TargetClient(this)); + } + + return _Target; + } + } + + private CefSharp.DevTools.Tethering.TetheringClient _Tethering; + /// + /// The Tethering domain defines methods and events for browser port binding. + /// + public CefSharp.DevTools.Tethering.TetheringClient Tethering + { + get + { + if ((_Tethering) == (null)) + { + _Tethering = (new CefSharp.DevTools.Tethering.TetheringClient(this)); + } + + return _Tethering; + } + } + + private CefSharp.DevTools.Tracing.TracingClient _Tracing; + /// + /// Tracing + /// + public CefSharp.DevTools.Tracing.TracingClient Tracing + { + get + { + if ((_Tracing) == (null)) + { + _Tracing = (new CefSharp.DevTools.Tracing.TracingClient(this)); + } + + return _Tracing; + } + } + + private CefSharp.DevTools.WebAudio.WebAudioClient _WebAudio; + /// + /// This domain allows inspection of Web Audio API. + /// https://webaudio.github.io/web-audio-api/ + /// + public CefSharp.DevTools.WebAudio.WebAudioClient WebAudio + { + get + { + if ((_WebAudio) == (null)) + { + _WebAudio = (new CefSharp.DevTools.WebAudio.WebAudioClient(this)); + } + + return _WebAudio; + } + } + + private CefSharp.DevTools.WebAuthn.WebAuthnClient _WebAuthn; + /// + /// This domain allows configuring virtual authenticators to test the WebAuthn + /// API. + /// + public CefSharp.DevTools.WebAuthn.WebAuthnClient WebAuthn + { + get + { + if ((_WebAuthn) == (null)) + { + _WebAuthn = (new CefSharp.DevTools.WebAuthn.WebAuthnClient(this)); + } + + return _WebAuthn; + } + } + + private CefSharp.DevTools.Debugger.DebuggerClient _Debugger; + /// + /// Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing + /// breakpoints, stepping through execution, exploring stack traces, etc. + /// + public CefSharp.DevTools.Debugger.DebuggerClient Debugger + { + get + { + if ((_Debugger) == (null)) + { + _Debugger = (new CefSharp.DevTools.Debugger.DebuggerClient(this)); + } + + return _Debugger; + } + } + + private CefSharp.DevTools.HeapProfiler.HeapProfilerClient _HeapProfiler; + /// + /// HeapProfiler + /// + public CefSharp.DevTools.HeapProfiler.HeapProfilerClient HeapProfiler + { + get + { + if ((_HeapProfiler) == (null)) + { + _HeapProfiler = (new CefSharp.DevTools.HeapProfiler.HeapProfilerClient(this)); + } + + return _HeapProfiler; + } + } + + private CefSharp.DevTools.Profiler.ProfilerClient _Profiler; + /// + /// Profiler + /// + public CefSharp.DevTools.Profiler.ProfilerClient Profiler + { + get + { + if ((_Profiler) == (null)) + { + _Profiler = (new CefSharp.DevTools.Profiler.ProfilerClient(this)); + } + + return _Profiler; + } + } + + private CefSharp.DevTools.Runtime.RuntimeClient _Runtime; + /// + /// Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. + /// Evaluation results are returned as mirror object that expose object type, string representation + /// and unique identifier that can be used for further object reference. Original objects are + /// maintained in memory unless they are either explicitly released or are released along with the + /// other objects in their object group. + /// + public CefSharp.DevTools.Runtime.RuntimeClient Runtime + { + get + { + if ((_Runtime) == (null)) + { + _Runtime = (new CefSharp.DevTools.Runtime.RuntimeClient(this)); + } + + return _Runtime; + } + } + } +} \ No newline at end of file diff --git a/CefSharp.Core/DevTools/DevToolsClient.Partial.cs b/CefSharp.Core/DevTools/DevToolsClient.Partial.cs new file mode 100644 index 0000000000..6a0f6266b7 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsClient.Partial.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CefSharp.DevTools.Page +{ + public partial class Viewport + { + /// + /// Default Constructor + /// + public Viewport() + { + Scale = 1.0; + } + } +} + +namespace CefSharp.DevTools.Network +{ + public partial class NetworkClient + { + /// + /// Fetches the resource and returns the content. + /// + /// Frame id to get the resource for. Mandatory for frame targets, and should be omitted for worker targets. + /// URL of the resource to get content for. + /// Options for the request. + /// returns System.Threading.Tasks.Task<LoadNetworkResourceResponse> + /// + /// This overload of LoadNetworkResourceAsync exists to avoid a breaking change as optional params are now always at the end + /// where previously they weren't marked as optional when at the beginning. + /// + public System.Threading.Tasks.Task LoadNetworkResourceAsync(string frameId, string url, CefSharp.DevTools.Network.LoadNetworkResourceOptions options) + { + var dict = new System.Collections.Generic.Dictionary(); + if (!(string.IsNullOrEmpty(frameId))) + { + dict.Add("frameId", frameId); + } + + dict.Add("url", url); + dict.Add("options", options.ToDictionary()); + return _client.ExecuteDevToolsMethodAsync("Network.loadNetworkResource", dict); + } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsClient.cs b/CefSharp.Core/DevTools/DevToolsClient.cs new file mode 100644 index 0000000000..22a742d7de --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsClient.cs @@ -0,0 +1,412 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using CefSharp.Callback; +using CefSharp.Internals; + +namespace CefSharp.DevTools +{ + /// + /// DevTool Client + /// + public partial class DevToolsClient : IDevToolsMessageObserver, IDevToolsClient + { + private readonly ConcurrentDictionary queuedCommandResults = new ConcurrentDictionary(); + private readonly ConcurrentDictionary eventHandlers = new ConcurrentDictionary(); + private IBrowser browser; + private IRegistration devToolsRegistration; + private bool devToolsAttached; + private SynchronizationContext syncContext; + private int disposeCount; + + /// + public event EventHandler DevToolsEvent; + + /// + public event EventHandler DevToolsEventError; + + /// + /// Capture the current so + /// continuation executes on the original calling thread. If + /// is null for + /// + /// then the continuation will be run on the CEF UI Thread (by default + /// this is not the same as the WPF/WinForms UI Thread). + /// + public bool CaptureSyncContext { get; set; } + + /// + /// When not null provided + /// will be used to run the contination. Defaults to null + /// Setting this property will change + /// to false. + /// + public SynchronizationContext SyncContext + { + get { return syncContext; } + set + { + CaptureSyncContext = false; + syncContext = value; + } + } + + /// + /// DevToolsClient + /// + /// Browser associated with this DevTools client + public DevToolsClient(IBrowser browser) + { + this.browser = browser; + + CaptureSyncContext = true; + } + + /// + /// Store a reference to the IRegistration that's returned when + /// you register an observer. + /// + /// registration + public void SetDevToolsObserverRegistration(IRegistration devToolsRegistration) + { + this.devToolsRegistration = devToolsRegistration; + } + + /// + public void AddEventHandler(string eventName, EventHandler eventHandler) where T : EventArgs + { + var eventProxy = eventHandlers.GetOrAdd(eventName, _ => new EventProxy(DeserializeJsonEvent)); + + var p = (EventProxy)eventProxy; + + p.AddHandler(eventHandler); + } + + /// + public bool RemoveEventHandler(string eventName, EventHandler eventHandler) where T : EventArgs + { + if (eventHandlers.TryGetValue(eventName, out IEventProxy eventProxy)) + { + var p = ((EventProxy)eventProxy); + + if (p.RemoveHandler(eventHandler)) + { + return !eventHandlers.TryRemove(eventName, out _); + } + } + + return true; + } + + /// + /// Execute a method call over the DevTools protocol. This method can be called on any thread. + /// See the DevTools protocol documentation at https://chromedevtools.github.io/devtools-protocol/ for details + /// of supported methods and the expected dictionary contents. + /// + /// is the method name + /// are the method parameters represented as a dictionary, + /// which may be empty. + /// return a Task that can be awaited to obtain the method result + public Task ExecuteDevToolsMethodAsync(string method, IDictionary parameters = null) + { + return ExecuteDevToolsMethodAsync(method, parameters); + } + + /// + /// Execute a method call over the DevTools protocol. This method can be called on any thread. + /// See the DevTools protocol documentation at https://chromedevtools.github.io/devtools-protocol/ for details + /// of supported methods and the expected dictionary contents. + /// + /// The type into which the result will be deserialzed. + /// is the method name + /// are the method parameters represented as a dictionary, + /// which may be empty. + /// return a Task that can be awaited to obtain the method result + public Task ExecuteDevToolsMethodAsync(string method, IDictionary parameters = null) where T : DevToolsDomainResponseBase + { + if (browser == null || browser.IsDisposed) + { + //TODO: Queue up commands where possible + throw new ObjectDisposedException(nameof(IBrowser)); + } + + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + var methodResultContext = new DevToolsMethodResponseContext( + type: typeof(T), + setResult: o => taskCompletionSource.TrySetResult((T)o), + setException: taskCompletionSource.TrySetException, + syncContext: CaptureSyncContext ? SynchronizationContext.Current : SyncContext + ); + + var browserHost = browser.GetHost(); + + var messageId = browserHost.GetNextDevToolsMessageId(); + + if (!queuedCommandResults.TryAdd(messageId, methodResultContext)) + { + throw new DevToolsClientException(string.Format("Unable to add MessageId {0} to queuedCommandResults ConcurrentDictionary.", messageId)); + } + + //Currently on CEF UI Thread we can directly execute + if (CefThread.CurrentlyOnUiThread) + { + ExecuteDevToolsMethod(browserHost, messageId, method, parameters, methodResultContext); + } + //ExecuteDevToolsMethod can only be called on the CEF UI Thread + else if (CefThread.CanExecuteOnUiThread) + { + CefThread.ExecuteOnUiThread(() => + { + ExecuteDevToolsMethod(browserHost, messageId, method, parameters, methodResultContext); + }); + } + else + { + queuedCommandResults.TryRemove(messageId, out methodResultContext); + throw new DevToolsClientException("Unable to invoke ExecuteDevToolsMethod on CEF UI Thread."); + } + + return taskCompletionSource.Task; + } + + private void ExecuteDevToolsMethod(IBrowserHost browserHost, int messageId, string method, IDictionary parameters, DevToolsMethodResponseContext methodResultContext) + { + try + { + var returnedMessageId = browserHost.ExecuteDevToolsMethod(messageId, method, parameters); + if (returnedMessageId == 0) + { + throw new DevToolsClientException(string.Format("Failed to execute dev tools method {0}.", method)); + } + else if (returnedMessageId != messageId) + { + //For some reason our message Id's don't match + throw new DevToolsClientException(string.Format("Generated MessageId {0} doesn't match returned Message Id {1}", returnedMessageId, messageId)); + } + } + catch (Exception ex) + { + queuedCommandResults.TryRemove(messageId, out _); + methodResultContext.SetException(ex); + } + } + + /// + public void Dispose() + { + //Dispose can be called from different Threads + //CEF maintains a reference and the user + //maintains a reference, we in a rare case + //we end up disposing of #3725 twice from different + //threads. This will ensure our dispose only runs once. + if (Interlocked.Increment(ref disposeCount) == 1) + { + DevToolsEvent = null; + devToolsRegistration?.Dispose(); + devToolsRegistration = null; + browser = null; + + var events = eventHandlers.Values; + eventHandlers.Clear(); + + foreach (var evt in events) + { + evt.Dispose(); + } + } + } + + /// + void IDevToolsMessageObserver.OnDevToolsAgentAttached(IBrowser browser) + { + devToolsAttached = true; + } + + /// + void IDevToolsMessageObserver.OnDevToolsAgentDetached(IBrowser browser) + { + devToolsAttached = false; + } + + /// + void IDevToolsMessageObserver.OnDevToolsEvent(IBrowser browser, string method, Stream parameters) + { + try + { + var evt = DevToolsEvent; + + //Only parse the data if we have an event handler + if (evt != null) + { + var paramsAsJsonString = StreamToString(parameters, leaveOpen: true); + + evt(this, new DevToolsEventArgs(method, paramsAsJsonString)); + } + + if (eventHandlers.TryGetValue(method, out IEventProxy eventProxy)) + { + eventProxy.Raise(this, method, parameters, SyncContext); + } + } + catch (Exception ex) + { + var errorEvent = DevToolsEventError; + + var json = ""; + + if (parameters.Length > 0) + { + parameters.Position = 0; + + try + { + json = StreamToString(parameters, leaveOpen: false); + } + catch (Exception) + { + //TODO: do we somehow pass this exception to the user? + } + } + + var args = new DevToolsErrorEventArgs(method, json, ex); + + errorEvent?.Invoke(this, args); + } + } + + /// + bool IDevToolsMessageObserver.OnDevToolsMessage(IBrowser browser, Stream message) + { + return false; + } + + /// + void IDevToolsMessageObserver.OnDevToolsMethodResult(IBrowser browser, int messageId, bool success, Stream result) + { + DevToolsMethodResponseContext context; + if (queuedCommandResults.TryRemove(messageId, out context)) + { + if (success) + { + if (context.Type == typeof(DevToolsMethodResponse) || context.Type == typeof(DevToolsDomainResponseBase)) + { + context.SetResult(new DevToolsMethodResponse + { + Success = success, + MessageId = messageId, + ResponseAsJsonString = StreamToString(result), + }); + } + else + { + try + { + context.SetResult(DeserializeJson(context.Type, result)); + } + catch (Exception ex) + { + context.SetException(ex); + } + } + } + else + { + var errorObj = DeserializeJson(result); + errorObj.MessageId = messageId; + + context.SetException(new DevToolsClientException("DevTools Client Error :" + errorObj.Message, errorObj)); + } + } + } + + + /// + /// Deserialize the JSON stream into a .Net object. + /// For .Net 6.0 uses System.Text.Json + /// for .Net 4.6.2 uses System.Runtime.Serialization.Json + /// + /// Object type + /// event Name + /// JSON stream + /// object of type + private static T DeserializeJsonEvent(string eventName, Stream stream) where T : EventArgs + { + if (typeof(T) == typeof(EventArgs)) + { + return (T)EventArgs.Empty; + } + + if (typeof(T) == typeof(DevToolsEventArgs)) + { + var paramsAsJsonString = StreamToString(stream, leaveOpen: true); + var args = new DevToolsEventArgs(eventName, paramsAsJsonString); + + return (T)(object)args; + } + + return (T)DeserializeJson(typeof(T), stream); + } + + /// + /// Deserialize the JSON stream into a .Net object. + /// For .Net 6.0 uses System.Text.Json + /// for .Net 4.6.2 uses System.Runtime.Serialization.Json + /// + /// Object type + /// JSON stream + /// object of type + private static T DeserializeJson(Stream stream) + { + return (T)DeserializeJson(typeof(T), stream); + } + +#if NETCOREAPP + private static readonly System.Text.Json.JsonSerializerOptions DefaultJsonSerializerOptions = new System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = { new CefSharp.Internals.Json.JsonEnumConverterFactory() }, + }; +#else + private static readonly System.Runtime.Serialization.Json.DataContractJsonSerializerSettings DefaultJsonSerializerSettings = new System.Runtime.Serialization.Json.DataContractJsonSerializerSettings + { + UseSimpleDictionaryFormat = true, + }; +#endif + + /// + /// Deserialize the JSON stream into a .Net object. + /// For .Net 6.0 uses System.Text.Json + /// for .Net 4.6.2 uses System.Runtime.Serialization.Json + /// + /// Object type + /// JSON stream + /// object of type + private static object DeserializeJson(Type type, Stream stream) + { +#if NETCOREAPP + return System.Text.Json.JsonSerializer.Deserialize(stream, type, DefaultJsonSerializerOptions); +#else + var dcs = new System.Runtime.Serialization.Json.DataContractJsonSerializer(type, DefaultJsonSerializerSettings); + return dcs.ReadObject(stream); +#endif + } + + private static string StreamToString(Stream stream, bool leaveOpen = false) + { + using (var streamReader = new StreamReader(stream, Encoding.UTF8, detectEncodingFromByteOrderMarks: false, bufferSize: 1024, leaveOpen: leaveOpen)) + { + return streamReader.ReadToEnd(); + } + } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsClientException.cs b/CefSharp.Core/DevTools/DevToolsClientException.cs new file mode 100644 index 0000000000..27e6e63160 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsClientException.cs @@ -0,0 +1,66 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Runtime.Serialization; + +namespace CefSharp.DevTools +{ + /// + /// The exception that is thrown when there's a problem executing a DevTools protocol method. + /// + [Serializable] + public class DevToolsClientException : Exception + { + /// + /// Get the Error Response + /// + public DevToolsDomainErrorResponse Response + { + get; private set; + } + + /// + /// Initializes a new instance of the class with its message + /// string set to a default message. + /// + public DevToolsClientException() : base("Error occurred whilst executing DevTools protocol method") + { + } + + /// + /// Initializes a new instance of the class with a specified error message. + /// + /// message + public DevToolsClientException(string message) : base(message) + { + } + + /// + /// Initializes a new instance of the class with a specified error message. + /// + /// message + /// error response + public DevToolsClientException(string message, DevToolsDomainErrorResponse errorResponse) : base(message) + { + Response = errorResponse; + } + + /// + /// Initializes a new instance of the class with a specified error message + /// and an inner exception. + /// + /// message + /// inner exception + public DevToolsClientException(string message, Exception inner) : base(message, inner) + { + } + + /// + protected DevToolsClientException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) + { + + } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsDomainBase.cs b/CefSharp.Core/DevTools/DevToolsDomainBase.cs new file mode 100644 index 0000000000..0e13c7a897 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsDomainBase.cs @@ -0,0 +1,147 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + + +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using CefSharp.DevTools.Browser; +using CefSharp.DevTools.Network; + +namespace CefSharp.DevTools +{ + /// + /// DevTools Domain base class + /// Provides some basic helper methods + /// + public abstract class DevToolsDomainBase + { +#if NETCOREAPP + /// + /// Convert Enum to String + /// + /// enum + /// string + protected string EnumToString(Enum val) + { + return Internals.Json.JsonEnumConverterFactory.ConvertEnumToString(val); + } + + /// + /// Enum to string + /// + /// array of type + /// enumerable string + protected IEnumerable EnumToString(CefSharp.DevTools.Network.ContentEncoding[] values) + { + foreach (var val in values) + { + yield return Internals.Json.JsonEnumConverterFactory.ConvertEnumToString(val); + } + } + + /// + /// Enum to string + /// + /// array of type + /// enumerable string + protected IEnumerable EnumToString(CefSharp.DevTools.Emulation.DisabledImageType[] values) + { + foreach (var val in values) + { + yield return Internals.Json.JsonEnumConverterFactory.ConvertEnumToString(val); + } + } + + /// + /// Enum to string + /// + /// array of type + /// enumerable string + protected IEnumerable EnumToString(PermissionType[] values) + { + foreach (var val in values) + { + yield return Internals.Json.JsonEnumConverterFactory.ConvertEnumToString(val); + } + } + + /// + /// Enum to string + /// + /// array of type + /// enumerable string + protected IEnumerable EnumToString(CefSharp.DevTools.DOMDebugger.CSPViolationType[] values) + { + foreach (var val in values) + { + yield return Internals.Json.JsonEnumConverterFactory.ConvertEnumToString(val); + } + } +#else + protected string EnumToString(Enum val) + { + var memInfo = val.GetType().GetMember(val.ToString()); + var dataMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memInfo[0], typeof(EnumMemberAttribute), false); + + return dataMemberAttribute.Value; + } + + //TODO: Create a generic function that converts enum array to string + protected IEnumerable EnumToString(ContentEncoding[] values) + { + foreach (var val in values) + { + var memInfo = val.GetType().GetMember(val.ToString()); + var dataMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memInfo[0], typeof(EnumMemberAttribute), false); + + yield return dataMemberAttribute.Value; + } + } + + protected IEnumerable EnumToString(Browser.PermissionType[] values) + { + foreach (var val in values) + { + var memInfo = val.GetType().GetMember(val.ToString()); + var dataMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memInfo[0], typeof(EnumMemberAttribute), false); + + yield return dataMemberAttribute.Value; + } + } + + protected IEnumerable EnumToString(CefSharp.DevTools.Emulation.DisabledImageType[] values) + { + foreach (var val in values) + { + var memInfo = val.GetType().GetMember(val.ToString()); + var dataMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memInfo[0], typeof(EnumMemberAttribute), false); + + yield return dataMemberAttribute.Value; + } + } + + protected IEnumerable EnumToString(CefSharp.DevTools.DOMDebugger.CSPViolationType[] values) + { + foreach (var val in values) + { + var memInfo = val.GetType().GetMember(val.ToString()); + var dataMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memInfo[0], typeof(EnumMemberAttribute), false); + + yield return dataMemberAttribute.Value; + } + } +#endif + + protected string ToBase64String(byte[] bytes) + { + return Convert.ToBase64String(bytes); + } + + protected string ToBase64String(byte[][] bytes) + { + throw new NotImplementedException("Not currently supported."); + } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsDomainEntityBase.cs b/CefSharp.Core/DevTools/DevToolsDomainEntityBase.cs new file mode 100644 index 0000000000..a6d1a1099b --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsDomainEntityBase.cs @@ -0,0 +1,256 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.Serialization; + +namespace CefSharp.DevTools +{ + /// + /// Common Base class for DevTools Domain Model classes + /// + [DataContract] + public abstract class DevToolsDomainEntityBase + { +#if NETCOREAPP + internal static string EnumToString(Enum e) + { + var memberInfo = e.GetType().GetMember(e.ToString()).FirstOrDefault(); + + var enumMemberAttribute = (System.Text.Json.Serialization.JsonPropertyNameAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), false); + + return enumMemberAttribute.Name; + } + + internal static string EnumToString(Array enumArray) + { + var returnValue = "["; + + foreach (var e in enumArray) + { + var memberInfo = e.GetType().GetMember(e.ToString()).FirstOrDefault(); + + var enumMemberAttribute = (System.Text.Json.Serialization.JsonPropertyNameAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), false); + + returnValue += enumMemberAttribute.Name + ","; + } + + returnValue += returnValue.Substring(0, returnValue.Length - 1) + "]"; + + return returnValue; + } +#else + internal static object StringToEnum(Type enumType, string input) + { + if (enumType.IsArray) + { + if (string.IsNullOrEmpty(input) || input == "[]" || input == "[ ]") + { + return null; + //return Array.CreateInstance(enumType.GetElementType(), 0); + } + + var values = input.Substring(1, input.Length - 2).Split(','); + + var returnValues = Array.CreateInstance(enumType.GetElementType(), values.Length); + + for (int i = 0; i < values.Length; i++) + { + var str = values[i].Trim('\r', '\n', '"', ' '); + + var enumVal = StringToEnumInternal(enumType.GetElementType(), str); + + returnValues.SetValue(enumVal, i); + } + + return returnValues; + } + + if (enumType.IsGenericType && enumType.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + if (string.IsNullOrEmpty(input)) + { + return null; + } + + enumType = Nullable.GetUnderlyingType(enumType); + } + + return StringToEnumInternal(enumType, input); + } + + private static object StringToEnumInternal(Type enumType, string input) + { + foreach (var name in Enum.GetNames(enumType)) + { + var enumMemberAttribute = ((EnumMemberAttribute[])enumType.GetField(name).GetCustomAttributes(typeof(EnumMemberAttribute), true)).Single(); + if (enumMemberAttribute.Value == input) + { + return Enum.Parse(enumType, name); + } + } + + return (Enum.GetValues(enumType).GetValue(0)); + } + + internal static string EnumToString(Enum e) + { + var memberInfo = e.GetType().GetMember(e.ToString()).FirstOrDefault(); + + var enumMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(EnumMemberAttribute), false); + + return enumMemberAttribute.Value; + } + + internal static string EnumToString(Array enumArray) + { + var returnValue = "["; + + foreach (var e in enumArray) + { + var memberInfo = e.GetType().GetMember(e.ToString()).FirstOrDefault(); + + var enumMemberAttribute = (EnumMemberAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(EnumMemberAttribute), false); + + returnValue += enumMemberAttribute.Value + ","; + } + + returnValue += returnValue.Substring(0, returnValue.Length - 1) + "]"; + + return returnValue; + } +#endif + + + +#if NETCOREAPP + public IDictionary ToDictionary() + { + var dict = new Dictionary(); + + var properties = GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); + + foreach (var prop in properties) + { + var propertyAttribute = (System.Text.Json.Serialization.JsonPropertyNameAttribute)Attribute.GetCustomAttribute(prop, typeof(System.Text.Json.Serialization.JsonPropertyNameAttribute), false); + + //Only add members that have JsonPropertyNameAttribute + if (propertyAttribute == null) + { + continue; + } + + var propertyName = propertyAttribute.Name; + var propertyRequired = Attribute.IsDefined(prop, typeof(System.Diagnostics.CodeAnalysis.DisallowNullAttribute)); + + var propertyValue = prop.GetValue(this); + + if (propertyRequired && propertyValue == null) + { + throw new DevToolsClientException(prop.Name + " is required"); + } + + //Not required and value null, don't add to dictionary + if (propertyValue == null) + { + continue; + } + + var propertyValueType = propertyValue.GetType(); + + if (typeof(DevToolsDomainEntityBase).IsAssignableFrom(propertyValueType)) + { + propertyValue = ((DevToolsDomainEntityBase)(propertyValue)).ToDictionary(); + } + else if (prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition() == typeof(IList<>) && typeof(DevToolsDomainEntityBase).IsAssignableFrom(prop.PropertyType.GetGenericArguments()[0])) + { + var values = new List>(); + foreach (var value in (IEnumerable)propertyValue) + { + values.Add(((DevToolsDomainEntityBase)value).ToDictionary()); + } + propertyValue = values; + } + else if (propertyValueType.IsEnum) + { + propertyValue = EnumToString((Enum)propertyValue); + } + else if (propertyValueType.IsGenericType) + { + var nullableType = Nullable.GetUnderlyingType(propertyValueType); + if(nullableType != null && nullableType.IsEnum) + { + propertyValue = EnumToString((Enum)propertyValue); + } + } + else if (propertyValueType.IsArray && propertyValueType.GetElementType().IsEnum) + { + propertyValue = EnumToString((Array)propertyValue); + } + + dict.Add(propertyName, propertyValue); + } + + return dict; + } +#else + public IDictionary ToDictionary() + { + var dict = new Dictionary(); + + var properties = GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + + foreach (var prop in properties) + { + var dataMemberAttribute = (DataMemberAttribute)Attribute.GetCustomAttribute(prop, typeof(DataMemberAttribute), false); + + //Only add members that have DataMemberAttribute + if (dataMemberAttribute == null) + { + continue; + } + + var propertyName = dataMemberAttribute.Name; + var propertyRequired = dataMemberAttribute.IsRequired; + var propertyValue = prop.GetValue(this); + + if (propertyRequired && propertyValue == null) + { + throw new DevToolsClientException(prop.Name + " is required"); + } + + //Not required and value null, don't add to dictionary + if (propertyValue == null) + { + continue; + } + + var propertyValueType = propertyValue.GetType(); + + if (typeof(DevToolsDomainEntityBase).IsAssignableFrom(propertyValueType)) + { + propertyValue = ((DevToolsDomainEntityBase)(propertyValue)).ToDictionary(); + } + else if (prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition() == typeof(IList<>) && typeof(DevToolsDomainEntityBase).IsAssignableFrom(prop.PropertyType.GetGenericArguments()[0])) + { + var values = new List>(); + foreach (var value in (IEnumerable)propertyValue) + { + values.Add(((DevToolsDomainEntityBase)value).ToDictionary()); + } + propertyValue = values; + } + + dict.Add(propertyName, propertyValue); + } + + return dict; + } +#endif + } +} diff --git a/CefSharp.Core/DevTools/DevToolsDomainErrorResponse.cs b/CefSharp.Core/DevTools/DevToolsDomainErrorResponse.cs new file mode 100644 index 0000000000..e7c28a2669 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsDomainErrorResponse.cs @@ -0,0 +1,42 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Runtime.Serialization; + +namespace CefSharp.DevTools +{ + /// + /// Error Message parsed from JSON + /// e.g. {"code":-32601,"message":"'Browser.getWindowForTarget' wasn't found"} + /// + [DataContract] + public class DevToolsDomainErrorResponse + { + /// + /// Message Id + /// + [IgnoreDataMember] + public int MessageId { get; set; } + + /// + /// Error Code + /// + [DataMember(Name = "code", IsRequired = true)] + public int Code + { + get; + set; + } + + /// + /// Error Message + /// + [DataMember(Name = "message", IsRequired = true)] + public string Message + { + get; + set; + } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsDomainEventArgsBase.cs b/CefSharp.Core/DevTools/DevToolsDomainEventArgsBase.cs new file mode 100644 index 0000000000..246fe3c078 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsDomainEventArgsBase.cs @@ -0,0 +1,28 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Runtime.Serialization; + +namespace CefSharp.DevTools +{ + /// + /// DevToolsDomainEventArgsBase + /// + [DataContract] + public abstract class DevToolsDomainEventArgsBase : EventArgs + { +#if !NETCOREAPP + public static object StringToEnum(Type enumType, string input) + { + return DevToolsDomainEntityBase.StringToEnum(enumType, input); + } + + public static string EnumToString(Enum e) + { + return DevToolsDomainEntityBase.EnumToString(e); + } +#endif + } +} diff --git a/CefSharp.Core/DevTools/DevToolsDomainResponseBase.cs b/CefSharp.Core/DevTools/DevToolsDomainResponseBase.cs new file mode 100644 index 0000000000..d9957d60f8 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsDomainResponseBase.cs @@ -0,0 +1,23 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.DevTools +{ + /// + /// DevToolsDomainResponseBase + /// + [System.Runtime.Serialization.DataContractAttribute] + public abstract class DevToolsDomainResponseBase + { + /// + /// Convert from string to base64 byte array + /// + /// string data + /// byte array + public byte[] Convert(string data) + { + return System.Convert.FromBase64String(data); + } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsErrorEventArgs.cs b/CefSharp.Core/DevTools/DevToolsErrorEventArgs.cs new file mode 100644 index 0000000000..a493b044ac --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsErrorEventArgs.cs @@ -0,0 +1,43 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; + +namespace CefSharp.DevTools +{ + /// + /// DevToolsErrorEventArgs - Raised when an exception occurs when + /// attempting to raise + /// + public class DevToolsErrorEventArgs : EventArgs + { + /// + /// Event Name + /// + public string EventName { get; private set; } + + /// + /// Json + /// + public string Json { get; private set; } + + /// + /// Exception + /// + public Exception Exception { get; private set; } + + /// + /// DevToolsErrorEventArgs + /// + /// Event Name + /// json + /// Exception + public DevToolsErrorEventArgs(string eventName, string json, Exception ex) + { + EventName = eventName; + Json = json; + Exception = ex; + } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsEventArgs.cs b/CefSharp.Core/DevTools/DevToolsEventArgs.cs new file mode 100644 index 0000000000..918a84ac30 --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsEventArgs.cs @@ -0,0 +1,28 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.DevTools +{ + /// + /// DevTools Event EventAargs + /// + public class DevToolsEventArgs : DevToolsDomainEventArgsBase + { + /// + /// Event Name + /// + public string EventName { get; private set; } + + /// + /// Event paramaters as Json string + /// + public string ParametersAsJsonString { get; private set; } + + public DevToolsEventArgs(string eventName, string paramsAsJsonString) + { + EventName = eventName; + ParametersAsJsonString = paramsAsJsonString; + } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsMethodResponse.cs b/CefSharp.Core/DevTools/DevToolsMethodResponse.cs new file mode 100644 index 0000000000..3c8c328a0a --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsMethodResponse.cs @@ -0,0 +1,27 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.DevTools +{ + /// + /// DevTools Method Response + /// + public class DevToolsMethodResponse : DevToolsDomainResponseBase + { + /// + /// MessageId + /// + public int MessageId { get; set; } + + /// + /// Success + /// + public bool Success { get; set; } + + /// + /// Method Response as Json string + /// + public string ResponseAsJsonString { get; set; } + } +} diff --git a/CefSharp.Core/DevTools/DevToolsMethodResponseContext.cs b/CefSharp.Core/DevTools/DevToolsMethodResponseContext.cs new file mode 100644 index 0000000000..be5f38db7e --- /dev/null +++ b/CefSharp.Core/DevTools/DevToolsMethodResponseContext.cs @@ -0,0 +1,54 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Generic; +using System.Threading; + +namespace CefSharp.DevTools +{ + // Helper class for setting the method response in the correct sync context + internal struct DevToolsMethodResponseContext + { + public readonly Type Type; + private readonly Func setResult; + private readonly Func setException; + private readonly SynchronizationContext syncContext; + + public DevToolsMethodResponseContext(Type type, Func setResult, Func setException, SynchronizationContext syncContext) + { + Type = type; + this.setResult = setResult; + this.setException = setException; + this.syncContext = syncContext; + } + + public void SetResult(object result) + { + InvokeOnSyncContext(setResult, result); + } + + public void SetException(Exception ex) + { + InvokeOnSyncContext(setException, ex); + } + + private void InvokeOnSyncContext(Func fn, T value) + { + if (syncContext == null || syncContext == SynchronizationContext.Current) + { + fn(value); + } + else + { + // Using a KeyValuePair to pass the method and value into the callback to avoid capturing local variables in the delegate. + syncContext.Post(new SendOrPostCallback(state => + { + var kv = (KeyValuePair, T>)state; + kv.Key(kv.Value); + }), new KeyValuePair, T>(fn, value)); + } + } + } +} diff --git a/CefSharp.Core/DevTools/EventProxy.cs b/CefSharp.Core/DevTools/EventProxy.cs new file mode 100644 index 0000000000..e71527661c --- /dev/null +++ b/CefSharp.Core/DevTools/EventProxy.cs @@ -0,0 +1,79 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +//Originally based on https://github.com/CefNet/CefNet.DevTools.Protocol/blob/0a124720474a469b5cef03839418f5e1debaf2f0/CefNet.DevTools.Protocol/Internal/EventProxy.T.cs + +using System; +using System.IO; +using System.Threading; + +namespace CefSharp.DevTools +{ + /// + /// Generic Typed Event Proxy + /// + /// Event Args Type + internal class EventProxy : IEventProxy + { + private event EventHandler handlers; + private Func convert; + + /// + /// Constructor + /// + /// Delegate used to convert from the Stream to event args + public EventProxy(Func convert) + { + this.convert = convert; + } + + /// + /// Add the event handler + /// + /// event handler to add + public void AddHandler(EventHandler handler) + { + handlers += handler; + } + + /// + /// Remove the event handler + /// + /// event handler to remove + /// returns true if the last event handler for this proxy was removed. + public bool RemoveHandler(EventHandler handler) + { + handlers -= handler; + + return handlers == null; + } + + /// + public void Raise(object sender, string eventName, Stream stream, SynchronizationContext syncContext) + { + stream.Position = 0; + + var args = convert(eventName, stream); + + if (syncContext == null) + { + handlers?.Invoke(sender, args); + } + else + { + syncContext.Post(new SendOrPostCallback(state => + { + handlers?.Invoke(sender, args); + + }), null); + } + } + + /// + public void Dispose() + { + handlers = null; + } + } +} diff --git a/CefSharp.Core/DevTools/Headers.cs b/CefSharp.Core/DevTools/Headers.cs new file mode 100644 index 0000000000..0d844c1f31 --- /dev/null +++ b/CefSharp.Core/DevTools/Headers.cs @@ -0,0 +1,168 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace CefSharp.DevTools.Network +{ + /// + /// Request / response headers as keys / values of JSON object. + /// + /// + /// CDP uses comma seperated values to store multiple header values. + /// Use or to get a string[] + /// for headers that have multiple values. + /// + /// Helper methods for dealing with comma separated header values based on https://github.com/dotnet/aspnetcore/blob/52eff90fbcfca39b7eb58baad597df6a99a542b0/src/Http/Http.Abstractions/src/Extensions/HeaderDictionaryExtensions.cs + public class Headers : Dictionary + { + /// + /// Initializes a new instance of the Headers class. + /// + public Headers() : base(StringComparer.OrdinalIgnoreCase) + { + } + + /// + /// Returns itself + /// + /// Dictionary of headers + public Dictionary ToDictionary() + { + return this; + } + + /// + /// Gets an array of values for the specified key. Values are comma seperated and will be split into a string[]. + /// Quoted values will not be split, and the quotes will be removed. + /// + /// The header name. + /// the associated values from the dictionary separated into individual values, or null if the key is not present. + /// true if the Dictionary contains an element with the specified key; otherwise, false. + public bool TryGetValues(string key, out string[] values) + { + values = null; + string value; + + if (TryGetValue(key, out value)) + { + var list = new List(); + + var valueStartIndex = -1; + var valueEndIndex = -1; + var inQuote = false; + for (var i = 0; i < value.Length; i++) + { + var c = value[i]; + + if (c == '\"') + { + inQuote = !inQuote; + continue; + } + + if (!inQuote && char.IsWhiteSpace(c)) + { + continue; + } + + if (valueStartIndex == -1) + { + valueStartIndex = i; + } + + if (!inQuote && c == ',') + { + if (valueEndIndex == -1) + { + list.Add(string.Empty); + } + else + { + list.Add(value.Substring(valueStartIndex, valueEndIndex + 1 - valueStartIndex)); + } + valueStartIndex = -1; + valueEndIndex = -1; + continue; + } + + valueEndIndex = i; + } + if (valueEndIndex == -1) + { + list.Add(string.Empty); + } + else + { + list.Add(value.Substring(valueStartIndex, valueEndIndex + 1 - valueStartIndex)); + } + + values = list.ToArray(); + + return true; + } + + return false; + } + + /// + /// Get the associated values from the dictionary separated into individual values. + /// Quoted values will not be split, and the quotes will be removed. + /// + /// The header name. + /// the associated values from the dictionary separated into individual values, or null if the key is not present. + public string[] GetCommaSeparatedValues(string key) + { + string[] values; + + if (TryGetValues(key, out values)) + { + return values; + } + + return null; + } + + /// + /// Quotes any values containing commas, and then comma joins all of the values with any existing values. + /// + /// The header name. + /// The header values. + public void AppendCommaSeparatedValues(string key, params string[] values) + { + if (TryGetValue(key, out var existingValue)) + { + this[key] = existingValue + "," + string.Join(",", values.Select(QuoteIfNeeded)); + } + else + { + SetCommaSeparatedValues(key, values); + } + } + + /// + /// Quotes any values containing commas, and then comma joins all of the values. + /// + /// The header name. + /// The header values. + public void SetCommaSeparatedValues(string key, params string[] values) + { + this[key] = string.Join(",", values.Select(QuoteIfNeeded)); + } + + private static string QuoteIfNeeded(string value) + { + if (!string.IsNullOrEmpty(value) && + value.Contains(',') && + (value[0] != '"' || value[value.Length - 1] != '"')) + { + return "\"" + value + "\""; + } + + return value; + } + } +} diff --git a/CefSharp.Core/DevTools/IDevToolsClient.cs b/CefSharp.Core/DevTools/IDevToolsClient.cs new file mode 100644 index 0000000000..17ba829e93 --- /dev/null +++ b/CefSharp.Core/DevTools/IDevToolsClient.cs @@ -0,0 +1,62 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace CefSharp.DevTools +{ + /// + /// DevTools Client + /// + public interface IDevToolsClient : IDisposable + { + /// + /// Will be called on receipt of a DevTools protocol event. Events by default are disabled and need to be + /// enabled on a per domain basis, e.g. Sending Network.enable (or calling ) + /// to enable network related events. + /// + event EventHandler DevToolsEvent; + + /// + /// Will be called when an error occurs when attempting to raise + /// + event EventHandler DevToolsEventError; + + /// + /// Add event handler for a DevTools protocol event. Events by default are disabled and need to be + /// enabled on a per domain basis, e.g. Sending Network.enable (or calling ) + /// to enable network related events. + /// + /// The event args type to which the event will be deserialized to. + /// is the event name to listen to + /// event handler to call when the event occurs + void AddEventHandler(string eventName, EventHandler eventHandler) where T : EventArgs; + + /// + /// Remove event handler for a DevTools protocol event. + /// + /// The event args type to which the event will be deserialized to. + /// is the event name to listen to + /// event handler to call when the event occurs + /// + /// Returns false if all handlers for the have been removed, + /// otherwise returns true if there are still handlers registered. + /// + bool RemoveEventHandler(string eventName, EventHandler eventHandler) where T : EventArgs; + + /// + /// Execute a method call over the DevTools protocol. This method can be called on any thread. + /// See the DevTools protocol documentation at https://chromedevtools.github.io/devtools-protocol/ for details + /// of supported methods and the expected dictionary contents. + /// + /// The type to which the method result will be deserialzed to. + /// is the method name + /// are the method parameters represented as a dictionary, + /// which may be empty. + /// return a Task that can be awaited to obtain the method result + Task ExecuteDevToolsMethodAsync(string method, IDictionary parameters = null) where T : DevToolsDomainResponseBase; + } +} diff --git a/CefSharp.Core/DevTools/IEventProxy.cs b/CefSharp.Core/DevTools/IEventProxy.cs new file mode 100644 index 0000000000..49f5ea62f4 --- /dev/null +++ b/CefSharp.Core/DevTools/IEventProxy.cs @@ -0,0 +1,27 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +// Originally Based on https://github.com/CefNet/CefNet.DevTools.Protocol/blob/0a124720474a469b5cef03839418f5e1debaf2f0/CefNet.DevTools.Protocol/IEventProxy.cs + +using System; +using System.IO; +using System.Threading; + +namespace CefSharp.DevTools +{ + /// + /// Event Proxy + /// + internal interface IEventProxy : IDisposable + { + /// + /// Raise Event + /// + /// sender + /// event name + /// Stream containing JSON + /// SynchronizationContext + void Raise(object sender, string eventName, Stream stream, SynchronizationContext syncContext); + } +} diff --git a/CefSharp.Core/DevTools/MemoryDumpConfig.cs b/CefSharp.Core/DevTools/MemoryDumpConfig.cs new file mode 100644 index 0000000000..1e3ad3d7d2 --- /dev/null +++ b/CefSharp.Core/DevTools/MemoryDumpConfig.cs @@ -0,0 +1,13 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.DevTools.Tracing +{ + /// + /// MemoryDumpConfig + /// + public class MemoryDumpConfig + { + } +} diff --git a/CefSharp.Core/DevTools/TargetFilter.cs b/CefSharp.Core/DevTools/TargetFilter.cs new file mode 100644 index 0000000000..bb1d798e5f --- /dev/null +++ b/CefSharp.Core/DevTools/TargetFilter.cs @@ -0,0 +1,23 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.DevTools.Target +{ + /// + /// The entries in TargetFilter are matched sequentially against targets and the first entry that matches + /// determines if the target is included or not, depending on the value of exclude field in the entry. + /// If filter is not specified, the one assumed is [{type: "browser", exclude: true}, {type: "tab", exclude: true}, {}] (i.e. include everything but browser and tab). + /// + public class TargetFilter : DevToolsDomainEntityBase + { + /// + /// Type + /// + public string Type { get; set; } + /// + /// Exclude + /// + public bool Exclude { get; set; } + } +} diff --git a/CefSharp.Core/DevToolsExtensions.cs b/CefSharp.Core/DevToolsExtensions.cs new file mode 100644 index 0000000000..75846f18d1 --- /dev/null +++ b/CefSharp.Core/DevToolsExtensions.cs @@ -0,0 +1,177 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Collections.Generic; +using System.Threading.Tasks; +using CefSharp.DevTools; +using CefSharp.Internals; +using CefSharp.Web; + +namespace CefSharp +{ + /// + /// Extensions for accessing DevTools through + /// + public static class DevToolsExtensions + { + /// + /// Execute a method call over the DevTools protocol. This is a more structured + /// version of SendDevToolsMessage. + /// See the DevTools protocol documentation at https://chromedevtools.github.io/devtools-protocol/ for details + /// of supported methods and the expected JSON message format. + /// See the SendDevToolsMessage documentation for additional usage information. + /// + /// browser host + /// is an incremental number that uniquely identifies the message (pass 0 to have the next number assigned + /// automatically based on previous values) + /// is the method name + /// are the method parameters represented as a , + /// which may be empty. + /// return the assigned message Id if called on the CEF UI thread and the message was + /// successfully submitted for validation, otherwise 0 + public static int ExecuteDevToolsMethod(this IBrowserHost browserHost, int messageId, string method, JsonString parameters) + { + WebBrowserExtensions.ThrowExceptionIfBrowserHostNull(browserHost); + + var json = parameters == null ? null : parameters.Json; + + return browserHost.ExecuteDevToolsMethod(messageId, method, json); + } + + /// + /// Execute a method call over the DevTools protocol. This is a more structured + /// version of SendDevToolsMessage. can only be called on the + /// CEF UI Thread, this method can be called on any thread. + /// See the DevTools protocol documentation at https://chromedevtools.github.io/devtools-protocol/ for details + /// of supported methods and the expected dictionary contents. + /// See the SendDevToolsMessage documentation for additional usage information. + /// + /// the browser instance + /// is an incremental number that uniquely identifies the message (pass 0 to have the next number assigned + /// automatically based on previous values) + /// is the method name + /// are the method parameters represented as a dictionary, + /// which may be empty. + /// return a Task that can be awaited to obtain the assigned message Id. If the message was + /// unsuccessfully submitted for validation, this value will be 0. + public static Task ExecuteDevToolsMethodAsync(this IBrowser browser, int messageId, string method, IDictionary parameters = null) + { + WebBrowserExtensions.ThrowExceptionIfBrowserNull(browser); + + var browserHost = browser.GetHost(); + + WebBrowserExtensions.ThrowExceptionIfBrowserHostNull(browserHost); + + if (CefThread.CurrentlyOnUiThread) + { + return Task.FromResult(browserHost.ExecuteDevToolsMethod(messageId, method, parameters)); + } + + if (CefThread.CanExecuteOnUiThread) + { + return CefThread.ExecuteOnUiThread(() => + { + return browserHost.ExecuteDevToolsMethod(messageId, method, parameters); + }); + } + + //CEF returns 0 to signify failure, we'll do the same. + return Task.FromResult(0); + } + + /// + /// Execute a method call over the DevTools protocol. This is a more structured + /// version of SendDevToolsMessage. can only be called on the + /// CEF UI Thread, this method can be called on any thread. + /// See the DevTools protocol documentation at https://chromedevtools.github.io/devtools-protocol/ for details + /// of supported methods and the expected dictionary contents. + /// See the SendDevToolsMessage documentation for additional usage information. + /// + /// the ChromiumWebBrowser instance + /// is an incremental number that uniquely identifies the message (pass 0 to have the next number assigned + /// automatically based on previous values) + /// is the method name + /// are the method parameters represented as a dictionary, + /// which may be empty. + /// return a Task that can be awaited to obtain the assigned message Id. If the message was + /// unsuccessfully submitted for validation, this value will be 0. + public static Task ExecuteDevToolsMethodAsync(this IChromiumWebBrowserBase chromiumWebBrowser, int messageId, string method, IDictionary parameters = null) + { + var browser = chromiumWebBrowser.BrowserCore; + + return browser.ExecuteDevToolsMethodAsync(messageId, method, parameters); + } + + /// + /// Gets a new Instance of the DevTools client for the chromiumWebBrowser + /// instance. + /// + /// the chromiumWebBrowser instance + /// DevToolsClient + public static DevToolsClient GetDevToolsClient(this IChromiumWebBrowserBase chromiumWebBrowser) + { + var browser = chromiumWebBrowser.BrowserCore; + + return browser.GetDevToolsClient(); + } + + /// + /// Gets a new Instance of the DevTools client + /// + /// the IBrowser instance + /// DevToolsClient + public static DevToolsClient GetDevToolsClient(this IBrowser browser) + { + WebBrowserExtensions.ThrowExceptionIfBrowserNull(browser); + + var browserHost = browser.GetHost(); + + WebBrowserExtensions.ThrowExceptionIfBrowserHostNull(browserHost); + + var devToolsClient = new DevToolsClient(browser); + + var observerRegistration = browserHost.AddDevToolsMessageObserver(devToolsClient); + + devToolsClient.SetDevToolsObserverRegistration(observerRegistration); + + return devToolsClient; + } + + /// + /// Set the Document Content for the Main Frame using DevTools Protocol. + /// + /// ChromiumWebBrowser instance + /// html + /// Task that can be awaited to determine if the content was successfully updated. + public static Task SetMainFrameDocumentContentAsync(this IChromiumWebBrowserBase chromiumWebBrowser, string html) + { + var browser = chromiumWebBrowser.BrowserCore; + + return browser.SetMainFrameDocumentContentAsync(html); + } + + /// + /// Set the Document Content for the Main Frame using DevTools Protocol. + /// + /// the browser instance + /// html + /// Task that can be awaited to determine if the content was successfully updated. + public static async Task SetMainFrameDocumentContentAsync(this IBrowser browser, string html) + { + WebBrowserExtensions.ThrowExceptionIfBrowserNull(browser); + + using (var client = browser.GetDevToolsClient()) + { + var response = await client.Page.GetFrameTreeAsync().ConfigureAwait(false); + + var frames = response.FrameTree; + var mainFrame = frames.Frame; + + var setContentResponse = await client.Page.SetDocumentContentAsync(mainFrame.Id, html).ConfigureAwait(false); + + return setContentResponse.Success; + } + } + } +} diff --git a/CefSharp.Core/DragData.cs b/CefSharp.Core/DragData.cs new file mode 100644 index 0000000000..770707270f --- /dev/null +++ b/CefSharp.Core/DragData.cs @@ -0,0 +1,23 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +//NOTE:Classes in the CefSharp.Core namespace have been hidden from intellisnse so users don't use them directly + +namespace CefSharp +{ + /// + /// Used to represent Drag Data. + /// + public static class DragData + { + /// + /// Create a new instance of + /// + /// DragData + public static IDragData Create() + { + return Core.DragData.Create(); + } + } +} diff --git a/CefSharp.Core/Fluent/DownloadHandler.cs b/CefSharp.Core/Fluent/DownloadHandler.cs new file mode 100644 index 0000000000..e2164ac9f1 --- /dev/null +++ b/CefSharp.Core/Fluent/DownloadHandler.cs @@ -0,0 +1,151 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.IO; + +namespace CefSharp.Fluent +{ + /// + /// Called before a download begins in response to a user-initiated action + /// (e.g. alt + link click or link click that returns a `Content-Disposition: + /// attachment` response from the server). + /// + /// the ChromiumWebBrowser control + /// The browser instance + /// is the target download URL + /// is the target method (GET, POST, etc) + /// Return true to proceed with the download or false to cancel the download. + public delegate bool CanDownloadDelegate(IWebBrowser chromiumWebBrowser, IBrowser browser, string url, string requestMethod); + + /// + /// Called before a download begins. + /// + /// the ChromiumWebBrowser control + /// The browser instance + /// Represents the file being downloaded. + /// Callback interface used to asynchronously continue a download. + /// Return true and execute either + /// asynchronously or in this method to continue or cancel the download. + /// Return false to proceed with default handling (cancel with Alloy style, + /// download shelf with Chrome style). + public delegate bool OnBeforeDownloadDelegate(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback); + + /// + /// Called when a download's status or progress information has been updated. This may be called multiple times before and after . + /// + /// the ChromiumWebBrowser control + /// The browser instance + /// Represents the file being downloaded. + /// The callback used to Cancel/Pause/Resume the process + public delegate void OnDownloadUpdatedDelegate(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback); + + /// + /// A implementation used by + /// to provide a fluent means of creating a . + /// + public class DownloadHandler : Handler.DownloadHandler + { + private CanDownloadDelegate canDownload; + private OnBeforeDownloadDelegate onBeforeDownload; + private OnDownloadUpdatedDelegate onDownloadUpdated; + + /// + /// Create a new DownloadHandler Builder + /// + /// Fluent DownloadHandler Builder + public static DownloadHandlerBuilder Create() + { + return new DownloadHandlerBuilder(); + } + + /// + /// Creates a new instances + /// where all downloads are automatically downloaded to the specified folder. + /// No dialog is dispolayed to the user. + /// + /// folder where files are download. + /// optional delegate for download updates, track progress, completion etc. + /// instance. + public static IDownloadHandler UseFolder(string folder, OnDownloadUpdatedDelegate downloadUpdated = null) + { + return Create() + .OnBeforeDownload((chromiumWebBrowser, browser, item, callback) => + { + using (callback) + { + var path = Path.Combine(folder, item.SuggestedFileName); + + callback.Continue(path, showDialog: false); + } + + return true; + }) + .OnDownloadUpdated(downloadUpdated) + .Build(); + } + + /// + /// Creates a new instances + /// where a default "Save As" dialog is displayed to the user. + /// + /// optional delegate for download updates, track progress, completion etc. + /// instance. + public static IDownloadHandler AskUser(OnDownloadUpdatedDelegate downloadUpdated = null) + { + return Create() + .OnBeforeDownload((chromiumWebBrowser, browser, item, callback) => + { + using (callback) + { + callback.Continue("", showDialog: true); + } + + return true; + }) + .OnDownloadUpdated(downloadUpdated) + .Build(); + } + + /// + /// Use to create a new instance of the fluent builder + /// + internal DownloadHandler() + { + + } + + internal void SetCanDownload(CanDownloadDelegate action) + { + canDownload = action; + } + + internal void SetOnBeforeDownload(OnBeforeDownloadDelegate action) + { + onBeforeDownload = action; + } + + internal void SetOnDownloadUpdated(OnDownloadUpdatedDelegate action) + { + onDownloadUpdated = action; + } + + /// + protected override bool CanDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, string url, string requestMethod) + { + return canDownload?.Invoke(chromiumWebBrowser, browser, url, requestMethod) ?? true; + } + + /// + protected override bool OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback) + { + return onBeforeDownload?.Invoke(chromiumWebBrowser, browser, downloadItem, callback) ?? false; + } + + /// + protected override void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) + { + onDownloadUpdated?.Invoke(chromiumWebBrowser, browser, downloadItem, callback); + } + } +} diff --git a/CefSharp.Core/Fluent/DownloadHandlerBuilder.cs b/CefSharp.Core/Fluent/DownloadHandlerBuilder.cs new file mode 100644 index 0000000000..f37eb71b74 --- /dev/null +++ b/CefSharp.Core/Fluent/DownloadHandlerBuilder.cs @@ -0,0 +1,71 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.Fluent +{ + /// + /// Fluent DownloadHandler Builder + /// + public class DownloadHandlerBuilder + { + private readonly DownloadHandler handler = new DownloadHandler(); + + /// + /// See for details. + /// + /// Action to be executed when + /// is called + /// + /// Fluent Builder, call to create + /// a new instance + /// + public DownloadHandlerBuilder CanDownload(CanDownloadDelegate action) + { + handler.SetCanDownload(action); + + return this; + } + + /// + /// See for details. + /// + /// Action to be executed when + /// is called + /// + /// Fluent Builder, call to create + /// a new instance + /// + public DownloadHandlerBuilder OnBeforeDownload(OnBeforeDownloadDelegate action) + { + handler.SetOnBeforeDownload(action); + + return this; + } + + /// + /// See for details. + /// + /// Action to be executed when + /// is called + /// + /// Fluent Builder, call to create + /// a new instance + /// + public DownloadHandlerBuilder OnDownloadUpdated(OnDownloadUpdatedDelegate action) + { + handler.SetOnDownloadUpdated(action); + + return this; + } + + /// + /// Create a instance + /// + /// a instance + public IDownloadHandler Build() + { + return handler; + } + } +} diff --git a/CefSharp.Core/Fluent/UrlRequestClient.cs b/CefSharp.Core/Fluent/UrlRequestClient.cs new file mode 100644 index 0000000000..7d9cf9127d --- /dev/null +++ b/CefSharp.Core/Fluent/UrlRequestClient.cs @@ -0,0 +1,142 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.IO; + +namespace CefSharp.Fluent +{ + /// + /// Called on the CEF IO thread when the browser needs credentials from the user. + /// This method will only be called for requests initiated from the browser process. + /// + /// indicates whether the host is a proxy server. + /// the hostname. + /// the port number. + /// realm + /// scheme + /// is a callback for authentication information + /// + /// Return true to continue the request and call when the authentication information is available. + /// If the request has an associated browser/frame then returning false will result in a call to + /// on the associated with that browser, if any. + /// Otherwise, returning false will cancel the request immediately. + /// + public delegate bool GetAuthCredentialsDelegate(bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback); + + /// + /// Called when some part of the response is read. This method will not be called if the flag is set on the request. + /// + /// request + /// A stream containing the bytes received since the last call. Cannot be used outside the scope of this method. + public delegate void OnDownloadDataDelegate(IUrlRequest request, Stream data); + + /// + /// Notifies the client of download progress. + /// + /// request + /// denotes the number of bytes received up to the call + /// is the expected total size of the response (or -1 if not determined). + public delegate void OnDownloadProgressDelegate(IUrlRequest request, long current, long total); + + /// + /// Notifies the client that the request has completed. + /// Use the property to determine if the + /// request was successful or not. + /// + /// request + public delegate void OnRequestCompleteDelegate(IUrlRequest request); + + /// + /// Notifies the client of upload progress. + /// This method will only be called if the UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. + /// + /// request + /// denotes the number of bytes sent so far. + /// is the total size of uploading data (or -1 if chunked upload is enabled). + public delegate void OnUploadProgressDelegate(IUrlRequest request, long current, long total); + + /// + /// Fluent UrlRequestClient + /// + public class UrlRequestClient : CefSharp.UrlRequestClient + { + private GetAuthCredentialsDelegate getAuthCredentials; + private OnDownloadDataDelegate onDownloadData; + private OnDownloadProgressDelegate onDownloadProgress; + private OnRequestCompleteDelegate onRequestComplete; + private OnUploadProgressDelegate onUploadProgress; + + /// + /// Create a new UrlRequestClient Builder + /// + /// Fluent UrlRequestClient Builder + public static UrlRequestClientBuilder Create() + { + return new UrlRequestClientBuilder(); + } + + /// + /// Use to create a new instance of the fluent builder + /// + internal UrlRequestClient() + { + + } + + internal void SetGetAuthCredentials(GetAuthCredentialsDelegate func) + { + getAuthCredentials = func; + } + + internal void SetOnDownloadData(OnDownloadDataDelegate action) + { + onDownloadData = action; + } + + internal void SetOnDownloadProgress(OnDownloadProgressDelegate action) + { + onDownloadProgress = action; + } + + internal void SetOnRequestComplete(OnRequestCompleteDelegate action) + { + onRequestComplete = action; + } + + internal void SetOnUploadProgress(OnUploadProgressDelegate action) + { + onUploadProgress = action; + } + + /// + protected override bool GetAuthCredentials(bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback) + { + return getAuthCredentials?.Invoke(isProxy, host, port, realm, scheme, callback) ?? false; + } + + /// + protected override void OnDownloadData(IUrlRequest request, Stream data) + { + onDownloadData?.Invoke(request, data); + } + + /// + protected override void OnDownloadProgress(IUrlRequest request, long current, long total) + { + onDownloadProgress?.Invoke(request, current, total); + } + + /// + protected override void OnRequestComplete(IUrlRequest request) + { + onRequestComplete?.Invoke(request); + } + + /// + protected override void OnUploadProgress(IUrlRequest request, long current, long total) + { + onUploadProgress?.Invoke(request, current, total); + } + } +} diff --git a/CefSharp.Core/Fluent/UrlRequestClientBuilder.cs b/CefSharp.Core/Fluent/UrlRequestClientBuilder.cs new file mode 100644 index 0000000000..3d154cabcf --- /dev/null +++ b/CefSharp.Core/Fluent/UrlRequestClientBuilder.cs @@ -0,0 +1,105 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.IO; + +namespace CefSharp.Fluent +{ + /// + /// Fluent UrlRequestClient Builder + /// + public class UrlRequestClientBuilder + { + private UrlRequestClient client = new UrlRequestClient(); + + /// + /// See for details + /// + /// function to be executed when + /// is called + /// + /// Fluent Builder, call to create + /// a new instance + /// + public UrlRequestClientBuilder GetAuthCredentials(GetAuthCredentialsDelegate func) + { + client.SetGetAuthCredentials(func); + + return this; + } + + /// + /// See for details. + /// + /// Action to be executed when + /// is called + /// + /// Fluent Builder, call to create + /// a new instance + /// + public UrlRequestClientBuilder OnDownloadData(OnDownloadDataDelegate action) + { + client.SetOnDownloadData(action); + + return this; + } + + /// + /// See for details. + /// + /// Action to be executed when + /// is called + /// + /// Fluent Builder, call to create + /// a new instance + /// + public UrlRequestClientBuilder OnDownloadProgress(OnDownloadProgressDelegate action) + { + client.SetOnDownloadProgress(action); + + return this; + } + + /// + /// See for details. + /// + /// Action to be executed when + /// is called + /// + /// Fluent Builder, call to create + /// a new instance + /// + public UrlRequestClientBuilder OnRequestComplete(OnRequestCompleteDelegate action) + { + client.SetOnRequestComplete(action); + + return this; + } + + /// + /// See for details. + /// + /// Action to be executed when + /// is called + /// + /// Fluent Builder, call to create + /// a new instance + /// + public UrlRequestClientBuilder OnUploadProgress(OnUploadProgressDelegate action) + { + client.SetOnUploadProgress(action); + + return this; + } + + /// + /// Create a instance + /// + /// a instance + public IUrlRequestClient Build() + { + return client; + } + } +} diff --git a/CefSharp.Core/Initializer.cs b/CefSharp.Core/Initializer.cs new file mode 100644 index 0000000000..d4d275a0ac --- /dev/null +++ b/CefSharp.Core/Initializer.cs @@ -0,0 +1,105 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.IO; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace CefSharp +{ + /// + /// CLR Module Initializer + /// Used to load libcef.dll if required + /// + public static class Initializer + { + //TODO: Internal debugging only for now, needs improving if users are going to + //get meaningful data from this. + internal static IntPtr? LibCefHandle { get; private set; } + internal static bool LibCefLoaded { get; private set; } + internal static string LibCefPath { get; private set; } + internal static string BrowserSubProcessPath { get; private set; } + internal static string BrowserSubProcessCorePath { get; private set; } + + [ModuleInitializer] + internal static void ModuleInitializer() + { + string currentFolder; + + var executingAssembly = Assembly.GetEntryAssembly(); + //The GetEntryAssembly method can return null when a managed assembly has been loaded from an unmanaged application. + //https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getentryassembly?view=net-5.0 + if (executingAssembly == null) + { + currentFolder = GetCefSharpCoreAssemblyLocation(); + } + else + { + currentFolder = Path.GetDirectoryName(executingAssembly.Location); + } + + //In .NET 5.0 and later versions, for bundled assemblies, Assembly.Location is an empty string. + //https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.location?view=net-5.0 + //Which results in Path.GetDirectoryName returning null, in that case use use AppContext.BaseDirectory + //otherwise Path.Combine will throw an exception. + //In .NET 5.0 and later versions, for bundled assemblies, AppContext.BaseDirectory returns the containing directory of the host executable. + //https://docs.microsoft.com/en-us/dotnet/api/system.appcontext.basedirectory?view=net-5.0 + if(string.IsNullOrEmpty(currentFolder)) + { + currentFolder = AppContext.BaseDirectory; + } + + var libCefPath = Path.Combine(currentFolder, "libcef.dll"); + + if (File.Exists(libCefPath)) + { + //We didn't load CEF, it was already next to our calling assembly, the + //framework should load it correctly on it's own + LibCefPath = libCefPath; + LibCefLoaded = false; + } + else + { + var arch = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); + var archFolder = $"runtimes\\win-{arch}\\native"; + libCefPath = Path.Combine(currentFolder, archFolder, "libcef.dll"); + + if (!File.Exists(libCefPath)) + { + // For cases where the library is dynamically loaded and no RuntimeIdentifier + // specified, attempt to locate libcef.dll next to CefSharp.Core.dll + currentFolder = GetCefSharpCoreAssemblyLocation(); + + libCefPath = Path.Combine(currentFolder, archFolder, "libcef.dll"); + } + + if (File.Exists(libCefPath)) + { + LibCefLoaded = NativeLibrary.TryLoad(libCefPath, out IntPtr handle); + + if (LibCefLoaded) + { + BrowserSubProcessPath = Path.Combine(currentFolder, archFolder, "CefSharp.BrowserSubprocess.exe"); + BrowserSubProcessCorePath = Path.Combine(currentFolder, archFolder, "CefSharp.BrowserSubprocess.Core.dll"); + + LibCefPath = libCefPath; + LibCefHandle = handle; + } + } + else + { + LibCefPath = libCefPath; + LibCefLoaded = false; + } + } + } + + private static string GetCefSharpCoreAssemblyLocation() + { + return Path.GetDirectoryName(typeof(Initializer).Assembly.Location); + } + } +} diff --git a/CefSharp.Core/Internals/CefExtensionHandlerAdapter.h b/CefSharp.Core/Internals/CefExtensionHandlerAdapter.h deleted file mode 100644 index 2fca76433c..0000000000 --- a/CefSharp.Core/Internals/CefExtensionHandlerAdapter.h +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright © 2018 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -#pragma once - -#include "Stdafx.h" - -#include "include\cef_extension.h" -#include "include\cef_extension_handler.h" -#include "BrowserSettings.h" -#include "CefExtensionWrapper.h" -#include "CefSharpBrowserWrapper.h" -#include "CefGetExtensionResourceCallbackWrapper.h" -#include "WindowInfo.h" - -using namespace CefSharp; - -namespace CefSharp -{ - namespace Internals - { - private class CefExtensionHandlerAdapter : public CefExtensionHandler - { - gcroot _handler; - - public: - CefExtensionHandlerAdapter(IExtensionHandler^ handler) - : _handler(handler) - { - } - - ~CefExtensionHandlerAdapter() - { - delete _handler; - _handler = nullptr; - } - - /// - // Called if the CefRequestContext::LoadExtension request fails. |result| will - // be the error code. - /// - /*--cef()--*/ - void OnExtensionLoadFailed(cef_errorcode_t result) OVERRIDE - { - _handler->OnExtensionLoadFailed((CefErrorCode)result); - } - - /// - // Called if the CefRequestContext::LoadExtension request succeeds. - // |extension| is the loaded extension. - /// - /*--cef()--*/ - void OnExtensionLoaded(CefRefPtr extension) OVERRIDE - { - //TODO: Should this be auto disposed? - _handler->OnExtensionLoaded(gcnew CefExtensionWrapper(extension)); - } - - /// - // Called after the CefExtension::Unload request has completed. - /// - /*--cef()--*/ - void OnExtensionUnloaded(CefRefPtr extension) OVERRIDE - { - //TODO: Add comment to interface saying extension is only valid within the scope - //of this method as it's auto disposed - CefExtensionWrapper wrapper(extension); - _handler->OnExtensionUnloaded(%wrapper); - } - - /// - // Called when an extension needs a browser to host a background script - // specified via the "background" manifest key. The browser will have no - // visible window and cannot be displayed. |extension| is the extension that - // is loading the background script. |url| is an internally generated - // reference to an HTML page that will be used to load the background script - // via a + + +
+
+ + + + diff --git a/CefSharp.Example/Resources/BindingTest.html b/CefSharp.Example/Resources/BindingTest.html index 6d0947b4fd..3684396878 100644 --- a/CefSharp.Example/Resources/BindingTest.html +++ b/CefSharp.Example/Resources/BindingTest.html @@ -1,593 +1,60 @@ - - Binding Test - - - -
-
- - - + + Binding Test + + + +
+
+ + + + + + + + - - + CefSharp.PostMessage({ "Type": "QUnitTestFailed", "Output": output }); + }); + - + diff --git a/CefSharp.Example/Resources/BindingTestAsync.js b/CefSharp.Example/Resources/BindingTestAsync.js new file mode 100644 index 0000000000..7defa87416 --- /dev/null +++ b/CefSharp.Example/Resources/BindingTestAsync.js @@ -0,0 +1,289 @@ +QUnit.module('BindingTestAsync', (hooks) => +{ + hooks.before(async () => + { + await CefSharp.BindObjectAsync("boundAsync"); + }); + + QUnit.test("BindObjectAsync Second call with boundAsync param", async (assert) => + { + const res = await CefSharp.BindObjectAsync("boundAsync"); + assert.equal(res.Success, false, "Second call to BindObjectAsync with already bound objects as params returned false."); + }); + + QUnit.test("Async call (Throw .Net Exception)", async (assert) => + { + assert.rejects(boundAsync.error()); + }); + + QUnit.test("Async call (Divide 16 / 2):", async (assert) => + { + const actualResult = await boundAsync.div(16, 2); + const expectedResult = 8; + assert.equal(expectedResult, actualResult, "Divide 16 / 2"); + }); + + QUnit.test("Async call (Div with Blocking Task 16 / 2):", async (assert) => + { + const actualResult = await boundAsync.divWithBlockingTaskCall(16, 2); + const expectedResult = 8; + assert.equal(expectedResult, actualResult, "Divide 16 / 2"); + }); + + QUnit.test("Async call (Divide 16 /0)", async (assert) => + { + assert.rejects(boundAsync.div(16, 0)); + }); + + QUnit.test("Async call (UIntAddModel 3 + 2):", async (assert) => + { + const actualResult = await boundAsync.uIntAddModel({ ParamA: 3, ParamB: 2 }); + const expectedResult = 5; + + assert.equal(expectedResult, actualResult, "Add 3 + 2 resulted in " + expectedResult); + }); + + QUnit.test("Async call (UIntAdd 3 + 2):", async (assert) => + { + const actualResult = await boundAsync.uIntAdd(3, 2); + const expectedResult = 5; + + assert.equal(expectedResult, actualResult, "Add 3 + 2 resulted in " + expectedResult); + }); + + QUnit.test("Async call (Hello):", async (assert) => + { + const res = await boundAsync.hello('CefSharp'); + assert.equal(res, "Hello CefSharp") + }); + + QUnit.test("Async call (Long Running Task):", async (assert) => + { + const res = await boundAsync.doSomething(); + assert.ok(true, "Slept for 1000ms") + }); + + QUnit.test("Async call (return Struct):", async (assert) => + { + var res = await boundAsync.returnObject('CefSharp Struct Test'); + assert.equal(res.Value, "CefSharp Struct Test", "Struct with a single field"); + + }); + + QUnit.test("Async call (return Class):", async (assert) => + { + //Returns a class + const res = await boundAsync.returnClass('CefSharp Class Test'); + const expectedResult = 'CefSharp Class Test'; + + assert.equal(expectedResult, res.Value, "Class with a single property"); + }); + + QUnit.test("Async call (return Class as JsonString):", async (assert) => + { + const expectedResult = 'CefSharp Class Test'; + + //Returns a class + const res = await boundAsync.returnClassAsJsonString(expectedResult); + assert.equal(expectedResult, res.Value, "Class with a single property"); + }); + + QUnit.test("Async call (returnStructArray):", async (assert) => + { + const res = await boundAsync.returnStructArray('CefSharp'); + assert.equal(res[0].Value, "CefSharpItem1", "Expected Result of CefSharpItem1"); + assert.equal(res[1].Value, "CefSharpItem2", "Expected Result of CefSharpItem2"); + }); + + QUnit.test("Async call (returnClassesArray):", async (assert) => + { + var asyncCallback = assert.async(); + + boundAsync.returnClassesArray('CefSharp').then(function (res) + { + assert.equal(res[0].Value, "CefSharpItem1", "Expected Result of CefSharpItem1"); + assert.equal(res[1].Value, "CefSharpItem2", "Expected Result of CefSharpItem2"); + + asyncCallback(); + }); + }); + + QUnit.test("Async call (echoDateTime): now", async (assert) => + { + const now = new Date(); + const res = await boundAsync.echoDateTime(now); + + assert.deepEqual(res, now, "Expected echo datetime"); + }); + + QUnit.test("Async call (echoDateTime): unixTimeZero", async (assert) => + { + const unixTimeZero = new Date(Date.parse('01 Jan 1970 00:00:00 GMT')); + const res = await boundAsync.echoDateTime(unixTimeZero); + + assert.deepEqual(res, unixTimeZero, "Expected echo unixTimeZero"); + }); + + QUnit.test("Async call (echoNullableDateTime):", async (assert) => + { + const now = new Date(); + const res = await boundAsync.echoNullableDateTime(now); + + assert.deepEqual(res, now, "Expected echo datetime"); + }); + + QUnit.test("Async call (echoNullableDateTime) null param:", async (assert) => + { + const res = await boundAsync.echoNullableDateTime(null); + + assert.equal(res, null, "Expected null"); + }); + + QUnit.test("Async call (echoArray):", async (assert) => + { + const res = await boundAsync.echoArray(["one", null, "three"]); + + assert.equal(res.length, 3, "Expected result to be length 3"); + assert.equal(res[0], "one", "Expected Result of 1st item"); + assert.equal(res[1], null, "Expected Result of 2nd item"); + assert.equal(res[2], "three", "Expected Result of 3rd item"); + }); + + QUnit.test("Async call (Test Empty Array):", async (assert) => + { + const res = await boundAsync.echoArray([]); + + assert.equal(Array.isArray(res), true, "Expected result is an array"); + assert.equal(res.length, 0, "Expected result to be length 0 (empty array)"); + }); + + + QUnit.test("Async call (echoValueTypeArray):", async (assert) => + { + const res = await boundAsync.echoValueTypeArray([1, null, 3]); + + assert.equal(res.length, 3, "Expected result to be length 3"); + assert.equal(res[0], 1, "Expected Result of 1st item"); + assert.equal(res[1], 0, "Expected Result of 2nd item"); + assert.equal(res[2], 3, "Expected Result of 3rd item"); + }); + + QUnit.test("Async call (echoMultidimensionalArray):", async (assert) => + { + const res = await boundAsync.echoMultidimensionalArray([[1, 2], null, [3, 4]]); + + assert.equal(res.length, 3, "Expected result to be length 3"); + assert.equal(res[0][0], 1, "Expected Result of 1st item"); + assert.equal(res[0][1], 2, "Expected Result of 1st item"); + assert.equal(res[1], null, "Expected Result of 2nd item"); + assert.equal(res[2][0], 3, "Expected Result of 3rd item"); + assert.equal(res[2][1], 4, "Expected Result of 3rd item"); + }); + + QUnit.test("Async call (methodReturnList):", async (assert) => + { + const list1 = + [ + "Element 0 - First", + "Element 1", + "Element 2 - Last" + ]; + const list2 = + [ + ["Element 0, 0", "Element 0, 1"], + ["Element 1, 0", "Element 1, 1"], + ["Element 2, 0", "Element 2, 1"] + ]; + + const results = await Promise.all([ + boundAsync.methodReturnsList(), + boundAsync.methodReturnsListOfLists(), + ]); + + assert.deepEqual(results[0], list1, "Call to boundAsync.MethodReturnsList() resulted in : " + JSON.stringify(results[0])); + assert.deepEqual(results[1], list2, "Call to boundAsync.MethodReturnsListOfLists() resulted in : " + JSON.stringify(results[1])); + }); + + QUnit.test("Async call (methodReturnsDictionary):", async (assert) => + { + const dict1 = + { + "five": 5, + "ten": 10 + }; + const dict2 = + { + "onepointfive": 1.5, + "five": 5, + "ten": "ten", + "twotwo": [2, 2] + }; + const dict3 = + { + "data": + { + "onepointfive": 1.5, + "five": 5, + "ten": "ten", + "twotwo": [2, 2] + } + }; + + const results = await Promise.all([ + boundAsync.methodReturnsDictionary1(), + boundAsync.methodReturnsDictionary2(), + boundAsync.methodReturnsDictionary3() + ]); + + assert.deepEqual(results[0], dict1, "Call to boundAsync.MethodReturnsDictionary1() resulted in : " + JSON.stringify(results[0])); + assert.deepEqual(results[1], dict2, "Call to boundAsync.MethodReturnsDictionary2() resulted in : " + JSON.stringify(results[1])); + assert.deepEqual(results[2], dict3, "Call to boundAsync.MethodReturnsDictionary3() resulted in : " + JSON.stringify(results[2])); + }); + + QUnit.test("Async call (PassSimpleClassAsArgument):", async (assert) => + { + const res = await boundAsync.passSimpleClassAsArgument({ + TestString: "Hello", + SubClasses: + [ + { PropertyOne: "Test Property One", Numbers: [1, 2, 3] }, + { PropertyOne: "Test Property Two", Numbers: [4, 5, 6] } + ] + }); + + assert.equal(res.Item1, true) + assert.equal(res.Item2, "TestString:Hello;SubClasses[0].PropertyOne:Test Property One"); + }); + + QUnit.test("Bind boundAsync2 and call (Hello):", async (assert) => + { + //Can use both cefSharp.bindObjectAsync and CefSharp.BindObjectAsync, both do the same + const result = await cefSharp.bindObjectAsync({ NotifyIfAlreadyBound: true }, "boundAsync2"); + const res = await boundAsync2.hello('CefSharp'); + + assert.equal(res, "Hello CefSharp") + assert.equal(true, CefSharp.DeleteBoundObject("boundAsync2"), "Object was unbound"); + assert.ok(window.boundAsync2 === undefined, "boundAsync2 is now undefined"); + }); + + //Repeat of the previous test to make sure binding a deleted object is working + QUnit.test("Bind boundAsync2 and call (Hello) Second Attempt:", async (assert) => + { + const result = await CefSharp.BindObjectAsync({ NotifyIfAlreadyBound: true, IgnoreCache: true }, "boundAsync2"); + const res = await boundAsync2.hello('CefSharp'); + + assert.equal(res, "Hello CefSharp") + }); + + //Repeat of the previous test to make sure binding a deleted object is working + QUnit.test("Bind boundAsync2 and call (Hello) Third Attempt:", async (assert) => + { + const result = await CefSharp.BindObjectAsync({ NotifyIfAlreadyBound: true, IgnoreCache: true }, "boundAsync2"); + const res = await boundAsync2.hello('CefSharp'); + + assert.equal(res, "Hello CefSharp") + assert.equal(true, CefSharp.DeleteBoundObject("boundAsync2"), "Object was unbound"); + assert.ok(window.boundAsync2 === undefined, "boundAsync2 is now undefined"); + }); + +}); diff --git a/CefSharp.Example/Resources/BindingTestNetCore.html b/CefSharp.Example/Resources/BindingTestNetCore.html new file mode 100644 index 0000000000..4d79ef7539 --- /dev/null +++ b/CefSharp.Example/Resources/BindingTestNetCore.html @@ -0,0 +1,59 @@ + + + + Binding Test (Net Core) + + + +
+
+ + + + + + + + + + diff --git a/CefSharp.Example/Resources/BindingTestSingle.html b/CefSharp.Example/Resources/BindingTestSingle.html index 3b10788776..766cdfd4bc 100644 --- a/CefSharp.Example/Resources/BindingTestSingle.html +++ b/CefSharp.Example/Resources/BindingTestSingle.html @@ -1,52 +1,45 @@ - + - - Binding Test - - - -
-
- - - + + - - + setTimeout(() => + { + resolve(msg); + }, 300); + }); + }; + + const expectedResult = "Callback has not been invoked"; + const actualResult = await boundAsync.javascriptOptionalCallbackEvalPromise(false, expectedResult, callback); + assert.equal(expectedResult, actualResult, "Echo response after promise execution"); + + const expectedSecondResult = "Callback has been invoked"; + const actualSecondResult = await boundAsync.javascriptOptionalCallbackEvalPromise(true, expectedSecondResult, callback); + assert.equal(expectedSecondResult, actualSecondResult, "Echo response after promise execution"); + }); + }); + + + diff --git a/CefSharp.Example/Resources/BindingTestSync.js b/CefSharp.Example/Resources/BindingTestSync.js new file mode 100644 index 0000000000..51c150c8af --- /dev/null +++ b/CefSharp.Example/Resources/BindingTestSync.js @@ -0,0 +1,269 @@ +QUnit.module('BindingTestSync', (hooks) => +{ + hooks.before(async () => + { + await CefSharp.BindObjectAsync("bound"); + }); + + QUnit.test("BindObjectAsync Second call with Bound param", async (assert) => + { + const res = await CefSharp.BindObjectAsync("bound"); + + assert.equal(res.Success, false, "Second call to BindObjectAsync with already bound objects as params returned false."); + }); + + QUnit.test("bound.repeat('hi ', 5)", function (assert) + { + const expectedResult = "hi hi hi hi hi " + let actualResult = bound.repeat("hi ", 5); + assert.equal(actualResult, expectedResult, "We expect value to be " + actualResult); + }); + + QUnit.test("bound.myProperty", function (assert) + { + const expectedResult = 42; + let actualResult = bound.myProperty; + + assert.equal(actualResult, expectedResult, "We expect value to be " + expectedResult); + }); + + QUnit.test("bound.subObject.simpleProperty", function (assert) + { + const expectedResult = "This is a very simple property."; + let actualResult = bound.subObject.simpleProperty; + + assert.equal(actualResult, expectedResult, "We expect value to be " + expectedResult); + + bound.subObject.simpleProperty = expectedResult + "1"; + + actualResult = bound.subObject.simpleProperty; + + assert.equal(actualResult, (expectedResult + "1"), "We expect value to be " + (expectedResult + 1)); + + //Reset to default value + bound.subObject.simpleProperty = expectedResult; + }); + + QUnit.test("Function delegate to c# method", function (assert) + { + function myFunction(functionParam) + { + return functionParam(); + } + + const expectedResult = "42" + let actualResult = myFunction(bound.echoMyProperty); + assert.equal(actualResult, expectedResult, "We expect value to be " + actualResult); + }); + + QUnit.test("Function returning complex type", function (assert) + { + function myFunction(functionParam) + { + return functionParam(); + } + + const expectedResult = "This is a very simple property." + let actualResult = bound.getSubObject().simpleProperty; + assert.equal(actualResult, expectedResult, "Call to bound.getSubObject().simpleProperty resulted in : " + actualResult); + }); + + QUnit.test("Call (echoDateTime): now", (assert) => + { + const now = new Date(); + const res = bound.echoDateTime(now); + + assert.deepEqual(res, now, "Expected echo datetime"); + }); + + QUnit.test("Call (echoDateTime): unixTimeZero", (assert) => + { + const unixTimeZero = new Date(Date.parse('01 Jan 1970 00:00:00 GMT')); + const res = bound.echoDateTime(unixTimeZero); + + assert.deepEqual(res, unixTimeZero, "Expected echo unixTimeZero"); + }); + + QUnit.test("Call (echoNullableDateTime):", (assert) => + { + const now = new Date(); + const res = bound.echoNullableDateTime(now); + + assert.deepEqual(res, now, "Expected echo datetime"); + }); + + QUnit.test("Call (echoNullableDateTime) null param:", (assert) => + { + const res = bound.echoNullableDateTime(null); + + assert.equal(res, null, "Expected null"); + }); + + QUnit.test("Stress Test", function (assert) + { + let stressTestCallCount = 1000; + for (var i = 1; i <= stressTestCallCount; i++) + { + assert.ok(true, bound.repeat("hi ", 5)); + } + + assert.ok(true, "Stress Test done with : " + stressTestCallCount + " call to bound.repeat(\"hi \", 5)"); + }); + + QUnit.test("JSON Serializer Test", function (assert) + { + var json = bound.returnJsonEmployeeList(); + var jsonObj = JSON.parse(json); + + assert.ok(jsonObj.employees.length > 0, "Employee Count : " + jsonObj.employees.length); + + var employees = jsonObj.employees; + + assert.equal("John Doe", employees[0].firstName + " " + employees[0].lastName, "Employee : " + employees[0].firstName + " " + employees[0].lastName); + assert.equal("Anna Smith", employees[1].firstName + " " + employees[1].lastName, "Employee : " + employees[1].firstName + " " + employees[1].lastName); + assert.equal("Peter Jones", employees[2].firstName + " " + employees[2].lastName, "Employee : " + employees[2].firstName + " " + employees[2].lastName); + }); + + QUnit.test("Javascript function sending variable number of parameters to Bound Object. (ParamArray Test)", function (assert) + { + assert.equal(bound.methodWithParams('With 1 Params', 'hello-world'), "Name:With 1 Params;Args:hello-world", "Method with paramArray with one param"); + assert.equal(bound.methodWithParams('With 2 Params', 'hello-world', 'chris was here'), "Name:With 2 Params;Args:hello-world, chris was here", "Method with paramArray with two params"); + assert.equal(bound.methodWithParams('With no Params'), "Name:With no Params;Args:", "Method with paramArary no params passed"); + assert.equal(bound.methodWithoutParams('Normal Method', 'hello'), "Normal Method, hello", "Method with one param (not param array)"); + assert.equal(bound.methodWithoutAnything(), "Method without anything called and returned successfully.", "Method without params"); + + assert.equal(bound.methodWithThreeParamsOneOptionalOneArray(null), "MethodWithThreeParamsOneOptionalOneArray:No Name Specified - No Optional Param Specified;Args:", "bound.methodWithThreeParamsOneOptionalOneArray(null)"); + assert.equal(bound.methodWithThreeParamsOneOptionalOneArray(null, null), "MethodWithThreeParamsOneOptionalOneArray:No Name Specified - No Optional Param Specified;Args:", "bound.methodWithThreeParamsOneOptionalOneArray(null, null)"); + assert.equal(bound.methodWithThreeParamsOneOptionalOneArray("Test", null), "MethodWithThreeParamsOneOptionalOneArray:Test - No Optional Param Specified;Args:", "bound.methodWithThreeParamsOneOptionalOneArray('Test', null)"); + assert.equal(bound.methodWithThreeParamsOneOptionalOneArray(null, null, "Arg1", "Arg2"), "MethodWithThreeParamsOneOptionalOneArray:No Name Specified - No Optional Param Specified;Args:Arg1, Arg2", "bound.methodWithThreeParamsOneOptionalOneArray(null, null, 'Arg1', 'Arg2')"); + }); + + QUnit.test("Methods and Properties on bound object 'bound':", function (assert) + { + for (var name in bound) + { + if (bound[name].constructor.name != 'Function') continue; + + assert.ok(true, "Property: " + name); + } + + for (var name in bound) + { + if (bound[name].constructor.name === 'Function') continue; + + + assert.ok(true, "Function: " + name); + } + + for (var name in bound) + { + if (typeof bound[name] == "object" && bound[name] !== null) + { + for (var sub in bound[name]) + { + var type = bound[name][sub].constructor.name === 'Function' ? "Function" : "Property"; + assert.ok(true, name + "." + sub + "(" + type + ")"); + } + } + } + }); + + QUnit.test("Javascript Callback Test using object as parameter", function (assert) + { + var asyncCallback = assert.async(); + + function objectCallback(s) + { + assert.ok(true, s); + + asyncCallback(); + } + + bound.testCallbackFromObject( + { + Callback: objectCallback, TestString: "Hello", SubClasses: + [ + { PropertyOne: "Test Property One", Numbers: [1, 2, 3] }, + { PropertyOne: "Test Property Two", Numbers: [4, 5, 6] } + ] + }); + }); + + QUnit.test("Javascript Callback Test with DateTime", function (assert) + { + var asyncCallback = assert.async(); + + function callback(dateTimeFirst, dateTimeSecondAsArray) + { + var arr = dateTimeSecondAsArray; + var dateTimeSecond = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]); + assert.equal(dateTimeFirst - dateTimeSecond, 0); + + asyncCallback(); + } + + bound.testCallbackWithDateTime(callback); + }); + + QUnit.test("Javascript Callback Test with 1900 DateTime", function (assert) + { + var asyncCallback = assert.async(); + + function callback(dateTimeFirst, dateTimeSecondAsArray) + { + var arr = dateTimeSecondAsArray; + var dateTimeSecond = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]); + assert.equal(dateTimeFirst - dateTimeSecond, 0); + + asyncCallback(); + } + + bound.testCallbackWithDateTime1900(callback); + }); + + QUnit.test("Javascript Callback Test with 1970 DateTime", function (assert) + { + var asyncCallback = assert.async(); + + function callback(dateTimeFirst, dateTimeSecondAsArray) + { + var arr = dateTimeSecondAsArray; + var dateTimeSecond = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]); + assert.equal(dateTimeFirst - dateTimeSecond, 0); + + asyncCallback(); + } + + bound.testCallbackWithDateTime1970(callback); + }); + + QUnit.test("Javascript Callback Test with 1985 DateTime", function (assert) + { + var asyncCallback = assert.async(); + + function callback(dateTimeFirst, dateTimeSecondAsArray) + { + var arr = dateTimeSecondAsArray; + var dateTimeSecond = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]); + assert.equal(dateTimeFirst - dateTimeSecond, 0); + + asyncCallback(); + } + + bound.testCallbackWithDateTime1985(callback); + }); + + QUnit.test("Javascript Callback Test", function (assert) + { + var asyncCallback = assert.async(); + + function callback(s) + { + assert.equal(s.Response, "This callback from C# was delayed 1500ms", s.Response); + + asyncCallback(); + } + + bound.testCallback(callback); + }); +}); diff --git a/CefSharp.Example/Resources/BindingTestsAsyncTask.html b/CefSharp.Example/Resources/BindingTestsAsyncTask.html new file mode 100644 index 0000000000..f3181cd362 --- /dev/null +++ b/CefSharp.Example/Resources/BindingTestsAsyncTask.html @@ -0,0 +1,176 @@ + + + + Binding Test Async Task + + + +
+ These tests require CefSharpSettings.ConcurrentTaskExecution = true; + Which by default is set to false +
+ +
+
+ + + + + + + + diff --git a/CefSharp.Example/Resources/HelloWorld.html b/CefSharp.Example/Resources/HelloWorld.html new file mode 100644 index 0000000000..1c9bad5e2c --- /dev/null +++ b/CefSharp.Example/Resources/HelloWorld.html @@ -0,0 +1,14 @@ + + + + + + Hello World + + +

Hello World

+ + + diff --git a/CefSharp.Example/Resources/Home.html b/CefSharp.Example/Resources/Home.html index a0473cde00..8fd9461bd4 100644 --- a/CefSharp.Example/Resources/Home.html +++ b/CefSharp.Example/Resources/Home.html @@ -25,15 +25,15 @@ - CefSharp + CefSharp @@ -142,7 +142,7 @@

Initialize/Shutdown Cef

} - It's important to note CEF that Initialize/Shutdown MUST be called on your main applicaiton thread (Typically the UI thead). If you call them on different + It's important to note CEF that Initialize/Shutdown MUST be called on your main application thread (typically the UI thread). If you call them on different threads, your application will hang.

@@ -158,16 +158,16 @@

Settings and Command Line Arguments

// By default CEF uses an in memory cache, to save cached data e.g. passwords you need to specify a cache path // NOTE: The executing user must have sufficent privileges to write to this folder. - settings.CachePath = "cache"; + settings.CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache"); // There are many command line arguments that can either be turned on or off // Enable WebRTC - settings.CefCommandLineArgs.Add("enable-media-stream", "1"); + settings.CefCommandLineArgs.Add("enable-media-stream"); // Don't use a proxy server, always make direct connections. Overrides any other proxy server flags that are passed. // Slightly improves Cef initialize time as it won't attempt to resolve a proxy - settings.CefCommandLineArgs.Add("no-proxy-server", "1"); + settings.CefCommandLineArgs.Add("no-proxy-server"); Cef.Initialize(settings); diff --git a/CefSharp.Example/Resources/ImageTest.html b/CefSharp.Example/Resources/ImageTest.html new file mode 100644 index 0000000000..f0a1385591 --- /dev/null +++ b/CefSharp.Example/Resources/ImageTest.html @@ -0,0 +1,12 @@ + + + + + + Image Test + + +

Image Loaded From Scheme Handler

+ + + diff --git a/CefSharp.Example/Resources/LegacyBindingTest.html b/CefSharp.Example/Resources/LegacyBindingTest.html index 859e908ecb..d75ac1cf67 100644 --- a/CefSharp.Example/Resources/LegacyBindingTest.html +++ b/CefSharp.Example/Resources/LegacyBindingTest.html @@ -1,13 +1,13 @@ - + Legacy Binding Test - +
- + diff --git a/CefSharp.Example/Resources/PopupTest.html b/CefSharp.Example/Resources/PopupTest.html index ed3fa12cf1..4286cc8d2b 100644 --- a/CefSharp.Example/Resources/PopupTest.html +++ b/CefSharp.Example/Resources/PopupTest.html @@ -1,15 +1,53 @@ - + - - Popup Test - - - target=_blank -
- window.open() -
- BindingTest.html -
- MultiBindingTest.html - + + Popup Test + + + target=_blank +
+ window.open() +
+ BindingTest.html +
+ MultiBindingTest.html +
+ + + + + diff --git a/CefSharp.Example/Resources/PopupsTest.html b/CefSharp.Example/Resources/PopupsTest.html deleted file mode 100644 index a34ce7b57f..0000000000 --- a/CefSharp.Example/Resources/PopupsTest.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Popup Test - - - target=_blank -
- window.open() - - diff --git a/CefSharp.Example/Resources/PostMessageTest.html b/CefSharp.Example/Resources/PostMessageTest.html new file mode 100644 index 0000000000..aaf4471508 --- /dev/null +++ b/CefSharp.Example/Resources/PostMessageTest.html @@ -0,0 +1,52 @@ + + + + + + Post Message Test + + + +
+
+ + + + + diff --git a/CefSharp.Example/Resources/extension.js b/CefSharp.Example/Resources/extension.js deleted file mode 100644 index 461b14e629..0000000000 --- a/CefSharp.Example/Resources/extension.js +++ /dev/null @@ -1,14 +0,0 @@ -var cefsharp; -if (!cefsharp) - cefsharp = {}; - -if (!cefsharp.example) - cefsharp.example = {}; - -(function () -{ - cefsharp.example.alert = function(text) - { - alert(text); - }; -})(); \ No newline at end of file diff --git a/CefSharp.Example/UrlRequestClient.cs b/CefSharp.Example/UrlRequestClient.cs new file mode 100644 index 0000000000..80757dccf1 --- /dev/null +++ b/CefSharp.Example/UrlRequestClient.cs @@ -0,0 +1,45 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.IO; + +namespace CefSharp.Example +{ + public class UrlRequestClient : IUrlRequestClient + { + private readonly Action completeAction; + private readonly MemoryStream responseBody = new MemoryStream(); + + public UrlRequestClient(Action completeAction) + { + this.completeAction = completeAction; + } + + bool IUrlRequestClient.GetAuthCredentials(bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback) + { + return true; + } + + void IUrlRequestClient.OnDownloadData(IUrlRequest request, Stream data) + { + data.CopyTo(responseBody); + } + + void IUrlRequestClient.OnDownloadProgress(IUrlRequest request, long current, long total) + { + + } + + void IUrlRequestClient.OnRequestComplete(IUrlRequest request) + { + this?.completeAction(request, responseBody.ToArray()); + } + + void IUrlRequestClient.OnUploadProgress(IUrlRequest request, long current, long total) + { + + } + } +} diff --git a/CefSharp.Example/WebRequestResourceHandler.cs b/CefSharp.Example/WebRequestResourceHandler.cs new file mode 100644 index 0000000000..6100308a60 --- /dev/null +++ b/CefSharp.Example/WebRequestResourceHandler.cs @@ -0,0 +1,79 @@ +// Copyright © 2016 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Collections.Specialized; +using System.IO; +using System.Net; +using System.Net.Mime; +using System.Threading.Tasks; + +namespace CefSharp.Example +{ + /// + /// A simple that uses to fulfill requests. + /// + /// + /// This example doesn't cover all cases, for example POST requests, if you'd like to see the example + /// expanded then please subit a Pull Request. + /// + public class WebRequestResourceHandler : ResourceHandler + { + public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback callback) + { + //Spawn a Task and immediately return CefReturnValue.ContinueAsync + Task.Run(async () => + { + using (callback) + { + //Create a clone of the headers so we can modify it + var headers = new NameValueCollection(request.Headers); + + var httpWebRequest = (HttpWebRequest)WebRequest.Create(request.Url); + httpWebRequest.UserAgent = headers["User-Agent"]; + httpWebRequest.Accept = headers["Accept"]; + httpWebRequest.Method = request.Method; + httpWebRequest.Referer = request.ReferrerUrl; + + //These headers must be set via the appropriate properties. + headers.Remove("User-Agent"); + headers.Remove("Accept"); + + httpWebRequest.Headers.Add(headers); + + //TODO: Deal with post data + var postData = request.PostData; + + var httpWebResponse = await httpWebRequest.GetResponseAsync() as HttpWebResponse; + + // Get the stream associated with the response. + var receiveStream = httpWebResponse.GetResponseStream(); + + var contentType = new ContentType(httpWebResponse.ContentType); + var mimeType = contentType.MediaType; + var charSet = contentType.CharSet; + var statusCode = httpWebResponse.StatusCode; + + var memoryStream = new MemoryStream(); + receiveStream.CopyTo(memoryStream); + receiveStream.Dispose(); + httpWebResponse.Dispose(); + + //Reset the stream position to 0 so the stream can be copied into the underlying unmanaged buffer + memoryStream.Position = 0; + + ResponseLength = memoryStream.Length; + MimeType = mimeType; + Charset = charSet ?? "UTF-8"; + StatusCode = (int)statusCode; + Stream = memoryStream; + AutoDisposeStream = true; + + callback.Continue(); + } + }); + + return CefReturnValue.ContinueAsync; + } + } +} diff --git a/CefSharp.Native.props b/CefSharp.Native.props index d34636ef85..7f59ab51cb 100644 --- a/CefSharp.Native.props +++ b/CefSharp.Native.props @@ -1,20 +1,38 @@ - - - - - - - - - - - + + + + + + - - - - - - \ No newline at end of file + + + + + + + locales\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + + + + + locales\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + + + diff --git a/CefSharp.OffScreen.Example/AsyncContext.cs b/CefSharp.OffScreen.Example/AsyncContext.cs new file mode 100644 index 0000000000..2d95c0a7a1 --- /dev/null +++ b/CefSharp.OffScreen.Example/AsyncContext.cs @@ -0,0 +1,38 @@ +/// https://devblogs.microsoft.com/pfxteam/await-synchronizationcontext-and-console-apps/ +/// +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace CefSharp.OffScreen.Example +{ + public static class AsyncContext + { + public static void Run(Func func) + { + var prevCtx = SynchronizationContext.Current; + + try + { + var syncCtx = new SingleThreadSynchronizationContext(); + + SynchronizationContext.SetSynchronizationContext(syncCtx); + + var t = func(); + + t.ContinueWith(delegate + { + syncCtx.Complete(); + }, TaskScheduler.Default); + + syncCtx.RunOnCurrentThread(); + + t.GetAwaiter().GetResult(); + } + finally + { + SynchronizationContext.SetSynchronizationContext(prevCtx); + } + } + } +} diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj index e765bcc086..6e8f99f875 100644 --- a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj @@ -1,104 +1,43 @@ - - - - - - - - Debug - x86 - {A4DEB90C-A529-4A93-ACE3-226A39EFCB00} - Exe - Properties - CefSharp.OffScreen.Example - CefSharp.OffScreen.Example - v4.6.2 - 512 - - - - - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - prompt - MinimumRecommendedRules.ruleset - false - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - false - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - false - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset - false - - - app.manifest - - - - - - - - - - - - - - {7b495581-2271-4f41-9476-acb86e8c864f} - CefSharp.Core - - - {a4394e7b-1155-43a6-989e-8ab72dddc9e4} - CefSharp.Example - - - {483b158d-f57d-49d9-9046-31e6a73f8a53} - CefSharp.OffScreen - - - {a55848cc-10e7-40cb-addb-04740b16dd43} - CefSharp - - - - - - - PreserveNewest - - - - - - + + + net472 + Exe + x86;x64 + MinimumRecommendedRules.ruleset + app.manifest + false + false + win-x86;win-x64 + + + + + + + + + + + + PreserveNewest + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj new file mode 100644 index 0000000000..2510ddb630 --- /dev/null +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj @@ -0,0 +1,63 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + Exe + net6.0-windows + CefSharp.OffScreen.Example + CefSharp.OffScreen.Example + false + app.manifest + MinimumRecommendedRules.ruleset + x86;x64;arm64 + + arm64 + CefSharp.OffScreen.Example.Program + + Major + win-x86;win-x64 + win-x86 + win-x64 + win-arm64 + false + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + PreserveNewest + + + + + + + + + + + + + diff --git a/CefSharp.OffScreen.Example/Program.cs b/CefSharp.OffScreen.Example/Program.cs index 84adc7b1ab..4efbbd9f2f 100644 --- a/CefSharp.OffScreen.Example/Program.cs +++ b/CefSharp.OffScreen.Example/Program.cs @@ -4,55 +4,92 @@ using System; using System.Diagnostics; -using System.Drawing; using System.IO; using System.Threading.Tasks; -using CefSharp.Example; -using CefSharp.Example.Handlers; +using CefSharp.DevTools.Page; namespace CefSharp.OffScreen.Example { public class Program { - private const string TestUrl = "https://www.google.com/"; + private const string TestUrlOne = "https://www.google.com/"; + private const string TestUrlTwo = "https://github.com/"; + private const string TestUrlThree = "https://www.google.com/doodles"; + private const string TestUrlFour = "https://microsoft.com/"; public static int Main(string[] args) { - Console.WriteLine("This example application will load {0}, take a screenshot, and save it to your desktop.", TestUrl); + Console.WriteLine("This example application will load {0}, take a screenshot, and save it to your desktop.", TestUrlOne); Console.WriteLine("You may see a lot of Chromium debugging output, please wait..."); Console.WriteLine(); - // You need to replace this with your own call to Cef.Initialize(); - CefExample.Init(new CefSettings(), browserProcessHandler: new BrowserProcessHandler()); + //Console app doesn't have a message loop which we need as Cef.Initialize/Cef.Shutdown must be called on the same + //thread. We use a super simple SynchronizationContext implementation from + //https://devblogs.microsoft.com/pfxteam/await-synchronizationcontext-and-console-apps/ + //Continuations will happen on the main thread + //The Nito.AsyncEx.Context Nuget package has a more advanced implementation + //https://github.com/StephenCleary/AsyncEx/blob/8a73d0467d40ca41f9f9cf827c7a35702243abb8/doc/AsyncContext.md#console-example-using-asynccontext - MainAsync("cachePath1", 1.0); - //Demo showing Zoom Level of 3.0 - //Using seperate request contexts allows the urls from the same domain to have independent zoom levels - //otherwise they would be the same - default behaviour of Chromium - //MainAsync("cachePath2", 3.0); + AsyncContext.Run(async delegate + { + Cef.EnableWaitForBrowsersToClose(); + + var settings = new CefSettings(); + //The location where cache data will be stored on disk. If empty an in-memory cache will be used for some features and a temporary disk cache for others. + //HTML5 databases such as localStorage will only persist across sessions if a cache path is specified. + settings.CachePath = Path.GetFullPath("cache"); + + var success = await Cef.InitializeAsync(settings); + + if (!success) + { + return; + } - // We have to wait for something, otherwise the process will exit too soon. - Console.ReadKey(); + var t1 = MainAsync(TestUrlOne, TestUrlTwo, "cache\\path1", 1.0); + //Demo showing Zoom Level of 2.0 + //Using seperate request contexts allows the urls from the same domain to have independent zoom levels + //otherwise they would be the same - default behaviour of Chromium + var t2 = MainAsync(TestUrlThree, TestUrlFour, "cache\\path2", 2.0); - // Clean up Chromium objects. You need to call this in your application otherwise - // you will get a crash when closing. - Cef.Shutdown(); + await Task.WhenAll(t1, t2); + + Console.WriteLine("Image viewer launched. Press any key to exit."); + + // Wait for user input + Console.ReadKey(); + + //Wait until the browser has finished closing (which by default happens on a different thread). + //Cef.EnableWaitForBrowsersToClose(); must be called before Cef.Initialize to enable this feature + //See https://github.com/cefsharp/CefSharp/issues/3047 for details + Cef.WaitForBrowsersToClose(); + + // Clean up Chromium objects. You need to call this in your application otherwise + // you will get a crash when closing. + Cef.Shutdown(); + }); //Success return 0; } - private static async void MainAsync(string cachePath, double zoomLevel) + private static async Task MainAsync(string url, string secondUrl, string cachePath, double zoomLevel) { - var browserSettings = new BrowserSettings(); - //Reduce rendering speed to one frame per second so it's easier to take screen shots - browserSettings.WindowlessFrameRate = 1; - var requestContextSettings = new RequestContextSettings { CachePath = cachePath }; + var browserSettings = new BrowserSettings + { + //Reduce rendering speed to one frame per second so it's easier to take screen shots + WindowlessFrameRate = 1 + }; + + var requestContextSettings = new RequestContextSettings + { + CachePath = Path.GetFullPath(cachePath) + }; // RequestContext can be shared between browser instances and allows for custom settings // e.g. CachePath using (var requestContext = new RequestContext(requestContextSettings)) - using (var browser = new ChromiumWebBrowser(TestUrl, browserSettings, requestContext)) + using (var browser = new ChromiumWebBrowser(url, browserSettings, requestContext)) { if (zoomLevel > 1) { @@ -65,7 +102,7 @@ private static async void MainAsync(string cachePath, double zoomLevel) } }; } - await LoadPageAsync(browser); + await browser.WaitForInitialLoadAsync(); //Check preferences on the CEF UI Thread await Cef.UIThreadTaskFactory.StartNew(delegate @@ -81,7 +118,10 @@ await Cef.UIThreadTaskFactory.StartNew(delegate var onUi = Cef.CurrentlyOnThread(CefThreadIds.TID_UI); // For Google.com pre-pupulate the search text box - await browser.EvaluateScriptAsync("document.getElementById('lst-ib').value = 'CefSharp Was Here!'"); + if (url.Contains("google.com")) + { + await browser.EvaluateScriptAsync("document.querySelector('[name=q]').value = 'CefSharp Was Here!'"); + } //Example using SendKeyEvent for input instead of javascript //var browserHost = browser.GetBrowserHost(); @@ -94,75 +134,74 @@ await Cef.UIThreadTaskFactory.StartNew(delegate ////Give the browser a little time to finish drawing our SendKeyEvent input //await Task.Delay(100); + var contentSize = await browser.GetContentSizeAsync(); + + var viewport = new Viewport + { + Height = contentSize.Height, + Width = contentSize.Width, + Scale = 1.0 + }; + // Wait for the screenshot to be taken, // if one exists ignore it, wait for a new one to make sure we have the most up to date - await browser.ScreenshotAsync(true).ContinueWith(DisplayBitmap); - - await LoadPageAsync(browser, "http://github.com"); + var bitmap = await browser.CaptureScreenshotAsync(viewport:viewport); - //Gets a wrapper around the underlying CefBrowser instance - var cefBrowser = browser.GetBrowser(); - // Gets a warpper around the CefBrowserHost instance - // You can perform a lot of low level browser operations using this interface - var cefHost = cefBrowser.GetHost(); + // Make a file to save it to (e.g. C:\Users\jan\Desktop\CefSharp screenshot.png) + var screenshotPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "CefSharp screenshot" + DateTime.Now.Ticks + ".png"); - //You can call Invalidate to redraw/refresh the image - cefHost.Invalidate(PaintElementType.View); + Console.WriteLine(); + Console.WriteLine("Screenshot ready. Saving to {0}", screenshotPath); - // Wait for the screenshot to be taken. - await browser.ScreenshotAsync(true).ContinueWith(DisplayBitmap); - } - } + File.WriteAllBytes(screenshotPath, bitmap); - public static Task LoadPageAsync(IWebBrowser browser, string address = null) - { - var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + Console.WriteLine("Screenshot saved. Launching your default image viewer..."); - EventHandler handler = null; - handler = (sender, args) => - { - //Wait for while page to finish loading not just the first frame - if (!args.IsLoading) + // Tell Windows to launch the saved image. + Process.Start(new ProcessStartInfo(screenshotPath) { - browser.LoadingStateChanged -= handler; - //Important that the continuation runs async using TaskCreationOptions.RunContinuationsAsynchronously - tcs.TrySetResult(true); - } - }; + // UseShellExecute is false by default on .NET Core. + UseShellExecute = true + }); - browser.LoadingStateChanged += handler; + await browser.LoadUrlAsync(secondUrl); - if (!string.IsNullOrEmpty(address)) - { - browser.Load(address); - } - return tcs.Task; - } + // Gets a warpper around the CefBrowserHost instance + // You can perform a lot of low level browser operations using this interface + var cefbrowserHost = browser.GetBrowserHost(); - private static void DisplayBitmap(Task task) - { - // Make a file to save it to (e.g. C:\Users\jan\Desktop\CefSharp screenshot.png) - var screenshotPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "CefSharp screenshot" + DateTime.Now.Ticks + ".png"); + //You can call Invalidate to redraw/refresh the image + cefbrowserHost.Invalidate(PaintElementType.View); - Console.WriteLine(); - Console.WriteLine("Screenshot ready. Saving to {0}", screenshotPath); + contentSize = await browser.GetContentSizeAsync(); - var bitmap = task.Result; + viewport = new Viewport + { + Height = contentSize.Height, + Width = contentSize.Width, + Scale = 1.0 + }; - // Save the Bitmap to the path. - // The image type is auto-detected via the ".png" extension. - bitmap.Save(screenshotPath); + // Wait for the screenshot to be taken, + // if one exists ignore it, wait for a new one to make sure we have the most up to date + bitmap = await browser.CaptureScreenshotAsync(viewport: viewport); + + screenshotPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "CefSharp screenshot" + DateTime.Now.Ticks + ".png"); - // We no longer need the Bitmap. - // Dispose it to avoid keeping the memory alive. Especially important in 32-bit applications. - bitmap.Dispose(); + Console.WriteLine(); + Console.WriteLine("Screenshot ready. Saving to {0}", screenshotPath); - Console.WriteLine("Screenshot saved. Launching your default image viewer..."); + File.WriteAllBytes(screenshotPath, bitmap); - // Tell Windows to launch the saved image. - Process.Start(screenshotPath); + Console.WriteLine("Screenshot saved. Launching your default image viewer..."); - Console.WriteLine("Image viewer launched. Press any key to exit."); + // Tell Windows to launch the saved image. + Process.Start(new ProcessStartInfo(screenshotPath) + { + // UseShellExecute is false by default on .NET Core. + UseShellExecute = true + }); + } } } } diff --git a/CefSharp.OffScreen.Example/SingleThreadSynchronizationContext.cs b/CefSharp.OffScreen.Example/SingleThreadSynchronizationContext.cs new file mode 100644 index 0000000000..b42b7f7e33 --- /dev/null +++ b/CefSharp.OffScreen.Example/SingleThreadSynchronizationContext.cs @@ -0,0 +1,34 @@ +/// https://devblogs.microsoft.com/pfxteam/await-synchronizationcontext-and-console-apps/ + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace CefSharp.OffScreen.Example +{ + public sealed class SingleThreadSynchronizationContext : SynchronizationContext + { + private readonly BlockingCollection> queue = + new BlockingCollection>(); + + public override void Post(SendOrPostCallback d, object state) + { + queue.Add(new KeyValuePair(d, state)); + } + + public void RunOnCurrentThread() + { + while (queue.TryTake(out var workItem, Timeout.Infinite)) + { + workItem.Key(workItem.Value); + } + } + + public void Complete() + { + queue.CompleteAdding(); + } + } +} diff --git a/CefSharp.OffScreen.Example/app.config b/CefSharp.OffScreen.Example/app.config index ac5aa757cc..5c22b42e59 100644 --- a/CefSharp.OffScreen.Example/app.config +++ b/CefSharp.OffScreen.Example/app.config @@ -1,3 +1,3 @@ - + diff --git a/CefSharp.OffScreen.Example/app.manifest b/CefSharp.OffScreen.Example/app.manifest index 3fae1d99c6..d21303c10d 100644 --- a/CefSharp.OffScreen.Example/app.manifest +++ b/CefSharp.OffScreen.Example/app.manifest @@ -7,7 +7,7 @@ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + @@ -28,24 +28,12 @@ - - - true/PM - - - - - - - - - - + diff --git a/CefSharp.OffScreen.Example/packages.config b/CefSharp.OffScreen.Example/packages.config deleted file mode 100644 index 75bf7d42e6..0000000000 --- a/CefSharp.OffScreen.Example/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CefSharp.OffScreen/CefSettings.cs b/CefSharp.OffScreen/CefSettings.cs index cbdcc9d018..5ec6614bcf 100644 --- a/CefSharp.OffScreen/CefSettings.cs +++ b/CefSharp.OffScreen/CefSettings.cs @@ -8,7 +8,7 @@ namespace CefSharp.OffScreen /// Initialization settings. Many of these and other settings can also configured /// using command-line switches. /// - public class CefSettings : AbstractCefSettings + public class CefSettings : CefSettingsBase { /// /// Intialize with default values @@ -19,7 +19,20 @@ public CefSettings() : base() //For OffScreen it doesn't make much sense to enable audio by default, so we disable it. //this can be removed in user code if required - CefCommandLineArgs.Add("mute-audio", "1"); + CefCommandLineArgs.Add("mute-audio"); + + // CEF doesn't call GetAuthCredentials unless + // the Chrome login prompt is disabled + // https://github.com/chromiumembedded/cef/issues/3603 + CefCommandLineArgs.Add("disable-chrome-login-prompt"); + + // Disable "Restore pages" popup after incorrect shutdown + // https://github.com/chromiumembedded/cef/issues/3767 + CefCommandLineArgs.Add("hide-crash-restore-bubble"); + + // Disable the back-forward cache + // https://github.com/cefsharp/CefSharp/issues/4621 + CefCommandLineArgs.Add("disable-back-forward-cache"); } /// @@ -28,7 +41,7 @@ public CefSettings() : base() /// public void EnableAudio() { - if(CefCommandLineArgs.ContainsKey("mute-audio")) + if (CefCommandLineArgs.ContainsKey("mute-audio")) { CefCommandLineArgs.Remove("mute-audio"); } diff --git a/CefSharp.OffScreen/CefSharp.OffScreen.csproj b/CefSharp.OffScreen/CefSharp.OffScreen.csproj index 5fa8b02f82..72b4a5f044 100644 --- a/CefSharp.OffScreen/CefSharp.OffScreen.csproj +++ b/CefSharp.OffScreen/CefSharp.OffScreen.csproj @@ -1,102 +1,53 @@ - - - + - Debug - x86 - {483B158D-F57D-49D9-9046-31E6A73F8A53} + net462 Library - Properties - CefSharp.OffScreen - CefSharp.OffScreen - v4.5.2 - 512 - - + true + ..\CefSharp.snk + false + MinimumRecommendedRules.ruleset - - true - bin\x64\Debug\ - DEBUG;TRACE + + + DEBUG;TRACE;OFFSCREEN full - x64 - prompt - MinimumRecommendedRules.ruleset - bin\x64\Debug\CefSharp.OffScreen.xml - false - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - bin\x64\Release\CefSharp.OffScreen.xml - false - + + TRACE;OFFSCREEN + bin\Release\CefSharp.OffScreen.xml true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - bin\x86\Debug\CefSharp.OffScreen.xml - 1591 - false - - - bin\x86\Release\ - TRACE true pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset - bin\x86\Release\CefSharp.OffScreen.xml - false - - - true - - - ..\CefSharp.snk + - - - - + + - - - - - - - - + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - {7b495581-2271-4f41-9476-acb86e8c864f} - CefSharp.Core - - - {a55848cc-10e7-40cb-addb-04740b16dd43} - CefSharp - + + + + + + + + - - \ No newline at end of file diff --git a/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj b/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj new file mode 100644 index 0000000000..a23bbf9d5e --- /dev/null +++ b/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj @@ -0,0 +1,57 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + net6.0-windows + CefSharp.OffScreen + CefSharp.OffScreen + $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + true + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + OFFSCREEN + + + + true + true + True + embedded + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.OffScreen/ChromiumWebBrowser.cs b/CefSharp.OffScreen/ChromiumWebBrowser.cs index 5b7d74f99d..d77013131a 100644 --- a/CefSharp.OffScreen/ChromiumWebBrowser.cs +++ b/CefSharp.OffScreen/ChromiumWebBrowser.cs @@ -7,10 +7,13 @@ using System.Drawing.Imaging; using System.Threading; using System.Threading.Tasks; +using CefSharp.DevTools.Page; using CefSharp.Enums; using CefSharp.Internals; using CefSharp.Structs; +using CefSharp.Web; using Point = System.Drawing.Point; +using Range = CefSharp.Structs.Range; using Size = System.Drawing.Size; namespace CefSharp.OffScreen @@ -19,13 +22,12 @@ namespace CefSharp.OffScreen /// An offscreen instance of Chromium that you can use to take /// snapshots or evaluate JavaScript. /// - /// - public class ChromiumWebBrowser : IRenderWebBrowser + public partial class ChromiumWebBrowser : IRenderWebBrowser { /// /// The managed cef browser adapter /// - private ManagedCefBrowserAdapter managedCefBrowserAdapter; + private IBrowserAdapter managedCefBrowserAdapter; /// /// Size of the Chromium viewport. @@ -35,20 +37,27 @@ public class ChromiumWebBrowser : IRenderWebBrowser private Size size = new Size(1366, 768); /// - /// The browser + /// Flag to guard the creation of the underlying offscreen browser - only one instance can be created /// - private IBrowser browser; + private bool browserCreated; /// - /// Flag to guard the creation of the underlying offscreen browser - only one instance can be created + /// When an empty address is passed into the constructor, we defer browser creation + /// until we have a Url. + /// Issue https://github.com/cefsharp/CefSharp/issues/4832 /// - private bool browserCreated; + private bool createBrowserOnNextLoadUrlCall; + /// + /// BrowserSettings used by createBrowserOnNextLoadCall + /// + private IBrowserSettings browserSettings; /// - /// The value for disposal, if it's 1 (one) then this instance is either disposed - /// or in the process of getting disposed + /// Action which is called immediately before the event after the + /// uderlying Chromium Embedded Framework (CEF) browser has been created. /// - private int disposeSignaled; + private Action onAfterBrowserCreatedDelegate; + private float deviceScaleFactor = 1.0f; /// /// Gets a value indicating whether this instance is disposed. @@ -66,9 +75,10 @@ public bool IsDisposed /// A flag that indicates whether the WebBrowser is initialized (true) or not (false). /// /// true if this instance is browser initialized; otherwise, false. - /// In the WPF control, this property is implemented as a Dependency Property and fully supports data - /// binding. - public bool IsBrowserInitialized { get; private set; } + public bool IsBrowserInitialized + { + get { return InternalIsBrowserInitialized(); } + } /// /// A flag that indicates whether the control is currently loading one or more web pages (true) or not (false). /// @@ -109,157 +119,29 @@ public bool IsDisposed /// The request context. public IRequestContext RequestContext { get; private set; } /// - /// Implement and assign to handle events related to JavaScript Dialogs. - /// - /// The js dialog handler. - public IJsDialogHandler JsDialogHandler { get; set; } - /// - /// Implement and assign to handle dialog events. - /// - /// The dialog handler. - public IDialogHandler DialogHandler { get; set; } - /// - /// Implement and assign to handle events related to downloading files. - /// - /// The download handler. - public IDownloadHandler DownloadHandler { get; set; } - /// - /// Implement and assign to handle events related to key press. - /// - /// The keyboard handler. - public IKeyboardHandler KeyboardHandler { get; set; } - /// - /// Implement and assign to handle events related to browser load status. - /// - /// The load handler. - public ILoadHandler LoadHandler { get; set; } - /// - /// Implement and assign to handle events related to popups. - /// - /// The life span handler. - public ILifeSpanHandler LifeSpanHandler { get; set; } - /// - /// Implement and assign to handle events related to browser display state. - /// - /// The display handler. - public IDisplayHandler DisplayHandler { get; set; } - /// - /// Implement and assign to handle events related to the browser context menu - /// - /// The menu handler. - public IContextMenuHandler MenuHandler { get; set; } - /// - /// Implement and assign to handle events related to the browser component's focus - /// - /// The focus handler. - public IFocusHandler FocusHandler { get; set; } - /// - /// Implement and assign to handle events related to browser requests. - /// - /// The request handler. - public IRequestHandler RequestHandler { get; set; } - /// /// Implement and assign to handle events related to browser rendering. /// /// The render handler. public IRenderHandler RenderHandler { get; set; } /// - /// Implement and assign to handle events related to dragging. - /// - /// The drag handler. - public IDragHandler DragHandler { get; set; } - /// - /// Implement and control the loading of resources - /// - /// The resource handler factory. - public IResourceHandlerFactory ResourceHandlerFactory { get; set; } - /// - /// Implement and assign to handle messages from the render process. - /// - /// The render process message handler. - public IRenderProcessMessageHandler RenderProcessMessageHandler { get; set; } - /// - /// Implement to handle events related to find results. - /// - /// The find handler. - public IFindHandler FindHandler { get; set; } - /// - /// Implement to handle audio events. - /// - public IAudioHandler AudioHandler { get; set; } - /// /// Implement to handle events related to accessibility. /// /// The accessibility handler. public IAccessibilityHandler AccessibilityHandler { get; set; } /// - /// Event handler that will get called when the resource load for a navigation fails or is canceled. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - public event EventHandler LoadError; - /// - /// Event handler that will get called when the browser begins loading a frame. Multiple frames may be loading at the same - /// time. Sub-frames may start or continue loading after the main frame load has ended. This method may not be called for a - /// particular frame if the load request for that frame fails. For notification of overall browser load status use - /// OnLoadingStateChange instead. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - /// Whilst this may seem like a logical place to execute js, it's called before the DOM has been loaded, implement - /// as it's called when the underlying V8Context is created - /// - public event EventHandler FrameLoadStart; - /// - /// Event handler that will get called when the browser is done loading a frame. Multiple frames may be loading at the same - /// time. Sub-frames may start or continue loading after the main frame load has ended. This method will always be called - /// for all frames irrespective of whether the request completes successfully. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - public event EventHandler FrameLoadEnd; - /// - /// Event handler for receiving Javascript console messages being sent from web pages. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// (The exception to this is when your running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). - /// - public event EventHandler ConsoleMessage; - /// /// Event called after the underlying CEF browser instance has been created. /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// (The exception to this is when your running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). + /// (The exception to this is when you're running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). /// public event EventHandler BrowserInitialized; /// - /// Event handler for changes to the status message. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// (The exception to this is when your running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). - /// - public event EventHandler StatusMessage; - /// - /// Event handler that will get called when the Loading state has changed. - /// This event will be fired twice. Once when loading is initiated either programmatically or - /// by user action, and once when loading is terminated due to completion, cancellation of failure. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - public event EventHandler LoadingStateChanged; - /// - /// Occurs when [address changed]. + /// Occurs when the browser address changed. /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// (The exception to this is when your running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). + /// (The exception to this is when you're running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). /// public event EventHandler AddressChanged; /// @@ -267,7 +149,7 @@ public bool IsDisposed /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// (The exception to this is when your running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). + /// (The exception to this is when you're running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). /// public event EventHandler TitleChanged; @@ -279,48 +161,96 @@ public bool IsDisposed public event EventHandler Paint; /// - /// A flag that indicates if you can execute javascript in the main frame. - /// Flag is set to true in IRenderProcessMessageHandler.OnContextCreated. - /// and false in IRenderProcessMessageHandler.OnContextReleased + /// Used by as the + /// event happens before the bitmap buffer is updated. We do this to allow users to mark + /// to true and stop the buffer from being updated. /// - public bool CanExecuteJavascriptInMainFrame { get; private set; } + private event EventHandler AfterPaint; /// - /// Create a new OffScreen Chromium Browser. If you use = true then you must + /// Create a new OffScreen Chromium Browser. If you use = true then you must /// set to false and call after the objects are registered. + /// The underlying Chromium Embedded Framework(CEF) Browser is created asynchronouly, to subscribe to the event it is recommended + /// that you set to false, subscribe to the event and then call + /// to ensure you are subscribe to the event before it's fired (Issue https://github.com/cefsharp/CefSharp/issues/3552). /// - /// Initial address (url) to load + /// html string to be initially loaded in the browser. /// The browser settings to use. If null, the default settings are used. /// See for more details. Defaults to null /// automatically create the underlying Browser + /// + /// Use as an alternative to the event. If the underlying Chromium Embedded Framework (CEF) browser is created successfully, + /// this action is guranteed to be called after the browser created where as the event may be called before + /// you have a chance to subscribe to the event as the CEF Browser is created async. (Issue https://github.com/cefsharp/CefSharp/issues/3552). + /// + /// + /// For those using or then + /// this must be true, for those using this can be false. + /// Lower memory usage when false. Defaults to true for backwards compatability. + /// /// Cef::Initialize() failed - public ChromiumWebBrowser(string address = "", BrowserSettings browserSettings = null, - RequestContext requestContext = null, bool automaticallyCreateBrowser = true) + public ChromiumWebBrowser(HtmlString html, IBrowserSettings browserSettings = null, + IRequestContext requestContext = null, bool automaticallyCreateBrowser = true, + Action onAfterBrowserCreated = null, bool useLegacyRenderHandler = true) : this(html.ToDataUriString(), browserSettings, requestContext, automaticallyCreateBrowser, onAfterBrowserCreated, useLegacyRenderHandler) { - if (!Cef.IsInitialized) - { - var settings = new CefSettings(); + } - if (!Cef.Initialize(settings)) - { - throw new InvalidOperationException("Cef::Initialize() failed"); - } - } + /// + /// Create a new OffScreen Chromium Browser. If you use = true then you must + /// set to false and call after the objects are registered. + /// The underlying Chromium Embedded Framework(CEF) Browser is created asynchronouly, to subscribe to the event it is recommended + /// that you set to false, subscribe to the event and then call + /// to ensure you are subscribe to the event before it's fired (Issue https://github.com/cefsharp/CefSharp/issues/3552). + /// + /// + /// Initial address (url) to load. If then cretion of the browser + /// will be deferred until is called with a non empty Url. + /// + /// The browser settings to use. If null, the default settings are used. + /// See for more details. Defaults to null + /// automatically create the underlying Browser + /// + /// Use as an alternative to the event. If the underlying Chromium Embedded Framework (CEF) browser is created successfully, + /// this action is guranteed to be called after the browser created where as the event may be called before + /// you have a chance to subscribe to the event as the CEF Browser is created async. (Issue https://github.com/cefsharp/CefSharp/issues/3552). + /// + /// + /// For those using or then + /// this must be true, for those using this can be false. + /// Lower memory usage when false. Defaults to true for backwards compatability. + /// + /// Cef::Initialize() failed + public ChromiumWebBrowser(string address = "", IBrowserSettings browserSettings = null, + IRequestContext requestContext = null, bool automaticallyCreateBrowser = true, + Action onAfterBrowserCreated = null, bool useLegacyRenderHandler = true) + { + InitializeCefInternal(); - ResourceHandlerFactory = new DefaultResourceHandlerFactory(); RequestContext = requestContext; Cef.AddDisposable(this); Address = address; + onAfterBrowserCreatedDelegate = onAfterBrowserCreated; - managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, true); + managedCefBrowserAdapter = ManagedCefBrowserAdapter.Create(this, true); if (automaticallyCreateBrowser) { - CreateBrowser(null, browserSettings); + if (string.IsNullOrEmpty(address)) + { + createBrowserOnNextLoadUrlCall = true; + this.browserSettings = browserSettings; + } + else + { + CreateBrowser(null, browserSettings); + } } - RenderHandler = new DefaultRenderHandler(this); + if (useLegacyRenderHandler) + { + RenderHandler = new DefaultRenderHandler(this); + } } /// @@ -355,7 +285,16 @@ protected virtual void Dispose(bool disposing) if (disposing) { - IsBrowserInitialized = false; + CanExecuteJavascriptInMainFrame = false; + Interlocked.Exchange(ref browserInitialized, 0); + + //Stop rendering immediately so later on when we dispose of the + //RenderHandler no further OnPaint calls take place + //Check browser not null as it's possible to call Dispose before it's created + if (browser?.IsDisposed == false) + { + browser?.GetHost().WasHidden(true); + } // Don't reference event listeners any longer: AddressChanged = null; @@ -366,14 +305,21 @@ protected virtual void Dispose(bool disposing) LoadError = null; LoadingStateChanged = null; Paint = null; + AfterPaint = null; StatusMessage = null; TitleChanged = null; + JavascriptMessageReceived = null; // Release reference to handlers, except LifeSpanHandler which is done after Disposing // ManagedCefBrowserAdapter otherwise the ILifeSpanHandler.DoClose will not be invoked. - this.SetHandlersToNullExceptLifeSpan(); + // We also leave FocusHandler and override with a NoFocusHandler implementation as + // it so we can block taking Focus (we're dispoing afterall). Issue #3715 + FreeHandlersExceptLifeSpanAndFocus(); + + FocusHandler = new NoFocusHandler(); browser = null; + BrowserCore = null; if (managedCefBrowserAdapter != null) { @@ -384,6 +330,13 @@ protected virtual void Dispose(bool disposing) // LifeSpanHandler is set to null after managedCefBrowserAdapter.Dispose so ILifeSpanHandler.DoClose // is called. LifeSpanHandler = null; + + //Take a copy of the RenderHandler then set to property to null + //Before we dispose, reduces the changes of any OnPaint calls + //using the RenderHandler after Dispose + var renderHandler = RenderHandler; + RenderHandler = null; + renderHandler?.Dispose(); } Cef.RemoveDisposable(this); @@ -395,7 +348,7 @@ protected virtual void Dispose(bool disposing) /// Window information used when creating the browser /// Browser initialization settings /// An instance of the underlying offscreen browser has already been created, this method can only be called once. - public void CreateBrowser(IWindowInfo windowInfo = null, BrowserSettings browserSettings = null) + public void CreateBrowser(IWindowInfo windowInfo = null, IBrowserSettings browserSettings = null) { if (browserCreated) { @@ -406,18 +359,70 @@ public void CreateBrowser(IWindowInfo windowInfo = null, BrowserSettings browser if (browserSettings == null) { - browserSettings = new BrowserSettings(frameworkCreated: true); + browserSettings = Core.ObjectFactory.CreateBrowserSettings(autoDispose: true); } if (windowInfo == null) { - windowInfo = new WindowInfo(); + windowInfo = Core.ObjectFactory.CreateWindowInfo(); windowInfo.SetAsWindowless(IntPtr.Zero); } - managedCefBrowserAdapter.CreateBrowser(windowInfo, browserSettings, (RequestContext)RequestContext, Address); + //TODO: We need some sort of timeout and + //if we use the same approach for WPF/WinForms then + //we need to move the common code into the partial class + GlobalContextInitialized.ExecuteOrEnqueue((success) => + { + if(!success) + { + return; + } + + managedCefBrowserAdapter.CreateBrowser(windowInfo, browserSettings, RequestContext, Address); + + //Dispose of BrowserSettings if we created it, if user created then they're responsible + if (browserSettings.AutoDispose) + { + browserSettings.Dispose(); + } + browserSettings = null; + + }); + + } + + /// + /// Create the underlying CEF browser. The address and request context passed into the constructor + /// will be used. If a delegate was passed + /// into the constructor it will not be called as this method overrides that value internally. + /// + /// Window information used when creating the browser + /// Browser initialization settings + /// An instance of the underlying offscreen browser has already been created, this method can only be called once. + /// + /// A that represents the creation of the underlying CEF browser ( instance. + /// When the task completes then the CEF Browser will have been created and you can start performing basic tasks. + /// Note that the control's event will be invoked after this task completes. + /// + public Task CreateBrowserAsync(IWindowInfo windowInfo = null, IBrowserSettings browserSettings = null) + { + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + onAfterBrowserCreatedDelegate += new Action(b => + { + tcs.TrySetResult(b); + }); + + try + { + CreateBrowser(windowInfo, browserSettings); + } + catch(Exception ex) + { + tcs.TrySetException(ex); + } - browserSettings = null; + return tcs.Task; } /// @@ -442,6 +447,23 @@ public Size Size } } + /// + /// Device scale factor. Specifies the ratio between physical and logical pixels. + /// + public float DeviceScaleFactor + { + get { return deviceScaleFactor; } + set + { + deviceScaleFactor = value; + + if (IsBrowserInitialized) + { + browser.GetHost().NotifyScreenInfoChanged(); + } + } + } + /// /// Immediately returns a copy of the last rendering from Chrome, /// or null if no rendering has occurred yet. @@ -504,50 +526,267 @@ public Bitmap ScreenshotOrNull(PopupBlending blend = PopupBlending.Main) /// It is your responsibility to dispose the returned Bitmap. /// The bitmap size is determined by the Size property set earlier. /// - /// Ignore existing bitmap (if any) and return the next avaliable bitmap + /// Ignore existing bitmap (if any) and return the next available bitmap /// Choose which bitmap to retrieve, choose for a merged bitmap. /// Task<Bitmap>. + [Obsolete("Use CaptureScreenshotAsync instead.")] public Task ScreenshotAsync(bool ignoreExistingScreenshot = false, PopupBlending blend = PopupBlending.Main) { + ThrowExceptionIfDisposed(); + // Try our luck and see if there is already a screenshot, to save us creating a new thread for nothing. var screenshot = ScreenshotOrNull(blend); - var completionSource = new TaskCompletionSource(); + var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); if (screenshot == null || ignoreExistingScreenshot) { - EventHandler paint = null; // otherwise we cannot reference ourselves in the anonymous method below + EventHandler afterPaint = null; // otherwise we cannot reference ourselves in the anonymous method below - paint = (sender, e) => + afterPaint = (sender, e) => { // Chromium has rendered. Tell the task about it. - Paint -= paint; + AfterPaint -= afterPaint; - completionSource.TrySetResultAsync(ScreenshotOrNull(blend)); + //If the user handled the Paint event then we'll throw an exception here + //as it's not possible to use ScreenShotAsync as the buffer wasn't updated. + if (e.Handled) + { + completionSource.TrySetException(new InvalidOperationException("OnPaintEventArgs.Handled = true, unable to process request. The buffer has not been updated")); + } + else + { + completionSource.TrySetResult(ScreenshotOrNull(blend)); + } }; - Paint += paint; + AfterPaint += afterPaint; } else { - completionSource.TrySetResultAsync(screenshot); + completionSource.TrySetResult(screenshot); } return completionSource.Task; } /// - /// Loads the specified URL. + /// Capture page screenshot. + /// + /// Image compression format (defaults to png). + /// Compression quality from range [0..100] (jpeg only). + /// view port to capture, if not null the browser will be resized if the requested width/height + /// are larger than the current browser . + /// A task that can be awaited to obtain the screenshot as a byte[]. + public async Task CaptureScreenshotAsync(CaptureScreenshotFormat? format = null, int? quality = null, Viewport viewport = null) + { + ThrowExceptionIfDisposed(); + ThrowExceptionIfBrowserNotInitialized(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + if (viewport == null) + { + var screenShot = await devToolsClient.Page.CaptureScreenshotAsync(format, quality, fromSurface: true).ConfigureAwait(continueOnCapturedContext: false); + + return screenShot.Data; + } + + if (viewport.Scale <= 0) + { + throw new ArgumentException($"{nameof(viewport)}.{nameof(viewport.Scale)} must be greater than 0."); + } + + //https://github.com/chromiumembedded/cef/issues/3103 + //CEF OSR mode doesn't set the size internally when CaptureScreenShot is called with a clip param specified, so + //we must manually resize our view if size is greater + var newWidth = viewport.Width + viewport.X; + if (newWidth < size.Width) + { + newWidth = size.Width; + } + var newHeight = viewport.Height + viewport.Y; + if (newHeight < size.Height) + { + newHeight = size.Height; + } + + if ((int)newWidth > size.Width || (int)newHeight > size.Height || viewport.Scale != deviceScaleFactor) + { + await ResizeAsync((int)newWidth, (int)newHeight, (float)viewport.Scale).ConfigureAwait(continueOnCapturedContext:false); + } + + //Create a copy instead of modifying users object as we need to set Scale to 1 + //as CEF doesn't support passing custom scale for OSR. + var clip = new Viewport + { + Height = viewport.Height, + Width = viewport.Width, + X = viewport.X, + Y = viewport.Y, + Scale = 1 + }; + + var response = await devToolsClient.Page.CaptureScreenshotAsync(format, quality, clip: clip, fromSurface: true).ConfigureAwait(continueOnCapturedContext: false); + + return response.Data; + } + } + + /// + /// Resize the browser /// - /// The URL to be loaded. + /// width + /// height + /// device scale factor + /// A task that can be awaited and will resolve when the desired size is achieved. + /// + /// The current implementation is fairly symplistic, it simply resizes the browser + /// and resolves the task when the browser starts painting at the desired size. + /// + public Task ResizeAsync(int width, int height, float? deviceScaleFactor = null) + { + ThrowExceptionIfDisposed(); + ThrowExceptionIfBrowserNotInitialized(); + + if (size.Width == width && size.Height == height && (deviceScaleFactor == null || deviceScaleFactor == DeviceScaleFactor)) + { + return Task.FromResult(true); + } + + var scaledWidth = (int)(width * DeviceScaleFactor); + var scaledHeight = (int)(height * DeviceScaleFactor); + + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + EventHandler handler = null; + + handler = (s, e) => + { + if (e.Width == scaledWidth && e.Height == scaledHeight) + { + AfterPaint -= handler; + + tcs.TrySetResult(true); + } + }; + + AfterPaint += handler; + + //Only set the value if not null otherwise + //a call to NotifyScreenInfoChanged will be made. + if (deviceScaleFactor.HasValue) + { + scaledWidth = (int)(width * deviceScaleFactor.Value); + scaledHeight = (int)(height * deviceScaleFactor.Value); + DeviceScaleFactor = deviceScaleFactor.Value; + } + Size = new Size(width, height); + + return tcs.Task; + } + + /// public void Load(string url) { - Address = url; + if (IsDisposed) + { + return; + } + + if (createBrowserOnNextLoadUrlCall) + { + createBrowserOnNextLoadUrlCall = false; + Address = url; + CreateBrowser(null, browserSettings); + browserSettings = null; + + return; + } + + //There's a small window here between CreateBrowser + //and OnAfterBrowserCreated where the Address prop + //will be updated, though LoadUrl won't be called. + if (IsBrowserInitialized) + { + using (var frame = this.GetMainFrame()) + { + frame.LoadUrl(url); + } + } + else + { + Address = url; + } + } + + /// + /// Waits for the page rendering to be idle for . + /// Rendering is considered to be idle when no events have occured + /// for . + /// This is useful for scenarios like taking a screen shot. + /// + /// optional idleTime in miliseconds, default to 500ms + /// optional timeout, if not specified defaults to thirty(30) seconds. + /// optional CancellationToken + /// Task that resolves when page rendering has been idle for + public async Task WaitForRenderIdleAsync(int idleTimeInMs = 500, TimeSpan? timeout = null, CancellationToken cancellationToken = default) + { + var renderIdleTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + var idleTimer = new System.Timers.Timer + { + Interval = idleTimeInMs, + AutoReset = false + }; + + EventHandler handler = null; + + idleTimer.Elapsed += (sender, args) => + { + Paint -= handler; + + idleTimer.Stop(); + idleTimer.Dispose(); + + renderIdleTcs.TrySetResult(true); + }; + + //Every time Paint is called we reset our timer + handler = (s, args) => + { + try + { + idleTimer?.Stop(); + idleTimer?.Start(); + } + catch (ObjectDisposedException) + { + // NOTE: When the Elapsed (or Timeout) and Paint are fire at almost exactly + // the same time, the timer maybe Disposed on a different thread. + // https://github.com/cefsharp/CefSharp/issues/4597 + } + catch(Exception ex) + { + renderIdleTcs.TrySetException(ex); + } + }; + + idleTimer.Start(); + + Paint += handler; - //Destroy the frame wrapper when we're done - using (var frame = this.GetMainFrame()) + try { - frame.LoadUrl(url); + await TaskTimeoutExtensions.WaitAsync(renderIdleTcs.Task, timeout ?? TimeSpan.FromSeconds(30), cancellationToken).ConfigureAwait(false); + } + catch(Exception) + { + Paint -= handler; + + idleTimer?.Stop(); + idleTimer?.Dispose(); + + throw; } } @@ -563,7 +802,7 @@ public IJavascriptObjectRepository JavascriptObjectRepository /// Has Focus - Always False /// /// returns false - bool IWebBrowser.Focus() + bool IChromiumWebBrowserBase.Focus() { // no control to focus for offscreen browser return false; @@ -575,7 +814,8 @@ bool IWebBrowser.Focus() /// browser instance or null public IBrowser GetBrowser() { - this.ThrowExceptionIfBrowserNotInitialized(); + ThrowExceptionIfDisposed(); + ThrowExceptionIfBrowserNotInitialized(); return browser; } @@ -595,7 +835,16 @@ public IBrowser GetBrowser() /// ScreenInfo. protected virtual ScreenInfo? GetScreenInfo() { - return RenderHandler?.GetScreenInfo(); + var renderHandler = RenderHandler; + + if(renderHandler == null) + { + var screenInfo = new ScreenInfo { DeviceScaleFactor = DeviceScaleFactor }; + + return screenInfo; + } + + return renderHandler.GetScreenInfo(); } /// @@ -613,12 +862,18 @@ Rect IRenderWebBrowser.GetViewRect() /// ViewRect. protected virtual Rect GetViewRect() { - if (RenderHandler == null) + var renderHandler = RenderHandler; + + if (renderHandler == null) { - return new Rect(0, 0, 640, 480); + var size = Size; + + var viewRect = new Rect(0, 0, size.Width, size.Height); + + return viewRect; } - return RenderHandler.GetViewRect(); + return renderHandler.GetViewRect(); } /// @@ -650,16 +905,10 @@ protected virtual bool GetScreenPoint(int viewX, int viewY, out int screenX, out return RenderHandler?.GetScreenPoint(viewX, viewY, out screenX, out screenY) ?? false; } - /// - /// Called when an element has been rendered to the shared texture handle. - /// This method is only called when is set to true - /// - /// indicates whether the element is the view or the popup widget. - /// contains the set of rectangles in pixel coordinates that need to be repainted - /// is the handle for a D3D11 Texture2D that can be accessed via ID3D11Device using the OpenSharedResource method. - void IRenderWebBrowser.OnAcceleratedPaint(PaintElementType type, Rect dirtyRect, IntPtr sharedHandle) + /// + void IRenderWebBrowser.OnAcceleratedPaint(PaintElementType type, Rect dirtyRect, AcceleratedPaintInfo acceleratedPaintInfo) { - RenderHandler?.OnAcceleratedPaint(type, dirtyRect, sharedHandle); + RenderHandler?.OnAcceleratedPaint(type, dirtyRect, acceleratedPaintInfo); } /// @@ -674,10 +923,11 @@ void IRenderWebBrowser.OnPaint(PaintElementType type, Rect dirtyRect, IntPtr buf { var handled = false; + var args = new OnPaintEventArgs(type == PaintElementType.Popup, dirtyRect, buffer, width, height); + var handler = Paint; if (handler != null) { - var args = new OnPaintEventArgs(type == PaintElementType.Popup, dirtyRect, buffer, width, height); handler(this, args); handled = args.Handled; } @@ -686,6 +936,12 @@ void IRenderWebBrowser.OnPaint(PaintElementType type, Rect dirtyRect, IntPtr buf { RenderHandler?.OnPaint(type, dirtyRect, buffer, width, height); } + + var afterHandler = AfterPaint; + if (afterHandler != null) + { + afterHandler(this, args); + } } /// @@ -745,79 +1001,16 @@ void IRenderWebBrowser.OnVirtualKeyboardRequested(IBrowser browser, TextInputMod RenderHandler?.OnVirtualKeyboardRequested(browser, inputMode); } - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnConsoleMessage(ConsoleMessageEventArgs args) - { - ConsoleMessage?.Invoke(this, args); - } - - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnFrameLoadStart(FrameLoadStartEventArgs args) - { - FrameLoadStart?.Invoke(this, args); - } - - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnFrameLoadEnd(FrameLoadEndEventArgs args) - { - FrameLoadEnd?.Invoke(this, args); - } - /// /// Called when [after browser created]. /// /// The browser. - void IWebBrowserInternal.OnAfterBrowserCreated(IBrowser browser) + partial void OnAfterBrowserCreated(IBrowser browser) { - this.browser = browser; - - IsBrowserInitialized = true; - + onAfterBrowserCreatedDelegate?.Invoke(browser); BrowserInitialized?.Invoke(this, EventArgs.Empty); } - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnLoadError(LoadErrorEventArgs args) - { - LoadError?.Invoke(this, args); - } - - /// - /// Gets the browser adapter. - /// - /// The browser adapter. - IBrowserAdapter IWebBrowserInternal.BrowserAdapter - { - get { return managedCefBrowserAdapter; } - } - - /// - /// Gets or sets a value indicating whether this instance has parent. - /// - /// true if this instance has parent; otherwise, false. - bool IWebBrowserInternal.HasParent { get; set; } - - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnStatusMessage(StatusMessageEventArgs args) - { - StatusMessage?.Invoke(this, args); - } - /// /// Sets the address. /// @@ -833,13 +1026,11 @@ void IWebBrowserInternal.SetAddress(AddressChangedEventArgs args) /// Sets the loading state change. /// /// The instance containing the event data. - void IWebBrowserInternal.SetLoadingStateChange(LoadingStateChangedEventArgs args) + partial void SetLoadingStateChange(LoadingStateChangedEventArgs args) { CanGoBack = args.CanGoBack; CanGoForward = args.CanGoForward; IsLoading = args.IsLoading; - - LoadingStateChanged?.Invoke(this, args); } /// @@ -860,11 +1051,6 @@ void IWebBrowserInternal.SetTooltipText(string tooltipText) TooltipText = tooltipText; } - void IWebBrowserInternal.SetCanExecuteJavascriptOnMainFrame(bool canExecute) - { - CanExecuteJavascriptInMainFrame = canExecute; - } - /// /// Creates a new bitmap with the dimensions of firstBitmap, then /// draws the firstBitmap, then overlays the secondBitmap diff --git a/CefSharp.OffScreen/DefaultRenderHandler.cs b/CefSharp.OffScreen/DefaultRenderHandler.cs index da27887f9c..6ca022e9e2 100644 --- a/CefSharp.OffScreen/DefaultRenderHandler.cs +++ b/CefSharp.OffScreen/DefaultRenderHandler.cs @@ -6,6 +6,7 @@ using CefSharp.Enums; using CefSharp.Structs; using Point = System.Drawing.Point; +using Range = CefSharp.Structs.Range; using Size = System.Drawing.Size; namespace CefSharp.OffScreen @@ -97,7 +98,14 @@ public void Dispose() /// Return null if no screenInfo structure is provided. public virtual ScreenInfo? GetScreenInfo() { - var screenInfo = new ScreenInfo { DeviceScaleFactor = 1.0F }; + var deviceScaleFactor = browser?.DeviceScaleFactor; + + if (deviceScaleFactor == null) + { + return null; + } + + var screenInfo = new ScreenInfo { DeviceScaleFactor = deviceScaleFactor.Value }; return screenInfo; } @@ -110,9 +118,14 @@ public void Dispose() public virtual Rect GetViewRect() { //TODO: See if this can be refactored and remove browser reference - var size = browser.Size; + var size = browser?.Size; + + if (size == null) + { + return new Rect(0, 0, 1, 1); + } - var viewRect = new Rect(0, 0, size.Width, size.Height); + var viewRect = new Rect(0, 0, size.Value.Width, size.Value.Height); return viewRect; } @@ -136,11 +149,20 @@ public virtual bool GetScreenPoint(int viewX, int viewY, out int screenX, out in /// /// Called when an element has been rendered to the shared texture handle. /// This method is only called when is set to true + /// + /// The underlying implementation uses a pool to deliver frames. As a result, + /// the handle may differ every frame depending on how many frames are + /// in-progress. The handle's resource cannot be cached and cannot be accessed + /// outside of this callback. It should be reopened each time this callback is + /// executed and the contents should be copied to a texture owned by the + /// client application. The contents of acceleratedPaintInfo + /// will be released back to the pool after this callback returns. /// /// indicates whether the element is the view or the popup widget. /// contains the set of rectangles in pixel coordinates that need to be repainted - /// is the handle for a D3D11 Texture2D that can be accessed via ID3D11Device using the OpenSharedResource method. - public virtual void OnAcceleratedPaint(PaintElementType type, Rect dirtyRect, IntPtr sharedHandle) + /// contains the shared handle; on Windows it is a + /// HANDLE to a texture that can be opened with D3D11 OpenSharedResource. + public virtual void OnAcceleratedPaint(PaintElementType type, Rect dirtyRect, AcceleratedPaintInfo acceleratedPaintInfo) { //NOT USED } diff --git a/CefSharp.OffScreen/IRenderHandler.cs b/CefSharp.OffScreen/IRenderHandler.cs index da1dfad982..e7367eaab3 100644 --- a/CefSharp.OffScreen/IRenderHandler.cs +++ b/CefSharp.OffScreen/IRenderHandler.cs @@ -5,6 +5,7 @@ using System; using CefSharp.Enums; using CefSharp.Structs; +using Range = CefSharp.Structs.Range; namespace CefSharp.OffScreen { @@ -42,11 +43,20 @@ public interface IRenderHandler : IDisposable /// /// Called when an element has been rendered to the shared texture handle. /// This method is only called when is set to true + /// + /// The underlying implementation uses a pool to deliver frames. As a result, + /// the handle may differ every frame depending on how many frames are + /// in-progress. The handle's resource cannot be cached and cannot be accessed + /// outside of this callback. It should be reopened each time this callback is + /// executed and the contents should be copied to a texture owned by the + /// client application. The contents of acceleratedPaintInfo + /// will be released back to the pool after this callback returns. /// /// indicates whether the element is the view or the popup widget. /// contains the set of rectangles in pixel coordinates that need to be repainted - /// is the handle for a D3D11 Texture2D that can be accessed via ID3D11Device using the OpenSharedResource method. - void OnAcceleratedPaint(PaintElementType type, Rect dirtyRect, IntPtr sharedHandle); + /// contains the shared handle; on Windows it is a + /// HANDLE to a texture that can be opened with D3D11 OpenSharedResource. + void OnAcceleratedPaint(PaintElementType type, Rect dirtyRect, AcceleratedPaintInfo acceleratedPaintInfo); /// /// Called when an element should be painted. Pixel values passed to this method are scaled relative to view coordinates based on the diff --git a/CefSharp.Test/AssertEx.cs b/CefSharp.Test/AssertEx.cs new file mode 100644 index 0000000000..16a9cf8a33 --- /dev/null +++ b/CefSharp.Test/AssertEx.cs @@ -0,0 +1,79 @@ +using System; +using System.Threading.Tasks; +using Xunit.Sdk; +using Nito.AsyncEx; +using System.Threading; + +namespace CefSharp.Test +{ + internal static class AssertEx + { + /// + /// Verifies that a event with the exact event args (and not a derived type) is raised + /// This method differs from + /// in that it waits for the event to be raised before returning (or is cancelled). + /// + /// The type of the event arguments to expect + /// number of miliseconds to wait before the timeout + /// Code to attach the event handler + /// Code to detach the event handler + /// A delegate to the code to be tested + /// The event sender and arguments wrapped in an object + /// Thrown when the expected event was not raised. + public static async Task> RaisesAsync( + int cancelAfter, + Action> attach, + Action> detach, + Action testCode) where T : EventArgs + { + var raisedEvent = await RaisesAsyncInternal(cancelAfter, attach, detach, testCode); + + if (raisedEvent == null) + throw new RaisesException(typeof(T)); + + if (raisedEvent.Arguments != null && !raisedEvent.Arguments.GetType().Equals(typeof(T))) + throw new RaisesException(typeof(T), raisedEvent.Arguments.GetType()); + + return raisedEvent; + } + + private static async Task> RaisesAsyncInternal( + int cancelAfter, + Action> attach, + Action> detach, + Action testCode) where T : EventArgs + { + GuardArgumentNotNull(nameof(attach), attach); + GuardArgumentNotNull(nameof(detach), detach); + GuardArgumentNotNull(nameof(testCode), testCode); + + using var cts = new CancellationTokenSource(); + var manualResetEvent = new AsyncManualResetEvent(); + + cts.CancelAfter(cancelAfter); + + Xunit.Assert.RaisedEvent raisedEvent = null; + + attach(Handler); + testCode(); + await manualResetEvent.WaitAsync(cts.Token); + detach(Handler); + + return raisedEvent; + + void Handler(object s, T args) + { + raisedEvent = new Xunit.Assert.RaisedEvent(s, args); + manualResetEvent.Set(); + } + } + + internal static void GuardArgumentNotNull(string argName, object argValue) + { + if (argValue == null) + { + throw new ArgumentNullException(argName); + } + } + } +} diff --git a/CefSharp.Test/BindingRedirectAssemblyResolver.cs b/CefSharp.Test/BindingRedirectAssemblyResolver.cs new file mode 100644 index 0000000000..5da8e6b2d2 --- /dev/null +++ b/CefSharp.Test/BindingRedirectAssemblyResolver.cs @@ -0,0 +1,52 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.IO; +using System.Reflection; + +namespace CefSharp.Test +{ + /// + /// CefSharp requires a default AppDomain which means that xunit is not able + /// to provide the correct binding redirects defined in the app.config + /// so we have to provide them manually via + /// + internal class BindingRedirectAssemblyResolver : IDisposable + { + internal BindingRedirectAssemblyResolver() + { + AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainAssemblyResolve; + } + void IDisposable.Dispose() + { + AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomainAssemblyResolve; + } + + private static Assembly CurrentDomainAssemblyResolve(object sender, ResolveEventArgs args) + { + var asemblyName = new AssemblyName(args.Name); + + // during tests and test discovery outside of visual studio the Environment.CurrentDirectory points to the output directory + var path = Path.Combine(Environment.CurrentDirectory, asemblyName.Name + ".dll"); + + if (File.Exists(path)) + { + return Assembly.LoadFrom(path); + } + + // during test discovery inside of visual studio the current directory points to e.g. "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE" + // which is why we are also checking the executing assembly which points to the output directory + // strangely enough though the execution assembly is different when test discovery happens outside of visual studio but in that case the Environment.CurrentDirectory is correct... + path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), asemblyName.Name + ".dll"); + + if (File.Exists(path)) + { + return Assembly.LoadFrom(path); + } + + return null; + } + } +} diff --git a/CefSharp.Test/BrowserRefCountDebuggingAttribute.cs b/CefSharp.Test/BrowserRefCountDebuggingAttribute.cs new file mode 100644 index 0000000000..8c3d21360b --- /dev/null +++ b/CefSharp.Test/BrowserRefCountDebuggingAttribute.cs @@ -0,0 +1,23 @@ +using System; +using System.Reflection; +using CefSharp.Internals; +using Xunit.Sdk; + +namespace CefSharp.Test +{ + internal class BrowserRefCountDebuggingAttribute : BeforeAfterTestAttribute + { + private Type type; + internal BrowserRefCountDebuggingAttribute(Type type) + { + this.type = type; + } + + public override void Before(MethodInfo methodUnderTest) + { + ((BrowserRefCounter)BrowserRefCounter.Instance).AppendLineToLog($"{type} - TestMethod {methodUnderTest.DeclaringType} {methodUnderTest.Name}"); + + base.Before(methodUnderTest); + } + } +} diff --git a/CefSharp.Test/BrowserTests.cs b/CefSharp.Test/BrowserTests.cs new file mode 100644 index 0000000000..e4238de00b --- /dev/null +++ b/CefSharp.Test/BrowserTests.cs @@ -0,0 +1,47 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using CefSharp.Example; +using CefSharp.OffScreen; +using Xunit; + +namespace CefSharp.Test +{ + public abstract class BrowserTests : IAsyncLifetime + { + public ChromiumWebBrowser Browser { get; private set; } + public bool RequestContextIsolated { get; protected set; } + + protected void AssertInitialLoadComplete() + { + var t = Browser.WaitForInitialLoadAsync(); + + Assert.True(t.IsCompleted, "WaitForInitialLoadAsync Task.IsComplete"); + Assert.True(t.Result.Success, "WaitForInitialLoadAsync Result.Success"); + } + + Task IAsyncLifetime.DisposeAsync() + { + Browser?.Dispose(); + + return Task.CompletedTask; + } + + Task IAsyncLifetime.InitializeAsync() + { + IRequestContext requestContext = null; + + if (RequestContextIsolated) + { + requestContext = new RequestContext(); + requestContext.RegisterSchemeHandlerFactory("https", CefExample.ExampleDomain, new CefSharpSchemeHandlerFactory()); + } + + Browser = new ChromiumWebBrowser(CefExample.HelloWorldUrl, requestContext: requestContext, useLegacyRenderHandler: false); + + return Browser.WaitForInitialLoadAsync(); + } + } +} diff --git a/CefSharp.Test/CefSharp.Test.csproj b/CefSharp.Test/CefSharp.Test.csproj index 39bcc79418..8df15d6b12 100644 --- a/CefSharp.Test/CefSharp.Test.csproj +++ b/CefSharp.Test/CefSharp.Test.csproj @@ -1,153 +1,76 @@ - - - - - - - Debug - x86 - 9.0.30729 - 2.0 - {7A4D5447-183B-4A11-8E63-9848991B46FF} - Library - Properties - CefSharp.Test - CefSharp.Test - v4.6.2 - 512 - - - - - 3.5 - Client - - - - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - prompt - AllRules.ruleset - false - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - AllRules.ruleset - false - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - AllRules.ruleset - false - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - AllRules.ruleset - false - - - - ..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll - True - - - - ..\packages\Moq.4.7.142\lib\net45\Moq.dll - True - - - - - - - ..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll - True - - - ..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll - True - - - ..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll - True - - - ..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll - True - - - - - - - - - - - - - - - - {7b495581-2271-4f41-9476-acb86e8c864f} - CefSharp.Core - True - - - {483b158d-f57d-49d9-9046-31e6a73f8a53} - CefSharp.OffScreen - True - - - {882505ad-246d-402a-8414-347efb8e2c8d} - CefSharp.WinForms - - - {e6cb3790-f267-4ac7-892c-2620737682ca} - CefSharp.Wpf - - - {a55848cc-10e7-40cb-addb-04740b16dd43} - CefSharp - True - - - - - - - - - - - - - - + + + net472 + Library + x86;x64 + win-x86;win-x64 + false + true + true + AllRules.ruleset + false + 8.0 + + + + win-x86 + + + + win-x64 + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Test/CefSharp.Test.netcore.csproj b/CefSharp.Test/CefSharp.Test.netcore.csproj new file mode 100644 index 0000000000..d390538b12 --- /dev/null +++ b/CefSharp.Test/CefSharp.Test.netcore.csproj @@ -0,0 +1,74 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + net6.0-windows + CefSharp.Test + CefSharp.Test + true + true + false + MinimumRecommendedRules.ruleset + x86;x64;arm64 + + arm64 + win-x86;win-x64 + win-x86 + win-x64 + win-arm64 + false + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + diff --git a/CefSharp.Test/CefSharpFixture.cs b/CefSharp.Test/CefSharpFixture.cs index 6407b86f55..ea91829ff2 100644 --- a/CefSharp.Test/CefSharpFixture.cs +++ b/CefSharp.Test/CefSharpFixture.cs @@ -2,17 +2,36 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -using CefSharp.OffScreen; using System; using System.IO; +using System.Net; +using System.Threading.Tasks; +using CefSharp.Example; +using CefSharp.OffScreen; +using Nito.AsyncEx; +using Titanium.Web.Proxy; +using Titanium.Web.Proxy.Models; +using Xunit; +using Xunit.Abstractions; +using Xunit.Sdk; namespace CefSharp.Test { - public class CefSharpFixture : IDisposable + public class CefSharpFixture : IAsyncLifetime, IDisposable { - public CefSharpFixture() + private readonly AsyncContextThread contextThread; + private ProxyServer proxyServer; + private readonly IMessageSink diagnosticMessageSink; + + public CefSharpFixture(IMessageSink messageSink) + { + contextThread = new AsyncContextThread(); + diagnosticMessageSink = messageSink; + } + + private void CefInitialize() { - if (!Cef.IsInitialized) + if (Cef.IsInitialized == null) { var isDefault = AppDomain.CurrentDomain.IsDefaultAppDomain(); if (!isDefault) @@ -20,22 +39,109 @@ public CefSharpFixture() throw new Exception(@"Add to your app.config to disable appdomains"); } + var apiHash = Cef.ApiHash(Cef.ApiVersion); + + if (Cef.ApiHashPlatform != apiHash) + { + throw new Exception($"CEF API Has does not match expected. {apiHash} {Cef.ApiHashPlatform}"); + } + + Cef.EnableWaitForBrowsersToClose(); + CefSharp.Internals.BrowserRefCounter.Instance.EnableLogging(); + + CefSharpSettings.ShutdownOnExit = false; var settings = new CefSettings(); + //settings.LogFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Logs\\cef.log"); + //settings.LogSeverity = LogSeverity.Verbose; + + settings.RegisterScheme(new CefCustomScheme + { + SchemeName = "https", + SchemeHandlerFactory = new CefSharpSchemeHandlerFactory(), + DomainName = CefExample.ExampleDomain + }); //The location where cache data will be stored on disk. If empty an in-memory cache will be used for some features and a temporary disk cache for others. //HTML5 databases such as localStorage will only persist across sessions if a cache path is specified. settings.CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests\\Cache"); + settings.RootCachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests"); + //settings.CefCommandLineArgs.Add("renderer-startup-dialog"); + //settings.CefCommandLineArgs.Add("disable-features=SpareRendererForSitePerProcess"); + //settings.CefCommandLineArgs.Add("disable-site-isolation-trials"); + settings.SetOffScreenRenderingBestPerformanceArgs(); + settings.CefCommandLineArgs.Add("use-gl", "angle"); + settings.CefCommandLineArgs.Add("use-angle", "swiftshader"); + settings.CefCommandLineArgs.Add("enable-logging"); //Enable Logging for the Renderer process (will open with a cmd prompt and output debug messages - use in conjunction with setting LogSeverity = LogSeverity.Verbose;) + settings.LogSeverity = LogSeverity.Verbose; // Needed for enable-logging to output messages + + var success = Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null); + + diagnosticMessageSink.OnMessage(new DiagnosticMessage("Cef Initialized:" + success)); + } - Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null); + if (Cef.IsInitialized == false) + { + throw new InvalidOperationException("Cef.Initialize failed."); } } + private void CefShutdown() + { + if (Cef.IsInitialized == true) + { + diagnosticMessageSink.OnMessage(new DiagnosticMessage("Before Cef Shutdown")); + + Cef.WaitForBrowsersToClose(); + + try + { + Cef.Shutdown(); + } + catch(Exception ex) + { + diagnosticMessageSink.OnMessage(new DiagnosticMessage("Cef Shutdown Exception:" + ex.ToString())); + } + + diagnosticMessageSink.OnMessage(new DiagnosticMessage("After Cef Shutdown")); + } + + StopProxyServer(); + } + + public Task InitializeAsync() + { + return contextThread.Factory.StartNew(CefInitialize); + } + + public Task DisposeAsync() + { + return contextThread.Factory.StartNew(CefShutdown); + } + public void Dispose() { - if (Cef.IsInitialized) + contextThread.Dispose(); + } + + public void StartProxyServerIfRequired() + { + if (proxyServer == null) { - Cef.Shutdown(); + proxyServer = new ProxyServer(userTrustRootCertificate: false); + + var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Loopback, 8080, false); + + // An explicit endpoint is where the client knows about the existence of a proxy + // So client sends request in a proxy friendly manner + proxyServer.AddEndPoint(explicitEndPoint); + proxyServer.Start(); } } + + public void StopProxyServer() + { + proxyServer?.Stop(); + proxyServer = null; + } } } diff --git a/CefSharp.Test/CefSharpTestCaseOrderer.cs b/CefSharp.Test/CefSharpTestCaseOrderer.cs new file mode 100644 index 0000000000..5e2b56d187 --- /dev/null +++ b/CefSharp.Test/CefSharpTestCaseOrderer.cs @@ -0,0 +1,37 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Generic; +using System.Linq; +using Xunit.Abstractions; +using Xunit.Sdk; + +namespace CefSharp.Test +{ + public class CefSharpTestCaseOrderer : ITestCaseOrderer + { + private readonly IMessageSink diagnosticMessageSink; + + public CefSharpTestCaseOrderer(IMessageSink diagnosticMessageSink) + { + this.diagnosticMessageSink = diagnosticMessageSink; + } + + IEnumerable ITestCaseOrderer.OrderTestCases(IEnumerable testCases) + { + var result = testCases.ToList(); // Run them in discovery order + + if(result.Count > 0) + { + var firstTestCase = result[0]; + + var message = new DiagnosticMessage("Ordered Test Cases for : {0} ", firstTestCase.TestMethod.TestClass.Class.ToString()); + diagnosticMessageSink.OnMessage(message); + } + + return result; + } + } +} diff --git a/CefSharp.Test/CefSharpXunitTestFramework.cs b/CefSharp.Test/CefSharpXunitTestFramework.cs new file mode 100644 index 0000000000..295515ae4e --- /dev/null +++ b/CefSharp.Test/CefSharpXunitTestFramework.cs @@ -0,0 +1,26 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using Xunit.Abstractions; +using Xunit.Sdk; + +[assembly: Xunit.TestFramework("CefSharp.Test.CefSharpXunitTestFramework", "CefSharp.Test")] + +namespace CefSharp.Test +{ + /// + /// Custom that allows for code to run begin/end of + /// each test run. Classes should implement + /// + public class CefSharpXunitTestFramework : XunitTestFramework + { + public CefSharpXunitTestFramework(IMessageSink messageSink) + : base(messageSink) + { + //Create a new BindingRedirectAssemblyResolver to resolve the assemblies + //that xUnit is unable to Load + DisposalTracker.Add(new BindingRedirectAssemblyResolver()); + } + } +} diff --git a/CefSharp.Test/CookieManager/CookieManagerTests.cs b/CefSharp.Test/CookieManager/CookieManagerTests.cs new file mode 100644 index 0000000000..58c4affe2e --- /dev/null +++ b/CefSharp.Test/CookieManager/CookieManagerTests.cs @@ -0,0 +1,217 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using Xunit.Abstractions; +using Xunit; +using System; +using CefSharp.Example; +using System.Linq; +using System.Collections.Generic; +using CefSharp.Enums; + +namespace CefSharp.Test.CookieManager +{ + [Collection(CefSharpFixtureCollection.Key)] + public class CookieManagerTests : RequestContextIsolatedBrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture collectionFixture; + + public CookieManagerTests(ITestOutputHelper output, CefSharpFixture collectionFixture) + { + this.output = output; + this.collectionFixture = collectionFixture; + } + + [Fact] + public async Task ShouldWork() + { + AssertInitialLoadComplete(); + + const string expected = "password=123456"; + + var cookieManager = Browser.GetCookieManager(); + + var success = await cookieManager.SetCookieAsync(CefExample.HelloWorldUrl, new Cookie + { + Name = "password", + Value = "123456" + }); + + Assert.True(success); + + var actual = await Browser.EvaluateScriptAsync("document.cookie"); + + Assert.Equal(expected, actual); + } + + [Fact] + public async Task ShouldSetMultipleCookies() + { + AssertInitialLoadComplete(); + + var expected = new string[] + { + "multiple-1=123456", + "multiple-2=bar" + }; + + var cookieManager = Browser.GetCookieManager(); + + var success = await cookieManager.SetCookieAsync(CefExample.HelloWorldUrl, new Cookie + { + Name = "multiple-1", + Value = "123456" + }); + + success &= await cookieManager.SetCookieAsync(CefExample.HelloWorldUrl, new Cookie + { + Name = "multiple-2", + Value = "bar" + }); + + Assert.True(success); + + var actual = await Browser.EvaluateScriptAsync>(@"(() => { + const cookies = document.cookie.split(';'); + return cookies.map(cookie => cookie.trim()).sort(); + })();"); + + Assert.Equal(expected, actual); + } + + [Fact] + public async Task ShouldGetACookie() + { + AssertInitialLoadComplete(); + + var response = await Browser.EvaluateScriptAsync(@"(() => { + document.cookie = 'username=John Doe'; + return document.cookie; + })();"); + + Assert.Equal("username=John Doe", response); + + var cookieManager = Browser.GetCookieManager(); + + var cookie = (await cookieManager.VisitAllCookiesAsync()).Single(); + + Assert.Equal("username", cookie.Name); + Assert.Equal("John Doe", cookie.Value); + Assert.Equal("cefsharp.example", cookie.Domain); + Assert.Equal("/", cookie.Path); + Assert.Null(cookie.Expires); + Assert.False(cookie.HttpOnly); + Assert.False(cookie.Secure); + Assert.Equal(CookieSameSite.Unspecified, cookie.SameSite); + } + + [Fact] + public async Task ShouldProperlyReportSecureCookie() + { + AssertInitialLoadComplete(); + + var response = await Browser.EvaluateScriptAsync(@"(() => { + document.cookie = 'username=John Doe;Secure;'; + return document.cookie; + })();"); + + Assert.Equal("username=John Doe", response); + + var cookieManager = Browser.GetCookieManager(); + + var cookie = (await cookieManager.VisitAllCookiesAsync()).Single(); + + Assert.True(cookie.Secure); + } + + [Fact] + public async Task ShouldProperlyReportStrictSameSiteCookie() + { + AssertInitialLoadComplete(); + + var response = await Browser.EvaluateScriptAsync(@"(() => { + document.cookie = 'username=John Doe;SameSite=Strict;'; + return document.cookie; + })();"); + + Assert.Equal("username=John Doe", response); + + var cookieManager = Browser.GetCookieManager(); + + var cookie = (await cookieManager.VisitAllCookiesAsync()).Single(); + + Assert.Equal(CookieSameSite.StrictMode, cookie.SameSite); + } + + [Fact] + //https://github.com/cefsharp/CefSharp/issues/4234 + public async Task ShouldSetAndGetCookie() + { + AssertInitialLoadComplete(); + + const string CookieName = "CefSharpExpiryTestCookie"; + var testStartDate = DateTime.Now; + var expectedExpiry = DateTime.Now.AddDays(1); + + var cookieManager = Browser.GetCookieManager(); + await cookieManager.DeleteCookiesAsync(CefExample.HelloWorldUrl, CookieName); + + var cookieSet = await cookieManager.SetCookieAsync(CefExample.HelloWorldUrl, new Cookie + { + Name = CookieName, + Value = "ILikeCookies", + Expires = expectedExpiry + }); + + Assert.True(cookieSet); + + var cookies = await cookieManager.VisitUrlCookiesAsync(CefExample.HelloWorldUrl, false); + var cookie = cookies.First(x => x.Name == CookieName); + + Assert.True(cookie.Expires.HasValue); + // Little bit of a loss in precision + Assert.Equal(expectedExpiry, cookie.Expires.Value, TimeSpan.FromMilliseconds(10)); + Assert.Equal(cookie.Creation ,testStartDate, TimeSpan.FromMilliseconds(1000)); + Assert.Equal(cookie.LastAccess, testStartDate, TimeSpan.FromMilliseconds(1000)); + + output.WriteLine("Expected {0} : Actual {1}", expectedExpiry, cookie.Expires.Value); + } + + [Fact] + public async Task ShouldClearCookies() + { + AssertInitialLoadComplete(); + + var cookieManager = Browser.GetCookieManager(); + + var cookieSet = await cookieManager.SetCookieAsync(CefExample.HelloWorldUrl, new Cookie + { + Name = "cookie1", + Value = "1" + }); + + Assert.True(cookieSet); + + var response = await Browser.EvaluateScriptAsync("document.cookie"); + + Assert.Equal("cookie1=1", response); + + await cookieManager.DeleteCookiesAsync(); + + var cookies = await cookieManager.VisitAllCookiesAsync(); + + Assert.Empty(cookies); + + Browser.Reload(); + + await Browser.WaitForRenderIdleAsync(); + + response = await Browser.EvaluateScriptAsync("document.cookie"); + + Assert.Equal(string.Empty, response); + } + } +} diff --git a/CefSharp.Test/DevTools/DevToolsClientTests.cs b/CefSharp.Test/DevTools/DevToolsClientTests.cs new file mode 100644 index 0000000000..d2d0cac296 --- /dev/null +++ b/CefSharp.Test/DevTools/DevToolsClientTests.cs @@ -0,0 +1,484 @@ +// Copyright © 2017 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Threading.Tasks; +using CefSharp.DevTools; +using CefSharp.DevTools.Browser; +using CefSharp.DevTools.Emulation; +using CefSharp.DevTools.Network; +using CefSharp.Example; +using CefSharp.OffScreen; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.DevTools +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class DevToolsClientTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public DevToolsClientTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task CanCaptureScreenshot() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var response = await devToolsClient.Page.CaptureScreenshotAsync(); + + Assert.NotNull(response.Data); + Assert.NotEmpty(response.Data); + + var image = Image.FromStream(new MemoryStream(response.Data)); + var size = browser.Size; + + Assert.NotNull(image); + Assert.Equal(ImageFormat.Png, image.RawFormat); + Assert.Equal(size.Width, image.Width); + Assert.Equal(size.Height, image.Height); + } + } + } + + [Fact] + public void CanConvertDevToolsObjectToDictionary() + { + var bounds = new Bounds + { + Height = 1, + Width = 1, + Left = 1, + Top = 1, + WindowState = WindowState.Fullscreen + }; + + var dict = bounds.ToDictionary(); + + Assert.Equal(bounds.Height, (int)dict["height"]); + Assert.Equal(bounds.Width, (int)dict["width"]); + Assert.Equal(bounds.Top, (int)dict["top"]); + Assert.Equal(bounds.Left, (int)dict["left"]); + Assert.Equal("fullscreen", (string)dict["windowState"]); + } + + [Fact] + public async Task CanGetDevToolsProtocolVersion() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var response = await devToolsClient.Browser.GetVersionAsync(); + var jsVersion = response.JsVersion; + var revision = response.Revision; + + Assert.NotNull(jsVersion); + Assert.NotNull(revision); + + output.WriteLine("DevTools Revision {0}", revision); + } + } + } + + [Fact] + public async Task CanClearStorageDataForOrigin() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var response = await devToolsClient.Storage.ClearDataForOriginAsync("*", "all"); + + Assert.True(response.Success); + } + } + } + + [Fact] + public async Task CanClearNetworkBrowserCache() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var response = await devToolsClient.Network.ClearBrowserCacheAsync(); + + Assert.True(response.Success); + } + } + } + + [SkipIfRunOnAppVeyorFact] + public async Task CanGetPageResourceContent() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var enableResponse = await devToolsClient.Page.EnableAsync(); + + Assert.True(enableResponse.Success); + + var frameTreeResponse = await devToolsClient.Page.GetFrameTreeAsync(); + + var frame = frameTreeResponse.FrameTree.Frame; + + var response = await devToolsClient.Page.GetResourceContentAsync(frame.Id, frame.Url); + + Assert.False(response.Base64Encoded); + Assert.StartsWith("", response.Content); + + } + } + } + + [Fact] + public async Task CanGetPageNavigationHistory() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var response = await devToolsClient.Page.GetNavigationHistoryAsync(); + var currentIndex = response.CurrentIndex; + var entries = response.Entries; + + Assert.Equal(0, currentIndex); + Assert.NotNull(entries); + Assert.True(entries.Count > 0); + Assert.Equal(CefSharp.DevTools.Page.TransitionType.Typed, entries[0].TransitionType); + } + } + } + + [Theory] + //[InlineData("CefSharpTest", "CefSharp Test Cookie", CefExample.ExampleDomain, CookieSameSite.None)] + [InlineData("CefSharpTest1", "CefSharp Test Cookie2", CefExample.ExampleDomain, CookieSameSite.Lax)] + public async Task CanSetCookieForDomain(string name, string value, string domain, CookieSameSite sameSite) + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var expiry = DateTimeOffset.UtcNow.AddDays(10); + var response = await devToolsClient.Network.SetCookieAsync(name, value, domain: domain, sameSite: sameSite, expires: expiry.ToUnixTimeSeconds()); + Assert.True(response.Success, "SetCookieForDomain"); + } + } + } + + [Fact] + public async Task CanUseMultipleDevToolsClientInstancesPerBrowser() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var response = await devToolsClient.Browser.GetVersionAsync(); + var jsVersion = response.JsVersion; + var revision = response.Revision; + + Assert.NotNull(jsVersion); + Assert.NotNull(revision); + + output.WriteLine("DevTools Revision {0}", revision); + } + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var response = await devToolsClient.Browser.GetVersionAsync(); + var jsVersion = response.JsVersion; + var revision = response.Revision; + + Assert.NotNull(jsVersion); + Assert.NotNull(revision); + + output.WriteLine("DevTools Revision {0}", revision); + } + } + } + + [Fact] + public async Task CanSetUserAgentOverride() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var brandsList = new List(); + var uab = new UserAgentBrandVersion + { + Brand = "Google Chrome", + Version = "89" + }; + brandsList.Add(uab); + + var uab2 = new UserAgentBrandVersion + { + Brand = "Chromium", + Version = "89" + }; + brandsList.Add(uab2); + + var ua = new UserAgentMetadata + { + Brands = brandsList, + Architecture = "arm", + Model = "Nexus 7", + Platform = "Android", + PlatformVersion = "6.0.1", + FullVersion = "89.0.4389.114", + Mobile = true + }; + + await devToolsClient.Emulation.SetUserAgentOverrideAsync("Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/5(KHTML,likeGeckoChrome/89.0.4389.114Safari/537.36", null, null, ua); + } + + var userAgent = await browser.EvaluateScriptAsync("navigator.userAgent"); + Assert.True(userAgent.Success); + Assert.Contains("Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/5(KHTML,likeGeckoChrome/89.0.4389.114Safari/537.36", Assert.IsType(userAgent.Result)); + + var brands = await browser.EvaluateScriptAsync("navigator.userAgentData.brands"); + Assert.True(brands.Success); + dynamic brandsResult = brands.Result; + Assert.Collection((IEnumerable)brandsResult, + (dynamic d) => + { + Assert.Equal("Google Chrome", d.brand); + Assert.Equal("89", d.version); + }, + (dynamic d) => + { + Assert.Equal("Chromium", d.brand); + Assert.Equal("89", d.version); + } + ); + + var highEntropyValues = await browser.EvaluateScriptAsPromiseAsync("return navigator.userAgentData.getHighEntropyValues(['architecture','model','platform','platformVersion','uaFullVersion'])"); + Assert.True(highEntropyValues.Success); + dynamic highEntropyValuesResult = highEntropyValues.Result; + Assert.Equal("arm", highEntropyValuesResult.architecture); + Assert.Equal("Nexus 7", highEntropyValuesResult.model); + Assert.Equal("Android", highEntropyValuesResult.platform); + Assert.Equal("6.0.1", highEntropyValuesResult.platformVersion); + Assert.Equal("89.0.4389.114", highEntropyValuesResult.uaFullVersion); + } + } + + [Fact] + public async Task CanSetExtraHTTPHeaders() + { + using (var browser = new ChromiumWebBrowser("about:blank", automaticallyCreateBrowser: false, useLegacyRenderHandler: false)) + { + await browser.CreateBrowserAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var extraHeaders = new Headers(); + extraHeaders.SetCommaSeparatedValues("TEST", "0"); + extraHeaders.AppendCommaSeparatedValues("test", " 1 ", "\" 2 \""); + extraHeaders.AppendCommaSeparatedValues("Test", " 2,5 "); + + await devToolsClient.Network.SetExtraHTTPHeadersAsync(extraHeaders); + + var evtTask = Assert.RaisesAsync( + x => devToolsClient.Network.RequestWillBeSent += x, + x => devToolsClient.Network.RequestWillBeSent -= x, + async () => + { + // enable events + await devToolsClient.Network.EnableAsync(); + + await browser.LoadUrlAsync("www.google.com"); + }); + + var xUnitEvent = await evtTask; + Assert.NotNull(xUnitEvent); + + var args = xUnitEvent.Arguments; + + Assert.NotNull(args); + Assert.NotEmpty(args.RequestId); + Assert.NotEqual(0, args.Timestamp); + Assert.NotEqual(0, args.WallTime); + Assert.NotNull(args.Request); + Assert.True(args.Request.Headers.TryGetValues("TeSt", out var values)); + Assert.Collection(values, + v => Assert.Equal("0", v), + v => Assert.Equal("1", v), + v => Assert.Equal(" 2 ", v), + v => Assert.Equal(" 2,5 ", v) + ); + } + } + } + + [Fact] + public async Task ExecuteDevToolsMethodThrowsExceptionWithInvalidMethod() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var ex = await Assert.ThrowsAsync( + () => devToolsClient.ExecuteDevToolsMethodAsync("methoddoesnotexist")); + + Assert.NotNull(ex.Response); + Assert.NotEqual(0, ex.Response.MessageId); + Assert.NotEqual(0, ex.Response.Code); + Assert.NotNull(ex.Response.Message); + } + } + } + + [Fact] + public async Task CanGetMediaQueries() + { + using (var browser = new ChromiumWebBrowser("https://cefsharp.github.io/demo/mediaqueryhover.html", useLegacyRenderHandler: false)) + { + await browser.WaitForInitialLoadAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + await devToolsClient.DOM.EnableAsync(); + await devToolsClient.CSS.EnableAsync(); + + var mediaQueries = await devToolsClient.CSS.GetMediaQueriesAsync(); + + Assert.True(mediaQueries.Medias.Count > 0); + } + } + } + + [Fact] + public async Task CanRegisterMultipleEventHandlers() + { + using (var browser = new ChromiumWebBrowser("about:blank", automaticallyCreateBrowser: false, useLegacyRenderHandler: false)) + { + await browser.CreateBrowserAsync(); + + using (var devToolsClient = browser.GetDevToolsClient()) + { + DevToolsEventArgs devToolsEventArgs = null; + EventHandler devToolsEventHandler = (sender, args) => + { + if (devToolsEventArgs == null) + { + devToolsEventArgs = args; + } + }; + devToolsClient.DevToolsEvent += devToolsEventHandler; + + RequestWillBeSentEventArgs requestWillBeSentEventArgs1 = null; + EventHandler requestWillBeSentEventHandler1 = (sender, args) => + { + if (requestWillBeSentEventArgs1 == null) + { + requestWillBeSentEventArgs1 = args; + } + }; + devToolsClient.Network.RequestWillBeSent += requestWillBeSentEventHandler1; + + RequestWillBeSentEventArgs requestWillBeSentEventArgs2 = null; + EventHandler requestWillBeSentEventHandler2 = (sender, args) => + { + if (requestWillBeSentEventArgs2 == null) + { + requestWillBeSentEventArgs2 = args; + } + }; + devToolsClient.Network.RequestWillBeSent += requestWillBeSentEventHandler2; + + // enable events + await devToolsClient.Network.EnableAsync(); + + await browser.LoadUrlAsync("www.google.com"); + + Assert.NotNull(devToolsEventArgs); + Assert.NotNull(requestWillBeSentEventArgs1); + Assert.NotNull(requestWillBeSentEventArgs2); + + Assert.Equal(requestWillBeSentEventArgs1.RequestId, requestWillBeSentEventArgs2.RequestId); + + // remove second event handler + devToolsClient.Network.RequestWillBeSent -= requestWillBeSentEventHandler2; + devToolsEventArgs = null; + requestWillBeSentEventArgs1 = null; + requestWillBeSentEventArgs2 = null; + + await browser.LoadUrlAsync("www.google.com"); + + Assert.NotNull(devToolsEventArgs); + Assert.NotNull(requestWillBeSentEventArgs1); + Assert.Null(requestWillBeSentEventArgs2); + } + } + } + + [Fact] + public void CanRemoveEventListenerBeforeAddingOne() + { + using (var devToolsClient = new DevToolsClient(null)) + { + devToolsClient.Network.RequestWillBeSent -= (sender, args) => { }; + } + } + + [Fact] + public void IsIEventProxyRemovedFromConcurrentDictionary() + { + const string eventName = "Browser.downloadProgress"; + using (var devToolsClient = new DevToolsClient(null)) + { + EventHandler eventHandler1 = (object sender, DownloadProgressEventArgs args) => { }; + EventHandler eventHandler2 = (object sender, DownloadProgressEventArgs args) => { }; + + devToolsClient.AddEventHandler(eventName, eventHandler1); + devToolsClient.AddEventHandler(eventName, eventHandler2); + + var hasHandlers = devToolsClient.RemoveEventHandler(eventName, eventHandler1); + + Assert.True(hasHandlers); + + hasHandlers = devToolsClient.RemoveEventHandler(eventName, eventHandler2); + + Assert.False(hasHandlers); + } + } + } +} diff --git a/CefSharp.Test/DevTools/HeadersTests.cs b/CefSharp.Test/DevTools/HeadersTests.cs new file mode 100644 index 0000000000..73d9c8dc3c --- /dev/null +++ b/CefSharp.Test/DevTools/HeadersTests.cs @@ -0,0 +1,111 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.DevTools.Network; +using Xunit; + +namespace CefSharp.Test.DevTools +{ + public class HeadersTests + { + [Fact] + public void HeadersTryGetValues() + { + var headers = new Headers(); + headers["EMPTY"] = " "; + headers["SIMPLE"] = " 1 "; + headers["MULTIPLE"] = " 1 , \" 1,5 \",2, \" 2 , 5 \" , 3 , ,"; + + string[] values; + + Assert.False(headers.TryGetValues("doesnotexist", out values)); + Assert.Null(values); + + Assert.True(headers.TryGetValues("EMPTY", out values)); + Assert.Collection(values, + v => Assert.Equal("", v) + ); + + Assert.True(headers.TryGetValues("SIMPLE", out values)); + Assert.Collection(values, + v => Assert.Equal("1", v) + ); + + Assert.True(headers.TryGetValues("MULTIPLE", out values)); + Assert.Collection(values, + v => Assert.Equal("1", v), + v => Assert.Equal(" 1,5 ", v), + v => Assert.Equal("2", v), + v => Assert.Equal(" 2 , 5 ", v), + v => Assert.Equal("3", v), + v => Assert.Equal("", v), + v => Assert.Equal("", v) + ); + } + + [Fact] + public void HeadersGetCommaSeparatedValues() + { + var headers = new Headers(); + headers["EMPTY"] = " "; + headers["SIMPLE"] = " 1 "; + headers["MULTIPLE"] = " 1 , \" 1,5 \",2, \" 2 , 5 \" , 3 , ,"; + + Assert.Null(headers.GetCommaSeparatedValues("doesnotexist")); + Assert.Collection(headers.GetCommaSeparatedValues("EMPTY"), + v => Assert.Equal("", v) + ); + Assert.Collection(headers.GetCommaSeparatedValues("SIMPLE"), + v => Assert.Equal("1", v) + ); + Assert.Collection(headers.GetCommaSeparatedValues("MULTIPLE"), + v => Assert.Equal("1", v), + v => Assert.Equal(" 1,5 ", v), + v => Assert.Equal("2", v), + v => Assert.Equal(" 2 , 5 ", v), + v => Assert.Equal("3", v), + v => Assert.Equal("", v), + v => Assert.Equal("", v) + ); + } + + [Fact] + public void HeadersAppendCommaSeparatedValues() + { + var headers = new Headers(); + headers.AppendCommaSeparatedValues("TEST", " 1 "); + + headers.AppendCommaSeparatedValues("test", "\" 1,5 \"", "2", " 2 , 5 ", "3", " ", ""); + + Assert.Collection(headers.GetCommaSeparatedValues("Test"), + v => Assert.Equal("1", v), + v => Assert.Equal(" 1,5 ", v), + v => Assert.Equal("2", v), + v => Assert.Equal(" 2 , 5 ", v), + v => Assert.Equal("3", v), + v => Assert.Equal("", v), + v => Assert.Equal("", v) + ); + } + + [Fact] + public void HeadersSetCommaSeparatedValues() + { + var headers = new Headers(); + headers["TEST"] = " 1 "; + + headers.SetCommaSeparatedValues("test", "\" 1,5 \"", "2", " 2 , 5 ", "3", " ", ""); + + Assert.Collection(headers.GetCommaSeparatedValues("Test"), + v => Assert.Equal(" 1,5 ", v), + v => Assert.Equal("2", v), + v => Assert.Equal(" 2 , 5 ", v), + v => Assert.Equal("3", v), + v => Assert.Equal("", v), + v => Assert.Equal("", v) + ); + } + + } +} diff --git a/CefSharp.Test/DevTools/JsonEnumConverterFacts.cs b/CefSharp.Test/DevTools/JsonEnumConverterFacts.cs new file mode 100644 index 0000000000..fd81bb1db4 --- /dev/null +++ b/CefSharp.Test/DevTools/JsonEnumConverterFacts.cs @@ -0,0 +1,125 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Text.Json; +using CefSharp.DevTools.Audits; +using CefSharp.DevTools.Browser; +using CefSharp.DevTools.CSS; +using CefSharp.Internals.Json; +using Xunit; + +namespace CefSharp.Test.DevTools +{ + public class JsonEnumConverterFacts + { + [Fact] + public void CanConvertEnumToJsonString() + { + var options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + IgnoreNullValues = true, + }; + + options.Converters.Add(new JsonEnumConverterFactory()); + + var expected = "\"clipboardSanitizedWrite\""; + var actual = JsonSerializer.Serialize(PermissionType.ClipboardSanitizedWrite, options); + + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertEnumArrayToJsonString() + { + var options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + IgnoreNullValues = true, + }; + + options.Converters.Add(new JsonEnumConverterFactory()); + + var expected = "[\"user-agent\",\"regular\"]"; + var actual = JsonSerializer.Serialize(new StyleSheetOrigin[] { StyleSheetOrigin.UserAgent, StyleSheetOrigin.Regular }, options); + + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertNullableEnumToJsonStringNull() + { + var options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + IgnoreNullValues = true, + }; + + options.Converters.Add(new JsonEnumConverterFactory()); + + var model = new MixedContentIssueDetails + { + InsecureURL = "Testing", + ResourceType = null + }; + + var expected = "{\"resolutionStatus\":\"MixedContentBlocked\",\"insecureURL\":\"Testing\"}"; + var actual = JsonSerializer.Serialize(model, options); + + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertNullableEnumToJsonStringNotNull() + { + var options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + IgnoreNullValues = true, + }; + + options.Converters.Add(new JsonEnumConverterFactory()); + + var model = new MixedContentIssueDetails + { + InsecureURL = "Testing", + ResourceType = MixedContentResourceType.CSPReport + }; + + var expected = "{\"resourceType\":\"CSPReport\",\"resolutionStatus\":\"MixedContentBlocked\",\"insecureURL\":\"Testing\"}"; + var actual = JsonSerializer.Serialize(model, options); + + Assert.Equal(expected, actual); + } + + [Fact] + public void CanSerializeDeserializeEnumJson() + { + var options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + IgnoreNullValues = true, + }; + + options.Converters.Add(new JsonEnumConverterFactory()); + + var expected = new MixedContentIssueDetails + { + InsecureURL = "http://testing.domain/index.html", + Frame = new AffectedFrame + { + FrameId = "123" + }, + ResourceType = MixedContentResourceType.CSPReport + }; + + var serialize = JsonSerializer.Serialize(expected, options); + var actual = JsonSerializer.Deserialize(serialize, options); + + Assert.Equal(expected.InsecureURL, actual.InsecureURL); + Assert.Equal(expected.ResourceType, actual.ResourceType); + Assert.Equal(expected.Frame.FrameId, actual.Frame.FrameId); + } + } +} diff --git a/CefSharp.Test/Framework/AsyncExtensionFacts.cs b/CefSharp.Test/Framework/AsyncExtensionTests.cs similarity index 90% rename from CefSharp.Test/Framework/AsyncExtensionFacts.cs rename to CefSharp.Test/Framework/AsyncExtensionTests.cs index 4a8490b17c..432260f64d 100644 --- a/CefSharp.Test/Framework/AsyncExtensionFacts.cs +++ b/CefSharp.Test/Framework/AsyncExtensionTests.cs @@ -2,21 +2,18 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -using Moq; using System.Threading.Tasks; +using Moq; using Xunit; using Xunit.Abstractions; namespace CefSharp.Test.Framework { - /// - /// Async Extensions - This test doesn't need to be part of the - /// - public class AsyncExtensionFacts + public class AsyncExtensionTests { private readonly ITestOutputHelper output; - public AsyncExtensionFacts(ITestOutputHelper output) + public AsyncExtensionTests(ITestOutputHelper output) { this.output = output; } @@ -41,7 +38,7 @@ public async Task TaskDeleteCookiesCallbackOnComplete() var callback = new TaskDeleteCookiesCallback(); //Execute OnComplete on seperate Thread as in practice will be called on the CEF IO Thread. - Task.Delay(100).ContinueWith(x => + _ = Task.Delay(100).ContinueWith(x => { var c = (IDeleteCookiesCallback)callback; @@ -68,7 +65,7 @@ public async Task TaskDeleteCookiesCallbackOnCompleteLoop() var callback = new TaskDeleteCookiesCallback(); //Execute OnComplete on seperate Thread as in practice will be called on the CEF IO Thread. - Task.Delay(100).ContinueWith(x => + _ = Task.Delay(100).ContinueWith(x => { var c = (IDeleteCookiesCallback)callback; @@ -88,7 +85,7 @@ public async Task TaskDeleteCookiesCallbackDispose() var callback = new TaskDeleteCookiesCallback(); //Execute Dispose on seperate Thread as in practice will be called on the CEF IO Thread. - Task.Delay(100).ContinueWith(x => + _ = Task.Delay(100).ContinueWith(x => { var c = (IDeleteCookiesCallback)callback; diff --git a/CefSharp.Test/Framework/BinderFacts.cs b/CefSharp.Test/Framework/BinderFacts.cs deleted file mode 100644 index 97b72d3a3b..0000000000 --- a/CefSharp.Test/Framework/BinderFacts.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright © 2018 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -using CefSharp.ModelBinding; -using System.Collections.Generic; -using Xunit; - -namespace CefSharp.Test.Framework -{ - /// - /// BinderFacts - Tests model default binder behavior - /// - public class BinderFacts - { - enum TestEnum - { - A, - B, - C - } - - class TestObject - { - public string AString; - public bool ABool; - public int AnInteger; - public double ADouble; - public TestEnum AnEnum; - } - - [Fact] - public void BindsComplexObjects() - { - var binder = new DefaultBinder(new DefaultFieldNameConverter()); - var obj = new Dictionary - { - { "AnEnum", 2 }, - { "AString", "SomeValue" }, - { "ABool", true }, - { "AnInteger", 2.4 }, - { "ADouble", 2.6 } - }; - - var result = (TestObject)binder.Bind(obj, typeof(TestObject)); - - Assert.Equal(TestEnum.C, result.AnEnum); - Assert.Equal(obj["AString"], result.AString); - Assert.Equal(obj["ABool"], result.ABool); - Assert.Equal(2, result.AnInteger); - Assert.Equal(obj["ADouble"], result.ADouble); - } - - [Fact] - public void BindsEnums() - { - var binder = new DefaultBinder(new DefaultFieldNameConverter()); - var result = binder.Bind(2, typeof(TestEnum)); - - Assert.Equal(TestEnum.C, result); - } - - [Fact] - public void BindsIntegersWithPrecisionLoss() - { - var binder = new DefaultBinder(new DefaultFieldNameConverter()); - var result = binder.Bind(2.5678, typeof(int)); - - Assert.Equal(3, result); - - result = binder.Bind(2.123, typeof(int)); - - Assert.Equal(2, result); - } - - [Fact] - public void BindsDoublesWithoutPrecisionLoss() - { - const double Expected = 2.5678; - var binder = new DefaultBinder(new DefaultFieldNameConverter()); - var result = binder.Bind(Expected, typeof(double)); - - Assert.Equal(Expected, result); - - result = binder.Bind(2, typeof(double)); - - Assert.Equal(2.0, result); - } - } -} diff --git a/CefSharp.Test/Framework/BinderTests.cs b/CefSharp.Test/Framework/BinderTests.cs new file mode 100644 index 0000000000..c2a683c1bd --- /dev/null +++ b/CefSharp.Test/Framework/BinderTests.cs @@ -0,0 +1,188 @@ +// Copyright © 2018 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Generic; +using CefSharp.JavascriptBinding; +using CefSharp.ModelBinding; +using Xunit; + +namespace CefSharp.Test.Framework +{ + /// + /// BinderFacts - Tests model default binder behavior + /// + public class BinderTests + { + private enum TestEnum + { + A, + B, + C + } + +#pragma warning disable CS0649 + private class TestObject + { + public string AString; + public bool ABool; + public int AnInteger; + public double ADouble; + public TestEnum AnEnum; + } +#pragma warning restore CS0649 + + [Fact] + public void BindsComplexObjects() + { + var binder = new DefaultBinder(); + var obj = new Dictionary + { + { "AnEnum", 2 }, + { "AString", "SomeValue" }, + { "ABool", true }, + { "AnInteger", 2.4 }, + { "ADouble", 2.6 } + }; + + var result = (TestObject)binder.Bind(obj, typeof(TestObject)); + + Assert.Equal(TestEnum.C, result.AnEnum); + Assert.Equal(obj["AString"], result.AString); + Assert.Equal(obj["ABool"], result.ABool); + Assert.Equal(2, result.AnInteger); + Assert.Equal(obj["ADouble"], result.ADouble); + } + + [Fact] + public void BindsEnums() + { + var binder = new DefaultBinder(); + var result = binder.Bind(2, typeof(TestEnum)); + + Assert.Equal(TestEnum.C, result); + } + + [Fact] + public void BindsIntegersWithPrecisionLoss() + { + var binder = new DefaultBinder(); + var result = binder.Bind(2.5678, typeof(int)); + + Assert.Equal(3, result); + + result = binder.Bind(2.123, typeof(int)); + + Assert.Equal(2, result); + } + + [Fact] + public void BindsDoublesWithoutPrecisionLoss() + { + const double Expected = 2.5678; + var binder = new DefaultBinder(); + var result = binder.Bind(Expected, typeof(double)); + + Assert.Equal(Expected, result); + + result = binder.Bind(2, typeof(double)); + + Assert.Equal(2.0, result); + } + + [Theory] + [InlineData(0, typeof(int))] + [InlineData(0d, typeof(double))] + [InlineData(false, typeof(bool))] + public void NullToValueTypeTheory(object excepectedResult, Type conversionType) + { + var binder = new DefaultBinder(); + + var actualResult = binder.Bind(null, conversionType); + + Assert.Equal(excepectedResult, actualResult); + } + + [Fact] + public void BindArrayWithNullElementToIntArray() + { + var arrayType = typeof(int[]); + + var binder = new DefaultBinder(); + var obj = new List { 10, 20, null, 30 }; + var result = binder.Bind(obj, arrayType); + + Assert.NotNull(result); + Assert.Equal(arrayType, result.GetType()); + + var arr = (int[])result; + Assert.Equal(obj.Count, arr.Length); + + for (int i = 0; i < obj.Count; i++) + { + var expected = obj[i] ?? 0; + var actual = arr[i]; + Assert.Equal(expected, actual); + } + } + + [Fact] + public void BindListOfNumbersToDoubleArray() + { + var doubleArrayType = typeof(double[]); + + var binder = new DefaultBinder(); + var obj = new List { 10, 20, 1.23 }; + var result = binder.Bind(obj, doubleArrayType); + + Assert.NotNull(result); + Assert.Equal(doubleArrayType, result.GetType()); + + var arr = (double[])result; + Assert.Equal(obj.Count, arr.Length); + + for (int i = 0; i < obj.Count; i++) + { + var expected = Convert.ToDouble(obj[i]); + var actual = arr[i]; + Assert.Equal(expected, actual); + } + } + + [Fact] + public void HonorsJavascriptNameConverter() + { + var namingConverter = new CamelCaseJavascriptNameConverter(); + IBinder binder = new DefaultBinder(namingConverter); + var obj = new Dictionary + { + { "aString", "SomeValue" }, + { "aBool", true }, + }; + + var result = (TestObject)binder.Bind(obj, typeof(TestObject)); + + Assert.Equal(obj["aString"], result.AString); + Assert.Equal(obj["aBool"], result.ABool); + } + + [Fact] + public void HonorsJavascriptNameConverterLegacy() + { + var namingConverter = new LegacyCamelCaseJavascriptNameConverter(); + IBinder binder = new DefaultBinder(namingConverter); + + var obj = new Dictionary + { + { "AString", "SomeValue" }, + { "ABool", true }, + }; + + var result = (TestObject)binder.Bind(obj, typeof(TestObject)); + + Assert.Equal(obj["AString"], result.AString); + Assert.Equal(obj["ABool"], result.ABool); + } + } +} diff --git a/CefSharp.Test/Framework/CamelCaseNamingConverterTests.cs b/CefSharp.Test/Framework/CamelCaseNamingConverterTests.cs new file mode 100644 index 0000000000..a8de2b4ab8 --- /dev/null +++ b/CefSharp.Test/Framework/CamelCaseNamingConverterTests.cs @@ -0,0 +1,38 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.JavascriptBinding; +using Xunit; + +namespace CefSharp.Test.Framework +{ + /// + /// JavascriptNameConverterFacts - Test the different name converters + /// + public class CamelCaseNamingConverterTests + { + [Fact] + public void CanConvertStringToJavascriptName() + { + IJavascriptNameConverter converter = new CamelCaseJavascriptNameConverter(); + var propertyInfo = new TestMemberInfo("APropertyName"); + + var result = converter.ConvertToJavascript(propertyInfo); + + Assert.Equal("aPropertyName", result); + } + + [Fact] + public void CanConvertStringToReturnedObjectName() + { + IJavascriptNameConverter converter = new CamelCaseJavascriptNameConverter(); + var propertyInfo = new TestMemberInfo("APropertyName"); + + var result = converter.ConvertReturnedObjectPropertyAndFieldToNameJavascript(propertyInfo); + + Assert.Equal("aPropertyName", result); + } + } +} + diff --git a/CefSharp.Test/Framework/CefTimeUtilsTests.cs b/CefSharp.Test/Framework/CefTimeUtilsTests.cs new file mode 100644 index 0000000000..0ef9d6548a --- /dev/null +++ b/CefSharp.Test/Framework/CefTimeUtilsTests.cs @@ -0,0 +1,93 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.Internals; +using System; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Framework +{ + public class CefTimeUtilsTests + { + private readonly ITestOutputHelper output; + + public CefTimeUtilsTests(ITestOutputHelper output) + { + this.output = output; + } + + [Theory] + [InlineData(-50491123200000000, "0001-01-01")] + [InlineData(-86400000000, "1600-12-31")] + [InlineData(0, "1601-01-01")] + [InlineData(2650467743999999999, "9999-12-31 23:59:59")] + [InlineData(759797148870000000, "9999-12-31 23:59:59")] + public void FromBaseTimeToDateTimeShouldWork(long val, string expectedDateTime) + { + var actual = CefTimeUtils.FromBaseTimeToDateTime(val); + var expected = DateTime.Parse(expectedDateTime).ToLocalTime(); + + Assert.Equal(expected, actual, TimeSpan.FromSeconds(1)); + } + + [Fact] + public void FromDateTimeToBaseTimeShouldWorkForMaxValue() + { + const long expected = 265046774399999999; + var maxValueAsUtc = DateTime.SpecifyKind(DateTime.MaxValue, DateTimeKind.Utc); + + var actual = CefTimeUtils.FromDateTimeToBaseTime(maxValueAsUtc); + + Assert.Equal(expected, actual); + } + + [Fact] + public void FromDateTimeToBaseTimeShouldWorkForWindowsEpoch() + { + const long expected = 0; + var utcTime = DateTime.SpecifyKind(new DateTime(1601, 01, 01), DateTimeKind.Utc); + + var actual = CefTimeUtils.FromDateTimeToBaseTime(utcTime); + + Assert.Equal(expected, actual); + } + + [Fact] + public void FromDateTimeToBaseTimeShouldWorkForMinValue() + { + const long expected = -50491123200000000; + var utcTime = DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc); + + var actual = CefTimeUtils.FromDateTimeToBaseTime(utcTime); + + Assert.Equal(expected, actual); + } + + + [Fact] + public void ShouldConvertMinValueToAndFromDateTime() + { + var expected = DateTime.MinValue.ToLocalTime(); + + var baseTime = CefTimeUtils.FromDateTimeToBaseTime(expected); + + var actual = CefTimeUtils.FromBaseTimeToDateTime(baseTime); + + Assert.Equal(expected, actual); + } + + [Fact] + public void ShouldConvertMaxValueToAndFromDateTime() + { + var expected = DateTime.MaxValue.ToLocalTime(); + + var baseTime = CefTimeUtils.FromDateTimeToBaseTime(expected); + + var actual = CefTimeUtils.FromBaseTimeToDateTime(baseTime); + + Assert.Equal(expected, actual, TimeSpan.FromMilliseconds(10)); + } + } +} diff --git a/CefSharp.Test/Framework/ConcurrentMethodRunnerQueueTest.cs b/CefSharp.Test/Framework/ConcurrentMethodRunnerQueueTest.cs new file mode 100644 index 0000000000..79e8082b07 --- /dev/null +++ b/CefSharp.Test/Framework/ConcurrentMethodRunnerQueueTest.cs @@ -0,0 +1,141 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Threading; +using System.Threading.Tasks; +using CefSharp.Example.JavascriptBinding; +using CefSharp.Internals; +using Xunit; +using Xunit.Abstractions; +using Moq; + +namespace CefSharp.Test.Framework +{ + public class ConcurrentMethodRunnerQueueTest + { + private readonly ITestOutputHelper output; + + public ConcurrentMethodRunnerQueueTest(ITestOutputHelper output) + { + this.output = output; + } + + /// + /// Recreate the workflow that would appear to be the root cause of + /// https://github.com/cefsharp/CefSharp/discussions/3638 + /// + [Fact] + public void SimulateStartOnTaskAlreadyCompleted() + { + var cts = new CancellationTokenSource(); + + //Create a new Task + var task = new Task(async () => + { + await Task.Delay(100); + + }, cts.Token); + + //Cancel before started + cts.Cancel(); + + Assert.Throws(() => task.Start(TaskScheduler.Default)); + } + + /// + /// Proposed fix for + /// https://github.com/cefsharp/CefSharp/discussions/3638 + /// It's difficult to recreate the exact threading requirements, so simulating the + /// behaviour to test code executes without exception. + /// + [Fact] + public void SimulateTaskRunStartOnTaskAlreadyCompleted() + { + var cts = new CancellationTokenSource(); + + //Cancel before started + cts.Cancel(); + + var task = Task.Run(async () => + { + await Task.Delay(100); + }, cts.Token); + + Assert.NotNull(task); + Assert.Equal(TaskStatus.Canceled, task.Status); + } + + [Fact] + public void ShouldWorkWhenEnqueueCalledAfterDispose() + { + var methodInvocation = new MethodInvocation(1, "1", 1, "Testing", 1); + methodInvocation.Parameters.Add("Echo Me!"); + + var objectRepository = new JavascriptObjectRepository + { + NameConverter = null + }; + + var methodRunnerQueue = new ConcurrentMethodRunnerQueue(objectRepository); + + //Dispose + methodRunnerQueue.Dispose(); + + //Enqueue + var ex = Record.Exception(() => methodRunnerQueue.Enqueue(methodInvocation)); + + //Ensure no exception thrown + Assert.Null(ex); + } + + [Fact] + public async Task ShouldDisposeWhenRunningWithoutException() + { + var boundObject = new AsyncBoundObject(); + + IJavascriptObjectRepositoryInternal objectRepository = new JavascriptObjectRepository(); + objectRepository.NameConverter = null; +#if NETCOREAPP + objectRepository.Register("testObject", boundObject, BindingOptions.DefaultBinder); +#else + objectRepository.Register("testObject", boundObject, true, BindingOptions.DefaultBinder); +#endif + var methodInvocation = new MethodInvocation(1, "1", 1, nameof(boundObject.AsyncWaitTwoSeconds), 1); + methodInvocation.Parameters.Add("Echo Me!"); + var methodRunnerQueue = new ConcurrentMethodRunnerQueue(objectRepository); + + methodRunnerQueue.Enqueue(methodInvocation); + + //Wait a litle for the queue to start processing our Method call + await Task.Delay(500); + + var ex = Record.Exception(() => methodRunnerQueue.Dispose()); + + Assert.Null(ex); + } + + [Fact] + public async Task ShouldCallMethodAsync() + { + const string expected = "Echo Me!"; + const string methodName = "AsyncWaitTwoSeconds"; + + var mockObjectRepository = new Mock(); + mockObjectRepository.Setup(x => x.TryCallMethodAsync(1, methodName, It.IsAny())).ReturnsAsync(new TryCallMethodResult(true, expected, string.Empty)); + var methodInvocation = new MethodInvocation(1, "1", 1, methodName, 1); + methodInvocation.Parameters.Add(expected); + + using var methodRunnerQueue = new ConcurrentMethodRunnerQueue(mockObjectRepository.Object); + + var evt = await AssertEx.RaisesAsync( + cancelAfter: 10000, + x => methodRunnerQueue.MethodInvocationComplete += x, + x => methodRunnerQueue.MethodInvocationComplete -= x, + () => methodRunnerQueue.Enqueue(methodInvocation)); + + Assert.Equal(expected, evt.Arguments.Result.Result); + } + } +} diff --git a/CefSharp.Test/Framework/HasHandlerTests.cs b/CefSharp.Test/Framework/HasHandlerTests.cs new file mode 100644 index 0000000000..6fa0a596f5 --- /dev/null +++ b/CefSharp.Test/Framework/HasHandlerTests.cs @@ -0,0 +1,49 @@ +using Xunit; + +namespace CefSharp.Test.Framework +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class HasHandlerTests + { + [Fact] + public void ShouldWorkForOffScreen() + { + using(var browser = new CefSharp.OffScreen.ChromiumWebBrowser(automaticallyCreateBrowser:false)) + { + browser.Paint += OffScreenBrowserPaint; + + Assert.Equal(1, browser.PaintEventHandlerCount()); + + browser.Paint -= OffScreenBrowserPaint; + + Assert.Equal(0, browser.PaintEventHandlerCount()); + } + } + + [WpfFact] + public void ShouldWorkForWpf() + { + using (var browser = new CefSharp.Wpf.ChromiumWebBrowser()) + { + browser.Paint += WpfBrowserPaint; + + Assert.Equal(1, browser.PaintEventHandlerCount()); + + browser.Paint -= WpfBrowserPaint; + + Assert.Equal(0, browser.PaintEventHandlerCount()); + } + } + + private void WpfBrowserPaint(object sender, CefSharp.Wpf.PaintEventArgs e) + { + + } + + private void OffScreenBrowserPaint(object sender, CefSharp.OffScreen.OnPaintEventArgs e) + { + + } + } +} diff --git a/CefSharp.Test/Framework/JavascritpCallbackConversionTests.cs b/CefSharp.Test/Framework/JavascritpCallbackConversionTests.cs new file mode 100644 index 0000000000..eaa0594cd0 --- /dev/null +++ b/CefSharp.Test/Framework/JavascritpCallbackConversionTests.cs @@ -0,0 +1,30 @@ +using Bogus; +using Bogus.Extensions; +using CefSharp.Internals; +using Xunit; +using Xunit.Repeat; + +namespace CefSharp.Test.Framework +{ + public class JavascritpCallbackConversionTests + { + [Theory] + [Repeat(1000)] + public void CanConvertToAndFromBinary(int iteration) + { + var calbackFactory = new Faker() + .RuleFor(o => o.Id, f => f.Random.Long(1, long.MaxValue)) + .RuleFor(o => o.BrowserId, f => f.Random.Number(1, int.MaxValue)) + .RuleFor(o => o.FrameId, f => f.Random.AlphaNumeric(120).ClampLength(120, 160)); + + var exepected = calbackFactory.Generate(); + + var actual = JavascriptCallback.FromBytes(exepected.ToByteArray(1)); + + Assert.Equal(exepected.Id, actual.Id); + Assert.Equal(exepected.BrowserId, actual.BrowserId); + Assert.Equal(exepected.FrameId, actual.FrameId); + + } + } +} diff --git a/CefSharp.Test/Framework/LegacyCamelCaseJavascriptNameConverterTests.cs b/CefSharp.Test/Framework/LegacyCamelCaseJavascriptNameConverterTests.cs new file mode 100644 index 0000000000..e04f9d2280 --- /dev/null +++ b/CefSharp.Test/Framework/LegacyCamelCaseJavascriptNameConverterTests.cs @@ -0,0 +1,38 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.JavascriptBinding; +using Xunit; + +namespace CefSharp.Test.Framework +{ + /// + /// LegacyCamelCaseJavascriptNameConverterFacts - Test the different name converters + /// + public class LegacyCamelCaseJavascriptNameConverterTests + { + [Fact] + public void CanConvertStringToJavascriptName() + { + IJavascriptNameConverter converter = new LegacyCamelCaseJavascriptNameConverter(); + var propertyInfo = new TestMemberInfo("APropertyName"); + + var result = converter.ConvertToJavascript(propertyInfo); + + Assert.Equal("aPropertyName", result); + } + + [Fact] + public void CanConvertStringToReturnedObjectName() + { + IJavascriptNameConverter converter = new LegacyCamelCaseJavascriptNameConverter(); + var propertyInfo = new TestMemberInfo("APropertyName"); + + var result = converter.ConvertReturnedObjectPropertyAndFieldToNameJavascript(propertyInfo); + + Assert.Equal(propertyInfo.Name, result); + } + } +} + diff --git a/CefSharp.Test/Framework/MethodRunnerQueueTests.cs b/CefSharp.Test/Framework/MethodRunnerQueueTests.cs new file mode 100644 index 0000000000..ed0eda88d9 --- /dev/null +++ b/CefSharp.Test/Framework/MethodRunnerQueueTests.cs @@ -0,0 +1,35 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.Internals; +using Xunit; + +namespace CefSharp.Test.Framework +{ + public class MethodRunnerQueueTests + { + [Fact] + public void DisposeQueueThenEnqueueMethodInvocation() + { + var methodInvocation = new MethodInvocation(1, "1", 1, "Testing", 1); + methodInvocation.Parameters.Add("Echo Me!"); + + var objectRepository = new JavascriptObjectRepository + { + NameConverter = null + }; + + var methodRunnerQueue = new MethodRunnerQueue(objectRepository); + + //Dispose + methodRunnerQueue.Dispose(); + + //Enqueue + var ex = Record.Exception(() => methodRunnerQueue.Enqueue(methodInvocation)); + + //Ensure no exception thrown + Assert.Null(ex); + } + } +} diff --git a/CefSharp.Test/Framework/MimeTypeMappingTests.cs b/CefSharp.Test/Framework/MimeTypeMappingTests.cs new file mode 100644 index 0000000000..5f54f47ba1 --- /dev/null +++ b/CefSharp.Test/Framework/MimeTypeMappingTests.cs @@ -0,0 +1,36 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using Xunit; + +namespace CefSharp.Test.Framework +{ + /// + /// MimeTypeMappingFacts - Tests file extension to mimeType mapping + /// + public class MimeTypeMappingTests + { + [Theory] + [InlineData("html", "text/html")] + [InlineData(".wasm", "application/wasm")] + [InlineData(".ogg", "audio/ogg")] + [InlineData(".oga", "audio/ogg")] + [InlineData(".ogv", "video/ogg")] + [InlineData(".opus", "audio/ogg")] + [InlineData(".webm", "video/webm")] + [InlineData(".weba", "audio/webm")] + [InlineData(".webp", "image/webp")] + [InlineData(".epub", "application/epub+zip")] + [InlineData(".woff", "application/font-woff")] + [InlineData(".woff2", "font/woff2")] + [InlineData(".ttf", "font/ttf")] + [InlineData(".otf", "font/otf")] + [InlineData(".dummyextension", "application/octet-stream")] + public void MapFileExtensionToMimeTypeTheory(string fileExtension, string expectedMimeType) + { + var actualMimeType = Cef.GetMimeType(fileExtension); + Assert.Equal(expectedMimeType, actualMimeType); + } + } +} diff --git a/CefSharp.Test/Framework/ParseUrlTests.cs b/CefSharp.Test/Framework/ParseUrlTests.cs new file mode 100644 index 0000000000..1b222dce4a --- /dev/null +++ b/CefSharp.Test/Framework/ParseUrlTests.cs @@ -0,0 +1,37 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using Xunit.Abstractions; +using Xunit; + +namespace CefSharp.Test.Framework +{ + public class ParseUrlTests + { + private readonly ITestOutputHelper output; + + public ParseUrlTests(ITestOutputHelper output) + { + this.output = output; + } + + [Theory] + [InlineData("https://google.com", "google.com")] + public void CanParseGoogleDotComUrl(string url, string host) + { + var urlParts = Cef.ParseUrl(url); + + Assert.Equal(urlParts.Host, host); + } + + [Theory] + [InlineData("google.com")] + public void CanParseInvalidUrl(string url) + { + var urlParts = Cef.ParseUrl(url); + + Assert.Null(urlParts); + } + } +} diff --git a/CefSharp.Test/Framework/PathCheckTests.cs b/CefSharp.Test/Framework/PathCheckTests.cs new file mode 100644 index 0000000000..f4063b9625 --- /dev/null +++ b/CefSharp.Test/Framework/PathCheckTests.cs @@ -0,0 +1,49 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using CefSharp.Internals; +using Xunit; + +namespace CefSharp.Test.Framework +{ + public class PathCheckTests + { + [Fact] + public void IsPathAbsoluteValid() + { + Assert.True(PathCheck.IsAbsolute(@"C:\foo1")); + Assert.True(PathCheck.IsAbsolute(@"c:\")); + Assert.True(PathCheck.IsAbsolute(@"C:\foo2")); + Assert.True(PathCheck.IsAbsolute(@"C:\foo2\")); + Assert.True(PathCheck.IsAbsolute(@"c:/")); + Assert.True(PathCheck.IsAbsolute(@"C:/foo1")); + Assert.True(PathCheck.IsAbsolute(@"c:\")); + Assert.True(PathCheck.IsAbsolute(@"C:/foo2")); + Assert.True(PathCheck.IsAbsolute(@"C:\Users\appveyor\AppData\Local\CefSharp\Tests\Cache")); + + } + + [Fact] + public void IsPathAbsoluteInValid() + { + Assert.False(PathCheck.IsAbsolute(@"\")); + Assert.False(PathCheck.IsAbsolute(@"/")); + Assert.False(PathCheck.IsAbsolute(@"C:")); + Assert.False(PathCheck.IsAbsolute(@".")); + Assert.False(PathCheck.IsAbsolute(@"..")); + Assert.False(PathCheck.IsAbsolute(@"cache")); + Assert.False(PathCheck.IsAbsolute(@"cache\")); + } + + [Fact] + public void AssertPathAbsoluteInValid() + { + Assert.Throws(() => PathCheck.AssertAbsolute(@"\", "Path")); + Assert.Throws(() => PathCheck.AssertAbsolute(@"c:foo", "Path")); + Assert.Throws(() => PathCheck.AssertAbsolute(@"cache", "Path")); + Assert.Throws(() => PathCheck.AssertAbsolute(@"locales\", "Path")); + } + } +} diff --git a/CefSharp.Test/Framework/RequestContextBuilderTests.cs b/CefSharp.Test/Framework/RequestContextBuilderTests.cs new file mode 100644 index 0000000000..02a7c8ea32 --- /dev/null +++ b/CefSharp.Test/Framework/RequestContextBuilderTests.cs @@ -0,0 +1,63 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Framework +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class RequestContextBuilderTests + { + private CefSharpFixture fixture; + private ITestOutputHelper output; + + public RequestContextBuilderTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public void ThrowExceptionWithSharedSettingsNull() + { + Assert.Throws(() => + { + var requestContext = RequestContext + .Configure() + .WithSharedSettings(null); + }); + } + + [Fact] + public void ThrowExceptionIfContextAlreadySpecified() + { + Assert.Throws(() => + { + var requestContext = new RequestContext(); + + RequestContext + .Configure() + .WithSharedSettings(requestContext) + .WithCachePath("shouldThrowException"); + }); + } + + [Fact] + public void ThrowExceptionIfCachePathAlreadySpecified() + { + Assert.Throws(() => + { + var requestContext = new RequestContext(); + + RequestContext + .Configure() + .WithCachePath("c:\\temp") + .WithSharedSettings(requestContext); + }); + } + } +} diff --git a/CefSharp.Test/Framework/RequestContextExtensionTests.cs b/CefSharp.Test/Framework/RequestContextExtensionTests.cs new file mode 100644 index 0000000000..15899364bd --- /dev/null +++ b/CefSharp.Test/Framework/RequestContextExtensionTests.cs @@ -0,0 +1,92 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Moq; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Framework +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class RequestContextExtensionTests + { + private const string ProxyPreferenceKey = "proxy"; + + private readonly ITestOutputHelper output; + + private delegate void SetPreferenceDelegate(string name, object value, out string errorMessage); + + public RequestContextExtensionTests(ITestOutputHelper output) + { + this.output = output; + } + + [Theory] + [InlineData("http", "localhost", 8080, "http://localhost:8080")] + [InlineData("socks", "localhost", null, "socks://localhost")] + [InlineData(null, "localhost", null, "http://localhost")] + public void CanSetProxyWithSchemeHostAndPort(string scheme, string host, int? port, string expected) + { + string preferenceName = ""; + object preferenceValue = null; + var mockRequestContext = new Mock(); + + mockRequestContext.Setup(x => x.CanSetPreference(ProxyPreferenceKey)).Returns(true); + + mockRequestContext.Setup(x => x.SetPreference(ProxyPreferenceKey, It.IsAny>(), out It.Ref.IsAny)) + .Callback(new SetPreferenceDelegate((string name, object value, out string errorMessage) => + { + preferenceName = name; + preferenceValue = value; + errorMessage = "OK"; + })) + .Returns(true); + + string msg; + + var result = mockRequestContext.Object.SetProxy(scheme, host, port, out msg); + var dict = (Dictionary)preferenceValue; + + Assert.True(result); + Assert.Equal("OK", msg); + Assert.Equal(ProxyPreferenceKey, preferenceName); + Assert.Equal(2, dict.Count); + Assert.Equal("fixed_servers", dict["mode"]); + Assert.Equal(expected, dict["server"]); + } + + [Fact] + public void SetProxyThrowsExceptionOnInvalidScheme() + { + var mockRequestContext = new Mock(); + + mockRequestContext.Setup(x => x.SetPreference(ProxyPreferenceKey, It.IsAny>(), out It.Ref.IsAny)).Returns(true); + + Assert.Throws(() => + { + string msg; + mockRequestContext.Object.SetProxy("myscheme", "localhost", 0, out msg); + }); + } + + [Fact] + public async Task CanGetCookieManagerForRequestContextAsync() + { + var requestContext = RequestContext + .Configure() + .Create(); + + var cookieManager = await requestContext.GetCookieManagerAsync(); + + var cookies = await cookieManager.VisitAllCookiesAsync(); + + Assert.NotNull(cookies); + output.WriteLine("Cookie Count {0}", cookies.Count); + } + } +} diff --git a/CefSharp.Test/Framework/RequestContextTests.cs b/CefSharp.Test/Framework/RequestContextTests.cs new file mode 100644 index 0000000000..714e8fe5bf --- /dev/null +++ b/CefSharp.Test/Framework/RequestContextTests.cs @@ -0,0 +1,105 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.IO; +using System.Threading.Tasks; +using CefSharp.Enums; +using CefSharp.Example; +using CefSharp.Internals; +using Xunit; + +namespace CefSharp.Test.Framework +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class RequestContextTests + { + [Fact] + public void IsSameAs() + { + var ctx1 = new RequestContext(); + var ctx2 = ctx1.UnWrap(); + + Assert.True(ctx1.IsSame(ctx2)); + } + + [Fact] + public void IsSharingWith() + { + var ctx1 = RequestContext.Configure() + .WithCachePath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests\\TempCache1")) + .Create(); + var ctx2 = new RequestContext(ctx1); + + Assert.True(ctx1.IsSharingWith(ctx2)); + } + + [Fact] + public void CanGetContentSetting() + { + var ctx = RequestContext.Configure() + .WithCachePath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests\\TempCache2")) + .Create(); + + var actual = ctx.GetContentSetting(CefExample.DefaultUrl, null, ContentSettingTypes.Autoplay); + + Assert.Equal(ContentSettingValues.Default, actual); + } + + [Fact] + public async Task CanSetContentSetting() + { + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + var ctx = RequestContext.Configure() + .WithCachePath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests\\TempCache3")) + .OnInitialize((ctx) => + { + tcs.SetResult(true); + }) + .Create(); + + await tcs.Task; + + var actual = ContentSettingValues.Default; + + await CefThread.ExecuteOnUiThread(() => + { + ctx.SetContentSetting(CefExample.DefaultUrl, null, ContentSettingTypes.Autoplay, ContentSettingValues.Block); + + actual = ctx.GetContentSetting(CefExample.DefaultUrl, null, ContentSettingTypes.Autoplay); + }); + + Assert.Equal(ContentSettingValues.Block, actual); + } + + [Fact] + public async Task CanSetWebsiteSetting() + { + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + var ctx = RequestContext.Configure() + .WithCachePath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests\\TempCache4")) + .OnInitialize((ctx) => + { + tcs.SetResult(true); + }) + .Create(); + + await tcs.Task; + + object actual = ContentSettingValues.Default; + + await CefThread.ExecuteOnUiThread(() => + { + ctx.SetWebsiteSetting(CefExample.DefaultUrl, null, ContentSettingTypes.Popups, (int)ContentSettingValues.Allow); + + actual = ctx.GetWebsiteSetting(CefExample.DefaultUrl, null, ContentSettingTypes.Popups); + }); + + Assert.Equal(ContentSettingValues.Allow, (ContentSettingValues)actual); + } + } +} diff --git a/CefSharp.Test/Framework/TestMemberInfo.cs b/CefSharp.Test/Framework/TestMemberInfo.cs new file mode 100644 index 0000000000..2b6cb8dbbe --- /dev/null +++ b/CefSharp.Test/Framework/TestMemberInfo.cs @@ -0,0 +1,52 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + + +using System; +using System.Reflection; + +namespace CefSharp.Test.Framework +{ + public class TestMemberInfo : MemberInfo + { + private readonly string name; + + public TestMemberInfo(string name) + { + this.name = name; + } + + public override MemberTypes MemberType + { + get { throw new NotImplementedException(); } + } + + public override string Name => name; + + public override Type DeclaringType + { + get { throw new NotImplementedException(); } + } + + public override Type ReflectedType + { + get { throw new NotImplementedException(); } + } + + public override object[] GetCustomAttributes(bool inherit) + { + throw new NotImplementedException(); + } + + public override object[] GetCustomAttributes(Type attributeType, bool inherit) + { + throw new NotImplementedException(); + } + + public override bool IsDefined(Type attributeType, bool inherit) + { + throw new NotImplementedException(); + } + } +} diff --git a/CefSharp.Test/Issues/Issue4621.cs b/CefSharp.Test/Issues/Issue4621.cs new file mode 100644 index 0000000000..13b4b0aeb2 --- /dev/null +++ b/CefSharp.Test/Issues/Issue4621.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CefSharp.OffScreen; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Issues +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class Issue4621 + { + private readonly ITestOutputHelper output; + + public Issue4621(ITestOutputHelper output) + { + this.output = output; + } + + [SkipIfRunOnAppVeyorFact] + public async Task GoogleSearchToGoogleAccountsBreaksJS() + { + using (var browser = new ChromiumWebBrowser("https://www.google.com", useLegacyRenderHandler: false)) + { + var initialResponse = await browser.WaitForInitialLoadAsync(); + + var response = await browser.LoadUrlAsync("https://accounts.google.com/"); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("accounts.google", mainFrame.Url); + Assert.Equal(200, response.HttpStatusCode); + + output.WriteLine("Url {0}", mainFrame.Url); + + var buttonText = await mainFrame.EvaluateScriptAsync("(function() { return document.querySelector(\"button[aria-haspopup='menu']\").innerText; })();"); + Assert.Equal("Create account", buttonText); + } + } + + [SkipIfRunOnAppVeyorFact] + public async Task GoogleSearchToGmailBreaksJS() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + var navResponse = await browser.LoadUrlAsync("https://mail.google.com/mail/&ogbl"); + Assert.True(navResponse.Success); + Assert.Equal(200, navResponse.HttpStatusCode); + + var mainFrame = browser.GetMainFrame(); + Assert.True(mainFrame.IsValid); + var text = await mainFrame.EvaluateScriptAsync("(function() { return document.querySelector(\"span\").innerText; })();"); + Assert.Equal("For work", text); + } + } + + [SkipIfRunOnAppVeyorFact] + public async Task NavigateBetweenTwoUrlsBreaksJs() + { + const string theUrl = "https://brave.com/"; + const string theUrl2 = "https://brave.com/search/"; + + using (var browser = new ChromiumWebBrowser(theUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + await Task.Delay(1000); + + for (var x = 0; x < 20; x++) + { + await browser.LoadUrlAsync(x % 2 == 0 ? theUrl : theUrl2); + + var javascriptResponse = await browser.EvaluateScriptAsync($"{x}+1"); + + Assert.True(javascriptResponse.Success, javascriptResponse.Message); + + Assert.Equal(x + 1, (int)javascriptResponse.Result); + } + } + } + } +} diff --git a/CefSharp.Test/Javascript/EvaluateScriptAsPromiseAsyncTest.cs b/CefSharp.Test/Javascript/EvaluateScriptAsPromiseAsyncTest.cs new file mode 100644 index 0000000000..74631cc9f8 --- /dev/null +++ b/CefSharp.Test/Javascript/EvaluateScriptAsPromiseAsyncTest.cs @@ -0,0 +1,69 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Javascript +{ + [Collection(CefSharpFixtureCollection.Key)] + public class EvaluateScriptAsPromiseAsyncTest : BrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture collectionFixture; + + public EvaluateScriptAsPromiseAsyncTest(ITestOutputHelper output, CefSharpFixture collectionFixture) + { + this.output = output; + this.collectionFixture = collectionFixture; + } + + [Theory] + [InlineData("return 42;", "42")] + [InlineData("return new Promise(function(resolve, reject) { resolve(42); });", "42")] + [InlineData("return await 42;", "42")] + [InlineData("var result = await fetch('./home.html'); return result.status;", "200")] + public async Task ShouldWork(string script, string expected) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsPromiseAsync(script); + + Assert.True(javascriptResponse.Success); + Assert.Equal(expected, javascriptResponse.Result.ToString()); + } + + [Theory] + [InlineData("return new Promise(function(resolve, reject) { reject('reject test'); });", "reject test")] + [InlineData("return await (function() { throw('reject test'); })();", "reject test")] + public async Task ShouldFail(string script, string expected) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsPromiseAsync(script); + + Assert.False(javascriptResponse.Success); + Assert.Equal(expected, javascriptResponse.Message); + } + + [Theory] + [InlineData("return { a: 'CefSharp', b: 42, };", "CefSharp", "42")] + [InlineData("return new Promise(function(resolve, reject) { resolve({ a: 'CefSharp', b: 42, }); });", "CefSharp", "42")] + [InlineData("return new Promise(function(resolve, reject) { setTimeout(resolve.bind(null, { a: 'CefSharp', b: 42, }), 1000); });", "CefSharp", "42")] + [InlineData("return await { a: 'CefSharp', b: 42, };", "CefSharp", "42")] + [InlineData("return await new Promise(function(resolve, reject) { setTimeout(resolve.bind(null, { a: 'CefSharp', b: 42, }), 1000); }); ", "CefSharp", "42")] + [InlineData("function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }; async function getValAfterSleep() { await sleep(1000); return { a: 'CefSharp', b: 42 }; }; await sleep(2000); const result = await getValAfterSleep(); await sleep(2000); return result;", "CefSharp", "42")] + public async Task ShouldWorkWithObjects(string script, string expectedA, string expectedB) + { + var javascriptResponse = await Browser.EvaluateScriptAsPromiseAsync(script); + + Assert.True(javascriptResponse.Success); + + dynamic result = javascriptResponse.Result; + Assert.Equal(expectedA, result.a.ToString()); + Assert.Equal(expectedB, result.b.ToString()); + } + } +} diff --git a/CefSharp.Test/Javascript/EvaluateScriptAsyncGenericTests.cs b/CefSharp.Test/Javascript/EvaluateScriptAsyncGenericTests.cs new file mode 100644 index 0000000000..994ea7c9b3 --- /dev/null +++ b/CefSharp.Test/Javascript/EvaluateScriptAsyncGenericTests.cs @@ -0,0 +1,186 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Globalization; +using System.Linq; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Javascript +{ + [Collection(CefSharpFixtureCollection.Key)] + public class EvaluateScriptAsyncGenericTests : BrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture collectionFixture; + + public EvaluateScriptAsyncGenericTests(ITestOutputHelper output, CefSharpFixture collectionFixture) + { + this.output = output; + this.collectionFixture = collectionFixture; + } + + [Theory] + [InlineData(double.MaxValue, "Number.MAX_VALUE")] + [InlineData(double.MaxValue / 2, "Number.MAX_VALUE / 2")] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForDoubleComputation(double expectedValue, string script) + { + AssertInitialLoadComplete(); + + var actual = await Browser.EvaluateScriptAsync(script); + + Assert.Equal(expectedValue, actual); + } + + [Theory] + [InlineData(0.5d)] + [InlineData(1.5d)] + [InlineData(-0.5d)] + [InlineData(-1.5d)] + [InlineData(100000.24500d)] + [InlineData(-100000.24500d)] + [InlineData((double)uint.MaxValue)] + [InlineData((double)int.MaxValue + 1)] + [InlineData((double)int.MaxValue + 10)] + [InlineData((double)int.MinValue - 1)] + [InlineData((double)int.MinValue - 10)] + [InlineData(((double)uint.MaxValue * 2))] + [InlineData(((double)uint.MaxValue * 2) + 0.1)] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForDouble(double expected) + { + AssertInitialLoadComplete(); + + var actual = await Browser.EvaluateScriptAsync(expected.ToString(CultureInfo.InvariantCulture)); + + Assert.Equal(expected, actual, 5); + } + + [Theory] + [InlineData(0)] + [InlineData(-1)] + [InlineData(100)] + [InlineData(int.MaxValue)] + [InlineData(int.MinValue)] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForInt(object expected) + { + AssertInitialLoadComplete(); + + var actual = await Browser.EvaluateScriptAsync(expected.ToString()); + + Assert.Equal(expected, actual); + } + + [Theory] + [InlineData("1970-01-01", "1970-01-01")] + [InlineData("1980-01-01", "1980-01-01")] + //https://github.com/cefsharp/CefSharp/issues/4234 + public async Task ShouldWorkForDate(DateTime expected, string str) + { + AssertInitialLoadComplete(); + + expected = expected.ToLocalTime(); + + var actual = await Browser.EvaluateScriptAsync($"new Date('{str}');"); + + Assert.Equal(expected, actual); + } + + [Theory] + [InlineData("new Promise(function(resolve, reject) { resolve(42); });", "42")] + [InlineData("Promise.resolve(42);", "42")] + [InlineData("(async () => { var result = await fetch('https://cefsharp.example/HelloWorld.html'); return result.status;})();", "200")] + public async Task ShouldWorkForPromisePrimative(string script, string expected) + { + AssertInitialLoadComplete(); + + var actual = await Browser.EvaluateScriptAsync(script); + + Assert.Equal(expected, actual); + } + + [Theory] + [InlineData("new Promise(function(resolve, reject) { reject('reject test'); });", "reject test")] + [InlineData("(async () => { throw('reject test'); })();", "reject test")] + public async Task ShouldFailForPromisePrimative(string script, string expected) + { + AssertInitialLoadComplete(); + + var exception = await Assert.ThrowsAsync(async () => + { + await Browser.EvaluateScriptAsync(script); + }); + + Assert.Equal(expected, exception.Message); + } + + [Theory] + [InlineData("new Promise(function(resolve, reject) { resolve({ a: 'CefSharp', b: 42, }); });", "CefSharp", "42")] + [InlineData("new Promise(function(resolve, reject) { setTimeout(resolve.bind(null, { a: 'CefSharp', b: 42, }), 1000); });", "CefSharp", "42")] + [InlineData("(async () => { function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }; async function getValAfterSleep() { await sleep(1000); return { a: 'CefSharp', b: 42 }; }; await sleep(2000); const result = await getValAfterSleep(); await sleep(2000); return result; })();", "CefSharp", "42")] + public async Task ShouldWorkForPromisePrimativeObject(string script, string expectedA, string expectedB) + { + AssertInitialLoadComplete(); + + var actual = await Browser.EvaluateScriptAsync(script); + + Assert.Equal(expectedA, actual.a.ToString()); + Assert.Equal(expectedB, actual.b.ToString()); + } + + [Fact] + public async Task ShouldLoadGoogleAndEvaluateScript() + { + AssertInitialLoadComplete(); + + var loadResponse = await Browser.LoadUrlAsync("www.google.com"); + + Assert.True(loadResponse.Success); + + var mainFrame = Browser.GetMainFrame(); + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + var response = await Browser.EvaluateScriptAsync("2 + 2"); + Assert.Equal(4, response); + output.WriteLine("Result of 2 + 2: {0}", response); + } + + [Fact] + public async Task CanEvaluateScriptInParallel() + { + AssertInitialLoadComplete(); + + var tasks = Enumerable.Range(0, 100).Select(i => Task.Run(async () => + { + return await Browser.EvaluateScriptAsync("2 + 2"); + })).ToList(); + + await Task.WhenAll(tasks); + + Assert.All(tasks, (t) => + { + Assert.Equal(4, t.Result); + }); + } + + [Theory] + [InlineData("[1,2,,5]", new object[] { 1, 2, null, 5 })] + [InlineData("[1,2,,]", new object[] { 1, 2, null })] + [InlineData("[,2,3]", new object[] { null, 2, 3 })] + [InlineData("[,2,,3,,4,,,,5,,,]", new object[] { null, 2, null, 3, null, 4, null, null, null, 5, null, null })] + public async Task CanEvaluateScriptAsyncReturnPartiallyEmptyArrays(string javascript, object[] expected) + { + AssertInitialLoadComplete(); + + var actual = await Browser.EvaluateScriptAsync(javascript); + + Assert.Equal(expected, actual); + } + } +} diff --git a/CefSharp.Test/Javascript/EvaluateScriptAsyncTests.cs b/CefSharp.Test/Javascript/EvaluateScriptAsyncTests.cs new file mode 100644 index 0000000000..f5f5bb3dba --- /dev/null +++ b/CefSharp.Test/Javascript/EvaluateScriptAsyncTests.cs @@ -0,0 +1,346 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Bogus; +using CefSharp.Example; +using Xunit; +using Xunit.Abstractions; +using Xunit.Repeat; + +namespace CefSharp.Test.Javascript +{ + [Collection(CefSharpFixtureCollection.Key)] + public class EvaluateScriptAsyncTests : BrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture collectionFixture; + + public EvaluateScriptAsyncTests(ITestOutputHelper output, CefSharpFixture collectionFixture) + { + this.output = output; + this.collectionFixture = collectionFixture; + } + + [Fact] + public async Task ShouldCancelAfterV8ContextChange() + { + Task evaluateCancelAfterDisposeTask; + using (var browser = new CefSharp.OffScreen.ChromiumWebBrowser(automaticallyCreateBrowser: false)) + { + await browser.CreateBrowserAsync(); + + // no V8 context + var withoutV8ContextException = await Assert.ThrowsAsync(() => browser.EvaluateScriptAsync("1+1")); + Assert.StartsWith("Unable to execute javascript at this time", withoutV8ContextException.Message); + + Task evaluateWithoutV8ContextTask; + using (var frame = browser.GetMainFrame()) + { + evaluateWithoutV8ContextTask = frame.EvaluateScriptAsync("1+2"); + } + + // V8 context + await browser.LoadUrlAsync(CefExample.HelloWorldUrl); + var evaluateWithoutV8ContextResponse = await evaluateWithoutV8ContextTask; + Assert.True(evaluateWithoutV8ContextResponse.Success); + Assert.Equal(3, evaluateWithoutV8ContextResponse.Result); + + var evaluateCancelAfterV8ContextChangeTask = browser.EvaluateScriptAsync("new Promise(resolve => setTimeout(resolve, 1000))"); + + // change V8 context + await browser.LoadUrlAsync(CefExample.HelloWorldUrl); + + // Wait for 100ms so the message from the render process has time to arrive, this + // wasn't previously nessicary, timing is different starting in M146 + await Task.Delay(500); + + await Assert.ThrowsAsync(() => evaluateCancelAfterV8ContextChangeTask); + + evaluateCancelAfterDisposeTask = browser.EvaluateScriptAsync("new Promise(resolve => setTimeout(resolve, 1000))"); + } + await Assert.ThrowsAsync(() => evaluateCancelAfterDisposeTask); + } + + [Fact] + public async Task ShouldCancelOnCrash() + { + AssertInitialLoadComplete(); + + var task = Browser.EvaluateScriptAsync("new Promise(resolve => setTimeout(resolve, 1000))"); + await Browser.LoadUrlAsync("chrome://crash"); + await Assert.ThrowsAsync(() => task); + } + + [Theory] + [InlineData(double.MaxValue, "Number.MAX_VALUE")] + [InlineData(double.MaxValue / 2, "Number.MAX_VALUE / 2")] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForDoubleComputation(double expectedValue, string script) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync(script); + Assert.True(javascriptResponse.Success); + + var actualType = javascriptResponse.Result.GetType(); + + Assert.Equal(typeof(double), actualType); + Assert.Equal(expectedValue, (double)javascriptResponse.Result, 5); + + output.WriteLine("Script {0} : Result {1}", script, javascriptResponse.Result); + } + + [Theory] + [InlineData(0.5d)] + [InlineData(1.5d)] + [InlineData(-0.5d)] + [InlineData(-1.5d)] + [InlineData(100000.24500d)] + [InlineData(-100000.24500d)] + [InlineData((double)uint.MaxValue)] + [InlineData((double)int.MaxValue + 1)] + [InlineData((double)int.MaxValue + 10)] + [InlineData((double)int.MinValue - 1)] + [InlineData((double)int.MinValue - 10)] + [InlineData(((double)uint.MaxValue * 2))] + [InlineData(((double)uint.MaxValue * 2) + 0.1)] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForDouble(double num) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync(num.ToString(CultureInfo.InvariantCulture)); + Assert.True(javascriptResponse.Success); + + var actualType = javascriptResponse.Result.GetType(); + + Assert.Equal(typeof(double), actualType); + Assert.Equal(num, (double)javascriptResponse.Result, 5); + + output.WriteLine("Expected {0} : Actual {1}", num, javascriptResponse.Result); + } + + [Theory] + [InlineData(0)] + [InlineData(-1)] + [InlineData(100)] + [InlineData(int.MaxValue)] + [InlineData(int.MinValue)] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForInt(object num) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync(num.ToString()); + Assert.True(javascriptResponse.Success); + + var actualType = javascriptResponse.Result.GetType(); + + Assert.Equal(typeof(int), actualType); + Assert.Equal(num, javascriptResponse.Result); + + output.WriteLine("Expected {0} : Actual {1}", num, javascriptResponse.Result); + } + + [Theory] + [InlineData("1970-01-01", "1970-01-01")] + [InlineData("1980-01-01", "1980-01-01")] + //https://github.com/cefsharp/CefSharp/issues/4234 + public async Task ShouldWorkForDate(DateTime expected, string actual) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync($"new Date('{actual}');"); + Assert.True(javascriptResponse.Success); + + var actualType = javascriptResponse.Result.GetType(); + var actualDateTime = (DateTime)javascriptResponse.Result; + + Assert.Equal(typeof(DateTime), actualType); + Assert.Equal(expected.ToLocalTime(), actualDateTime); + + output.WriteLine("Expected {0} : Actual {1}", expected.ToLocalTime(), actualDateTime); + } + + [Theory] + [InlineData("new Promise(function(resolve, reject) { resolve(42); });", "42")] + [InlineData("Promise.resolve(42);", "42")] + [InlineData("(async () => { var result = await fetch('https://cefsharp.example/HelloWorld.html'); return result.status;})();", "200")] + public async Task ShouldWorkForPromisePrimative(string script, string expected) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync(script); + + Assert.True(javascriptResponse.Success); + Assert.Equal(expected, javascriptResponse.Result.ToString()); + } + + [Theory] + [InlineData("new Promise(function(resolve, reject) { reject('reject test'); });", "reject test")] + [InlineData("(async () => { throw('reject test'); })();", "reject test")] + public async Task ShouldFailForPromisePrimative(string script, string expected) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync(script); + + Assert.False(javascriptResponse.Success); + Assert.Equal(expected, javascriptResponse.Message); + } + + [Theory] + [InlineData("new Promise(function(resolve, reject) { resolve({ a: 'CefSharp', b: 42, }); });", "CefSharp", "42")] + [InlineData("new Promise(function(resolve, reject) { setTimeout(resolve.bind(null, { a: 'CefSharp', b: 42, }), 1000); });", "CefSharp", "42")] + [InlineData("(async () => { function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }; async function getValAfterSleep() { await sleep(1000); return { a: 'CefSharp', b: 42 }; }; await sleep(2000); const result = await getValAfterSleep(); await sleep(2000); return result; })();", "CefSharp", "42")] + public async Task ShouldWorkForPromisePrimativeObject(string script, string expectedA, string expectedB) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync(script); + + Assert.True(javascriptResponse.Success); + + dynamic result = javascriptResponse.Result; + Assert.Equal(expectedA, result.a.ToString()); + Assert.Equal(expectedB, result.b.ToString()); + } + + [Fact] + public async Task ShouldLoadGoogleAndEvaluateScript() + { + AssertInitialLoadComplete(); + + var loadResponse = await Browser.LoadUrlAsync("www.google.com"); + + Assert.True(loadResponse.Success); + + var mainFrame = Browser.GetMainFrame(); + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + var response = await Browser.EvaluateScriptAsync("2 + 2"); + Assert.Equal(4, response); + output.WriteLine("Result of 2 + 2: {0}", response); + } + + [Fact] + public async Task CanEvaluateScriptInParallel() + { + AssertInitialLoadComplete(); + + var tasks = Enumerable.Range(0, 100).Select(i => Task.Run(async () => + { + var javascriptResponse = await Browser.EvaluateScriptAsync("2 + 2"); + + if (javascriptResponse.Success) + { + return (int)javascriptResponse.Result; + } + + return -1; + })).ToList(); + + await Task.WhenAll(tasks); + + Assert.All(tasks, (t) => + { + Assert.Equal(4, t.Result); + }); + } + + [Theory] + [InlineData("[1,2,,5]", new object[] { 1, 2, null, 5 })] + [InlineData("[1,2,,]", new object[] { 1, 2, null })] + [InlineData("[,2,3]", new object[] { null, 2, 3 })] + [InlineData("[,2,,3,,4,,,,5,,,]", new object[] { null, 2, null, 3, null, 4, null, null, null, 5, null, null })] + public async Task CanEvaluateScriptAsyncReturnPartiallyEmptyArrays(string javascript, object[] expected) + { + AssertInitialLoadComplete(); + + var result = await Browser.EvaluateScriptAsync(javascript); + + Assert.True(result.Success); + Assert.Equal(expected, result.Result); + } + + [Theory] + [InlineData("return", "Uncaught SyntaxError: Illegal return statement\n@ about:blank:1:0")] + public async Task CanEvaluateScriptAsyncReturnError(string javascript, string expected) + { + AssertInitialLoadComplete(); + + var result = await Browser.EvaluateScriptAsync(javascript); + + Assert.False(result.Success); + Assert.Equal(expected, result.Message); + } + + /// + /// Use the EvaluateScriptAsync (IWebBrowser, String,Object[]) overload and pass in string params + /// that require encoding. Test case for https://github.com/cefsharp/CefSharp/issues/2339 + /// + /// A task + [Fact] + public async Task CanEvaluateScriptAsyncWithEncodedStringArguments() + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync("var testfunc=function(s) { return s; }"); + Assert.True(javascriptResponse.Success); + + // now call the function we just created + string[] teststrings = new string[]{"Mary's\tLamb & \r\nOther Things", + "[{test:\"Mary's Lamb & \\nOther Things\", 'other': \"\", 'and': null}]" }; + foreach (var test in teststrings) + { + javascriptResponse = await Browser.EvaluateScriptAsync("testfunc", test); + Assert.True(javascriptResponse.Success); + Assert.Equal(test, (string)javascriptResponse.Result); + output.WriteLine("{0} passes {1}", test, javascriptResponse.Result); + } + } + + [Theory] + [Repeat(20)] + public async Task CanEvaluateScriptAsyncReturnArrayBuffer(int iteration) + { + AssertInitialLoadComplete(); + + var randomizer = new Randomizer(); + + var expected = randomizer.Utf16String(minLength: iteration, maxLength: iteration); + var expectedBytes = Encoding.UTF8.GetBytes(expected); + + var javascriptResponse = await Browser.EvaluateScriptAsync($"new TextEncoder().encode('{expected}').buffer"); + + Assert.True(javascriptResponse.Success); + Assert.IsType(javascriptResponse.Result); + + var actualBytes = (byte[])javascriptResponse.Result; + + Assert.Equal(expectedBytes, actualBytes); + + Assert.Equal(expected, Encoding.UTF8.GetString(actualBytes)); + } + + [Theory] + [InlineData("(async () => { function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }; await sleep(2000); return true; })();")] + public async Task ShouldTimeout(string script) + { + AssertInitialLoadComplete(); + + var exception = await Assert.ThrowsAsync( + async () => await Browser.EvaluateScriptAsync(script, timeout: TimeSpan.FromMilliseconds(100))); + + Assert.NotNull(exception); + Assert.IsType(exception); + } + } +} diff --git a/CefSharp.Test/Javascript/JavascriptCallbackTests.cs b/CefSharp.Test/Javascript/JavascriptCallbackTests.cs new file mode 100644 index 0000000000..ec7a01f041 --- /dev/null +++ b/CefSharp.Test/Javascript/JavascriptCallbackTests.cs @@ -0,0 +1,325 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Dynamic; +using System.Globalization; +using System.Threading.Tasks; +using CefSharp.Example; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Javascript +{ + [Collection(CefSharpFixtureCollection.Key)] + public class JavascriptCallbackTests : BrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture collectionFixture; + + public JavascriptCallbackTests(ITestOutputHelper output, CefSharpFixture collectionFixture) + { + this.output = output; + this.collectionFixture = collectionFixture; + } + + [SkipIfRunOnAppVeyorFact] + // Started failing in M146, needs investigation + public async Task ShouldCancelAfterV8ContextChange() + { + IJavascriptCallback callbackExecuteCancelAfterDisposeCallback; + Task callbackExecuteCancelAfterDisposeTask; + using (var browser = new CefSharp.OffScreen.ChromiumWebBrowser(automaticallyCreateBrowser: false)) + { + await browser.CreateBrowserAsync(); + + // no V8 context + var withoutV8ContextException = await Assert.ThrowsAsync(() => browser.EvaluateScriptAsync("(function() { return 1+1; })")); + Assert.StartsWith("Unable to execute javascript at this time", withoutV8ContextException.Message); + + Task callbackExecuteWithoutV8ContextTask; + using (var frame = browser.GetMainFrame()) + { + callbackExecuteWithoutV8ContextTask = frame.EvaluateScriptAsync("(function() { return 1+2; })"); + } + + // V8 context + await browser.LoadUrlAsync(CefExample.HelloWorldUrl); + + var callbackExecuteWithoutV8ContextResponse = await callbackExecuteWithoutV8ContextTask; + Assert.True(callbackExecuteWithoutV8ContextResponse.Success); + var callbackExecuteWithoutV8ContextCallback = (IJavascriptCallback)callbackExecuteWithoutV8ContextResponse.Result; + var callbackExecuteWithoutV8ContextExecuteResponse = await callbackExecuteWithoutV8ContextCallback.ExecuteAsync(); + Assert.True(callbackExecuteWithoutV8ContextExecuteResponse.Success); + Assert.Equal(3, callbackExecuteWithoutV8ContextExecuteResponse.Result); + + var callbackExecuteCancelAfterV8ContextResponse = await browser.EvaluateScriptAsync("(function() { return new Promise(resolve => setTimeout(resolve, 1000)); })"); + Assert.True(callbackExecuteCancelAfterV8ContextResponse.Success); + var callbackExecuteCancelAfterV8ContextCallback = (IJavascriptCallback)callbackExecuteCancelAfterV8ContextResponse.Result; + var callbackExecuteCancelAfterV8ContextTask = callbackExecuteCancelAfterV8ContextCallback.ExecuteAsync(); + + // change V8 context + await browser.LoadUrlAsync(CefExample.HelloWorldUrl); + + await Assert.ThrowsAsync(() => callbackExecuteCancelAfterV8ContextTask); + var callbackExecuteCancelAfterV8ContextResult = await callbackExecuteCancelAfterV8ContextCallback.ExecuteAsync(); + Assert.False(callbackExecuteCancelAfterV8ContextResult.Success); + Assert.StartsWith("Unable to find JavascriptCallback with Id " + callbackExecuteCancelAfterV8ContextCallback.Id, callbackExecuteCancelAfterV8ContextResult.Message); + + var callbackExecuteCancelAfterDisposeResponse = await browser.EvaluateScriptAsync("(function() { return new Promise(resolve => setTimeout(resolve, 1000)); })"); + Assert.True(callbackExecuteCancelAfterDisposeResponse.Success); + callbackExecuteCancelAfterDisposeCallback = (IJavascriptCallback)callbackExecuteCancelAfterDisposeResponse.Result; + callbackExecuteCancelAfterDisposeTask = callbackExecuteCancelAfterDisposeCallback.ExecuteAsync(); + } + Assert.False(callbackExecuteCancelAfterDisposeCallback.CanExecute); + await Assert.ThrowsAsync(() => callbackExecuteCancelAfterDisposeTask); + await Assert.ThrowsAsync(() => callbackExecuteCancelAfterDisposeCallback.ExecuteAsync()); + } + + [Fact] + public async Task ShouldCancelOnCrash() + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync("(function() { return new Promise(resolve => setTimeout(resolve, 1000)); })"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var task = callback.ExecuteAsync(); + + await Browser.LoadUrlAsync("chrome://crash"); + await Assert.ThrowsAsync(() => task); + } + + [Theory] + [InlineData("(function() { return Promise.resolve(53)})", 53)] + [InlineData("(function() { return Promise.resolve('53')})", "53")] + [InlineData("(function() { return Promise.resolve(true)})", true)] + [InlineData("(function() { return Promise.resolve(false)})", false)] + public async Task ShouldWorkForPromise(string script, object expected) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync(script); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(); + + Assert.True(callbackResponse.Success); + + Assert.Equal(expected, callbackResponse.Result); + + output.WriteLine("Script {0} : Result {1}", script, callbackResponse.Result); + } + + [Theory] + [InlineData("(function() { return Promise.reject(new Error('My Error'))})", "Error: My Error")] + [InlineData("(function() { return Promise.reject(42)})", "42")] + [InlineData("(function() { return Promise.reject(false)})", "false")] + [InlineData("(function() { return Promise.reject(null)})", "null")] + public async Task ShouldFailForPromise(string script, string expected) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync(script); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(); + + Assert.False(callbackResponse.Success); + + Assert.Equal(expected, callbackResponse.Message); + + output.WriteLine("Script {0} : Message {1}", script, callbackResponse.Message); + } + + [Theory] + [InlineData(double.MaxValue, "Number.MAX_VALUE")] + [InlineData(double.MaxValue / 2, "Number.MAX_VALUE / 2")] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForDoubleComputation(double expectedValue, string script) + { + var javascriptResponse = await Browser.EvaluateScriptAsync("(function() { return " + script + "})"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(); + + Assert.True(callbackResponse.Success); + + Assert.Equal(expectedValue, (double)callbackResponse.Result, 5); + + output.WriteLine("Script {0} : Result {1}", script, callbackResponse.Result); + } + + [Theory] + [InlineData(0.5d)] + [InlineData(1.5d)] + [InlineData(-0.5d)] + [InlineData(-1.5d)] + [InlineData(100000.24500d)] + [InlineData(-100000.24500d)] + [InlineData((double)uint.MaxValue)] + [InlineData((double)int.MaxValue + 1)] + [InlineData((double)int.MaxValue + 10)] + [InlineData((double)int.MinValue - 1)] + [InlineData((double)int.MinValue - 10)] + [InlineData(((double)uint.MaxValue * 2))] + [InlineData(((double)uint.MaxValue * 2) + 0.1)] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForDouble(double num) + { + var javascriptResponse = await Browser.EvaluateScriptAsync("(function() { return " + num.ToString(CultureInfo.InvariantCulture) + "})"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(); + + Assert.Equal(num, (double)callbackResponse.Result, 5); + + output.WriteLine("Expected {0} : Actual {1}", num, callbackResponse.Result); + } + + [Theory] + [InlineData(0)] + [InlineData(-1)] + [InlineData(100)] + [InlineData(int.MaxValue)] + [InlineData(int.MinValue)] + //https://github.com/cefsharp/CefSharp/issues/3858 + public async Task ShouldWorkForInt(object num) + { + var javascriptResponse = await Browser.EvaluateScriptAsync("(function() { return " + num.ToString() + "})"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(); + + Assert.Equal(num, callbackResponse.Result); + + output.WriteLine("Expected {0} : Actual {1}", num, callbackResponse.Result); + } + + [Theory] + [InlineData("1970-01-01", "1970-01-01")] + [InlineData("1980-01-01", "1980-01-01")] + //https://github.com/cefsharp/CefSharp/issues/4234 + public async Task ShouldWorkForDate(DateTime expected, string actual) + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync("(function() { return new Date('" + actual + "');})"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(); + + var actualDateTime = (DateTime)callbackResponse.Result; + + Assert.Equal(expected.ToLocalTime(), actualDateTime); + + output.WriteLine("Expected {0} : Actual {1}", expected.ToLocalTime(), actualDateTime); + } + + [Theory] + [InlineData("1970-01-01", DateTimeStyles.AssumeLocal)] + [InlineData("1970-01-01", DateTimeStyles.AssumeUniversal)] + [InlineData("1980-01-01", DateTimeStyles.AssumeLocal)] + [InlineData("1980-01-01", DateTimeStyles.AssumeUniversal)] + //https://github.com/cefsharp/CefSharp/issues/4234 + public async Task ShouldEchoDateTime(string expected, DateTimeStyles dateTimeStyle) + { + AssertInitialLoadComplete(); + + var expectedDateTime = DateTime.Parse(expected, CultureInfo.InvariantCulture, dateTimeStyle); + + var javascriptResponse = await Browser.EvaluateScriptAsync("(function(p) { return p; })"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(expectedDateTime); + + var actualDateTime = (DateTime)callbackResponse.Result; + + Assert.Equal(expectedDateTime, actualDateTime); + + output.WriteLine("Expected {0} : Actual {1}", expectedDateTime, actualDateTime); + } + + [Fact] + //https://github.com/cefsharp/CefSharp/issues/4234 + public async Task ShouldEchoDateTimeNow() + { + AssertInitialLoadComplete(); + + var expectedDateTime = DateTime.Now; + + var javascriptResponse = await Browser.EvaluateScriptAsync("(function(p) { return p; })"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(expectedDateTime); + + var actualDateTime = (DateTime)callbackResponse.Result; + + Assert.Equal(expectedDateTime, actualDateTime, TimeSpan.FromMilliseconds(10)); + + output.WriteLine("Expected {0} : Actual {1}", expectedDateTime, actualDateTime); + } + + [Fact] + public async Task ShouldWorkWithExpandoObject() + { + AssertInitialLoadComplete(); + + var expectedDateTime = DateTime.Now; + + dynamic request = new ExpandoObject(); + request.dateTime = expectedDateTime; + + var javascriptResponse = await Browser.EvaluateScriptAsync("(function(p) { return p; })"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + var callbackResponse = await callback.ExecuteAsync(request); + + dynamic response = callbackResponse.Result; + var actualDateTime = (DateTime)response.dateTime; + + Assert.Equal(expectedDateTime, actualDateTime, TimeSpan.FromMilliseconds(10)); + + output.WriteLine("Expected {0} : Actual {1}", expectedDateTime, actualDateTime); + } + + [Fact] + public async Task ShouldWorkWhenExecutedMultipleTimes() + { + AssertInitialLoadComplete(); + + var javascriptResponse = await Browser.EvaluateScriptAsync("(function() { return 42; })"); + Assert.True(javascriptResponse.Success); + + var callback = (IJavascriptCallback)javascriptResponse.Result; + + for (var i = 0; i < 3; i++) + { + var callbackResponse = await callback.ExecuteAsync(); + Assert.True(callbackResponse.Success); + Assert.Equal(42, callbackResponse.Result); + } + } + } +} diff --git a/CefSharp.Test/JavascriptBinding/BindingTestObject.cs b/CefSharp.Test/JavascriptBinding/BindingTestObject.cs new file mode 100644 index 0000000000..2fc702e442 --- /dev/null +++ b/CefSharp.Test/JavascriptBinding/BindingTestObject.cs @@ -0,0 +1,17 @@ +// Copyright © 2017 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.Test.JavascriptBinding +{ + internal class BindingTestObject + { + public int EchoMethodCallCount { get; private set; } + public string Echo(string arg) + { + EchoMethodCallCount++; + + return arg; + } + } +} diff --git a/CefSharp.Test/JavascriptBinding/IntegrationTests.cs b/CefSharp.Test/JavascriptBinding/IntegrationTests.cs new file mode 100644 index 0000000000..60d496c211 --- /dev/null +++ b/CefSharp.Test/JavascriptBinding/IntegrationTests.cs @@ -0,0 +1,203 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using CefSharp.Example; +using CefSharp.Example.JavascriptBinding; +using CefSharp.OffScreen; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.JavascriptBinding +{ + /// + /// Automated QUnit Integration Tests + /// + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class IntegrationTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public IntegrationTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + +#if NETCOREAPP + [Fact] + public async Task LoadJavaScriptBindingQunitTestsSuccessfulCompletion() + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingTestNetCoreUrl, automaticallyCreateBrowser: false)) + { + //TODO: Extract this into some sort of helper setup method + var bindingOptions = BindingOptions.DefaultBinder; + var repo = browser.JavascriptObjectRepository; + + repo.Register("boundAsync", new AsyncBoundObject(), options: bindingOptions); + repo.Register("boundAsync2", new AsyncBoundObject(), options: bindingOptions); + + browser.JavascriptMessageReceived += (s, e) => + { + dynamic msg = e.Message; + var type = (string)msg.Type; + + if (type == "QUnitTestFailed") + { + var testOutput = (string)msg.Output; + output.WriteLine(testOutput); + } + }; + + var response = await browser.CreateBrowserAndWaitForQUnitTestExeuctionToComplete(); + + if (!response.Success) + { + output.WriteLine("QUnit Passed : {0}", response.Passed); + output.WriteLine("QUnit Total : {0}", response.Total); + } + + Assert.True(response.Success); + + output.WriteLine("QUnit Tests result: {0}", response.Success); + } + } +#else + + // Issue https://github.com/cefsharp/CefSharp/issues/3867 + [SkipIfRunOnAppVeyorFact] + public async Task LoadJavaScriptBindingQunitTestsSuccessfulCompletion() + { + var requestContext = new RequestContext(); + requestContext.RegisterSchemeHandlerFactory("https", CefExample.ExampleDomain, new CefSharpSchemeHandlerFactory()); + + using (var browser = new ChromiumWebBrowser(CefExample.BindingTestUrl, requestContext: requestContext, automaticallyCreateBrowser: false)) + { + //TODO: Extract this into some sort of helper setup method + var bindingOptions = BindingOptions.DefaultBinder; + var repo = browser.JavascriptObjectRepository; + + repo.Register("bound", new BoundObject(), isAsync: false, options: bindingOptions); + repo.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: bindingOptions); + repo.Register("boundAsync2", new AsyncBoundObject(), isAsync: true, options: bindingOptions); + + browser.JavascriptMessageReceived += (s, e) => + { + dynamic msg = e.Message; + var type = (string)msg.Type; + + if (type == "QUnitTestFailed") + { + var testOutput = (string)msg.Output; + output.WriteLine(testOutput); + } + }; + + var response = await browser.CreateBrowserAndWaitForQUnitTestExeuctionToComplete(); + + if (!response.Success) + { + output.WriteLine("QUnit Passed : {0}", response.Passed); + output.WriteLine("QUnit Total : {0}", response.Total); + } + + Assert.True(response.Success); + + output.WriteLine("QUnit Tests result: {0}", response.Success); + } + } + + [Fact] + public async Task LoadJavaScriptBindingAsyncTaskQunitTestsSuccessfulCompletion() + { + CefSharpSettings.ConcurrentTaskExecution = true; + + using (var browser = new ChromiumWebBrowser(CefExample.BindingTestsAsyncTaskUrl, automaticallyCreateBrowser: false)) + { + CefSharpSettings.ConcurrentTaskExecution = false; + + //TODO: Extract this into some sort of helper setup method + var bindingOptions = BindingOptions.DefaultBinder; + var repo = browser.JavascriptObjectRepository; + + repo.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: bindingOptions); + + browser.JavascriptMessageReceived += (s, e) => + { + dynamic msg = e.Message; + var type = (string)msg.Type; + + if (type == "QUnitTestFailed") + { + var testOutput = (string)msg.Output; + output.WriteLine(testOutput); + } + }; + + browser.LoadError += (s, e) => + { + var err = e.ErrorCode; + }; + + var response = await browser.CreateBrowserAndWaitForQUnitTestExeuctionToComplete(); + + if (!response.Success) + { + output.WriteLine("QUnit Passed : {0}", response.Passed); + output.WriteLine("QUnit Total : {0}", response.Total); + } + + Assert.True(response.Success); + + output.WriteLine("QUnit Tests result: {0}", response.Success); + } + } + + [SkipIfRunOnAppVeyorFact()] + //Skipping Issue https://github.com/cefsharp/CefSharp/issues/3867 + public async Task LoadLegacyJavaScriptBindingQunitTestsSuccessfulCompletion() + { + var requestContext = new RequestContext(); + requestContext.RegisterSchemeHandlerFactory("https", CefExample.ExampleDomain, new CefSharpSchemeHandlerFactory()); + + using (var browser = new ChromiumWebBrowser(CefExample.LegacyBindingTestUrl, requestContext:requestContext, automaticallyCreateBrowser: false)) + { + //TODO: Extract this into some sort of helper setup method + var bindingOptions = BindingOptions.DefaultBinder; + var repo = browser.JavascriptObjectRepository; + repo.Settings.LegacyBindingEnabled = true; + + repo.Register("bound", new BoundObject(), isAsync: false, options: bindingOptions); + repo.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: bindingOptions); + + browser.JavascriptMessageReceived += (s, e) => + { + dynamic msg = e.Message; + var type = (string)msg.Type; + + if (type == "QUnitTestFailed") + { + var testOutput = (string)msg.Output; + output.WriteLine(testOutput); + } + }; + + var response = await browser.CreateBrowserAndWaitForQUnitTestExeuctionToComplete(); + + if(!response.Success) + { + output.WriteLine("QUnit Passed : {0}", response.Passed); + output.WriteLine("QUnit Total : {0}", response.Total); + } + + Assert.True(response.Success); + + output.WriteLine("QUnit Tests result: {0}", response.Success); + } + } +#endif + } +} diff --git a/CefSharp.Test/JavascriptBinding/JavaScriptObjectRepositoryTests.cs b/CefSharp.Test/JavascriptBinding/JavaScriptObjectRepositoryTests.cs new file mode 100644 index 0000000000..8481845968 --- /dev/null +++ b/CefSharp.Test/JavascriptBinding/JavaScriptObjectRepositoryTests.cs @@ -0,0 +1,93 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.Example.ModelBinding; +using CefSharp.Internals; +using System; +using System.Collections.Generic; +using Xunit; + +internal class NoNamespaceClass +{ + public SomeElseClass SomeElseClass { get; set; } + public int Year { get; set; } + + public string GetExampleString() + { + return "ok"; + } +} + +internal class SomeElseClass +{ + +} + + +namespace CefSharp.Test.JavascriptBinding +{ + public class JavaScriptObjectRepositoryTests + { + [Fact] + public void ShouldRegisterJavascriptObjectBindWhenNamespaceIsNull() + { + IJavascriptObjectRepositoryInternal javascriptObjectRepository = new JavascriptObjectRepository(); + var name = nameof(NoNamespaceClass); +#if NETCOREAPP + javascriptObjectRepository.Register(name, new NoNamespaceClass(), new BindingOptions()); +#else + javascriptObjectRepository.Register(name, new NoNamespaceClass(), false, new BindingOptions()); +#endif + Assert.True(javascriptObjectRepository.IsBound(name)); + + var boundObjects = javascriptObjectRepository.GetObjects("example.com", new List { name }); + Assert.Single(boundObjects); + + var result = javascriptObjectRepository.TryCallMethod(boundObjects[0].Id, "getExampleString", new object[0]); + Assert.True(result.Success); + Assert.Equal("ok", result.ReturnValue.ToString()); + } + + [Fact] + public void ShouldReturnErrorMessageForObjectInvalidId() + { + IJavascriptObjectRepositoryInternal javascriptObjectRepository = new JavascriptObjectRepository(); + + var result = javascriptObjectRepository.TryCallMethod(100, "getExampleString", new object[0]); + Assert.False(result.Success); + Assert.StartsWith("Object Not Found Matching Id", result.Exception); + } + +#if !NETCOREAPP + [Fact] + public void ShouldRegisterJavascriptObjectPropertyBindWhenNamespaceIsNull() + { + IJavascriptObjectRepositoryInternal javascriptObjectRepository = new JavascriptObjectRepository(); + var name = nameof(NoNamespaceClass); + + BindingOptions bindingOptions = new BindingOptions() + { + Binder = BindingOptions.DefaultBinder.Binder, + PropertyInterceptor = new PropertyInterceptorLogger() + }; + javascriptObjectRepository.Register(name, new NoNamespaceClass(), false, bindingOptions); + Assert.True(javascriptObjectRepository.IsBound(name)); + + var boundObjects = javascriptObjectRepository.GetObjects("example.com", new List { name }); + Assert.Single(boundObjects); + + object getResult, setResult = 100; + string exception; + NoNamespaceClass noNamespaceClass = new NoNamespaceClass(); + bool retValue = javascriptObjectRepository.TrySetProperty(boundObjects[0].Id, "year", setResult, out exception); + Assert.True(retValue); + + retValue = javascriptObjectRepository.TryGetProperty(boundObjects[0].Id, "year", out getResult, out exception); + Assert.True(retValue); + Assert.Equal(100, Convert.ToInt32(getResult)); + } +#endif + } + +} diff --git a/CefSharp.Test/JavascriptBinding/JavascriptBindingSimpleTest.cs b/CefSharp.Test/JavascriptBinding/JavascriptBindingSimpleTest.cs new file mode 100644 index 0000000000..1fe97b64bf --- /dev/null +++ b/CefSharp.Test/JavascriptBinding/JavascriptBindingSimpleTest.cs @@ -0,0 +1,55 @@ +// Copyright © 2023 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using CefSharp.Example; +using CefSharp.OffScreen; +using Xunit; + +namespace CefSharp.Test.JavascriptBinding +{ + [Collection(CefSharpFixtureCollection.Key)] + public class JavascriptBindingSimpleTest + { + // Keep this class inline as to provide a single file example. + private class MyBoundObject + { + public int EchoMethodCallCount { get; private set; } + public string Echo(string arg) + { + EchoMethodCallCount++; + + return arg; + } + } + + [Fact] + public async Task ShouldWork() + { + const string script = @" + (async function() + { + await CefSharp.BindObjectAsync('bound'); + return await bound.echo('Welcome to CefSharp!'); + })();"; + + using (var browser = new ChromiumWebBrowser(CefExample.HelloWorldUrl)) + { + var boundObj = new MyBoundObject(); + +#if NETCOREAPP + browser.JavascriptObjectRepository.Register("bound", boundObj); +#else + browser.JavascriptObjectRepository.Register("bound", boundObj, true); +#endif + await browser.WaitForInitialLoadAsync(); + + var result = await browser.EvaluateScriptAsync(script); + + Assert.Equal(1, boundObj.EchoMethodCallCount); + Assert.Equal("Welcome to CefSharp!", result); + } + } + } +} diff --git a/CefSharp.Test/JavascriptBinding/JavascriptBindingTests.cs b/CefSharp.Test/JavascriptBinding/JavascriptBindingTests.cs new file mode 100644 index 0000000000..76610b243e --- /dev/null +++ b/CefSharp.Test/JavascriptBinding/JavascriptBindingTests.cs @@ -0,0 +1,421 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Diagnostics; +using System.Threading.Tasks; +using CefSharp.Event; +using CefSharp.Example; +using CefSharp.Example.JavascriptBinding; +using CefSharp.Internals; +using CefSharp.OffScreen; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.JavascriptBinding +{ + [Collection(CefSharpFixtureCollection.Key)] + public class JavascriptBindingTests : BrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public JavascriptBindingTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task ShouldWork() + { + AssertInitialLoadComplete(); + + const string script = @" + (async function() + { + await CefSharp.BindObjectAsync('bound'); + return await bound.echo('Welcome to CefSharp!'); + })();"; + + var boundObj = new BindingTestObject(); + +#if NETCOREAPP + Browser.JavascriptObjectRepository.Register("bound", boundObj); +#else + Browser.JavascriptObjectRepository.Register("bound", boundObj, true); +#endif + + var result = await Browser.EvaluateScriptAsync(script); + + Assert.Equal(1, boundObj.EchoMethodCallCount); + Assert.Equal("Welcome to CefSharp!", result); + } + + [Fact] + //Issue https://github.com/cefsharp/CefSharp/issues/3470 + //Verify workaround passes + public async Task ShouldRaiseResolveObjectEvent() + { + AssertInitialLoadComplete(); + + var evt = await Assert.RaisesAsync( + x => Browser.JavascriptObjectRepository.ResolveObject += x, + y => Browser.JavascriptObjectRepository.ResolveObject -= y, + () => Browser.EvaluateScriptAsync("CefSharp.BindObjectAsync();")); + + Assert.NotNull(evt); + + Assert.Equal(JavascriptObjectRepository.AllObjects, evt.Arguments.ObjectName); + } + + [Fact] + public async Task ShouldWorkWhenUsingCustomGlobalObjectName() + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiGlobalObjectName = "bindingApiObject"; + + //To modify the settings we need to defer browser creation slightly + browser.CreateBrowser(); + + await browser.WaitForInitialLoadAsync(); + + var result = await browser.EvaluateScriptAsync("bindingApiObject.isObjectCached('doesntexist') === false"); + + Assert.True(result.Success); + } + } + + [Theory] + //We'll execute twice using the different cased (camelcase naming and standard) + [InlineData("CefSharp.IsObjectCached('doesntexist')")] + [InlineData("cefSharp.isObjectCached('doesntexist')")] + public async Task ShouldFailWhenIsObjectCachedCalledWithInvalidObjectName(string script) + { + var loadResponse = await Browser.LoadUrlAsync(CefExample.BindingApiCustomObjectNameTestUrl); + + Assert.True(loadResponse.Success); + + var response = await Browser.EvaluateScriptAsync(script); + + Assert.True(response.Success); + Assert.False((bool)response.Result); + } + + [Fact] + public async Task ShouldDisableJsBindingApi() + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiEnabled = false; + + //To modify the settings we need to defer browser creation slightly + browser.CreateBrowser(); + + var loadResponse = await browser.WaitForInitialLoadAsync(); + + Assert.True(loadResponse.Success); + + var response1 = await browser.EvaluateScriptAsync("typeof window.cefSharp === 'undefined'"); + var response2 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + + Assert.True(response1.Success); + Assert.True((bool)response1.Result); + + Assert.True(response2.Success); + Assert.True((bool)response2.Result); + } + } + + [Theory] + [InlineData("notallowed")] + [InlineData("notallowed", "alsonotallowed")] + [InlineData("notallowed", "alsonotallowed", "stillnotallowed")] + public async Task ShouldDisableJsBindingApiForOrigin(params string[] origins) + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiEnabled = true; + settings.JavascriptBindingApiAllowOrigins = origins; + + //To modify the settings we need to defer browser creation slightly + browser.CreateBrowser(); + + var loadResponse = await browser.WaitForInitialLoadAsync(); + + Assert.True(loadResponse.Success); + + var response1 = await browser.EvaluateScriptAsync("typeof window.cefSharp === 'undefined'"); + var response2 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + + Assert.True(response1.Success); + Assert.True((bool)response1.Result); + + Assert.True(response2.Success); + Assert.True((bool)response2.Result); + } + } + + [Fact] + public async Task ShouldEnableJsBindingApiWhenOriginsListIsEmpty() + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiEnabled = true; + settings.JavascriptBindingApiAllowOrigins = new string[0]; + + //To modify the settings we need to defer browser creation slightly + browser.CreateBrowser(); + + var loadResponse = await browser.WaitForInitialLoadAsync(); + + Assert.True(loadResponse.Success); + + var response1 = await browser.EvaluateScriptAsync("typeof window.cefSharp === 'undefined'"); + var response2 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + + Assert.True(response1.Success); + Assert.False((bool)response1.Result); + + Assert.True(response2.Success); + Assert.False((bool)response2.Result); + } + } + + [Theory] + [InlineData(CefExample.BaseUrl)] + [InlineData(CefExample.BaseUrl + "/")] + public async Task ShouldEnableJsBindingApiForOriginWithOrWithoutTrailingSlash(string configuredOrigin) + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiEnabled = true; + settings.JavascriptBindingApiAllowOrigins = new string[] { configuredOrigin }; + + //To modify the settings we need to defer browser creation slightly + browser.CreateBrowser(); + + var loadResponse = await browser.WaitForInitialLoadAsync(); + + Assert.True(loadResponse.Success); + + var response1 = await browser.EvaluateScriptAsync("typeof window.cefSharp === 'undefined'"); + var response2 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + + Assert.True(response1.Success); + Assert.False((bool)response1.Result); + + Assert.True(response2.Success); + Assert.False((bool)response2.Result); + } + } + [Theory] + [InlineData(CefExample.BaseUrl + "/")] + [InlineData("someorigin", CefExample.BaseUrl + "/")] + [InlineData(CefExample.BaseUrl + "/", "someorigin")] + [InlineData("firstorigin", "secondorigin", CefExample.BaseUrl + "/")] + [InlineData("firstorigin", CefExample.BaseUrl + "/", "secondorigin")] + public async Task ShouldEnableJsBindingApiForOrigin(params string[] origins) + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiEnabled = true; + settings.JavascriptBindingApiAllowOrigins = origins; + + //To modify the settings we need to defer browser creation slightly + browser.CreateBrowser(); + + var loadResponse = await browser.WaitForInitialLoadAsync(); + + Assert.True(loadResponse.Success); + + var response1 = await browser.EvaluateScriptAsync("typeof window.cefSharp === 'undefined'"); + var response2 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + + Assert.True(response1.Success); + Assert.False((bool)response1.Result); + + Assert.True(response2.Success); + Assert.False((bool)response2.Result); + } + } + + [Fact] + public async Task ShouldEnableJsBindingApi() + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiEnabled = true; + + //To modify the settings we need to defer browser creation slightly + browser.CreateBrowser(); + + var loadResponse = await browser.WaitForInitialLoadAsync(); + + Assert.True(loadResponse.Success); + + var response1 = await browser.EvaluateScriptAsync("typeof window.cefSharp === 'undefined'"); + var response2 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + + Assert.True(response1.Success); + Assert.False((bool)response1.Result); + + Assert.True(response2.Success); + Assert.False((bool)response2.Result); + } + } + + [Theory] + [InlineData("CefSharp.RenderProcessId")] + [InlineData("cefSharp.renderProcessId")] + public async Task ShouldReturnRenderProcessId(string script) + { + AssertInitialLoadComplete(); + + var result = await Browser.EvaluateScriptAsync(script); + + Assert.True(result.Success); + + using var process = Process.GetProcessById(Assert.IsType(result.Result)); + + Assert.Equal("CefSharp.BrowserSubprocess", process.ProcessName); + } + + [Fact] + public async Task ShouldWorkAfterACrossOriginNavigation() + { + const string script = @" + (async function() + { + await CefSharp.BindObjectAsync('bound'); + return await bound.echo('test'); + })();"; + + var boundObj = new BindingTestObject(); + +#if NETCOREAPP + Browser.JavascriptObjectRepository.Register("bound", boundObj); +#else + Browser.JavascriptObjectRepository.Register("bound", boundObj, true); +#endif + + await Browser.LoadUrlAsync("https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url"); + await Browser.EvaluateScriptAsync(script); + await Browser.LoadUrlAsync("https://www.google.com"); + await Browser.EvaluateScriptAsync(script); + + Assert.Equal(2, boundObj.EchoMethodCallCount); + } + + [Fact] + public async Task ShouldFireResolveObject() + { + AssertInitialLoadComplete(); + + var objRepository = Browser.JavascriptObjectRepository; + + var evt = await Assert.RaisesAsync( + a => objRepository.ResolveObject += a, + a => objRepository.ResolveObject -= a, + () => Browser.EvaluateScriptAsync("(async function() { await CefSharp.BindObjectAsync('first'); })();")); + + Assert.NotNull(evt); + Assert.Equal("first", evt.Arguments.ObjectName); + Assert.Equal("https://cefsharp.example/HelloWorld.html", evt.Arguments.Url); + } + + [Fact] + public async Task ShouldFireResolveObjectForUnregisteredObject() + { + AssertInitialLoadComplete(); + + var objRepository = Browser.JavascriptObjectRepository; + + var boundObj = new BindingTestObject(); + +#if NETCOREAPP + objRepository.Register("first", boundObj); +#else + objRepository.Register("first", boundObj, true); +#endif + + var evt = await Assert.RaisesAsync( + a => objRepository.ResolveObject += a, + a => objRepository.ResolveObject -= a, + () => Browser.EvaluateScriptAsync("(async function() { await CefSharp.BindObjectAsync('first', 'second'); })();")); + + Assert.NotNull(evt); + Assert.Equal("second", evt.Arguments.ObjectName); + } + + [Fact] + public async Task ShouldDisableJsBindingApiAfterCrossOriginNavigationToDisallowedOrigin() + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiEnabled = true; + settings.JavascriptBindingApiAllowOrigins = new string[] { CefExample.BaseUrl }; + + browser.CreateBrowser(); + + var loadResponse = await browser.WaitForInitialLoadAsync(); + + Assert.True(loadResponse.Success); + + // Binding API should be present on the allowed origin + var response1 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + Assert.True(response1.Success); + Assert.False((bool)response1.Result); + + // Navigate to a different origin that is not in the allow list + var crossOriginLoad = await browser.LoadUrlAsync("https://www.google.com"); + Assert.True(crossOriginLoad.Success); + + // Binding API should no longer be present on the disallowed origin + var response2 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + Assert.True(response2.Success); + Assert.True((bool)response2.Result); + } + } + + [Fact] + public async Task ShouldKeepJsBindingApiEnabledAfterCrossOriginNavigationToAllowedOrigin() + { + using (var browser = new ChromiumWebBrowser(CefExample.BindingApiCustomObjectNameTestUrl, automaticallyCreateBrowser: false)) + { + var settings = browser.JavascriptObjectRepository.Settings; + settings.JavascriptBindingApiEnabled = true; + settings.JavascriptBindingApiAllowOrigins = new string[] { CefExample.BaseUrl, "https://www.google.com" }; + + browser.CreateBrowser(); + + var loadResponse = await browser.WaitForInitialLoadAsync(); + + Assert.True(loadResponse.Success); + + // Binding API should be present on the first allowed origin + var response1 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + Assert.True(response1.Success); + Assert.False((bool)response1.Result); + + // Navigate to a second origin that is also in the allow list + var crossOriginLoad = await browser.LoadUrlAsync("https://www.google.com"); + Assert.True(crossOriginLoad.Success); + + // Binding API should still be present on the second allowed origin + var response2 = await browser.EvaluateScriptAsync("typeof window.CefSharp === 'undefined'"); + Assert.True(response2.Success); + Assert.False((bool)response2.Result); + } + } + } +} diff --git a/CefSharp.Test/Navigation/WaitForNavigationAsyncTests.cs b/CefSharp.Test/Navigation/WaitForNavigationAsyncTests.cs new file mode 100644 index 0000000000..f38c739f5d --- /dev/null +++ b/CefSharp.Test/Navigation/WaitForNavigationAsyncTests.cs @@ -0,0 +1,126 @@ +using Xunit.Abstractions; +using Xunit; +using System.Threading.Tasks; +using CefSharp.OffScreen; +using CefSharp.Example; +using System; +using System.Threading; + +namespace CefSharp.Test.Navigation +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class WaitForNavigationAsyncTests + { + + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public WaitForNavigationAsyncTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task CanWork() + { + const string expected = CefExample.HelloWorldUrl; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var navigationTask = browser.WaitForNavigationAsync(); + var evaluateTask = browser.EvaluateScriptAsync($"window.location.href = '{expected}';"); + + await Task.WhenAll(navigationTask, evaluateTask); + + var navigationResponse = navigationTask.Result; + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Equal(expected, mainFrame.Url); + Assert.Equal(200, navigationResponse.HttpStatusCode); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [Fact] + public async Task CanWaitForInvalidDomain() + { + const string expected = "https://notfound.cefsharp.test"; + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var navigationTask = browser.WaitForNavigationAsync(); + var evaluateTask = browser.EvaluateScriptAsync($"window.location.href = '{expected}';"); + + await Task.WhenAll(navigationTask, evaluateTask); + + var navigationResponse = navigationTask.Result; + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.False(navigationResponse.Success); + Assert.Contains(expected, mainFrame.Url); + Assert.Equal(CefErrorCode.NameNotResolved, navigationResponse.ErrorCode); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [Fact] + public async Task CanTimeout() + { + const string expected = "The operation has timed out."; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var exception = await Assert.ThrowsAnyAsync(async () => + { + await browser.WaitForNavigationAsync(timeout:TimeSpan.FromMilliseconds(100)); + }); + + Assert.Contains(expected, exception.Message); + + output.WriteLine("Exception {0}", exception.Message); + } + } + + [Fact] + public async Task CanCancel() + { + const string expected = "A task was canceled."; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + var cancellationTokenSource = new CancellationTokenSource(); + cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(1)); + + Assert.True(response.Success); + + var exception = await Assert.ThrowsAnyAsync(async () => + { + await browser.WaitForNavigationAsync(cancellationToken: cancellationTokenSource.Token); + }); + + Assert.Contains(expected, exception.Message); + + output.WriteLine("Exception {0}", exception.Message); + } + } + } +} diff --git a/CefSharp.Test/OffScreen/BrowserRefCountTests.cs b/CefSharp.Test/OffScreen/BrowserRefCountTests.cs new file mode 100644 index 0000000000..1a51aaa76c --- /dev/null +++ b/CefSharp.Test/OffScreen/BrowserRefCountTests.cs @@ -0,0 +1,58 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading; +using CefSharp.Internals; +using CefSharp.OffScreen; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.OffScreen +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class BrowserRefCountTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public BrowserRefCountTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public void ShouldWork() + { + var currentCount = BrowserRefCounter.Instance.Count; + + var manualResetEvent = new ManualResetEvent(false); + + var browser = new ChromiumWebBrowser("https://google.com", useLegacyRenderHandler: false); + + browser.LoadingStateChanged += (sender, e) => + { + if (!e.IsLoading) + { + manualResetEvent.Set(); + } + }; + + manualResetEvent.WaitOne(); + + //TODO: Refactor this so reference is injected into browser + Assert.Equal(currentCount + 1, BrowserRefCounter.Instance.Count); + + browser.Dispose(); + + Cef.WaitForBrowsersToClose(10000); + + output.WriteLine("BrowserRefCounter Log"); + output.WriteLine(BrowserRefCounter.Instance.GetLog()); + + Assert.Equal(0, BrowserRefCounter.Instance.Count); + } + } +} diff --git a/CefSharp.Test/OffScreen/DownloadHandlerTests.cs b/CefSharp.Test/OffScreen/DownloadHandlerTests.cs new file mode 100644 index 0000000000..5af31e68c4 --- /dev/null +++ b/CefSharp.Test/OffScreen/DownloadHandlerTests.cs @@ -0,0 +1,71 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using CefSharp.OffScreen; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.OffScreen +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class DownloadHandlerTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public DownloadHandlerTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Theory] + [InlineData("https://code.jquery.com/jquery-3.4.1.min.js")] + public async Task ShouldWorkWithoutAskingUser(string url) + { + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + using (var chromiumWebBrowser = new ChromiumWebBrowser(url, useLegacyRenderHandler: false)) + { + var userTempPath = System.IO.Path.GetTempPath(); + + chromiumWebBrowser.DownloadHandler = + Fluent.DownloadHandler.UseFolder(userTempPath, + (chromiumBrowser, browser, downloadItem, callback) => + { + if (downloadItem.IsComplete) + { + tcs.SetResult(downloadItem.FullPath); + } + else if (downloadItem.IsCancelled) + { + tcs.SetResult(null); + } + }); + + await chromiumWebBrowser.WaitForInitialLoadAsync(); + + chromiumWebBrowser.StartDownload(url); + + var downloadedFilePath = await tcs.Task; + + Assert.NotNull(downloadedFilePath); + Assert.Contains(userTempPath, downloadedFilePath); + Assert.True(System.IO.File.Exists(downloadedFilePath)); + + var downloadedFileContent = System.IO.File.ReadAllText(downloadedFilePath); + + Assert.NotEqual(0, downloadedFileContent.Length); + + var htmlSrc = await chromiumWebBrowser.GetSourceAsync(); + + Assert.Contains(downloadedFileContent.Substring(0, 100), htmlSrc); + + System.IO.File.Delete(downloadedFilePath); + } + } + } +} diff --git a/CefSharp.Test/OffScreen/OffScreenBrowserBasicFacts.cs b/CefSharp.Test/OffScreen/OffScreenBrowserBasicFacts.cs deleted file mode 100644 index e3393027d5..0000000000 --- a/CefSharp.Test/OffScreen/OffScreenBrowserBasicFacts.cs +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright © 2017 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -using CefSharp.OffScreen; -using System.Threading.Tasks; -using Xunit; -using Xunit.Abstractions; - -namespace CefSharp.Test.OffScreen -{ - //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle - [Collection(CefSharpFixtureCollection.Key)] - public class OffScreenBrowserBasicFacts - { - //TODO: Move into own file/namespace - public class AsyncBoundObject - { - public bool MethodCalled { get; set; } - public string Echo(string arg) - { - MethodCalled = true; - return arg; - } - } - - private readonly ITestOutputHelper output; - private readonly CefSharpFixture fixture; - - public OffScreenBrowserBasicFacts(ITestOutputHelper output, CefSharpFixture fixture) - { - this.fixture = fixture; - this.output = output; - } - - [Fact] - public async Task CanLoadGoogle() - { - using (var browser = new ChromiumWebBrowser("www.google.com")) - { - await browser.LoadPageAsync(); - - var mainFrame = browser.GetMainFrame(); - Assert.True(mainFrame.IsValid); - Assert.True(mainFrame.Url.Contains("www.google")); - - output.WriteLine("Url {0}", mainFrame.Url); - } - } - - [Fact] - public async Task CanLoadGoogleAndEvaluateScript() - { - using (var browser = new ChromiumWebBrowser("www.google.com")) - { - await browser.LoadPageAsync(); - - var mainFrame = browser.GetMainFrame(); - Assert.True(mainFrame.IsValid); - Assert.True(mainFrame.Url.Contains("www.google")); - - var javascriptResponse = await browser.EvaluateScriptAsync("2 + 2"); - Assert.True(javascriptResponse.Success); - Assert.Equal(4, (int)javascriptResponse.Result); - output.WriteLine("Result of 2 + 2: {0}", javascriptResponse.Result); - } - } - - [Fact] - public async Task CrossSiteNavigationJavascriptBinding() - { - const string script = @" - (async function() - { - await CefSharp.BindObjectAsync('bound'); - bound.echo('test'); - })();"; - - var boundObj = new AsyncBoundObject(); - - var browser = new ChromiumWebBrowser("https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url"); - browser.JavascriptObjectRepository.Register("bound", boundObj, true); - - await browser.LoadPageAsync(); - browser.GetMainFrame().ExecuteJavaScriptAsync(script); - - await Task.Delay(2000); - Assert.True(boundObj.MethodCalled); - - boundObj.MethodCalled = false; - - browser.Load("https://www.google.com"); - await browser.LoadPageAsync(); - browser.GetMainFrame().ExecuteJavaScriptAsync(script); - await Task.Delay(2000); - Assert.True(boundObj.MethodCalled); - } - - /// - /// Use the EvaluateScriptAsync (IWebBrowser, String,Object[]) overload and pass in string params - /// that require encoding. Test case for https://github.com/cefsharp/CefSharp/issues/2339 - /// - /// A task - [Fact] - public async Task CanEvaluateScriptAsyncWithEncodedStringArguments() - { - using (var browser = new ChromiumWebBrowser("http://www.google.com")) - { - await browser.LoadPageAsync(); - - var mainFrame = browser.GetMainFrame(); - Assert.True(mainFrame.IsValid); - - var javascriptResponse = await browser.EvaluateScriptAsync("var testfunc=function(s) { return s; }"); - Assert.True(javascriptResponse.Success); - - // now call the function we just created - string[] teststrings = new string[]{"Mary's\tLamb & \r\nOther Things", - "[{test:\"Mary's Lamb & \\nOther Things\", 'other': \"\", 'and': null}]" }; - foreach (var test in teststrings) - { - javascriptResponse = await browser.EvaluateScriptAsync("testfunc", test); - Assert.True(javascriptResponse.Success); - Assert.Equal(test, (string)javascriptResponse.Result); - output.WriteLine("{0} passes {1}", test, javascriptResponse.Result); - } - } - } - - } -} diff --git a/CefSharp.Test/OffScreen/OffScreenBrowserTests.cs b/CefSharp.Test/OffScreen/OffScreenBrowserTests.cs new file mode 100644 index 0000000000..21bd1ac05c --- /dev/null +++ b/CefSharp.Test/OffScreen/OffScreenBrowserTests.cs @@ -0,0 +1,334 @@ +// Copyright © 2017 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using CefSharp.Example; +using CefSharp.OffScreen; +using CefSharp.Web; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.OffScreen +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class OffScreenBrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public OffScreenBrowserTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task ShouldWorkWhenLoadingGoogle() + { + using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler:false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + Assert.Equal(200, response.HttpStatusCode); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [Fact] + public async Task ShouldWorkWhenPassingEmptyUrlToConstructor() + { + using (var browser = new ChromiumWebBrowser(string.Empty, useLegacyRenderHandler: false)) + { + var response = await browser.LoadUrlAsync("www.google.com"); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + Assert.Equal(200, response.HttpStatusCode); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [Theory(Skip = "Not working with Chrome bootstrap")] + [InlineData("http://httpbin.org/post")] + public async Task ShouldWorkWhenLoadingRequestWithPostData(string url) + { + const string data = "Testing123"; + //When Chromium Site Isolation is enabled we must first navigate to + //a web page of the same origin to use LoadRequest + //When Site Isolation is disabled we can navigate to any web page + //https://magpcss.org/ceforum/viewtopic.php?f=10&t=18672&p=50266#p50249 + using (var browser = new ChromiumWebBrowser("http://httpbin.org/", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success, $"Initial Load Error Code: {response.ErrorCode.ToString()} Http Status Code: {response.HttpStatusCode}"); + + var request = new Request + { + Url = "http://httpbin.org/post", + Method = "POST" + }; + var postData = new PostData(); + postData.AddElement(new PostDataElement + { + Bytes = Encoding.UTF8.GetBytes(data) + }); + + request.PostData = postData; + + await browser.LoadRequestAsync(request); + + var mainFrame = browser.GetMainFrame(); + Assert.Equal(url, mainFrame.Url); + + var navEntry = await browser.GetVisibleNavigationEntryAsync(); + + Assert.Equal((int)HttpStatusCode.OK, navEntry.HttpStatusCode); + Assert.True(navEntry.HasPostData, "Has PostData"); + + var source = await browser.GetTextAsync(); + + Assert.Contains(data, source); + } + } + + [Fact] + public async Task ShouldFailWhenLoadingInvalidDomain() + { + using (var browser = new ChromiumWebBrowser("notfound.cefsharp.test", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("notfound.cefsharp.test", mainFrame.Url); + Assert.Equal(CefErrorCode.NameNotResolved, response.ErrorCode); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [Fact] + public async Task ShouldFailWhenLoadingBadSsl() + { + using (var browser = new ChromiumWebBrowser("https://expired.badssl.com/", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("", mainFrame.Url); + Assert.Equal(-1, response.HttpStatusCode); + Assert.Equal(CefErrorCode.CertDateInvalid, response.ErrorCode); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [Fact] + public async Task ShouldRespectDisposed() + { + ChromiumWebBrowser browser; + + using (browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Equal(CefExample.DefaultUrl, mainFrame.Url); + Assert.Equal(200, response.HttpStatusCode); + + output.WriteLine("Url {0}", mainFrame.Url); + } + + Assert.True(browser.IsDisposed, $"Browser IsDisposed:{browser.IsDisposed}"); + + Assert.Throws(() => + { + browser.Copy(); + }); + } + + [Fact] + public async Task ShouldWorkWhenBrowserCreatedAsync() + { + using (var chromiumWebBrowser = new ChromiumWebBrowser("http://www.google.com", automaticallyCreateBrowser: false, useLegacyRenderHandler: false)) + { + var browser = await chromiumWebBrowser.CreateBrowserAsync(); + + Assert.NotNull(browser); + Assert.False(browser.HasDocument); + Assert.NotEqual(0, browser.Identifier); + Assert.False(browser.IsDisposed); + } + } + + [Fact] + public async Task ShouldMakeFrameUrlRequest() + { + using (var browser = new ChromiumWebBrowser("https://code.jquery.com/jquery-3.4.1.min.js", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var wasCached = false; + var requestClient = new Example.UrlRequestClient((IUrlRequest req, byte[] responseBody) => + { + wasCached = req.ResponseWasCached; + taskCompletionSource.TrySetResult(Encoding.UTF8.GetString(responseBody)); + }); + + //Can be created on any valid CEF Thread, here we'll use the CEF UI Thread + await Cef.UIThreadTaskFactory.StartNew(delegate + { + var request = mainFrame.CreateRequest(false); + + request.Method = "GET"; + request.Url = "https://code.jquery.com/jquery-3.4.1.min.js"; + var urlRequest = mainFrame.CreateUrlRequest(request, requestClient); + }); + + var stringResult = await taskCompletionSource.Task; + + Assert.True(!string.IsNullOrEmpty(stringResult)); + Assert.True(wasCached); + } + } + + [Theory] + [InlineData("https://code.jquery.com/jquery-3.4.1.min.js")] + public async Task ShouldDownloadUrlForFrame(string url) + { + using (var browser = new ChromiumWebBrowser(url, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var htmlSrc = await browser.GetSourceAsync(); + + Assert.NotNull(htmlSrc); + + var mainFrame = browser.GetMainFrame(); + Assert.True(mainFrame.IsValid); + + var data = await mainFrame.DownloadUrlAsync(url); + + Assert.NotNull(data); + Assert.True(data.Length > 0); + + var stringResult = Encoding.UTF8.GetString(data).Substring(0, 100); + + Assert.Contains(stringResult, htmlSrc); + } + } + + [Theory] + //TODO: Add more urls + [InlineData("http://www.google.com", "http://cefsharp.github.io/")] + public async Task CanExecuteJavascriptInMainFrameAfterNavigatingToDifferentOrigin(string firstUrl, string secondUrl) + { + using (var browser = new ChromiumWebBrowser(firstUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + Assert.True(browser.CanExecuteJavascriptInMainFrame); + + await browser.LoadUrlAsync(secondUrl); + + Assert.True(browser.CanExecuteJavascriptInMainFrame); + + await browser.LoadUrlAsync(firstUrl); + + Assert.True(browser.CanExecuteJavascriptInMainFrame); + } + } + + [Fact] + public async Task ShouldWaitForBrowserInitialLoadAfterSubsequentLoad() + { + using (var browser = new ChromiumWebBrowser("http://www.google.com", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google.com", mainFrame.Url); + Assert.Equal(CefErrorCode.None, response.ErrorCode); + Assert.Equal(200, response.HttpStatusCode); + + output.WriteLine("Url {0}", mainFrame.Url); + + response = await browser.WaitForInitialLoadAsync(); + + Assert.Equal(CefErrorCode.None, response.ErrorCode); + Assert.Equal(200, response.HttpStatusCode); + } + } + + [Fact] + public async Task ShouldFailWhenCallingTryGetBrowserCoreByIdWithInvalidId() + { + using (var browser = new ChromiumWebBrowser("http://www.google.com", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var result = browser.TryGetBrowserCoreById(100, out IBrowser browserCore); + + Assert.False(result); + Assert.Null(browserCore); + } + } + + [Fact] + public async Task ShouldWorkWhenCallingTryGetBrowserCoreByIdWithOwnId() + { + using (var browser = new ChromiumWebBrowser("http://www.google.com", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var result = browser.TryGetBrowserCoreById(browser.BrowserCore.Identifier, out IBrowser browserCore); + + Assert.True(result); + Assert.NotNull(browserCore); + Assert.Equal(browser.BrowserCore.Identifier, browserCore.Identifier); + } + } + + [SkipIfRunOnAppVeyorFact] + public async Task ShouldWorkWhenCreatingOneThousandBrowserSequentially() + { + for (int i = 0; i < 1000; i++) + { + using (var browser = new ChromiumWebBrowser(new HtmlString("Testing"), useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var source = await browser.GetSourceAsync(); + + Assert.Contains("Testing", source); + } + } + } + } +} diff --git a/CefSharp.Test/OffScreen/RequestContextTests.cs b/CefSharp.Test/OffScreen/RequestContextTests.cs new file mode 100644 index 0000000000..0d1e6b08da --- /dev/null +++ b/CefSharp.Test/OffScreen/RequestContextTests.cs @@ -0,0 +1,134 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using CefSharp.OffScreen; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.OffScreen +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class RequestContextTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public RequestContextTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [SkipIfRunOnAppVeyorFact] + public async Task ShouldWorkWithProxy() + { + fixture.StartProxyServerIfRequired(); + + var requestContext = RequestContext + .Configure() + .WithProxyServer("127.0.0.1", 8080) + .Create(); + + using (var browser = new ChromiumWebBrowser("http://cefsharp.github.io/", requestContext: requestContext, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("cefsharp.github.io", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [SkipIfRunOnAppVeyorFact] + public async Task ShouldWorkWithSetProxyAsync() + { + fixture.StartProxyServerIfRequired(); + + var tcs = new TaskCompletionSource(); + + var requestContext = RequestContext + .Configure() + .OnInitialize((ctx) => + { + tcs.SetResult(true); + }) + .Create(); + + //Wait for our RequestContext to have initialized. + await tcs.Task; + + var setProxyResponse = await requestContext.SetProxyAsync("127.0.0.1", 8080); + + Assert.True(setProxyResponse.Success); + + using (var browser = new ChromiumWebBrowser("http://cefsharp.github.io/", requestContext: requestContext, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("cefsharp.github.io", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [SkipIfRunOnAppVeyorFact] + public async Task ShouldWorkWithProxySetOnUiThread() + { + fixture.StartProxyServerIfRequired(); + + var tcs = new TaskCompletionSource(); + + var requestContext = RequestContext + .Configure() + .OnInitialize((ctx) => + { + tcs.SetResult(true); + }) + .Create(); + + //Wait for our RequestContext to have initialized. + await tcs.Task; + + var success = false; + + //To execute on the CEF UI Thread you can use + await Cef.UIThreadTaskFactory.StartNew(delegate + { + string errorMessage; + + if (!requestContext.CanSetPreference("proxy")) + { + //Unable to set proxy, if you set proxy via command line args it cannot be modified. + success = false; + + return; + } + + success = requestContext.SetProxy("127.0.0.1", 8080, out errorMessage); + }); + + Assert.True(success); + + using (var browser = new ChromiumWebBrowser("http://cefsharp.github.io/", requestContext: requestContext, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("cefsharp.github.io", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + } +} diff --git a/CefSharp.Test/OffScreen/ScreenshotTests.cs b/CefSharp.Test/OffScreen/ScreenshotTests.cs new file mode 100644 index 0000000000..5be4bbdeba --- /dev/null +++ b/CefSharp.Test/OffScreen/ScreenshotTests.cs @@ -0,0 +1,131 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using Xunit.Abstractions; +using Xunit; +using System.Threading.Tasks; +using CefSharp.DevTools.Page; +using System.IO; +using CefSharp.OffScreen; +using System.Drawing; + +namespace CefSharp.Test.OffScreen +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class ScreenshotTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public ScreenshotTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task ShouldWork() + { + using (var browser = new ChromiumWebBrowser("http://www.google.com", useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var result1 = await browser.CaptureScreenshotAsync(); + Assert.Equal(1366, browser.Size.Width); + Assert.Equal(768, browser.Size.Height); + Assert.Equal(1, browser.DeviceScaleFactor); + using (var screenshot = Image.FromStream(new MemoryStream(result1))) + { + Assert.Equal(1366, screenshot.Width); + Assert.Equal(768, screenshot.Height); + } + + var result2 = await browser.CaptureScreenshotAsync(viewport: new Viewport { Width = 1366, Height = 768, X = 100, Y = 200, Scale = 2 }); + Assert.Equal(1466, browser.Size.Width); + Assert.Equal(968, browser.Size.Height); + Assert.Equal(2, browser.DeviceScaleFactor); + using (var screenshot = Image.FromStream(new MemoryStream(result2))) + { + Assert.Equal(2732, screenshot.Width); + Assert.Equal(1536, screenshot.Height); + } + + var result3 = await browser.CaptureScreenshotAsync(viewport: new Viewport { Width = 100, Height = 200, Scale = 2 }); + Assert.Equal(1466, browser.Size.Width); + Assert.Equal(968, browser.Size.Height); + Assert.Equal(2, browser.DeviceScaleFactor); + using (var screenshot = Image.FromStream(new MemoryStream(result3))) + { + Assert.Equal(200, screenshot.Width); + Assert.Equal(400, screenshot.Height); + } + + var result4 = await browser.CaptureScreenshotAsync(viewport: new Viewport { Width = 100, Height = 200, Scale = 1 }); + Assert.Equal(1466, browser.Size.Width); + Assert.Equal(968, browser.Size.Height); + Assert.Equal(1, browser.DeviceScaleFactor); + using (var screenshot = Image.FromStream(new MemoryStream(result4))) + { + Assert.Equal(100, screenshot.Width); + Assert.Equal(200, screenshot.Height); + } + } + } + + [Fact] + public async Task ShouldWorkWhenResizingWithDeviceScalingFactor() + { + using (var browser = new ChromiumWebBrowser("http://www.google.com")) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + Assert.Equal(1366, browser.Size.Width); + Assert.Equal(768, browser.Size.Height); + Assert.Equal(1, browser.DeviceScaleFactor); + + + await browser.ResizeAsync(800, 600, 2); + + Assert.Equal(800, browser.Size.Width); + Assert.Equal(600, browser.Size.Height); + Assert.Equal(2, browser.DeviceScaleFactor); + + using (var screenshot = browser.ScreenshotOrNull()) + { + Assert.Equal(1600, screenshot.Width); + Assert.Equal(1200, screenshot.Height); + } + + await browser.ResizeAsync(400, 300); + + Assert.Equal(400, browser.Size.Width); + Assert.Equal(300, browser.Size.Height); + Assert.Equal(2, browser.DeviceScaleFactor); + + using (var screenshot = browser.ScreenshotOrNull()) + { + Assert.Equal(800, screenshot.Width); + Assert.Equal(600, screenshot.Height); + } + + await browser.ResizeAsync(1366, 768, 1); + + Assert.Equal(1366, browser.Size.Width); + Assert.Equal(768, browser.Size.Height); + Assert.Equal(1, browser.DeviceScaleFactor); + + using (var screenshot = browser.ScreenshotOrNull()) + { + Assert.Equal(1366, screenshot.Width); + Assert.Equal(768, screenshot.Height); + } + } + } + } +} diff --git a/CefSharp.Test/OffScreen/WaitForRenderIdleTests.cs b/CefSharp.Test/OffScreen/WaitForRenderIdleTests.cs new file mode 100644 index 0000000000..fe32b4483d --- /dev/null +++ b/CefSharp.Test/OffScreen/WaitForRenderIdleTests.cs @@ -0,0 +1,123 @@ +using CefSharp.Example; +using CefSharp.OffScreen; +using System; +using System.Threading; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.OffScreen +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class WaitForRenderIdleTests + { + + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public WaitForRenderIdleTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task ShouldWork() + { + const int expected = 500; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler:false)) + { + var start = DateTime.Now; + await browser.WaitForRenderIdleAsync(); + + var end = DateTime.Now; + + var time = (end - start).TotalMilliseconds; + + Assert.True(end > start); + Assert.True(time > expected, $"Executed in {time}ms"); + + output.WriteLine("Time {0}ms", time); + + Assert.Equal(0, browser.PaintEventHandlerCount()); + } + } + + [Fact] + public async Task ShouldWorkForManualInvalidateCalls() + { + const int expected = 600; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var start = DateTime.Now; + + var invalidateTask = Task.Run(async () => + { + await Task.Delay(400); + + browser.GetBrowserHost().Invalidate(PaintElementType.View); + + await Task.Delay(100); + + browser.GetBrowserHost().Invalidate(PaintElementType.View); + + await Task.Delay(100); + + browser.GetBrowserHost().Invalidate(PaintElementType.View); + }); + + await Task.WhenAll(browser.WaitForRenderIdleAsync(), invalidateTask); + + var end = DateTime.Now; + + var time = (end - start).TotalMilliseconds; + + Assert.True(end > start); + Assert.True(time > expected, $"Executed in {time}ms"); + + Assert.Equal(0, browser.PaintEventHandlerCount()); + + output.WriteLine("Time {0}ms", time); + } + } + + [Fact] + public async Task ShouldRespectTimeout() + { + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var exception = await Assert.ThrowsAsync(async () => + { + await browser.WaitForRenderIdleAsync(timeout: TimeSpan.FromMilliseconds(100)); + }); + + Assert.Equal("The operation has timed out.", exception.Message); + + Assert.Equal(0, browser.PaintEventHandlerCount()); + } + } + + [Fact] + public async Task ShouldRespectCancellation() + { + + using (var cancellationSource = new CancellationTokenSource()) + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + cancellationSource.CancelAfter(400); + + var exception = await Assert.ThrowsAsync(async () => + { + await browser.WaitForRenderIdleAsync(cancellationToken:cancellationSource.Token); + }); + + Assert.Equal("A task was canceled.", exception.Message); + + Assert.Equal(0, browser.PaintEventHandlerCount()); + } + } + } +} diff --git a/CefSharp.Test/PostMessage/PostMessageTests.cs b/CefSharp.Test/PostMessage/PostMessageTests.cs new file mode 100644 index 0000000000..d0e08717f1 --- /dev/null +++ b/CefSharp.Test/PostMessage/PostMessageTests.cs @@ -0,0 +1,101 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.PostMessage +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class PostMessageTests : BrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public PostMessageTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task ShouldWork() + { + AssertInitialLoadComplete(); + + var evt = await Assert.RaisesAsync( + a => Browser.JavascriptMessageReceived += a, + a => Browser.JavascriptMessageReceived -= a, + () => Browser.EvaluateScriptAsync("cefSharp.postMessage('test');")); + + Assert.NotNull(evt); + Assert.Equal("test", evt.Arguments.Message); + } + + [Fact] + public async Task ShouldWorkWithJavascriptCallback() + { + const string expected = "Echo"; + + AssertInitialLoadComplete(); + + var evt = await Assert.RaisesAsync( + a => Browser.JavascriptMessageReceived += a, + a => Browser.JavascriptMessageReceived -= a, + () => Browser.EvaluateScriptAsync("cefSharp.postMessage({ 'Type': 'Update', Data: { 'Property': 123 }, 'Callback': (p1) => { return p1; } });")); + + Assert.NotNull(evt); + + dynamic msg = evt.Arguments.Message; + var callback = (IJavascriptCallback)msg.Callback; + var response = await callback.ExecuteAsync(expected); + + Assert.True(response.Success); + Assert.Equal(expected, response.Result); + } + + [Theory] + [InlineData("Event", "Event1")] + [InlineData("Event", "Event2")] + [InlineData("CustomEvent", "Event1")] + [InlineData("CustomEvent", "Event2")] + public async Task ShouldWorkForCustomEvent(string jsEventObject, string expected) + { + const string Script = @" + const postMessageHandler = e => { cefSharp.postMessage(e.type); }; + window.addEventListener(""Event1"", postMessageHandler, false); + window.addEventListener(""Event2"", postMessageHandler, false);"; + + string rawHtml = $"

testing

"; + + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + //Make sure to load an initial page so we can then add our script using + //Page.AddScriptToEvaluateOnNewDocument (via DevTools) + + using (var devToolsClient = Browser.GetDevToolsClient()) + { + var result = await devToolsClient.Page.AddScriptToEvaluateOnNewDocumentAsync(Script); + var scriptId = int.Parse(result.Identifier); + + //We must use Page.Enable for the script to be added + await devToolsClient.Page.EnableAsync(); + + Browser.LoadHtml(rawHtml); + + Browser.JavascriptMessageReceived += (o, e) => + { + tcs.SetResult((string)e.Message); + }; + + var actual = await tcs.Task; + + Assert.True(scriptId > 0); + Assert.Equal(expected, actual); + } + } + } +} diff --git a/CefSharp.Test/PrintToPdf/PrintToPdfTests.cs b/CefSharp.Test/PrintToPdf/PrintToPdfTests.cs new file mode 100644 index 0000000000..9a5a0f7560 --- /dev/null +++ b/CefSharp.Test/PrintToPdf/PrintToPdfTests.cs @@ -0,0 +1,59 @@ +using System.Threading.Tasks; +using Xunit.Abstractions; +using Xunit; +using System.IO; +using CefSharp.OffScreen; +using CefSharp.Example; +using System; + +namespace CefSharp.Test.PrintToPdf +{ + [Collection(CefSharpFixtureCollection.Key)] + public class PrintToPdfTests : BrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public PrintToPdfTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task ShouldWork() + { + AssertInitialLoadComplete(); + + var tempFile = Path.Combine(Path.GetTempPath(), "test.pdf"); + + if(File.Exists(tempFile)) + { + File.Delete(tempFile); + } + + var success = await Browser.PrintToPdfAsync(tempFile); + + Assert.True(success, $"PDF Generation Failed {tempFile}"); + Assert.True(File.Exists(tempFile), $"PDF File not found {tempFile}"); + } + + [Fact] + public async Task ShouldFailIfPageNotLoaded() + { + var tempFile = Path.Combine(Path.GetTempPath(), "test.pdf"); + + if (File.Exists(tempFile)) + { + File.Delete(tempFile); + } + + using (var browser = new ChromiumWebBrowser(CefExample.HelloWorldUrl, automaticallyCreateBrowser: false)) + { + var exception = await Assert.ThrowsAsync(async () => await browser.PrintToPdfAsync(tempFile)); + + Assert.Equal(WebBrowserExtensions.BrowserNullExceptionString, exception.Message); + } + } + } +} diff --git a/CefSharp.Test/Properties/AssemblyInfo.cs b/CefSharp.Test/Properties/AssemblyInfo.cs index af7f059be1..7948f084c1 100644 --- a/CefSharp.Test/Properties/AssemblyInfo.cs +++ b/CefSharp.Test/Properties/AssemblyInfo.cs @@ -18,4 +18,5 @@ [assembly: AssemblyFileVersion(AssemblyInfo.AssemblyFileVersion)] [assembly: CLSCompliant(AssemblyInfo.ClsCompliant)] -[assembly: CollectionBehavior(DisableTestParallelization = true)] +[assembly: CollectionBehavior(DisableTestParallelization = true, MaxParallelThreads = 1)] +//[assembly: TestCaseOrderer("CefSharp.Test.CefSharpTestCaseOrderer", "CefSharp.Test")] diff --git a/CefSharp.Test/QUnitTestResult.cs b/CefSharp.Test/QUnitTestResult.cs new file mode 100644 index 0000000000..9160b0e17a --- /dev/null +++ b/CefSharp.Test/QUnitTestResult.cs @@ -0,0 +1,17 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.Test +{ + public class QUnitTestResult + { + public bool Success + { + get { return Passed == Total; } + } + + public int Passed { get; set; } + public int Total { get; set; } + } +} diff --git a/CefSharp.Test/RequestContextIsolatedBrowserTests.cs b/CefSharp.Test/RequestContextIsolatedBrowserTests.cs new file mode 100644 index 0000000000..5ac6dfced1 --- /dev/null +++ b/CefSharp.Test/RequestContextIsolatedBrowserTests.cs @@ -0,0 +1,23 @@ +// Copyright © 2023 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using CefSharp.Example; +using CefSharp.OffScreen; +using Xunit; + +namespace CefSharp.Test +{ + /// + /// Each browser instance will be created with it's own + /// using an InMemory cache + /// + public abstract class RequestContextIsolatedBrowserTests : BrowserTests + { + protected RequestContextIsolatedBrowserTests() + { + RequestContextIsolated = true; + } + } +} diff --git a/CefSharp.Test/SchemeHandler/FolderSchemeHandlerFactoryTests.cs b/CefSharp.Test/SchemeHandler/FolderSchemeHandlerFactoryTests.cs new file mode 100644 index 0000000000..a75af1fee9 --- /dev/null +++ b/CefSharp.Test/SchemeHandler/FolderSchemeHandlerFactoryTests.cs @@ -0,0 +1,107 @@ +using Xunit.Abstractions; +using Xunit; +using System.Threading.Tasks; +using CefSharp.OffScreen; +using CefSharp.Example; +using CefSharp.SchemeHandler; +using System.IO; + +namespace CefSharp.Test.SchemeHandler +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class FolderSchemeHandlerFactoryTests + { + +#if NETCOREAPP + private static string ExampleResourcesFolderPath = Path.GetFullPath(@"..\..\..\..\..\..\CefSharp.Example\Resources"); +#else + private static string ExampleResourcesFolderPath = Path.GetFullPath(@"..\..\..\..\..\CefSharp.Example\Resources"); +#endif + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public FolderSchemeHandlerFactoryTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task ShouldWork() + { + const string expected = "https://folderschemehandlerfactory.test/"; + + using (var requestContext = new RequestContext(Cef.GetGlobalRequestContext())) + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, requestContext: requestContext, useLegacyRenderHandler: false)) + { + _ = await browser.WaitForInitialLoadAsync(); + + requestContext.RegisterSchemeHandlerFactory("https", + "folderSchemeHandlerFactory.test", + new FolderSchemeHandlerFactory(ExampleResourcesFolderPath, defaultPage: "HelloWorld.html")); + + var response = await browser.LoadUrlAsync(expected); + + var mainFrame = browser.GetMainFrame(); + Assert.True(mainFrame.IsValid); + Assert.Equal(expected, mainFrame.Url); + Assert.Equal(200, response.HttpStatusCode); + + var jsResponse = await browser.EvaluateScriptAsync("document.documentElement.outerHTML"); + + Assert.Contains("Hello World", jsResponse.Result.ToString()); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [Fact] + public async Task ShouldAllowFileDeletionAfterLoading() + { + const string expected = "https://folderschemehandlerfactory.test/"; + const string html = "I'm going to be deleted after use!"; + + using (var requestContext = new RequestContext(Cef.GetGlobalRequestContext())) + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, requestContext: requestContext)) + { + _ = await browser.WaitForInitialLoadAsync(); + + var tempFile = Path.Combine(ExampleResourcesFolderPath, "DeleteAfterUse.html"); + + if(File.Exists(tempFile)) + { + File.Delete(tempFile); + } + + Assert.False(File.Exists(tempFile)); + + File.WriteAllText(tempFile, html); + + Assert.True(File.Exists(tempFile)); + + requestContext.RegisterSchemeHandlerFactory("https", + "folderSchemeHandlerFactory.test", + new FolderSchemeHandlerFactory(ExampleResourcesFolderPath, defaultPage: "DeleteAfterUse.html")); + + var response = await browser.LoadUrlAsync(expected); + + var mainFrame = browser.GetMainFrame(); + Assert.True(mainFrame.IsValid); + Assert.Equal(expected, mainFrame.Url); + Assert.Equal(200, response.HttpStatusCode); + + var jsResponse = await browser.EvaluateScriptAsync("document.documentElement.outerHTML"); + + Assert.Contains(html, jsResponse.Result.ToString()); + + //Delete the file + File.Delete(tempFile); + + Assert.False(File.Exists(tempFile)); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + } +} diff --git a/CefSharp.Test/Selector/WaitForSelectorAsyncTests.cs b/CefSharp.Test/Selector/WaitForSelectorAsyncTests.cs new file mode 100644 index 0000000000..08850cf203 --- /dev/null +++ b/CefSharp.Test/Selector/WaitForSelectorAsyncTests.cs @@ -0,0 +1,207 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using Xunit.Abstractions; +using Xunit; +using System.Threading.Tasks; +using CefSharp.OffScreen; +using CefSharp.Example; +using System; +using CefSharp.Web; + +namespace CefSharp.Test.Selector +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class WaitForSelectorAsyncTests + { + + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public WaitForSelectorAsyncTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task CanWork() + { + const string elementId = "newElement"; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var selectorTask = browser.WaitForSelectorAsync($"#{elementId}"); + var evaluateTask = browser.EvaluateScriptAsync("const newDiv = document.createElement('div'); newDiv.id = 'newElement'; const newContent = document.createTextNode('Hi there and greetings!'); newDiv.appendChild(newContent); document.body.append(newDiv);"); + + await Task.WhenAll(selectorTask, evaluateTask); + + var selectorResponse = selectorTask.Result; + var evalauteResponse = evaluateTask.Result; + + Assert.True(selectorResponse.Success); + Assert.True(evalauteResponse.Success); + + Assert.Equal(elementId, selectorResponse.ElementId); + Assert.Equal("DIV", selectorResponse.TagName); + } + } + + [Fact] + public async Task CanWorkForDelayedAction() + { + const string elementId = "newElement"; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var selectorTask = browser.WaitForSelectorAsync($"#{elementId}"); + var evaluateTask = Task.Run(async () => + { + await Task.Delay(500); + return await browser.EvaluateScriptAsync("const newDiv = document.createElement('div'); newDiv.id = 'newElement'; const newContent = document.createTextNode('Hi there and greetings!'); newDiv.appendChild(newContent); document.body.append(newDiv);"); + }); + + await Task.WhenAll(selectorTask, evaluateTask); + + var selectorResponse = selectorTask.Result; + var evalauteResponse = evaluateTask.Result; + + Assert.True(selectorResponse.Success); + Assert.True(evalauteResponse.Success); + + Assert.True(selectorResponse.ElementAdded); + Assert.Equal(elementId, selectorResponse.ElementId); + Assert.Equal("DIV", selectorResponse.TagName); + } + } + + [Fact] + public async Task CanWorkForRemoved() + { + const string elementId = "content"; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var selectorTask = browser.WaitForSelectorAsync($"#{elementId}", removed:true); + var evaluateTask = browser.EvaluateScriptAsync($"document.querySelector('#{elementId}').remove();"); + + await Task.WhenAll(selectorTask, evaluateTask); + + var selectorResponse = selectorTask.Result; + var evalauteResponse = evaluateTask.Result; + + Assert.True(selectorResponse.Success); + Assert.True(evalauteResponse.Success); + + Assert.False(selectorResponse.ElementAdded); + + var removedCheck = await browser.EvaluateScriptAsync($"document.querySelector('#{elementId}') === null"); + + Assert.True(removedCheck.Success); + Assert.True((bool)removedCheck.Result); + } + } + + [Fact] + public async Task ShouldReturnTrueForRemovedNonExistingElement() + { + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var selectorResponse = await browser.WaitForSelectorAsync("non-existing", removed:true ); + + Assert.True(selectorResponse.Success); + Assert.False(selectorResponse.ElementAdded); + } + } + + [Fact] + public async Task CanTimeout() + { + const string expected = "The operation has timed out."; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var exception = await Assert.ThrowsAnyAsync(async () => + { + await browser.WaitForSelectorAsync("#notExist", timeout: TimeSpan.FromMilliseconds(100)); + }); + + Assert.Contains(expected, exception.Message); + + output.WriteLine("Exception {0}", exception.Message); + } + } + + [Fact] + public async Task ShouldCancelIfNavigationOccurs() + { + const string expected = "A task was canceled."; + const string url = CefExample.HelloWorldUrl; + + using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var exception = await Assert.ThrowsAnyAsync(async () => + { + var navigationTask = browser.WaitForSelectorAsync("non-existant"); + var evaluateTask = browser.EvaluateScriptAsync($"setTimeout(() => window.location.href = '{url}', 100);"); + + await Task.WhenAll(navigationTask, evaluateTask); + }); + + Assert.Contains(expected, exception.Message); + + output.WriteLine("Exception {0}", exception.Message); + } + } + + [Fact] + public async Task ShouldRespondToNodeAttributeMutation() + { + var html = new HtmlString("
"); + + using (var browser = new ChromiumWebBrowser(html, useLegacyRenderHandler: false)) + { + var response = await browser.WaitForInitialLoadAsync(); + + Assert.True(response.Success); + + var divFound = false; + var waitForSelector = browser.WaitForSelectorAsync(".zombo").ContinueWith(_ => divFound = true); + + Assert.False(divFound); + + browser.ExecuteScriptAsync("document.querySelector('div').className = 'zombo'"); + + var actual = await waitForSelector; + + Assert.True(actual); + } + } + } +} diff --git a/CefSharp.Test/SkipIfRunOnAppVeyorFact.cs b/CefSharp.Test/SkipIfRunOnAppVeyorFact.cs new file mode 100644 index 0000000000..d5515d9aba --- /dev/null +++ b/CefSharp.Test/SkipIfRunOnAppVeyorFact.cs @@ -0,0 +1,20 @@ +// Copyright © 2020 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using Xunit; + +namespace CefSharp.Test +{ + public class SkipIfRunOnAppVeyorFact : FactAttribute + { + public SkipIfRunOnAppVeyorFact() + { + if(Environment.GetEnvironmentVariable("APPVEYOR") == "True") + { + Skip = "Running on Appveyor - Test Skipped"; + } + } + } +} diff --git a/CefSharp.Test/UrlRequest/UrlRequestTests.cs b/CefSharp.Test/UrlRequest/UrlRequestTests.cs new file mode 100644 index 0000000000..03ac74f46a --- /dev/null +++ b/CefSharp.Test/UrlRequest/UrlRequestTests.cs @@ -0,0 +1,57 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Text; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.UrlRequest +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class UrlRequestTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public UrlRequestTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [Fact] + public async Task ShouldWork() + { + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + IUrlRequest urlRequest = null; + int statusCode = -1; + + //Can be created on any valid CEF Thread, here we'll use the CEF UI Thread + await Cef.UIThreadTaskFactory.StartNew(delegate + { + var requestClient = new Example.UrlRequestClient((IUrlRequest req, byte[] responseBody) => + { + statusCode = req.Response.StatusCode; + taskCompletionSource.TrySetResult(Encoding.UTF8.GetString(responseBody)); + }); + + var request = new Request + { + Method = "GET", + Url = "https://code.jquery.com/jquery-3.4.1.min.js" + }; + + //Global RequestContext will be used + urlRequest = new CefSharp.UrlRequest(request, requestClient); + }); + + var stringResult = await taskCompletionSource.Task; + + Assert.True(!string.IsNullOrEmpty(stringResult)); + Assert.Equal(200, statusCode); + } + } +} diff --git a/CefSharp.Test/WebBrowserTestExtensions.cs b/CefSharp.Test/WebBrowserTestExtensions.cs index cf1c148a5e..750d8d06f1 100644 --- a/CefSharp.Test/WebBrowserTestExtensions.cs +++ b/CefSharp.Test/WebBrowserTestExtensions.cs @@ -3,37 +3,148 @@ // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; +using System.Reflection; using System.Threading.Tasks; +using CefSharp.Internals; +using CefSharp.OffScreen; namespace CefSharp.Test { public static class WebBrowserTestExtensions { - public static Task LoadPageAsync(this IWebBrowser browser, string address = null) + public static int PaintEventHandlerCount(this CefSharp.Wpf.ChromiumWebBrowser browser) { - //If using .Net 4.6 then use TaskCreationOptions.RunContinuationsAsynchronously - //and switch to tcs.TrySetResult below - no need for the custom extension method - var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var field = typeof(CefSharp.Wpf.ChromiumWebBrowser).GetField("Paint", BindingFlags.NonPublic | BindingFlags.Instance); - EventHandler handler = null; - handler = (sender, args) => + if(field == null) + { + throw new Exception("Unable to obtain Paint event handler"); + } + + var handler = field.GetValue(browser) as Delegate; + + if (handler == null) + { + return 0; + } + + var subscribers = handler.GetInvocationList(); + + return subscribers.Length; + } + + public static int PaintEventHandlerCount(this ChromiumWebBrowser browser) + { + var field = typeof(ChromiumWebBrowser).GetField("Paint", BindingFlags.NonPublic | BindingFlags.Instance); + + if (field == null) + { + throw new Exception("Unable to obtain Paint event handler"); + } + + var handler = field.GetValue(browser) as Delegate; + + if (handler == null) + { + return 0; + } + + var subscribers = handler.GetInvocationList(); + + return subscribers.Length; + } + + public static Task LoadRequestAsync(this IWebBrowser browser, IRequest request) + { + if(request == null) + { + throw new ArgumentNullException("request"); + } + + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + EventHandler loadErrorHandler = null; + EventHandler loadingStateChangeHandler = null; + + loadErrorHandler = (sender, args) => + { + //Ignore Aborted + //Currently invalid SSL certificates which aren't explicitly allowed + //end up with CefErrorCode.Aborted, I've created the following PR + //in the hopes of getting this fixed. + //https://bitbucket.org/chromiumembedded/cef/pull-requests/373 + if (args.ErrorCode == CefErrorCode.Aborted) + { + return; + } + + //If LoadError was called then we'll remove both our handlers + //as we won't need to capture LoadingStateChanged, we know there + //was an error + browser.LoadError -= loadErrorHandler; + browser.LoadingStateChanged -= loadingStateChangeHandler; + + tcs.TrySetResult(new LoadUrlAsyncResponse(args.ErrorCode, -1)); + }; + + loadingStateChangeHandler = (sender, args) => { //Wait for while page to finish loading not just the first frame if (!args.IsLoading) { - browser.LoadingStateChanged -= handler; + var host = args.Browser.GetHost(); + + var navEntry = host?.GetVisibleNavigationEntry(); + + int statusCode = navEntry?.HttpStatusCode ?? -1; + + //By default 0 is some sort of error, we map that to -1 + //so that it's clearer that something failed. + if (statusCode == 0) + { + statusCode = -1; + } + + browser.LoadingStateChanged -= loadingStateChangeHandler; //This is required when using a standard TaskCompletionSource //Extension method found in the CefSharp.Internals namespace - tcs.TrySetResult(true); + tcs.TrySetResult(new LoadUrlAsyncResponse(CefErrorCode.None, statusCode)); } }; - browser.LoadingStateChanged += handler; + browser.LoadingStateChanged += loadingStateChangeHandler; + browser.GetMainFrame().LoadRequest(request); - if (!string.IsNullOrEmpty(address)) + return TaskTimeoutExtensions.WaitAsync(tcs.Task, TimeSpan.FromSeconds(30)); + } + + public static Task CreateBrowserAndWaitForQUnitTestExeuctionToComplete(this ChromiumWebBrowser browser) + { + //If using .Net 4.6 then use TaskCreationOptions.RunContinuationsAsynchronously + //and switch to tcs.TrySetResult below - no need for the custom extension method + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + EventHandler handler = null; + handler = (sender, args) => { - browser.Load(address); - } + dynamic msg = args.Message; + //Wait for while page to finish loading not just the first frame + if (msg.Type == "QUnitExecutionComplete") + { + browser.JavascriptMessageReceived -= handler; + + var details = msg.Details; + var total = (int)details.total; + var passed = (int)details.passed; + + tcs.TrySetResult(new QUnitTestResult { Passed = passed, Total = total }); + } + }; + + browser.JavascriptMessageReceived += handler; + + browser.CreateBrowser(); + return tcs.Task; } } diff --git a/CefSharp.Test/WinForms/RequestContextTests.cs b/CefSharp.Test/WinForms/RequestContextTests.cs new file mode 100644 index 0000000000..6cae221ac0 --- /dev/null +++ b/CefSharp.Test/WinForms/RequestContextTests.cs @@ -0,0 +1,69 @@ +// Copyright © 2017 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Threading.Tasks; +using CefSharp.Example; +using CefSharp.WinForms; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.WinForms +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class RequestContextTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public RequestContextTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [WinFormsFact] + public async Task ShouldWork() + { + using (var browser = new ChromiumWebBrowser("www.google.com")) + { + browser.RequestContext = new RequestContext(); + + browser.Size = new System.Drawing.Size(1024, 768); + browser.CreateControl(); + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WinFormsFact] + public async Task ShouldWorkUsingBuilder() + { + using (var browser = new ChromiumWebBrowser("www.google.com")) + { + browser.RequestContext = RequestContext.Configure() + .WithSharedSettings(Cef.GetGlobalRequestContext()) + .Create(); + + browser.Size = new System.Drawing.Size(1024, 768); + browser.CreateControl(); + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + } +} diff --git a/CefSharp.Test/WinForms/WinFormsBrowserBasicFacts.cs b/CefSharp.Test/WinForms/WinFormsBrowserBasicFacts.cs deleted file mode 100644 index aac9a9158e..0000000000 --- a/CefSharp.Test/WinForms/WinFormsBrowserBasicFacts.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright © 2017 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -using Xunit; -using Xunit.Abstractions; - -namespace CefSharp.Test.WinForms -{ - //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle - [Collection(CefSharpFixtureCollection.Key)] - public class WinFormsBrowserBasicFacts - { - private readonly ITestOutputHelper output; - private readonly CefSharpFixture fixture; - - public WinFormsBrowserBasicFacts(ITestOutputHelper output, CefSharpFixture fixture) - { - this.fixture = fixture; - this.output = output; - } - - //TODO: Add tests - //Investigate using https://github.com/AArnott/Xunit.StaFact for STA thread management - } -} diff --git a/CefSharp.Test/WinForms/WinFormsBrowserTests.cs b/CefSharp.Test/WinForms/WinFormsBrowserTests.cs new file mode 100644 index 0000000000..08bd376fdb --- /dev/null +++ b/CefSharp.Test/WinForms/WinFormsBrowserTests.cs @@ -0,0 +1,115 @@ +// Copyright © 2017 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Threading.Tasks; +using CefSharp.Example; +using CefSharp.WinForms; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.WinForms +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + public class WinFormsBrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public WinFormsBrowserTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [WinFormsFact] + public async Task ShouldWorkWhenLoadingGoogle() + { + using (var browser = new ChromiumWebBrowser("www.google.com")) + { + browser.Size = new System.Drawing.Size(1024, 768); + browser.CreateControl(); + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WinFormsFact] + public async Task ShouldDisableImageLoadingViaObjectFactory() + { + using (var browser = new ChromiumWebBrowser("www.google.com")) + { + var settings = Core.ObjectFactory.CreateBrowserSettings(true); + settings.ImageLoading = CefState.Disabled; + browser.BrowserSettings = settings; + browser.Size = new System.Drawing.Size(1024, 768); + browser.CreateControl(); + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WinFormsFact] + public async Task ShouldDisableImageLoading() + { + using (var browser = new ChromiumWebBrowser("www.google.com")) + { + browser.BrowserSettings = new BrowserSettings(true) + { + ImageLoading = CefState.Disabled + }; + browser.Size = new System.Drawing.Size(1024, 768); + browser.CreateControl(); + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WinFormsFact] + public async Task ShouldRespectDisposed() + { + ChromiumWebBrowser browser; + + using (browser = new ChromiumWebBrowser(CefExample.DefaultUrl)) + { + browser.Size = new System.Drawing.Size(1024, 768); + browser.CreateControl(); + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Equal(CefExample.DefaultUrl, mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + + Assert.True(browser.IsDisposed); + + Assert.Throws(() => + { + browser.Copy(); + }); + } + } +} diff --git a/CefSharp.Test/Wpf.HwndHost/WpfBrowserTests.cs b/CefSharp.Test/Wpf.HwndHost/WpfBrowserTests.cs new file mode 100644 index 0000000000..c5d4561aff --- /dev/null +++ b/CefSharp.Test/Wpf.HwndHost/WpfBrowserTests.cs @@ -0,0 +1,113 @@ +// Copyright © 2017 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Interop; +using CefSharp.Example; +using CefSharp.Wpf.HwndHost; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Wpf.HwndHost +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + [BrowserRefCountDebugging(typeof(ChromiumWebBrowser))] + public class WpfBrowserTests + { + [DllImport("user32.dll")] + private static extern IntPtr SetParent(IntPtr hwnd, IntPtr hwndNewParent); + + private const int HWND_MESSAGE = -3; + + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public WpfBrowserTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [WpfFact] + public async Task ShouldWorkWhenLoadingGoogle() + { + var window = CreateAndShowHiddenWindow(); + + using (var browser = new ChromiumWebBrowser("www.google.com")) + { + window.Content = browser; + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WpfFact] + public async Task ShouldWorkWhenLoadUrlAsyncImmediately() + { + var window = CreateAndShowHiddenWindow(); + + using (var browser = new ChromiumWebBrowser(string.Empty)) + { + window.Content = browser; + + var response = await browser.LoadUrlAsync("www.google.com"); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WpfFact] + public async Task ShouldRespectDisposed() + { + var window = CreateAndShowHiddenWindow(); + + ChromiumWebBrowser browser; + + using (browser = new ChromiumWebBrowser(CefExample.DefaultUrl)) + { + window.Content = browser; + + await browser.WaitForInitialLoadAsync(); + } + + Assert.True(browser.IsDisposed); + + var ex = Assert.Throws(() => + { + browser.Copy(); + }); + } + + private static Window CreateAndShowHiddenWindow() + { + var window = new Window(); + window.Width = 1024; + window.Height = 768; + + var helper = new WindowInteropHelper(window); + + helper.EnsureHandle(); + + SetParent(helper.Handle, (IntPtr)HWND_MESSAGE); + + window.Show(); + return window; + } + } +} diff --git a/CefSharp.Test/Wpf/RequestContextTests.cs b/CefSharp.Test/Wpf/RequestContextTests.cs new file mode 100644 index 0000000000..740c526a7f --- /dev/null +++ b/CefSharp.Test/Wpf/RequestContextTests.cs @@ -0,0 +1,66 @@ +// Copyright © 2017 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Threading.Tasks; +using System.Windows; +using CefSharp.Wpf; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Wpf +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + [BrowserRefCountDebugging(typeof(ChromiumWebBrowser))] + public class RequestContextTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public RequestContextTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [WpfFact] + public async Task ShouldWork() + { + using (var browser = new ChromiumWebBrowser("www.google.com")) + { + browser.RequestContext = new RequestContext(); + browser.CreateBrowser(null, new Size(1024, 786)); + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WpfFact] + public async Task ShouldWorkUsingBuilder() + { + using (var browser = new ChromiumWebBrowser("www.google.com")) + { + browser.RequestContext = RequestContext.Configure() + .WithSharedSettings(Cef.GetGlobalRequestContext()) + .Create(); + + browser.CreateBrowser(null, new Size(1024, 786)); + + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + } +} diff --git a/CefSharp.Test/Wpf/WaitForRenderIdleTests.cs b/CefSharp.Test/Wpf/WaitForRenderIdleTests.cs new file mode 100644 index 0000000000..96c20809cb --- /dev/null +++ b/CefSharp.Test/Wpf/WaitForRenderIdleTests.cs @@ -0,0 +1,126 @@ +using CefSharp.Example; +using CefSharp.Wpf; +using System; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Wpf +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + [BrowserRefCountDebugging(typeof(ChromiumWebBrowser))] + public class WaitForRenderIdleTests + { + + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public WaitForRenderIdleTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [WpfFact] + public async Task ShouldWork() + { + using (var browser = new ChromiumWebBrowser(null, CefExample.DefaultUrl, new Size(1024, 786))) + { + var start = DateTime.Now; + await browser.WaitForRenderIdleAsync(); + + var end = DateTime.Now; + + var time = (end - start).TotalMilliseconds; + + Assert.True(end > start); + Assert.True(time > 400, $"Executed in {time}ms"); + + output.WriteLine("Time {0}ms", time); + + Assert.Equal(0, browser.PaintEventHandlerCount()); + } + } + + [WpfFact] + public async Task ShouldWorkForManualInvalidateCalls() + { + const int expected = 600; + + using (var browser = new ChromiumWebBrowser(null, CefExample.DefaultUrl, new Size(1024, 786))) + { + var start = DateTime.Now; + + var invalidateTask = Task.Run(async () => + { + await Task.Delay(400); + + // Ensure the browser has finished loading before we attempt + // to access BrowserHost + await browser.WaitForInitialLoadAsync(); + + browser.GetBrowserHost().Invalidate(PaintElementType.View); + + await Task.Delay(100); + + browser.GetBrowserHost().Invalidate(PaintElementType.View); + + await Task.Delay(100); + + browser.GetBrowserHost().Invalidate(PaintElementType.View); + }); + + await Task.WhenAll(browser.WaitForRenderIdleAsync(), invalidateTask); + + var end = DateTime.Now; + + var time = (end - start).TotalMilliseconds; + + Assert.True(end > start); + Assert.True(time > expected, $"Executed in {time}ms"); + + Assert.Equal(0, browser.PaintEventHandlerCount()); + + output.WriteLine("Time {0}ms", time); + } + } + + [WpfFact] + public async Task ShouldRespectTimeout() + { + using (var browser = new ChromiumWebBrowser(null, CefExample.DefaultUrl, new Size(1024, 786))) + { + var exception = await Assert.ThrowsAsync(async () => + { + await browser.WaitForRenderIdleAsync(timeout: TimeSpan.FromMilliseconds(100)); + }); + + Assert.Equal("The operation has timed out.", exception.Message); + + Assert.Equal(0, browser.PaintEventHandlerCount()); + } + } + + [WpfFact] + public async Task ShouldRespectCancellation() + { + using (var cancellationSource = new CancellationTokenSource()) + using (var browser = new ChromiumWebBrowser(null, CefExample.DefaultUrl, new Size(1024, 786))) + { + cancellationSource.CancelAfter(200); + + var exception = await Assert.ThrowsAsync(async () => + { + await browser.WaitForRenderIdleAsync(cancellationToken:cancellationSource.Token); + }); + + Assert.Equal("A task was canceled.", exception.Message); + + Assert.Equal(0, browser.PaintEventHandlerCount()); + } + } + } +} diff --git a/CefSharp.Test/Wpf/WpfBrowserBasicFacts.cs b/CefSharp.Test/Wpf/WpfBrowserBasicFacts.cs deleted file mode 100644 index e030180b66..0000000000 --- a/CefSharp.Test/Wpf/WpfBrowserBasicFacts.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright © 2017 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -using Xunit; -using Xunit.Abstractions; - -namespace CefSharp.Test.Wpf -{ - //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle - [Collection(CefSharpFixtureCollection.Key)] - public class WpfBrowserBasicFacts - { - private readonly ITestOutputHelper output; - private readonly CefSharpFixture fixture; - - public WpfBrowserBasicFacts(ITestOutputHelper output, CefSharpFixture fixture) - { - this.fixture = fixture; - this.output = output; - } - - //TODO: Add tests - //Investigate using https://github.com/AArnott/Xunit.StaFact for STA thread management - } -} diff --git a/CefSharp.Test/Wpf/WpfBrowserTests.cs b/CefSharp.Test/Wpf/WpfBrowserTests.cs new file mode 100644 index 0000000000..1fd1a17652 --- /dev/null +++ b/CefSharp.Test/Wpf/WpfBrowserTests.cs @@ -0,0 +1,97 @@ +// Copyright © 2017 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Threading.Tasks; +using System.Windows; +using CefSharp.Example; +using CefSharp.Wpf; +using Xunit; +using Xunit.Abstractions; + +namespace CefSharp.Test.Wpf +{ + //NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle + [Collection(CefSharpFixtureCollection.Key)] + [BrowserRefCountDebugging(typeof(ChromiumWebBrowser))] + public class WpfBrowserTests + { + private readonly ITestOutputHelper output; + private readonly CefSharpFixture fixture; + + public WpfBrowserTests(ITestOutputHelper output, CefSharpFixture fixture) + { + this.fixture = fixture; + this.output = output; + } + + [WpfFact] + public async Task ShouldWorkWhenLoadingGoogle() + { + using (var browser = new ChromiumWebBrowser(null, "www.google.com", new Size(1024, 786))) + { + await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WpfFact] + public async Task ShouldWorkWhenLoadUrlAsyncImmediately() + { + using (var browser = new ChromiumWebBrowser(null, string.Empty, new Size(1024, 786))) + { + var response = await browser.LoadUrlAsync("www.google.com"); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WpfFact] + public async Task ShouldWorkWhenLoadUrlImmediately() + { + using (var browser = new ChromiumWebBrowser()) + { + browser.LoadUrl("www.google.com"); + browser.CreateBrowser(null, new Size(1024, 786)); + + var response = await browser.WaitForInitialLoadAsync(); + var mainFrame = browser.GetMainFrame(); + + Assert.True(response.Success); + Assert.True(mainFrame.IsValid); + Assert.Contains("www.google", mainFrame.Url); + + output.WriteLine("Url {0}", mainFrame.Url); + } + } + + [WpfFact] + public async Task ShouldRespectDisposed() + { + ChromiumWebBrowser browser; + + using (browser = new ChromiumWebBrowser(null, CefExample.DefaultUrl, new Size(1024, 786))) + { + await browser.WaitForInitialLoadAsync(); + } + + Assert.True(browser.IsDisposed); + + var ex = Assert.Throws(() => + { + browser.Copy(); + }); + } + } +} diff --git a/CefSharp.Test/app.config b/CefSharp.Test/app.config index 52163d34b7..f31f20cd62 100644 --- a/CefSharp.Test/app.config +++ b/CefSharp.Test/app.config @@ -1,11 +1,30 @@ - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CefSharp.Test/packages.config b/CefSharp.Test/packages.config deleted file mode 100644 index d65b9cc089..0000000000 --- a/CefSharp.Test/packages.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/CefSharp.Test/xunit.runner.json b/CefSharp.Test/xunit.runner.json new file mode 100644 index 0000000000..96f1bd534a --- /dev/null +++ b/CefSharp.Test/xunit.runner.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "diagnosticMessages": true, + "parallelizeTestCollections": false, + "maxParallelThreads": 1, + "appDomain": "denied" +} diff --git a/CefSharp.WinForms.Example/AboutBox.cs b/CefSharp.WinForms.Example/AboutBox.cs index 4f0c43690e..19eb610ba4 100644 --- a/CefSharp.WinForms.Example/AboutBox.cs +++ b/CefSharp.WinForms.Example/AboutBox.cs @@ -77,7 +77,7 @@ public AboutBox() InitializeComponent(); ExecutingAssembly = Assembly.GetExecutingAssembly(); - Text = "About CefTest"; + Text = "About CefSharp.WinForms.Example"; labelProductName.Text = AssemblyProduct; labelVersion.Text = String.Format("Version {0} ", Cef.CefSharpVersion); labelCopyright.Text = AssemblyCopyright; diff --git a/CefSharp.WinForms.Example/BrowserForm.Designer.cs b/CefSharp.WinForms.Example/BrowserForm.Designer.cs index de33f15116..90b0548dc9 100644 --- a/CefSharp.WinForms.Example/BrowserForm.Designer.cs +++ b/CefSharp.WinForms.Example/BrowserForm.Designer.cs @@ -33,10 +33,13 @@ private void InitializeComponent() this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.newTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.hideScrollbarsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.printToPdfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.takeScreenShotMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.showDevToolsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.showDevToolsDockedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeDevToolsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -66,8 +69,8 @@ private void InitializeComponent() this.openDataUrlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.httpbinorgToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.runFileDialogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.javascriptBindingStressTestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.browserTabControl = new System.Windows.Forms.TabControl(); - this.loadExtensionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -82,8 +85,7 @@ private void InitializeComponent() this.testToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Padding = new System.Windows.Forms.Padding(9, 3, 0, 3); - this.menuStrip1.Size = new System.Drawing.Size(1095, 35); + this.menuStrip1.Size = new System.Drawing.Size(973, 28); this.menuStrip1.TabIndex = 1; this.menuStrip1.Text = "menuStrip1"; // @@ -92,22 +94,25 @@ private void InitializeComponent() this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.newTabToolStripMenuItem, this.closeTabToolStripMenuItem, + this.hideScrollbarsMenuItem, this.printToolStripMenuItem, this.printToPdfToolStripMenuItem, this.aboutToolStripMenuItem, + this.takeScreenShotMenuItem, this.showDevToolsMenuItem, + this.showDevToolsDockedToolStripMenuItem, this.closeDevToolsMenuItem, this.toolStripMenuItem3, this.exitToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(50, 29); + this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); this.fileToolStripMenuItem.Text = "&File"; // // newTabToolStripMenuItem // this.newTabToolStripMenuItem.Name = "newTabToolStripMenuItem"; this.newTabToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T))); - this.newTabToolStripMenuItem.Size = new System.Drawing.Size(239, 30); + this.newTabToolStripMenuItem.Size = new System.Drawing.Size(262, 26); this.newTabToolStripMenuItem.Text = "&New Tab"; this.newTabToolStripMenuItem.Click += new System.EventHandler(this.NewTabToolStripMenuItemClick); // @@ -115,54 +120,75 @@ private void InitializeComponent() // this.closeTabToolStripMenuItem.Name = "closeTabToolStripMenuItem"; this.closeTabToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W))); - this.closeTabToolStripMenuItem.Size = new System.Drawing.Size(239, 30); + this.closeTabToolStripMenuItem.Size = new System.Drawing.Size(262, 26); this.closeTabToolStripMenuItem.Text = "&Close Tab"; this.closeTabToolStripMenuItem.Click += new System.EventHandler(this.CloseTabToolStripMenuItemClick); // + // hideScrollbarsMenuItem + // + this.hideScrollbarsMenuItem.Name = "hideScrollbarsMenuItem"; + this.hideScrollbarsMenuItem.Size = new System.Drawing.Size(262, 26); + this.hideScrollbarsMenuItem.Text = "Hide Scrollbars"; + this.hideScrollbarsMenuItem.Click += new System.EventHandler(this.HideScrollbarsToolStripMenuItemClick); + // // printToolStripMenuItem // this.printToolStripMenuItem.Name = "printToolStripMenuItem"; - this.printToolStripMenuItem.Size = new System.Drawing.Size(239, 30); + this.printToolStripMenuItem.Size = new System.Drawing.Size(262, 26); this.printToolStripMenuItem.Text = "&Print"; this.printToolStripMenuItem.Click += new System.EventHandler(this.PrintToolStripMenuItemClick); // // printToPdfToolStripMenuItem // this.printToPdfToolStripMenuItem.Name = "printToPdfToolStripMenuItem"; - this.printToPdfToolStripMenuItem.Size = new System.Drawing.Size(239, 30); + this.printToPdfToolStripMenuItem.Size = new System.Drawing.Size(262, 26); this.printToPdfToolStripMenuItem.Text = "Print To Pdf"; this.printToPdfToolStripMenuItem.Click += new System.EventHandler(this.PrintToPdfToolStripMenuItemClick); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(239, 30); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(262, 26); this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.AboutToolStripMenuItemClick); // + // takeScreenShotMenuItem + // + this.takeScreenShotMenuItem.Name = "takeScreenShotMenuItem"; + this.takeScreenShotMenuItem.Size = new System.Drawing.Size(262, 26); + this.takeScreenShotMenuItem.Text = "Take Screenshot"; + this.takeScreenShotMenuItem.Click += new System.EventHandler(this.TakeScreenShotMenuItemClick); + // // showDevToolsMenuItem // this.showDevToolsMenuItem.Name = "showDevToolsMenuItem"; - this.showDevToolsMenuItem.Size = new System.Drawing.Size(239, 30); - this.showDevToolsMenuItem.Text = "Show Dev Tools"; + this.showDevToolsMenuItem.Size = new System.Drawing.Size(262, 26); + this.showDevToolsMenuItem.Text = "Show Dev Tools (Default)"; this.showDevToolsMenuItem.Click += new System.EventHandler(this.ShowDevToolsMenuItemClick); // + // showDevToolsDockedToolStripMenuItem + // + this.showDevToolsDockedToolStripMenuItem.Name = "showDevToolsDockedToolStripMenuItem"; + this.showDevToolsDockedToolStripMenuItem.Size = new System.Drawing.Size(262, 26); + this.showDevToolsDockedToolStripMenuItem.Text = "Show Dev Tools (Docked)"; + this.showDevToolsDockedToolStripMenuItem.Click += new System.EventHandler(this.ShowDevToolsDockedMenuItemClick); + // // closeDevToolsMenuItem // this.closeDevToolsMenuItem.Name = "closeDevToolsMenuItem"; - this.closeDevToolsMenuItem.Size = new System.Drawing.Size(239, 30); + this.closeDevToolsMenuItem.Size = new System.Drawing.Size(262, 26); this.closeDevToolsMenuItem.Text = "Close Dev Tools"; this.closeDevToolsMenuItem.Click += new System.EventHandler(this.CloseDevToolsMenuItemClick); // // toolStripMenuItem3 // this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(236, 6); + this.toolStripMenuItem3.Size = new System.Drawing.Size(259, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(239, 30); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(262, 26); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitMenuItemClick); // @@ -181,79 +207,79 @@ private void InitializeComponent() this.toolStripSeparator1, this.copySourceToClipBoardAsyncMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - this.editToolStripMenuItem.Size = new System.Drawing.Size(54, 29); + this.editToolStripMenuItem.Size = new System.Drawing.Size(49, 24); this.editToolStripMenuItem.Text = "Edit"; // // undoMenuItem // this.undoMenuItem.Name = "undoMenuItem"; - this.undoMenuItem.Size = new System.Drawing.Size(361, 30); + this.undoMenuItem.Size = new System.Drawing.Size(313, 26); this.undoMenuItem.Text = "Undo"; this.undoMenuItem.Click += new System.EventHandler(this.UndoMenuItemClick); // // redoMenuItem // this.redoMenuItem.Name = "redoMenuItem"; - this.redoMenuItem.Size = new System.Drawing.Size(361, 30); + this.redoMenuItem.Size = new System.Drawing.Size(313, 26); this.redoMenuItem.Text = "Redo"; this.redoMenuItem.Click += new System.EventHandler(this.RedoMenuItemClick); // // findMenuItem // this.findMenuItem.Name = "findMenuItem"; - this.findMenuItem.Size = new System.Drawing.Size(361, 30); + this.findMenuItem.Size = new System.Drawing.Size(313, 26); this.findMenuItem.Text = "Find"; this.findMenuItem.Click += new System.EventHandler(this.FindMenuItemClick); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(358, 6); + this.toolStripMenuItem2.Size = new System.Drawing.Size(310, 6); // // cutMenuItem // this.cutMenuItem.Name = "cutMenuItem"; - this.cutMenuItem.Size = new System.Drawing.Size(361, 30); + this.cutMenuItem.Size = new System.Drawing.Size(313, 26); this.cutMenuItem.Text = "Cut"; this.cutMenuItem.Click += new System.EventHandler(this.CutMenuItemClick); // // copyMenuItem // this.copyMenuItem.Name = "copyMenuItem"; - this.copyMenuItem.Size = new System.Drawing.Size(361, 30); + this.copyMenuItem.Size = new System.Drawing.Size(313, 26); this.copyMenuItem.Text = "Copy"; this.copyMenuItem.Click += new System.EventHandler(this.CopyMenuItemClick); // // pasteMenuItem // this.pasteMenuItem.Name = "pasteMenuItem"; - this.pasteMenuItem.Size = new System.Drawing.Size(361, 30); + this.pasteMenuItem.Size = new System.Drawing.Size(313, 26); this.pasteMenuItem.Text = "Paste"; this.pasteMenuItem.Click += new System.EventHandler(this.PasteMenuItemClick); // // deleteMenuItem // this.deleteMenuItem.Name = "deleteMenuItem"; - this.deleteMenuItem.Size = new System.Drawing.Size(361, 30); + this.deleteMenuItem.Size = new System.Drawing.Size(313, 26); this.deleteMenuItem.Text = "Delete"; this.deleteMenuItem.Click += new System.EventHandler(this.DeleteMenuItemClick); // // selectAllMenuItem // this.selectAllMenuItem.Name = "selectAllMenuItem"; - this.selectAllMenuItem.Size = new System.Drawing.Size(361, 30); + this.selectAllMenuItem.Size = new System.Drawing.Size(313, 26); this.selectAllMenuItem.Text = "Select All"; this.selectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItemClick); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(358, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(310, 6); // // copySourceToClipBoardAsyncMenuItem // this.copySourceToClipBoardAsyncMenuItem.Name = "copySourceToClipBoardAsyncMenuItem"; - this.copySourceToClipBoardAsyncMenuItem.Size = new System.Drawing.Size(361, 30); + this.copySourceToClipBoardAsyncMenuItem.Size = new System.Drawing.Size(313, 26); this.copySourceToClipBoardAsyncMenuItem.Text = "Copy Source to Clipboard (async)"; this.copySourceToClipBoardAsyncMenuItem.Click += new System.EventHandler(this.CopySourceToClipBoardAsyncClick); // @@ -264,27 +290,27 @@ private void InitializeComponent() this.zoomOutToolStripMenuItem, this.currentZoomLevelToolStripMenuItem}); this.zoomLevelToolStripMenuItem.Name = "zoomLevelToolStripMenuItem"; - this.zoomLevelToolStripMenuItem.Size = new System.Drawing.Size(116, 29); + this.zoomLevelToolStripMenuItem.Size = new System.Drawing.Size(101, 24); this.zoomLevelToolStripMenuItem.Text = "Zoom Level"; // // zoomInToolStripMenuItem // this.zoomInToolStripMenuItem.Name = "zoomInToolStripMenuItem"; - this.zoomInToolStripMenuItem.Size = new System.Drawing.Size(251, 30); + this.zoomInToolStripMenuItem.Size = new System.Drawing.Size(222, 26); this.zoomInToolStripMenuItem.Text = "Zoom In"; this.zoomInToolStripMenuItem.Click += new System.EventHandler(this.ZoomInToolStripMenuItemClick); // // zoomOutToolStripMenuItem // this.zoomOutToolStripMenuItem.Name = "zoomOutToolStripMenuItem"; - this.zoomOutToolStripMenuItem.Size = new System.Drawing.Size(251, 30); + this.zoomOutToolStripMenuItem.Size = new System.Drawing.Size(222, 26); this.zoomOutToolStripMenuItem.Text = "Zoom Out"; this.zoomOutToolStripMenuItem.Click += new System.EventHandler(this.ZoomOutToolStripMenuItemClick); // // currentZoomLevelToolStripMenuItem // this.currentZoomLevelToolStripMenuItem.Name = "currentZoomLevelToolStripMenuItem"; - this.currentZoomLevelToolStripMenuItem.Size = new System.Drawing.Size(251, 30); + this.currentZoomLevelToolStripMenuItem.Size = new System.Drawing.Size(222, 26); this.currentZoomLevelToolStripMenuItem.Text = "Current Zoom Level"; this.currentZoomLevelToolStripMenuItem.Click += new System.EventHandler(this.CurrentZoomLevelToolStripMenuItemClick); // @@ -295,20 +321,20 @@ private void InitializeComponent() this.doesElementWithIDExistToolStripMenuItem, this.listenForButtonClickToolStripMenuItem}); this.scriptToolStripMenuItem.Name = "scriptToolStripMenuItem"; - this.scriptToolStripMenuItem.Size = new System.Drawing.Size(69, 29); + this.scriptToolStripMenuItem.Size = new System.Drawing.Size(61, 24); this.scriptToolStripMenuItem.Text = "Script"; // // isTextInputToolStripMenuItem // this.isTextInputToolStripMenuItem.Name = "isTextInputToolStripMenuItem"; - this.isTextInputToolStripMenuItem.Size = new System.Drawing.Size(391, 30); + this.isTextInputToolStripMenuItem.Size = new System.Drawing.Size(342, 26); this.isTextInputToolStripMenuItem.Text = "Does active element accept text input"; this.isTextInputToolStripMenuItem.Click += new System.EventHandler(this.DoesActiveElementAcceptTextInputToolStripMenuItemClick); // // doesElementWithIDExistToolStripMenuItem // this.doesElementWithIDExistToolStripMenuItem.Name = "doesElementWithIDExistToolStripMenuItem"; - this.doesElementWithIDExistToolStripMenuItem.Size = new System.Drawing.Size(391, 30); + this.doesElementWithIDExistToolStripMenuItem.Size = new System.Drawing.Size(342, 26); this.doesElementWithIDExistToolStripMenuItem.Text = "Does element with ID exist"; this.doesElementWithIDExistToolStripMenuItem.Click += new System.EventHandler(this.DoesElementWithIdExistToolStripMenuItemClick); // @@ -318,20 +344,20 @@ private void InitializeComponent() this.goToDemoPageToolStripMenuItem, this.injectJavascriptCodeToolStripMenuItem}); this.listenForButtonClickToolStripMenuItem.Name = "listenForButtonClickToolStripMenuItem"; - this.listenForButtonClickToolStripMenuItem.Size = new System.Drawing.Size(391, 30); + this.listenForButtonClickToolStripMenuItem.Size = new System.Drawing.Size(342, 26); this.listenForButtonClickToolStripMenuItem.Text = "Listen for button click"; // // goToDemoPageToolStripMenuItem // this.goToDemoPageToolStripMenuItem.Name = "goToDemoPageToolStripMenuItem"; - this.goToDemoPageToolStripMenuItem.Size = new System.Drawing.Size(263, 30); + this.goToDemoPageToolStripMenuItem.Size = new System.Drawing.Size(233, 26); this.goToDemoPageToolStripMenuItem.Text = "Go to demo page"; this.goToDemoPageToolStripMenuItem.Click += new System.EventHandler(this.GoToDemoPageToolStripMenuItemClick); // // injectJavascriptCodeToolStripMenuItem // this.injectJavascriptCodeToolStripMenuItem.Name = "injectJavascriptCodeToolStripMenuItem"; - this.injectJavascriptCodeToolStripMenuItem.Size = new System.Drawing.Size(263, 30); + this.injectJavascriptCodeToolStripMenuItem.Size = new System.Drawing.Size(233, 26); this.injectJavascriptCodeToolStripMenuItem.Text = "Inject Javascript code"; this.injectJavascriptCodeToolStripMenuItem.Click += new System.EventHandler(this.InjectJavascriptCodeToolStripMenuItemClick); // @@ -341,59 +367,59 @@ private void InitializeComponent() this.openDataUrlToolStripMenuItem, this.httpbinorgToolStripMenuItem, this.runFileDialogToolStripMenuItem, - this.loadExtensionsToolStripMenuItem}); + this.javascriptBindingStressTestToolStripMenuItem}); this.testToolStripMenuItem.Name = "testToolStripMenuItem"; - this.testToolStripMenuItem.Size = new System.Drawing.Size(54, 29); + this.testToolStripMenuItem.Size = new System.Drawing.Size(49, 24); this.testToolStripMenuItem.Text = "Test"; // // openDataUrlToolStripMenuItem // this.openDataUrlToolStripMenuItem.Name = "openDataUrlToolStripMenuItem"; - this.openDataUrlToolStripMenuItem.Size = new System.Drawing.Size(252, 30); + this.openDataUrlToolStripMenuItem.Size = new System.Drawing.Size(283, 26); this.openDataUrlToolStripMenuItem.Text = "Open Data Url"; this.openDataUrlToolStripMenuItem.Click += new System.EventHandler(this.OpenDataUrlToolStripMenuItemClick); // // httpbinorgToolStripMenuItem // this.httpbinorgToolStripMenuItem.Name = "httpbinorgToolStripMenuItem"; - this.httpbinorgToolStripMenuItem.Size = new System.Drawing.Size(252, 30); + this.httpbinorgToolStripMenuItem.Size = new System.Drawing.Size(283, 26); this.httpbinorgToolStripMenuItem.Text = "httpbin.org"; this.httpbinorgToolStripMenuItem.Click += new System.EventHandler(this.OpenHttpBinOrgToolStripMenuItemClick); // // runFileDialogToolStripMenuItem // this.runFileDialogToolStripMenuItem.Name = "runFileDialogToolStripMenuItem"; - this.runFileDialogToolStripMenuItem.Size = new System.Drawing.Size(252, 30); + this.runFileDialogToolStripMenuItem.Size = new System.Drawing.Size(283, 26); this.runFileDialogToolStripMenuItem.Text = "Run File Dialog"; this.runFileDialogToolStripMenuItem.Click += new System.EventHandler(this.RunFileDialogToolStripMenuItemClick); // + // javascriptBindingStressTestToolStripMenuItem + // + this.javascriptBindingStressTestToolStripMenuItem.Name = "javascriptBindingStressTestToolStripMenuItem"; + this.javascriptBindingStressTestToolStripMenuItem.Size = new System.Drawing.Size(283, 26); + this.javascriptBindingStressTestToolStripMenuItem.Text = "Javascript Binding Stress Test"; + this.javascriptBindingStressTestToolStripMenuItem.Click += new System.EventHandler(this.JavascriptBindingStressTestToolStripMenuItemClick); + // // browserTabControl // this.browserTabControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.browserTabControl.Location = new System.Drawing.Point(0, 35); - this.browserTabControl.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.browserTabControl.Location = new System.Drawing.Point(0, 28); + this.browserTabControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.browserTabControl.Name = "browserTabControl"; this.browserTabControl.SelectedIndex = 0; - this.browserTabControl.Size = new System.Drawing.Size(1095, 719); + this.browserTabControl.Size = new System.Drawing.Size(973, 575); this.browserTabControl.TabIndex = 2; // - // loadExtensionsToolStripMenuItem - // - this.loadExtensionsToolStripMenuItem.Name = "loadExtensionsToolStripMenuItem"; - this.loadExtensionsToolStripMenuItem.Size = new System.Drawing.Size(252, 30); - this.loadExtensionsToolStripMenuItem.Text = "Load Example Extension"; - this.loadExtensionsToolStripMenuItem.Click += new System.EventHandler(this.LoadExtensionsToolStripMenuItemClick); - // // BrowserForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1095, 754); + this.ClientSize = new System.Drawing.Size(973, 603); this.Controls.Add(this.browserTabControl); this.Controls.Add(this.menuStrip1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; - this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "BrowserForm"; this.Text = "BrowserForm"; this.menuStrip1.ResumeLayout(false); @@ -443,6 +469,9 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem openDataUrlToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem httpbinorgToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem runFileDialogToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem loadExtensionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem javascriptBindingStressTestToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem showDevToolsDockedToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem hideScrollbarsMenuItem; + private System.Windows.Forms.ToolStripMenuItem takeScreenShotMenuItem; } } diff --git a/CefSharp.WinForms.Example/BrowserForm.cs b/CefSharp.WinForms.Example/BrowserForm.cs index 1d0855e062..afb82d6615 100644 --- a/CefSharp.WinForms.Example/BrowserForm.cs +++ b/CefSharp.WinForms.Example/BrowserForm.cs @@ -4,12 +4,16 @@ using System; using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; using System.IO; +using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Forms; using CefSharp.Example; using CefSharp.Example.Callback; using CefSharp.Example.Handlers; +using CefSharp.WinForms.Host; namespace CefSharp.WinForms.Example { @@ -26,7 +30,7 @@ public BrowserForm(bool multiThreadedMessageLoopEnabled) { InitializeComponent(); - var bitness = Environment.Is64BitProcess ? "x64" : "x86"; + var bitness = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); Text = "CefSharp.WinForms.Example - " + bitness; WindowState = FormWindowState.Maximized; @@ -39,6 +43,19 @@ public BrowserForm(bool multiThreadedMessageLoopEnabled) this.multiThreadedMessageLoopEnabled = multiThreadedMessageLoopEnabled; } + public IContainer Components + { + get + { + if (components == null) + { + components = new Container(); + } + + return components; + } + } + private void BrowserFormLoad(object sender, EventArgs e) { AddTab(CefExample.DefaultUrl); @@ -48,16 +65,22 @@ private void BrowserFormLoad(object sender, EventArgs e) /// Used to add a Popup browser as a Tab /// /// - public void AddTab(Control browserHostControl, string url) + public void AddTab(ChromiumHostControl browserHostControl, string url) { browserTabControl.SuspendLayout(); + var browser = new BrowserTabUserControl(browserHostControl) + { + Dock = DockStyle.Fill, + Bounds = browserTabControl.Bounds + }; + var tabPage = new TabPage(url) { Dock = DockStyle.Fill }; - tabPage.Controls.Add(browserHostControl); + tabPage.Controls.Add(browser); browserTabControl.TabPages.Add(tabPage); @@ -74,6 +97,7 @@ private void AddTab(string url, int? insertIndex = null) var browser = new BrowserTabUserControl(AddTab, url, multiThreadedMessageLoopEnabled) { Dock = DockStyle.Fill, + Bounds = browserTabControl.Bounds }; var tabPage = new TabPage(url) @@ -117,22 +141,18 @@ private void AboutToolStripMenuItemClick(object sender, EventArgs e) new AboutBox().ShowDialog(); } - public void RemoveTab(IntPtr windowHandle) + public void RemoveTab(ChromiumHostControl ctrl) { - var parentControl = FromChildHandle(windowHandle); - if (!parentControl.IsDisposed) + if (!ctrl.IsDisposed) { - if (parentControl.Parent is TabPage tabPage) + var tabPage = ctrl.GetParentOfType(); + + if(tabPage == null) { - browserTabControl.TabPages.Remove(tabPage); + throw new Exception("Unable to find parent TabPage"); } - else if (parentControl.Parent is Panel panel) - { - var browserTabUserControl = (BrowserTabUserControl)panel.Parent; - var tab = (TabPage)browserTabUserControl.Parent; - browserTabControl.TabPages.Remove(tab); - } + browserTabControl.TabPages.Remove(tabPage); } } @@ -273,54 +293,49 @@ private void PrintToolStripMenuItemClick(object sender, EventArgs e) } } - private void ShowDevToolsMenuItemClick(object sender, EventArgs e) + private async void ShowDevToolsMenuItemClick(object sender, EventArgs e) { var control = GetCurrentTabControl(); if (control != null) { - control.Browser.ShowDevTools(); - - //EXPERIMENTAL Example below shows how to use a control to host DevTools - //(in this case it's added as a new TabPage) - // NOTE: Does not currently move/resize correctly - //var tabPage = new TabPage("DevTools") - //{ - // Dock = DockStyle.Fill - //}; - - //var panel = new Panel - //{ - // Dock = DockStyle.Fill - //}; - - ////We need to call CreateControl as we need the Handle later - //panel.CreateControl(); - - //tabPage.Controls.Add(panel); - - //browserTabControl.TabPages.Add(tabPage); - - ////Make newly created tab active - //browserTabControl.SelectedTab = tabPage; + var isDevToolsOpen = await control.CheckIfDevToolsIsOpenAsync(); + if (!isDevToolsOpen) + { + control.Browser.ShowDevTools(); + } + } + } - ////Grab the client rect - //var rect = panel.ClientRectangle; - //var webBrowser = control.Browser; - //var browser = webBrowser.GetBrowser().GetHost(); - //var windowInfo = new WindowInfo(); - ////DevTools becomes a child of the panel, we use it's dimesions - //windowInfo.SetAsChild(panel.Handle, rect.Left, rect.Top, rect.Right, rect.Bottom); - ////Show DevTools in our panel - //browser.ShowDevTools(windowInfo); + private async void ShowDevToolsDockedMenuItemClick(object sender, EventArgs e) + { + var control = GetCurrentTabControl(); + if (control != null) + { + var isDevToolsOpen = await control.CheckIfDevToolsIsOpenAsync(); + if (!isDevToolsOpen) + { + var chromiumWebBrowser = control.Browser as ChromiumWebBrowser; + if (chromiumWebBrowser != null && chromiumWebBrowser.LifeSpanHandler != null) + { + control.ShowDevToolsDocked(); + } + } } } - private void CloseDevToolsMenuItemClick(object sender, EventArgs e) + private async void CloseDevToolsMenuItemClick(object sender, EventArgs e) { var control = GetCurrentTabControl(); if (control != null) { - control.Browser.CloseDevTools(); + //Check if DevTools is open before closing, this isn't strictly required + //If DevTools isn't open and you call CloseDevTools it's a No-Op, so prefectly + //safe to call without checking + var isDevToolsOpen = await control.CheckIfDevToolsIsOpenAsync(); + if (isDevToolsOpen) + { + control.Browser.CloseDevTools(); + } } } @@ -468,7 +483,7 @@ private void GoToDemoPageToolStripMenuItemClick(object sender, EventArgs e) var control = GetCurrentTabControl(); if (control != null) { - control.Browser.Load("custom://cefsharp/ScriptedMethodsTest.html"); + control.Browser.LoadUrl("custom://cefsharp/ScriptedMethodsTest.html"); } } @@ -535,7 +550,7 @@ private void OpenHttpBinOrgToolStripMenuItemClick(object sender, EventArgs e) var control = GetCurrentTabControl(); if (control != null) { - control.Browser.Load("https://httpbin.org/"); + control.Browser.LoadUrl("https://httpbin.org/"); } } @@ -544,60 +559,72 @@ private void RunFileDialogToolStripMenuItemClick(object sender, EventArgs e) var control = GetCurrentTabControl(); if (control != null) { - control.Browser.GetBrowserHost().RunFileDialog(CefFileDialogMode.Open, "Open", null, new List { "*.*" }, 0, new RunFileDialogCallback()); + control.Browser.GetBrowserHost().RunFileDialog(CefFileDialogMode.Open, "Open", null, new List { "*.*" }, new RunFileDialogCallback()); } } - private void LoadExtensionsToolStripMenuItemClick(object sender, EventArgs e) + private void JavascriptBindingStressTestToolStripMenuItemClick(object sender, EventArgs e) { var control = GetCurrentTabControl(); if (control != null) { - //The sample extension only works for http(s) schemes - if (control.Browser.Address.StartsWith("http")) + control.Browser.LoadUrl(CefExample.BindingTestUrl); + control.Browser.LoadingStateChanged += (o, args) => { - var requestContext = control.Browser.GetBrowserHost().RequestContext; - - var dir = Path.Combine(AppContext.BaseDirectory, @"..\..\..\..\CefSharp.Example\Extensions"); - dir = Path.GetFullPath(dir); - if (!Directory.Exists(dir)) + if (args.IsLoading == false) { - throw new DirectoryNotFoundException("Unable to locate example extensions folder - " + dir); - } - - var extensionHandler = new ExtensionHandler - { - LoadExtensionPopup = (url) => + Task.Delay(10000).ContinueWith(t => { - BeginInvoke(new Action(() => + if (control.Browser != null) { - var extensionForm = new Form(); + control.Browser.Reload(); + } + }); + } + }; + } + } - var extensionBrowser = new ChromiumWebBrowser(url); - //extensionBrowser.IsBrowserInitializedChanged += (s, args) => - //{ - // extensionBrowser.ShowDevTools(); - //}; + private void HideScrollbarsToolStripMenuItemClick(object sender, EventArgs e) + { + var control = GetCurrentTabControl(); - extensionForm.Controls.Add(extensionBrowser); + _ = control?.HideScrollbarsAsync(); + } - extensionForm.Show(this); - })); - }, - GetActiveBrowser = (extension, isIncognito) => - { - //Return the active browser for which the extension will act upon - return control.Browser.GetBrowser(); - } - }; + private async void TakeScreenShotMenuItemClick(object sender, EventArgs e) + { + var control = GetCurrentTabControl(); - requestContext.LoadExtensionsFromDirectory(dir, extensionHandler); - } - else - { - MessageBox.Show("The sample extension only works with http(s) schemes, please load a different website and try again", "Unable to load Extension"); - } + if(control == null) + { + return; } + + var chromiumWebBrowser = (ChromiumWebBrowser)control.Browser; + + var contentSize = await chromiumWebBrowser.GetContentSizeAsync(); + + //Capture current scrollable area + var viewPort = new DevTools.Page.Viewport + { + Width = contentSize.Width, + Height = contentSize.Height, + }; + + var data = await chromiumWebBrowser.CaptureScreenshotAsync(viewPort: viewPort, captureBeyondViewport: true); + + // Make a file to save it to (e.g. C:\Users\[user]\Desktop\CefSharp screenshot.png) + var screenshotPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "CefSharp screenshot" + DateTime.Now.Ticks + ".png"); + + File.WriteAllBytes(screenshotPath, data); + + // Tell Windows to launch the saved image. + Process.Start(new ProcessStartInfo(screenshotPath) + { + // UseShellExecute is false by default on .NET Core. + UseShellExecute = true + }); } } } diff --git a/CefSharp.WinForms.Example/BrowserTabUserControl.Designer.cs b/CefSharp.WinForms.Example/BrowserTabUserControl.Designer.cs index a9db8a97d0..51d1aa3aff 100644 --- a/CefSharp.WinForms.Example/BrowserTabUserControl.Designer.cs +++ b/CefSharp.WinForms.Example/BrowserTabUserControl.Designer.cs @@ -27,9 +27,13 @@ private void InitializeComponent() this.forwardButton = new System.Windows.Forms.ToolStripButton(); this.urlTextBox = new System.Windows.Forms.ToolStripTextBox(); this.goButton = new System.Windows.Forms.ToolStripButton(); + this.browserSplitContainer = new System.Windows.Forms.SplitContainer(); this.browserPanel = new System.Windows.Forms.Panel(); this.toolStrip2.SuspendLayout(); this.toolStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.browserSplitContainer)).BeginInit(); + this.browserSplitContainer.Panel1.SuspendLayout(); + this.browserSplitContainer.SuspendLayout(); this.SuspendLayout(); // // toolStrip2 @@ -154,17 +158,31 @@ private void InitializeComponent() this.goButton.Text = "Go"; this.goButton.Click += new System.EventHandler(this.GoButtonClick); // + // browserSplitContainer + // + this.browserSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.browserSplitContainer.Location = new System.Drawing.Point(0, 25); + this.browserSplitContainer.Name = "browserSplitContainer"; + // + // browserSplitContainer.Panel1 + // + this.browserSplitContainer.Panel1.Controls.Add(this.browserPanel); + this.browserSplitContainer.Panel2Collapsed = true; + this.browserSplitContainer.Size = new System.Drawing.Size(730, 439); + this.browserSplitContainer.SplitterDistance = 481; + this.browserSplitContainer.TabIndex = 2; + // // browserPanel // this.browserPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.browserPanel.Location = new System.Drawing.Point(0, 25); + this.browserPanel.Location = new System.Drawing.Point(0, 0); this.browserPanel.Name = "browserPanel"; this.browserPanel.Size = new System.Drawing.Size(730, 439); - this.browserPanel.TabIndex = 2; + this.browserPanel.TabIndex = 3; // // BrowserTabUserControl // - this.Controls.Add(this.browserPanel); + this.Controls.Add(this.browserSplitContainer); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.statusLabel); this.Controls.Add(this.outputLabel); @@ -175,6 +193,9 @@ private void InitializeComponent() this.toolStrip2.PerformLayout(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); + this.browserSplitContainer.Panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.browserSplitContainer)).EndInit(); + this.browserSplitContainer.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -195,6 +216,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripButton findNextButton; private System.Windows.Forms.ToolStripButton findCloseButton; private System.Windows.Forms.Label statusLabel; + private System.Windows.Forms.SplitContainer browserSplitContainer; private System.Windows.Forms.Panel browserPanel; } -} \ No newline at end of file +} diff --git a/CefSharp.WinForms.Example/BrowserTabUserControl.cs b/CefSharp.WinForms.Example/BrowserTabUserControl.cs index d54b268bcd..1aafc64db4 100644 --- a/CefSharp.WinForms.Example/BrowserTabUserControl.cs +++ b/CefSharp.WinForms.Example/BrowserTabUserControl.cs @@ -12,17 +12,35 @@ using CefSharp.Example.Handlers; using CefSharp.Example.JavascriptBinding; using CefSharp.WinForms.Example.Handlers; -using CefSharp.WinForms.Internals; +using CefSharp.WinForms.Experimental; +using CefSharp.WinForms.Handler; +using CefSharp.WinForms.Host; namespace CefSharp.WinForms.Example { public partial class BrowserTabUserControl : UserControl { - public IWinFormsWebBrowser Browser { get; private set; } - private IntPtr browserHandle; - private ChromeWidgetMessageInterceptor messageInterceptor; + public IWinFormsChromiumWebBrowser Browser { get; private set; } + private ChromiumWidgetNativeWindow messageInterceptor; private bool multiThreadedMessageLoopEnabled; + public BrowserTabUserControl(ChromiumHostControl chromiumHostControl) + { + InitializeComponent(); + + Browser = chromiumHostControl; + + browserPanel.Controls.Add(chromiumHostControl); + + chromiumHostControl.LoadingStateChanged += OnBrowserLoadingStateChanged; + chromiumHostControl.ConsoleMessage += OnBrowserConsoleMessage; + chromiumHostControl.TitleChanged += OnBrowserTitleChanged; + chromiumHostControl.AddressChanged += OnBrowserAddressChanged; + chromiumHostControl.StatusMessage += OnBrowserStatusMessage; + chromiumHostControl.IsBrowserInitializedChanged += OnIsBrowserInitializedChanged; + chromiumHostControl.LoadError += OnLoadError; + } + public BrowserTabUserControl(Action openNewTab, string url, bool multiThreadedMessageLoopEnabled) { InitializeComponent(); @@ -39,18 +57,80 @@ public BrowserTabUserControl(Action openNewTab, string url, bool m browser.MenuHandler = new MenuHandler(); browser.RequestHandler = new WinFormsRequestHandler(openNewTab); browser.JsDialogHandler = new JsDialogHandler(); - browser.DownloadHandler = new DownloadHandler(); + browser.DownloadHandler = Fluent.DownloadHandler.AskUser(); + browser.AudioHandler = new CefSharp.Handler.AudioHandler(); + browser.FrameHandler = new CefSharp.Handler.FrameHandler(); + browser.PermissionHandler = new ExamplePermissionHandler(); + if (multiThreadedMessageLoopEnabled) { browser.KeyboardHandler = new KeyboardHandler(); } - else - { - //When MultiThreadedMessageLoop is disabled we don't need the - //CefSharp focus handler implementation. - browser.FocusHandler = null; - } - //browser.LifeSpanHandler = new LifeSpanHandler(); + + //The CefSharp.WinForms.Handler.LifeSpanHandler implementation + //allows for Popups to be hosted in Controls/Tabs + //This example also demonstrates docking DevTools in a SplitPanel + browser.LifeSpanHandler = CefSharp.WinForms.Handler.LifeSpanHandler + .Create() + .OnBeforePopupCreated((chromiumWebBrowser, b, frame, targetUrl, targetFrameName, targetDisposition, userGesture, browserSettings) => + { + //Can cancel opening popup based on Url if required. + if(targetUrl?.StartsWith(CefExample.BaseUrl + "/cancelme.html") == true) + { + return PopupCreation.Cancel; + } + + return PopupCreation.Continue; + }) + .OnPopupCreated((ctrl, targetUrl) => + { + //Don't try using ctrl.FindForm() here as + //the control hasn't been attached to a parent yet. + if (FindForm() is BrowserForm owner) + { + owner.AddTab(ctrl, targetUrl); + } + }) + .OnPopupDestroyed((ctrl, popupBrowser) => + { + //If we docked DevTools (hosted it ourselves rather than the default popup) + //Used when the BrowserTabUserControl.ShowDevToolsDocked method is called + if (popupBrowser.MainFrame.Url.Equals("devtools://devtools/devtools_app.html")) + { + //Dispose of the parent control we used to host DevTools, this will release the DevTools window handle + //and the ILifeSpanHandler.OnBeforeClose() will be call after. + ctrl.Dispose(); + } + else + { + //If browser is disposed or the handle has been released then we don't + //need to remove the tab in this example. The user likely used the + // File -> Close Tab menu option which also calls BrowserForm.RemoveTab + if (!ctrl.IsDisposed && ctrl.IsHandleCreated) + { + if (ctrl.FindForm() is BrowserForm owner) + { + owner.RemoveTab(ctrl); + } + + ctrl.Dispose(); + } + } + }) + .OnPopupBrowserCreated((ctrl, popupBrowser) => + { + //The host control maybe null if the popup was hosted in a native Window e.g. Devtools by default + if(ctrl == null) + { + return; + } + + //You can access all the core browser functionality via IBrowser + //frames, browwser host, etc. + var isPopup = popupBrowser.IsPopup; + }) + .Build(); + browser.LoadingStateChanged += OnBrowserLoadingStateChanged; browser.ConsoleMessage += OnBrowserConsoleMessage; browser.TitleChanged += OnBrowserTitleChanged; @@ -59,8 +139,12 @@ public BrowserTabUserControl(Action openNewTab, string url, bool m browser.IsBrowserInitializedChanged += OnIsBrowserInitializedChanged; browser.LoadError += OnLoadError; +#if NETCOREAPP + browser.JavascriptObjectRepository.Register("boundAsync", new AsyncBoundObject(), options: BindingOptions.DefaultBinder); +#else browser.JavascriptObjectRepository.Register("bound", new BoundObject(), isAsync: false, options: BindingOptions.DefaultBinder); browser.JavascriptObjectRepository.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: BindingOptions.DefaultBinder); +#endif //If you call CefSharp.BindObjectAsync in javascript and pass in the name of an object which is not yet //bound, then ResolveObject will be called, you can then register it @@ -69,27 +153,32 @@ public BrowserTabUserControl(Action openNewTab, string url, bool m var repo = e.ObjectRepository; if (e.ObjectName == "boundAsync2") { +#if NETCOREAPP + repo.Register("boundAsync2", new AsyncBoundObject(), options: BindingOptions.DefaultBinder); +#else repo.Register("boundAsync2", new AsyncBoundObject(), isAsync: true, options: BindingOptions.DefaultBinder); +#endif } }; browser.RenderProcessMessageHandler = new RenderProcessMessageHandler(); - browser.DisplayHandler = new DisplayHandler(); + browser.DisplayHandler = new WinFormsDisplayHandler(); //browser.MouseDown += OnBrowserMouseClick; - browser.HandleCreated += OnBrowserHandleCreated; - //browser.ResourceHandlerFactory = new FlashResourceHandlerFactory(); this.multiThreadedMessageLoopEnabled = multiThreadedMessageLoopEnabled; var eventObject = new ScriptedMethodsBoundObject(); eventObject.EventArrived += OnJavascriptEventArrived; // Use the default of camelCaseJavascriptNames // .Net methods starting with a capitol will be translated to starting with a lower case letter when called from js +#if !NETCOREAPP browser.JavascriptObjectRepository.Register("boundEvent", eventObject, isAsync: false, options: BindingOptions.DefaultBinder); +#endif CefExample.RegisterTestResources(browser); - var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion); - DisplayOutput(version); + var version = string.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion); + //Set label directly, don't use DisplayOutput as call would be a NOOP (no valid handle yet). + outputLabel.Text = version; } /// @@ -115,11 +204,6 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - private void OnBrowserHandleCreated(object sender, EventArgs e) - { - browserHandle = ((ChromiumWebBrowser)Browser).Handle; - } - private void OnBrowserMouseClick(object sender, MouseEventArgs e) { MessageBox.Show("Mouse Clicked" + e.X + ";" + e.Y + ";" + e.Button); @@ -127,7 +211,28 @@ private void OnBrowserMouseClick(object sender, MouseEventArgs e) private void OnLoadError(object sender, LoadErrorEventArgs args) { - DisplayOutput("Load Error:" + args.ErrorCode + ";" + args.ErrorText); + //Aborted is generally safe to ignore + //Actions like starting a download will trigger an Aborted error + //which doesn't require any user action. + if(args.ErrorCode == CefErrorCode.Aborted) + { + return; + } + + //Don't display an error for external protocols such as mailto which + //we might want to open in the default viewer + if (args.ErrorCode == CefErrorCode.UnknownUrlScheme && args.Frame.Url.StartsWith("mailto")) + { + return; + } + + var errorHtml = string.Format("

Failed to load URL {0} with error {1} ({2}).

", + args.FailedUrl, args.ErrorText, args.ErrorCode); + + _ = args.Browser.SetMainFrameDocumentContentAsync(errorHtml); + + //AddressChanged isn't called for failed Urls so we need to manually update the Url TextBox + this.InvokeOnUiThreadIfRequired(() => urlTextBox.Text = args.FailedUrl); } private void OnBrowserConsoleMessage(object sender, ConsoleMessageEventArgs args) @@ -205,9 +310,7 @@ private void SetIsLoading(bool isLoading) private void OnIsBrowserInitializedChanged(object sender, EventArgs e) { - //Get the underlying browser host wrapper - var browserHost = Browser.GetBrowser().GetHost(); - var requestContext = browserHost.RequestContext; + var requestContext = Browser.GetRequestContext(); string errorMessage; // Browser must be initialized before getting/setting preferences var success = requestContext.SetPreference("enable_do_not_track", true, out errorMessage); @@ -253,20 +356,21 @@ private void SetupMessageInterceptor() while (true) { IntPtr chromeWidgetHostHandle; - if (ChromeWidgetHandleFinder.TryFindHandle(browserHandle, out chromeWidgetHostHandle)) + if (ChromiumRenderWidgetHandleFinder.TryFindHandle(Browser.BrowserCore, out chromeWidgetHostHandle)) { - messageInterceptor = new ChromeWidgetMessageInterceptor((Control)Browser, chromeWidgetHostHandle, message => + messageInterceptor = new ChromiumWidgetNativeWindow((Control)Browser, chromeWidgetHostHandle); + + messageInterceptor.OnWndProc(message => { const int WM_MOUSEACTIVATE = 0x0021; const int WM_NCLBUTTONDOWN = 0x00A1; - const int WM_LBUTTONDOWN = 0x0201; const int WM_DESTROY = 0x0002; // Render process switch happened, need to find the new handle if (message.Msg == WM_DESTROY) { SetupMessageInterceptor(); - return; + return false; } if (message.Msg == WM_MOUSEACTIVATE) @@ -301,6 +405,8 @@ private void SetupMessageInterceptor() // Console.WriteLine("WM_MOUSELEAVE"); // break; //} + + return false; }); break; @@ -321,7 +427,7 @@ private void SetupMessageInterceptor() private void DisplayOutput(string output) { - this.InvokeOnUiThreadIfRequired(() => outputLabel.Text = output); + outputLabel.InvokeOnUiThreadIfRequired(() => outputLabel.Text = output); } private void HandleToolStripLayout(object sender, LayoutEventArgs e) @@ -339,7 +445,7 @@ private void HandleToolStripLayout() width -= item.Width - item.Margin.Horizontal; } } - urlTextBox.Width = Math.Max(0, width - urlTextBox.Margin.Horizontal - 18); + urlTextBox.Width = Math.Max(100, width - urlTextBox.Margin.Horizontal - goButton.Width); } private void GoButtonClick(object sender, EventArgs e) @@ -371,11 +477,30 @@ private void LoadUrl(string url) { if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) { - Browser.Load(url); + Browser.LoadUrl(url); } + else + { + var searchUrl = "https://www.google.com/search?q=" + Uri.EscapeDataString(url); + + Browser.LoadUrl(searchUrl); + } + + //Give the browser focus after starting navigation + if (Browser.CanSelect) + { + Browser.Select(); + } + } + + public async Task HideScrollbarsAsync() + { + var devTools = Browser.GetDevToolsClient(); + + await devTools.Emulation.SetScrollbarsHiddenAsync(true); } - public async void CopySourceToClipBoardAsync() + public async Task CopySourceToClipBoardAsync() { var htmlSource = await Browser.GetSourceAsync(); @@ -411,7 +536,7 @@ private void Find(bool next) { if (!string.IsNullOrEmpty(findTextBox.Text)) { - Browser.Find(0, findTextBox.Text, next, false, false); + Browser.Find(findTextBox.Text, next, false, false); } } @@ -434,5 +559,45 @@ private void FindCloseButtonClick(object sender, EventArgs e) { ToggleBottomToolStrip(); } + + //Example of DevTools docked within the existing UserControl, + //in this example it's hosted in a Panel with a SplitContainer + public void ShowDevToolsDocked() + { + if (browserSplitContainer.Panel2Collapsed) + { + browserSplitContainer.Panel2Collapsed = false; + } + + //Find devToolsControl in Controls collection + Control devToolsControl = null; + devToolsControl = browserSplitContainer.Panel2.Controls.Find(nameof(devToolsControl), false).FirstOrDefault(); + + if (devToolsControl == null || devToolsControl.IsDisposed) + { + devToolsControl = Browser.ShowDevToolsDocked( + parentControl: browserSplitContainer.Panel2, + controlName: nameof(devToolsControl)); + + EventHandler devToolsPanelDisposedHandler = null; + devToolsPanelDisposedHandler = (s, e) => + { + browserSplitContainer.Panel2.Controls.Remove(devToolsControl); + browserSplitContainer.Panel2Collapsed = true; + devToolsControl.Disposed -= devToolsPanelDisposedHandler; + }; + + //Subscribe for devToolsPanel dispose event + devToolsControl.Disposed += devToolsPanelDisposedHandler; + } + } + + public Task CheckIfDevToolsIsOpenAsync() + { + return Cef.UIThreadTaskFactory.StartNew(() => + { + return Browser.GetBrowserHost().HasDevTools; + }); + } } } diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index b636cdca33..2898e2545c 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -1,192 +1,52 @@ - - - - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C043FFF7-5F71-4FFC-989A-E09E18548589} - WinExe - Properties - CefSharp.WinForms.Example - CefSharp.WinForms.Example - v4.6.2 - 512 - - - - - - - 3.5 - Client - - - - - - x64 - bin\x64\Debug\ - false - - - x64 - bin\x64\Release\ - false - - - true - bin\x86\Debug\ - x86 - MinimumRecommendedRules.ruleset - false - DEBUG - - - bin\x86\Release\ - x86 - MinimumRecommendedRules.ruleset - false - - - app.manifest - - - - - 3.5 - - - - - - - - - - Form - - - AboutBox.cs - - - Form - - - BrowserForm.cs - - - UserControl - - - BrowserTabUserControl.cs - - - - - - - - - - - Form - - - InputBox.cs - - - Form - - - SimpleBrowserForm.cs - - - Form - - - TabulationDemoForm.cs - - - - - - True - True - Resources.resx - - - - - AboutBox.cs - Designer - - - BrowserForm.cs - Designer - - - BrowserTabUserControl.cs - Designer - - - InputBox.cs - - - SimpleBrowserForm.cs - - - TabulationDemoForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - {7b495581-2271-4f41-9476-acb86e8c864f} - CefSharp.Core - - - {a4394e7b-1155-43a6-989e-8ab72dddc9e4} - CefSharp.Example - - - {882505ad-246d-402a-8414-347efb8e2c8d} - CefSharp.WinForms - - - {a55848cc-10e7-40cb-addb-04740b16dd43} - CefSharp - - - - - + + + net472 + WinExe + x86;x64 + false + true + MinimumRecommendedRules.ruleset + app.manifest + CefSharp.WinForms.Example.Program + false + win-x86;win-x64 + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj new file mode 100644 index 0000000000..6aac8bb15e --- /dev/null +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj @@ -0,0 +1,70 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + WinExe + net6.0-windows + CefSharp.WinForms.Example + CefSharp.WinForms.Example + true + false + app.manifest + MinimumRecommendedRules.ruleset + x86;x64;arm64 + + arm64 + + Major + win-x86;win-x64 + win-x86 + win-x64 + win-arm64 + false + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + True + True + Resources.resx + + + + + PreserveNewest + + + + + + + + + + + + + diff --git a/CefSharp.WinForms.Example/ChromeWidgetMessageInterceptor.cs b/CefSharp.WinForms.Example/ChromeWidgetMessageInterceptor.cs deleted file mode 100644 index 015e11f0b9..0000000000 --- a/CefSharp.WinForms.Example/ChromeWidgetMessageInterceptor.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright © 2015 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -using System; -using System.Runtime.InteropServices; -using System.Text; -using System.Windows.Forms; - -namespace CefSharp.WinForms.Example -{ - /// - /// Intercepts Windows messages sent to the ChromiumWebBrowser control's widget sub-window. - /// - /// It is necessary to listen to the widget sub-window because it receives all Windows messages - /// and forwards them to CEF, rather than the ChromiumWebBrowser.Handle. - /// - /// The supplied Action delegate is fired upon each message. - /// - internal class ChromeWidgetMessageInterceptor : NativeWindow - { - private Action forwardAction; - - internal ChromeWidgetMessageInterceptor(Control browser, IntPtr chromeWidgetHostHandle, Action forwardAction) - { - AssignHandle(chromeWidgetHostHandle); - - browser.HandleDestroyed += BrowserHandleDestroyed; - - this.forwardAction = forwardAction; - } - - private void BrowserHandleDestroyed(object sender, EventArgs e) - { - ReleaseHandle(); - - var browser = (Control)sender; - - browser.HandleDestroyed -= BrowserHandleDestroyed; - forwardAction = null; - } - - protected override void WndProc(ref Message m) - { - base.WndProc(ref m); - - if (forwardAction != null) - { - forwardAction(m); - } - } - } - - internal static class ChromeWidgetHandleFinder - { - private delegate bool EnumWindowProc(IntPtr hwnd, IntPtr lParam); - - [DllImport("user32")] - [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr lParam); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - public static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount); - - private class ClassDetails - { - public IntPtr DescendantFound { get; set; } - } - - private static bool EnumWindow(IntPtr hWnd, IntPtr lParam) - { - const string chromeWidgetHostClassName = "Chrome_RenderWidgetHostHWND"; - - var buffer = new StringBuilder(128); - GetClassName(hWnd, buffer, buffer.Capacity); - - if (buffer.ToString() == chromeWidgetHostClassName) - { - var gcHandle = GCHandle.FromIntPtr(lParam); - - var classDetails = (ClassDetails)gcHandle.Target; - - classDetails.DescendantFound = hWnd; - return false; - } - - return true; - } - - /// - /// Chrome's message-loop Window isn't created synchronously, so this may not find it. - /// If so, you need to wait and try again later. - /// - public static bool TryFindHandle(IntPtr browserHandle, out IntPtr chromeWidgetHostHandle) - { - var classDetails = new ClassDetails(); - var gcHandle = GCHandle.Alloc(classDetails); - - var childProc = new EnumWindowProc(EnumWindow); - EnumChildWindows(browserHandle, childProc, GCHandle.ToIntPtr(gcHandle)); - - chromeWidgetHostHandle = classDetails.DescendantFound; - - gcHandle.Free(); - - return classDetails.DescendantFound != IntPtr.Zero; - } - } -} diff --git a/CefSharp.WinForms.Example/ControlExtensions.cs b/CefSharp.WinForms.Example/ControlExtensions.cs new file mode 100644 index 0000000000..d87f8eec80 --- /dev/null +++ b/CefSharp.WinForms.Example/ControlExtensions.cs @@ -0,0 +1,76 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Windows.Forms; + +namespace CefSharp.WinForms.Example +{ + public static class ControlExtensions + { + /// + /// Finds the parent for the given control of + /// + /// Type + /// control + /// Parent or null + public static T GetParentOfType(this Control control) where T : Control + { + if(control.IsDisposed || !control.IsHandleCreated) + { + return default; + } + + var current = control; + + do + { + current = current.Parent; + + if (current == null) + { + return default; + } + + } + while (current.GetType() != typeof(T)); + + return (T)current; + } + /// + /// Executes the Action asynchronously on the UI thread, does not block execution on the calling thread. + /// No action will be performed if the control doesn't have a valid handle or the control is Disposed/Disposing. + /// + /// the control for which the update is required + /// action to be performed on the control + public static void InvokeOnUiThreadIfRequired(this Control control, Action action) + { + //See https://stackoverflow.com/questions/1874728/avoid-calling-invoke-when-the-control-is-disposed + //for background and some guidance when implementing your own version. + //No action + if (control.Disposing || control.IsDisposed || !control.IsHandleCreated) + { + return; + } + + if (control.InvokeRequired) + { + control.BeginInvoke((Action)(() => + { + //No action + if (control.Disposing || control.IsDisposed || !control.IsHandleCreated) + { + return; + } + + action(); + })); + } + else + { + action.Invoke(); + } + } + } +} diff --git a/CefSharp.WinForms.Example/Handlers/DisplayHandler.cs b/CefSharp.WinForms.Example/Handlers/DisplayHandler.cs deleted file mode 100644 index 6ed0de74b4..0000000000 --- a/CefSharp.WinForms.Example/Handlers/DisplayHandler.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright © 2016 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -using System.Collections.Generic; -using System.Windows.Forms; -using CefSharp.Structs; -using CefSharp.WinForms.Internals; - -namespace CefSharp.WinForms.Example.Handlers -{ - public class DisplayHandler : IDisplayHandler - { - private Control parent; - private Form fullScreenForm; - - void IDisplayHandler.OnAddressChanged(IWebBrowser browserControl, AddressChangedEventArgs addressChangedArgs) - { - - } - - bool IDisplayHandler.OnAutoResize(IWebBrowser browserControl, IBrowser browser, Size newSize) - { - return false; - } - - void IDisplayHandler.OnTitleChanged(IWebBrowser browserControl, TitleChangedEventArgs titleChangedArgs) - { - - } - - void IDisplayHandler.OnFaviconUrlChange(IWebBrowser browserControl, IBrowser browser, IList urls) - { - - } - - void IDisplayHandler.OnFullscreenModeChange(IWebBrowser browserControl, IBrowser browser, bool fullscreen) - { - var chromiumWebBrowser = (ChromiumWebBrowser)browserControl; - - chromiumWebBrowser.InvokeOnUiThreadIfRequired(() => - { - if (fullscreen) - { - parent = chromiumWebBrowser.Parent; - - parent.Controls.Remove(chromiumWebBrowser); - - fullScreenForm = new Form(); - fullScreenForm.FormBorderStyle = FormBorderStyle.None; - fullScreenForm.WindowState = FormWindowState.Maximized; - - fullScreenForm.Controls.Add(chromiumWebBrowser); - - fullScreenForm.ShowDialog(parent.FindForm()); - } - else - { - fullScreenForm.Controls.Remove(chromiumWebBrowser); - - parent.Controls.Add(chromiumWebBrowser); - - fullScreenForm.Close(); - fullScreenForm.Dispose(); - fullScreenForm = null; - } - }); - } - - void IDisplayHandler.OnLoadingProgressChange(IWebBrowser chromiumWebBrowser, IBrowser browser, double progress) - { - - } - - bool IDisplayHandler.OnTooltipChanged(IWebBrowser browserControl, ref string text) - { - //text = "Sample text"; - return false; - } - - void IDisplayHandler.OnStatusMessage(IWebBrowser browserControl, StatusMessageEventArgs statusMessageArgs) - { - - } - - bool IDisplayHandler.OnConsoleMessage(IWebBrowser browserControl, ConsoleMessageEventArgs consoleMessageArgs) - { - return false; - } - } -} diff --git a/CefSharp.WinForms.Example/Handlers/KeyboardHandler.cs b/CefSharp.WinForms.Example/Handlers/KeyboardHandler.cs index 2b75498b56..4a18d22cf7 100644 --- a/CefSharp.WinForms.Example/Handlers/KeyboardHandler.cs +++ b/CefSharp.WinForms.Example/Handlers/KeyboardHandler.cs @@ -7,7 +7,7 @@ namespace CefSharp.WinForms.Example.Handlers public class KeyboardHandler : IKeyboardHandler { /// > - public bool OnPreKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey, ref bool isKeyboardShortcut) + public bool OnPreKeyEvent(IWebBrowser chromiumWebBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey, ref bool isKeyboardShortcut) { const int WM_SYSKEYDOWN = 0x104; const int WM_KEYDOWN = 0x100; @@ -33,7 +33,7 @@ public bool OnPreKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType var result = false; - var control = browserControl as Control; + var control = chromiumWebBrowser as Control; var msgType = 0; switch (type) { @@ -121,7 +121,7 @@ public bool OnPreKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType } /// > - public bool OnKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey) + public bool OnKeyEvent(IWebBrowser chromiumWebBrowser, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey) { var result = false; Debug.WriteLine("OnKeyEvent: KeyType: {0} 0x{1:X} Modifiers: {2}", type, windowsKeyCode, modifiers); diff --git a/CefSharp.WinForms.Example/Handlers/LifeSpanHandler.cs b/CefSharp.WinForms.Example/Handlers/LifeSpanHandler.cs deleted file mode 100644 index c4dfa7a91d..0000000000 --- a/CefSharp.WinForms.Example/Handlers/LifeSpanHandler.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright © 2015 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -using System; -using System.Collections.Generic; -using System.Windows.Forms; -using CefSharp.WinForms.Example.Helper; - -namespace CefSharp.WinForms.Example.Handlers -{ - public class LifeSpanHandler : ILifeSpanHandler - { - private Dictionary popupasChildHelpers = new Dictionary(); - - bool ILifeSpanHandler.OnBeforePopup(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser) - { - //Set newBrowser to null unless your attempting to host the popup in a new instance of ChromiumWebBrowser - //This option is typically used in WPF. This example demos using IWindowInfo.SetAsChild - //Older branches likely still have an example of this method if you choose to go down that path. - newBrowser = null; - - //Use IWindowInfo.SetAsChild to specify the parent handle - //NOTE: user PopupAsChildHelper to handle with Form move and Control resize - var chromiumWebBrowser = (ChromiumWebBrowser)browserControl; - - chromiumWebBrowser.Invoke(new Action(() => - { - if (chromiumWebBrowser.FindForm() is BrowserForm owner) - { - var control = new Control - { - Dock = DockStyle.Fill - }; - control.CreateControl(); - - owner.AddTab(control, targetUrl); - - var rect = control.ClientRectangle; - - windowInfo.SetAsChild(control.Handle, rect.Left, rect.Top, rect.Right, rect.Bottom); - } - })); - - return false; - } - - void ILifeSpanHandler.OnAfterCreated(IWebBrowser browserControl, IBrowser browser) - { - if (browser.IsPopup) - { - var windowHandle = browser.GetHost().GetWindowHandle(); - - //WinForms will kindly lookup the child control from it's handle - //If no parentControl then likely it's a popup and has no parent handle - //(Devtools by default will remain a popup, at this point the Url hasn't been set, so - // we're going with this assumption as it fits the use case of this example) - var parentControl = Control.FromChildHandle(windowHandle); - - if (parentControl != null) - { - var interceptor = new PopupAsChildHelper(browser); - - popupasChildHelpers.Add(browser.Identifier, interceptor); - } - } - } - - bool ILifeSpanHandler.DoClose(IWebBrowser browserControl, IBrowser browser) - { - //The default CEF behaviour (return false) will send a OS close notification (e.g. WM_CLOSE). - //See the doc for this method for full details. - // Allow devtools to close - if (browser.MainFrame.Url.Equals("chrome-devtools://devtools/devtools_app.html")) - { - return false; - } - - var windowHandle = browser.GetHost().GetWindowHandle(); - - var chromiumWebBrowser = (ChromiumWebBrowser)browserControl; - - //If browser is disposed or the handle has been released then we don't - //need to remove the tab (likely removed from menu) - if (!chromiumWebBrowser.IsDisposed && chromiumWebBrowser.IsHandleCreated) - { - chromiumWebBrowser.Invoke(new Action(() => - { - if (chromiumWebBrowser.FindForm() is BrowserForm owner) - { - owner.RemoveTab(windowHandle); - } - })); - } - - //The default CEF behaviour (return false) will send a OS close notification (e.g. WM_CLOSE). - //See the doc for this method for full details. - //return true here to handle closing yourself (no WM_CLOSE will be sent). - return true; - } - - void ILifeSpanHandler.OnBeforeClose(IWebBrowser browserControl, IBrowser browser) - { - if (!browser.IsDisposed && browser.IsPopup) - { - if (popupasChildHelpers.TryGetValue(browser.Identifier, out PopupAsChildHelper interceptor)) - { - popupasChildHelpers[browser.Identifier] = null; - interceptor.Dispose(); - } - } - } - } -} diff --git a/CefSharp.WinForms.Example/Handlers/MenuHandler.cs b/CefSharp.WinForms.Example/Handlers/MenuHandler.cs index d02271af84..e393351650 100644 --- a/CefSharp.WinForms.Example/Handlers/MenuHandler.cs +++ b/CefSharp.WinForms.Example/Handlers/MenuHandler.cs @@ -9,7 +9,7 @@ internal class MenuHandler : IContextMenuHandler private const int ShowDevTools = 26501; private const int CloseDevTools = 26502; - void IContextMenuHandler.OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model) + void IContextMenuHandler.OnBeforeContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model) { //To disable the menu then call clear // model.Clear(); @@ -22,7 +22,7 @@ void IContextMenuHandler.OnBeforeContextMenu(IWebBrowser browserControl, IBrowse model.AddItem((CefMenuCommand)CloseDevTools, "Close DevTools"); } - bool IContextMenuHandler.OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags) + bool IContextMenuHandler.OnContextMenuCommand(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags) { if ((int)commandId == ShowDevTools) { @@ -35,14 +35,14 @@ bool IContextMenuHandler.OnContextMenuCommand(IWebBrowser browserControl, IBrows return false; } - void IContextMenuHandler.OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame) + void IContextMenuHandler.OnContextMenuDismissed(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame) { } - bool IContextMenuHandler.RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback) + bool IContextMenuHandler.RunContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback) { return false; } } -} \ No newline at end of file +} diff --git a/CefSharp.WinForms.Example/Handlers/ScheduleMessagePumpBrowserProcessHandler.cs b/CefSharp.WinForms.Example/Handlers/ScheduleMessagePumpBrowserProcessHandler.cs new file mode 100644 index 0000000000..a401629c6b --- /dev/null +++ b/CefSharp.WinForms.Example/Handlers/ScheduleMessagePumpBrowserProcessHandler.cs @@ -0,0 +1,74 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Threading.Tasks; +using System.Timers; +using CefSharp.Example.Handlers; + +namespace CefSharp.WinForms.Example.Handlers +{ + /// + /// Integreates CEF into the WinForms message loop, + /// This implementation is very simplistic, the timer fires roughly + /// times per second calling Cef.DoMessageLoopWork on the WinForms UI Thread. When OnScheduleMessagePumpWork + /// is called with a delay of less than or equal to 0 then Cef.DoMessageLoopWork is called as CEF has signaled + /// that it needs to perform work. + /// See the following link for the CEF reference implementation that containes a more complex example that maybe + /// required in some circumstances. + /// https://bitbucket.org/chromiumembedded/cef/commits/1ff26aa02a656b3bc9f0712591c92849c5909e04?at=2785 + /// + public class ScheduleMessagePumpBrowserProcessHandler : BrowserProcessHandler + { + private Timer timer; + private TaskFactory factory; + + public ScheduleMessagePumpBrowserProcessHandler(TaskScheduler scheduler) + { + factory = new TaskFactory(scheduler); + timer = new Timer { Interval = ThirtyTimesPerSecond, AutoReset = true }; + timer.Start(); + timer.Elapsed += TimerTick; + } + + private void TimerTick(object sender, EventArgs e) + { + //Basically execute Cef.DoMessageLoopWork 30 times per second + //Execute DoMessageLoopWork on UI thread + factory.StartNew(() => Cef.DoMessageLoopWork()); + } + + protected override void OnScheduleMessagePumpWork(long delay) + { + //If the delay is greater than the Maximum then use ThirtyTimesPerSecond + //instead - we do this to achieve a minimum number of FPS + if (delay > ThirtyTimesPerSecond) + { + delay = ThirtyTimesPerSecond; + } + + //when delay <= 0 queue the Task up for execution on the UI thread. + if (delay <= 0) + { + //Update the timer to execute almost immediately + factory.StartNew(() => Cef.DoMessageLoopWork()); + } + } + + protected override void Dispose(bool disposing) + { + if(disposing) + { + if (timer != null) + { + timer.Stop(); + timer.Dispose(); + timer = null; + } + } + + base.Dispose(disposing); + } + } +} diff --git a/CefSharp.WinForms.Example/Handlers/WinFormsBrowserProcessHandler.cs b/CefSharp.WinForms.Example/Handlers/WinFormsBrowserProcessHandler.cs index bd3f75707f..e34f4acf40 100644 --- a/CefSharp.WinForms.Example/Handlers/WinFormsBrowserProcessHandler.cs +++ b/CefSharp.WinForms.Example/Handlers/WinFormsBrowserProcessHandler.cs @@ -3,55 +3,54 @@ // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; -using System.Threading.Tasks; -using System.Timers; +using System.ComponentModel; +using System.Windows.Forms; using CefSharp.Example.Handlers; namespace CefSharp.WinForms.Example.Handlers { /// - /// EXPERIMENTAL - this implementation is very simplistic and not ready for production use + /// Minimal integration of CEF into existing message loop + /// The timer fires roughly + /// times per second calling Cef.DoMessageLoopWork on the WinForms UI Thread. /// See the following link for the CEF reference implementation. /// https://bitbucket.org/chromiumembedded/cef/commits/1ff26aa02a656b3bc9f0712591c92849c5909e04?at=2785 /// public class WinFormsBrowserProcessHandler : BrowserProcessHandler { private Timer timer; - private TaskFactory factory; - public WinFormsBrowserProcessHandler(TaskScheduler scheduler) + public WinFormsBrowserProcessHandler(IContainer components) { - factory = new TaskFactory(scheduler); - timer = new Timer { Interval = MaxTimerDelay, AutoReset = true }; + timer = new Timer(components) { Interval = SixtyTimesPerSecond }; timer.Start(); - timer.Elapsed += TimerTick; + timer.Tick += TimerTick; } private void TimerTick(object sender, EventArgs e) { //Basically execute Cef.DoMessageLoopWork 30 times per second - //Execute DoMessageLoopWork on UI thread - factory.StartNew(() => Cef.DoMessageLoopWork()); + Cef.DoMessageLoopWork(); } - protected override void OnScheduleMessagePumpWork(int delay) + protected override void OnScheduleMessagePumpWork(long delay) { - //when delay <= 0 queue the Task up for execution on the UI thread. - if (delay <= 0) - { - //Update the timer to execute almost immediately - factory.StartNew(() => Cef.DoMessageLoopWork()); - } + //NOOP - Only enabled when CefSettings.ExternalMessagePump } - public override void Dispose() + protected override void Dispose(bool disposing) { - if (timer != null) + if(disposing) { - timer.Stop(); - timer.Dispose(); - timer = null; + if (timer != null) + { + timer.Stop(); + timer.Dispose(); + timer = null; + } } + + base.Dispose(disposing); } } } diff --git a/CefSharp.WinForms.Example/Handlers/WinFormsDisplayHandler.cs b/CefSharp.WinForms.Example/Handlers/WinFormsDisplayHandler.cs new file mode 100644 index 0000000000..fc890138db --- /dev/null +++ b/CefSharp.WinForms.Example/Handlers/WinFormsDisplayHandler.cs @@ -0,0 +1,49 @@ +// Copyright © 2016 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Windows.Forms; + +namespace CefSharp.WinForms.Example.Handlers +{ + public class WinFormsDisplayHandler : CefSharp.WinForms.Handler.DisplayHandler + { + private Control parent; + private Form fullScreenForm; + + protected override void OnFullscreenModeChange(IWebBrowser chromiumWebBrowser, IBrowser browser, bool fullscreen) + { + var webBrowser = (ChromiumWebBrowser)chromiumWebBrowser; + + webBrowser.InvokeOnUiThreadIfRequired(() => + { + if (fullscreen) + { + parent = webBrowser.Parent; + + parent.Controls.Remove(webBrowser); + + fullScreenForm = new Form(); + fullScreenForm.FormBorderStyle = FormBorderStyle.None; + fullScreenForm.WindowState = FormWindowState.Maximized; + + fullScreenForm.Controls.Add(webBrowser); + + fullScreenForm.ShowDialog(parent.FindForm()); + } + else + { + fullScreenForm.Controls.Remove(webBrowser); + + parent.Controls.Add(webBrowser); + + fullScreenForm.Close(); + fullScreenForm.Dispose(); + fullScreenForm = null; + } + }); + + base.OnFullscreenModeChange(chromiumWebBrowser, browser, fullscreen); + } + } +} diff --git a/CefSharp.WinForms.Example/Handlers/WinFormsLifeSpanHandlerEx.cs b/CefSharp.WinForms.Example/Handlers/WinFormsLifeSpanHandlerEx.cs new file mode 100644 index 0000000000..b55e10662b --- /dev/null +++ b/CefSharp.WinForms.Example/Handlers/WinFormsLifeSpanHandlerEx.cs @@ -0,0 +1,176 @@ +// Copyright © 2023 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Windows.Forms; +using CefSharp.WinForms.Host; + +namespace CefSharp.WinForms.Example.Handlers +{ + /// + /// A WinForms Specific implementation that demos + /// the process of hosting a Popup using a instance. + /// This implementation returns true in + /// so no WM_CLOSE message is sent, this differs from the default CEF behaviour. + /// + internal class WinFormsLifeSpanHandlerEx : CefSharp.Handler.LifeSpanHandler + { + private Action onPopupBrowserCreated; + private Action onPopupDestroyed; + private Action onPopupCreated; + + /// + /// The delegate will be called when the underlying CEF has been + /// created. The instance is valid until + /// is called. provides low level access to the CEF Browser, you can access frames, view source, + /// perform navigation (via frame) etc. This is equivilent to the . + /// + /// Action to be invoked when the has been created. + /// instance allowing you to chain method calls together + public WinFormsLifeSpanHandlerEx OnPopupBrowserCreated(Action onPopupBrowserCreated) + { + this.onPopupBrowserCreated = onPopupBrowserCreated; + + return this; + } + + /// + /// The will be called when the is to be + /// removed from it's parent. + /// When the is called you must remove/dispose of the . + /// + /// Action to be invoked when the Popup is to be destroyed. + /// instance allowing you to chain method calls together + public WinFormsLifeSpanHandlerEx OnPopupDestroyed(Action onPopupDestroyed) + { + this.onPopupDestroyed = onPopupDestroyed; + + return this; + } + + /// + /// The will be called when the has been + /// created. When the is called you must add the control to it's intended parent. + /// + /// Action to be invoked when the Popup host has been created and is ready to be attached to it's parent. + /// instance allowing you to chain method calls together + public WinFormsLifeSpanHandlerEx OnPopupCreated(Action onPopupCreated) + { + this.onPopupCreated = onPopupCreated; + + return this; + } + + /// + protected override bool DoClose(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + if (browser.IsPopup) + { + var control = ChromiumHostControlBase.FromBrowser(browser); + + //We don't have a parent control so we allow the default behaviour, required to close + //default popups e.g. DevTools + if (control == null) + { + return false; + } + + //If the main browser is disposed or the handle has been released then we don't + //need to remove the popup (likely removed from menu) + if (!control.IsDisposed && control.IsHandleCreated) + { + try + { + control.BeginInvoke(new Action(() => + { + onPopupDestroyed?.Invoke(control); + + control.Dispose(); + })); + } + catch (ObjectDisposedException) + { + // If the popup is being hosted on a Form that is being + // Closed/Disposed as we attempt to call Control.BeginInvoke + // we can end up with an ObjectDisposedException + // return false (Default behaviour). + return false; + } + } + } + + //No WM_CLOSE message will be sent, manually handle closing + return true; + } + + /// + protected override void OnAfterCreated(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + if (browser.IsPopup) + { + var webBrowser = (ChromiumWebBrowser)chromiumWebBrowser; + + webBrowser.BeginInvoke((Action) (() => + { + var control = ChromiumHostControlBase.FromBrowser(browser); + + if (control != null) + { + onPopupBrowserCreated?.Invoke(control); + } + })); + + } + } + + /// + protected override void OnBeforeClose(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + if (!browser.IsDisposed && browser.IsPopup) + { + + } + } + + /// + /// + /// NOTE: DevTools popups DO NOT trigger OnBeforePopup. + /// + protected override bool OnBeforePopup(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser) + { + newBrowser = null; + + var webBrowser = (ChromiumWebBrowser)chromiumWebBrowser; + + ChromiumWebBrowser control = null; + + //We need to execute sync here so IWindowInfo.SetAsChild is called before we return false; + webBrowser.Invoke(new Action(() => + { + control = new ChromiumWebBrowser + { + Dock = DockStyle.Fill + }; + + //NOTE: This is important and must be called before the handle is created + control.SetAsPopup(); + control.LifeSpanHandler = this; + + control.CreateControl(); + + var rect = control.ClientRectangle; + + var windowBounds = new CefSharp.Structs.Rect(rect.X, rect.Y, rect.Width, rect.Height); + + windowInfo.SetAsChild(control.Handle, windowBounds); + + onPopupCreated?.Invoke(control, targetUrl, targetFrameName, windowBounds); + })); + + newBrowser = control; + + return false; + } + } +} diff --git a/CefSharp.WinForms.Example/Handlers/WinFormsRequestHandler.cs b/CefSharp.WinForms.Example/Handlers/WinFormsRequestHandler.cs index 8d16626d0f..4d841ebc3b 100644 --- a/CefSharp.WinForms.Example/Handlers/WinFormsRequestHandler.cs +++ b/CefSharp.WinForms.Example/Handlers/WinFormsRequestHandler.cs @@ -6,27 +6,26 @@ using System.Security.Cryptography.X509Certificates; using System.Windows.Forms; using CefSharp.Example.Handlers; -using CefSharp.WinForms.Internals; namespace CefSharp.WinForms.Example.Handlers { - public class WinFormsRequestHandler : RequestHandler + public class WinFormsRequestHandler : ExampleRequestHandler { - private Action openNewTab; + private readonly Action openNewTab; public WinFormsRequestHandler(Action openNewTab) { this.openNewTab = openNewTab; } - public override bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture) + protected override bool OnOpenUrlFromTab(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture) { if (openNewTab == null) { return false; } - var control = (Control)browserControl; + var control = (Control)chromiumWebBrowser; control.InvokeOnUiThreadIfRequired(delegate () { @@ -36,17 +35,24 @@ public override bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser brows return true; } - public override bool OnSelectClientCertificate(IWebBrowser browserControl, IBrowser browser, bool isProxy, string host, int port, X509Certificate2Collection certificates, ISelectClientCertificateCallback callback) + protected override bool OnSelectClientCertificate(IWebBrowser chromiumWebBrowser, IBrowser browser, bool isProxy, string host, int port, X509Certificate2Collection certificates, ISelectClientCertificateCallback callback) { - var control = (Control)browserControl; + var control = (Control)chromiumWebBrowser; control.InvokeOnUiThreadIfRequired(delegate () { var selectedCertificateCollection = X509Certificate2UI.SelectFromCollection(certificates, "Certificates Dialog", "Select Certificate for authentication", X509SelectionFlag.SingleSelection); - - //X509Certificate2UI.SelectFromCollection returns a collection, we've used SingleSelection, so just take the first - //The underlying CEF implementation only accepts a single certificate - callback.Select(selectedCertificateCollection[0]); + if (selectedCertificateCollection.Count > 0) + { + //X509Certificate2UI.SelectFromCollection returns a collection, we've used SingleSelection, so just take the first + //The underlying CEF implementation only accepts a single certificate + callback.Select(selectedCertificateCollection[0]); + } + else + { + //User canceled no certificate should be selected. + callback.Select(null); + } }); return true; diff --git a/CefSharp.WinForms.Example/Helper/PopupAsChildHelper.cs b/CefSharp.WinForms.Example/Helper/PopupAsChildHelper.cs deleted file mode 100644 index c985149bf2..0000000000 --- a/CefSharp.WinForms.Example/Helper/PopupAsChildHelper.cs +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright © 2015 The CefSharp Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. - -using System; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Windows.Forms; -using CefSharp.WinForms.Internals; - -namespace CefSharp.WinForms.Example.Helper -{ - /// - /// When using ILifeSpanHandler.OnBeforePopup and calling IWindowInfo.SetAsChild - /// it's important to track form movement and control size change. This NativeWindow - /// does that for you. With newer version it's possible this is only required when using - /// MultiThreadedMessageLoop = true. - /// TODO: Currently there's a 1:1 mapping between helpers and browsers, it should be possible - /// to have one helper per form that notifies all browser instances - /// - public class PopupAsChildHelper : NativeWindow, IDisposable - { - /// - /// Keep track of whether a move is in progress. - /// - private bool isMoving; - - /// - /// Gets or sets the parent control used to host the popup child handle - /// - private Control parentControl; - - /// - /// Gets or sets the parent form. - /// - /// The parent form. - private Form parentForm; - - /// - /// The IBrowser that references the Popup - /// - private IBrowser browser; - - /// - /// The browsers window handle(hwnd) - /// - private IntPtr browserHandle; - - /// - /// Initializes a new instance of the class. - /// - /// The browser. - public PopupAsChildHelper(IBrowser browser) - { - if (browser == null) - { - throw new ArgumentNullException("browser"); - } - - this.browser = browser; - - //From the browser we grab the window handle (hwnd) - this.browserHandle = browser.GetHost().GetWindowHandle(); - - //WinForms will kindly lookup the child control from it's handle - this.parentControl = Control.FromChildHandle(browserHandle); - - if (this.parentControl == null) - { - throw new Exception("Unable to locate parentControl from the browser handle."); - } - - // Get notified if our control window parent changes: - this.parentControl.ParentChanged += ParentFormChanged; - //Get notified of size changes - this.parentControl.SizeChanged += ParentControlSizeChanged; - - // Find the browser form to subclass to monitor WM_MOVE/WM_MOVING - RefindParentForm(); - } - - /// - /// Call to force refinding of the parent Form. - /// (i.e. top level window that owns the ChromiumWebBrowserControl) - /// - public void RefindParentForm() - { - parentControl.InvokeOnUiThreadIfRequired(() => - { - ParentFormChanged(parentControl, null); - }); - } - - /// - /// Adjust the form to listen to if the ChromiumWebBrowserControl's parent changes. - /// - /// The ChromiumWebBrowser whose parent has changed. - /// The instance containing the event data. - private void ParentFormChanged(object sender, EventArgs e) - { - var control = (Control)sender; - var oldForm = parentForm; - var newForm = control.FindForm(); - - if (oldForm == null || newForm == null || oldForm.Handle != newForm.Handle) - { - if (Handle != IntPtr.Zero) - { - ReleaseHandle(); - } - if (oldForm != null) - { - oldForm.HandleCreated -= OnHandleCreated; - oldForm.HandleDestroyed -= OnHandleDestroyed; - } - parentForm = newForm; - if (newForm != null) - { - newForm.HandleCreated += OnHandleCreated; - newForm.HandleDestroyed += OnHandleDestroyed; - // If newForm's Handle has been created already, - // our event listener won't be called, so call it now. - if (newForm.IsHandleCreated) - { - OnHandleCreated(newForm, null); - } - } - } - } - - private void ParentControlSizeChanged(object sender, EventArgs e) - { - var bounds = parentControl.Bounds; - if (browserHandle != IntPtr.Zero) - { - NativeMethodWrapper.SetWindowPosition(browserHandle, bounds.X, bounds.Y, bounds.Width, bounds.Height); - } - } - - /// - /// Handles the event. - /// - /// The sender. - /// The instance containing the event data. - private void OnHandleCreated(object sender, EventArgs e) - { - AssignHandle(((Form)sender).Handle); - } - - /// - /// Handles the event. - /// - /// The sender. - /// The instance containing the event data. - private void OnHandleDestroyed(object sender, EventArgs e) - { - ReleaseHandle(); - } - - /// - /// Invokes the default window procedure associated with this window. - /// - /// A that is associated with the current Windows message. - protected override void WndProc(ref Message m) - { - var isMovingMessage = false; - - // Negative initial values keeps the compiler quiet and to - // ensure we have actual window movement to notify CEF about. - const int invalidMoveCoordinate = -1; - var x = invalidMoveCoordinate; - var y = invalidMoveCoordinate; - - // Listen for operating system messages - switch (m.Msg) - { - case 0x216: //WM_MOVING - { - var movingRectangle = (Rectangle)Marshal.PtrToStructure(m.LParam, typeof(Rectangle)); - x = movingRectangle.Left; - y = movingRectangle.Top; - isMovingMessage = true; - break; - } - case 0x3: //WM_MOVE - { - // Convert IntPtr into 32bit int safely without - // exceptions: - int dwLParam = CastToInt32(m.LParam); - - // Extract coordinates from lo/hi word: - x = dwLParam & 0xffff; - y = (dwLParam >> 16) & 0xffff; - - isMovingMessage = true; - break; - } - } - - // Only notify about movement if: - // * ParentControl Handle Created - // NOTE: This is checked for paranoia. - // This WndProc can't be called unless ParentForm has - // its handle created, but that doesn't necessarily mean - // Browser has had its handle created. - // WinForm controls don't usually get eagerly created Handles - // in their constructors. - // * ParentForm Actually moved - // * Not currently moving (on the UI thread only of course) - // * The current WindowState is Normal. - // This check is to simplify the effort here. - // Other logic already handles the maximize/minimize - // cases just fine. - // You might consider checking Control.Visible and - // not notifying our browser control if the browser control isn't visible. - // However, if you do that, the non-Visible CEF tab will still - // have any SELECT drop downs rendering where they shouldn't. - if (isMovingMessage - && parentControl.IsHandleCreated - && parentForm.WindowState == FormWindowState.Normal - && (parentForm.Left != x || parentForm.Top != y) - && !isMoving) - { - // parentForm.Left & .Right are negative when the window - // is transitioning from maximized to normal. - // If we are transitioning, the form will also receive - // a WM_SIZE which can deal with the move/size combo itself. - if (parentForm.Left >= 0 && parentForm.Right >= 0) - { - OnMoving(); - } - } - - DefWndProc(ref m); - } - - /// - /// Called when the window is moving. - /// - protected virtual void OnMoving() - { - isMoving = true; - - if (!browser.IsDisposed) - { - browser.GetHost().NotifyMoveOrResizeStarted(); - } - - isMoving = false; - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - Dispose(true); - } - - /// - /// Releases unmanaged and - optionally - managed resources. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - if (parentForm != null) - { - parentForm.HandleCreated -= OnHandleCreated; - parentForm.HandleDestroyed -= OnHandleDestroyed; - parentForm = null; - } - - // Unmanaged resource, but release here anyway. - // NativeWindow has its own finalization logic - // that should be run if this instance isn't disposed - // properly before arriving at the finalization thread. - // See: http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/NativeWindow.cs,147 - // for the gruesome details. - if (Handle != IntPtr.Zero) - { - ReleaseHandle(); - } - - if (parentControl != null) - { - parentControl.ParentChanged -= ParentFormChanged; - parentControl.SizeChanged -= ParentControlSizeChanged; - parentControl = null; - } - } - } - - /// - /// When overridden in a derived class, manages an unhandled thread exception. - /// - /// An that specifies the unhandled thread exception. - protected override void OnThreadException(Exception e) - { - // TODO: Do something more interesting here, logging, whatever, something. - base.OnThreadException(e); - } - - private static int CastToInt32(IntPtr intPtr) - { - return unchecked((int)intPtr.ToInt64()); - } - } -} diff --git a/CefSharp.WinForms.Example/Minimal/MultiFormAppContext.cs b/CefSharp.WinForms.Example/Minimal/MultiFormAppContext.cs new file mode 100644 index 0000000000..a78474d2fc --- /dev/null +++ b/CefSharp.WinForms.Example/Minimal/MultiFormAppContext.cs @@ -0,0 +1,38 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System.Windows.Forms; + +namespace CefSharp.WinForms.Example.Minimal +{ + public class MultiFormAppContext : ApplicationContext + { + private SimpleBrowserForm form1; + private SimpleBrowserForm form2; + + public MultiFormAppContext() + { + form1 = new SimpleBrowserForm(); + form1.WindowState = FormWindowState.Normal; + form2 = new SimpleBrowserForm(); + form2.WindowState = FormWindowState.Normal; + + form1.FormClosed += OnFormClosed; + form2.FormClosed += OnFormClosed; + + MainForm = form1; + + form1.Show(); + form2.Show(); + } + + private void OnFormClosed(object sender, FormClosedEventArgs e) + { + if (Application.OpenForms.Count == 0) + { + ExitThread(); + } + } + } +} diff --git a/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs b/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs index 876075c190..524bb6f6b7 100644 --- a/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs +++ b/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs @@ -3,10 +3,10 @@ // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; +using System.ComponentModel; +using System.Runtime.InteropServices; using System.Windows.Forms; -using CefSharp.Example; using CefSharp.Example.JavascriptBinding; -using CefSharp.WinForms.Internals; namespace CefSharp.WinForms.Example.Minimal { @@ -21,7 +21,7 @@ public SimpleBrowserForm() Text = "CefSharp"; WindowState = FormWindowState.Maximized; - var bitness = Environment.Is64BitProcess ? "x64" : "x86"; + var bitness = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}, Environment: {3}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion, bitness); DisplayOutput(version); @@ -32,6 +32,19 @@ public SimpleBrowserForm() Load += OnLoad; } + public IContainer Components + { + get + { + if (components == null) + { + components = new Container(); + } + + return components; + } + } + private void OnLoad(object sender, EventArgs e) { CreateBrowser(); @@ -50,7 +63,9 @@ private void CreateBrowser() browser.StatusMessage += OnBrowserStatusMessage; browser.TitleChanged += OnBrowserTitleChanged; browser.AddressChanged += OnBrowserAddressChanged; - browser.JavascriptObjectRepository.Register("bound", new BoundObject()); +#if !NETCOREAPP + browser.JavascriptObjectRepository.Register("bound", new BoundObject(), false); +#endif } private void OnBrowserConsoleMessage(object sender, ConsoleMessageEventArgs args) @@ -123,7 +138,7 @@ private void HandleToolStripLayout() width -= item.Width - item.Margin.Horizontal; } } - urlTextBox.Width = Math.Max(0, width - urlTextBox.Margin.Horizontal - 18); + urlTextBox.Width = Math.Max(100, width - urlTextBox.Margin.Horizontal - goButton.Width); } private void ExitMenuItemClick(object sender, EventArgs e) @@ -162,7 +177,19 @@ private void LoadUrl(string url) { if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) { - browser.Load(url); + browser.LoadUrl(url); + } + else + { + var searchUrl = "https://www.google.com/search?q=" + Uri.EscapeDataString(url); + + browser.LoadUrl(searchUrl); + } + + //Give the browser focus after starting navigation + if (browser.CanSelect) + { + browser.Select(); } } } diff --git a/CefSharp.WinForms.Example/Minimal/TabulationDemoForm.cs b/CefSharp.WinForms.Example/Minimal/TabulationDemoForm.cs index a3472cfbdb..2e88aa73e5 100644 --- a/CefSharp.WinForms.Example/Minimal/TabulationDemoForm.cs +++ b/CefSharp.WinForms.Example/Minimal/TabulationDemoForm.cs @@ -3,6 +3,7 @@ // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -10,13 +11,19 @@ namespace CefSharp.WinForms.Example.Minimal { public partial class TabulationDemoForm : Form { - private readonly ChromiumWebBrowser chromiumWebBrowser; + private ChromiumWebBrowser chromiumWebBrowser; private readonly Color focusColor = Color.Yellow; private readonly Color nonFocusColor = Color.White; public TabulationDemoForm() { InitializeComponent(); + + Load += FormLoad; + } + + private void FormLoad(object sender, EventArgs e) + { chromiumWebBrowser = new ChromiumWebBrowser(txtURL.Text) { Dock = DockStyle.Fill }; var userControl = new UserControl { Dock = DockStyle.Fill }; userControl.Enter += UserControlEnter; @@ -27,6 +34,19 @@ public TabulationDemoForm() grpBrowser.Controls.Add(userControl); } + public IContainer Components + { + get + { + if (components == null) + { + components = new Container(); + } + + return components; + } + } + private void TxtUrlLostFocus(object sender, EventArgs e) { // Uncomment this if you want the address bar to go white diff --git a/CefSharp.WinForms.Example/Program.cs b/CefSharp.WinForms.Example/Program.cs index 7295654f48..67366a48f0 100644 --- a/CefSharp.WinForms.Example/Program.cs +++ b/CefSharp.WinForms.Example/Program.cs @@ -17,15 +17,14 @@ public class Program [STAThread] public static int Main(string[] args) { - const bool simpleSubProcess = false; + // DEMO: Change to true to self host the BrowserSubprocess. + // instead of using CefSharp.BrowserSubprocess.exe, your applications exe will be used. + // In this case CefSharp.WinForms.Example.exe + const bool selfHostSubProcess = false; - Cef.EnableHighDPISupport(); - - //NOTE: Using a simple sub processes uses your existing application executable to spawn instances of the sub process. - //Features like JSB, EvaluateScriptAsync, custom schemes require the CefSharp.BrowserSubprocess to function - if (simpleSubProcess) + if (selfHostSubProcess) { - var exitCode = Cef.ExecuteProcess(); + var exitCode = CefSharp.BrowserSubprocess.SelfHost.Main(args); if (exitCode >= 0) { @@ -41,10 +40,11 @@ public static int Main(string[] args) #endif var settings = new CefSettings(); - settings.BrowserSubprocessPath = "CefSharp.WinForms.Example.exe"; + settings.BrowserSubprocessPath = System.IO.Path.GetFullPath("CefSharp.WinForms.Example.exe"); Cef.Initialize(settings); + Application.EnableVisualStyles(); var browser = new SimpleBrowserForm(); Application.Run(browser); } @@ -58,8 +58,14 @@ public static int Main(string[] args) } #endif + // DEMO: To integrate CEF into your applications existing message loop + // set multiThreadedMessageLoop = false; const bool multiThreadedMessageLoop = true; + // When multiThreadedMessageLoop = true then externalMessagePump must be set to false + // To enable externalMessagePump set multiThreadedMessageLoop = false and externalMessagePump = true + const bool externalMessagePump = false; + //TEST: There are a number of different Forms for testing purposes. var browser = new BrowserForm(multiThreadedMessageLoop); //var browser = new SimpleBrowserForm(); //var browser = new TabulationDemoForm(); @@ -72,18 +78,28 @@ public static int Main(string[] args) } else { - //Get the current taskScheduler (must be called after the form is created) - var scheduler = TaskScheduler.FromCurrentSynchronizationContext(); + if (externalMessagePump) + { + //Get the current taskScheduler (must be called after the form is created) + var scheduler = TaskScheduler.FromCurrentSynchronizationContext(); + browserProcessHandler = new ScheduleMessagePumpBrowserProcessHandler(scheduler); + } + else + { + //We'll add out WinForms timer to the components container so it's Diposed + browserProcessHandler = new WinFormsBrowserProcessHandler(browser.Components); + } - browserProcessHandler = new WinFormsBrowserProcessHandler(scheduler); } var settings = new CefSettings(); settings.MultiThreadedMessageLoop = multiThreadedMessageLoop; - settings.ExternalMessagePump = !multiThreadedMessageLoop; + settings.ExternalMessagePump = externalMessagePump; CefExample.Init(settings, browserProcessHandler: browserProcessHandler); + Application.EnableVisualStyles(); + //Application.Run(new MultiFormAppContext()); Application.Run(browser); } diff --git a/CefSharp.WinForms.Example/Properties/Resources.Designer.cs b/CefSharp.WinForms.Example/Properties/Resources.Designer.cs index 4f3b07f260..8405d4c795 100644 --- a/CefSharp.WinForms.Example/Properties/Resources.Designer.cs +++ b/CefSharp.WinForms.Example/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace CefSharp.WinForms.Example.Properties -{ - - +namespace CefSharp.WinForms.Example.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,110 +19,92 @@ namespace CefSharp.WinForms.Example.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CefSharp.WinForms.Example.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap chromium256 - { - get - { + internal static System.Drawing.Bitmap chromium256 { + get { object obj = ResourceManager.GetObject("chromium256", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap nav_left_green - { - get - { + internal static System.Drawing.Bitmap nav_left_green { + get { object obj = ResourceManager.GetObject("nav_left_green", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap nav_plain_green - { - get - { + internal static System.Drawing.Bitmap nav_plain_green { + get { object obj = ResourceManager.GetObject("nav_plain_green", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap nav_plain_red - { - get - { + internal static System.Drawing.Bitmap nav_plain_red { + get { object obj = ResourceManager.GetObject("nav_plain_red", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap nav_right_green - { - get - { + internal static System.Drawing.Bitmap nav_right_green { + get { object obj = ResourceManager.GetObject("nav_right_green", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } diff --git a/CefSharp.WinForms.Example/app.config b/CefSharp.WinForms.Example/app.config index ac5aa757cc..0e97998270 100644 --- a/CefSharp.WinForms.Example/app.config +++ b/CefSharp.WinForms.Example/app.config @@ -1,3 +1,10 @@ - + + + + + + + + diff --git a/CefSharp.WinForms.Example/app.manifest b/CefSharp.WinForms.Example/app.manifest index c492c09432..e0446bc911 100644 --- a/CefSharp.WinForms.Example/app.manifest +++ b/CefSharp.WinForms.Example/app.manifest @@ -8,7 +8,7 @@ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + @@ -34,24 +34,12 @@ - - - true/PM - - - - - - - - - - + diff --git a/CefSharp.WinForms.Example/packages.config b/CefSharp.WinForms.Example/packages.config deleted file mode 100644 index 75bf7d42e6..0000000000 --- a/CefSharp.WinForms.Example/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CefSharp.WinForms.Test/CefSharp.WinForms.Test.csproj b/CefSharp.WinForms.Test/CefSharp.WinForms.Test.csproj deleted file mode 100644 index 9b2c82eef7..0000000000 --- a/CefSharp.WinForms.Test/CefSharp.WinForms.Test.csproj +++ /dev/null @@ -1,76 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {310B527B-A811-450D-A1B2-79352FDB338A} - Library - Properties - CefSharp.WinForms.Test - CefSharp.WinForms.Test - v4.0 - 512 - - - - - 3.5 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\nunit\nunit.framework.dll - - - - - - - - - - - {978c9b2b-04b6-4359-a341-ca3fcbe98d32} - CefSharp.WinForms - - - {7b495581-2271-4f41-9476-acb86e8c864f} - {978C9B2B-04B6-4359-A341-CA3FCBE98D32} - CefSharp.WinForms - - - {7B495581-2271-4F41-9476-ACB86E8C864F} - CefSharp - - - - - \ No newline at end of file diff --git a/CefSharp.WinForms.Test/InitTest.cs b/CefSharp.WinForms.Test/InitTest.cs deleted file mode 100644 index 009d489d63..0000000000 --- a/CefSharp.WinForms.Test/InitTest.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using NUnit.Framework; - -namespace CefSharp.WinForms.Test -{ - [TestFixture] - public class InitTest - { - private WebView web_view; - - [SetUp] - public void SetUp() - { - var settings = new Settings(); - if (!CEF.Initialize(settings)) - { - Assert.Fail(); - } - - web_view = new WebView(); - } - - [Test] - public void Foo() - { - Assert.Pass(); - } - } -} \ No newline at end of file diff --git a/CefSharp.WinForms.Test/Properties/AssemblyInfo.cs b/CefSharp.WinForms.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 96ee8308d2..0000000000 --- a/CefSharp.WinForms.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("CefSharp.WinForms.Test")] -[assembly: AssemblyCompany("Anthony Taranto")] -[assembly: AssemblyProduct("CefSharp.Example")] -[assembly: AssemblyCopyright("Copyright © 2013")] - -[assembly: AssemblyVersion("1.25.2.*")] -[assembly: ComVisible(false)] diff --git a/CefSharp.WinForms/CefSettings.cs b/CefSharp.WinForms/CefSettings.cs index d5a66dc70e..a9e1f71446 100644 --- a/CefSharp.WinForms/CefSettings.cs +++ b/CefSharp.WinForms/CefSettings.cs @@ -8,7 +8,25 @@ namespace CefSharp.WinForms /// Initialization settings. Many of these and other settings can also configured /// using command-line switches. ///
- public class CefSettings : AbstractCefSettings + public class CefSettings : CefSettingsBase { + /// + /// Intialize with default values + /// + public CefSettings() : base() + { + // CEF doesn't call GetAuthCredentials unless + // the Chrome login prompt is disabled + // https://github.com/chromiumembedded/cef/issues/3603 + CefCommandLineArgs.Add("disable-chrome-login-prompt"); + + // Disable "Restore pages" popup after incorrect shutdown + // https://github.com/chromiumembedded/cef/issues/3767 + CefCommandLineArgs.Add("hide-crash-restore-bubble"); + + // Disable the back-forward cache + // https://github.com/cefsharp/CefSharp/issues/4621 + CefCommandLineArgs.Add("disable-back-forward-cache"); + } } } diff --git a/CefSharp.WinForms/CefSharp.WinForms.csproj b/CefSharp.WinForms/CefSharp.WinForms.csproj index f4a381cb56..2364f0b7b2 100644 --- a/CefSharp.WinForms/CefSharp.WinForms.csproj +++ b/CefSharp.WinForms/CefSharp.WinForms.csproj @@ -1,101 +1,63 @@ - - - + - Debug - AnyCPU - {882505AD-246D-402A-8414-347EFB8E2C8D} + net462 Library - Properties - CefSharp.WinForms - CefSharp.WinForms - v4.5.2 - 512 - - - - - x64 - bin\x64\Debug\ - false - - - x64 - bin\x64\Release\ - bin\x64\Release\CefSharp.WinForms.XML - pdbonly - true - true - false - - true - - ..\CefSharp.snk + false + true + true + MinimumRecommendedRules.ruleset - - true - bin\x86\Debug\ - x86 - MinimumRecommendedRules.ruleset - false + + + TRACE;DEBUG;WINFORMS + full - - bin\x86\Release\ - x86 - MinimumRecommendedRules.ruleset + + + TRACE;WINFORMS + bin\Release\CefSharp.WinForms.XML + true true pdbonly - true - bin\x86\Release\CefSharp.WinForms.XML - false + - - - - - - - - - - - - - - - - - - - - - - - Component + + ChromiumWebBrowser.Partial.cs + + + + + - - {7b495581-2271-4f41-9476-acb86e8c864f} - CefSharp.Core - - - {a55848cc-10e7-40cb-addb-04740b16dd43} - CefSharp - + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - + + + + + + + + - - \ No newline at end of file diff --git a/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj b/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj new file mode 100644 index 0000000000..35e17ccb73 --- /dev/null +++ b/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj @@ -0,0 +1,71 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + net6.0-windows + CefSharp.WinForms + CefSharp.WinForms + $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + true + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + WINFORMS + 9.0 + + + + true + true + True + embedded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; compile + + + + + \ No newline at end of file diff --git a/CefSharp.WinForms/ChromiumWebBrowser.cs b/CefSharp.WinForms/ChromiumWebBrowser.cs index 5e5ebdd2be..159e9df76a 100644 --- a/CefSharp.WinForms/ChromiumWebBrowser.cs +++ b/CefSharp.WinForms/ChromiumWebBrowser.cs @@ -9,7 +9,11 @@ using System.Threading; using System.Windows.Forms; using CefSharp.Internals; +using CefSharp.Web; using CefSharp.WinForms.Internals; +using CefSharp.WinForms.Host; +using CefSharp.DevTools.Page; +using System.Threading.Tasks; namespace CefSharp.WinForms { @@ -17,26 +21,25 @@ namespace CefSharp.WinForms /// ChromiumWebBrowser is the WinForms web browser control /// /// - /// /// [Docking(DockingBehavior.AutoDock), DefaultEvent("LoadingStateChanged"), ToolboxBitmap(typeof(ChromiumWebBrowser)), Description("CefSharp ChromiumWebBrowser - Chromium Embedded Framework .Net wrapper. https://github.com/cefsharp/CefSharp"), Designer(typeof(ChromiumWebBrowserDesigner))] - public class ChromiumWebBrowser : Control, IWebBrowserInternal, IWinFormsWebBrowser + public partial class ChromiumWebBrowser : ChromiumHostControlBase, IWebBrowserInternal, IWinFormsWebBrowser { + //TODO: If we start adding more consts then extract them into a common class + //Possibly in the CefSharp assembly and move the WPF ones into there as well. + private const uint WS_EX_NOACTIVATE = 0x08000000; + /// /// The managed cef browser adapter /// - private ManagedCefBrowserAdapter managedCefBrowserAdapter; + private IBrowserAdapter managedCefBrowserAdapter; /// /// The parent form message interceptor /// private ParentFormMessageInterceptor parentFormMessageInterceptor; /// - /// The browser - /// - private IBrowser browser; - /// /// A flag that indicates whether or not the designer is active /// NOTE: DesignMode becomes false by the time we get to the destructor/dispose so it gets stored here /// @@ -46,11 +49,22 @@ public class ChromiumWebBrowser : Control, IWebBrowserInternal, IWinFormsWebBrow /// private bool initialized; /// - /// Has the underlying Cef Browser been created (slightly different to initliazed in that + /// Has the underlying Cef Browser been created (slightly different to initialized in that /// the browser is initialized in an async fashion) /// private bool browserCreated; /// + /// A flag indicating if the was used when calling CreateBrowser + /// If false and contains a non empty string Load will be called + /// on the main frame + /// + private bool initialAddressLoaded; + /// + /// If true the the WS_EX_NOACTIVATE style will be removed so that future mouse clicks + /// inside the browser correctly activate and focus the window. + /// + private bool removeExNoActivateStyle; + /// /// Browser initialization settings /// private IBrowserSettings browserSettings; @@ -61,16 +75,21 @@ public class ChromiumWebBrowser : Control, IWebBrowserInternal, IWinFormsWebBrow private IRequestContext requestContext; /// - /// The value for disposal, if it's 1 (one) then this instance is either disposed - /// or in the process of getting disposed + /// Parking control used to temporarily host the CefBrowser instance + /// when is true. /// - private int disposeSignaled; + private Control parkingControl; + /// + /// This flag is set when the browser gets focus before the underlying CEF browser + /// has been initialized. + /// + private bool initialFocus; /// /// Gets a value indicating whether this instance is disposed. /// /// if this instance is disposed; otherwise, . - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(false)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] public new bool IsDisposed { get @@ -79,22 +98,27 @@ public class ChromiumWebBrowser : Control, IWebBrowserInternal, IWinFormsWebBrow } } - /// - /// Set to true while handing an activating WM_ACTIVATE message. - /// MUST ONLY be cleared by DefaultFocusHandler. - /// - /// true if this instance is activating; otherwise, false. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(false)] - public bool IsActivating { get; set; } - /// /// Gets or sets the browser settings. /// /// The browser settings. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)] public IBrowserSettings BrowserSettings { - get { return browserSettings; } + get + { + //We keep a reference to the browserSettings for the case where + //the Control Handle is destroyed then Created see https://github.com/cefsharp/CefSharp/issues/2840 + //As it's not possible to change settings after the browser has been + //created, and changing browserSettings then creating a new handle will + //give a subtle different user experience if you aren't expecting it we + //return null here even though we still have a reference. + if (browserCreated) + { + return null; + } + return browserSettings; + } set { if (browserCreated) @@ -102,18 +126,25 @@ public IBrowserSettings BrowserSettings throw new Exception("Browser has already been created. BrowserSettings must be " + "set before the underlying CEF browser is created."); } - if (value != null && value.GetType() != typeof(BrowserSettings)) + if (value != null && !Core.ObjectFactory.BrowserSetingsType.IsAssignableFrom(value.UnWrap().GetType())) { - throw new Exception(string.Format("BrowserSettings can only be of type {0} or null", typeof(BrowserSettings))); + throw new Exception(string.Format("BrowserSettings can only be of type {0} or null", Core.ObjectFactory.BrowserSetingsType)); } browserSettings = value; } } /// + /// Activates browser upon creation, the default value is false. Prior to version 73 + /// the default behaviour was to activate browser on creation (Equivalent of setting this property to true). + /// To restore this behaviour set this value to true immediately after you create the instance. + /// https://github.com/chromiumembedded/cef/issues/1856 + /// + public bool ActivateBrowserOnCreation { get; set; } + /// /// Gets or sets the request context. /// /// The request context. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)] public IRequestContext RequestContext { get { return requestContext; } @@ -124,9 +155,9 @@ public IRequestContext RequestContext throw new Exception("Browser has already been created. RequestContext must be " + "set before the underlying CEF browser is created."); } - if (value != null && value.GetType() != typeof(RequestContext)) + if (value != null && !Core.ObjectFactory.RequestContextType.IsAssignableFrom(value.UnWrap().GetType())) { - throw new Exception(string.Format("RequestContxt can only be of type {0} or null", typeof(RequestContext))); + throw new Exception(string.Format("RequestContext can only be of type {0} or null", Core.ObjectFactory.RequestContextType)); } requestContext = value; } @@ -137,13 +168,13 @@ public IRequestContext RequestContext /// true if this instance is loading; otherwise, false. /// In the WPF control, this property is implemented as a Dependency Property and fully supports data /// binding. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(false)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] public bool IsLoading { get; private set; } /// /// The text that will be displayed as a ToolTip /// /// The tooltip text. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)] public string TooltipText { get; private set; } /// /// The address (URL) which the browser control is currently displaying. @@ -152,158 +183,9 @@ public IRequestContext RequestContext /// The address. /// In the WPF control, this property is implemented as a Dependency Property and fully supports data /// binding. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)] public string Address { get; private set; } - /// - /// Implement and assign to handle dialog events. - /// - /// The dialog handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IDialogHandler DialogHandler { get; set; } - /// - /// Implement and assign to handle events related to JavaScript Dialogs. - /// - /// The js dialog handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IJsDialogHandler JsDialogHandler { get; set; } - /// - /// Implement and assign to handle events related to key press. - /// - /// The keyboard handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IKeyboardHandler KeyboardHandler { get; set; } - /// - /// Implement and assign to handle events related to browser requests. - /// - /// The request handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IRequestHandler RequestHandler { get; set; } - /// - /// Implement and assign to handle events related to downloading files. - /// - /// The download handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IDownloadHandler DownloadHandler { get; set; } - /// - /// Implement and assign to handle events related to browser load status. - /// - /// The load handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public ILoadHandler LoadHandler { get; set; } - /// - /// Implement and assign to handle events related to popups. - /// - /// The life span handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public ILifeSpanHandler LifeSpanHandler { get; set; } - /// - /// Implement and assign to handle events related to browser display state. - /// - /// The display handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IDisplayHandler DisplayHandler { get; set; } - /// - /// Implement and assign to handle events related to the browser context menu - /// - /// The menu handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IContextMenuHandler MenuHandler { get; set; } - /// - /// Implement and assign to handle messages from the render process. - /// - /// The render process message handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IRenderProcessMessageHandler RenderProcessMessageHandler { get; set; } - /// - /// Implement to handle events related to find results. - /// - /// The find handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IFindHandler FindHandler { get; set; } - /// - /// Implement to handle audio events. - /// - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IAudioHandler AudioHandler { get; set; } - /// - /// The for this ChromiumWebBrowser. - /// - /// The focus handler. - /// If you need customized focus handling behavior for WinForms, the suggested - /// best practice would be to inherit from DefaultFocusHandler and try to avoid - /// needing to override the logic in OnGotFocus. The implementation in - /// DefaultFocusHandler relies on very detailed behavior of how WinForms and - /// Windows interact during window activation. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IFocusHandler FocusHandler { get; set; } - /// - /// Implement and assign to handle events related to dragging. - /// - /// The drag handler. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IDragHandler DragHandler { get; set; } - /// - /// Implement and control the loading of resources - /// - /// The resource handler factory. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(null)] - public IResourceHandlerFactory ResourceHandlerFactory { get; set; } - - /// - /// Event handler that will get called when the resource load for a navigation fails or is canceled. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - public event EventHandler LoadError; - /// - /// Event handler that will get called when the browser begins loading a frame. Multiple frames may be loading at the same - /// time. Sub-frames may start or continue loading after the main frame load has ended. This method may not be called for a - /// particular frame if the load request for that frame fails. For notification of overall browser load status use - /// OnLoadingStateChange instead. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - /// Whilst this may seem like a logical place to execute js, it's called before the DOM has been loaded, implement - /// as it's called when the underlying V8Context is created - /// - public event EventHandler FrameLoadStart; - /// - /// Event handler that will get called when the browser is done loading a frame. Multiple frames may be loading at the same - /// time. Sub-frames may start or continue loading after the main frame load has ended. This method will always be called - /// for all frames irrespective of whether the request completes successfully. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - public event EventHandler FrameLoadEnd; - /// - /// Event handler that will get called when the Loading state has changed. - /// This event will be fired twice. Once when loading is initiated either programmatically or - /// by user action, and once when loading is terminated due to completion, cancellation of failure. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - public event EventHandler LoadingStateChanged; - /// - /// Event handler for receiving Javascript console messages being sent from web pages. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// (The exception to this is when your running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). - /// - public event EventHandler ConsoleMessage; - /// - /// Event handler for changes to the status message. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// (The exception to this is when your running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). - /// - public event EventHandler StatusMessage; /// /// Occurs when the browser address changed. /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI @@ -318,13 +200,6 @@ public IRequestContext RequestContext /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. /// public event EventHandler TitleChanged; - /// - /// Event called after the underlying CEF browser instance has been created. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - public event EventHandler IsBrowserInitializedChanged; /// /// A flag that indicates whether the state of the control currently supports the GoForward action (true) or not (false). @@ -332,7 +207,7 @@ public IRequestContext RequestContext /// true if this instance can go forward; otherwise, false. /// In the WPF control, this property is implemented as a Dependency Property and fully supports data /// binding. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(false)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] public bool CanGoForward { get; private set; } /// /// A flag that indicates whether the state of the control current supports the GoBack action (true) or not (false). @@ -340,34 +215,41 @@ public IRequestContext RequestContext /// true if this instance can go back; otherwise, false. /// In the WPF control, this property is implemented as a Dependency Property and fully supports data /// binding. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(false)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] public bool CanGoBack { get; private set; } /// /// A flag that indicates whether the WebBrowser is initialized (true) or not (false). /// /// true if this instance is browser initialized; otherwise, false. - /// In the WPF control, this property is implemented as a Dependency Property and fully supports data - /// binding. - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(false)] - public bool IsBrowserInitialized { get; private set; } - - /// - /// A flag that indicates if you can execute javascript in the main frame. - /// Flag is set to true in IRenderProcessMessageHandler.OnContextCreated. - /// and false in IRenderProcessMessageHandler.OnContextReleased - /// - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(false)] - public bool CanExecuteJavascriptInMainFrame { get; private set; } + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] + public bool IsBrowserInitialized + { + get { return InternalIsBrowserInitialized(); } + } /// /// ParentFormMessageInterceptor hooks the Form handle and forwards /// the move/active messages to the browser, the default is true - /// and should only be required when using + /// and should only be required when using /// set to true. /// - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(true)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(true)] public bool UseParentFormMessageInterceptor { get; set; } = true; + /// + /// By default when is called + /// the underlying Browser Hwnd is only parked (moved to a temp parent) + /// when is true, there are a few other + /// cases where parking of the control is desired, you can force parking by setting + /// this property to true. + /// + /// + /// You may wish to set this property to true when using the browser in conjunction + /// with https://github.com/dockpanelsuite/dockpanelsuite + /// + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(true)] + public bool ParkControlOnHandleDestroyed { get; set; } = false; + /// /// Initializes static members of the class. /// @@ -390,12 +272,22 @@ private static void OnApplicationExit(object sender, EventArgs e) } /// + /// To control how is called, this method will + /// unsubscribe from , + /// + public static void UnregisterShutdownHandler() + { + Application.ApplicationExit -= OnApplicationExit; + } + + /// + /// Important!!! /// This constructor exists as the WinForms designer requires a parameterless constructor, if you are instantiating /// an instance of this class in code then use the /// constructor overload instead. Using this constructor in code is unsupported and you may experience 's /// when attempting to access some of the properties immediately after instantiation. /// - [Obsolete("Should only be used by the WinForms Designer. Use the ChromiumWebBrowser(string, IRequestContext) constructor overload instead.")] + [EditorBrowsable(EditorBrowsableState.Never)] public ChromiumWebBrowser() { @@ -403,10 +295,25 @@ public ChromiumWebBrowser() /// /// Initializes a new instance of the class. + /// **Important** - When using this constructor the property + /// will default to . + /// + /// html string to be initially loaded in the browser. + /// (Optional) Request context that will be used for this browser instance, if null the Global + /// Request Context will be used. + public ChromiumWebBrowser(HtmlString html, IRequestContext requestContext = null) : this(html.ToDataUriString(), requestContext) + { + + } + + /// + /// Initializes a new instance of the class. + /// **Important** - When using this constructor the property + /// will default to . /// /// The address. - /// Request context that will be used for this browser instance, - /// if null the Global Request Context will be used + /// (Optional) Request context that will be used for this browser instance, if null the Global + /// Request Context will be used. public ChromiumWebBrowser(string address, IRequestContext requestContext = null) { Dock = DockStyle.Fill; @@ -418,7 +325,7 @@ public ChromiumWebBrowser(string address, IRequestContext requestContext = null) /// /// Required for designer support - this method cannot be inlined as the designer - /// will attempt to load libcef.dll and will subsiquently throw an exception. + /// will attempt to load libcef.dll and will subsequently throw an exception. /// TODO: Still not happy with this method name, need something better /// [MethodImpl(MethodImplOptions.NoInlining)] @@ -426,29 +333,27 @@ private void InitializeFieldsAndCefIfRequired() { if (!initialized) { - if (!Cef.IsInitialized && !Cef.Initialize(new CefSettings())) - { - throw new InvalidOperationException("Cef::Initialize() failed"); - } + InitializeCefInternal(); Cef.AddDisposable(this); if (FocusHandler == null) { - FocusHandler = new DefaultFocusHandler(); - } - - if (ResourceHandlerFactory == null) - { - ResourceHandlerFactory = new DefaultResourceHandlerFactory(); + //If the WinForms UI thread and the CEF UI thread are one in the same + //then we don't need the FocusHandler, it's only required when using + //MultiThreadedMessageLoop (the default) + if (!Cef.CurrentlyOnThread(CefThreadIds.TID_UI)) + { + FocusHandler = new DefaultFocusHandler(); + } } if (browserSettings == null) { - browserSettings = new BrowserSettings(frameworkCreated: true); + browserSettings = Core.ObjectFactory.CreateBrowserSettings(autoDispose: true); } - managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, false); + managedCefBrowserAdapter = ManagedCefBrowserAdapter.Create(this, false); initialized = true; } @@ -480,31 +385,37 @@ protected override void Dispose(bool disposing) /// /// to release both managed and unmanaged resources; to release only unmanaged resources. /// - /// This method cannot be inlined as the designer will attempt to load libcef.dll and will subsiquently throw an exception. + /// This method cannot be inlined as the designer will attempt to load libcef.dll and will subsequently throw an exception. /// [MethodImpl(MethodImplOptions.NoInlining)] private void InternalDispose(bool disposing) { if (disposing) { - IsBrowserInitialized = false; + Interlocked.Exchange(ref browserInitialized, 0); + CanExecuteJavascriptInMainFrame = false; // Don't maintain a reference to event listeners anylonger: AddressChanged = null; ConsoleMessage = null; FrameLoadEnd = null; FrameLoadStart = null; - IsBrowserInitializedChanged = null; LoadError = null; LoadingStateChanged = null; StatusMessage = null; TitleChanged = null; + JavascriptMessageReceived = null; // Release reference to handlers, except LifeSpanHandler which is done after Disposing // ManagedCefBrowserAdapter otherwise the ILifeSpanHandler.DoClose will not be invoked. - this.SetHandlersToNullExceptLifeSpan(); + // We also leave FocusHandler and override with a NoFocusHandler implementation as + // it so we can block taking Focus (we're dispoing afterall). Issue #3715 + FreeHandlersExceptLifeSpanAndFocus(); + + FocusHandler = new NoFocusHandler(); browser = null; + BrowserCore = null; if (parentFormMessageInterceptor != null) { @@ -518,6 +429,17 @@ private void InternalDispose(bool disposing) managedCefBrowserAdapter = null; } + //Dispose of BrowserSettings if we created it, if user created then they're responsible + if (browserSettings != null && browserSettings.AutoDispose) + { + browserSettings.Dispose(); + } + + browserSettings = null; + + parkingControl?.Dispose(); + parkingControl = null; + // LifeSpanHandler is set to null after managedCefBrowserAdapter.Dispose so ILifeSpanHandler.DoClose // is called. LifeSpanHandler = null; @@ -526,29 +448,79 @@ private void InternalDispose(bool disposing) Cef.RemoveDisposable(this); } - /// - /// Loads the specified URL. - /// - /// The URL to be loaded. + /// public void Load(string url) { - if (IsBrowserInitialized) + if (IsDisposed) { - using (var frame = this.GetMainFrame()) + return; + } + + var browserCore = BrowserCore; + + //There's a small window here between CreateBrowser + //and OnAfterBrowserCreated where the Address prop + //will be updated, no MainFrame.LoadUrl call will be made. + if (browserCore == null) + { + Address = url; + } + else + { + if(browserCore.IsDisposed) + { + return; + } + + if(!browserCore.IsValid) { - frame.LoadUrl(url); + throw new InvalidOperationException("IBrowser instance is no longer valid. Control.Handle was likely destroyed."); + } + + using (var frame = browserCore.MainFrame) + { + //Only attempt to call load if frame is valid + //I've seen so far one case where the MainFrame is invalid. + //As yet unable to reproduce + if (frame.IsValid) + { + frame.LoadUrl(url); + } } } - else + } + + /// + /// Capture page screenshot. + /// + /// Image compression format (defaults to png). + /// Compression quality from range [0..100] (jpeg only). + /// Capture the screenshot of a given region only. + /// Capture the screenshot from the surface, rather than the view. Defaults to true. + /// Capture the screenshot beyond the viewport. Defaults to false. + /// A task that can be awaited to obtain the screenshot as a byte[]. + public async Task CaptureScreenshotAsync(CaptureScreenshotFormat format = CaptureScreenshotFormat.Png, int? quality = null, Viewport viewPort = null, bool fromSurface = true, bool captureBeyondViewport = false) + { + ThrowExceptionIfDisposed(); + ThrowExceptionIfBrowserNotInitialized(); + + if(viewPort != null && viewPort.Scale <= 0) { - Address = url; + throw new ArgumentException($"{nameof(viewPort)}.{nameof(viewPort.Scale)} must be greater than 0."); + } + + using (var devToolsClient = browser.GetDevToolsClient()) + { + var screenShot = await devToolsClient.Page.CaptureScreenshotAsync(format, quality, viewPort, fromSurface, captureBeyondViewport).ConfigureAwait(continueOnCapturedContext: false); + + return screenShot.Data; } } /// /// The javascript object repository, one repository per ChromiumWebBrowser instance. /// - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IJavascriptObjectRepository JavascriptObjectRepository { get @@ -558,6 +530,36 @@ public IJavascriptObjectRepository JavascriptObjectRepository } } + + /// + /// Indicates if one of the Ancestors of this control is sited + /// and that site in DesignMode. + /// + // Roughly based on https://github.com/dotnet/winforms/pull/5375 + private bool IsParentInDesignMode(Control control) + { + if(control == null) + { + throw new ArgumentNullException(nameof(control)); + } + + //Check if our Site is in DesignMode + //If not then walk up the tree + //Until we find a Site that is or our parent is null + if(control.Site?.DesignMode ?? false) + { + return true; + } + + if(control.Parent == null) + { + return false; + } + + return IsParentInDesignMode(control.Parent); + } + + /// /// Raises the event. /// @@ -566,19 +568,74 @@ protected override void OnHandleCreated(EventArgs e) { designMode = DesignMode; + //Check if our Parent is in design mode. if (!designMode) + { + try + { + designMode = IsParentInDesignMode(this); + } + catch (Exception) + { + //TODO: We should log the exception + //Need to provide a wrapper around CEF Log first + } + } + + if(designMode) + { + //For design mode only we remove our custom ApplicationExit event handler + //As we must avoid making all unmanaged calls + Application.ApplicationExit -= OnApplicationExit; + } + else { InitializeFieldsAndCefIfRequired(); // NOTE: Had to move the code out of this function otherwise the designer would crash CreateBrowser(); - ResizeBrowser(); + ResizeBrowser(Width, Height); } base.OnHandleCreated(e); } + protected override void OnHandleDestroyed(EventArgs e) + { + if (!designMode) + { + // NOTE: Had to move the code out of this function otherwise the designer would crash + OnHandleDestroyedInternal(); + } + + base.OnHandleDestroyed(e); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void OnHandleDestroyedInternal() + { + //When the Control is being Recreated then we'll park + //the browser (set to a temp parent) and assign to + //our new handle when it's ready. + if (RecreatingHandle || ParkControlOnHandleDestroyed) + { + parkingControl = new Control(); + parkingControl.CreateControl(); + + var host = this.GetBrowserHost(); + + // Possible host is null + // https://github.com/cefsharp/CefSharp/issues/3931 + if (host != null) + { + var hwnd = host.GetWindowHandle(); + + NativeMethodWrapper.SetWindowParent(hwnd, parkingControl.Handle); + } + } + } + /// /// Override this method to handle creation of WindowInfo. This method can be used to customise aspects of /// browser creation including configuration of settings such as . @@ -591,20 +648,21 @@ protected override void OnHandleCreated(EventArgs e) /// To re-enable Window Activation then remove WS_EX_NOACTIVATE from ExStyle /// /// const uint WS_EX_NOACTIVATE = 0x08000000; - /// windowInfo.ExStyle &= ~WS_EX_NOACTIVATE; + /// windowInfo.ExStyle &= ~WS_EX_NOACTIVATE; /// /// protected virtual IWindowInfo CreateBrowserWindowInfo(IntPtr handle) { - //TODO: If we start adding more consts then extract them into a common class - //Possibly in the CefSharp assembly and move the WPF ones into there as well. - const uint WS_EX_NOACTIVATE = 0x08000000; - - var windowInfo = new WindowInfo(); + var windowInfo = Core.ObjectFactory.CreateWindowInfo(); + windowInfo.RuntimeStyle = CefSharpSettings.RuntimeStyle ?? CefRuntimeStyle.Alloy; windowInfo.SetAsChild(handle); - //Disable Window activation by default - //https://bitbucket.org/chromiumembedded/cef/issues/1856/branch-2526-cef-activates-browser-window - windowInfo.ExStyle |= WS_EX_NOACTIVATE; + + if (!ActivateBrowserOnCreation) + { + //Disable Window activation by default + //https://github.com/chromiumembedded/cef/issues/1856/branch-2526-cef-activates-browser-window + windowInfo.ExStyle |= WS_EX_NOACTIVATE; + } return windowInfo; } @@ -616,31 +674,77 @@ private void CreateBrowser() if (((IWebBrowserInternal)this).HasParent == false) { - if (IsBrowserInitialized == false || browser == null) + //If we are Recreating our handle we will have re-parented our + //browser to parkingControl. We'll assign the browser to our newly + //created handle now. + if ((RecreatingHandle || ParkControlOnHandleDestroyed) && IsBrowserInitialized && browser != null) { - var windowInfo = CreateBrowserWindowInfo(Handle); + var host = this.GetBrowserHost(); + var hwnd = host.GetWindowHandle(); - managedCefBrowserAdapter.CreateBrowser(windowInfo, browserSettings as BrowserSettings, requestContext as RequestContext, Address); + NativeMethodWrapper.SetWindowParent(hwnd, Handle); - browserSettings = null; + parkingControl.Dispose(); + parkingControl = null; } else { - //If the browser already exists we'll reparent it to the new Handle - var browserHandle = browser.GetHost().GetWindowHandle(); - NativeMethodWrapper.SetWindowParent(browserHandle, Handle); + var windowInfo = CreateBrowserWindowInfo(Handle); + + //We actually check if WS_EX_NOACTIVATE was set for instances + //the user has override CreateBrowserWindowInfo and not called base.CreateBrowserWindowInfo + removeExNoActivateStyle = (windowInfo.ExStyle & WS_EX_NOACTIVATE) == WS_EX_NOACTIVATE; + + initialAddressLoaded = !string.IsNullOrEmpty(Address); + + managedCefBrowserAdapter.CreateBrowser(windowInfo, browserSettings, requestContext, Address); } } } + /// + /// Called from when we set focus + /// to the CefBrowser instance via . + /// Method is only called if the browser got focus via + /// before the call to . + /// Can be overridden to provide custom behaviour. + /// + protected virtual void OnSetBrowserInitialFocus() + { + // MultiThreadedMessageLoop = true + // Starting in M104 CEF changes mean that calling CefBrowserHost::SetFocus(true) + // directly in OnAfterCreated result in the browser focus being in a strange state when using + // MultiThreadedMessageLoop. Dealaying the SetFocus call results in the correct behaviour. + // Here we Invoke back into the WinForms UI Thread, check if we have Focus then call + // SetFocus (which will call back onto the CEF UI Thread). + // It's possible to use Cef.PostAction to invoke directly on the CEF UI Thread, + // this also seems to work as expected, using the WinForms UI Thread allows + // us to check the Focused property to determine if we actully have focus + // https://github.com/chromiumembedded/cef/issues/3436/chromium-based-browser-loses-focus-when + if (InvokeRequired) + { + BeginInvoke((Action)(() => + { + if (Disposing || IsDisposed || browser?.IsDisposed == true) + { + return; + } + + if (Focused) + { + browser?.GetHost()?.SetFocus(true); + } + })); + } + } + /// /// Called after browser created. /// /// The browser. - void IWebBrowserInternal.OnAfterBrowserCreated(IBrowser browser) + partial void OnAfterBrowserCreated(IBrowser browser) { - this.browser = browser; - IsBrowserInitialized = true; + BrowserHwnd = browser.GetHost().GetWindowHandle(); // By the time this callback gets called, this control // is most likely hooked into a browser Form of some sort. @@ -651,12 +755,31 @@ void IWebBrowserInternal.OnAfterBrowserCreated(IBrowser browser) this.InvokeOnUiThreadIfRequired(() => { parentFormMessageInterceptor = new ParentFormMessageInterceptor(this); + parentFormMessageInterceptor.Moving += (sender, args) => + { + if (IsBrowserInitialized && !IsDisposed) + { + browser?.GetHost()?.NotifyMoveOrResizeStarted(); + } + }; }); } - ResizeBrowser(); + ResizeBrowser(Width, Height); + + //If Load was called after the call to CreateBrowser we'll call Load + //on the MainFrame + if (!initialAddressLoaded && !string.IsNullOrEmpty(Address)) + { + browser.MainFrame.LoadUrl(Address); + } + + if(initialFocus) + { + OnSetBrowserInitialFocus(); + } - IsBrowserInitializedChanged?.Invoke(this, EventArgs.Empty); + RaiseIsBrowserInitializedChangedEvent(); } /// @@ -678,16 +801,22 @@ void IWebBrowserInternal.SetAddress(AddressChangedEventArgs args) /// Sets the loading state change. /// /// The instance containing the event data. - void IWebBrowserInternal.SetLoadingStateChange(LoadingStateChangedEventArgs args) + partial void SetLoadingStateChange(LoadingStateChangedEventArgs args) { CanGoBack = args.CanGoBack; CanGoForward = args.CanGoForward; IsLoading = args.IsLoading; - var handler = LoadingStateChanged; - if (handler != null) + if (removeExNoActivateStyle && browser != null) { - handler(this, args); + removeExNoActivateStyle = false; + + var host = this.GetBrowserHost(); + var hwnd = host.GetWindowHandle(); + //Remove the WS_EX_NOACTIVATE style so that future mouse clicks inside the + //browser correctly activate and focus the browser. + //https://github.com/chromiumembedded/cef/blob/9df4a54308a88fd80c5774d91c62da35afb5fd1b/tests/cefclient/browser/root_window_win.cc#L1088 + NativeMethodWrapper.RemoveExNoActivateStyle(hwnd); } } @@ -713,91 +842,6 @@ void IWebBrowserInternal.SetTooltipText(string tooltipText) TooltipText = tooltipText; } - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnFrameLoadStart(FrameLoadStartEventArgs args) - { - var handler = FrameLoadStart; - if (handler != null) - { - handler(this, args); - } - } - - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnFrameLoadEnd(FrameLoadEndEventArgs args) - { - var handler = FrameLoadEnd; - if (handler != null) - { - handler(this, args); - } - } - - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnConsoleMessage(ConsoleMessageEventArgs args) - { - var handler = ConsoleMessage; - if (handler != null) - { - handler(this, args); - } - } - - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnStatusMessage(StatusMessageEventArgs args) - { - var handler = StatusMessage; - if (handler != null) - { - handler(this, args); - } - } - - /// - /// Handles the event. - /// - /// The instance containing the event data. - void IWebBrowserInternal.OnLoadError(LoadErrorEventArgs args) - { - var handler = LoadError; - if (handler != null) - { - handler(this, args); - } - } - - void IWebBrowserInternal.SetCanExecuteJavascriptOnMainFrame(bool canExecute) - { - CanExecuteJavascriptInMainFrame = canExecute; - } - - /// - /// Gets the browser adapter. - /// - /// The browser adapter. - IBrowserAdapter IWebBrowserInternal.BrowserAdapter - { - get { return managedCefBrowserAdapter; } - } - - /// - /// Gets or sets a value indicating whether this instance has parent. - /// - /// true if this instance has parent; otherwise, false. - bool IWebBrowserInternal.HasParent { get; set; } - /// /// Manually implement Focused because cef does not implement it. /// @@ -821,41 +865,43 @@ public override bool Focused } } - /// - /// Raises the event. - /// - /// An that contains the event data. - protected override void OnSizeChanged(EventArgs e) + /// + protected override void ResizeBrowser(int width, int height) { - base.OnSizeChanged(e); - - if (!designMode && initialized) + if (!designMode && IsBrowserInitialized) { - ResizeBrowser(); + managedCefBrowserAdapter.Resize(width, height); } } /// - /// Resizes the browser. + /// When minimized set the browser window size to 0x0 to reduce resource usage. + /// https://github.com/chromiumembedded/cef/blob/c7701b8a6168f105f2c2d6b239ce3958da3e3f13/tests/cefclient/browser/browser_window_std_win.cc#L87 /// - private void ResizeBrowser() + internal override void HideInternal() { - if (IsBrowserInitialized) - { - managedCefBrowserAdapter.Resize(Width, Height); - } + ResizeBrowser(0, 0); } /// - /// Raises the event. + /// Show the browser (called after previous minimised) /// - /// An that contains the event data. + internal override void ShowInternal() + { + ResizeBrowser(Width, Height); + } + + /// protected override void OnGotFocus(EventArgs e) { if (IsBrowserInitialized) { browser.GetHost().SetFocus(true); } + else + { + initialFocus = true; + } base.OnGotFocus(e); } @@ -863,44 +909,24 @@ protected override void OnGotFocus(EventArgs e) /// /// Returns the current IBrowser Instance /// - /// browser instance or null + /// browser instance public IBrowser GetBrowser() { - this.ThrowExceptionIfBrowserNotInitialized(); + ThrowExceptionIfDisposed(); + ThrowExceptionIfBrowserNotInitialized(); return browser; } /// - /// Makes certain keys as Input keys when CefSettings.MultiThreadedMessageLoop = false + /// Gets the associated with + /// a specific instance. /// - /// key data - /// true for a select list of keys otherwise defers to base.IsInputKey - protected override bool IsInputKey(Keys keyData) + /// browser + /// returns the assocaited or null if Disposed or no host found. + public static ChromiumWebBrowser FromBrowser(IBrowser browser) { - //This code block is only called/required when CEF is running in the - //same message loop as the WinForms UI (CefSettings.MultiThreadedMessageLoop = false) - //Without this code, arrows and tab won't be processed - switch (keyData) - { - case Keys.Right: - case Keys.Left: - case Keys.Up: - case Keys.Down: - case Keys.Tab: - { - return true; - } - case Keys.Shift | Keys.Right: - case Keys.Shift | Keys.Left: - case Keys.Shift | Keys.Up: - case Keys.Shift | Keys.Down: - { - return true; - } - } - - return base.IsInputKey(keyData); + return FromBrowser(browser); } } } diff --git a/CefSharp.WinForms/ChromiumWebBrowserDesigner.cs b/CefSharp.WinForms/ChromiumWebBrowserDesigner.cs index 22e0d008fb..1a2966735d 100644 --- a/CefSharp.WinForms/ChromiumWebBrowserDesigner.cs +++ b/CefSharp.WinForms/ChromiumWebBrowserDesigner.cs @@ -4,7 +4,11 @@ using System.Collections; using System.Drawing; +#if NETCOREAPP +using Microsoft.DotNet.DesignTools.Designers; +#else using System.Windows.Forms.Design; +#endif namespace CefSharp.WinForms { diff --git a/CefSharp.WinForms/Experimental/ChromiumRenderWidgetHandleFinder.cs b/CefSharp.WinForms/Experimental/ChromiumRenderWidgetHandleFinder.cs new file mode 100644 index 0000000000..8308cc10e3 --- /dev/null +++ b/CefSharp.WinForms/Experimental/ChromiumRenderWidgetHandleFinder.cs @@ -0,0 +1,113 @@ +// Copyright © 2015 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Runtime.InteropServices; +using System.Text; + +namespace CefSharp.WinForms.Experimental +{ + /// + /// ChromiumWidgetHandleFinder is a helper class used to find the + /// child Hwnd for the browser instance. + /// + public static class ChromiumRenderWidgetHandleFinder + { + /// + /// Class Name of the Chrome_RenderWidgetHostHWND Child Window + /// + public const string ChromeRenderWidgetHostClassName = "Chrome_RenderWidgetHostHWND"; + + /// + /// EnumWindowProc delegate used by + /// + /// A handle to a child window of the parent window specified in EnumChildWindows + /// The application-defined value given in EnumChildWindows + /// To continue enumeration, the callback function must return true; to stop enumeration, it must return false. + private delegate bool EnumWindowProc(IntPtr hwnd, IntPtr lParam); + + [DllImport("user32")] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr lParam); + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount); + + /// + /// Chromium's message-loop Window isn't created synchronously, so this may not find it. + /// If so, you need to wait and try again later. + /// + /// ChromiumWebBrowser instance + /// Handle of the child HWND with the name + /// returns true if the HWND was found otherwise false. + public static bool TryFindHandle(IWebBrowser chromiumWebBrowser, out IntPtr chromerRenderWidgetHostHandle) + { + var host = chromiumWebBrowser.GetBrowserHost(); + if (host == null) + { + throw new Exception("IBrowserHost is null, you've likely call this method before the underlying browser has been created."); + } + + var hwnd = host.GetWindowHandle(); + + return TryFindHandle(hwnd, ChromeRenderWidgetHostClassName, out chromerRenderWidgetHostHandle); + } + + /// + /// Chromium's message-loop Window isn't created synchronously, so this may not find it. + /// If so, you need to wait and try again later. + /// + /// IBrowser instance + /// Handle of the child HWND with the name + /// returns true if the HWND was found otherwise false. + public static bool TryFindHandle(IBrowser browser, out IntPtr chromerRenderWidgetHostHandle) + { + var host = browser.GetHost(); + if (host == null) + { + throw new Exception("IBrowserHost is null, you've likely call this method before the underlying browser has been created."); + } + + var hwnd = host.GetWindowHandle(); + + return TryFindHandle(hwnd, ChromeRenderWidgetHostClassName, out chromerRenderWidgetHostHandle); + } + + /// + /// Helper function used to find the child HWND with the ClassName matching + /// Chromium's message-loop Window isn't created synchronously, so this may not find it. + /// If so, you need to wait and try again later. + /// In most cases you should use the overload. + /// + /// control Handle + /// class name used to match + /// Handle of the child HWND with the name + /// returns true if the HWND was found otherwise false. + public static bool TryFindHandle(IntPtr chromiumWebBrowserHandle, string chromeRenderWidgetHostClassName, out IntPtr chromerRenderWidgetHostHandle) + { + var chromeRenderWidgetHostHwnd = IntPtr.Zero; + + EnumWindowProc childProc = (IntPtr hWnd, IntPtr lParam) => + { + var buffer = new StringBuilder(128); + GetClassName(hWnd, buffer, buffer.Capacity); + + if (buffer.ToString() == chromeRenderWidgetHostClassName) + { + chromeRenderWidgetHostHwnd = hWnd; + return false; + } + + return true; + }; + + EnumChildWindows(chromiumWebBrowserHandle, childProc, IntPtr.Zero); + + chromerRenderWidgetHostHandle = chromeRenderWidgetHostHwnd; + + return chromerRenderWidgetHostHandle != IntPtr.Zero; + } + } +} + diff --git a/CefSharp.WinForms/Experimental/ChromiumWidgetNativeWindow.cs b/CefSharp.WinForms/Experimental/ChromiumWidgetNativeWindow.cs new file mode 100644 index 0000000000..9efc7e921d --- /dev/null +++ b/CefSharp.WinForms/Experimental/ChromiumWidgetNativeWindow.cs @@ -0,0 +1,69 @@ +// Copyright © 2015 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Windows.Forms; + +namespace CefSharp.WinForms.Experimental +{ + /// + /// Provides a convenient implement + /// that can be used without having to create your own class + /// + public class ChromiumWidgetNativeWindow : NativeWindow + { + private Func wndProcHandler; + + /// + /// ChromiumWidgetMessageInterceptor constructor + /// + /// Control is used to handled the event so + /// we can automatically call . If null then you are responsible + /// for calling + /// Hwnd to intercept messages for. + public ChromiumWidgetNativeWindow(Control control, IntPtr chromeWidgetHostHandle) + { + AssignHandle(chromeWidgetHostHandle); + + if (control != null) + { + control.HandleDestroyed += BrowserHandleDestroyed; + } + } + + private void BrowserHandleDestroyed(object sender, EventArgs e) + { + ReleaseHandle(); + + var control = (Control)sender; + + control.HandleDestroyed -= BrowserHandleDestroyed; + wndProcHandler = null; + } + + /// + /// Register a Func which is used to intercept + /// calls. should return true if the message + /// was handled, otherwise false. + /// + /// Func to be used to intercept messages, null to clear an existing function. + public void OnWndProc(Func wndProcHandler) + { + this.wndProcHandler = wndProcHandler; + } + + /// + protected override void WndProc(ref Message m) + { + var handler = wndProcHandler; + + var handled = handler?.Invoke(m); + + if (handled == false) + { + base.WndProc(ref m); + } + } + } +} diff --git a/CefSharp.WinForms/Handler/DisplayHandler.cs b/CefSharp.WinForms/Handler/DisplayHandler.cs new file mode 100644 index 0000000000..af06d6e0ec --- /dev/null +++ b/CefSharp.WinForms/Handler/DisplayHandler.cs @@ -0,0 +1,76 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.WinForms.Host; + +namespace CefSharp.WinForms.Handler +{ + /// + /// A WinForms Specific implementation that simplifies + /// the process of hosting a Popup as a Control/Tab. Use this implementation as a base + /// for your own custom implementation if you are using + /// + public class DisplayHandler : CefSharp.Handler.DisplayHandler + { + /// + protected override void OnAddressChanged(IWebBrowser chromiumWebBrowser, AddressChangedEventArgs args) + { + var browser = args.Browser; + + if(browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + control?.OnAddressChanged(args); + } + + base.OnAddressChanged(chromiumWebBrowser, args); + } + + /// + protected override bool OnConsoleMessage(IWebBrowser chromiumWebBrowser, ConsoleMessageEventArgs args) + { + var browser = args.Browser; + + if (browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + control?.OnConsoleMessage(args); + } + + return base.OnConsoleMessage(chromiumWebBrowser, args); + } + + /// + protected override void OnTitleChanged(IWebBrowser chromiumWebBrowser, TitleChangedEventArgs args) + { + var browser = args.Browser; + + if (browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + control?.OnTitleChanged(args); + } + + base.OnTitleChanged(chromiumWebBrowser, args); + } + + /// + protected override void OnStatusMessage(IWebBrowser chromiumWebBrowser, StatusMessageEventArgs args) + { + var browser = args.Browser; + + if (browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + control?.OnStatusMessage(args); + } + + base.OnStatusMessage(chromiumWebBrowser, args); + } + } +} diff --git a/CefSharp.WinForms/Handler/LifeSpanHandler.cs b/CefSharp.WinForms/Handler/LifeSpanHandler.cs new file mode 100644 index 0000000000..87915658b7 --- /dev/null +++ b/CefSharp.WinForms/Handler/LifeSpanHandler.cs @@ -0,0 +1,330 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using CefSharp.WinForms.Host; +using CefSharp.WinForms.Internals; + +namespace CefSharp.WinForms.Handler +{ + /// + /// Called beforethe popup is created, can be used to cancel popup creation if required + /// or modify . + /// It's important to note that the methods of this interface are called on a CEF UI thread, + /// which by default is not the same as your application UI thread. + /// + /// the ChromiumWebBrowser control + /// The browser instance that launched this popup. + /// The HTML frame that launched this popup. + /// The URL of the popup content. (This may be empty/null) + /// The name of the popup. (This may be empty/null) + /// The value indicates where the user intended to + /// open the popup (e.g. current tab, new tab, etc) + /// The value will be true if the popup was opened via explicit user gesture + /// (e.g. clicking a link) or false if the popup opened automatically (e.g. via the DomContentLoaded event). + /// browser settings, defaults to source browsers + /// To cancel creation of the popup return true otherwise return false. + public delegate PopupCreation OnBeforePopupCreatedDelegate(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IBrowserSettings browserSettings); + + /// + /// Called when the has been created. + /// When called you must add the control to it's intended parent + /// so the can be calculated to set the initial + /// size correctly. + /// + /// popup host control + /// url + public delegate void OnPopupCreatedDelegate(ChromiumHostControl control, string url); + + /// + /// Called when the instance has been created. + /// The reference will be valid until is called + /// + /// popup host control, maybe null if Browser is hosted in a native Popup window. + /// DevTools by default will be hosted in a native popup window. + /// browser + public delegate void OnPopupBrowserCreatedDelegate(ChromiumHostControl control, IBrowser browser); + + /// + /// Called when the is to be removed from it's parent. + /// When called you must remove/dispose of the . + /// + /// popup host control + /// browser + public delegate void OnPopupDestroyedDelegate(ChromiumHostControl control, IBrowser browser); + + /// + /// Called to create a new instance of . Allows creation of a derived + /// implementation of . + /// + /// A custom instance of . + public delegate ChromiumHostControl CreatePopupChromiumHostControl(); + + /// + /// A WinForms Specific implementation that simplifies + /// the process of hosting a Popup as a Control/Tab. + /// This implementation returns true in + /// so no WM_CLOSE message is sent, this differs from the default CEF behaviour. + /// + public class LifeSpanHandler : CefSharp.Handler.LifeSpanHandler + { + private readonly Dictionary popupParentFormMessageInterceptors = new Dictionary(); + private OnBeforePopupCreatedDelegate onBeforePopupCreated; + private OnPopupDestroyedDelegate onPopupDestroyed; + private OnPopupBrowserCreatedDelegate onPopupBrowserCreated; + private OnPopupCreatedDelegate onPopupCreated; + private CreatePopupChromiumHostControl chromiumHostControlCreatedDelegate; + + /// + /// Default constructor + /// + /// Optional delegate used to create custom instances. + public LifeSpanHandler(CreatePopupChromiumHostControl chromiumHostControlCreatedDelegate = null) + { + this.chromiumHostControlCreatedDelegate = chromiumHostControlCreatedDelegate; + } + + /// + protected override bool DoClose(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + if (browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + //We don't have a parent control so we allow the default behaviour, required to close + //default popups e.g. DevTools + if (control == null) + { + return false; + } + + //If the main browser is disposed or the handle has been released then we don't + //need to remove the popup (likely removed from menu) + if (!control.IsDisposed && control.IsHandleCreated) + { + try + { + //We need to invoke in a sync fashion so our IBrowser object is still in scope + //Calling in an async fashion leads to the IBrowser being disposed before we + //can access it. + control.InvokeSyncOnUiThreadIfRequired(new Action(() => + { + onPopupDestroyed?.Invoke(control, browser); + + control.Dispose(); + })); + } + catch (ObjectDisposedException) + { + // If the popup is being hosted on a Form that is being + // Closed/Disposed as we attempt to call Control.Invoke + // we can end up with an ObjectDisposedException + // return false (Default behaviour). + return false; + } + } + } + + //No WM_CLOSE message will be sent, manually handle closing + return true; + } + + /// + protected override void OnAfterCreated(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + if (browser.IsPopup) + { + //WinForms will kindly lookup the child control from it's handle + //If no parentControl then likely it's a native popup created by CEF + //(Devtools by default will open as a popup, at this point the Url hasn't been set, so + // we're going with this assumption as it fits the use case currently) + var control = ChromiumHostControl.FromBrowser(browser); + + //If control is null then we'll treat as a native popup (do nothing) + //If control is disposed there's nothing for us to do either. + if (control != null && !control.IsDisposed) + { + control.BrowserHwnd = browser.GetHost().GetWindowHandle(); + + control.InvokeOnUiThreadIfRequired(() => + { + var interceptor = new ParentFormMessageInterceptor(control); + interceptor.Moving += (sender, args) => + { + if (!browser.IsDisposed) + { + browser?.GetHost()?.NotifyMoveOrResizeStarted(); + } + }; + + popupParentFormMessageInterceptors.Add(browser.Identifier, interceptor); + }); + + control.BrowserCore = browser; + control.RaiseIsBrowserInitializedChangedEvent(); + } + + onPopupBrowserCreated?.Invoke(control, browser); + } + } + + /// + protected override void OnBeforeClose(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + if (!browser.IsDisposed && browser.IsPopup) + { + ParentFormMessageInterceptor interceptor; + + if (popupParentFormMessageInterceptors.TryGetValue(browser.Identifier, out interceptor)) + { + popupParentFormMessageInterceptors.Remove(browser.Identifier); + interceptor?.Dispose(); + } + } + } + + /// + /// + /// NOTE: DevTools popups DO NOT trigger OnBeforePopup. + /// + protected override bool OnBeforePopup(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser) + { + newBrowser = null; + + PopupCreation userAction = onBeforePopupCreated?.Invoke(chromiumWebBrowser, browser, frame, targetUrl, targetFrameName, targetDisposition, userGesture, browserSettings) ?? PopupCreation.Continue; + + //Cancel popup creation + if(userAction == PopupCreation.Cancel) + { + return true; + } + + if(userAction == PopupCreation.ContinueWithJavascriptDisabled) + { + noJavascriptAccess = true; + } + + //No action so we'll go with the default behaviour. + if (onPopupCreated == null) + { + return false; + } + + var webBrowser = (ChromiumWebBrowser)chromiumWebBrowser; + + //Load and Display Handlers are used to trigger the relevant events. + //If they are already assigned we'll leave the user preference in place + if (webBrowser.LoadHandler == null) + { + webBrowser.LoadHandler = new LoadHandler(); + } + if (webBrowser.DisplayHandler == null) + { + webBrowser.DisplayHandler = new DisplayHandler(); + } + + //We need to execute sync here so IWindowInfo.SetAsChild is called before we return false; + webBrowser.InvokeSyncOnUiThreadIfRequired(new Action(() => + { + ChromiumHostControl control = chromiumHostControlCreatedDelegate?.Invoke(); + + if (control == null) + { + control = new ChromiumHostControl + { + Dock = DockStyle.Fill + }; + } + control.CreateControl(); + + onPopupCreated?.Invoke(control, targetUrl); + + var rect = control.ClientRectangle; + + var windowBounds = new CefSharp.Structs.Rect(rect.X, rect.Y, rect.Width, rect.Height); + + windowInfo.SetAsChild(control.Handle, windowBounds); + })); + + return false; + } + + /// + /// The will be called before the popup has been created and + /// can be used to cancel popup creation if required or modify . + /// + /// Action to be invoked before popup is created. + /// instance allowing you to chain method calls together + public LifeSpanHandler OnBeforePopupCreated(OnBeforePopupCreatedDelegate onBeforePopupCreated) + { + this.onBeforePopupCreated = onBeforePopupCreated; + + return this; + } + + /// + /// The will be called when the has been + /// created. When the is called you must add the control to it's intended parent + /// so the can be calculated to set the initial + /// size correctly. + /// + /// Action to be invoked when the Popup host has been created and is ready to be attached to it's parent. + /// instance allowing you to chain method calls together + public LifeSpanHandler OnPopupCreated(OnPopupCreatedDelegate onPopupCreated) + { + this.onPopupCreated = onPopupCreated; + + return this; + } + + /// + /// The will be called when the has been + /// created. The instance is valid until + /// is called. provides low level access to the CEF Browser, you can access frames, view source, + /// perform navigation (via frame) etc. + /// + /// Action to be invoked when the has been created. + /// instance allowing you to chain method calls together + public LifeSpanHandler OnPopupBrowserCreated(OnPopupBrowserCreatedDelegate onPopupBrowserCreated) + { + this.onPopupBrowserCreated = onPopupBrowserCreated; + + return this; + } + + /// + /// The will be called when the is to be + /// removed from it's parent. + /// When the is called you must remove/dispose of the . + /// + /// Action to be invoked when the Popup is to be destroyed. + /// instance allowing you to chain method calls together + public LifeSpanHandler OnPopupDestroyed(OnPopupDestroyedDelegate onPopupDestroyed) + { + this.onPopupDestroyed = onPopupDestroyed; + + return this; + } + + /// + /// Create a new instance of the + /// which can be used to create a WinForms specific + /// implementation that simplifies the process of hosting a Popup as a Control/Tab. + /// In scnarios where you also need to implement then instead + /// of implementing directly you will need to inherit from . + /// As it provides base functionality required to make events work correctly. + /// + /// + /// A which can be used to fluently create an . + /// Call to create the actual instance after you have call + /// etc. + /// + public static LifeSpanHandlerBuilder Create(CreatePopupChromiumHostControl chromiumHostControlCreatedDelegate = null) + { + return new LifeSpanHandlerBuilder(chromiumHostControlCreatedDelegate); + } + } +} diff --git a/CefSharp.WinForms/Handler/LifeSpanHandlerBuilder.cs b/CefSharp.WinForms/Handler/LifeSpanHandlerBuilder.cs new file mode 100644 index 0000000000..11cc9d88f9 --- /dev/null +++ b/CefSharp.WinForms/Handler/LifeSpanHandlerBuilder.cs @@ -0,0 +1,95 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.WinForms.Handler +{ + /// + /// Fluent Builder + /// + public class LifeSpanHandlerBuilder + { + private readonly LifeSpanHandler handler; + + /// + /// LifeSpanHandlerBuilder + /// + /// + /// When specified the delegate will be used to create the + /// instance. Allowing users to create their own custom instance that extends + /// + public LifeSpanHandlerBuilder(CreatePopupChromiumHostControl chromiumHostControlCreatedDelegate) + { + handler = new LifeSpanHandler(chromiumHostControlCreatedDelegate); + } + + /// + /// The will be called before the popup has been created and + /// can be used to cancel popup creation if required, modify and disable javascript. + /// + /// Action to be invoked before popup is created. + /// instance allowing you to chain method calls together + public LifeSpanHandlerBuilder OnBeforePopupCreated(OnBeforePopupCreatedDelegate onBeforePopupCreated) + { + handler.OnBeforePopupCreated(onBeforePopupCreated); + + return this; + } + + /// + /// The will be called when the has been + /// created. When the is called you must add the control to it's intended parent + /// so the can be calculated to set the initial + /// size correctly. + /// + /// Action to be invoked when the Popup is to be destroyed. + /// instance allowing you to chain method calls together + public LifeSpanHandlerBuilder OnPopupCreated(OnPopupCreatedDelegate onPopupCreated) + { + handler.OnPopupCreated(onPopupCreated); + + return this; + } + + /// + /// The will be called when the has been + /// created. The instance is valid until + /// is called. provides low level access to the CEF Browser, you can access frames, view source, + /// perform navigation (via frame) etc. + /// + /// Action to be invoked when the has been created. + /// instance allowing you to chain method calls together + public LifeSpanHandlerBuilder OnPopupBrowserCreated(OnPopupBrowserCreatedDelegate onPopupBrowserCreated) + { + handler.OnPopupBrowserCreated(onPopupBrowserCreated); + + return this; + } + + /// + /// The will be called when the is to be + /// removed from it's parent. + /// When the is called you must remove/dispose of the . + /// + /// Action to be invoked when the Popup is to be destroyed. + /// instance allowing you to chain method calls together + public LifeSpanHandlerBuilder OnPopupDestroyed(OnPopupDestroyedDelegate onPopupDestroyed) + { + handler.OnPopupDestroyed(onPopupDestroyed); + + return this; + } + + /// + /// Creates an implementation + /// that can be used to host popups as tabs/controls. The resulting + /// returns true in + /// so no WM_CLOSE message is sent, this differs from the default CEF behaviour. + /// + /// a instance + public ILifeSpanHandler Build() + { + return handler; + } + } +} diff --git a/CefSharp.WinForms/Handler/LoadHandler.cs b/CefSharp.WinForms/Handler/LoadHandler.cs new file mode 100644 index 0000000000..ad9583beaa --- /dev/null +++ b/CefSharp.WinForms/Handler/LoadHandler.cs @@ -0,0 +1,76 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.WinForms.Host; + +namespace CefSharp.WinForms.Handler +{ + /// + /// A WinForms Specific implementation that simplifies + /// the process of hosting a Popup as a Control/Tab.Use this implementation as a base + /// for your own custom implementation if you are using + /// + public class LoadHandler : CefSharp.Handler.LoadHandler + { + /// + protected override void OnFrameLoadEnd(IWebBrowser chromiumWebBrowser, FrameLoadEndEventArgs args) + { + var browser = args.Browser; + + if (browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + control?.OnFrameLoadEnd(args); + } + + base.OnFrameLoadEnd(chromiumWebBrowser, args); + } + + /// + protected override void OnFrameLoadStart(IWebBrowser chromiumWebBrowser, FrameLoadStartEventArgs args) + { + var browser = args.Browser; + + if (browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + control?.OnFrameLoadStart(args); + } + + base.OnFrameLoadStart(chromiumWebBrowser, args); + } + + /// + protected override void OnLoadError(IWebBrowser chromiumWebBrowser, LoadErrorEventArgs args) + { + var browser = args.Browser; + + if (browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + control?.OnLoadError(args); + } + + base.OnLoadError(chromiumWebBrowser, args); + } + + /// + protected override void OnLoadingStateChange(IWebBrowser chromiumWebBrowser, LoadingStateChangedEventArgs args) + { + var browser = args.Browser; + + if (browser.IsPopup) + { + var control = ChromiumHostControl.FromBrowser(browser); + + control?.OnLoadingStateChange(args); + } + + base.OnLoadingStateChange(chromiumWebBrowser, args); + } + } +} diff --git a/CefSharp.WinForms/Handler/PopupCreation.cs b/CefSharp.WinForms/Handler/PopupCreation.cs new file mode 100644 index 0000000000..931b9b390f --- /dev/null +++ b/CefSharp.WinForms/Handler/PopupCreation.cs @@ -0,0 +1,25 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +namespace CefSharp.WinForms.Handler +{ + /// + /// Popup Creation options + /// + public enum PopupCreation + { + /// + /// Popup creation is cancled, no further action will occur + /// + Cancel = 0, + /// + /// Popup creation will continue as per normal. + /// + Continue, + /// + /// Popup creation will continue with javascript disabled. + /// + ContinueWithJavascriptDisabled + } +} diff --git a/CefSharp.WinForms/Host/ChromiumHostControl.cs b/CefSharp.WinForms/Host/ChromiumHostControl.cs new file mode 100644 index 0000000000..a5469b86c8 --- /dev/null +++ b/CefSharp.WinForms/Host/ChromiumHostControl.cs @@ -0,0 +1,314 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace CefSharp.WinForms.Host +{ + /// + /// Chromium Browser Host Control, used for hosting Popups in WinForms + /// + /// + [Docking(DockingBehavior.AutoDock), ToolboxBitmap(typeof(ChromiumWebBrowser)), + Designer(typeof(ChromiumWebBrowserDesigner))] + public class ChromiumHostControl : ChromiumHostControlBase, IWinFormsChromiumWebBrowser + { + /// + /// Get access to the core instance. + /// Maybe null if the underlying CEF Browser has not yet been + /// created or if this control has been disposed. Check + /// before accessing. + /// + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)] + public IBrowser BrowserCore { get; internal set; } + + /// + /// Event handler that will get called when the resource load for a navigation fails or is canceled. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + public event EventHandler LoadError; + /// + /// Event handler that will get called when the browser begins loading a frame. Multiple frames may be loading at the same + /// time. Sub-frames may start or continue loading after the main frame load has ended. This method may not be called for a + /// particular frame if the load request for that frame fails. For notification of overall browser load status use + /// OnLoadingStateChange instead. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + /// Whilst this may seem like a logical place to execute js, it's called before the DOM has been loaded, implement + /// as it's called when the underlying V8Context is created + /// + public event EventHandler FrameLoadStart; + /// + /// Event handler that will get called when the browser is done loading a frame. Multiple frames may be loading at the same + /// time. Sub-frames may start or continue loading after the main frame load has ended. This method will always be called + /// for all frames irrespective of whether the request completes successfully. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + public event EventHandler FrameLoadEnd; + /// + /// Event handler that will get called when the Loading state has changed. + /// This event will be fired twice. Once when loading is initiated either programmatically or + /// by user action, and once when loading is terminated due to completion, cancellation of failure. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + public event EventHandler LoadingStateChanged; + /// + /// Event handler for receiving Javascript console messages being sent from web pages. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// (The exception to this is when you're running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). + /// + public event EventHandler ConsoleMessage; + /// + /// Event handler for changes to the status message. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// (The exception to this is when you're running with settings.MultiThreadedMessageLoop = false, then they'll be the same thread). + /// + public event EventHandler StatusMessage; + + /// + /// Occurs when the browser address changed. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + public event EventHandler AddressChanged; + /// + /// Occurs when the browser title changed. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + public event EventHandler TitleChanged; + + /// + /// A flag that indicates whether the control is currently loading one or more web pages (true) or not (false). + /// + /// true if this instance is loading; otherwise, false. + /// In the WPF control, this property is implemented as a Dependency Property and fully supports data + /// binding. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] + public bool IsLoading { get; private set; } + /// + /// The address (URL) which the browser control is currently displaying. + /// Will automatically be updated as the user navigates to another page (e.g. by clicking on a link). + /// + /// The address. + /// In the WPF control, this property is implemented as a Dependency Property and fully supports data + /// binding. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(null)] + public string Address { get; private set; } + /// + /// A flag that indicates whether the state of the control currently supports the GoForward action (true) or not (false). + /// + /// true if this instance can go forward; otherwise, false. + /// In the WPF control, this property is implemented as a Dependency Property and fully supports data + /// binding. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] + public bool CanGoForward { get; private set; } + /// + /// A flag that indicates whether the state of the control current supports the GoBack action (true) or not (false). + /// + /// true if this instance can go back; otherwise, false. + /// In the WPF control, this property is implemented as a Dependency Property and fully supports data + /// binding. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] + public bool CanGoBack { get; private set; } + /// + /// A flag that indicates whether the WebBrowser is initialized (true) or not (false). + /// + /// true if this instance is browser initialized; otherwise, false. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] + public bool IsBrowserInitialized + { + get { return BrowserCore != null; } + } + + /// + /// Handles the event. + /// + /// The instance containing the event data. + internal void OnFrameLoadStart(FrameLoadStartEventArgs args) + { + FrameLoadStart?.Invoke(this, args); + } + + /// + /// Handles the event. + /// + /// The instance containing the event data. + internal void OnFrameLoadEnd(FrameLoadEndEventArgs args) + { + FrameLoadEnd?.Invoke(this, args); + } + + /// + /// Handles the event. + /// + /// The instance containing the event data. + internal void OnConsoleMessage(ConsoleMessageEventArgs args) + { + ConsoleMessage?.Invoke(this, args); + } + + /// + /// Handles the event. + /// + /// The instance containing the event data. + internal void OnStatusMessage(StatusMessageEventArgs args) + { + StatusMessage?.Invoke(this, args); + } + + /// + /// Handles the event. + /// + /// The instance containing the event data. + internal void OnLoadError(LoadErrorEventArgs args) + { + LoadError?.Invoke(this, args); + } + + /// + /// Sets the loading state change. + /// + /// The instance containing the event data. + internal void OnLoadingStateChange(LoadingStateChangedEventArgs args) + { + CanGoBack = args.CanGoBack; + CanGoForward = args.CanGoForward; + IsLoading = args.IsLoading; + + LoadingStateChanged?.Invoke(this, args); + } + + /// + /// Sets the title. + /// + /// The instance containing the event data. + internal void OnTitleChanged(TitleChangedEventArgs args) + { + TitleChanged?.Invoke(this, args); + } + + /// + /// Sets the address. + /// + /// The instance containing the event data. + internal void OnAddressChanged(AddressChangedEventArgs args) +{ + Address = args.Address; + + AddressChanged?.Invoke(this, args); + } + + /// + /// Loads the specified in the Main Frame. + /// + /// The URL to be loaded. + public void LoadUrl(string url) + { + if (IsDisposed) + { + return; + } + + var browser = BrowserCore; + + if (browser == null || browser.IsDisposed) + { + return; + } + + using (var frame = browser.MainFrame) + { + frame.LoadUrl(url); + } + } + + /// + public Task LoadUrlAsync(string url) + { + //LoadUrlAsync is actually a static method so that CefSharp.Wpf.HwndHost can reuse the code + return CefSharp.WebBrowserExtensions.LoadUrlAsync(this, url); + } + + /// + public Task WaitForNavigationAsync(TimeSpan? timeout = null, CancellationToken cancellationToken = default) + { + //WaitForNavigationAsync is actually a static method so that CefSharp.Wpf.HwndHost can reuse the code + return CefSharp.WebBrowserExtensions.WaitForNavigationAsync(this, timeout, cancellationToken); + } + + /// + /// Returns the main (top-level) frame for the browser window. + /// + /// the main frame + public IFrame GetMainFrame() + { + var browser = BrowserCore; + + if(browser == null) + { + throw new Exception(CefSharp.WebBrowserExtensions.BrowserNullExceptionString); + } + + return browser.MainFrame; + } + + /// + protected override void Dispose(bool disposing) + { + if (disposing) + { + var browserCore = BrowserCore; + + AddressChanged = null; + ConsoleMessage = null; + FrameLoadEnd = null; + FrameLoadStart = null; + LoadError = null; + LoadingStateChanged = null; + StatusMessage = null; + TitleChanged = null; + BrowserCore = null; + + if (browserCore?.IsDisposed == false) + { + //Close the underlying CEF Browser + browserCore?.GetHost()?.CloseBrowser(true); + } + } + + base.Dispose(disposing); + } + + /// + /// Gets the associated with + /// a specific instance. + /// + /// browser + /// returns the assocaited or null if Disposed or no host found. + public static ChromiumHostControl FromBrowser(IBrowser browser) + { + return FromBrowser(browser); + } + } +} diff --git a/CefSharp.WinForms/Host/ChromiumHostControlBase.cs b/CefSharp.WinForms/Host/ChromiumHostControlBase.cs new file mode 100644 index 0000000000..8cd2c1e861 --- /dev/null +++ b/CefSharp.WinForms/Host/ChromiumHostControlBase.cs @@ -0,0 +1,222 @@ +// Copyright © 2021 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace CefSharp.WinForms.Host +{ + /// + /// Chromium Browser Host Control, provides base functionality for hosting a + /// CefBrowser instance (main browser and popups) in WinForms. + /// + /// + public abstract class ChromiumHostControlBase : Control + { + [DllImport("user32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); + + /// + /// IntPtr that represents the CefBrowser Hwnd + /// Used for sending messages to the browser + /// e.g. resize + /// + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public IntPtr BrowserHwnd { get; set; } + /// + /// Set to true while handing an activating WM_ACTIVATE message. + /// MUST ONLY be cleared by DefaultFocusHandler. + /// + /// true if this instance is activating; otherwise, false. + [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), DefaultValue(false)] + public bool IsActivating { get; set; } + + /// + /// Event called after the underlying CEF browser instance has been created. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + public event EventHandler IsBrowserInitializedChanged; + + /// + /// Gets the default size of the control. + /// + /// + /// The default of the control. + /// + protected override Size DefaultSize + { + get { return new Size(200, 100); } + } + + /// + /// Makes certain keys as Input keys when CefSettings.MultiThreadedMessageLoop = false + /// + /// key data + /// true for a select list of keys otherwise defers to base.IsInputKey + protected override bool IsInputKey(Keys keyData) + { + //This code block is only called/required when CEF is running in the + //same message loop as the WinForms UI (CefSettings.MultiThreadedMessageLoop = false) + //Without this code, arrows and tab won't be processed + switch (keyData) + { + case Keys.Right: + case Keys.Left: + case Keys.Up: + case Keys.Down: + case Keys.Tab: + { + return true; + } + case Keys.Shift | Keys.Tab: + case Keys.Shift | Keys.Right: + case Keys.Shift | Keys.Left: + case Keys.Shift | Keys.Up: + case Keys.Shift | Keys.Down: + { + return true; + } + } + + return base.IsInputKey(keyData); + } + + /// + /// Raises the event. + /// + /// An that contains the event data. + protected override void OnSizeChanged(EventArgs e) + { + ResizeBrowser(Width, Height); + + base.OnSizeChanged(e); + } + + /// + protected override void OnVisibleChanged(EventArgs e) + { + if (Visible) + { + ShowInternal(); + } + else + { + HideInternal(); + } + + base.OnVisibleChanged(e); + } + + /// + /// Resizes the browser to the specified and . + /// If and are both 0 then the browser + /// will be hidden and resource usage will be minimised. + /// + /// width + /// height + protected virtual void ResizeBrowser(int width, int height) + { + if (BrowserHwnd != IntPtr.Zero) + { + SetWindowPosition(BrowserHwnd, 0, 0, width, height); + } + } + + /// + /// When minimized set the browser window size to 0x0 to reduce resource usage. + /// https://github.com/chromiumembedded/cef/blob/c7701b8a6168f105f2c2d6b239ce3958da3e3f13/tests/cefclient/browser/browser_window_std_win.cc#L87 + /// + internal virtual void HideInternal() + { + if (BrowserHwnd != IntPtr.Zero) + { + SetWindowPosition(BrowserHwnd, 0, 0, 0, 0); + } + } + + /// + /// Show the browser (called after previous minimised) + /// + internal virtual void ShowInternal() + { + if (BrowserHwnd != IntPtr.Zero) + { + SetWindowPosition(BrowserHwnd, 0, 0, Width, Height); + } + } + + /// + protected override void Dispose(bool disposing) + { + if (disposing) + { + BrowserHwnd = IntPtr.Zero; + IsBrowserInitializedChanged = null; + } + + base.Dispose(disposing); + } + + /// + /// Trigger the event + /// + internal void RaiseIsBrowserInitializedChangedEvent() + { + IsBrowserInitializedChanged?.Invoke(this, EventArgs.Empty); + } + + private void SetWindowPosition(IntPtr handle, int x, int y, int width, int height) + { + const uint SWP_NOMOVE = 0x0002; + const uint SWP_NOZORDER = 0x0004; + const uint SWP_NOACTIVATE = 0x0010; + + if (handle != IntPtr.Zero) + { + if (width == 0 && height == 0) + { + // For windowed browsers when the frame window is minimized set the + // browser window size to 0x0 to reduce resource usage. + SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); + } + else + { + SetWindowPos(handle, IntPtr.Zero, x, y, width, height, SWP_NOZORDER); + } + } + } + + /// + /// Gets the or associated with + /// a specific instance. + /// + /// browser + /// returns the assocaited or or null if Disposed or no host found. + public static T FromBrowser(IBrowser browser) where T : ChromiumHostControlBase + { + if (browser.IsDisposed) + { + return null; + } + + var windowHandle = browser.GetHost().GetWindowHandle(); + + if (windowHandle == IntPtr.Zero) + { + return null; + } + + var control = Control.FromChildHandle(windowHandle) as T; + + return control; + } + } +} diff --git a/CefSharp.WinForms/IWinFormsChromiumWebBrowser.cs b/CefSharp.WinForms/IWinFormsChromiumWebBrowser.cs new file mode 100644 index 0000000000..f98142c4ed --- /dev/null +++ b/CefSharp.WinForms/IWinFormsChromiumWebBrowser.cs @@ -0,0 +1,48 @@ +// Copyright © 2022 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using CefSharp.WinForms.Host; +using System; +using System.ComponentModel; +using System.Windows.Forms; + +namespace CefSharp.WinForms +{ + /// + /// Winforms Specific Chromium browser implementation, differs from in that + /// this interface is implemented by both and + /// where is only implemented by + /// + public interface IWinFormsChromiumWebBrowser : IChromiumWebBrowserBase, IWin32Window, IComponent, ISynchronizeInvoke + { + /// + /// Occurs when the browser title changed. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + event EventHandler TitleChanged; + /// + /// Occurs when the browser address changed. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + event EventHandler AddressChanged; + + /// + /// Event called after the underlying CEF browser instance has been created. + /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI + /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. + /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. + /// + event EventHandler IsBrowserInitializedChanged; + + /// + bool CanSelect { get; } + + /// + void Select(); + } +} diff --git a/CefSharp.WinForms/IWinFormsWebBrowser.cs b/CefSharp.WinForms/IWinFormsWebBrowser.cs index 51a27c30ef..c4cc58ea6f 100644 --- a/CefSharp.WinForms/IWinFormsWebBrowser.cs +++ b/CefSharp.WinForms/IWinFormsWebBrowser.cs @@ -2,30 +2,15 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -using System; - namespace CefSharp.WinForms { /// /// WinForms specific implementation, has events the /// implementation exposes. /// - /// - public interface IWinFormsWebBrowser : IWebBrowser + /// and + public interface IWinFormsWebBrowser : IWebBrowser, IWinFormsChromiumWebBrowser { - /// - /// Occurs when the browser title changed. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - event EventHandler TitleChanged; - /// - /// Occurs when the browser address changed. - /// It's important to note this event is fired on a CEF UI thread, which by default is not the same as your application UI - /// thread. It is unwise to block on this thread for any length of time as your browser will become unresponsive and/or hang.. - /// To access UI elements you'll need to Invoke/Dispatch onto the UI Thread. - /// - event EventHandler AddressChanged; + } } diff --git a/CefSharp.WinForms/Internals/ControlExtensions.cs b/CefSharp.WinForms/Internals/ControlExtensions.cs index 1c9fc585d4..6daba9225c 100644 --- a/CefSharp.WinForms/Internals/ControlExtensions.cs +++ b/CefSharp.WinForms/Internals/ControlExtensions.cs @@ -14,14 +14,30 @@ public static class ControlExtensions { /// /// Executes the Action asynchronously on the UI thread, does not block execution on the calling thread. + /// No action will be performed if the control doesn't have a valid handle or the control is Disposed/Disposing. /// /// the control for which the update is required /// action to be performed on the control - public static void InvokeOnUiThreadIfRequired(this Control control, Action action) + internal static void InvokeOnUiThreadIfRequired(this Control control, Action action) { + //No action + if (control.Disposing || control.IsDisposed || !control.IsHandleCreated) + { + return; + } + if (control.InvokeRequired) { - control.BeginInvoke(action); + control.BeginInvoke((Action)(() => + { + //No action + if (control.Disposing || control.IsDisposed || !control.IsHandleCreated) + { + return; + } + + action(); + })); } else { @@ -29,6 +45,30 @@ public static void InvokeOnUiThreadIfRequired(this Control control, Action actio } } + /// + /// Executes the Action sync on the UI thread, blocks execution on the calling thread. + /// No action will be performed if the control doesn't have a valid handle or the control is Disposed/Disposing. + /// + /// the control for which the update is required + /// action to be performed on the control + internal static void InvokeSyncOnUiThreadIfRequired(this Control control, Action action) + { + //No action + if (control.Disposing || control.IsDisposed || !control.IsHandleCreated) + { + return; + } + + if (control.InvokeRequired) + { + control.Invoke(action); + } + else + { + action(); + } + } + /// /// Activates the specified control. /// diff --git a/CefSharp.WinForms/Internals/ParentFormMessageInterceptor.cs b/CefSharp.WinForms/Internals/ParentFormMessageInterceptor.cs index 950531a2ce..738beda149 100644 --- a/CefSharp.WinForms/Internals/ParentFormMessageInterceptor.cs +++ b/CefSharp.WinForms/Internals/ParentFormMessageInterceptor.cs @@ -7,6 +7,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; using CefSharp.Internals; +using CefSharp.WinForms.Host; namespace CefSharp.WinForms.Internals { @@ -16,7 +17,7 @@ namespace CefSharp.WinForms.Internals /// /// /// - internal class ParentFormMessageInterceptor : NativeWindow, IDisposable + public class ParentFormMessageInterceptor : NativeWindow, IDisposable { /// /// Keep track of whether a move is in progress. @@ -28,11 +29,18 @@ internal class ParentFormMessageInterceptor : NativeWindow, IDisposable /// private Rectangle movingRectangle; + /// + /// Store the previous window state, used to determine if the + /// Windows was previously + /// and resume rendering + /// + private FormWindowState previousWindowState; + /// /// Gets or sets the browser. /// /// The browser. - private ChromiumWebBrowser Browser { get; set; } + private ChromiumHostControlBase Browser { get; set; } /// /// Gets or sets the parent form. @@ -40,11 +48,16 @@ internal class ParentFormMessageInterceptor : NativeWindow, IDisposable /// The parent form. private Form ParentForm { get; set; } + /// + /// Called when the parent form is moving + /// + public event EventHandler Moving; + /// /// Initializes a new instance of the class. /// /// The browser. - public ParentFormMessageInterceptor(ChromiumWebBrowser browser) + public ParentFormMessageInterceptor(ChromiumHostControlBase browser) { Browser = browser; // Get notified if our browser window parent changes: @@ -83,12 +96,17 @@ private void ParentParentChanged(object sender, EventArgs e) { oldForm.HandleCreated -= OnHandleCreated; oldForm.HandleDestroyed -= OnHandleDestroyed; + oldForm.Resize -= OnResize; } ParentForm = newForm; if (newForm != null) { newForm.HandleCreated += OnHandleCreated; newForm.HandleDestroyed += OnHandleDestroyed; + newForm.Resize += OnResize; + + previousWindowState = newForm.WindowState; + // If newForm's Handle has been created already, // our event listener won't be called, so call it now. if (newForm.IsHandleCreated) @@ -99,6 +117,37 @@ private void ParentParentChanged(object sender, EventArgs e) } } + private void OnResize(object sender, EventArgs e) + { + var form = (Form)sender; + + if (previousWindowState == form.WindowState) + { + return; + } + + switch (form.WindowState) + { + case FormWindowState.Normal: + case FormWindowState.Maximized: + { + if (previousWindowState == FormWindowState.Minimized) + { + Browser?.ShowInternal(); + } + break; + } + case FormWindowState.Minimized: + { + Browser?.HideInternal(); + + break; + } + } + + previousWindowState = form.WindowState; + } + /// /// Handles the event. /// @@ -238,10 +287,7 @@ protected virtual void OnMoving() { isMoving = true; - if (Browser.IsBrowserInitialized) - { - Browser.GetBrowser().GetHost().NotifyMoveOrResizeStarted(); - } + Moving?.Invoke(Browser, EventArgs.Empty); isMoving = false; } @@ -262,10 +308,13 @@ protected virtual void Dispose(bool disposing) { if (disposing) { + Moving = null; + if (ParentForm != null) { ParentForm.HandleCreated -= OnHandleCreated; ParentForm.HandleDestroyed -= OnHandleDestroyed; + ParentForm.Resize -= OnResize; ParentForm = null; } diff --git a/CefSharp.WinForms/WebBrowserExtensions.cs b/CefSharp.WinForms/WebBrowserExtensions.cs new file mode 100644 index 0000000000..4e047d31b8 --- /dev/null +++ b/CefSharp.WinForms/WebBrowserExtensions.cs @@ -0,0 +1,136 @@ +// Copyright © 2019 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.Windows.Forms; +using CefSharp.WinForms.Host; + +namespace CefSharp.WinForms +{ + /// + /// Helper extensions for performing common CefSharp related WinForms tasks + /// + public static class WebBrowserExtensions + { + [System.Runtime.InteropServices.DllImport("user32.dll")] + private static extern bool DestroyWindow(IntPtr hWnd); + + /// + /// Manually call https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroywindow + /// passing in the handle returned from . + /// This method can be used to manually close the underlying CefBrowser instance. + /// This will avoid the WM_Close message that CEF sends by default to the top level window. + /// (Which closes your application). This method should generally only be used in the WinForms version. + /// + /// the or instance. + /// If the function succeeds, the return value is true. + /// + /// + /// //Invoke on the CEF UI Thread + /// Cef.UIThreadTaskFactory.StartNew(() => + /// { + /// var closed = chromiumWebBrowser.DestroyWindow(); + /// }); + /// + /// + public static bool DestroyWindow(this IChromiumWebBrowserBase chromiumWebBrowser) + { + if (!Cef.CurrentlyOnThread(CefThreadIds.TID_UI)) + { + throw new InvalidOperationException("This method can only be called on the CEF UI thread." + + "Use Cef.UIThreadTaskFactory to marshal your call onto the CEF UI Thread."); + } + + if (chromiumWebBrowser.IsDisposed) + { + return false; + } + + var browser = chromiumWebBrowser.BrowserCore; + + if (browser == null) + { + return false; + } + + var handle = browser.GetHost().GetWindowHandle(); + + + return DestroyWindow(handle); + } + + /// + /// Open DevTools using as the parent control. If inspectElementAtX and/or inspectElementAtY are specified then + /// the element at the specified (x,y) location will be inspected. + /// For resize/moving to work correctly you will need to use the implementation. + /// (Set to an instance of ) + /// + /// instance + /// Control used as the parent for DevTools (a custom control will be added to the collection) + /// Control name + /// Dock Style + /// x coordinate (used for inspectElement) + /// y coordinate (used for inspectElement) + /// Returns the that hosts the DevTools instance if successful, otherwise returns null on error. + public static Control ShowDevToolsDocked(this IChromiumWebBrowserBase chromiumWebBrowser, Control parentControl, string controlName = nameof(ChromiumHostControl) + "DevTools", DockStyle dockStyle = DockStyle.Fill, int inspectElementAtX = 0, int inspectElementAtY = 0) + { + if (chromiumWebBrowser.IsDisposed || parentControl == null || parentControl.IsDisposed) + { + return null; + } + + return chromiumWebBrowser.ShowDevToolsDocked((ctrl) => { parentControl.Controls.Add(ctrl); }, controlName, dockStyle, inspectElementAtX, inspectElementAtY); + } + + /// + /// Open DevTools using your own Control as the parent. If inspectElementAtX and/or inspectElementAtY are specified then + /// the element at the specified (x,y) location will be inspected. + /// For resize/moving to work correctly you will need to use the implementation. + /// (Set to an instance of ) + /// + /// instance + /// + /// Action that is Invoked when the DevTools Host Control has been created and needs to be added to it's parent. + /// It's important the control is added to it's intended parent at this point so the + /// can be calculated to set the initial display size. + /// control name + /// Dock Style + /// x coordinate (used for inspectElement) + /// y coordinate (used for inspectElement) + /// Returns the that hosts the DevTools instance if successful, otherwise returns null on error. + public static Control ShowDevToolsDocked(this IChromiumWebBrowserBase chromiumWebBrowser, Action addParentControl, string controlName = nameof(ChromiumHostControl) + "DevTools", DockStyle dockStyle = DockStyle.Fill, int inspectElementAtX = 0, int inspectElementAtY = 0) + { + if (chromiumWebBrowser.IsDisposed || addParentControl == null) + { + return null; + } + + var host = chromiumWebBrowser.GetBrowserHost(); + if (host == null) + { + return null; + } + + var control = new ChromiumHostControl() + { + Name = controlName, + Dock = dockStyle + }; + + control.CreateControl(); + + //It's now time for the user to add the control to it's parent + addParentControl(control); + + //Devtools will be a child of the ChromiumHostControl + var rect = control.ClientRectangle; + var windowInfo = new WindowInfo(); + var windowBounds = new CefSharp.Structs.Rect(rect.X, rect.Y, rect.Width, rect.Height); + windowInfo.SetAsChild(control.Handle, windowBounds); + host.ShowDevTools(windowInfo, inspectElementAtX, inspectElementAtY); + + return control; + } + } +} diff --git a/CefSharp.Wpf.Example/App.xaml b/CefSharp.Wpf.Example/App.xaml index 10e4fa6c93..47e4e21753 100644 --- a/CefSharp.Wpf.Example/App.xaml +++ b/CefSharp.Wpf.Example/App.xaml @@ -1,42 +1,62 @@ - - --> + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + diff --git a/CefSharp.Wpf.Example/App.xaml.cs b/CefSharp.Wpf.Example/App.xaml.cs index 913fd5b603..23eba51f98 100644 --- a/CefSharp.Wpf.Example/App.xaml.cs +++ b/CefSharp.Wpf.Example/App.xaml.cs @@ -13,6 +13,10 @@ public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { + //System.AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport", true); + System.AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.EnablePointerSupport", true); + + #if DEBUG if (!System.Diagnostics.Debugger.IsAttached) { @@ -43,4 +47,4 @@ protected override void OnStartup(StartupEventArgs e) base.OnStartup(e); } } -} \ No newline at end of file +} diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 53a63a08c8..f49f060a7d 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -1,214 +1,52 @@ - - - - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4828DAEC-EF99-4553-B674-4374F77C6D66} - WinExe - Properties - CefSharp.Wpf.Example - CefSharp.Wpf.Example - v4.6.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - - - - 3.5 - Client - - - - - - true - bin\x64\Debug\ - DEBUG;TRACE - full - x64 - prompt - AllRules.ruleset - false - - - bin\x64\Release\ - TRACE - true - pdbonly - x64 - prompt - AllRules.ruleset - false - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - AllRules.ruleset - false - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - AllRules.ruleset - false - - - app.manifest - - - CefSharp.Wpf.Example.Program - - - - ..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.dll - - - ..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.Extras.dll - - - ..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.Platform.dll - - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - - - 3.5 - - - - ..\packages\MvvmLightLibs.5.1.1.0\lib\net45\System.Windows.Interactivity.dll - - - - - - - - - MSBuild:Compile - Designer - MSBuild:Compile - Designer - - - - - - - - - - - - - - - - JavascriptCallbackMainWindow.xaml - - - TouchKeyboardWin10MainWindow.xaml - - - SimpleMainWindow.xaml - - - SpawnBrowsersWindow.xaml - - - BrowserTabView.xaml - - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - MainWindow.xaml - Code - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - - - Code - - - - - - - - - PreserveNewest - - - - - - {23ee5140-2c2c-4b53-a954-10b08dca6bd6} - CefSharp.BrowserSubprocess - - - {7b495581-2271-4f41-9476-acb86e8c864f} - CefSharp.Core - - - {a4394e7b-1155-43a6-989e-8ab72dddc9e4} - CefSharp.Example - - - {e6cb3790-f267-4ac7-892c-2620737682ca} - CefSharp.Wpf - - - {a55848cc-10e7-40cb-addb-04740b16dd43} - CefSharp - - - - - - - - + + + net472 + WinExe + x86;x64 + false + true + AllRules.ruleset + app.manifest + CefSharp.Wpf.Example.Program + false + win-x86;win-x64 + + + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj new file mode 100644 index 0000000000..efd46fe162 --- /dev/null +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj @@ -0,0 +1,66 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + WinExe + net6.0-windows + CefSharp.Wpf.Example + CefSharp.Wpf.Example + true + false + app.manifest + MinimumRecommendedRules.ruleset + x86;x64;arm64 + + arm64 + CefSharp.Wpf.Example.Program + + Major + win-x86;win-x64 + win-x86 + win-x64 + win-arm64 + false + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + PreserveNewest + + + + + + + + + + + + + diff --git a/CefSharp.Wpf.Example/ChangeParentWindow.xaml b/CefSharp.Wpf.Example/ChangeParentWindow.xaml new file mode 100644 index 0000000000..145a367a57 --- /dev/null +++ b/CefSharp.Wpf.Example/ChangeParentWindow.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + +