diff --git a/drivers/LICENSE.chromedriver b/drivers/LICENSE.chromedriver new file mode 100644 index 0000000..2249a28 --- /dev/null +++ b/drivers/LICENSE.chromedriver @@ -0,0 +1,27 @@ +// Copyright 2015 The Chromium Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/drivers/THIRD_PARTY_NOTICES.chromedriver b/drivers/THIRD_PARTY_NOTICES.chromedriver new file mode 100644 index 0000000..a5c0110 --- /dev/null +++ b/drivers/THIRD_PARTY_NOTICES.chromedriver @@ -0,0 +1,11388 @@ +-------------------- +License notice for CityHash +-------------------- +// Copyright (c) 2011 Google, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +-------------------- +License notice for CityHash +-------------------- +// Copyright (c) 2011 Google, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +-------------------- +License notice for Google Double Conversion +-------------------- +Copyright 2006-2011, the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for Paul Hsieh's SuperFastHash +-------------------- +Paul Hsieh OLD BSD license + +Copyright (c) 2010, Paul Hsieh +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. +* Neither my name, Paul Hsieh, nor the names of any other contributors to the + code use may not be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for QUICHE +-------------------- +// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for URI Template Parser +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------- +License notice for Abseil +-------------------- + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +-------------------- +License notice for Implementation of WebDriver BiDi standard +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-------------------- +License notice for mitt +-------------------- +MIT License + +Copyright (c) 2021 Jason Miller + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +-------------------- +License notice for zod +-------------------- +MIT License + +Copyright (c) 2020 Colin McDonnell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + +-------------------- +License notice for WebKit +-------------------- +(WebKit doesn't distribute an explicit license. This LICENSE is derived from +license text in the source.) + +Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +2006, 2007 Alexander Kellett, Alexey Proskuryakov, Alex Mathews, Allan +Sandfeld Jensen, Alp Toker, Anders Carlsson, Andrew Wellington, Antti +Koivisto, Apple Inc., Arthur Langereis, Baron Schwartz, Bjoern Graf, +Brent Fulgham, Cameron Zwarich, Charles Samuels, Christian Dywan, +Collabora Ltd., Cyrus Patel, Daniel Molkentin, Dave Maclachlan, David +Smith, Dawit Alemayehu, Dirk Mueller, Dirk Schulze, Don Gibson, Enrico +Ros, Eric Seidel, Frederik Holljen, Frerich Raabe, Friedmann Kleint, +George Staikos, Google Inc., Graham Dennis, Harri Porten, Henry Mason, +Hiroyuki Ikezoe, Holger Hans Peter Freyther, IBM, James G. Speth, Jan +Alonzo, Jean-Loup Gailly, John Reis, Jonas Witt, Jon Shier, Jonas +Witt, Julien Chaffraix, Justin Haygood, Kevin Ollivier, Kevin Watters, +Kimmo Kinnunen, Kouhei Sutou, Krzysztof Kowalczyk, Lars Knoll, Luca +Bruno, Maks Orlovich, Malte Starostik, Mark Adler, Martin Jones, +Marvin Decker, Matt Lilek, Michael Emmel, Mitz Pettel, mozilla.org, +Netscape Communications Corporation, Nicholas Shanks, Nikolas +Zimmermann, Nokia, Oliver Hunt, Opened Hand, Paul Johnston, Peter +Kelly, Pioneer Research Center USA, Rich Moore, Rob Buis, Robin Dunn, +Ronald Tschalär, Samuel Weinig, Simon Hausmann, Staikos Computing +Services Inc., Stefan Schimanski, Symantec Corporation, The Dojo +Foundation, The Karbon Developers, Thomas Boyer, Tim Copperfield, +Tobias Anton, Torben Weis, Trolltech, University of Cambridge, Vaclav +Slavik, Waldo Bastian, Xan Lopez, Zack Rusin + +The terms and conditions vary from file to file, but are one of: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +*OR* + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. +3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + +-------------------- +License notice for BoringSSL +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +Licenses for support code +------------------------- + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +BoringSSL uses the Chromium test infrastructure to run a continuous build, +trybots etc. The scripts which manage this, and the script for generating build +metadata, are under the Chromium license. Distributing code linked against +BoringSSL does not trigger this license. + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for Fiat-Crypto: Synthesizing Correct-by-Construction Code for Cryptographic Primitives +-------------------- +The Apache License, Version 2.0 (Apache-2.0) + +Copyright 2015-2020 the fiat-crypto authors (see the AUTHORS file) + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for Brotli +-------------------- +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------- +License notice for Compact Encoding Detection +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-------------------- +License notice for Crashpad +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------- +License notice for getopt +-------------------- +Copyright (C) 1997 Gregory Pietsch + +[These files] are hereby placed in the public domain without restrictions. Just +give the author credit, don't claim you wrote it or prevent anyone else from +using it. + +-------------------- +License notice for CRC32C +-------------------- +Copyright 2017, The CRC32C Authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for d3 +-------------------- +Copyright 2010-2023 Mike Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +-------------------- +License notice for dav1d is an AV1 decoder :) +-------------------- +Copyright © 2018, VideoLAN and dav1d authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for Dawn +-------------------- +// Copyright 2017-2023 The Dawn & Tint Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for Expat XML Parser +-------------------- +Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper +Copyright (c) 2001-2022 Expat maintainers + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------- +License notice for ffmpeg +-------------------- +# License + +Most files in FFmpeg are under the GNU Lesser General Public License version 2.1 +or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other +files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to +FFmpeg. + +Some optional parts of FFmpeg are licensed under the GNU General Public License +version 2 or later (GPL v2+). See the file `COPYING.GPLv2` for details. None of +these parts are used by default, you have to explicitly pass `--enable-gpl` to +configure to activate them. In this case, FFmpeg's license changes to GPL v2+. + +Specifically, the GPL parts of FFmpeg are: + +- libpostproc +- optional x86 optimization in the files + - `libavcodec/x86/flac_dsp_gpl.asm` + - `libavcodec/x86/idct_mmx.c` + - `libavfilter/x86/vf_removegrain.asm` +- the following building and testing tools + - `compat/solaris/make_sunver.pl` + - `doc/t2h.pm` + - `doc/texi2pod.pl` + - `libswresample/tests/swresample.c` + - `tests/checkasm/*` + - `tests/tiny_ssim.c` +- the following filters in libavfilter: + - `signature_lookup.c` + - `vf_blackframe.c` + - `vf_boxblur.c` + - `vf_colormatrix.c` + - `vf_cover_rect.c` + - `vf_cropdetect.c` + - `vf_delogo.c` + - `vf_eq.c` + - `vf_find_rect.c` + - `vf_fspp.c` + - `vf_histeq.c` + - `vf_hqdn3d.c` + - `vf_kerndeint.c` + - `vf_lensfun.c` (GPL version 3 or later) + - `vf_mcdeint.c` + - `vf_mpdecimate.c` + - `vf_nnedi.c` + - `vf_owdenoise.c` + - `vf_perspective.c` + - `vf_phase.c` + - `vf_pp.c` + - `vf_pp7.c` + - `vf_pullup.c` + - `vf_repeatfields.c` + - `vf_sab.c` + - `vf_signature.c` + - `vf_smartblur.c` + - `vf_spp.c` + - `vf_stereo3d.c` + - `vf_super2xsai.c` + - `vf_tinterlace.c` + - `vf_uspp.c` + - `vf_vaguedenoiser.c` + - `vsrc_mptestsrc.c` + +Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then +the configure parameter `--enable-version3` will activate this licensing option +for you. Read the file `COPYING.LGPLv3` or, if you have enabled GPL parts, +`COPYING.GPLv3` to learn the exact legal terms that apply in this case. + +There are a handful of files under other licensing terms, namely: + +* The files `libavcodec/jfdctfst.c`, `libavcodec/jfdctint_template.c` and + `libavcodec/jrevdct.c` are taken from libjpeg, see the top of the files for + licensing details. Specifically note that you must credit the IJG in the + documentation accompanying your program if you only distribute executables. + You must also indicate any changes including additions and deletions to + those three files in the documentation. +* `tests/reference.pnm` is under the expat license. + + +## External libraries + +FFmpeg can be combined with a number of external libraries, which sometimes +affect the licensing of binaries resulting from the combination. + +### Compatible libraries + +The following libraries are under GPL version 2: +- avisynth +- frei0r +- libcdio +- libdavs2 +- librubberband +- libvidstab +- libx264 +- libx265 +- libxavs +- libxavs2 +- libxvid + +When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by +passing `--enable-gpl` to configure. + +The following libraries are under LGPL version 3: +- gmp +- libaribb24 +- liblensfun + +When combining them with FFmpeg, use the configure option `--enable-version3` to +upgrade FFmpeg to the LGPL v3. + +The VMAF, mbedTLS, RK MPI, OpenCORE and VisualOn libraries are under the Apache License +2.0. That license is incompatible with the LGPL v2.1 and the GPL v2, but not with +version 3 of those licenses. So to combine these libraries with FFmpeg, the +license version needs to be upgraded by passing `--enable-version3` to configure. + +The smbclient library is under the GPL v3, to combine it with FFmpeg, +the options `--enable-gpl` and `--enable-version3` have to be passed to +configure to upgrade FFmpeg to the GPL v3. + +### Incompatible libraries + +There are certain libraries you can combine with FFmpeg whose licenses are not +compatible with the GPL and/or the LGPL. If you wish to enable these +libraries, even in circumstances that their license may be incompatible, pass +`--enable-nonfree` to configure. This will cause the resulting binary to be +unredistributable. + +The Fraunhofer FDK AAC and OpenSSL libraries are under licenses which are +incompatible with the GPLv2 and v3. To the best of our knowledge, they are +compatible with the LGPL. + + +******************************************************************************** + +libavformat/oggparsetheora.c + +Copyright (C) 2005 Matthieu CASTET, Alex Beregszaszi + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +******************************************************************************** + +libavutil/x86/x86inc.asm + +x86inc.asm: x86 abstraction layer + + Copyright (C) 2005-2024 x264 project + + Authors: Loren Merritt + Henrik Gramner + Anton Mitrofanov + Fiona Glaser + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +******************************************************************************** + +libavcodec/mips/compute_antialias_fixed.h +libavcodec/mips/compute_antialias_float.h +libavutil/fixed_dsp.c +libavutil/fixed_dsp.h +libavutil/mips/libm_mips.h +libavutil/softfloat_tables.h + +Copyright (c) 2012 +MIPS Technologies, Inc., California. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +3. Neither the name of the MIPS Technologies, Inc., nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +Authors: +Branimir Vasic (bvasic@mips.com) +Darko Laus (darko@mips.com) +Djordje Pesut (djordje@mips.com) +Goran Cordasic (goran@mips.com) +Nedeljko Babic (nedeljko.babic imgtec com) +Mirjana Vulin (mvulin@mips.com) +Stanislav Ocovaj (socovaj@mips.com) +Zoran Lukic (zoranl@mips.com) + +******************************************************************************** + +libavformat/oggdec.c +libavformat/oggdec.h +libavformat/oggparseogm.c +libavformat/oggparsevorbis.c + +Copyright (C) 2005 Michael Ahlberg, MÃ¥ns RullgÃ¥rd + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +******************************************************************************** + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +-------------------- +License notice for FlatBuffers +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------- +License notice for FreeType +-------------------- + The FreeType Project LICENSE + ---------------------------- + + 2006-Jan-27 + + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + """ + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + """ + + Please replace with the value from the FreeType version you + actually use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty +-------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts +----------- + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + https://www.freetype.org + + +--- end of FTL.TXT --- + +-------------------- +License notice for harfbuzz-ng +-------------------- +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010-2022 Google, Inc. +Copyright © 2015-2020 Ebrahim Byagowi +Copyright © 2019,2020 Facebook, Inc. +Copyright © 2012,2015 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2011 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2005,2006,2020,2021,2022,2023 Behdad Esfahbod +Copyright © 2004,2007,2008,2009,2010,2013,2021,2022,2023 Red Hat, Inc. +Copyright © 1998-2005 David Turner and Werner Lemberg +Copyright © 2016 Igalia S.L. +Copyright © 2022 Matthias Clasen +Copyright © 2018,2021 Khaled Hosny +Copyright © 2018,2019,2020 Adobe, Inc +Copyright © 2013-2015 Alexei Podtelezhnikov + +For full copyright notices consult the individual files in the package. + + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + +-------------------- +License notice for icu +-------------------- +UNICODE LICENSE V3 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 2016-2023 Unicode, Inc. + +NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of data files and any associated documentation (the "Data Files") or +software and any associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that either (a) +this copyright and permission notice appear with all copies of the Data +Files or Software, or (b) this copyright and permission notice appear in +associated Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +THIRD PARTY RIGHTS. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA +FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in these Data Files or Software without prior written +authorization of the copyright holder. + +---------------------------------------------------------------------- + +Third-Party Software Licenses + +This section contains third-party software notices and/or additional +terms for licensed third-party software components included within ICU +libraries. + +---------------------------------------------------------------------- + +ICU License - ICU 1.8.1 to ICU 57.1 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. + +---------------------------------------------------------------------- + +Chinese/Japanese Word Break Dictionary Data (cjdict.txt) + + # The Google Chrome software developed by Google is licensed under + # the BSD license. Other software included in this distribution is + # provided under other licenses, as set forth below. + # + # The BSD License + # http://opensource.org/licenses/bsd-license.php + # Copyright (C) 2006-2008, Google Inc. + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided with + # the distribution. + # Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + # + # The word list in cjdict.txt are generated by combining three word lists + # listed below with further processing for compound word breaking. The + # frequency is generated with an iterative training against Google web + # corpora. + # + # * Libtabe (Chinese) + # - https://sourceforge.net/project/?group_id=1519 + # - Its license terms and conditions are shown below. + # + # * IPADIC (Japanese) + # - http://chasen.aist-nara.ac.jp/chasen/distribution.html + # - Its license terms and conditions are shown below. + # + # ---------COPYING.libtabe ---- BEGIN-------------------- + # + # /* + # * Copyright (c) 1999 TaBE Project. + # * Copyright (c) 1999 Pai-Hsiang Hsiao. + # * All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the TaBE Project nor the names of its + # * contributors may be used to endorse or promote products derived + # * from this software without specific prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # /* + # * Copyright (c) 1999 Computer Systems and Communication Lab, + # * Institute of Information Science, Academia + # * Sinica. All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the Computer Systems and Communication Lab + # * nor the names of its contributors may be used to endorse or + # * promote products derived from this software without specific + # * prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + # University of Illinois + # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 + # + # ---------------COPYING.libtabe-----END-------------------------------- + # + # + # ---------------COPYING.ipadic-----BEGIN------------------------------- + # + # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science + # and Technology. All Rights Reserved. + # + # Use, reproduction, and distribution of this software is permitted. + # Any copy of this software, whether in its original form or modified, + # must include both the above copyright notice and the following + # paragraphs. + # + # Nara Institute of Science and Technology (NAIST), + # the copyright holders, disclaims all warranties with regard to this + # software, including all implied warranties of merchantability and + # fitness, in no event shall NAIST be liable for + # any special, indirect or consequential damages or any damages + # whatsoever resulting from loss of use, data or profits, whether in an + # action of contract, negligence or other tortuous action, arising out + # of or in connection with the use or performance of this software. + # + # A large portion of the dictionary entries + # originate from ICOT Free Software. The following conditions for ICOT + # Free Software applies to the current dictionary as well. + # + # Each User may also freely distribute the Program, whether in its + # original form or modified, to any third party or parties, PROVIDED + # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear + # on, or be attached to, the Program, which is distributed substantially + # in the same form as set out herein and that such intended + # distribution, if actually made, will neither violate or otherwise + # contravene any of the laws and regulations of the countries having + # jurisdiction over the User or the intended distribution itself. + # + # NO WARRANTY + # + # The program was produced on an experimental basis in the course of the + # research and development conducted during the project and is provided + # to users as so produced on an experimental basis. Accordingly, the + # program is provided without any warranty whatsoever, whether express, + # implied, statutory or otherwise. The term "warranty" used herein + # includes, but is not limited to, any warranty of the quality, + # performance, merchantability and fitness for a particular purpose of + # the program and the nonexistence of any infringement or violation of + # any right of any third party. + # + # Each user of the program will agree and understand, and be deemed to + # have agreed and understood, that there is no warranty whatsoever for + # the program and, accordingly, the entire risk arising from or + # otherwise connected with the program is assumed by the user. + # + # Therefore, neither ICOT, the copyright holder, or any other + # organization that participated in or was otherwise related to the + # development of the program and their respective officials, directors, + # officers and other employees shall be held liable for any and all + # damages, including, without limitation, general, special, incidental + # and consequential damages, arising out of or otherwise in connection + # with the use or inability to use the program or any product, material + # or result produced or otherwise obtained by using the program, + # regardless of whether they have been advised of, or otherwise had + # knowledge of, the possibility of such damages at any time during the + # project or thereafter. Each user will be deemed to have agreed to the + # foregoing by his or her commencement of use of the program. The term + # "use" as used herein includes, but is not limited to, the use, + # modification, copying and distribution of the program and the + # production of secondary products from the program. + # + # In the case where the program, whether in its original form or + # modified, was distributed or delivered to or received by a user from + # any person, organization or entity other than ICOT, unless it makes or + # grants independently of ICOT any specific warranty to the user in + # writing, such person, organization or entity, will also be exempted + # from and not be held liable to the user for any such damages as noted + # above as far as the program is concerned. + # + # ---------------COPYING.ipadic-----END---------------------------------- + +---------------------------------------------------------------------- + +Lao Word Break Dictionary Data (laodict.txt) + + # Copyright (C) 2016 and later: Unicode, Inc. and others. + # License & terms of use: http://www.unicode.org/copyright.html + # Copyright (c) 2015 International Business Machines Corporation + # and others. All Rights Reserved. + # + # Project: https://github.com/rober42539/lao-dictionary + # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt + # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt + # (copied below) + # + # This file is derived from the above dictionary version of Nov 22, 2020 + # ---------------------------------------------------------------------- + # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, this + # list of conditions and the following disclaimer. Redistributions in binary + # form must reproduce the above copyright notice, this list of conditions and + # the following disclaimer in the documentation and/or other materials + # provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # OF THE POSSIBILITY OF SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Burmese Word Break Dictionary Data (burmesedict.txt) + + # Copyright (c) 2014 International Business Machines Corporation + # and others. All Rights Reserved. + # + # This list is part of a project hosted at: + # github.com/kanyawtech/myanmar-karen-word-lists + # + # -------------------------------------------------------------------------- + # Copyright (c) 2013, LeRoy Benjamin Sharon + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions + # are met: Redistributions of source code must retain the above + # copyright notice, this list of conditions and the following + # disclaimer. Redistributions in binary form must reproduce the + # above copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided + # with the distribution. + # + # Neither the name Myanmar Karen Word Lists, nor the names of its + # contributors may be used to endorse or promote products derived + # from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + # SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Time Zone Database + + ICU uses the public domain data and code derived from Time Zone +Database for its time zone support. The ownership of the TZ database +is explained in BCP 175: Procedure for Maintaining the Time Zone +Database section 7. + + # 7. Database Ownership + # + # The TZ database itself is not an IETF Contribution or an IETF + # document. Rather it is a pre-existing and regularly updated work + # that is in the public domain, and is intended to remain in the + # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do + # not apply to the TZ Database or contributions that individuals make + # to it. Should any claims be made and substantiated against the TZ + # Database, the organization that is providing the IANA + # Considerations defined in this RFC, under the memorandum of + # understanding with the IETF, currently ICANN, may act in accordance + # with all competent court orders. No ownership claims will be made + # by ICANN or the IETF Trust on the database or the code. Any person + # making a contribution to the database or code waives all rights to + # future claims in that contribution or in the TZ Database. + +---------------------------------------------------------------------- + +Google double-conversion + +Copyright 2006-2011, the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- + +File: aclocal.m4 (only for ICU4C) +Section: pkg.m4 - Macros to locate and utilise pkg-config. + + +Copyright © 2004 Scott James Remnant . +Copyright © 2012-2015 Dan Nicholson + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: config.guess (only for ICU4C) + + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, see . + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. This Exception is an additional permission under section 7 +of the GNU General Public License, version 3 ("GPLv3"). + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: install-sh (only for ICU4C) + + +Copyright 1991 by the Massachusetts Institute of Technology + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of M.I.T. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. M.I.T. makes no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. + +-------------------- +License notice for ipcz +-------------------- +// Copyright 2022 The Chromium Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google LLC nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for jsoncpp +-------------------- +The JsonCpp library's source code, including accompanying documentation, +tests and demonstration applications, are licensed under the following +conditions... + +The author (Baptiste Lepilleur) explicitly disclaims copyright in all +jurisdictions which recognize such a disclaimer. In such jurisdictions, +this software is released into the Public Domain. + +In jurisdictions which do not recognize Public Domain property (e.g. Germany as of +2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is +released under the terms of the MIT License (see below). + +In jurisdictions which recognize Public Domain property, the user of this +software may choose to accept it either as 1) Public Domain, 2) under the +conditions of the MIT License (see below), or 3) under the terms of dual +Public Domain/MIT License conditions described here, as they choose. + +The MIT License is about as close to Public Domain as a license can get, and is +described in clear, concise terms at: + + http://en.wikipedia.org/wiki/MIT_License + +The full text of the MIT License follows: + +======================================================================== +Copyright (c) 2007-2010 Baptiste Lepilleur + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +======================================================================== +(END LICENSE TEXT) + +The MIT license is compatible with both the GPL and commercial +software, affording one all of the rights of Public Domain with the +minor nuisance of being required to keep the above copyright notice +and license text in the source code. Note also that by accepting the +Public Domain "license" you can re-license your copy using whatever +license you like. + +-------------------- +License notice for Alliance for Open Media Video Codec +-------------------- +Copyright (c) 2016, Alliance for Open Media. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +-------------------- +License notice for Alliance for Open Media Video Codec +-------------------- +Alliance for Open Media Patent License 1.0 + +1. License Terms. + +1.1. Patent License. Subject to the terms and conditions of this License, each + Licensor, on behalf of itself and successors in interest and assigns, + grants Licensee a non-sublicensable, perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as expressly stated in this + License) patent license to its Necessary Claims to make, use, sell, offer + for sale, import or distribute any Implementation. + +1.2. Conditions. + +1.2.1. Availability. As a condition to the grant of rights to Licensee to make, + sell, offer for sale, import or distribute an Implementation under + Section 1.1, Licensee must make its Necessary Claims available under + this License, and must reproduce this License with any Implementation + as follows: + + a. For distribution in source code, by including this License in the + root directory of the source code with its Implementation. + + b. For distribution in any other form (including binary, object form, + and/or hardware description code (e.g., HDL, RTL, Gate Level Netlist, + GDSII, etc.)), by including this License in the documentation, legal + notices, and/or other written materials provided with the + Implementation. + +1.2.2. Additional Conditions. This license is directly from Licensor to + Licensee. Licensee acknowledges as a condition of benefiting from it + that no rights from Licensor are received from suppliers, distributors, + or otherwise in connection with this License. + +1.3. Defensive Termination. If any Licensee, its Affiliates, or its agents + initiates patent litigation or files, maintains, or voluntarily + participates in a lawsuit against another entity or any person asserting + that any Implementation infringes Necessary Claims, any patent licenses + granted under this License directly to the Licensee are immediately + terminated as of the date of the initiation of action unless 1) that suit + was in response to a corresponding suit regarding an Implementation first + brought against an initiating entity, or 2) that suit was brought to + enforce the terms of this License (including intervention in a third-party + action by a Licensee). + +1.4. Disclaimers. The Reference Implementation and Specification are provided + "AS IS" and without warranty. The entire risk as to implementing or + otherwise using the Reference Implementation or Specification is assumed + by the implementer and user. Licensor expressly disclaims any warranties + (express, implied, or otherwise), including implied warranties of + merchantability, non-infringement, fitness for a particular purpose, or + title, related to the material. IN NO EVENT WILL LICENSOR BE LIABLE TO + ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, + INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF + ACTION OF ANY KIND WITH RESPECT TO THIS LICENSE, WHETHER BASED ON BREACH + OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR + NOT THE OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +2. Definitions. + +2.1. Affiliate. "Affiliate" means an entity that directly or indirectly + Controls, is Controlled by, or is under common Control of that party. + +2.2. Control. "Control" means direct or indirect control of more than 50% of + the voting power to elect directors of that corporation, or for any other + entity, the power to direct management of such entity. + +2.3. Decoder. "Decoder" means any decoder that conforms fully with all + non-optional portions of the Specification. + +2.4. Encoder. "Encoder" means any encoder that produces a bitstream that can + be decoded by a Decoder only to the extent it produces such a bitstream. + +2.5. Final Deliverable. "Final Deliverable" means the final version of a + deliverable approved by the Alliance for Open Media as a Final + Deliverable. + +2.6. Implementation. "Implementation" means any implementation, including the + Reference Implementation, that is an Encoder and/or a Decoder. An + Implementation also includes components of an Implementation only to the + extent they are used as part of an Implementation. + +2.7. License. "License" means this license. + +2.8. Licensee. "Licensee" means any person or entity who exercises patent + rights granted under this License. + +2.9. Licensor. "Licensor" means (i) any Licensee that makes, sells, offers + for sale, imports or distributes any Implementation, or (ii) a person + or entity that has a licensing obligation to the Implementation as a + result of its membership and/or participation in the Alliance for Open + Media working group that developed the Specification. + +2.10. Necessary Claims. "Necessary Claims" means all claims of patents or + patent applications, (a) that currently or at any time in the future, + are owned or controlled by the Licensor, and (b) (i) would be an + Essential Claim as defined by the W3C Policy as of February 5, 2004 + (https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential) + as if the Specification was a W3C Recommendation; or (ii) are infringed + by the Reference Implementation. + +2.11. Reference Implementation. "Reference Implementation" means an Encoder + and/or Decoder released by the Alliance for Open Media as a Final + Deliverable. + +2.12. Specification. "Specification" means the specification designated by + the Alliance for Open Media as a Final Deliverable for which this + License was issued. + + +-------------------- +License notice for libjpeg-turbo +-------------------- +libjpeg-turbo Licenses +====================== + +libjpeg-turbo is covered by three compatible BSD-style open source licenses: + +- The IJG (Independent JPEG Group) License, which is listed in + [README.ijg](README.ijg) + + This license applies to the libjpeg API library and associated programs + (any code inherited from libjpeg, and any modifications to that code.) + +- The Modified (3-clause) BSD License, which is listed below + + This license covers the TurboJPEG API library and associated programs, as + well as the build system. + +- The [zlib License](https://opensource.org/licenses/Zlib) + + This license is a subset of the other two, and it covers the libjpeg-turbo + SIMD extensions. + + +Complying with the libjpeg-turbo Licenses +========================================= + +This section provides a roll-up of the libjpeg-turbo licensing terms, to the +best of our understanding. + +1. If you are distributing a modified version of the libjpeg-turbo source, + then: + + 1. You cannot alter or remove any existing copyright or license notices + from the source. + + **Origin** + - Clause 1 of the IJG License + - Clause 1 of the Modified BSD License + - Clauses 1 and 3 of the zlib License + + 2. You must add your own copyright notice to the header of each source + file you modified, so others can tell that you modified that file (if + there is not an existing copyright header in that file, then you can + simply add a notice stating that you modified the file.) + + **Origin** + - Clause 1 of the IJG License + - Clause 2 of the zlib License + + 3. You must include the IJG README file, and you must not alter any of the + copyright or license text in that file. + + **Origin** + - Clause 1 of the IJG License + +2. If you are distributing only libjpeg-turbo binaries without the source, or + if you are distributing an application that statically links with + libjpeg-turbo, then: + + 1. Your product documentation must include a message stating: + + This software is based in part on the work of the Independent JPEG + Group. + + **Origin** + - Clause 2 of the IJG license + + 2. If your binary distribution includes or uses the TurboJPEG API, then + your product documentation must include the text of the Modified BSD + License (see below.) + + **Origin** + - Clause 2 of the Modified BSD License + +3. You cannot use the name of the IJG or The libjpeg-turbo Project or the + contributors thereof in advertising, publicity, etc. + + **Origin** + - IJG License + - Clause 3 of the Modified BSD License + +4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be + free of defects, nor do we accept any liability for undesirable + consequences resulting from your use of the software. + + **Origin** + - IJG License + - Modified BSD License + - zlib License + + +The Modified (3-clause) BSD License +=================================== + +Copyright (C)2009-2023 D. R. Commander. All Rights Reserved.
+Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +Why Three Licenses? +=================== + +The zlib License could have been used instead of the Modified (3-clause) BSD +License, and since the IJG License effectively subsumes the distribution +conditions of the zlib License, this would have effectively placed +libjpeg-turbo binary distributions under the IJG License. However, the IJG +License specifically refers to the Independent JPEG Group and does not extend +attribution and endorsement protections to other entities. Thus, it was +desirable to choose a license that granted us the same protections for new code +that were granted to the IJG for code derived from their software. + +-------------------- +License notice for libpng +-------------------- +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2019 The PNG Reference Library Authors. + * Copyright (c) 2018-2019 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. + +-------------------- +License notice for libsrtp +-------------------- +/* + * + * Copyright (c) 2001-2017 Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +-------------------- +License notice for URL Pattern Library +-------------------- +The MIT License (MIT) + +Copyright 2020 The Chromium Authors +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------- +License notice for libvpx +-------------------- +Copyright (c) 2010, The WebM Project authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google, nor the WebM Project, nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------- +License notice for libvpx +-------------------- +Additional IP Rights Grant (Patents) +------------------------------------ + +"These implementations" means the copyrightable works that implement the WebM +codecs distributed by Google as part of the WebM Project. + +Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge, +royalty-free, irrevocable (except as stated in this section) patent license to +make, have made, use, offer to sell, sell, import, transfer, and otherwise +run, modify and propagate the contents of these implementations of WebM, where +such license applies only to those patent claims, both currently owned by +Google and acquired in the future, licensable by Google that are necessarily +infringed by these implementations of WebM. This grant does not include claims +that would be infringed only as a consequence of further modification of these +implementations. If you or your agent or exclusive licensee institute or order +or agree to the institution of patent litigation or any other patent +enforcement activity against any entity (including a cross-claim or +counterclaim in a lawsuit) alleging that any of these implementations of WebM +or any code incorporated within any of these implementations of WebM +constitute direct or contributory patent infringement, or inducement of +patent infringement, then any patent rights granted to you under this License +for these implementations of WebM shall terminate as of the date such +litigation is filed. + +-------------------- +License notice for WebP image encoder/decoder +-------------------- +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------- +License notice for WebP image encoder/decoder +-------------------- +Additional IP Rights Grant (Patents) +------------------------------------ + +"These implementations" means the copyrightable works that implement the WebM +codecs distributed by Google as part of the WebM Project. + +Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge, +royalty-free, irrevocable (except as stated in this section) patent license to +make, have made, use, offer to sell, sell, import, transfer, and otherwise +run, modify and propagate the contents of these implementations of WebM, where +such license applies only to those patent claims, both currently owned by +Google and acquired in the future, licensable by Google that are necessarily +infringed by these implementations of WebM. This grant does not include claims +that would be infringed only as a consequence of further modification of these +implementations. If you or your agent or exclusive licensee institute or order +or agree to the institution of patent litigation or any other patent +enforcement activity against any entity (including a cross-claim or +counterclaim in a lawsuit) alleging that any of these implementations of WebM +or any code incorporated within any of these implementations of WebM +constitute direct or contributory patent infringement, or inducement of +patent infringement, then any patent rights granted to you under this License +for these implementations of WebM shall terminate as of the date such +litigation is filed. + +-------------------- +License notice for libyuv +-------------------- +Copyright 2011 The LibYuv Project Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for Lit +-------------------- +BSD 3-Clause License + +Copyright (c) 2017 Google LLC. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------- +License notice for llvm-libc +-------------------- +============================================================================== +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2007-2019 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +-------------------- +License notice for Lottie Web +-------------------- +The MIT License (MIT) + +Copyright (c) 2015 Bodymovin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +################################################################################ +# License headers for subpackages +################################################################################ + +Transformation Matrix v2.0 +(c) Epistemex 2014-2015 +www.epistemex.com +By Ken Fyrstenberg +Contributions by leeoniya. +License: MIT, header required. + + +################################################################################ + +Copyright 2014 David Bau. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +################################################################################ + +BezierEasing - use bezier curve for transition easing function +by Gaëtan Renaudeau 2014 - 2015 – MIT License + +Credits: is based on Firefox's nsSMILKeySpline.cpp +Usage: +var spline = BezierEasing([ 0.25, 0.1, 0.25, 1.0 ]) +spline.get(x) => returns the easing value | x must be in [0, 1] range + +-------------------- +License notice for Metrics Protos +-------------------- +// Copyright 2015 The Chromium Authors +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for modp base64 decoder +-------------------- + * MODP_B64 - High performance base64 encoder/decoder + * Version 1.3 -- 17-Mar-2006 + * http://modp.com/release/base64 + * + * Copyright (c) 2005, 2006 Nick Galbreath -- nickg [at] modp [dot] com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the modp.com nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for OpenH264 +-------------------- +Copyright (c) 2013, Cisco Systems +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------- +License notice for opus +-------------------- +Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, + Jean-Marc Valin, Timothy B. Terriberry, + CSIRO, Gregory Maxwell, Mark Borgerding, + Erik de Castro Lopo + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Opus is subject to the royalty-free patent licenses which are +specified at: + +Xiph.Org Foundation: +https://datatracker.ietf.org/ipr/1524/ + +Microsoft Corporation: +https://datatracker.ietf.org/ipr/1914/ + +Broadcom Corporation: +https://datatracker.ietf.org/ipr/1526/ + +-------------------- +License notice for Perfetto +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +------------------ + +Files: * except those files noted below + + Copyright (c) 2017, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +------------------ + +Files: src/trace_processor/perfetto_sql/stdlib/chromium/*, protos/third_party/chromium/*, test/trace_processor/diff_tests/stdlib/chrome/* + + Copyright 2015 The Chromium Authors + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +------------------ + +Files: src/trace_processor/perfetto_sql/preprocessor/preprocessor_grammar.{c, h} + +The author disclaims copyright to this source code. In place of a legal notice, here is a blessing: + +May you do good and not evil. +May you find forgiveness for yourself and forgive others. +May you share freely, never taking more than you give. + +-------------------- +License notice for PFFFT: a pretty fast FFT. +-------------------- +Copyright (c) 2013 Julien Pommier ( pommier@modartt.com ) + +Based on original fortran 77 code from FFTPACKv4 from NETLIB, +authored by Dr Paul Swarztrauber of NCAR, in 1985. + +As confirmed by the NCAR fftpack software curators, the following +FFTPACKv5 license applies to FFTPACKv4 sources. My changes are +released under the same terms. + +FFTPACK license: + +http://www.cisl.ucar.edu/css/software/fftpack5/ftpk.html + +Copyright (c) 2004 the University Corporation for Atmospheric +Research ("UCAR"). All rights reserved. Developed by NCAR's +Computational and Information Systems Laboratory, UCAR, +www.cisl.ucar.edu. + +Redistribution and use of the Software in source and binary forms, +with or without modification, is permitted provided that the +following conditions are met: + +- Neither the names of NCAR's Computational and Information Systems +Laboratory, the University Corporation for Atmospheric Research, +nor the names of its sponsors or contributors may be used to +endorse or promote products derived from this Software without +specific prior written permission. + +- Redistributions of source code must retain the above copyright +notices, this list of conditions, and the disclaimer below. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions, and the disclaimer below in the +documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +-------------------- +License notice for Polymer +-------------------- +// Copyright (c) 2012 The Polymer Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for Protocol Buffers +-------------------- +Copyright 2008 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + +-------------------- +License notice for Protocol Buffers (javascript) +-------------------- +BSD 3-Clause License + +Copyright (c) 2022, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for re2 - an efficient, principled regular expression library +-------------------- +// Copyright (c) 2009 The RE2 Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for Recurrent neural network for audio noise reduction +-------------------- +Copyright (c) 2017, Mozilla +Copyright (c) 2007-2017, Jean-Marc Valin +Copyright (c) 2005-2017, Xiph.Org Foundation +Copyright (c) 2003-2004, Mark Borgerding + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.Org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for adler2 +-------------------- + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/LICENSE-2.0 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for bitflags +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for bytemuck +-------------------- +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for bytemuck_derive +-------------------- +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for cfg-if +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for crc32fast +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +-------------------- +License notice for cxx +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for cxxbridge-macro +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for fdeflate +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +-------------------- +License notice for flate2 +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for foldhash +-------------------- +Copyright (c) 2024 Orson Peters + +This software is provided 'as-is', without any express or implied warranty. In +no event will the authors be held liable for any damages arising from the use of +this software. + +Permission is granted to anyone to use this software for any purpose, including +commercial applications, and to alter it and redistribute it freely, subject to +the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim + that you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. +-------------------- +License notice for font-types +-------------------- +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +Copyright 2019 Colin Rothfels + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for itoa +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for log +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for memchr +-------------------- +The MIT License (MIT) + +Copyright (c) 2015 Andrew Gallant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------- +License notice for miniz_oxide +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +-------------------- +License notice for png +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for proc-macro2 +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for quote +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for read-fonts +-------------------- +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +Copyright 2019 Colin Rothfels + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for rustversion +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for ryu +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for serde +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for serde_derive +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for serde_json_lenient +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for simd-adler32 +-------------------- +MIT License + +Copyright (c) [2021] [Marvin Countryman] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +-------------------- +License notice for skrifa +-------------------- +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +Copyright 2019 Colin Rothfels + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +-------------------- +License notice for syn +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for unicode-ident +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +-------------------- +License notice for unicode-ident +-------------------- +UNICODE LICENSE V3 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2023 Unicode, Inc. + +NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of data files and any associated documentation (the "Data Files") or +software and any associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that either (a) +this copyright and permission notice appear with all copies of the Data +Files or Software, or (b) this copyright and permission notice appear in +associated Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +THIRD PARTY RIGHTS. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA +FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in these Data Files or Software without prior written +authorization of the copyright holder. + +-------------------- +License notice for Selenium Atoms +-------------------- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2022 Software Freedom Conservancy (SFC) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------- +License notice for Sizzle +-------------------- +MIT License +---- + +Copyright (c) 2009 John Resig + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------- +License notice for Wicked Good XPath +-------------------- +The MIT License + +Copyright (c) 2007 Cybozu Labs, Inc. +Copyright (c) 2012 Google Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------- +License notice for simdutf unicode transcoder +-------------------- +Copyright 2021 The simdutf authors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------- +License notice for sqlite +-------------------- +The author disclaims copyright to this source code. In place of +a legal notice, here is a blessing: + + May you do good and not evil. + May you find forgiveness for yourself and forgive others. + May you share freely, never taking more than you give. + +-------------------- +License notice for Vulkan API headers +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------- +License notice for WebRTC +-------------------- +Copyright (c) 2011, The WebRTC project authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------- +License notice for General Purpose FFT (Fast Fourier/Cosine/Sine Transform) Package +-------------------- +/* + * http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html + * Copyright Takuya OOURA, 1996-2001 + * + * You may use, copy, modify and distribute this code for any purpose (include + * commercial use) and without fee. Please refer to this package when you modify + * this code. + */ + +-------------------- +License notice for spl sqrt floor +-------------------- +/* + * Written by Wilco Dijkstra, 1996. The following email exchange establishes the + * license. + * + * From: Wilco Dijkstra + * Date: Fri, Jun 24, 2011 at 3:20 AM + * Subject: Re: sqrt routine + * To: Kevin Ma + * Hi Kevin, + * Thanks for asking. Those routines are public domain (originally posted to + * comp.sys.arm a long time ago), so you can use them freely for any purpose. + * Cheers, + * Wilco + * + * ----- Original Message ----- + * From: "Kevin Ma" + * To: + * Sent: Thursday, June 23, 2011 11:44 PM + * Subject: Fwd: sqrt routine + * Hi Wilco, + * I saw your sqrt routine from several web sites, including + * http://www.finesse.demon.co.uk/steven/sqrt.html. + * Just wonder if there's any copyright information with your Successive + * approximation routines, or if I can freely use it for any purpose. + * Thanks. + * Kevin + */ + +-------------------- +License notice for fft +-------------------- +/* + * Copyright(c)1995,97 Mark Olesen + * Queen's Univ at Kingston (Canada) + * + * Permission to use, copy, modify, and distribute this software for + * any purpose without fee is hereby granted, provided that this + * entire notice is included in all copies of any software which is + * or includes a copy or modification of this software and in all + * copies of the supporting documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR QUEEN'S + * UNIVERSITY AT KINGSTON MAKES ANY REPRESENTATION OR WARRANTY OF ANY + * KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS + * FITNESS FOR ANY PARTICULAR PURPOSE. + * + * All of which is to say that you can do what you like with this + * source code provided you don't try to sell it as your own and you + * include an unaltered copy of this message (including the + * copyright). + * + * It is also implicitly understood that bug fixes and improvements + * should make their way back to the general Internet community so + * that everyone benefits. + */ + +-------------------- +License notice for In line A-law and u-law conversion routines +-------------------- +/* + * SpanDSP - a series of DSP components for telephony + * + * g711.h - In line A-law and u-law conversion routines + * + * Written by Steve Underwood + * + * Copyright (C) 2001 Steve Underwood + * + * Despite my general liking of the GPL, I place this code in the + * public domain for the benefit of all mankind - even the slimy + * ones who might try to proprietize my work and use it to my + * detriment. + */ + +-------------------- +License notice for The ITU G.722 codec, encode and decode part. +-------------------- +/* + * SpanDSP - a series of DSP components for telephony + * + * g722_decode.c - The ITU G.722 codec, decode part. + * + * Written by Steve Underwood + * + * Copyright (C) 2005 Steve Underwood + * + * Despite my general liking of the GPL, I place my own contributions + * to this code in the public domain for the benefit of all mankind - + * even the slimy ones who might try to proprietize my work and use it + * to my detriment. + * + * Based in part on a single channel G.722 codec which is: + * + * Copyright (c) CMU 1993 + * Computer Science, Speech Group + * Chengxiang Lu and Alex Hauptmann + */ + +-------------------- +License notice for C++ Signal/Slot Library +-------------------- +// sigslot.h: Signal/Slot classes +// +// Written by Sarah Thompson (sarah@telergy.com) 2002. +// +// License: Public domain. You are free to use this code however you like, with +// the proviso that the author takes on no responsibility or liability for any +// use. + +-------------------- +License notice for Wuffs (Wrangling Untrusted File Formats Safely) +-------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------- +License notice for zlib +-------------------- +version 1.2.12, March 27th, 2022 + +Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +-------------------- +License notice for Zstandard +-------------------- +BSD License + +For Zstandard software + +Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook, nor Meta, nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/drivers/chromedriver.exe b/drivers/chromedriver.exe new file mode 100644 index 0000000..611f94c Binary files /dev/null and b/drivers/chromedriver.exe differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..658b96e Binary files /dev/null and b/requirements.txt differ diff --git a/selenium-4.31.0/CHANGES b/selenium-4.31.0/CHANGES new file mode 100644 index 0000000..016aa90 --- /dev/null +++ b/selenium-4.31.0/CHANGES @@ -0,0 +1,1514 @@ +Selenium 4.31.0 +* Add CDP for Chrome 135 and remove 132 +* Fix docstring issues that sphinx complains about (#15466) +* service: only shutdown if process not terminated (#15183) + +Selenium 4.30.0 +* Add CDP for Chrome 134 and remove 131 +* Remove support for v85 since no longer required by Firefox +* expected_conditions: correct type annotation (#15337) +* use `By` class attributes instead of strings in locator converter (#15402) +* fix invalid selector bug for mutation observation +* improve socket resource management with proper shutdown sequence (#15453) + +Selenium 4.29.0 +* Add CDP for Chrome 133 and remove 130 +* [py] Disable strict time stamps in Firefox profile (#15141) +* [py] Enhance PrintOptions to support default, predefined, and custom page sizes (#15052) (#15064) +* [py] Remove Firefox CDP (#15200) +* [py] Handle named `get_cookie` and `delete_cookie` for None and empty strings (#15073) +* [py] Document cygwin path for `send_keys` (#15275) +* [py] Fix return type and docstring of get_downloadable_files (#15292) + +Selenium 4.28.1 +* [py] Fix installing most of the data from source distributions + +Selenium 4.28.0 +* Add CDP for Chrome 132 and remove 129 +* [py] fix packaging (#14823) +* [py] Typing package import enhancement (#14283) +* [py] moved all getters in `fedcm/account.py` into descriptor object. (#14858) +* [py] add execute_cdp_cmd to Remote (#14809) +* Added more detailed docstrings to find_element() (#14930) +* [py] Refactored `remote/client_config.py` by moving `properties` into `descriptor` object (#14899) +* py: Ensure DRIVER_PATH_ENV_KEY defaults to string (#14862) +* [py] add doc for driver_path_env_key (#14997) +* [py] Fix WebKitGTK driver name check (#15046) +* [py] Upgraded WebDriverWait Docstrings (#15054) +* [py] Added Docstrings to ActionBuilder (#15065) +* [py] Upgraded WebElement Docstrings (#15056) +* [py] Upgraded WebDriver Docstrings (#15055) +* [java][js][py] Add straight relative-by locators (#14482) +* [py] Added Docstrings to RelativeBy Class and Added Missing Deprecation Warning to with_tag_name() (#15097) + +Selenium 4.27.1 +* Fix `pyproject.toml` for installable from sdist (#14806) +* Revert the Deprecation warnings of WebElement.get_attribute() (#14808) + +Selenium 4.27.0 +* Add CDP for Chrome 131 and remove 128 +* Add Firefox CDP deprecation warnings (#14787) +* Cleaned up Py doc sphinx warnings/errors and added README (#14191) +* Added Deprecation of WebElement.get_attribute() per #13334 (#14675) +* Fix TypeError when init Safari webdriver (#14699) +* Set user_agent and extra_headers via ClientConfig (#14718) +* Updated Handling for DetachedShadowRoot Exception (#14677) +* Support FedCM commands (#14710) + +Selenium 4.26.1 +* DeprecationWarning raised in default webdriver init (#14690) +* Remote connection use timeout from ClientConfig (#14692) +* Add backward compatibility for AppiumConnection (#14696) + +Selenium 4.26.0 +* Add CDP for Chrome 130 and remove 127 +* Added more internal logging for CDP (#14668) +* Set consistent polling across java and python for `WebDriverWait` methods (#14626) +* webkitgtk: log_path -> log_output (#14618) +* Implement configurable configuration class for the http client (#13286) +* Better compatibility with Appium-python (#14587) +* Avoid waiting indefinitely on a frozen chromedriver process (#14578) +* Allow logging diagnose in safari driver (#14606) +* Remote connection throws response status code when data is empty (#14601) +* Remove deprecated parameter from EdgeService (#14563) +* Allow driver path to be set using ENV variables (#14528) +* Remove un-needed print (#14562) +* Fix a bug in `bidi/session.py` by removing mutable object as default value for function argument (#14286) + +Selenium 4.25.0 +* Add CDP for Chrome 129 and remove 126 +* fix type errors for `service.py`, `cdp.py`, `webelement.py` and `remote_connection.py` (#14448) +* fix type errors for `input_device` and `file_detector` (#14459) +* fix type errors for `pointer_input.py`, `wheel_input.py` and `firefox/options.py` (#14476) +* firefox_profile.py: use `with` statement in zipfile as Python 2.x support is dropped (#14489) + +Selenium 4.24.0 +* Allow overriding `GLOBAL_DEFAULT_TIMEOUT` (#14354) +* fix mypy errors for `timeouts.py` and `print_page_options.py` (#14362) +* fix mypy errors for `input_device.py`, `ie/options.py` and `selenium_manager.py` (#14377) +* fix type errors for `log.py`, `chromium/options.py`, `websocket_connection.py` and `chrome/options.py` (#14392) +* Add CDP for Chrome 128 and remove 125 + +Selenium 4.23.1 + +* Fix 14278 and match ordering of dependencies (#14297) + +Selenium 4.23.0 + +* Disable strict time stamps in Firefox profile (#14168) +* Update the py api doc build (#14173) +* Add websocket-client v.1.8.0 to setup.py (#14187) +* Remove precompiled binaries from sdist (#14233) +* Fix RelativeBy#near to take 2 parameters (#13082) +* Add CDP for Chrome 127 and remove 124 + +Selenium 4.22.0 + +* Fix EOFError when calling the Remote WebDriver download_file method (#14031) +* Add low-level sync API to use DevTools (#13977) +* Add preference to enable CDP in Firefox by default (#14091) +* Allow using enable_bidi property on options class +* Implement script module for BiDi +* Remove desired capabilities argument for Webkitgtk (#14128) +* Make webkitgtk.webdriver same as wpewebkit.webdriver +* Add CDP for Chrome 126 and remove 123 + +Selenium 4.21.0 + +* Add CDP for Chrome 125 and remove 122 +* Moving ignore_local_proxy_environment_variables to BaseOptions (#13926) + +Selenium 4.20.0 + +* Add CDP for Chrome 124 and remove 121 +* Add type hints for selenium.webdriver.remote.webdriver.WebDriver.__init__ (#13775) +* Add types to set_window_position parameters (#13786) +* Making Selenium Manager a thin wrapper (#13387) + * This change has been made to make it easier to maintain and improve, the interface has + changed and if users were invoking it, they might experience issues. Selenium Manager is + still in beta and these type of changes are expected. + + +Selenium 4.19.0 + +* Add CDP for Chrome 123 and remove 120 +* Add more network interfaces to detect lan ip (#13663) +* install_addon() didn't take into account dir paths with trailing slashes (#13694) +* Explicitly export Select and WebDriverWait from selenium.webdriver.support.ui (#13491) +* Add return type to webelement.submit (#13490) +* Add type to parameter of webelement.WebElement.send_keys (#13492) + +Selenium 4.18.1 + +* Add CDP for Chrome 122 and remove 119 + +Selenium 4.18.0 + +* Update linting dependencies +* Setting Python for nightly releases - https://test.pypi.org/project/selenium/ + +Selenium 4.17.2 +* [py] Correct typing_extension dependency for wheel generation + +Selenium 4.17.1 +* Fix typo in setup.py (#13487) + +Selenium 4.17.0 +* Add page load strategy enum (#13258) +* Use correct file name when bumping versions (#13282) +* Filter which bidi logs are recorded based on event type (#12951) +* Add python to Selenium Manager input for tracking (see #13288) +* Sleep depending on the number of attempts to check if the service has started (#13321) +* Use subprocess.DEVNULL instead of open(os.devnull) to avoid leaking a file handle (#13329) +* Remove all references to firefox-bin +* Check if architecture/platform combination is supported for Selenium Manager (#13381) +* Remove extension connection class and other usages of webdriver.xpi +* remove deprecated verbose argument from edge service +* remove deprecated desired_capabilities property from webdriver +* remove deprecated application cache support +* truncate large strings when logging requests +* Update WPEWebKit support code (#13278) +* [py] Fix WPEWebKit python support code +* Do not change profile preferences of an existing directory by default (#13477) +* Deprecate firefox profile methods that are not supported (#13477) +* deprecate FirefoxBinary class (#13476) +* Fix type error in mypy (#13482) +* Add CDP for Chrome 121 and remove 118 + +Selenium 4.16.0 +* Fix inadvertent code change in mutation_event +* Fix bug in using SE_MANAGER_PATH +* Fix bug where downloaded file was not getting unzipped +* Add more logging to driver startup +* Fix WebDriverWait type hints for WebElement (#13108) +* Clean up of usage of executable path in services +* Don't leak a file descriptor to os.devnull by default (#13162) +* Allow bsd operating systems to use the linux binary +* Close trio memory channel sender after the driver is quit (#13151) +* Remote webdriver cannot match Chromium browser name for remote connection +* Remove deprecated reuse_service parameter from Safari driver constructor +* Remove deprecated quiet parameter from Safari service constructor +* Ensure all drivers stop service during driver quit +* Update chromium driver constructors for readability +* Add CDP for Chrome 120 and remove 117 + + +Selenium 4.15.2 +* Fix bug for unzipping downloaded files + +Selenium 4.15.1 +* Fix bug in using SE_MANAGER_PATH +* Fix inadvertent code change in mutation_event + +Selenium 4.15.0 +* Return a `pathlib.Path` when `SE_MANAGER_PATH` is set. closes #12929 +* Do not set browser binary in selenium manager if it is an empty string (#12738) +* Add CDP v119 and remove v116 +* Remove selenium manager accommodation for Conda +* Implement file downloads (#12979) +* Add some type hints to selenium.webdriver.support (#13070) + +Selenium 4.14.0 +* add CDP files for v118 and remove v115 +* use lazy string interpolation for logging calls +* Fix dangling log_output in Service (#12871) + +Selenium 4.13.0 +* add CDP files for v117 and remove v114 +* do not send parameters in payload that are used in endpoint (#12685) +* close out driver logging on quit (#12637) +* disable console appearing on windows when running in pythonw (#12715) +* remove deprecated headless methods +* fix bug preventing using performance logging in chromium +* remove deprecation notice from Firefox profiles +* Allow users to set Selenium Manager path by environment variable (#12752) + +Selenium 4.12.0 +* Add CDP files for v116 and remove v113 +* fix bug in ElementScrollBehavior in IE Options (#12462) +* fix bug preventing sending keys with long strings (#12474) +* fix typing for action_chains (#12477) +* fix typing for IE Options (#12464) +* fix bug in common options (#12499) +* allow setting http client certifications with REQUESTS_CA_BUNDLE env (#11957) +* support conda installation of selenium manager (#12536) +* Drop support for `python3.7` +* Fixed a bug where `Popen.wait()` calls caught the wrong exceptions when timing out + +Selenium 4.11.2 +* better bug fix for #12454 + +Selenium 4.11.1 +* Delete unusable Safari Options parameters to fix bug preventing Safari execution (#12454) + +Selenium 4.11.0 +* Add CDP files for v115 and remove v112 +* removed redundant attributes `capabilities` and `set_capability` in wpewebkit/options.py (#12169) +* mapped all error codes in `errorhandler.py` to corresponding exception object. (#12190) +* improve driver logging (#12103) - implement log_output() for flexibility and consistency of driver logging +* fix property name in Selenium Manager (#12237) +* used truthy check instead of checking for length in `to_capabilities` method in `ie/options.py` (#12262) +* remote commands dict is moved outside `RemoteConnection` class in `remote/remote_connection.py` (#12261) +* moved `ConnectionType` class outside `Mobile` class to avoid nesting of classes (#12256) +* used `pathlib` module to check if the file exist in `remote/file_detector.py` (#12253) +* added truthy check in chromium options instead of identity operator (#12274) +* added pythonic approach of type checking in `firefox/firefox_profile.py` (#12271) +* let users pass service args to IE driver (#12272) +* Adding ignore process match for IE Mode across bindings (#12279) +* moved all ie options to custom descriptors. (#12283) +* minor ie-options fix to PR 12283 (#12309), fixes #12283 +* added type hints to `SwitchTo` class (#12296) +* Refactored Proxy object in common/proxy.py using custom descriptor. (#12286) +* optimized Timeouts class by moving timeouts to descriptor class (#12287) +* added type hinting support to ActionChains and Alert class (#12290) +* Moved all `PrintOptions` class attributes to custom descriptor class. (#12297) +* Use Selenium Manager to locate drivers on PATH (#12356 +* Enable cdp to work for edge +* Update docstring of wait.py so it can also cover the case of WebElement as 1st arg of WebDriverWait. (#12376) +* Added type hinting support to `common/actions` libraries. (#12325) +* Fix type of `ignore_proxy` in `ChromiumRemoteconnection` +* set exception direct cause when switching frame focus when NSE is raised +* Raise a more generic `ValueError` when proxy type is not acceptable +* Add browser output from selenium manager to options (#12404) +* Add check=False explicitly to subprocess calls; simplify `keys_to_typing` +* Expose `WPEWebKitService` and `WebKitGTKService` in the public API +* Remove deprecated `ActionChains.scroll(...)` +* Removed unused variable `DEFAULT_SAFARI_CAPS` in `safari/webdriver.py` (#12416) +* Added type checks in `setter` methods of different browser options (#12328) +* Add creation flag for windows in selenium_manager (#12435) +* Fix checking window handles for current + +Selenium 4.10.0 +* Add CDP files for v114 and remove v111 +* Fix bug preventing proxy from working in Options classes (#12029) +* Add proxy support for Selenium Manager (#12032) +* Additional updates to typing (#12067, #12106) +* Add support for changing pointers in Actions class (#11521) +* Remove browser filters for shadow root element searches (#12112) +* Remove significant amounts of deprecated code (#12030) +* Improve near relative locator behavior (#11290) +* Change Selenium Manager logging to debug (#12145) +* Add links to documentation in error messages (#12156) +* Add custom error class for driver location and improve error logic +* Fix bug in BiDi mutation events + +Selenium 4.9.1 +* Add CDP files for v113 and remove v110 +* Minor fixes for docstring and dictionary declarations (#11975) +* Update logging to match other bindings (#11990) +* Support newer versions of urllib3 (#11993) + +Selenium 4.9.0 +* Remove "shadow_root" assertion in Python bindings for Firefox (#11821) +* Simplify driver binary and driver location selecting (#11864) +* Do not pass desired caps in Safari (#11854) +* Selenium Manager get Browser Version from Options classes +* Selenium Manager use binary from Browser Options +* Adding v112 and removing v109 + +Selenium 4.8.3 +* Add fine grained control for arguments provided to service subprocesses by passing a `popen_kw` mapping for all services. +* `Options` classes now allow `timeout` to be set partially and no longer raise an exception when all values are not provided. (#11623) +* No longer sending `SIGKILL` to subprocesses in instances where `SIGTERM` was successful within 60 seconds. +* Add CDP files for v111 and remove v108 +* Pass default to `pop` when parsing service popen_kw +* Using json output with Selenium Manager +* Sphinx config update to keep invoked methods and shorter aliases in documentation (#11802) + +Selenium 4.8.2 +* Update tox.ini for a valid "isort" version (#11667) +* Undo a bug fix that caused a worse bug. (#11666) + +Selenium 4.8.1 +* Add CDP files for v110 and remove v107 +* pylint fixes including tidy of f strings, simplifications of conditional statements and isinstances (#11205) +* Replace devtools genrule with proper generate_devtools rule. (#11392) +* Add docstring for `alert_is_present` +* Updating Selenium Manager binaries for 4.8.1 release + +Selenium 4.8.0 +* Add CDP files for v109 and remove v106 +* Add logging to Selenium Manager for both stdout and stderr +* Multiple updates and improvements to types +* Fix sdist tar package_dir (#11416) +* Add comment with name of large JS executions (#11038) +* Deprecate headless property for chromium and firefox options classes (#11467) + +Selenium 4.7.2 +* Put selenium manager bug fix from 4.7.1 in the correct place + +Selenium 4.7.1 +* Fix bug preventing selenium manager from using Internet Explorer + +Selenium 4.7.0 +* Add CDP files for v108 and remove v105 +* Improve error handling with Selenium Manager (#11329) +* Fix bug preventing alternate package managers from using Selenium Manager (#11234) + +Selenium 4.6.1 +* Replace response.getheader() with response.headers.get() (deprecated in urllib3 1.26.13). +* Fixed a bug in `Service` destructors accessing modules that no longer existed during interpreter shutdown. +* Improved exception messages when raising for `relative` locator issues. + +Selenium 4.6.0 +* Document firefox `service=` arg. closes #11067 +* Additional types and tidying safari service +* Revert removal of default executable global for safari +* Additional types; remove unused `permissions.py` +* Remove `RemoteDriverServerException` +* Remove unused `send_remote_shutdown_command` implementations in services +* Update `log_path` docs for non chromium based services +* Make `get_screenshot_as_file()` work with pathlib.Paths (#11095) +* Remove `protocols.py` +* fix typing in get_full_page_screenshot_as_png (#11163) +* typo in error message (#11166) +* Adding CDP files for v107 and removing v104 +* add initial support for selenium manager +* Revert "[py] do not allow Select class to work with disabled selects" +* #11093 - The SessionId shouldn't be added to params themself bu… (#11121) + +Selenium 4.5.0 +* Fix frame_to_be_available_and_switch_to_it() for string inputs (#10963) +* Implicit non w3c capability conversion for `acceptSslCerts`, `platform` and `version` is now deprecated +* Additional type hints +* Bugfix options returning `None` when strict_file_interactability, set_window_rect or accept_insecure_certs are not set +* Add CDP for v105, remove support for v102 +* Add CDP for v106, remove support for v103 + +Selenium 4.4.3 +* Update explicit dependency for certifi to remove upper bound (#10956) + +Selenium 4.4.2 +* Add explicit dependency for certifi (#10953) + +Selenium 4.4.1 +* Removal of urllib3[secure] extras (deprecated) dependency + +Selenium 4.4.0 +* More flexibility in locating Firefox binary (#10818) +* Add CDP for v104, remove support for v101 +* Throw error when setting w3c to False on Chromium, and warning when setting w3c to True + +Selenium 4.3.0 +* Deprecated find_element_by_* and find_elements_by_* are now removed (#10712) +* Deprecated Opera support has been removed (#10630) +* Fully upgraded from python 2x to 3.7 syntax and features (#10647) +* Added a devtools version fallback mechanism to look for an older version when mismatch occurs (#10749) +* Better support for co-operative multi inheritance by utilising super() throughout +* Improved type hints throughout + +Selenium 4.2.0 +* Fix bug preventing Firefox from setting accept_insecure_certs to False (#10442) +* Deprecated opera classes as not w3c compatible (#10379) +* Fix SecurityError: Invalid Domain problem (#10653) +* Implement convenience methods for scrolling + +Selenium 4.1.5 +* use `typing_extensions` to be compatible with `py37` (#10613) + +Selenium 4.1.4 + +* Hook options class in safari driver (#10433) +* Remove universal wheel, python 2 is unsupported (#10438) +* Fix `tox -e docs` by pinning `Jinja2` (#10492) +* Add support Chrome 100 and remove for Chrome 97 +* Removed desired capabilities from handshake code (#10494) +* Invalid selector exceptions are is not a no such element exception +* Do not convert tag name to css selector +* Add debug logging for urllib response data (#10568) +* Use monotonic clock for waits, fixes #10544 (#10550) +* Adding Chrome DevTools 101 and removing 98 +* Add the ability to create sdist package of the python bindings +* Remove unicode prefix for strings (#10562) +* Use `get_timeout()` for urllib pool manager timeouts in remote connection (#10563) +* Fixing "--connect-existing" #10598 +* Added DeprecationWarning to the warnings.warn methods inside the find_element_by_x methods (#10575) +* Added virtual authenticator for Python Bindings (#10579) + +Selenium 4.1.3 + +* fix generated wheel asset (#10022) +* add support for proxy authentication (#10358) +* add Safari options (#10385) +* add support for Firefox to install unpacked addons (#10308) +* add support for Chrome 99 and remove support for Chrome 96 + +Selenium 4.1.2 + +* Include `py.typed` in the library + +Selenium 4.1.1 + +* add support for Chrome 98 and remove support for Chrome 95 +* Add py.typed file (#10310) +* Elaborate find_element deprecation message (#10273) +* add support for Chrome v97 +* convert selectors for finding elements in shadow dom +* missing self for service args +* don't use websocket-port if user sets connect-existing (a4dc6e) +* update tests for current IE options +* fix firefox addon tests +* Support new Cast command added to Chrome Devtools (#10150) +* send Base64 encoded addon to driver instead of path String +* Reflect how find_elements returns a list, not just one WebElement. (#10172) +* add shadowroot to api docs +* add log reference to api rst file +* remove non breaking space for doc generation +* Updating exceptions file for docs +* Add type hinting to Shadowroot +* update ShadowRoot find element signatures to match those in WebElement (#10138) +* add Zenkaku/Hankaku key +* raise `NoSuchElementException` for relative failures instead of `IndexError` (#10078) +* Remove legacy in favour of W3C endpoints. (#10075) +* Tidy relativeby docs, use non deprecated methods in webserver (#10077, #10103, #10108, #10186, #10212, #10120) +* PEP 484 type hints s (#10099) +* Handle Socks Proxy for Remote Connections. Fixes #10091 +* Add extra attributes to pointer down and pointer move actions +* Add Scroll via Wheel Inputs and Wheel Actions + +Selenium 4.1.0 + +* add warning if people set w3c to false as it may break their tests +* Fix wrong type annotations for "env" it's a dict not a string (#10072) +* Added default executable path in service module for (#10057) +* Fix typos for docstrings (#10052) +* Fix return type hint in get_screenshot_as_png (#10060) +* Add CDP for v96, remove support for v92 and v93 +* Add support for shadow dom end points +* Upgrade sphinx to use latest +* Correct docstrings around Service usage +* XFail alert tests due to https://bugzilla.mozilla.org/show_bug.cgi\?id\=1731795 +* Remove py2 import code +* Check the values in NO_PROXY and set the poolmanager accordingly (#9925, #9967) +* Move python version to a variable to be shared about in build steps +* Bump Bazel rules_pkg to 0.5.1 + +Selenium 4.0.0 + +* Add cdp 95 to python and JS +* Remove Edge legacy options. (#9908) +* Expected condition for checking attribute value (#9881) +* implement relative locator for find_element (#9902) +* Fix python generation code for CDP to optionals better + +Selenium 4 Release Candidate 3 + +* Fix CDP Code Generation broken by Chromium 94 +* Fix Deprecation warnings for IE Bindings. Fixes #9818 + +Selenium 4 Release Candidate 2 + +* Add new websocketUrl capability +* Force free ports for cdp in geckodriver +* Add w3c capabilities to Python options (#9870) +* expected_conditions and wait modules raises InvalidSelectorException for invalid xpaths (#9805) +* implement chromium specific endpoint for setting permissions +* implement chromium specific endpoint for deleting network conditions +* update ruby, python and JS to add support for v94 and remove support for v92 +* Fix type hint on chrome option method (#9840) +* Allows None to be set for the sameSite attribute (#9771) +* Fix typo in python webdriver for IE (#9801) + +Selenium 4 Release Candidate 1 + +* Remove cdp versions 88, 89, and 90 +* Replace v91 with v93 in bazel files +* update IE options class in each language to match the currently supported capabilities in the IE Driver +* Specify that the "find_element_by_* ..." warning is a deprecation warning (#9700) +* clean up imports +* Use options when passing things to remote webdriver instead of capabilities (#9678) +* Correct deprecation message in IE handling code +* Rewrite the logging module for bidi connections +* remove non-w3c compliant parameters from default capabilities +* Run type checks in CI and report typing coverage to codecov (#9523) +* PEP 484 Type Hints added +* Handle first/always match better when it hits lists/dicts. Fixes #9538 +* correct tox warnings +* Fix deprecation warnings for Safari (#9577) +* Allow 0 coordinates for the window position. Fixes #9574 +* Fix incorrect use of 'NoReturn' type annotation. (#9540) + +Selenium 4 Beta 4 (The Final Beta) + +* Returning fixed IP in GitHub actions (#9550) +* PEP 484 type hints for common.exceptions and webdriver.support.color (#9482) +* Add the ability to pass in multiple options and have that capabilities returned as (first|always)Match +* Add docstrings for RelativeBy +* Add the ability to pass in different locators to do Relative Locator searches +* Add a test with returning a JS Const object #9468 +* Handle poor responses from drivers when there are errors. Fixes #9437 +* Add the ability to enable mobile on options classes +* Add the ability to use Options classes on Safari +* Fix converting list of tuples to str in send_keys (#9330) +* Expand element to be clickable in expected conditions(#9374) +* Upgrade rules_python to 0.2.0 + +Selenium 4 Beta 3 + +* Enable more tests +* Improve support for WebDriver Bidi over selenium grid +* Update CDP Support versions to remove 86,87 and add 90,91 +* Allow overriding the default 250 msecs duration of pointer movement (#9336) +* Only give deprecation warning if Profile is being used in options +* Loosen version requirements on dependencies. Fixes #9312 +* Bump urllib3 from 1.26.2 to 1.26.3 in /py (#9311) +* Disable wait on frame test due to bug in Firefox +* Correct pinned browser path for chrome on linux + +Selenium 4 beta 2 Post 1 + +* Fix Chrome instantiation + +Selenium 4 beta 2 + +* Set up python for pinned browsers +* Add Multiple file upload test +* Fix using arguments in Chrome Option. Fixes #9281 +* Deprecate arguments in remote webdriver instantiation +* Improve proxy via options test for Firefox +* Set Chromium Edge to be the default for Edge browsers +* Move code so that it is reachable +* Fix usage of options to RemoteWebDriver (#9240) +* Deprecate using a Firefox profile in Options +* use attribute endpoint to evaluate multiple selects +* implement get_dom_attribute +* Add attribute_to_be_include method to expected_conditions when the at… (#9200) +* Additional Python type hints (#9192) +* Correct Type Hinting on option method. Fixes #9210 +* Use a flat namespace for selenium options +* remove unused imports +* Add ARIA APIs for getting the role and label of an Element +* Fix homepage attribute in wheel target +* Avoid using bazel native python rules + +Selenium 4.0 Beta 1 + +* Deprecate all but `Options` and `Service` arguments in driver instantiation. (#9125,#9128) +* Upgrade Bazel rules_python to latest +* Deprecate w3c checks in python bindings (#9109) +* Remove legacy WebElement key `ELEMENT` (#9102, #9110) +* Improve how desired_capabilities and options are merged +* Use weakreferences for driver in switch and mobile classes (#2425) +* Fix 'webview2' browser name for Edge py options. (#9090) +* Add python type hinting +* Improved alias for Keys (#9076) +* Improve comment about using importlib_resources +* Add mozdebugger capability to use CDP Features with Firefox +* Refactor bidi APIs for logging to be on their own class +* Make sure we are checking a string for local file detector +* Add Ignored Exception to wait in Bidi Tests +* Update tests +* Adding Github Actions workflow for Python (#9031) +* Fix WebDriver.start_session docstring to remove incorrect arguments (#9021) +* Add Mutation Logging support +* Pin Firefox bidi support to use the generated code for CDP 85 +* Fix handling of generated code put into wheels +* Modernise the python code around imports and conditionals +* Support for float types in text fields (#8936) +* Add print page command to python binding (#8903) +* Add Chrome v88 to bidi support +* Fix pytest macro to allow --test_args to pass through +* Remove thread.join in testing webserver due to chromedriver issue 3654 +* Fix grammar typos in exceptions.py (#8876) +* Enforce python version in wheel when created. fixes #8863 +* Correct proxy tests +* Include readme in Wheel so it's rendered on Pypi + +Selenium 4.0 Alpha 7 + +* BREAKING CHANGE: Dropped support for python < 3.7 + +* Remove support for XBL in Firefox. +* Correct formatting with JS fragment +* Add debugpy to requirements +* Fix uploading multiple files on remote driver (#7472) (#8734) +* Correct docstring around find_element and find_elements. Fixes #8806 +* Add the ability to ignore local proxys that are available +* add script pinning to python bindings +* Deprecate desired_capabilities property in favour of capabilities property +* Update tests to use requirements file +* Allow driver fixtures to be used in Chrome only tests +* Update testing to use the latest pytest +* do not update already set preference (#8692) +* Added new argument creationflags in Service class for common, chrome, and firefox (#8647) +* add se namespacing to file upload endpoint for all bindings (#8588) +* Correct dependency management for code generator +* Update host to connect to get a port. Fixes #8503 +* Poll quicker for the driver when starting up. Fixes #8477 +* Add support for DevTools APIs +* Improve WebKitGTK and WPEWebKit support +* Fix browserName typo for Edge WebView2 +* Fix wheel generation for multiple python versions + +Selenium 4.0 Alpha 6 Post 2 + +* Correct usage of Abstract Base class in some instances +* Correct build step for releasing + +Selenium 4.0 Alpha 6 + +* Add Abstract Base Class to WebElement and WebDriver #7127 (#8348) +* Copy `acceptInsecureCerts` to Options for Firefox. Fixes #8261 +* Correct check on DEFAULT_EXECUTABLE_PATH +* Use ProxyManager instead of PoolManager in remote_connection (#8297) +* Check offsets are cast to int. Fixes #7639 +* Fixes an issue where IE server port is set '0' by default (#8294) +* Favor Python3 constructs and Python 2.7 compatibility (#8290) +* Remove Unused Arguments from Firefox +* Fixup Firefox deprecations +* Delete support for Blackberry Driver +* Delete PhantomJS capabilities +* Delete Android Driver support +* Remove python crazyfun references +* Enable and update Safari tests +* Use same port in remote executor and service (#8255) +* Update tests and docs to not use deprecated methods +* mark various tests as failing in Firefox +* Use callback functions instead callable objects as expected conditions (#7765) +* Fix error in webelemet not created, verifying if is str or dict. (#3481) +* verify command_executor ssl certificate by default (#6536) +* Correct documentation for ChromiumDriver +* Deprecating find_element(s)_* calls in event firing webdriver +* Fixing path to selenium server for remote tests +* Fixing relative locator constructor +* Changing environment variable we use to check if the tests are running on travis +* Fixing HSL to RGBa color converter +* Deprecate use of AppCache APIs + +Selenium 4.0 Alpha 5 + +* Correct service usage in IE Binding. Fixes #7749 +* Deprecate find_element(s)_by_* calls +* Use a capability to switch engines for Edge (#8096) +* Fix Flake8 errors +* Add WPEWebKit driver (#6375) +* update python_requires to only support python 2.7 and Python3.5+(#8085) +* add the ability to generate a wheel via bazel +* Add in support for page loading strategies for Options +* Add the ability to get and set timeouts against a driver. Fixes #7738 +* Correct Docstring import in WebDriverWait example. Fixes #7780 +* Explicitly force timeout value to float in WebDriverWait. Fixes #8050 +* Add support for relative locators +* Fix clear actions in ActionChains (#7943) +* Automate RemoteConnection subclass selection (#8010) +* Fix capabilities to support macOS platform (#7980) +* fix: DeprecationWarning of base64.encodestring() (#7446) +* Build python code with Bazel +* Parse python docstring example as code snippet +* correct python_requires in setup +* Fix grammar typo in exceptions.py (#7657) +* Fixed references to chromedriver website + +Selenium 4.0 Alpha 3 + +* Fixing stacktrace parser to handle strings as well as objects +* urllib throws on 404 so let's check the /status endpoint that returns 200 +* Changing default command executor address to the address of TNG Grid +* Fixing check of type of a returned element in a test for all_of condition +* Implement logical expected conditions in Python (#7121) +* Explicitly clear PoolManager by using context manager (#6878) +* Fix invisibility_of_element expected condition init function (#7484) +* fix docs build, add chromium and edge to docs +* flake8 fixes +* allow --browser-binary and --browser-args to be used with ChromiumEdge +* Add support for the new MicrosoftEdge (#7459) +* increase async script timeout from 0 as the w3c spec states to start time checking immediately +* fix unit test for firefox options, proxy key should be outside of options +* update to w3c compliant log endpoints +* Remove 'resolve_ip' option from RemoteConnection (#1729,#2509) +* Running python unit tests with bazel +* Pass capabilities rather than options to the proxy object (#6620) +* Adding full page screenshot feature for Firefox (#7182) +* Added EventFiringWebElement to the isinstance check in the move_to method.(#6604) +* Added socksVersion field in proxy class (#6983) +* also clear w3c actions in ActionChains#reset_actions +* fix edge webdriver init by deprecating edge_service in favor of service also fix warnings import in edge/webdriver +* Removes old exception and dead code from py lib.(#7134) +* Raise error for unsupported method for set_window_rect + +Selenium 4.0 Alpha 1 + +* Update driver initialisation to use service and option objects +* turn on keep-alive by default for remote connections (#7072) +* Fix ConnectionResetError +* Add new Cast commands +* Suggest download Microsoft Webdriver over HTTPS +* Clear PoolManager in ‘remote_connection’ to ensure sockets are closed +* remove --disable-gpu option for headless Chrome +* Add support for the New Window command (#6873) +* Update docstrings in Options classes to allow documentation to highlight Return values +* Fix typos in select.py (#6925) +* Remove native events handling code +* Deleting unused imports, fixing flake8 issues +* Remove unused port selection in IE Driver +* Enabling tests xpassed in Chrome +* Pretty-printing code samples +* remove all deprecated methods and args from Python bindings +* Fix DeprecationWarning: invalid escape sequence +* Don't override browser options with desired capabilities by default in WebKitGTK (#6814) +* Add WebKitGTK to API docs (#6815) +* Subclass options classes from a common base class (#6522) +* Update Sphinx (#6728) +* WebDriverWait: update documentation for until and until_not (#6711) +* Fix typo in description of WebDriver class (#6724) +* add strictFileInteractability to acceptable W3C capabilities +* Deprecate Blackberry Driver support +* Fixing/tidying docstring. + +Selenium 3.141.0 + +* Bump version to a better approximation of Π +* Improved Test build targets +* fix os path in test for Windows +* use 'NUL' for /dev/null on Windows +* Update ctor docstrings to explain that a directory passed in is cloned. Fixes #6542 +* Allow passing of service_args to Safari. Fixes #6459 +* Remove element equals url +* Improved WebExtension support + +Selenium 3.14.1 + +* Fix ability to set timeout for urllib3 (#6286) +* get_cookie uses w3c endpoint when compliant +* Remove body from GET requests (#6250) +* Fix actions pause for fraction of a second (#6300) +* Fixed input pausing for some actions methods +* Capabilities can be set on Options classes +* WebElement rect method is now forward compatible for OSS endpoints (#6355) +* Deprecation warnings now have a stacklevel of 2 +* keep_alive can now be set on Webdriver init (#6316) +* isDisplayed atom is now used for all w3c compliant browser, fixing issue with Safari 12 + +Selenium 3.14.0 + +* Fix doc of URL-related ExpectedCondition (#6236) +* Added ExpectedCondition invisibility_of_element +* Swap out httplib for urllib3 +* Be consistent with webdriver init kwarg service_log_path (#5725) + +Selenium 3.13.0 + +* Add executing Chrome devtools command (#5989) +* fix incorrect w3c action encoding in python client (#6014) +* Implement context manager for WebDriver +* Stop sending "windowHandle" param in maximize_window command for w3c + +Selenium 3.12.0 + +* Add desired_capabilities keyword to IE and Firefox drivers for driver consistency +* Fix bug with creating Safari webdriver instance (#5578) +* Add support for Safari extension command +* Deprecate Options `set_headless` methods in favor of property setter +* Only set --disable-gpu for Chrome headless when on Windows +* Add selenium User-Agent header (#5696) +* Remote webdriver can now be started when passing options +* All Options.to_capabilities now start with default DesiredCapabilities +* Improve the error message that is raised when safaridriver cannot be found (#5739) +* IeOptions class is now imported to selenium.webdriver +* Remove the beta `authenticate` methods from `Alert` + +Selenium 3.11.0 + +No changes just keeping python version in step with the rest of the project. + +Selenium 3.10.0 + +* make tests to check clicking on disabled element work for w3c compliant drivers (#5561) +* add docstring for InvalidElementStateException. Fixes #5520 +* Deleting unused imports +* Making python specification in IDEA project more generic +* It should be possible to use a custom safaridriver executable to run Selenium's test suite. + +Selenium 3.9.0 + +* Add docstrings to WebElement find methods (#5384) +* Additional data in unexpected alert error is now handled for w3c drivers (#5416) +* Allow service_args to be passed into Firefox WebDriver (#5421) +* Fix bug introduced with response logging in 3.8.1 (#5362) + +Selenium 3.8.1 + +* Fix bug when creating an Opera driver (#5266) +* Stop sending sessionId in w3c payload. (#4620) +* Fix issue with w3c actions releasing on element (#5180) +* A more descriptive log message is displayed if the port cannot be connected (#2913) +* Initialize Alert object by calling alert.text (#1863) +* PhantomJS is now deprecated, please use either Chrome or Firefox in headless mode +* Legacy Firefox driver: ensuring copy of profile dir, its 'extensions' subdir and 'user.js' file are writable. (#1466) + +Selenium 3.8.0 + +* Firefox options can now be imported from selenium.webdriver as FirefoxOptions (#5120) +* Headless mode can now be set in Chrome Options using `set_headless` +* Headless mode can now be set in Firefox Options using `set_headless` +* Add the WebKitGTK WebDriver and options class (#4635) +* Browser options can now be passed to remote WebDriver via the `options` parameter +* Browser option parameters are now standardized across drivers as `options`. `firefox_options`, + `chrome_options`, and `ie_options` are now deprecated +* Added missing W3C Error Codes (#4556) +* Support has been removed for Python versions 2.6 and 3.3 + +Selenium 3.7.0 + +* need to pass applicable environment variables to tox +* Fix active_element for w3c drivers (#3979) +* add support for minimize command +* add support for fullscreen command +* window rect commands should fail on firefox and remote (legacy) +* Fix python backward compatibility for window commands (#4937) +* Update docstrings to specify the type of path needed to install firefox addons. (#4881) +* Update python chromeOptions key for capabilities (#4622) +* Fix python pause action implementation (#4795) + +Selenium 3.6.0 + +* Fix package name in python webelement module (#4670) +* Fix python driver examples (#3872) +* No need to multiply pause by 1000 +* Add pause to action chains +* only check for proxyType once +* lowercase proxy type for w3c payload in python #4574 +* guarding against null return value from find_elements in python #4555 +* remove unnecessary pytest marking, address flake8 issues +* allow IE WebDriver to accept IE Options +* add IE Options class +* convert OSS capabilities to W3C equivalent for W3C payload +* Add Safari to API docs + +Selenium 3.5.0 + +* Numerous test fixes +*Iterate over capabilities in a way to support py2.7 and py3 +* Fix W3C switching to window by name. +* Support GeckoDriver addon install/uninstall commands #4215. +* Move firefox_profile into moz:firefoxOptions. +* Filter non-W3C capability names out of alwaysMatch. +* Honor cmd line args passed to Service ctor (#4167) +* Add expected conditions based on URL to Python Expected Conditions #4160 +* Add network emulation to Chrome Python bindings (#4011) +* add warning when saving incorrectly named screenshot (#4141) + +Selenium 3.4.3 + +* Fix EventFiringWebdriver and WebElement to raise AttributeError on missing attributes. (#4107) +* unwrap WebElements inside dicts + +Selenium 3.4.2 + +* translate move_by_offset command to w3c +* Update capabilities properly instead of assuming dict structure. Fixes #3927 +* Add missing file for Chrome options to API docs. +* Add Chrome options module to API docs. + +Selenium 3.4.1 + +* Add back the ability to set profile when using Firefox 45ESR. Fixes #3897 + +Selenium 3.4.0 + +* Correct usage of newSession around `firstMatch` and `alwaysMatch` +* Remove superfluous capabilities that are not needed +* Add expected condition that waits for all found elements to be visible (#3532) +* Allow methods wrapped by EventFiringWebDriver and EventFiringWebElement (#806) +* Dropping `javascriptEnabled` capability for real browsers +* Use W3C check from parent object instead of assuming from capabilities +* Bump example source distribution to match latest release. +* Replace TypeError with KeyError in remote webdriver error handler code (#3826) +* When testing Marionette use default capabilities in testing +* Conform to the api of urllib2 for adding header for a request (#3803) +* Add `text` key to alert#sendKeys parameters for W3C Endpoint +* Location once scrolled into view should use W3C executeScript endpoint not JSONWP +* Fixed the usage information in documentation of "save_screenshot". (#3804) +* Add Element Not Interactable exception +* Clean up imports in error handler +* flake8 cleanup + +Selenium 3.3.3 + +* make w3c execute_script commands unique + +Selenium 3.3.2 + +* Update window commands to use W3C End points +* Update Alert when in W3C mode to use W3C Endpoints +* Update to new W3C Execute Script end points +* Add setting/getting proxy details to Firefox Options +* Deprecate the use of browser profile when instantiating a session +* Update start session to handle the W3C New Session +* Add get/set window rect commands +* Add InvalidArgumentException +* When passing in `text` to send_keys, make sure we send a string not array +* Fix string decoding in remote connection (#3663) +* Fix indentation to satisfy PEP8 +* Try use old way of setting page load timeout if new way fails. Fixes #3654 +* fix file uploads for Firefox +* Run unit tests on Python 3.3, 3.4, and 3.5 (#3638) +* Fix indentation in double_click. +* Fix non-W3C page load timeout setting. + +Selenium 3.3.1 + +* Fix encoding of basic auth header when using Python 3 Fixes #3622 +* Add initial unit test suite +* Update W3C Timeout setting to be in line with the specification +* support.ui.Select class inherits from object (#3067) +* fix bug in proxy constructor that some properties are not proper set (#3459) +* Fix flake8 issues (#3628) + +Selenium 3.3.0 +**Note** If you are updating to this version, please also update GeckoDriver to v0.15.0 + +* Fix python HTTPS encoding for python driver (#3379) +* Allow Firefox preferences to be set directly in Options +* Fix shutdown and process termination (#3263) +* Preventing exception if log_path is none or empty. Fixes #3128 +* Add the W3C capability to Firefox for accepting insecure certificates +* Initial implementation of Pointer Actions +* Only skip tests if driver name matches a directory name. +* Update calls that return a pure object with keys to look for 'value' key +* Initial W3C Actions support +* fix docs output directory + +Selenium 3.0.2 + +* Add support for W3C Get Active Element +* Return when we use executeScript for faking WebElement.get_property +* Expand user paths and resolve absolute path for Chrome extensions +* Add support for verbose logging and custom path to EdgeDriver +* Update TakeElementScreenshot to match WebDriver specification +* Raise WebDriverException when FirefoxBinary fails to locate binary +* Fix getting IP for python 3 +* Write Service log to DEVNULL by default +* Only attempt to remove the Firefox profile path if one was specified +* Added context manager for chrome/content in Firefox + +Selenium 3.0.1 + +* Fix regressions with python 3 +* Add support for Safari Technology Preview + +Selenium 3.0.0 + +* new FirefoxDriver ctor precedence logic and moz:firefoxOptions support (#2882) +* Add W3C Set Window Position and W3C Get Window Position +* enable log path setting from firefox webdriver (#2700) +* Correct encoding of getAttribute.js and only load it once. Fixes #2785 +* Encode the isDisplayed atom and only load it once + +Selenium 3.0.0.b3 + +* Use atoms for get_attribute and is_displayed when communicating with + a w3c compliant remote end. +* Make it possible to specialise web element + +Selenium 3.0.0.b2 + +* Updated Marionette port argument to match other drivers. + +Selenium 3.0.0.b1 + +* Fix basestring reference to work with python 3. Fixes #1820 +* Correct Length conditional when filtering in PhantomJS. Fixes #1817 +* Fix send keys when using PUA keys e.g. Keys.RIGHT #1839 +* Fix cookie file leak in PhantomJS #1854 +* Use the correct binary path when using Marionette +* Fixed: Unhelpful error message when PhantomJS exits. (#2173 #2168) +* Fix broken link to python documentation (#2159) +* Attempt to remove Firefox profile when using Marionette +* Ensure all capabilities are either within desiredCapabilities or requiredCapabilities +* Correct the expected capability name for the Firefox profile +* Add Firefox options to capabilities +* Visibility_of_all implies it only returns elements if all visible (#2052) +* Find visible elements (#2041) +* Pass the firefox_profile as a desired capability in the Python client when using a remote server +* Avoid checking exception details for invalid locators due to differences in server implementations +* Handle capabilities better with Marionette and GeckoDriver +* Updated the maxVersion of FirefoxDriver xpi maxVersion to work with Firefox 47.0.1 +* Remove Selenium RC support + +Selenium 2.53.0 + +* Adding Options object for use with Python FirefoxDriver +* Fixed improper usage of super in exceptions module +* create a temp file for cookies in phantomjs if not specified +* Pass in the executable that FirefoxBinary finds to the service if there isn't one passed in as a kwarg or capability +* Applied some DRY and extracted out the keys_to_typing() +* Fix deselecting options in `` element. + backend_node_id: typing.Optional[dom.BackendNodeId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FileChooserOpened: + return cls( + frame_id=FrameId.from_json(json['frameId']), + mode=str(json['mode']), + backend_node_id=dom.BackendNodeId.from_json(json['backendNodeId']) if 'backendNodeId' in json else None + ) + + +@event_class('Page.frameAttached') +@dataclass +class FrameAttached: + ''' + Fired when frame has been attached to its parent. + ''' + #: Id of the frame that has been attached. + frame_id: FrameId + #: Parent frame identifier. + parent_frame_id: FrameId + #: JavaScript stack trace of when frame was attached, only set if frame initiated from script. + stack: typing.Optional[runtime.StackTrace] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameAttached: + return cls( + frame_id=FrameId.from_json(json['frameId']), + parent_frame_id=FrameId.from_json(json['parentFrameId']), + stack=runtime.StackTrace.from_json(json['stack']) if 'stack' in json else None + ) + + +@event_class('Page.frameClearedScheduledNavigation') +@dataclass +class FrameClearedScheduledNavigation: + ''' + Fired when frame no longer has a scheduled navigation. + ''' + #: Id of the frame that has cleared its scheduled navigation. + frame_id: FrameId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameClearedScheduledNavigation: + return cls( + frame_id=FrameId.from_json(json['frameId']) + ) + + +@event_class('Page.frameDetached') +@dataclass +class FrameDetached: + ''' + Fired when frame has been detached from its parent. + ''' + #: Id of the frame that has been detached. + frame_id: FrameId + reason: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameDetached: + return cls( + frame_id=FrameId.from_json(json['frameId']), + reason=str(json['reason']) + ) + + +@event_class('Page.frameSubtreeWillBeDetached') +@dataclass +class FrameSubtreeWillBeDetached: + ''' + **EXPERIMENTAL** + + Fired before frame subtree is detached. Emitted before any frame of the + subtree is actually detached. + ''' + #: Id of the frame that is the root of the subtree that will be detached. + frame_id: FrameId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameSubtreeWillBeDetached: + return cls( + frame_id=FrameId.from_json(json['frameId']) + ) + + +@event_class('Page.frameNavigated') +@dataclass +class FrameNavigated: + ''' + Fired once navigation of the frame has completed. Frame is now associated with the new loader. + ''' + #: Frame object. + frame: Frame + type_: NavigationType + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameNavigated: + return cls( + frame=Frame.from_json(json['frame']), + type_=NavigationType.from_json(json['type']) + ) + + +@event_class('Page.documentOpened') +@dataclass +class DocumentOpened: + ''' + **EXPERIMENTAL** + + Fired when opening document to write to. + ''' + #: Frame object. + frame: Frame + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DocumentOpened: + return cls( + frame=Frame.from_json(json['frame']) + ) + + +@event_class('Page.frameResized') +@dataclass +class FrameResized: + ''' + **EXPERIMENTAL** + + + ''' + + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameResized: + return cls( + + ) + + +@event_class('Page.frameRequestedNavigation') +@dataclass +class FrameRequestedNavigation: + ''' + **EXPERIMENTAL** + + Fired when a renderer-initiated navigation is requested. + Navigation may still be cancelled after the event is issued. + ''' + #: Id of the frame that is being navigated. + frame_id: FrameId + #: The reason for the navigation. + reason: ClientNavigationReason + #: The destination URL for the requested navigation. + url: str + #: The disposition for the navigation. + disposition: ClientNavigationDisposition + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameRequestedNavigation: + return cls( + frame_id=FrameId.from_json(json['frameId']), + reason=ClientNavigationReason.from_json(json['reason']), + url=str(json['url']), + disposition=ClientNavigationDisposition.from_json(json['disposition']) + ) + + +@event_class('Page.frameScheduledNavigation') +@dataclass +class FrameScheduledNavigation: + ''' + Fired when frame schedules a potential navigation. + ''' + #: Id of the frame that has scheduled a navigation. + frame_id: FrameId + #: Delay (in seconds) until the navigation is scheduled to begin. The navigation is not + #: guaranteed to start. + delay: float + #: The reason for the navigation. + reason: ClientNavigationReason + #: The destination URL for the scheduled navigation. + url: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameScheduledNavigation: + return cls( + frame_id=FrameId.from_json(json['frameId']), + delay=float(json['delay']), + reason=ClientNavigationReason.from_json(json['reason']), + url=str(json['url']) + ) + + +@event_class('Page.frameStartedLoading') +@dataclass +class FrameStartedLoading: + ''' + **EXPERIMENTAL** + + Fired when frame has started loading. + ''' + #: Id of the frame that has started loading. + frame_id: FrameId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameStartedLoading: + return cls( + frame_id=FrameId.from_json(json['frameId']) + ) + + +@event_class('Page.frameStoppedLoading') +@dataclass +class FrameStoppedLoading: + ''' + **EXPERIMENTAL** + + Fired when frame has stopped loading. + ''' + #: Id of the frame that has stopped loading. + frame_id: FrameId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> FrameStoppedLoading: + return cls( + frame_id=FrameId.from_json(json['frameId']) + ) + + +@event_class('Page.downloadWillBegin') +@dataclass +class DownloadWillBegin: + ''' + **EXPERIMENTAL** + + Fired when page is about to start a download. + Deprecated. Use Browser.downloadWillBegin instead. + ''' + #: Id of the frame that caused download to begin. + frame_id: FrameId + #: Global unique identifier of the download. + guid: str + #: URL of the resource being downloaded. + url: str + #: Suggested file name of the resource (the actual name of the file saved on disk may differ). + suggested_filename: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DownloadWillBegin: + return cls( + frame_id=FrameId.from_json(json['frameId']), + guid=str(json['guid']), + url=str(json['url']), + suggested_filename=str(json['suggestedFilename']) + ) + + +@event_class('Page.downloadProgress') +@dataclass +class DownloadProgress: + ''' + **EXPERIMENTAL** + + Fired when download makes progress. Last call has ``done`` == true. + Deprecated. Use Browser.downloadProgress instead. + ''' + #: Global unique identifier of the download. + guid: str + #: Total expected bytes to download. + total_bytes: float + #: Total bytes received. + received_bytes: float + #: Download status. + state: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DownloadProgress: + return cls( + guid=str(json['guid']), + total_bytes=float(json['totalBytes']), + received_bytes=float(json['receivedBytes']), + state=str(json['state']) + ) + + +@event_class('Page.interstitialHidden') +@dataclass +class InterstitialHidden: + ''' + Fired when interstitial page was hidden + ''' + + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterstitialHidden: + return cls( + + ) + + +@event_class('Page.interstitialShown') +@dataclass +class InterstitialShown: + ''' + Fired when interstitial page was shown + ''' + + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterstitialShown: + return cls( + + ) + + +@event_class('Page.javascriptDialogClosed') +@dataclass +class JavascriptDialogClosed: + ''' + Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been + closed. + ''' + #: Whether dialog was confirmed. + result: bool + #: User input in case of prompt. + user_input: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> JavascriptDialogClosed: + return cls( + result=bool(json['result']), + user_input=str(json['userInput']) + ) + + +@event_class('Page.javascriptDialogOpening') +@dataclass +class JavascriptDialogOpening: + ''' + Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to + open. + ''' + #: Frame url. + url: str + #: Message that will be displayed by the dialog. + message: str + #: Dialog type. + type_: DialogType + #: 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. + has_browser_handler: bool + #: Default dialog prompt. + default_prompt: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> JavascriptDialogOpening: + return cls( + url=str(json['url']), + message=str(json['message']), + type_=DialogType.from_json(json['type']), + has_browser_handler=bool(json['hasBrowserHandler']), + default_prompt=str(json['defaultPrompt']) if 'defaultPrompt' in json else None + ) + + +@event_class('Page.lifecycleEvent') +@dataclass +class LifecycleEvent: + ''' + Fired for lifecycle events (navigation, load, paint, etc) in the current + target (including local frames). + ''' + #: Id of the frame. + frame_id: FrameId + #: Loader identifier. Empty string if the request is fetched from worker. + loader_id: network.LoaderId + name: str + timestamp: network.MonotonicTime + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> LifecycleEvent: + return cls( + frame_id=FrameId.from_json(json['frameId']), + loader_id=network.LoaderId.from_json(json['loaderId']), + name=str(json['name']), + timestamp=network.MonotonicTime.from_json(json['timestamp']) + ) + + +@event_class('Page.backForwardCacheNotUsed') +@dataclass +class BackForwardCacheNotUsed: + ''' + **EXPERIMENTAL** + + 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. + ''' + #: The loader id for the associated navigation. + loader_id: network.LoaderId + #: The frame id of the associated frame. + frame_id: FrameId + #: Array of reasons why the page could not be cached. This must not be empty. + not_restored_explanations: typing.List[BackForwardCacheNotRestoredExplanation] + #: Tree structure of reasons why the page could not be cached for each frame. + not_restored_explanations_tree: typing.Optional[BackForwardCacheNotRestoredExplanationTree] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> BackForwardCacheNotUsed: + return cls( + loader_id=network.LoaderId.from_json(json['loaderId']), + frame_id=FrameId.from_json(json['frameId']), + not_restored_explanations=[BackForwardCacheNotRestoredExplanation.from_json(i) for i in json['notRestoredExplanations']], + not_restored_explanations_tree=BackForwardCacheNotRestoredExplanationTree.from_json(json['notRestoredExplanationsTree']) if 'notRestoredExplanationsTree' in json else None + ) + + +@event_class('Page.loadEventFired') +@dataclass +class LoadEventFired: + timestamp: network.MonotonicTime + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> LoadEventFired: + return cls( + timestamp=network.MonotonicTime.from_json(json['timestamp']) + ) + + +@event_class('Page.navigatedWithinDocument') +@dataclass +class NavigatedWithinDocument: + ''' + **EXPERIMENTAL** + + Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation. + ''' + #: Id of the frame. + frame_id: FrameId + #: Frame's new url. + url: str + #: Navigation type + navigation_type: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NavigatedWithinDocument: + return cls( + frame_id=FrameId.from_json(json['frameId']), + url=str(json['url']), + navigation_type=str(json['navigationType']) + ) + + +@event_class('Page.screencastFrame') +@dataclass +class ScreencastFrame: + ''' + **EXPERIMENTAL** + + Compressed image data requested by the ``startScreencast``. + ''' + #: Base64-encoded compressed image. + data: str + #: Screencast frame metadata. + metadata: ScreencastFrameMetadata + #: Frame number. + session_id: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ScreencastFrame: + return cls( + data=str(json['data']), + metadata=ScreencastFrameMetadata.from_json(json['metadata']), + session_id=int(json['sessionId']) + ) + + +@event_class('Page.screencastVisibilityChanged') +@dataclass +class ScreencastVisibilityChanged: + ''' + **EXPERIMENTAL** + + Fired when the page with currently enabled screencast was shown or hidden . + ''' + #: True if the page is visible. + visible: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ScreencastVisibilityChanged: + return cls( + visible=bool(json['visible']) + ) + + +@event_class('Page.windowOpen') +@dataclass +class WindowOpen: + ''' + Fired when a new window is going to be opened, via window.open(), link click, form submission, + etc. + ''' + #: The URL for the new window. + url: str + #: Window name. + window_name: str + #: An array of enabled window features. + window_features: typing.List[str] + #: Whether or not it was triggered by user gesture. + user_gesture: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WindowOpen: + return cls( + url=str(json['url']), + window_name=str(json['windowName']), + window_features=[str(i) for i in json['windowFeatures']], + user_gesture=bool(json['userGesture']) + ) + + +@event_class('Page.compilationCacheProduced') +@dataclass +class CompilationCacheProduced: + ''' + **EXPERIMENTAL** + + Issued for every compilation cache generated. Is only available + if Page.setGenerateCompilationCache is enabled. + ''' + url: str + #: Base64-encoded data + data: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CompilationCacheProduced: + return cls( + url=str(json['url']), + data=str(json['data']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/performance.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/performance.py new file mode 100644 index 0000000..3039ab7 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/performance.py @@ -0,0 +1,116 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Performance +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +@dataclass +class Metric: + ''' + Run-time execution metric. + ''' + #: Metric name. + name: str + + #: Metric value. + value: float + + def to_json(self): + json = dict() + json['name'] = self.name + json['value'] = self.value + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + value=float(json['value']), + ) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disable collecting and reporting metrics. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Performance.disable', + } + json = yield cmd_dict + + +def enable( + time_domain: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable collecting and reporting metrics. + + :param time_domain: *(Optional)* Time domain to use for collecting and reporting duration metrics. + ''' + params: T_JSON_DICT = dict() + if time_domain is not None: + params['timeDomain'] = time_domain + cmd_dict: T_JSON_DICT = { + 'method': 'Performance.enable', + 'params': params, + } + json = yield cmd_dict + + +def set_time_domain( + time_domain: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets time domain to use for collecting and reporting duration metrics. + Note that this must be called before enabling metrics collection. Calling + this method while metrics collection is enabled returns an error. + + **EXPERIMENTAL** + + :param time_domain: Time domain + ''' + params: T_JSON_DICT = dict() + params['timeDomain'] = time_domain + cmd_dict: T_JSON_DICT = { + 'method': 'Performance.setTimeDomain', + 'params': params, + } + json = yield cmd_dict + + +def get_metrics() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Metric]]: + ''' + Retrieve current values of run-time metrics. + + :returns: Current values for run-time metrics. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Performance.getMetrics', + } + json = yield cmd_dict + return [Metric.from_json(i) for i in json['metrics']] + + +@event_class('Performance.metrics') +@dataclass +class Metrics: + ''' + Current values of the metrics. + ''' + #: Current values of the metrics. + metrics: typing.List[Metric] + #: Timestamp title. + title: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> Metrics: + return cls( + metrics=[Metric.from_json(i) for i in json['metrics']], + title=str(json['title']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/performance_timeline.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/performance_timeline.py new file mode 100644 index 0000000..d43e241 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/performance_timeline.py @@ -0,0 +1,198 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: PerformanceTimeline (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import dom +from . import network +from . import page + + +@dataclass +class LargestContentfulPaint: + ''' + See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl + ''' + render_time: network.TimeSinceEpoch + + load_time: network.TimeSinceEpoch + + #: The number of pixels being painted. + size: float + + #: The id attribute of the element, if available. + element_id: typing.Optional[str] = None + + #: The URL of the image (may be trimmed). + url: typing.Optional[str] = None + + node_id: typing.Optional[dom.BackendNodeId] = None + + def to_json(self): + json = dict() + json['renderTime'] = self.render_time.to_json() + json['loadTime'] = self.load_time.to_json() + json['size'] = self.size + if self.element_id is not None: + json['elementId'] = self.element_id + if self.url is not None: + json['url'] = self.url + if self.node_id is not None: + json['nodeId'] = self.node_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + render_time=network.TimeSinceEpoch.from_json(json['renderTime']), + load_time=network.TimeSinceEpoch.from_json(json['loadTime']), + size=float(json['size']), + element_id=str(json['elementId']) if 'elementId' in json else None, + url=str(json['url']) if 'url' in json else None, + node_id=dom.BackendNodeId.from_json(json['nodeId']) if 'nodeId' in json else None, + ) + + +@dataclass +class LayoutShiftAttribution: + previous_rect: dom.Rect + + current_rect: dom.Rect + + node_id: typing.Optional[dom.BackendNodeId] = None + + def to_json(self): + json = dict() + json['previousRect'] = self.previous_rect.to_json() + json['currentRect'] = self.current_rect.to_json() + if self.node_id is not None: + json['nodeId'] = self.node_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + previous_rect=dom.Rect.from_json(json['previousRect']), + current_rect=dom.Rect.from_json(json['currentRect']), + node_id=dom.BackendNodeId.from_json(json['nodeId']) if 'nodeId' in json else None, + ) + + +@dataclass +class LayoutShift: + ''' + See https://wicg.github.io/layout-instability/#sec-layout-shift and layout_shift.idl + ''' + #: Score increment produced by this event. + value: float + + had_recent_input: bool + + last_input_time: network.TimeSinceEpoch + + sources: typing.List[LayoutShiftAttribution] + + def to_json(self): + json = dict() + json['value'] = self.value + json['hadRecentInput'] = self.had_recent_input + json['lastInputTime'] = self.last_input_time.to_json() + json['sources'] = [i.to_json() for i in self.sources] + return json + + @classmethod + def from_json(cls, json): + return cls( + value=float(json['value']), + had_recent_input=bool(json['hadRecentInput']), + last_input_time=network.TimeSinceEpoch.from_json(json['lastInputTime']), + sources=[LayoutShiftAttribution.from_json(i) for i in json['sources']], + ) + + +@dataclass +class TimelineEvent: + #: Identifies the frame that this event is related to. Empty for non-frame targets. + frame_id: page.FrameId + + #: 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. + type_: str + + #: Name may be empty depending on the type. + name: str + + #: Time in seconds since Epoch, monotonically increasing within document lifetime. + time: network.TimeSinceEpoch + + #: Event duration, if applicable. + duration: typing.Optional[float] = None + + lcp_details: typing.Optional[LargestContentfulPaint] = None + + layout_shift_details: typing.Optional[LayoutShift] = None + + def to_json(self): + json = dict() + json['frameId'] = self.frame_id.to_json() + json['type'] = self.type_ + json['name'] = self.name + json['time'] = self.time.to_json() + if self.duration is not None: + json['duration'] = self.duration + if self.lcp_details is not None: + json['lcpDetails'] = self.lcp_details.to_json() + if self.layout_shift_details is not None: + json['layoutShiftDetails'] = self.layout_shift_details.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + frame_id=page.FrameId.from_json(json['frameId']), + type_=str(json['type']), + name=str(json['name']), + time=network.TimeSinceEpoch.from_json(json['time']), + duration=float(json['duration']) if 'duration' in json else None, + lcp_details=LargestContentfulPaint.from_json(json['lcpDetails']) if 'lcpDetails' in json else None, + layout_shift_details=LayoutShift.from_json(json['layoutShiftDetails']) if 'layoutShiftDetails' in json else None, + ) + + +def enable( + event_types: typing.List[str] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Previously buffered events would be reported before method returns. + See also: timelineEventAdded + + :param event_types: The types of event to report, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype The specified filter overrides any previous filters, passing empty filter disables recording. Note that not all types exposed to the web platform are currently supported. + ''' + params: T_JSON_DICT = dict() + params['eventTypes'] = [i for i in event_types] + cmd_dict: T_JSON_DICT = { + 'method': 'PerformanceTimeline.enable', + 'params': params, + } + json = yield cmd_dict + + +@event_class('PerformanceTimeline.timelineEventAdded') +@dataclass +class TimelineEventAdded: + ''' + Sent when a performance timeline event is added. See reportPerformanceTimeline method. + ''' + event: TimelineEvent + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TimelineEventAdded: + return cls( + event=TimelineEvent.from_json(json['event']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/preload.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/preload.py new file mode 100644 index 0000000..9943a0d --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/preload.py @@ -0,0 +1,553 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Preload (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import dom +from . import network +from . import page + + +class RuleSetId(str): + ''' + Unique id + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> RuleSetId: + return cls(json) + + def __repr__(self): + return 'RuleSetId({})'.format(super().__repr__()) + + +@dataclass +class RuleSet: + ''' + Corresponds to SpeculationRuleSet + ''' + id_: RuleSetId + + #: Identifies a document which the rule set is associated with. + loader_id: network.LoaderId + + #: 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 + source_text: str + + #: 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 + backend_node_id: typing.Optional[dom.BackendNodeId] = None + + url: typing.Optional[str] = None + + request_id: typing.Optional[network.RequestId] = None + + #: Error information + #: ``errorMessage`` is null iff ``errorType`` is null. + error_type: typing.Optional[RuleSetErrorType] = None + + #: TODO(https://crbug.com/1425354): Replace this property with structured error. + error_message: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['id'] = self.id_.to_json() + json['loaderId'] = self.loader_id.to_json() + json['sourceText'] = self.source_text + if self.backend_node_id is not None: + json['backendNodeId'] = self.backend_node_id.to_json() + if self.url is not None: + json['url'] = self.url + if self.request_id is not None: + json['requestId'] = self.request_id.to_json() + if self.error_type is not None: + json['errorType'] = self.error_type.to_json() + if self.error_message is not None: + json['errorMessage'] = self.error_message + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=RuleSetId.from_json(json['id']), + loader_id=network.LoaderId.from_json(json['loaderId']), + source_text=str(json['sourceText']), + backend_node_id=dom.BackendNodeId.from_json(json['backendNodeId']) if 'backendNodeId' in json else None, + url=str(json['url']) if 'url' in json else None, + request_id=network.RequestId.from_json(json['requestId']) if 'requestId' in json else None, + error_type=RuleSetErrorType.from_json(json['errorType']) if 'errorType' in json else None, + error_message=str(json['errorMessage']) if 'errorMessage' in json else None, + ) + + +class RuleSetErrorType(enum.Enum): + SOURCE_IS_NOT_JSON_OBJECT = "SourceIsNotJsonObject" + INVALID_RULES_SKIPPED = "InvalidRulesSkipped" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class SpeculationAction(enum.Enum): + ''' + The type of preloading attempted. It corresponds to + mojom::SpeculationAction (although PrefetchWithSubresources is omitted as it + isn't being used by clients). + ''' + PREFETCH = "Prefetch" + PRERENDER = "Prerender" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class SpeculationTargetHint(enum.Enum): + ''' + Corresponds to mojom::SpeculationTargetHint. + See https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints + ''' + BLANK = "Blank" + SELF = "Self" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class PreloadingAttemptKey: + ''' + 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. + ''' + loader_id: network.LoaderId + + action: SpeculationAction + + url: str + + target_hint: typing.Optional[SpeculationTargetHint] = None + + def to_json(self): + json = dict() + json['loaderId'] = self.loader_id.to_json() + json['action'] = self.action.to_json() + json['url'] = self.url + if self.target_hint is not None: + json['targetHint'] = self.target_hint.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + loader_id=network.LoaderId.from_json(json['loaderId']), + action=SpeculationAction.from_json(json['action']), + url=str(json['url']), + target_hint=SpeculationTargetHint.from_json(json['targetHint']) if 'targetHint' in json else None, + ) + + +@dataclass +class PreloadingAttemptSource: + ''' + 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 or 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. + ''' + key: PreloadingAttemptKey + + rule_set_ids: typing.List[RuleSetId] + + node_ids: typing.List[dom.BackendNodeId] + + def to_json(self): + json = dict() + json['key'] = self.key.to_json() + json['ruleSetIds'] = [i.to_json() for i in self.rule_set_ids] + json['nodeIds'] = [i.to_json() for i in self.node_ids] + return json + + @classmethod + def from_json(cls, json): + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + rule_set_ids=[RuleSetId.from_json(i) for i in json['ruleSetIds']], + node_ids=[dom.BackendNodeId.from_json(i) for i in json['nodeIds']], + ) + + +class PreloadPipelineId(str): + ''' + Chrome manages different types of preloads together using a + concept of preloading pipeline. For example, if a site uses a + SpeculationRules for prerender, Chrome first starts a prefetch and + then upgrades it to prerender. + + CDP events for them are emitted separately but they share + ``PreloadPipelineId``. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> PreloadPipelineId: + return cls(json) + + def __repr__(self): + return 'PreloadPipelineId({})'.format(super().__repr__()) + + +class PrerenderFinalStatus(enum.Enum): + ''' + List of FinalStatus reasons for Prerender2. + ''' + ACTIVATED = "Activated" + DESTROYED = "Destroyed" + LOW_END_DEVICE = "LowEndDevice" + INVALID_SCHEME_REDIRECT = "InvalidSchemeRedirect" + INVALID_SCHEME_NAVIGATION = "InvalidSchemeNavigation" + NAVIGATION_REQUEST_BLOCKED_BY_CSP = "NavigationRequestBlockedByCsp" + MAIN_FRAME_NAVIGATION = "MainFrameNavigation" + MOJO_BINDER_POLICY = "MojoBinderPolicy" + RENDERER_PROCESS_CRASHED = "RendererProcessCrashed" + RENDERER_PROCESS_KILLED = "RendererProcessKilled" + DOWNLOAD = "Download" + TRIGGER_DESTROYED = "TriggerDestroyed" + NAVIGATION_NOT_COMMITTED = "NavigationNotCommitted" + NAVIGATION_BAD_HTTP_STATUS = "NavigationBadHttpStatus" + CLIENT_CERT_REQUESTED = "ClientCertRequested" + NAVIGATION_REQUEST_NETWORK_ERROR = "NavigationRequestNetworkError" + CANCEL_ALL_HOSTS_FOR_TESTING = "CancelAllHostsForTesting" + DID_FAIL_LOAD = "DidFailLoad" + STOP = "Stop" + SSL_CERTIFICATE_ERROR = "SslCertificateError" + LOGIN_AUTH_REQUESTED = "LoginAuthRequested" + UA_CHANGE_REQUIRES_RELOAD = "UaChangeRequiresReload" + BLOCKED_BY_CLIENT = "BlockedByClient" + AUDIO_OUTPUT_DEVICE_REQUESTED = "AudioOutputDeviceRequested" + MIXED_CONTENT = "MixedContent" + TRIGGER_BACKGROUNDED = "TriggerBackgrounded" + MEMORY_LIMIT_EXCEEDED = "MemoryLimitExceeded" + DATA_SAVER_ENABLED = "DataSaverEnabled" + TRIGGER_URL_HAS_EFFECTIVE_URL = "TriggerUrlHasEffectiveUrl" + ACTIVATED_BEFORE_STARTED = "ActivatedBeforeStarted" + INACTIVE_PAGE_RESTRICTION = "InactivePageRestriction" + START_FAILED = "StartFailed" + TIMEOUT_BACKGROUNDED = "TimeoutBackgrounded" + CROSS_SITE_REDIRECT_IN_INITIAL_NAVIGATION = "CrossSiteRedirectInInitialNavigation" + CROSS_SITE_NAVIGATION_IN_INITIAL_NAVIGATION = "CrossSiteNavigationInInitialNavigation" + SAME_SITE_CROSS_ORIGIN_REDIRECT_NOT_OPT_IN_IN_INITIAL_NAVIGATION = "SameSiteCrossOriginRedirectNotOptInInInitialNavigation" + SAME_SITE_CROSS_ORIGIN_NAVIGATION_NOT_OPT_IN_IN_INITIAL_NAVIGATION = "SameSiteCrossOriginNavigationNotOptInInInitialNavigation" + ACTIVATION_NAVIGATION_PARAMETER_MISMATCH = "ActivationNavigationParameterMismatch" + ACTIVATED_IN_BACKGROUND = "ActivatedInBackground" + EMBEDDER_HOST_DISALLOWED = "EmbedderHostDisallowed" + ACTIVATION_NAVIGATION_DESTROYED_BEFORE_SUCCESS = "ActivationNavigationDestroyedBeforeSuccess" + TAB_CLOSED_BY_USER_GESTURE = "TabClosedByUserGesture" + TAB_CLOSED_WITHOUT_USER_GESTURE = "TabClosedWithoutUserGesture" + PRIMARY_MAIN_FRAME_RENDERER_PROCESS_CRASHED = "PrimaryMainFrameRendererProcessCrashed" + PRIMARY_MAIN_FRAME_RENDERER_PROCESS_KILLED = "PrimaryMainFrameRendererProcessKilled" + ACTIVATION_FRAME_POLICY_NOT_COMPATIBLE = "ActivationFramePolicyNotCompatible" + PRELOADING_DISABLED = "PreloadingDisabled" + BATTERY_SAVER_ENABLED = "BatterySaverEnabled" + ACTIVATED_DURING_MAIN_FRAME_NAVIGATION = "ActivatedDuringMainFrameNavigation" + PRELOADING_UNSUPPORTED_BY_WEB_CONTENTS = "PreloadingUnsupportedByWebContents" + CROSS_SITE_REDIRECT_IN_MAIN_FRAME_NAVIGATION = "CrossSiteRedirectInMainFrameNavigation" + CROSS_SITE_NAVIGATION_IN_MAIN_FRAME_NAVIGATION = "CrossSiteNavigationInMainFrameNavigation" + SAME_SITE_CROSS_ORIGIN_REDIRECT_NOT_OPT_IN_IN_MAIN_FRAME_NAVIGATION = "SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation" + SAME_SITE_CROSS_ORIGIN_NAVIGATION_NOT_OPT_IN_IN_MAIN_FRAME_NAVIGATION = "SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation" + MEMORY_PRESSURE_ON_TRIGGER = "MemoryPressureOnTrigger" + MEMORY_PRESSURE_AFTER_TRIGGERED = "MemoryPressureAfterTriggered" + PRERENDERING_DISABLED_BY_DEV_TOOLS = "PrerenderingDisabledByDevTools" + SPECULATION_RULE_REMOVED = "SpeculationRuleRemoved" + ACTIVATED_WITH_AUXILIARY_BROWSING_CONTEXTS = "ActivatedWithAuxiliaryBrowsingContexts" + MAX_NUM_OF_RUNNING_EAGER_PRERENDERS_EXCEEDED = "MaxNumOfRunningEagerPrerendersExceeded" + MAX_NUM_OF_RUNNING_NON_EAGER_PRERENDERS_EXCEEDED = "MaxNumOfRunningNonEagerPrerendersExceeded" + MAX_NUM_OF_RUNNING_EMBEDDER_PRERENDERS_EXCEEDED = "MaxNumOfRunningEmbedderPrerendersExceeded" + PRERENDERING_URL_HAS_EFFECTIVE_URL = "PrerenderingUrlHasEffectiveUrl" + REDIRECTED_PRERENDERING_URL_HAS_EFFECTIVE_URL = "RedirectedPrerenderingUrlHasEffectiveUrl" + ACTIVATION_URL_HAS_EFFECTIVE_URL = "ActivationUrlHasEffectiveUrl" + JAVA_SCRIPT_INTERFACE_ADDED = "JavaScriptInterfaceAdded" + JAVA_SCRIPT_INTERFACE_REMOVED = "JavaScriptInterfaceRemoved" + ALL_PRERENDERING_CANCELED = "AllPrerenderingCanceled" + WINDOW_CLOSED = "WindowClosed" + SLOW_NETWORK = "SlowNetwork" + OTHER_PRERENDERED_PAGE_ACTIVATED = "OtherPrerenderedPageActivated" + V8_OPTIMIZER_DISABLED = "V8OptimizerDisabled" + PRERENDER_FAILED_DURING_PREFETCH = "PrerenderFailedDuringPrefetch" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class PreloadingStatus(enum.Enum): + ''' + Preloading status values, see also PreloadingTriggeringOutcome. This + status is shared by prefetchStatusUpdated and prerenderStatusUpdated. + ''' + PENDING = "Pending" + RUNNING = "Running" + READY = "Ready" + SUCCESS = "Success" + FAILURE = "Failure" + NOT_SUPPORTED = "NotSupported" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class PrefetchStatus(enum.Enum): + ''' + TODO(https://crbug.com/1384419): revisit the list of PrefetchStatus and + filter out the ones that aren't necessary to the developers. + ''' + PREFETCH_ALLOWED = "PrefetchAllowed" + PREFETCH_FAILED_INELIGIBLE_REDIRECT = "PrefetchFailedIneligibleRedirect" + PREFETCH_FAILED_INVALID_REDIRECT = "PrefetchFailedInvalidRedirect" + PREFETCH_FAILED_MIME_NOT_SUPPORTED = "PrefetchFailedMIMENotSupported" + PREFETCH_FAILED_NET_ERROR = "PrefetchFailedNetError" + PREFETCH_FAILED_NON2_XX = "PrefetchFailedNon2XX" + PREFETCH_EVICTED_AFTER_CANDIDATE_REMOVED = "PrefetchEvictedAfterCandidateRemoved" + PREFETCH_EVICTED_FOR_NEWER_PREFETCH = "PrefetchEvictedForNewerPrefetch" + PREFETCH_HELDBACK = "PrefetchHeldback" + PREFETCH_INELIGIBLE_RETRY_AFTER = "PrefetchIneligibleRetryAfter" + PREFETCH_IS_PRIVACY_DECOY = "PrefetchIsPrivacyDecoy" + PREFETCH_IS_STALE = "PrefetchIsStale" + PREFETCH_NOT_ELIGIBLE_BROWSER_CONTEXT_OFF_THE_RECORD = "PrefetchNotEligibleBrowserContextOffTheRecord" + PREFETCH_NOT_ELIGIBLE_DATA_SAVER_ENABLED = "PrefetchNotEligibleDataSaverEnabled" + PREFETCH_NOT_ELIGIBLE_EXISTING_PROXY = "PrefetchNotEligibleExistingProxy" + PREFETCH_NOT_ELIGIBLE_HOST_IS_NON_UNIQUE = "PrefetchNotEligibleHostIsNonUnique" + PREFETCH_NOT_ELIGIBLE_NON_DEFAULT_STORAGE_PARTITION = "PrefetchNotEligibleNonDefaultStoragePartition" + PREFETCH_NOT_ELIGIBLE_SAME_SITE_CROSS_ORIGIN_PREFETCH_REQUIRED_PROXY = "PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy" + PREFETCH_NOT_ELIGIBLE_SCHEME_IS_NOT_HTTPS = "PrefetchNotEligibleSchemeIsNotHttps" + PREFETCH_NOT_ELIGIBLE_USER_HAS_COOKIES = "PrefetchNotEligibleUserHasCookies" + PREFETCH_NOT_ELIGIBLE_USER_HAS_SERVICE_WORKER = "PrefetchNotEligibleUserHasServiceWorker" + PREFETCH_NOT_ELIGIBLE_BATTERY_SAVER_ENABLED = "PrefetchNotEligibleBatterySaverEnabled" + PREFETCH_NOT_ELIGIBLE_PRELOADING_DISABLED = "PrefetchNotEligiblePreloadingDisabled" + PREFETCH_NOT_FINISHED_IN_TIME = "PrefetchNotFinishedInTime" + PREFETCH_NOT_STARTED = "PrefetchNotStarted" + PREFETCH_NOT_USED_COOKIES_CHANGED = "PrefetchNotUsedCookiesChanged" + PREFETCH_PROXY_NOT_AVAILABLE = "PrefetchProxyNotAvailable" + PREFETCH_RESPONSE_USED = "PrefetchResponseUsed" + PREFETCH_SUCCESSFUL_BUT_NOT_USED = "PrefetchSuccessfulButNotUsed" + PREFETCH_NOT_USED_PROBE_FAILED = "PrefetchNotUsedProbeFailed" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class PrerenderMismatchedHeaders: + ''' + Information of headers to be displayed when the header mismatch occurred. + ''' + header_name: str + + initial_value: typing.Optional[str] = None + + activation_value: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['headerName'] = self.header_name + if self.initial_value is not None: + json['initialValue'] = self.initial_value + if self.activation_value is not None: + json['activationValue'] = self.activation_value + return json + + @classmethod + def from_json(cls, json): + return cls( + header_name=str(json['headerName']), + initial_value=str(json['initialValue']) if 'initialValue' in json else None, + activation_value=str(json['activationValue']) if 'activationValue' in json else None, + ) + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Preload.enable', + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Preload.disable', + } + json = yield cmd_dict + + +@event_class('Preload.ruleSetUpdated') +@dataclass +class RuleSetUpdated: + ''' + Upsert. Currently, it is only emitted when a rule set added. + ''' + rule_set: RuleSet + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> RuleSetUpdated: + return cls( + rule_set=RuleSet.from_json(json['ruleSet']) + ) + + +@event_class('Preload.ruleSetRemoved') +@dataclass +class RuleSetRemoved: + id_: RuleSetId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> RuleSetRemoved: + return cls( + id_=RuleSetId.from_json(json['id']) + ) + + +@event_class('Preload.preloadEnabledStateUpdated') +@dataclass +class PreloadEnabledStateUpdated: + ''' + Fired when a preload enabled state is updated. + ''' + disabled_by_preference: bool + disabled_by_data_saver: bool + disabled_by_battery_saver: bool + disabled_by_holdback_prefetch_speculation_rules: bool + disabled_by_holdback_prerender_speculation_rules: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreloadEnabledStateUpdated: + return cls( + disabled_by_preference=bool(json['disabledByPreference']), + disabled_by_data_saver=bool(json['disabledByDataSaver']), + disabled_by_battery_saver=bool(json['disabledByBatterySaver']), + disabled_by_holdback_prefetch_speculation_rules=bool(json['disabledByHoldbackPrefetchSpeculationRules']), + disabled_by_holdback_prerender_speculation_rules=bool(json['disabledByHoldbackPrerenderSpeculationRules']) + ) + + +@event_class('Preload.prefetchStatusUpdated') +@dataclass +class PrefetchStatusUpdated: + ''' + Fired when a prefetch attempt is updated. + ''' + key: PreloadingAttemptKey + pipeline_id: PreloadPipelineId + #: The frame id of the frame initiating prefetch. + initiating_frame_id: page.FrameId + prefetch_url: str + status: PreloadingStatus + prefetch_status: PrefetchStatus + request_id: network.RequestId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PrefetchStatusUpdated: + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + pipeline_id=PreloadPipelineId.from_json(json['pipelineId']), + initiating_frame_id=page.FrameId.from_json(json['initiatingFrameId']), + prefetch_url=str(json['prefetchUrl']), + status=PreloadingStatus.from_json(json['status']), + prefetch_status=PrefetchStatus.from_json(json['prefetchStatus']), + request_id=network.RequestId.from_json(json['requestId']) + ) + + +@event_class('Preload.prerenderStatusUpdated') +@dataclass +class PrerenderStatusUpdated: + ''' + Fired when a prerender attempt is updated. + ''' + key: PreloadingAttemptKey + pipeline_id: PreloadPipelineId + status: PreloadingStatus + prerender_status: typing.Optional[PrerenderFinalStatus] + #: 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. + disallowed_mojo_interface: typing.Optional[str] + mismatched_headers: typing.Optional[typing.List[PrerenderMismatchedHeaders]] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PrerenderStatusUpdated: + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + pipeline_id=PreloadPipelineId.from_json(json['pipelineId']), + status=PreloadingStatus.from_json(json['status']), + prerender_status=PrerenderFinalStatus.from_json(json['prerenderStatus']) if 'prerenderStatus' in json else None, + disallowed_mojo_interface=str(json['disallowedMojoInterface']) if 'disallowedMojoInterface' in json else None, + mismatched_headers=[PrerenderMismatchedHeaders.from_json(i) for i in json['mismatchedHeaders']] if 'mismatchedHeaders' in json else None + ) + + +@event_class('Preload.preloadingAttemptSourcesUpdated') +@dataclass +class PreloadingAttemptSourcesUpdated: + ''' + Send a list of sources for all preloading attempts in a document. + ''' + loader_id: network.LoaderId + preloading_attempt_sources: typing.List[PreloadingAttemptSource] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreloadingAttemptSourcesUpdated: + return cls( + loader_id=network.LoaderId.from_json(json['loaderId']), + preloading_attempt_sources=[PreloadingAttemptSource.from_json(i) for i in json['preloadingAttemptSources']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/profiler.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/profiler.py new file mode 100644 index 0000000..ab2ff07 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/profiler.py @@ -0,0 +1,418 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Profiler +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import debugger +from . import runtime + + +@dataclass +class ProfileNode: + ''' + Profile node. Holds callsite information, execution statistics and child nodes. + ''' + #: Unique id of the node. + id_: int + + #: Function location. + call_frame: runtime.CallFrame + + #: Number of samples where this node was on top of the call stack. + hit_count: typing.Optional[int] = None + + #: Child node ids. + children: typing.Optional[typing.List[int]] = None + + #: The reason of being not optimized. The function may be deoptimized or marked as don't + #: optimize. + deopt_reason: typing.Optional[str] = None + + #: An array of source position ticks. + position_ticks: typing.Optional[typing.List[PositionTickInfo]] = None + + def to_json(self): + json = dict() + json['id'] = self.id_ + json['callFrame'] = self.call_frame.to_json() + if self.hit_count is not None: + json['hitCount'] = self.hit_count + if self.children is not None: + json['children'] = [i for i in self.children] + if self.deopt_reason is not None: + json['deoptReason'] = self.deopt_reason + if self.position_ticks is not None: + json['positionTicks'] = [i.to_json() for i in self.position_ticks] + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=int(json['id']), + call_frame=runtime.CallFrame.from_json(json['callFrame']), + hit_count=int(json['hitCount']) if 'hitCount' in json else None, + children=[int(i) for i in json['children']] if 'children' in json else None, + deopt_reason=str(json['deoptReason']) if 'deoptReason' in json else None, + position_ticks=[PositionTickInfo.from_json(i) for i in json['positionTicks']] if 'positionTicks' in json else None, + ) + + +@dataclass +class Profile: + ''' + Profile. + ''' + #: The list of profile nodes. First item is the root node. + nodes: typing.List[ProfileNode] + + #: Profiling start timestamp in microseconds. + start_time: float + + #: Profiling end timestamp in microseconds. + end_time: float + + #: Ids of samples top nodes. + samples: typing.Optional[typing.List[int]] = None + + #: Time intervals between adjacent samples in microseconds. The first delta is relative to the + #: profile startTime. + time_deltas: typing.Optional[typing.List[int]] = None + + def to_json(self): + json = dict() + json['nodes'] = [i.to_json() for i in self.nodes] + json['startTime'] = self.start_time + json['endTime'] = self.end_time + if self.samples is not None: + json['samples'] = [i for i in self.samples] + if self.time_deltas is not None: + json['timeDeltas'] = [i for i in self.time_deltas] + return json + + @classmethod + def from_json(cls, json): + return cls( + nodes=[ProfileNode.from_json(i) for i in json['nodes']], + start_time=float(json['startTime']), + end_time=float(json['endTime']), + samples=[int(i) for i in json['samples']] if 'samples' in json else None, + time_deltas=[int(i) for i in json['timeDeltas']] if 'timeDeltas' in json else None, + ) + + +@dataclass +class PositionTickInfo: + ''' + Specifies a number of samples attributed to a certain source position. + ''' + #: Source line number (1-based). + line: int + + #: Number of samples attributed to the source line. + ticks: int + + def to_json(self): + json = dict() + json['line'] = self.line + json['ticks'] = self.ticks + return json + + @classmethod + def from_json(cls, json): + return cls( + line=int(json['line']), + ticks=int(json['ticks']), + ) + + +@dataclass +class CoverageRange: + ''' + Coverage data for a source range. + ''' + #: JavaScript script source offset for the range start. + start_offset: int + + #: JavaScript script source offset for the range end. + end_offset: int + + #: Collected execution count of the source range. + count: int + + def to_json(self): + json = dict() + json['startOffset'] = self.start_offset + json['endOffset'] = self.end_offset + json['count'] = self.count + return json + + @classmethod + def from_json(cls, json): + return cls( + start_offset=int(json['startOffset']), + end_offset=int(json['endOffset']), + count=int(json['count']), + ) + + +@dataclass +class FunctionCoverage: + ''' + Coverage data for a JavaScript function. + ''' + #: JavaScript function name. + function_name: str + + #: Source ranges inside the function with coverage data. + ranges: typing.List[CoverageRange] + + #: Whether coverage data for this function has block granularity. + is_block_coverage: bool + + def to_json(self): + json = dict() + json['functionName'] = self.function_name + json['ranges'] = [i.to_json() for i in self.ranges] + json['isBlockCoverage'] = self.is_block_coverage + return json + + @classmethod + def from_json(cls, json): + return cls( + function_name=str(json['functionName']), + ranges=[CoverageRange.from_json(i) for i in json['ranges']], + is_block_coverage=bool(json['isBlockCoverage']), + ) + + +@dataclass +class ScriptCoverage: + ''' + Coverage data for a JavaScript script. + ''' + #: JavaScript script id. + script_id: runtime.ScriptId + + #: JavaScript script name or url. + url: str + + #: Functions contained in the script that has coverage data. + functions: typing.List[FunctionCoverage] + + def to_json(self): + json = dict() + json['scriptId'] = self.script_id.to_json() + json['url'] = self.url + json['functions'] = [i.to_json() for i in self.functions] + return json + + @classmethod + def from_json(cls, json): + return cls( + script_id=runtime.ScriptId.from_json(json['scriptId']), + url=str(json['url']), + functions=[FunctionCoverage.from_json(i) for i in json['functions']], + ) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.disable', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.enable', + } + json = yield cmd_dict + + +def get_best_effort_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[ScriptCoverage]]: + ''' + Collect coverage data for the current isolate. The coverage data may be incomplete due to + garbage collection. + + :returns: Coverage data for the current isolate. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.getBestEffortCoverage', + } + json = yield cmd_dict + return [ScriptCoverage.from_json(i) for i in json['result']] + + +def set_sampling_interval( + interval: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + + :param interval: New sampling interval in microseconds. + ''' + params: T_JSON_DICT = dict() + params['interval'] = interval + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.setSamplingInterval', + 'params': params, + } + json = yield cmd_dict + + +def start() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.start', + } + json = yield cmd_dict + + +def start_precise_coverage( + call_count: typing.Optional[bool] = None, + detailed: typing.Optional[bool] = None, + allow_triggered_updates: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,float]: + ''' + 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. + + :param call_count: *(Optional)* Collect accurate call counts beyond simple 'covered' or 'not covered'. + :param detailed: *(Optional)* Collect block-based coverage. + :param allow_triggered_updates: *(Optional)* Allow the backend to send updates on its own initiative + :returns: Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + ''' + params: T_JSON_DICT = dict() + if call_count is not None: + params['callCount'] = call_count + if detailed is not None: + params['detailed'] = detailed + if allow_triggered_updates is not None: + params['allowTriggeredUpdates'] = allow_triggered_updates + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.startPreciseCoverage', + 'params': params, + } + json = yield cmd_dict + return float(json['timestamp']) + + +def stop() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,Profile]: + ''' + + + :returns: Recorded profile. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.stop', + } + json = yield cmd_dict + return Profile.from_json(json['profile']) + + +def stop_precise_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disable precise code coverage. Disabling releases unnecessary execution count records and allows + executing optimized code. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.stopPreciseCoverage', + } + json = yield cmd_dict + + +def take_precise_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.List[ScriptCoverage], float]]: + ''' + Collect coverage data for the current isolate, and resets execution counters. Precise code + coverage needs to have started. + + :returns: A tuple with the following items: + + 0. **result** - Coverage data for the current isolate. + 1. **timestamp** - Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.takePreciseCoverage', + } + json = yield cmd_dict + return ( + [ScriptCoverage.from_json(i) for i in json['result']], + float(json['timestamp']) + ) + + +@event_class('Profiler.consoleProfileFinished') +@dataclass +class ConsoleProfileFinished: + id_: str + #: Location of console.profileEnd(). + location: debugger.Location + profile: Profile + #: Profile title passed as an argument to console.profile(). + title: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleProfileFinished: + return cls( + id_=str(json['id']), + location=debugger.Location.from_json(json['location']), + profile=Profile.from_json(json['profile']), + title=str(json['title']) if 'title' in json else None + ) + + +@event_class('Profiler.consoleProfileStarted') +@dataclass +class ConsoleProfileStarted: + ''' + Sent when new profile recording is started using console.profile() call. + ''' + id_: str + #: Location of console.profile(). + location: debugger.Location + #: Profile title passed as an argument to console.profile(). + title: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleProfileStarted: + return cls( + id_=str(json['id']), + location=debugger.Location.from_json(json['location']), + title=str(json['title']) if 'title' in json else None + ) + + +@event_class('Profiler.preciseCoverageDeltaUpdate') +@dataclass +class PreciseCoverageDeltaUpdate: + ''' + **EXPERIMENTAL** + + 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. + ''' + #: Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + timestamp: float + #: Identifier for distinguishing coverage events. + occasion: str + #: Coverage data for the current isolate. + result: typing.List[ScriptCoverage] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreciseCoverageDeltaUpdate: + return cls( + timestamp=float(json['timestamp']), + occasion=str(json['occasion']), + result=[ScriptCoverage.from_json(i) for i in json['result']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/pwa.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/pwa.py new file mode 100644 index 0000000..8def6e8 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/pwa.py @@ -0,0 +1,260 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: PWA (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import target + + +@dataclass +class FileHandlerAccept: + ''' + 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 + ''' + #: New name of the mimetype according to + #: https://www.iana.org/assignments/media-types/media-types.xhtml + media_type: str + + file_extensions: typing.List[str] + + def to_json(self): + json = dict() + json['mediaType'] = self.media_type + json['fileExtensions'] = [i for i in self.file_extensions] + return json + + @classmethod + def from_json(cls, json): + return cls( + media_type=str(json['mediaType']), + file_extensions=[str(i) for i in json['fileExtensions']], + ) + + +@dataclass +class FileHandler: + action: str + + accepts: typing.List[FileHandlerAccept] + + display_name: str + + def to_json(self): + json = dict() + json['action'] = self.action + json['accepts'] = [i.to_json() for i in self.accepts] + json['displayName'] = self.display_name + return json + + @classmethod + def from_json(cls, json): + return cls( + action=str(json['action']), + accepts=[FileHandlerAccept.from_json(i) for i in json['accepts']], + display_name=str(json['displayName']), + ) + + +class DisplayMode(enum.Enum): + ''' + If user prefers opening the app in browser or an app window. + ''' + STANDALONE = "standalone" + BROWSER = "browser" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def get_os_app_state( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[int, typing.List[FileHandler]]]: + ''' + Returns the following OS state for the given manifest id. + + :param manifest_id: The id from the webapp's manifest file, commonly it's the url of the site installing the webapp. See https://web.dev/learn/pwa/web-app-manifest. + :returns: A tuple with the following items: + + 0. **badgeCount** - + 1. **fileHandlers** - + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.getOsAppState', + 'params': params, + } + json = yield cmd_dict + return ( + int(json['badgeCount']), + [FileHandler.from_json(i) for i in json['fileHandlers']] + ) + + +def install( + manifest_id: str, + install_url_or_bundle_url: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Installs the given manifest identity, optionally using the given install_url + or IWA bundle location. + + TODO(crbug.com/337872319) Support IWA to meet the following specific + requirement. + IWA-specific install description: If the manifest_id is isolated-app://, + install_url_or_bundle_url is required, and can be either an http(s) URL or + file:// URL pointing to a signed web bundle (.swbn). The .swbn file's + signing key must correspond to manifest_id. If Chrome is not in IWA dev + mode, the installation will fail, regardless of the state of the allowlist. + + :param manifest_id: + :param install_url_or_bundle_url: *(Optional)* The location of the app or bundle overriding the one derived from the manifestId. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if install_url_or_bundle_url is not None: + params['installUrlOrBundleUrl'] = install_url_or_bundle_url + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.install', + 'params': params, + } + json = yield cmd_dict + + +def uninstall( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Uninstalls the given manifest_id and closes any opened app windows. + + :param manifest_id: + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.uninstall', + 'params': params, + } + json = yield cmd_dict + + +def launch( + manifest_id: str, + url: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,target.TargetID]: + ''' + 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. + + :param manifest_id: + :param url: *(Optional)* + :returns: ID of the tab target created as a result. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if url is not None: + params['url'] = url + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.launch', + 'params': params, + } + json = yield cmd_dict + return target.TargetID.from_json(json['targetId']) + + +def launch_files_in_app( + manifest_id: str, + files: typing.List[str] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[target.TargetID]]: + ''' + 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. + + :param manifest_id: + :param files: + :returns: IDs of the tab targets created as the result. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + params['files'] = [i for i in files] + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.launchFilesInApp', + 'params': params, + } + json = yield cmd_dict + return [target.TargetID.from_json(i) for i in json['targetIds']] + + +def open_current_page_in_app( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param manifest_id: + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.openCurrentPageInApp', + 'params': params, + } + json = yield cmd_dict + + +def change_app_user_settings( + manifest_id: str, + link_capturing: typing.Optional[bool] = None, + display_mode: typing.Optional[DisplayMode] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param manifest_id: + :param link_capturing: *(Optional)* If user allows the links clicked on by the user in the app's scope, or extended 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 the initial value, uninstalling and installing the web app again will reset it. TODO(crbug.com/339453269): Setting this value on ChromeOS is not supported yet. + :param display_mode: *(Optional)* + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if link_capturing is not None: + params['linkCapturing'] = link_capturing + if display_mode is not None: + params['displayMode'] = display_mode.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.changeAppUserSettings', + 'params': params, + } + json = yield cmd_dict diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/py.typed b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/runtime.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/runtime.py new file mode 100644 index 0000000..c8b4957 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/runtime.py @@ -0,0 +1,1583 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Runtime +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class ScriptId(str): + ''' + Unique script identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> ScriptId: + return cls(json) + + def __repr__(self): + return 'ScriptId({})'.format(super().__repr__()) + + +@dataclass +class SerializationOptions: + ''' + Represents options for serialization. Overrides ``generatePreview`` and ``returnByValue``. + ''' + serialization: str + + #: Deep serialization depth. Default is full depth. Respected only in ``deep`` serialization mode. + max_depth: typing.Optional[int] = None + + #: 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. + additional_parameters: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['serialization'] = self.serialization + if self.max_depth is not None: + json['maxDepth'] = self.max_depth + if self.additional_parameters is not None: + json['additionalParameters'] = self.additional_parameters + return json + + @classmethod + def from_json(cls, json): + return cls( + serialization=str(json['serialization']), + max_depth=int(json['maxDepth']) if 'maxDepth' in json else None, + additional_parameters=dict(json['additionalParameters']) if 'additionalParameters' in json else None, + ) + + +@dataclass +class DeepSerializedValue: + ''' + Represents deep serialized value. + ''' + type_: str + + value: typing.Optional[typing.Any] = None + + object_id: typing.Optional[str] = None + + #: 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. + weak_local_object_reference: typing.Optional[int] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + if self.value is not None: + json['value'] = self.value + if self.object_id is not None: + json['objectId'] = self.object_id + if self.weak_local_object_reference is not None: + json['weakLocalObjectReference'] = self.weak_local_object_reference + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + value=json['value'] if 'value' in json else None, + object_id=str(json['objectId']) if 'objectId' in json else None, + weak_local_object_reference=int(json['weakLocalObjectReference']) if 'weakLocalObjectReference' in json else None, + ) + + +class RemoteObjectId(str): + ''' + Unique object identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> RemoteObjectId: + return cls(json) + + def __repr__(self): + return 'RemoteObjectId({})'.format(super().__repr__()) + + +class UnserializableValue(str): + ''' + Primitive value which cannot be JSON-stringified. Includes values ``-0``, ``NaN``, ``Infinity``, + ``-Infinity``, and bigint literals. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnserializableValue: + return cls(json) + + def __repr__(self): + return 'UnserializableValue({})'.format(super().__repr__()) + + +@dataclass +class RemoteObject: + ''' + Mirror object referencing original JavaScript object. + ''' + #: Object type. + type_: str + + #: 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. + subtype: typing.Optional[str] = None + + #: Object class (constructor) name. Specified for ``object`` type values only. + class_name: typing.Optional[str] = None + + #: Remote object value in case of primitive values or JSON values (if it was requested). + value: typing.Optional[typing.Any] = None + + #: Primitive value which can not be JSON-stringified does not have ``value``, but gets this + #: property. + unserializable_value: typing.Optional[UnserializableValue] = None + + #: String representation of the object. + description: typing.Optional[str] = None + + #: Deep serialized value. + deep_serialized_value: typing.Optional[DeepSerializedValue] = None + + #: Unique object identifier (for non-primitive values). + object_id: typing.Optional[RemoteObjectId] = None + + #: Preview containing abbreviated property values. Specified for ``object`` type values only. + preview: typing.Optional[ObjectPreview] = None + + custom_preview: typing.Optional[CustomPreview] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + if self.subtype is not None: + json['subtype'] = self.subtype + if self.class_name is not None: + json['className'] = self.class_name + if self.value is not None: + json['value'] = self.value + if self.unserializable_value is not None: + json['unserializableValue'] = self.unserializable_value.to_json() + if self.description is not None: + json['description'] = self.description + if self.deep_serialized_value is not None: + json['deepSerializedValue'] = self.deep_serialized_value.to_json() + if self.object_id is not None: + json['objectId'] = self.object_id.to_json() + if self.preview is not None: + json['preview'] = self.preview.to_json() + if self.custom_preview is not None: + json['customPreview'] = self.custom_preview.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + subtype=str(json['subtype']) if 'subtype' in json else None, + class_name=str(json['className']) if 'className' in json else None, + value=json['value'] if 'value' in json else None, + unserializable_value=UnserializableValue.from_json(json['unserializableValue']) if 'unserializableValue' in json else None, + description=str(json['description']) if 'description' in json else None, + deep_serialized_value=DeepSerializedValue.from_json(json['deepSerializedValue']) if 'deepSerializedValue' in json else None, + object_id=RemoteObjectId.from_json(json['objectId']) if 'objectId' in json else None, + preview=ObjectPreview.from_json(json['preview']) if 'preview' in json else None, + custom_preview=CustomPreview.from_json(json['customPreview']) if 'customPreview' in json else None, + ) + + +@dataclass +class CustomPreview: + #: The JSON-stringified result of formatter.header(object, config) call. + #: It contains json ML array that represents RemoteObject. + header: str + + #: 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. + body_getter_id: typing.Optional[RemoteObjectId] = None + + def to_json(self): + json = dict() + json['header'] = self.header + if self.body_getter_id is not None: + json['bodyGetterId'] = self.body_getter_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + header=str(json['header']), + body_getter_id=RemoteObjectId.from_json(json['bodyGetterId']) if 'bodyGetterId' in json else None, + ) + + +@dataclass +class ObjectPreview: + ''' + Object containing abbreviated remote object value. + ''' + #: Object type. + type_: str + + #: True iff some of the properties or entries of the original object did not fit. + overflow: bool + + #: List of the properties. + properties: typing.List[PropertyPreview] + + #: Object subtype hint. Specified for ``object`` type values only. + subtype: typing.Optional[str] = None + + #: String representation of the object. + description: typing.Optional[str] = None + + #: List of the entries. Specified for ``map`` and ``set`` subtype values only. + entries: typing.Optional[typing.List[EntryPreview]] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + json['overflow'] = self.overflow + json['properties'] = [i.to_json() for i in self.properties] + if self.subtype is not None: + json['subtype'] = self.subtype + if self.description is not None: + json['description'] = self.description + if self.entries is not None: + json['entries'] = [i.to_json() for i in self.entries] + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + overflow=bool(json['overflow']), + properties=[PropertyPreview.from_json(i) for i in json['properties']], + subtype=str(json['subtype']) if 'subtype' in json else None, + description=str(json['description']) if 'description' in json else None, + entries=[EntryPreview.from_json(i) for i in json['entries']] if 'entries' in json else None, + ) + + +@dataclass +class PropertyPreview: + #: Property name. + name: str + + #: Object type. Accessor means that the property itself is an accessor property. + type_: str + + #: User-friendly property value string. + value: typing.Optional[str] = None + + #: Nested value preview. + value_preview: typing.Optional[ObjectPreview] = None + + #: Object subtype hint. Specified for ``object`` type values only. + subtype: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['name'] = self.name + json['type'] = self.type_ + if self.value is not None: + json['value'] = self.value + if self.value_preview is not None: + json['valuePreview'] = self.value_preview.to_json() + if self.subtype is not None: + json['subtype'] = self.subtype + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + type_=str(json['type']), + value=str(json['value']) if 'value' in json else None, + value_preview=ObjectPreview.from_json(json['valuePreview']) if 'valuePreview' in json else None, + subtype=str(json['subtype']) if 'subtype' in json else None, + ) + + +@dataclass +class EntryPreview: + #: Preview of the value. + value: ObjectPreview + + #: Preview of the key. Specified for map-like collection entries. + key: typing.Optional[ObjectPreview] = None + + def to_json(self): + json = dict() + json['value'] = self.value.to_json() + if self.key is not None: + json['key'] = self.key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + value=ObjectPreview.from_json(json['value']), + key=ObjectPreview.from_json(json['key']) if 'key' in json else None, + ) + + +@dataclass +class PropertyDescriptor: + ''' + Object property descriptor. + ''' + #: Property name or symbol description. + name: str + + #: True if the type of this property descriptor may be changed and if the property may be + #: deleted from the corresponding object. + configurable: bool + + #: True if this property shows up during enumeration of the properties on the corresponding + #: object. + enumerable: bool + + #: The value associated with the property. + value: typing.Optional[RemoteObject] = None + + #: True if the value associated with the property may be changed (data descriptors only). + writable: typing.Optional[bool] = None + + #: A function which serves as a getter for the property, or ``undefined`` if there is no getter + #: (accessor descriptors only). + get: typing.Optional[RemoteObject] = None + + #: A function which serves as a setter for the property, or ``undefined`` if there is no setter + #: (accessor descriptors only). + set_: typing.Optional[RemoteObject] = None + + #: True if the result was thrown during the evaluation. + was_thrown: typing.Optional[bool] = None + + #: True if the property is owned for the object. + is_own: typing.Optional[bool] = None + + #: Property symbol object, if the property is of the ``symbol`` type. + symbol: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + json['configurable'] = self.configurable + json['enumerable'] = self.enumerable + if self.value is not None: + json['value'] = self.value.to_json() + if self.writable is not None: + json['writable'] = self.writable + if self.get is not None: + json['get'] = self.get.to_json() + if self.set_ is not None: + json['set'] = self.set_.to_json() + if self.was_thrown is not None: + json['wasThrown'] = self.was_thrown + if self.is_own is not None: + json['isOwn'] = self.is_own + if self.symbol is not None: + json['symbol'] = self.symbol.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + configurable=bool(json['configurable']), + enumerable=bool(json['enumerable']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + writable=bool(json['writable']) if 'writable' in json else None, + get=RemoteObject.from_json(json['get']) if 'get' in json else None, + set_=RemoteObject.from_json(json['set']) if 'set' in json else None, + was_thrown=bool(json['wasThrown']) if 'wasThrown' in json else None, + is_own=bool(json['isOwn']) if 'isOwn' in json else None, + symbol=RemoteObject.from_json(json['symbol']) if 'symbol' in json else None, + ) + + +@dataclass +class InternalPropertyDescriptor: + ''' + Object internal property descriptor. This property isn't normally visible in JavaScript code. + ''' + #: Conventional property name. + name: str + + #: The value associated with the property. + value: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + if self.value is not None: + json['value'] = self.value.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + ) + + +@dataclass +class PrivatePropertyDescriptor: + ''' + Object private field descriptor. + ''' + #: Private property name. + name: str + + #: The value associated with the private property. + value: typing.Optional[RemoteObject] = None + + #: A function which serves as a getter for the private property, + #: or ``undefined`` if there is no getter (accessor descriptors only). + get: typing.Optional[RemoteObject] = None + + #: A function which serves as a setter for the private property, + #: or ``undefined`` if there is no setter (accessor descriptors only). + set_: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + if self.value is not None: + json['value'] = self.value.to_json() + if self.get is not None: + json['get'] = self.get.to_json() + if self.set_ is not None: + json['set'] = self.set_.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + get=RemoteObject.from_json(json['get']) if 'get' in json else None, + set_=RemoteObject.from_json(json['set']) if 'set' in json else None, + ) + + +@dataclass +class CallArgument: + ''' + Represents function call argument. Either remote object id ``objectId``, primitive ``value``, + unserializable primitive value or neither of (for undefined) them should be specified. + ''' + #: Primitive value or serializable javascript object. + value: typing.Optional[typing.Any] = None + + #: Primitive value which can not be JSON-stringified. + unserializable_value: typing.Optional[UnserializableValue] = None + + #: Remote object handle. + object_id: typing.Optional[RemoteObjectId] = None + + def to_json(self): + json = dict() + if self.value is not None: + json['value'] = self.value + if self.unserializable_value is not None: + json['unserializableValue'] = self.unserializable_value.to_json() + if self.object_id is not None: + json['objectId'] = self.object_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + value=json['value'] if 'value' in json else None, + unserializable_value=UnserializableValue.from_json(json['unserializableValue']) if 'unserializableValue' in json else None, + object_id=RemoteObjectId.from_json(json['objectId']) if 'objectId' in json else None, + ) + + +class ExecutionContextId(int): + ''' + Id of an execution context. + ''' + def to_json(self) -> int: + return self + + @classmethod + def from_json(cls, json: int) -> ExecutionContextId: + return cls(json) + + def __repr__(self): + return 'ExecutionContextId({})'.format(super().__repr__()) + + +@dataclass +class ExecutionContextDescription: + ''' + Description of an isolated world. + ''' + #: Unique id of the execution context. It can be used to specify in which execution context + #: script evaluation should be performed. + id_: ExecutionContextId + + #: Execution context origin. + origin: str + + #: Human readable name describing given context. + name: str + + #: 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. + unique_id: str + + #: Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'``'isolated'``'worker', frameId: string} + aux_data: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['id'] = self.id_.to_json() + json['origin'] = self.origin + json['name'] = self.name + json['uniqueId'] = self.unique_id + if self.aux_data is not None: + json['auxData'] = self.aux_data + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=ExecutionContextId.from_json(json['id']), + origin=str(json['origin']), + name=str(json['name']), + unique_id=str(json['uniqueId']), + aux_data=dict(json['auxData']) if 'auxData' in json else None, + ) + + +@dataclass +class ExceptionDetails: + ''' + Detailed information about exception (or error) that was thrown during script compilation or + execution. + ''' + #: Exception id. + exception_id: int + + #: Exception text, which should be used together with exception object when available. + text: str + + #: Line number of the exception location (0-based). + line_number: int + + #: Column number of the exception location (0-based). + column_number: int + + #: Script ID of the exception location. + script_id: typing.Optional[ScriptId] = None + + #: URL of the exception location, to be used when the script was not reported. + url: typing.Optional[str] = None + + #: JavaScript stack trace if available. + stack_trace: typing.Optional[StackTrace] = None + + #: Exception object if available. + exception: typing.Optional[RemoteObject] = None + + #: Identifier of the context where exception happened. + execution_context_id: typing.Optional[ExecutionContextId] = None + + #: Dictionary with entries of meta data that the client associated + #: with this exception, such as information about associated network + #: requests, etc. + exception_meta_data: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['exceptionId'] = self.exception_id + json['text'] = self.text + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + if self.script_id is not None: + json['scriptId'] = self.script_id.to_json() + if self.url is not None: + json['url'] = self.url + if self.stack_trace is not None: + json['stackTrace'] = self.stack_trace.to_json() + if self.exception is not None: + json['exception'] = self.exception.to_json() + if self.execution_context_id is not None: + json['executionContextId'] = self.execution_context_id.to_json() + if self.exception_meta_data is not None: + json['exceptionMetaData'] = self.exception_meta_data + return json + + @classmethod + def from_json(cls, json): + return cls( + exception_id=int(json['exceptionId']), + text=str(json['text']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + script_id=ScriptId.from_json(json['scriptId']) if 'scriptId' in json else None, + url=str(json['url']) if 'url' in json else None, + stack_trace=StackTrace.from_json(json['stackTrace']) if 'stackTrace' in json else None, + exception=RemoteObject.from_json(json['exception']) if 'exception' in json else None, + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) if 'executionContextId' in json else None, + exception_meta_data=dict(json['exceptionMetaData']) if 'exceptionMetaData' in json else None, + ) + + +class Timestamp(float): + ''' + Number of milliseconds since epoch. + ''' + def to_json(self) -> float: + return self + + @classmethod + def from_json(cls, json: float) -> Timestamp: + return cls(json) + + def __repr__(self): + return 'Timestamp({})'.format(super().__repr__()) + + +class TimeDelta(float): + ''' + Number of milliseconds. + ''' + def to_json(self) -> float: + return self + + @classmethod + def from_json(cls, json: float) -> TimeDelta: + return cls(json) + + def __repr__(self): + return 'TimeDelta({})'.format(super().__repr__()) + + +@dataclass +class CallFrame: + ''' + Stack entry for runtime errors and assertions. + ''' + #: JavaScript function name. + function_name: str + + #: JavaScript script id. + script_id: ScriptId + + #: JavaScript script name or url. + url: str + + #: JavaScript script line number (0-based). + line_number: int + + #: JavaScript script column number (0-based). + column_number: int + + def to_json(self): + json = dict() + json['functionName'] = self.function_name + json['scriptId'] = self.script_id.to_json() + json['url'] = self.url + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + return json + + @classmethod + def from_json(cls, json): + return cls( + function_name=str(json['functionName']), + script_id=ScriptId.from_json(json['scriptId']), + url=str(json['url']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + ) + + +@dataclass +class StackTrace: + ''' + Call frames for assertions or error messages. + ''' + #: JavaScript function name. + call_frames: typing.List[CallFrame] + + #: String label of this stack trace. For async traces this may be a name of the function that + #: initiated the async call. + description: typing.Optional[str] = None + + #: Asynchronous JavaScript stack trace that preceded this stack, if available. + parent: typing.Optional[StackTrace] = None + + #: Asynchronous JavaScript stack trace that preceded this stack, if available. + parent_id: typing.Optional[StackTraceId] = None + + def to_json(self): + json = dict() + json['callFrames'] = [i.to_json() for i in self.call_frames] + if self.description is not None: + json['description'] = self.description + if self.parent is not None: + json['parent'] = self.parent.to_json() + if self.parent_id is not None: + json['parentId'] = self.parent_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + call_frames=[CallFrame.from_json(i) for i in json['callFrames']], + description=str(json['description']) if 'description' in json else None, + parent=StackTrace.from_json(json['parent']) if 'parent' in json else None, + parent_id=StackTraceId.from_json(json['parentId']) if 'parentId' in json else None, + ) + + +class UniqueDebuggerId(str): + ''' + Unique identifier of current debugger. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UniqueDebuggerId: + return cls(json) + + def __repr__(self): + return 'UniqueDebuggerId({})'.format(super().__repr__()) + + +@dataclass +class StackTraceId: + ''' + 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. + ''' + id_: str + + debugger_id: typing.Optional[UniqueDebuggerId] = None + + def to_json(self): + json = dict() + json['id'] = self.id_ + if self.debugger_id is not None: + json['debuggerId'] = self.debugger_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=str(json['id']), + debugger_id=UniqueDebuggerId.from_json(json['debuggerId']) if 'debuggerId' in json else None, + ) + + +def await_promise( + promise_object_id: RemoteObjectId, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Add handler to promise with given promise object id. + + :param promise_object_id: Identifier of the promise. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object that should be sent by value. + :param generate_preview: *(Optional)* Whether preview should be generated for the result. + :returns: A tuple with the following items: + + 0. **result** - Promise result. Will contain rejected value if promise was rejected. + 1. **exceptionDetails** - *(Optional)* Exception details if stack strace is available. + ''' + params: T_JSON_DICT = dict() + params['promiseObjectId'] = promise_object_id.to_json() + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.awaitPromise', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def call_function_on( + function_declaration: str, + object_id: typing.Optional[RemoteObjectId] = None, + arguments: typing.Optional[typing.List[CallArgument]] = None, + silent: typing.Optional[bool] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + user_gesture: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None, + execution_context_id: typing.Optional[ExecutionContextId] = None, + object_group: typing.Optional[str] = None, + throw_on_side_effect: typing.Optional[bool] = None, + unique_context_id: typing.Optional[str] = None, + serialization_options: typing.Optional[SerializationOptions] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Calls function with given declaration on the given object. Object group of the result is + inherited from the target object. + + :param function_declaration: Declaration of the function to call. + :param object_id: *(Optional)* Identifier of the object to call function on. Either objectId or executionContextId should be specified. + :param arguments: *(Optional)* Call arguments. All call arguments must belong to the same JavaScript world as the target object. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object which should be sent by value. Can be overriden by ````serializationOptions````. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the result. + :param user_gesture: *(Optional)* Whether execution should be treated as initiated by user in the UI. + :param await_promise: *(Optional)* Whether execution should ````await```` for resulting value and return once awaited promise is resolved. + :param execution_context_id: *(Optional)* Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + :param throw_on_side_effect: **(EXPERIMENTAL)** *(Optional)* Whether to throw an exception if side effect cannot be ruled out during evaluation. + :param unique_context_id: **(EXPERIMENTAL)** *(Optional)* 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 be system-unique, so it can be used to prevent accidental function call in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with ````executionContextId````. + :param serialization_options: **(EXPERIMENTAL)** *(Optional)* Specifies the result serialization. If provided, overrides ````generatePreview```` and ````returnByValue```. + :returns: A tuple with the following items: + + 0. **result** - Call result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['functionDeclaration'] = function_declaration + if object_id is not None: + params['objectId'] = object_id.to_json() + if arguments is not None: + params['arguments'] = [i.to_json() for i in arguments] + if silent is not None: + params['silent'] = silent + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if user_gesture is not None: + params['userGesture'] = user_gesture + if await_promise is not None: + params['awaitPromise'] = await_promise + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + if throw_on_side_effect is not None: + params['throwOnSideEffect'] = throw_on_side_effect + if unique_context_id is not None: + params['uniqueContextId'] = unique_context_id + if serialization_options is not None: + params['serializationOptions'] = serialization_options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.callFunctionOn', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def compile_script( + expression: str, + source_url: str, + persist_script: bool, + execution_context_id: typing.Optional[ExecutionContextId] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.Optional[ScriptId], typing.Optional[ExceptionDetails]]]: + ''' + Compiles expression. + + :param expression: Expression to compile. + :param source_url: Source url to be set for the script. + :param persist_script: Specifies whether the compiled script should be persisted. + :param execution_context_id: *(Optional)* Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + :returns: A tuple with the following items: + + 0. **scriptId** - *(Optional)* Id of the script. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['expression'] = expression + params['sourceURL'] = source_url + params['persistScript'] = persist_script + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.compileScript', + 'params': params, + } + json = yield cmd_dict + return ( + ScriptId.from_json(json['scriptId']) if 'scriptId' in json else None, + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables reporting of execution contexts creation. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.disable', + } + json = yield cmd_dict + + +def discard_console_entries() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Discards collected exceptions and console API calls. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.discardConsoleEntries', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.enable', + } + json = yield cmd_dict + + +def evaluate( + expression: str, + object_group: typing.Optional[str] = None, + include_command_line_api: typing.Optional[bool] = None, + silent: typing.Optional[bool] = None, + context_id: typing.Optional[ExecutionContextId] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + user_gesture: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None, + throw_on_side_effect: typing.Optional[bool] = None, + timeout: typing.Optional[TimeDelta] = None, + disable_breaks: typing.Optional[bool] = None, + repl_mode: typing.Optional[bool] = None, + allow_unsafe_eval_blocked_by_csp: typing.Optional[bool] = None, + unique_context_id: typing.Optional[str] = None, + serialization_options: typing.Optional[SerializationOptions] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Evaluates expression on global object. + + :param expression: Expression to evaluate. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. + :param include_command_line_api: *(Optional)* Determines whether Command Line API should be available during the evaluation. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param context_id: *(Optional)* Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. This is mutually exclusive with ````uniqueContextId````, which offers an alternative way to identify the execution context that is more reliable in a multi-process environment. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object that should be sent by value. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the result. + :param user_gesture: *(Optional)* Whether execution should be treated as initiated by user in the UI. + :param await_promise: *(Optional)* Whether execution should ````await```` for resulting value and return once awaited promise is resolved. + :param throw_on_side_effect: **(EXPERIMENTAL)** *(Optional)* Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies ````disableBreaks```` below. + :param timeout: **(EXPERIMENTAL)** *(Optional)* Terminate execution after timing out (number of milliseconds). + :param disable_breaks: **(EXPERIMENTAL)** *(Optional)* Disable breakpoints during execution. + :param repl_mode: **(EXPERIMENTAL)** *(Optional)* 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. + :param allow_unsafe_eval_blocked_by_csp: **(EXPERIMENTAL)** *(Optional)* 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 this evaluation and allows unsafe-eval. Defaults to true. + :param unique_context_id: **(EXPERIMENTAL)** *(Optional)* An alternative way to specify the execution context to evaluate in. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental evaluation of the expression in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with ````contextId````. + :param serialization_options: **(EXPERIMENTAL)** *(Optional)* Specifies the result serialization. If provided, overrides ````generatePreview```` and ````returnByValue```. + :returns: A tuple with the following items: + + 0. **result** - Evaluation result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['expression'] = expression + if object_group is not None: + params['objectGroup'] = object_group + if include_command_line_api is not None: + params['includeCommandLineAPI'] = include_command_line_api + if silent is not None: + params['silent'] = silent + if context_id is not None: + params['contextId'] = context_id.to_json() + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if user_gesture is not None: + params['userGesture'] = user_gesture + if await_promise is not None: + params['awaitPromise'] = await_promise + if throw_on_side_effect is not None: + params['throwOnSideEffect'] = throw_on_side_effect + if timeout is not None: + params['timeout'] = timeout.to_json() + if disable_breaks is not None: + params['disableBreaks'] = disable_breaks + if repl_mode is not None: + params['replMode'] = repl_mode + if allow_unsafe_eval_blocked_by_csp is not None: + params['allowUnsafeEvalBlockedByCSP'] = allow_unsafe_eval_blocked_by_csp + if unique_context_id is not None: + params['uniqueContextId'] = unique_context_id + if serialization_options is not None: + params['serializationOptions'] = serialization_options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.evaluate', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def get_isolate_id() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: + ''' + Returns the isolate id. + + **EXPERIMENTAL** + + :returns: The isolate id. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getIsolateId', + } + json = yield cmd_dict + return str(json['id']) + + +def get_heap_usage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[float, float]]: + ''' + Returns the JavaScript heap usage. + It is the total usage of the corresponding isolate not scoped to a particular Runtime. + + **EXPERIMENTAL** + + :returns: A tuple with the following items: + + 0. **usedSize** - Used heap size in bytes. + 1. **totalSize** - Allocated heap size in bytes. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getHeapUsage', + } + json = yield cmd_dict + return ( + float(json['usedSize']), + float(json['totalSize']) + ) + + +def get_properties( + object_id: RemoteObjectId, + own_properties: typing.Optional[bool] = None, + accessor_properties_only: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + non_indexed_properties_only: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.List[PropertyDescriptor], typing.Optional[typing.List[InternalPropertyDescriptor]], typing.Optional[typing.List[PrivatePropertyDescriptor]], typing.Optional[ExceptionDetails]]]: + ''' + Returns properties of a given object. Object group of the result is inherited from the target + object. + + :param object_id: Identifier of the object to return properties for. + :param own_properties: *(Optional)* If true, returns properties belonging only to the element itself, not to its prototype chain. + :param accessor_properties_only: **(EXPERIMENTAL)** *(Optional)* If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the results. + :param non_indexed_properties_only: **(EXPERIMENTAL)** *(Optional)* If true, returns non-indexed properties only. + :returns: A tuple with the following items: + + 0. **result** - Object properties. + 1. **internalProperties** - *(Optional)* Internal object properties (only of the element itself). + 2. **privateProperties** - *(Optional)* Object private properties. + 3. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['objectId'] = object_id.to_json() + if own_properties is not None: + params['ownProperties'] = own_properties + if accessor_properties_only is not None: + params['accessorPropertiesOnly'] = accessor_properties_only + if generate_preview is not None: + params['generatePreview'] = generate_preview + if non_indexed_properties_only is not None: + params['nonIndexedPropertiesOnly'] = non_indexed_properties_only + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getProperties', + 'params': params, + } + json = yield cmd_dict + return ( + [PropertyDescriptor.from_json(i) for i in json['result']], + [InternalPropertyDescriptor.from_json(i) for i in json['internalProperties']] if 'internalProperties' in json else None, + [PrivatePropertyDescriptor.from_json(i) for i in json['privateProperties']] if 'privateProperties' in json else None, + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def global_lexical_scope_names( + execution_context_id: typing.Optional[ExecutionContextId] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Returns all let, const and class variables from global scope. + + :param execution_context_id: *(Optional)* Specifies in which execution context to lookup global scope variables. + :returns: + ''' + params: T_JSON_DICT = dict() + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.globalLexicalScopeNames', + 'params': params, + } + json = yield cmd_dict + return [str(i) for i in json['names']] + + +def query_objects( + prototype_object_id: RemoteObjectId, + object_group: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,RemoteObject]: + ''' + :param prototype_object_id: Identifier of the prototype to return objects for. + :param object_group: *(Optional)* Symbolic group name that can be used to release the results. + :returns: Array with objects. + ''' + params: T_JSON_DICT = dict() + params['prototypeObjectId'] = prototype_object_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.queryObjects', + 'params': params, + } + json = yield cmd_dict + return RemoteObject.from_json(json['objects']) + + +def release_object( + object_id: RemoteObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Releases remote object with given id. + + :param object_id: Identifier of the object to release. + ''' + params: T_JSON_DICT = dict() + params['objectId'] = object_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.releaseObject', + 'params': params, + } + json = yield cmd_dict + + +def release_object_group( + object_group: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Releases all remote objects that belong to a given group. + + :param object_group: Symbolic object group name. + ''' + params: T_JSON_DICT = dict() + params['objectGroup'] = object_group + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.releaseObjectGroup', + 'params': params, + } + json = yield cmd_dict + + +def run_if_waiting_for_debugger() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Tells inspected instance to run if it was waiting for debugger to attach. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.runIfWaitingForDebugger', + } + json = yield cmd_dict + + +def run_script( + script_id: ScriptId, + execution_context_id: typing.Optional[ExecutionContextId] = None, + object_group: typing.Optional[str] = None, + silent: typing.Optional[bool] = None, + include_command_line_api: typing.Optional[bool] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Runs script with given id in a given context. + + :param script_id: Id of the script to run. + :param execution_context_id: *(Optional)* Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param include_command_line_api: *(Optional)* Determines whether Command Line API should be available during the evaluation. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object which should be sent by value. + :param generate_preview: *(Optional)* Whether preview should be generated for the result. + :param await_promise: *(Optional)* Whether execution should ````await``` for resulting value and return once awaited promise is resolved. + :returns: A tuple with the following items: + + 0. **result** - Run result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['scriptId'] = script_id.to_json() + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + if silent is not None: + params['silent'] = silent + if include_command_line_api is not None: + params['includeCommandLineAPI'] = include_command_line_api + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if await_promise is not None: + params['awaitPromise'] = await_promise + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.runScript', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def set_async_call_stack_depth( + max_depth: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables or disables async call stacks tracking. + + :param max_depth: Maximum depth of async call stacks. Setting to ```0``` will effectively disable collecting async call stacks (default). + ''' + params: T_JSON_DICT = dict() + params['maxDepth'] = max_depth + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setAsyncCallStackDepth', + 'params': params, + } + json = yield cmd_dict + + +def set_custom_object_formatter_enabled( + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + + + **EXPERIMENTAL** + + :param enabled: + ''' + params: T_JSON_DICT = dict() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setCustomObjectFormatterEnabled', + 'params': params, + } + json = yield cmd_dict + + +def set_max_call_stack_size_to_capture( + size: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + + + **EXPERIMENTAL** + + :param size: + ''' + params: T_JSON_DICT = dict() + params['size'] = size + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setMaxCallStackSizeToCapture', + 'params': params, + } + json = yield cmd_dict + + +def terminate_execution() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Terminate current or next JavaScript execution. + Will cancel the termination when the outer-most script execution ends. + + **EXPERIMENTAL** + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.terminateExecution', + } + json = yield cmd_dict + + +def add_binding( + name: str, + execution_context_id: typing.Optional[ExecutionContextId] = None, + execution_context_name: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param name: + :param execution_context_id: **(EXPERIMENTAL)** *(Optional)* If specified, the binding would only be exposed to the specified execution 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 case and bugs in implementation (crbug.com/1169639). ````executionContextId```` will be removed in the future. + :param execution_context_name: *(Optional)* If specified, the binding is exposed to the executionContext with matching 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```. + ''' + params: T_JSON_DICT = dict() + params['name'] = name + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if execution_context_name is not None: + params['executionContextName'] = execution_context_name + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.addBinding', + 'params': params, + } + json = yield cmd_dict + + +def remove_binding( + name: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + This method does not remove binding function from global object but + unsubscribes current runtime agent from Runtime.bindingCalled notifications. + + :param name: + ''' + params: T_JSON_DICT = dict() + params['name'] = name + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.removeBinding', + 'params': params, + } + json = yield cmd_dict + + +def get_exception_details( + error_object_id: RemoteObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Optional[ExceptionDetails]]: + ''' + 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. + + **EXPERIMENTAL** + + :param error_object_id: The error object for which to resolve the exception details. + :returns: + ''' + params: T_JSON_DICT = dict() + params['errorObjectId'] = error_object_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getExceptionDetails', + 'params': params, + } + json = yield cmd_dict + return ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + + +@event_class('Runtime.bindingCalled') +@dataclass +class BindingCalled: + ''' + **EXPERIMENTAL** + + Notification is issued every time when binding is called. + ''' + name: str + payload: str + #: Identifier of the context where the call was made. + execution_context_id: ExecutionContextId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> BindingCalled: + return cls( + name=str(json['name']), + payload=str(json['payload']), + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) + ) + + +@event_class('Runtime.consoleAPICalled') +@dataclass +class ConsoleAPICalled: + ''' + Issued when console API was called. + ''' + #: Type of the call. + type_: str + #: Call arguments. + args: typing.List[RemoteObject] + #: Identifier of the context where the call was made. + execution_context_id: ExecutionContextId + #: Call timestamp. + timestamp: Timestamp + #: 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. + stack_trace: typing.Optional[StackTrace] + #: 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. + context: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleAPICalled: + return cls( + type_=str(json['type']), + args=[RemoteObject.from_json(i) for i in json['args']], + execution_context_id=ExecutionContextId.from_json(json['executionContextId']), + timestamp=Timestamp.from_json(json['timestamp']), + stack_trace=StackTrace.from_json(json['stackTrace']) if 'stackTrace' in json else None, + context=str(json['context']) if 'context' in json else None + ) + + +@event_class('Runtime.exceptionRevoked') +@dataclass +class ExceptionRevoked: + ''' + Issued when unhandled exception was revoked. + ''' + #: Reason describing why exception was revoked. + reason: str + #: The id of revoked exception, as reported in ``exceptionThrown``. + exception_id: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExceptionRevoked: + return cls( + reason=str(json['reason']), + exception_id=int(json['exceptionId']) + ) + + +@event_class('Runtime.exceptionThrown') +@dataclass +class ExceptionThrown: + ''' + Issued when exception was thrown and unhandled. + ''' + #: Timestamp of the exception. + timestamp: Timestamp + exception_details: ExceptionDetails + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExceptionThrown: + return cls( + timestamp=Timestamp.from_json(json['timestamp']), + exception_details=ExceptionDetails.from_json(json['exceptionDetails']) + ) + + +@event_class('Runtime.executionContextCreated') +@dataclass +class ExecutionContextCreated: + ''' + Issued when new execution context is created. + ''' + #: A newly created execution context. + context: ExecutionContextDescription + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextCreated: + return cls( + context=ExecutionContextDescription.from_json(json['context']) + ) + + +@event_class('Runtime.executionContextDestroyed') +@dataclass +class ExecutionContextDestroyed: + ''' + Issued when execution context is destroyed. + ''' + #: Id of the destroyed context + execution_context_id: ExecutionContextId + #: Unique Id of the destroyed context + execution_context_unique_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextDestroyed: + return cls( + execution_context_id=ExecutionContextId.from_json(json['executionContextId']), + execution_context_unique_id=str(json['executionContextUniqueId']) + ) + + +@event_class('Runtime.executionContextsCleared') +@dataclass +class ExecutionContextsCleared: + ''' + Issued when all executionContexts were cleared in browser + ''' + + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextsCleared: + return cls( + + ) + + +@event_class('Runtime.inspectRequested') +@dataclass +class InspectRequested: + ''' + Issued when object should be inspected (for example, as a result of inspect() command line API + call). + ''' + object_: RemoteObject + hints: dict + #: Identifier of the context where the call was made. + execution_context_id: typing.Optional[ExecutionContextId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InspectRequested: + return cls( + object_=RemoteObject.from_json(json['object']), + hints=dict(json['hints']), + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) if 'executionContextId' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/schema.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/schema.py new file mode 100644 index 0000000..5077f78 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/schema.py @@ -0,0 +1,48 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Schema +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +@dataclass +class Domain: + ''' + Description of the protocol domain. + ''' + #: Domain name. + name: str + + #: Domain version. + version: str + + def to_json(self): + json = dict() + json['name'] = self.name + json['version'] = self.version + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + version=str(json['version']), + ) + + +def get_domains() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Domain]]: + ''' + Returns supported domains. + + :returns: List of supported domains. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Schema.getDomains', + } + json = yield cmd_dict + return [Domain.from_json(i) for i in json['domains']] diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/security.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/security.py new file mode 100644 index 0000000..e7714fe --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/security.py @@ -0,0 +1,507 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Security +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import network + + +class CertificateId(int): + ''' + An internal certificate ID value. + ''' + def to_json(self) -> int: + return self + + @classmethod + def from_json(cls, json: int) -> CertificateId: + return cls(json) + + def __repr__(self): + return 'CertificateId({})'.format(super().__repr__()) + + +class MixedContentType(enum.Enum): + ''' + A description of mixed content (HTTP resources on HTTPS pages), as defined by + https://www.w3.org/TR/mixed-content/#categories + ''' + BLOCKABLE = "blockable" + OPTIONALLY_BLOCKABLE = "optionally-blockable" + NONE = "none" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class SecurityState(enum.Enum): + ''' + The security level of a page or resource. + ''' + UNKNOWN = "unknown" + NEUTRAL = "neutral" + INSECURE = "insecure" + SECURE = "secure" + INFO = "info" + INSECURE_BROKEN = "insecure-broken" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class CertificateSecurityState: + ''' + Details about the security state of the page certificate. + ''' + #: Protocol name (e.g. "TLS 1.2" or "QUIC"). + protocol: str + + #: Key Exchange used by the connection, or the empty string if not applicable. + key_exchange: str + + #: Cipher name. + cipher: str + + #: Page certificate. + certificate: typing.List[str] + + #: Certificate subject name. + subject_name: str + + #: Name of the issuing CA. + issuer: str + + #: Certificate valid from date. + valid_from: network.TimeSinceEpoch + + #: Certificate valid to (expiration) date + valid_to: network.TimeSinceEpoch + + #: True if the certificate uses a weak signature algorithm. + certificate_has_weak_signature: bool + + #: True if the certificate has a SHA1 signature in the chain. + certificate_has_sha1_signature: bool + + #: True if modern SSL + modern_ssl: bool + + #: True if the connection is using an obsolete SSL protocol. + obsolete_ssl_protocol: bool + + #: True if the connection is using an obsolete SSL key exchange. + obsolete_ssl_key_exchange: bool + + #: True if the connection is using an obsolete SSL cipher. + obsolete_ssl_cipher: bool + + #: True if the connection is using an obsolete SSL signature. + obsolete_ssl_signature: bool + + #: (EC)DH group used by the connection, if applicable. + key_exchange_group: typing.Optional[str] = None + + #: TLS MAC. Note that AEAD ciphers do not have separate MACs. + mac: typing.Optional[str] = None + + #: The highest priority network error code, if the certificate has an error. + certificate_network_error: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['protocol'] = self.protocol + json['keyExchange'] = self.key_exchange + json['cipher'] = self.cipher + json['certificate'] = [i for i in self.certificate] + json['subjectName'] = self.subject_name + json['issuer'] = self.issuer + json['validFrom'] = self.valid_from.to_json() + json['validTo'] = self.valid_to.to_json() + json['certificateHasWeakSignature'] = self.certificate_has_weak_signature + json['certificateHasSha1Signature'] = self.certificate_has_sha1_signature + json['modernSSL'] = self.modern_ssl + json['obsoleteSslProtocol'] = self.obsolete_ssl_protocol + json['obsoleteSslKeyExchange'] = self.obsolete_ssl_key_exchange + json['obsoleteSslCipher'] = self.obsolete_ssl_cipher + json['obsoleteSslSignature'] = self.obsolete_ssl_signature + if self.key_exchange_group is not None: + json['keyExchangeGroup'] = self.key_exchange_group + if self.mac is not None: + json['mac'] = self.mac + if self.certificate_network_error is not None: + json['certificateNetworkError'] = self.certificate_network_error + return json + + @classmethod + def from_json(cls, json): + return cls( + protocol=str(json['protocol']), + key_exchange=str(json['keyExchange']), + cipher=str(json['cipher']), + certificate=[str(i) for i in json['certificate']], + subject_name=str(json['subjectName']), + issuer=str(json['issuer']), + valid_from=network.TimeSinceEpoch.from_json(json['validFrom']), + valid_to=network.TimeSinceEpoch.from_json(json['validTo']), + certificate_has_weak_signature=bool(json['certificateHasWeakSignature']), + certificate_has_sha1_signature=bool(json['certificateHasSha1Signature']), + modern_ssl=bool(json['modernSSL']), + obsolete_ssl_protocol=bool(json['obsoleteSslProtocol']), + obsolete_ssl_key_exchange=bool(json['obsoleteSslKeyExchange']), + obsolete_ssl_cipher=bool(json['obsoleteSslCipher']), + obsolete_ssl_signature=bool(json['obsoleteSslSignature']), + key_exchange_group=str(json['keyExchangeGroup']) if 'keyExchangeGroup' in json else None, + mac=str(json['mac']) if 'mac' in json else None, + certificate_network_error=str(json['certificateNetworkError']) if 'certificateNetworkError' in json else None, + ) + + +class SafetyTipStatus(enum.Enum): + BAD_REPUTATION = "badReputation" + LOOKALIKE = "lookalike" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class SafetyTipInfo: + #: Describes whether the page triggers any safety tips or reputation warnings. Default is unknown. + safety_tip_status: SafetyTipStatus + + #: The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches. + safe_url: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['safetyTipStatus'] = self.safety_tip_status.to_json() + if self.safe_url is not None: + json['safeUrl'] = self.safe_url + return json + + @classmethod + def from_json(cls, json): + return cls( + safety_tip_status=SafetyTipStatus.from_json(json['safetyTipStatus']), + safe_url=str(json['safeUrl']) if 'safeUrl' in json else None, + ) + + +@dataclass +class VisibleSecurityState: + ''' + Security state information about the page. + ''' + #: The security level of the page. + security_state: SecurityState + + #: Array of security state issues ids. + security_state_issue_ids: typing.List[str] + + #: Security state details about the page certificate. + certificate_security_state: typing.Optional[CertificateSecurityState] = None + + #: 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. + safety_tip_info: typing.Optional[SafetyTipInfo] = None + + def to_json(self): + json = dict() + json['securityState'] = self.security_state.to_json() + json['securityStateIssueIds'] = [i for i in self.security_state_issue_ids] + if self.certificate_security_state is not None: + json['certificateSecurityState'] = self.certificate_security_state.to_json() + if self.safety_tip_info is not None: + json['safetyTipInfo'] = self.safety_tip_info.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + security_state=SecurityState.from_json(json['securityState']), + security_state_issue_ids=[str(i) for i in json['securityStateIssueIds']], + certificate_security_state=CertificateSecurityState.from_json(json['certificateSecurityState']) if 'certificateSecurityState' in json else None, + safety_tip_info=SafetyTipInfo.from_json(json['safetyTipInfo']) if 'safetyTipInfo' in json else None, + ) + + +@dataclass +class SecurityStateExplanation: + ''' + An explanation of an factor contributing to the security state. + ''' + #: Security state representing the severity of the factor being explained. + security_state: SecurityState + + #: Title describing the type of factor. + title: str + + #: Short phrase describing the type of factor. + summary: str + + #: Full text explanation of the factor. + description: str + + #: The type of mixed content described by the explanation. + mixed_content_type: MixedContentType + + #: Page certificate. + certificate: typing.List[str] + + #: Recommendations to fix any issues. + recommendations: typing.Optional[typing.List[str]] = None + + def to_json(self): + json = dict() + json['securityState'] = self.security_state.to_json() + json['title'] = self.title + json['summary'] = self.summary + json['description'] = self.description + json['mixedContentType'] = self.mixed_content_type.to_json() + json['certificate'] = [i for i in self.certificate] + if self.recommendations is not None: + json['recommendations'] = [i for i in self.recommendations] + return json + + @classmethod + def from_json(cls, json): + return cls( + security_state=SecurityState.from_json(json['securityState']), + title=str(json['title']), + summary=str(json['summary']), + description=str(json['description']), + mixed_content_type=MixedContentType.from_json(json['mixedContentType']), + certificate=[str(i) for i in json['certificate']], + recommendations=[str(i) for i in json['recommendations']] if 'recommendations' in json else None, + ) + + +@dataclass +class InsecureContentStatus: + ''' + Information about insecure content on the page. + ''' + #: Always false. + ran_mixed_content: bool + + #: Always false. + displayed_mixed_content: bool + + #: Always false. + contained_mixed_form: bool + + #: Always false. + ran_content_with_cert_errors: bool + + #: Always false. + displayed_content_with_cert_errors: bool + + #: Always set to unknown. + ran_insecure_content_style: SecurityState + + #: Always set to unknown. + displayed_insecure_content_style: SecurityState + + def to_json(self): + json = dict() + json['ranMixedContent'] = self.ran_mixed_content + json['displayedMixedContent'] = self.displayed_mixed_content + json['containedMixedForm'] = self.contained_mixed_form + json['ranContentWithCertErrors'] = self.ran_content_with_cert_errors + json['displayedContentWithCertErrors'] = self.displayed_content_with_cert_errors + json['ranInsecureContentStyle'] = self.ran_insecure_content_style.to_json() + json['displayedInsecureContentStyle'] = self.displayed_insecure_content_style.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + ran_mixed_content=bool(json['ranMixedContent']), + displayed_mixed_content=bool(json['displayedMixedContent']), + contained_mixed_form=bool(json['containedMixedForm']), + ran_content_with_cert_errors=bool(json['ranContentWithCertErrors']), + displayed_content_with_cert_errors=bool(json['displayedContentWithCertErrors']), + ran_insecure_content_style=SecurityState.from_json(json['ranInsecureContentStyle']), + displayed_insecure_content_style=SecurityState.from_json(json['displayedInsecureContentStyle']), + ) + + +class CertificateErrorAction(enum.Enum): + ''' + The action to take when a certificate error occurs. continue will continue processing the + request and cancel will cancel the request. + ''' + CONTINUE = "continue" + CANCEL = "cancel" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables tracking security state changes. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Security.disable', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables tracking security state changes. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Security.enable', + } + json = yield cmd_dict + + +def set_ignore_certificate_errors( + ignore: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable/disable whether all certificate errors should be ignored. + + :param ignore: If true, all certificate errors will be ignored. + ''' + params: T_JSON_DICT = dict() + params['ignore'] = ignore + cmd_dict: T_JSON_DICT = { + 'method': 'Security.setIgnoreCertificateErrors', + 'params': params, + } + json = yield cmd_dict + + +def handle_certificate_error( + event_id: int, + action: CertificateErrorAction + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Handles a certificate error that fired a certificateError event. + + :param event_id: The ID of the event. + :param action: The action to take on the certificate error. + ''' + params: T_JSON_DICT = dict() + params['eventId'] = event_id + params['action'] = action.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Security.handleCertificateError', + 'params': params, + } + json = yield cmd_dict + + +def set_override_certificate_errors( + override: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable/disable overriding certificate errors. If enabled, all certificate error events need to + be handled by the DevTools client and should be answered with ``handleCertificateError`` commands. + + :param override: If true, certificate errors will be overridden. + ''' + params: T_JSON_DICT = dict() + params['override'] = override + cmd_dict: T_JSON_DICT = { + 'method': 'Security.setOverrideCertificateErrors', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Security.certificateError') +@dataclass +class CertificateError: + ''' + 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. + ''' + #: The ID of the event. + event_id: int + #: The type of the error. + error_type: str + #: The url that was requested. + request_url: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CertificateError: + return cls( + event_id=int(json['eventId']), + error_type=str(json['errorType']), + request_url=str(json['requestURL']) + ) + + +@event_class('Security.visibleSecurityStateChanged') +@dataclass +class VisibleSecurityStateChanged: + ''' + **EXPERIMENTAL** + + The security state of the page changed. + ''' + #: Security state information about the page. + visible_security_state: VisibleSecurityState + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> VisibleSecurityStateChanged: + return cls( + visible_security_state=VisibleSecurityState.from_json(json['visibleSecurityState']) + ) + + +@event_class('Security.securityStateChanged') +@dataclass +class SecurityStateChanged: + ''' + The security state of the page changed. No longer being sent. + ''' + #: Security state. + security_state: SecurityState + #: True if the page was loaded over cryptographic transport such as HTTPS. + scheme_is_cryptographic: bool + #: Previously a list of explanations for the security state. Now always + #: empty. + explanations: typing.List[SecurityStateExplanation] + #: Information about insecure content on the page. + insecure_content_status: InsecureContentStatus + #: Overrides user-visible description of the state. Always omitted. + summary: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> SecurityStateChanged: + return cls( + security_state=SecurityState.from_json(json['securityState']), + scheme_is_cryptographic=bool(json['schemeIsCryptographic']), + explanations=[SecurityStateExplanation.from_json(i) for i in json['explanations']], + insecure_content_status=InsecureContentStatus.from_json(json['insecureContentStatus']), + summary=str(json['summary']) if 'summary' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/service_worker.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/service_worker.py new file mode 100644 index 0000000..9dd80b1 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/service_worker.py @@ -0,0 +1,414 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: ServiceWorker (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import target + + +class RegistrationID(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> RegistrationID: + return cls(json) + + def __repr__(self): + return 'RegistrationID({})'.format(super().__repr__()) + + +@dataclass +class ServiceWorkerRegistration: + ''' + ServiceWorker registration. + ''' + registration_id: RegistrationID + + scope_url: str + + is_deleted: bool + + def to_json(self): + json = dict() + json['registrationId'] = self.registration_id.to_json() + json['scopeURL'] = self.scope_url + json['isDeleted'] = self.is_deleted + return json + + @classmethod + def from_json(cls, json): + return cls( + registration_id=RegistrationID.from_json(json['registrationId']), + scope_url=str(json['scopeURL']), + is_deleted=bool(json['isDeleted']), + ) + + +class ServiceWorkerVersionRunningStatus(enum.Enum): + STOPPED = "stopped" + STARTING = "starting" + RUNNING = "running" + STOPPING = "stopping" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ServiceWorkerVersionStatus(enum.Enum): + NEW = "new" + INSTALLING = "installing" + INSTALLED = "installed" + ACTIVATING = "activating" + ACTIVATED = "activated" + REDUNDANT = "redundant" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ServiceWorkerVersion: + ''' + ServiceWorker version. + ''' + version_id: str + + registration_id: RegistrationID + + script_url: str + + running_status: ServiceWorkerVersionRunningStatus + + status: ServiceWorkerVersionStatus + + #: The Last-Modified header value of the main script. + script_last_modified: typing.Optional[float] = None + + #: 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. + script_response_time: typing.Optional[float] = None + + controlled_clients: typing.Optional[typing.List[target.TargetID]] = None + + target_id: typing.Optional[target.TargetID] = None + + router_rules: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['versionId'] = self.version_id + json['registrationId'] = self.registration_id.to_json() + json['scriptURL'] = self.script_url + json['runningStatus'] = self.running_status.to_json() + json['status'] = self.status.to_json() + if self.script_last_modified is not None: + json['scriptLastModified'] = self.script_last_modified + if self.script_response_time is not None: + json['scriptResponseTime'] = self.script_response_time + if self.controlled_clients is not None: + json['controlledClients'] = [i.to_json() for i in self.controlled_clients] + if self.target_id is not None: + json['targetId'] = self.target_id.to_json() + if self.router_rules is not None: + json['routerRules'] = self.router_rules + return json + + @classmethod + def from_json(cls, json): + return cls( + version_id=str(json['versionId']), + registration_id=RegistrationID.from_json(json['registrationId']), + script_url=str(json['scriptURL']), + running_status=ServiceWorkerVersionRunningStatus.from_json(json['runningStatus']), + status=ServiceWorkerVersionStatus.from_json(json['status']), + script_last_modified=float(json['scriptLastModified']) if 'scriptLastModified' in json else None, + script_response_time=float(json['scriptResponseTime']) if 'scriptResponseTime' in json else None, + controlled_clients=[target.TargetID.from_json(i) for i in json['controlledClients']] if 'controlledClients' in json else None, + target_id=target.TargetID.from_json(json['targetId']) if 'targetId' in json else None, + router_rules=str(json['routerRules']) if 'routerRules' in json else None, + ) + + +@dataclass +class ServiceWorkerErrorMessage: + ''' + ServiceWorker error message. + ''' + error_message: str + + registration_id: RegistrationID + + version_id: str + + source_url: str + + line_number: int + + column_number: int + + def to_json(self): + json = dict() + json['errorMessage'] = self.error_message + json['registrationId'] = self.registration_id.to_json() + json['versionId'] = self.version_id + json['sourceURL'] = self.source_url + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + return json + + @classmethod + def from_json(cls, json): + return cls( + error_message=str(json['errorMessage']), + registration_id=RegistrationID.from_json(json['registrationId']), + version_id=str(json['versionId']), + source_url=str(json['sourceURL']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + ) + + +def deliver_push_message( + origin: str, + registration_id: RegistrationID, + data: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param data: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['data'] = data + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.deliverPushMessage', + 'params': params, + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.disable', + } + json = yield cmd_dict + + +def dispatch_sync_event( + origin: str, + registration_id: RegistrationID, + tag: str, + last_chance: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param tag: + :param last_chance: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['tag'] = tag + params['lastChance'] = last_chance + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.dispatchSyncEvent', + 'params': params, + } + json = yield cmd_dict + + +def dispatch_periodic_sync_event( + origin: str, + registration_id: RegistrationID, + tag: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param tag: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['tag'] = tag + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.dispatchPeriodicSyncEvent', + 'params': params, + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.enable', + } + json = yield cmd_dict + + +def inspect_worker( + version_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param version_id: + ''' + params: T_JSON_DICT = dict() + params['versionId'] = version_id + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.inspectWorker', + 'params': params, + } + json = yield cmd_dict + + +def set_force_update_on_page_load( + force_update_on_page_load: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param force_update_on_page_load: + ''' + params: T_JSON_DICT = dict() + params['forceUpdateOnPageLoad'] = force_update_on_page_load + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.setForceUpdateOnPageLoad', + 'params': params, + } + json = yield cmd_dict + + +def skip_waiting( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.skipWaiting', + 'params': params, + } + json = yield cmd_dict + + +def start_worker( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.startWorker', + 'params': params, + } + json = yield cmd_dict + + +def stop_all_workers() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.stopAllWorkers', + } + json = yield cmd_dict + + +def stop_worker( + version_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param version_id: + ''' + params: T_JSON_DICT = dict() + params['versionId'] = version_id + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.stopWorker', + 'params': params, + } + json = yield cmd_dict + + +def unregister( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.unregister', + 'params': params, + } + json = yield cmd_dict + + +def update_registration( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.updateRegistration', + 'params': params, + } + json = yield cmd_dict + + +@event_class('ServiceWorker.workerErrorReported') +@dataclass +class WorkerErrorReported: + error_message: ServiceWorkerErrorMessage + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerErrorReported: + return cls( + error_message=ServiceWorkerErrorMessage.from_json(json['errorMessage']) + ) + + +@event_class('ServiceWorker.workerRegistrationUpdated') +@dataclass +class WorkerRegistrationUpdated: + registrations: typing.List[ServiceWorkerRegistration] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerRegistrationUpdated: + return cls( + registrations=[ServiceWorkerRegistration.from_json(i) for i in json['registrations']] + ) + + +@event_class('ServiceWorker.workerVersionUpdated') +@dataclass +class WorkerVersionUpdated: + versions: typing.List[ServiceWorkerVersion] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerVersionUpdated: + return cls( + versions=[ServiceWorkerVersion.from_json(i) for i in json['versions']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/storage.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/storage.py new file mode 100644 index 0000000..57ff0a5 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/storage.py @@ -0,0 +1,2095 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Storage (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import browser +from . import network +from . import page + + +class SerializedStorageKey(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SerializedStorageKey: + return cls(json) + + def __repr__(self): + return 'SerializedStorageKey({})'.format(super().__repr__()) + + +class StorageType(enum.Enum): + ''' + Enum of possible storage types. + ''' + APPCACHE = "appcache" + COOKIES = "cookies" + FILE_SYSTEMS = "file_systems" + INDEXEDDB = "indexeddb" + LOCAL_STORAGE = "local_storage" + SHADER_CACHE = "shader_cache" + WEBSQL = "websql" + SERVICE_WORKERS = "service_workers" + CACHE_STORAGE = "cache_storage" + INTEREST_GROUPS = "interest_groups" + SHARED_STORAGE = "shared_storage" + STORAGE_BUCKETS = "storage_buckets" + ALL_ = "all" + OTHER = "other" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class UsageForType: + ''' + Usage for a storage type. + ''' + #: Name of storage type. + storage_type: StorageType + + #: Storage usage (bytes). + usage: float + + def to_json(self): + json = dict() + json['storageType'] = self.storage_type.to_json() + json['usage'] = self.usage + return json + + @classmethod + def from_json(cls, json): + return cls( + storage_type=StorageType.from_json(json['storageType']), + usage=float(json['usage']), + ) + + +@dataclass +class TrustTokens: + ''' + Pair of issuer origin and number of available (signed, but not used) Trust + Tokens from that issuer. + ''' + issuer_origin: str + + count: float + + def to_json(self): + json = dict() + json['issuerOrigin'] = self.issuer_origin + json['count'] = self.count + return json + + @classmethod + def from_json(cls, json): + return cls( + issuer_origin=str(json['issuerOrigin']), + count=float(json['count']), + ) + + +class InterestGroupAuctionId(str): + ''' + Protected audience interest group auction identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> InterestGroupAuctionId: + return cls(json) + + def __repr__(self): + return 'InterestGroupAuctionId({})'.format(super().__repr__()) + + +class InterestGroupAccessType(enum.Enum): + ''' + Enum of interest group access types. + ''' + JOIN = "join" + LEAVE = "leave" + UPDATE = "update" + LOADED = "loaded" + BID = "bid" + WIN = "win" + ADDITIONAL_BID = "additionalBid" + ADDITIONAL_BID_WIN = "additionalBidWin" + TOP_LEVEL_BID = "topLevelBid" + TOP_LEVEL_ADDITIONAL_BID = "topLevelAdditionalBid" + CLEAR = "clear" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class InterestGroupAuctionEventType(enum.Enum): + ''' + Enum of auction events. + ''' + STARTED = "started" + CONFIG_RESOLVED = "configResolved" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class InterestGroupAuctionFetchType(enum.Enum): + ''' + Enum of network fetches auctions can do. + ''' + BIDDER_JS = "bidderJs" + BIDDER_WASM = "bidderWasm" + SELLER_JS = "sellerJs" + BIDDER_TRUSTED_SIGNALS = "bidderTrustedSignals" + SELLER_TRUSTED_SIGNALS = "sellerTrustedSignals" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class SharedStorageAccessType(enum.Enum): + ''' + Enum of shared storage access types. + ''' + DOCUMENT_ADD_MODULE = "documentAddModule" + DOCUMENT_SELECT_URL = "documentSelectURL" + DOCUMENT_RUN = "documentRun" + DOCUMENT_SET = "documentSet" + DOCUMENT_APPEND = "documentAppend" + DOCUMENT_DELETE = "documentDelete" + DOCUMENT_CLEAR = "documentClear" + DOCUMENT_GET = "documentGet" + WORKLET_SET = "workletSet" + WORKLET_APPEND = "workletAppend" + WORKLET_DELETE = "workletDelete" + WORKLET_CLEAR = "workletClear" + WORKLET_GET = "workletGet" + WORKLET_KEYS = "workletKeys" + WORKLET_ENTRIES = "workletEntries" + WORKLET_LENGTH = "workletLength" + WORKLET_REMAINING_BUDGET = "workletRemainingBudget" + HEADER_SET = "headerSet" + HEADER_APPEND = "headerAppend" + HEADER_DELETE = "headerDelete" + HEADER_CLEAR = "headerClear" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class SharedStorageEntry: + ''' + Struct for a single key-value pair in an origin's shared storage. + ''' + key: str + + value: str + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=str(json['value']), + ) + + +@dataclass +class SharedStorageMetadata: + ''' + Details for an origin's shared storage. + ''' + #: Time when the origin's shared storage was last created. + creation_time: network.TimeSinceEpoch + + #: Number of key-value pairs stored in origin's shared storage. + length: int + + #: Current amount of bits of entropy remaining in the navigation budget. + remaining_budget: float + + #: Total number of bytes stored as key-value pairs in origin's shared + #: storage. + bytes_used: int + + def to_json(self): + json = dict() + json['creationTime'] = self.creation_time.to_json() + json['length'] = self.length + json['remainingBudget'] = self.remaining_budget + json['bytesUsed'] = self.bytes_used + return json + + @classmethod + def from_json(cls, json): + return cls( + creation_time=network.TimeSinceEpoch.from_json(json['creationTime']), + length=int(json['length']), + remaining_budget=float(json['remainingBudget']), + bytes_used=int(json['bytesUsed']), + ) + + +@dataclass +class SharedStorageReportingMetadata: + ''' + Pair of reporting metadata details for a candidate URL for ``selectURL()``. + ''' + event_type: str + + reporting_url: str + + def to_json(self): + json = dict() + json['eventType'] = self.event_type + json['reportingUrl'] = self.reporting_url + return json + + @classmethod + def from_json(cls, json): + return cls( + event_type=str(json['eventType']), + reporting_url=str(json['reportingUrl']), + ) + + +@dataclass +class SharedStorageUrlWithMetadata: + ''' + Bundles a candidate URL with its reporting metadata. + ''' + #: Spec of candidate URL. + url: str + + #: Any associated reporting metadata. + reporting_metadata: typing.List[SharedStorageReportingMetadata] + + def to_json(self): + json = dict() + json['url'] = self.url + json['reportingMetadata'] = [i.to_json() for i in self.reporting_metadata] + return json + + @classmethod + def from_json(cls, json): + return cls( + url=str(json['url']), + reporting_metadata=[SharedStorageReportingMetadata.from_json(i) for i in json['reportingMetadata']], + ) + + +@dataclass +class SharedStorageAccessParams: + ''' + Bundles the parameters for shared storage access events whose + presence/absence can vary according to SharedStorageAccessType. + ''' + #: Spec of the module script URL. + #: Present only for SharedStorageAccessType.documentAddModule. + script_source_url: typing.Optional[str] = None + + #: Name of the registered operation to be run. + #: Present only for SharedStorageAccessType.documentRun and + #: SharedStorageAccessType.documentSelectURL. + operation_name: typing.Optional[str] = None + + #: The operation's serialized data in bytes (converted to a string). + #: Present only for SharedStorageAccessType.documentRun and + #: SharedStorageAccessType.documentSelectURL. + serialized_data: typing.Optional[str] = None + + #: Array of candidate URLs' specs, along with any associated metadata. + #: Present only for SharedStorageAccessType.documentSelectURL. + urls_with_metadata: typing.Optional[typing.List[SharedStorageUrlWithMetadata]] = None + + #: Key for a specific entry in an origin's shared storage. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.documentAppend, + #: SharedStorageAccessType.documentDelete, + #: SharedStorageAccessType.workletSet, + #: SharedStorageAccessType.workletAppend, + #: SharedStorageAccessType.workletDelete, + #: SharedStorageAccessType.workletGet, + #: SharedStorageAccessType.headerSet, + #: SharedStorageAccessType.headerAppend, and + #: SharedStorageAccessType.headerDelete. + key: typing.Optional[str] = None + + #: Value for a specific entry in an origin's shared storage. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.documentAppend, + #: SharedStorageAccessType.workletSet, + #: SharedStorageAccessType.workletAppend, + #: SharedStorageAccessType.headerSet, and + #: SharedStorageAccessType.headerAppend. + value: typing.Optional[str] = None + + #: Whether or not to set an entry for a key if that key is already present. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.workletSet, and + #: SharedStorageAccessType.headerSet. + ignore_if_present: typing.Optional[bool] = None + + def to_json(self): + json = dict() + if self.script_source_url is not None: + json['scriptSourceUrl'] = self.script_source_url + if self.operation_name is not None: + json['operationName'] = self.operation_name + if self.serialized_data is not None: + json['serializedData'] = self.serialized_data + if self.urls_with_metadata is not None: + json['urlsWithMetadata'] = [i.to_json() for i in self.urls_with_metadata] + if self.key is not None: + json['key'] = self.key + if self.value is not None: + json['value'] = self.value + if self.ignore_if_present is not None: + json['ignoreIfPresent'] = self.ignore_if_present + return json + + @classmethod + def from_json(cls, json): + return cls( + script_source_url=str(json['scriptSourceUrl']) if 'scriptSourceUrl' in json else None, + operation_name=str(json['operationName']) if 'operationName' in json else None, + serialized_data=str(json['serializedData']) if 'serializedData' in json else None, + urls_with_metadata=[SharedStorageUrlWithMetadata.from_json(i) for i in json['urlsWithMetadata']] if 'urlsWithMetadata' in json else None, + key=str(json['key']) if 'key' in json else None, + value=str(json['value']) if 'value' in json else None, + ignore_if_present=bool(json['ignoreIfPresent']) if 'ignoreIfPresent' in json else None, + ) + + +class StorageBucketsDurability(enum.Enum): + RELAXED = "relaxed" + STRICT = "strict" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class StorageBucket: + storage_key: SerializedStorageKey + + #: If not specified, it is the default bucket of the storageKey. + name: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['storageKey'] = self.storage_key.to_json() + if self.name is not None: + json['name'] = self.name + return json + + @classmethod + def from_json(cls, json): + return cls( + storage_key=SerializedStorageKey.from_json(json['storageKey']), + name=str(json['name']) if 'name' in json else None, + ) + + +@dataclass +class StorageBucketInfo: + bucket: StorageBucket + + id_: str + + expiration: network.TimeSinceEpoch + + #: Storage quota (bytes). + quota: float + + persistent: bool + + durability: StorageBucketsDurability + + def to_json(self): + json = dict() + json['bucket'] = self.bucket.to_json() + json['id'] = self.id_ + json['expiration'] = self.expiration.to_json() + json['quota'] = self.quota + json['persistent'] = self.persistent + json['durability'] = self.durability.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + bucket=StorageBucket.from_json(json['bucket']), + id_=str(json['id']), + expiration=network.TimeSinceEpoch.from_json(json['expiration']), + quota=float(json['quota']), + persistent=bool(json['persistent']), + durability=StorageBucketsDurability.from_json(json['durability']), + ) + + +class AttributionReportingSourceType(enum.Enum): + NAVIGATION = "navigation" + EVENT = "event" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class UnsignedInt64AsBase10(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnsignedInt64AsBase10: + return cls(json) + + def __repr__(self): + return 'UnsignedInt64AsBase10({})'.format(super().__repr__()) + + +class UnsignedInt128AsBase16(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnsignedInt128AsBase16: + return cls(json) + + def __repr__(self): + return 'UnsignedInt128AsBase16({})'.format(super().__repr__()) + + +class SignedInt64AsBase10(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SignedInt64AsBase10: + return cls(json) + + def __repr__(self): + return 'SignedInt64AsBase10({})'.format(super().__repr__()) + + +@dataclass +class AttributionReportingFilterDataEntry: + key: str + + values: typing.List[str] + + def to_json(self): + json = dict() + json['key'] = self.key + json['values'] = [i for i in self.values] + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + values=[str(i) for i in json['values']], + ) + + +@dataclass +class AttributionReportingFilterConfig: + filter_values: typing.List[AttributionReportingFilterDataEntry] + + #: duration in seconds + lookback_window: typing.Optional[int] = None + + def to_json(self): + json = dict() + json['filterValues'] = [i.to_json() for i in self.filter_values] + if self.lookback_window is not None: + json['lookbackWindow'] = self.lookback_window + return json + + @classmethod + def from_json(cls, json): + return cls( + filter_values=[AttributionReportingFilterDataEntry.from_json(i) for i in json['filterValues']], + lookback_window=int(json['lookbackWindow']) if 'lookbackWindow' in json else None, + ) + + +@dataclass +class AttributionReportingFilterPair: + filters: typing.List[AttributionReportingFilterConfig] + + not_filters: typing.List[AttributionReportingFilterConfig] + + def to_json(self): + json = dict() + json['filters'] = [i.to_json() for i in self.filters] + json['notFilters'] = [i.to_json() for i in self.not_filters] + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=[AttributionReportingFilterConfig.from_json(i) for i in json['filters']], + not_filters=[AttributionReportingFilterConfig.from_json(i) for i in json['notFilters']], + ) + + +@dataclass +class AttributionReportingAggregationKeysEntry: + key: str + + value: UnsignedInt128AsBase16 + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=UnsignedInt128AsBase16.from_json(json['value']), + ) + + +@dataclass +class AttributionReportingEventReportWindows: + #: duration in seconds + start: int + + #: duration in seconds + ends: typing.List[int] + + def to_json(self): + json = dict() + json['start'] = self.start + json['ends'] = [i for i in self.ends] + return json + + @classmethod + def from_json(cls, json): + return cls( + start=int(json['start']), + ends=[int(i) for i in json['ends']], + ) + + +@dataclass +class AttributionReportingTriggerSpec: + #: number instead of integer because not all uint32 can be represented by + #: int + trigger_data: typing.List[float] + + event_report_windows: AttributionReportingEventReportWindows + + def to_json(self): + json = dict() + json['triggerData'] = [i for i in self.trigger_data] + json['eventReportWindows'] = self.event_report_windows.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + trigger_data=[float(i) for i in json['triggerData']], + event_report_windows=AttributionReportingEventReportWindows.from_json(json['eventReportWindows']), + ) + + +class AttributionReportingTriggerDataMatching(enum.Enum): + EXACT = "exact" + MODULUS = "modulus" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class AttributionReportingAggregatableDebugReportingData: + key_piece: UnsignedInt128AsBase16 + + #: number instead of integer because not all uint32 can be represented by + #: int + value: float + + types: typing.List[str] + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['value'] = self.value + json['types'] = [i for i in self.types] + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + value=float(json['value']), + types=[str(i) for i in json['types']], + ) + + +@dataclass +class AttributionReportingAggregatableDebugReportingConfig: + key_piece: UnsignedInt128AsBase16 + + debug_data: typing.List[AttributionReportingAggregatableDebugReportingData] + + #: number instead of integer because not all uint32 can be represented by + #: int, only present for source registrations + budget: typing.Optional[float] = None + + aggregation_coordinator_origin: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['debugData'] = [i.to_json() for i in self.debug_data] + if self.budget is not None: + json['budget'] = self.budget + if self.aggregation_coordinator_origin is not None: + json['aggregationCoordinatorOrigin'] = self.aggregation_coordinator_origin + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + debug_data=[AttributionReportingAggregatableDebugReportingData.from_json(i) for i in json['debugData']], + budget=float(json['budget']) if 'budget' in json else None, + aggregation_coordinator_origin=str(json['aggregationCoordinatorOrigin']) if 'aggregationCoordinatorOrigin' in json else None, + ) + + +@dataclass +class AttributionScopesData: + values: typing.List[str] + + #: number instead of integer because not all uint32 can be represented by + #: int + limit: float + + max_event_states: float + + def to_json(self): + json = dict() + json['values'] = [i for i in self.values] + json['limit'] = self.limit + json['maxEventStates'] = self.max_event_states + return json + + @classmethod + def from_json(cls, json): + return cls( + values=[str(i) for i in json['values']], + limit=float(json['limit']), + max_event_states=float(json['maxEventStates']), + ) + + +@dataclass +class AttributionReportingSourceRegistration: + time: network.TimeSinceEpoch + + #: duration in seconds + expiry: int + + trigger_specs: typing.List[AttributionReportingTriggerSpec] + + #: duration in seconds + aggregatable_report_window: int + + type_: AttributionReportingSourceType + + source_origin: str + + reporting_origin: str + + destination_sites: typing.List[str] + + event_id: UnsignedInt64AsBase10 + + priority: SignedInt64AsBase10 + + filter_data: typing.List[AttributionReportingFilterDataEntry] + + aggregation_keys: typing.List[AttributionReportingAggregationKeysEntry] + + trigger_data_matching: AttributionReportingTriggerDataMatching + + destination_limit_priority: SignedInt64AsBase10 + + aggregatable_debug_reporting_config: AttributionReportingAggregatableDebugReportingConfig + + max_event_level_reports: int + + debug_key: typing.Optional[UnsignedInt64AsBase10] = None + + scopes_data: typing.Optional[AttributionScopesData] = None + + def to_json(self): + json = dict() + json['time'] = self.time.to_json() + json['expiry'] = self.expiry + json['triggerSpecs'] = [i.to_json() for i in self.trigger_specs] + json['aggregatableReportWindow'] = self.aggregatable_report_window + json['type'] = self.type_.to_json() + json['sourceOrigin'] = self.source_origin + json['reportingOrigin'] = self.reporting_origin + json['destinationSites'] = [i for i in self.destination_sites] + json['eventId'] = self.event_id.to_json() + json['priority'] = self.priority.to_json() + json['filterData'] = [i.to_json() for i in self.filter_data] + json['aggregationKeys'] = [i.to_json() for i in self.aggregation_keys] + json['triggerDataMatching'] = self.trigger_data_matching.to_json() + json['destinationLimitPriority'] = self.destination_limit_priority.to_json() + json['aggregatableDebugReportingConfig'] = self.aggregatable_debug_reporting_config.to_json() + json['maxEventLevelReports'] = self.max_event_level_reports + if self.debug_key is not None: + json['debugKey'] = self.debug_key.to_json() + if self.scopes_data is not None: + json['scopesData'] = self.scopes_data.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + time=network.TimeSinceEpoch.from_json(json['time']), + expiry=int(json['expiry']), + trigger_specs=[AttributionReportingTriggerSpec.from_json(i) for i in json['triggerSpecs']], + aggregatable_report_window=int(json['aggregatableReportWindow']), + type_=AttributionReportingSourceType.from_json(json['type']), + source_origin=str(json['sourceOrigin']), + reporting_origin=str(json['reportingOrigin']), + destination_sites=[str(i) for i in json['destinationSites']], + event_id=UnsignedInt64AsBase10.from_json(json['eventId']), + priority=SignedInt64AsBase10.from_json(json['priority']), + filter_data=[AttributionReportingFilterDataEntry.from_json(i) for i in json['filterData']], + aggregation_keys=[AttributionReportingAggregationKeysEntry.from_json(i) for i in json['aggregationKeys']], + trigger_data_matching=AttributionReportingTriggerDataMatching.from_json(json['triggerDataMatching']), + destination_limit_priority=SignedInt64AsBase10.from_json(json['destinationLimitPriority']), + aggregatable_debug_reporting_config=AttributionReportingAggregatableDebugReportingConfig.from_json(json['aggregatableDebugReportingConfig']), + max_event_level_reports=int(json['maxEventLevelReports']), + debug_key=UnsignedInt64AsBase10.from_json(json['debugKey']) if 'debugKey' in json else None, + scopes_data=AttributionScopesData.from_json(json['scopesData']) if 'scopesData' in json else None, + ) + + +class AttributionReportingSourceRegistrationResult(enum.Enum): + SUCCESS = "success" + INTERNAL_ERROR = "internalError" + INSUFFICIENT_SOURCE_CAPACITY = "insufficientSourceCapacity" + INSUFFICIENT_UNIQUE_DESTINATION_CAPACITY = "insufficientUniqueDestinationCapacity" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + SUCCESS_NOISED = "successNoised" + DESTINATION_REPORTING_LIMIT_REACHED = "destinationReportingLimitReached" + DESTINATION_GLOBAL_LIMIT_REACHED = "destinationGlobalLimitReached" + DESTINATION_BOTH_LIMITS_REACHED = "destinationBothLimitsReached" + REPORTING_ORIGINS_PER_SITE_LIMIT_REACHED = "reportingOriginsPerSiteLimitReached" + EXCEEDS_MAX_CHANNEL_CAPACITY = "exceedsMaxChannelCapacity" + EXCEEDS_MAX_SCOPES_CHANNEL_CAPACITY = "exceedsMaxScopesChannelCapacity" + EXCEEDS_MAX_TRIGGER_STATE_CARDINALITY = "exceedsMaxTriggerStateCardinality" + EXCEEDS_MAX_EVENT_STATES_LIMIT = "exceedsMaxEventStatesLimit" + DESTINATION_PER_DAY_REPORTING_LIMIT_REACHED = "destinationPerDayReportingLimitReached" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AttributionReportingSourceRegistrationTimeConfig(enum.Enum): + INCLUDE = "include" + EXCLUDE = "exclude" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class AttributionReportingAggregatableValueDictEntry: + key: str + + #: number instead of integer because not all uint32 can be represented by + #: int + value: float + + filtering_id: UnsignedInt64AsBase10 + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value + json['filteringId'] = self.filtering_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=float(json['value']), + filtering_id=UnsignedInt64AsBase10.from_json(json['filteringId']), + ) + + +@dataclass +class AttributionReportingAggregatableValueEntry: + values: typing.List[AttributionReportingAggregatableValueDictEntry] + + filters: AttributionReportingFilterPair + + def to_json(self): + json = dict() + json['values'] = [i.to_json() for i in self.values] + json['filters'] = self.filters.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + values=[AttributionReportingAggregatableValueDictEntry.from_json(i) for i in json['values']], + filters=AttributionReportingFilterPair.from_json(json['filters']), + ) + + +@dataclass +class AttributionReportingEventTriggerData: + data: UnsignedInt64AsBase10 + + priority: SignedInt64AsBase10 + + filters: AttributionReportingFilterPair + + dedup_key: typing.Optional[UnsignedInt64AsBase10] = None + + def to_json(self): + json = dict() + json['data'] = self.data.to_json() + json['priority'] = self.priority.to_json() + json['filters'] = self.filters.to_json() + if self.dedup_key is not None: + json['dedupKey'] = self.dedup_key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + data=UnsignedInt64AsBase10.from_json(json['data']), + priority=SignedInt64AsBase10.from_json(json['priority']), + filters=AttributionReportingFilterPair.from_json(json['filters']), + dedup_key=UnsignedInt64AsBase10.from_json(json['dedupKey']) if 'dedupKey' in json else None, + ) + + +@dataclass +class AttributionReportingAggregatableTriggerData: + key_piece: UnsignedInt128AsBase16 + + source_keys: typing.List[str] + + filters: AttributionReportingFilterPair + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['sourceKeys'] = [i for i in self.source_keys] + json['filters'] = self.filters.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + source_keys=[str(i) for i in json['sourceKeys']], + filters=AttributionReportingFilterPair.from_json(json['filters']), + ) + + +@dataclass +class AttributionReportingAggregatableDedupKey: + filters: AttributionReportingFilterPair + + dedup_key: typing.Optional[UnsignedInt64AsBase10] = None + + def to_json(self): + json = dict() + json['filters'] = self.filters.to_json() + if self.dedup_key is not None: + json['dedupKey'] = self.dedup_key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=AttributionReportingFilterPair.from_json(json['filters']), + dedup_key=UnsignedInt64AsBase10.from_json(json['dedupKey']) if 'dedupKey' in json else None, + ) + + +@dataclass +class AttributionReportingTriggerRegistration: + filters: AttributionReportingFilterPair + + aggregatable_dedup_keys: typing.List[AttributionReportingAggregatableDedupKey] + + event_trigger_data: typing.List[AttributionReportingEventTriggerData] + + aggregatable_trigger_data: typing.List[AttributionReportingAggregatableTriggerData] + + aggregatable_values: typing.List[AttributionReportingAggregatableValueEntry] + + aggregatable_filtering_id_max_bytes: int + + debug_reporting: bool + + source_registration_time_config: AttributionReportingSourceRegistrationTimeConfig + + aggregatable_debug_reporting_config: AttributionReportingAggregatableDebugReportingConfig + + scopes: typing.List[str] + + debug_key: typing.Optional[UnsignedInt64AsBase10] = None + + aggregation_coordinator_origin: typing.Optional[str] = None + + trigger_context_id: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['filters'] = self.filters.to_json() + json['aggregatableDedupKeys'] = [i.to_json() for i in self.aggregatable_dedup_keys] + json['eventTriggerData'] = [i.to_json() for i in self.event_trigger_data] + json['aggregatableTriggerData'] = [i.to_json() for i in self.aggregatable_trigger_data] + json['aggregatableValues'] = [i.to_json() for i in self.aggregatable_values] + json['aggregatableFilteringIdMaxBytes'] = self.aggregatable_filtering_id_max_bytes + json['debugReporting'] = self.debug_reporting + json['sourceRegistrationTimeConfig'] = self.source_registration_time_config.to_json() + json['aggregatableDebugReportingConfig'] = self.aggregatable_debug_reporting_config.to_json() + json['scopes'] = [i for i in self.scopes] + if self.debug_key is not None: + json['debugKey'] = self.debug_key.to_json() + if self.aggregation_coordinator_origin is not None: + json['aggregationCoordinatorOrigin'] = self.aggregation_coordinator_origin + if self.trigger_context_id is not None: + json['triggerContextId'] = self.trigger_context_id + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=AttributionReportingFilterPair.from_json(json['filters']), + aggregatable_dedup_keys=[AttributionReportingAggregatableDedupKey.from_json(i) for i in json['aggregatableDedupKeys']], + event_trigger_data=[AttributionReportingEventTriggerData.from_json(i) for i in json['eventTriggerData']], + aggregatable_trigger_data=[AttributionReportingAggregatableTriggerData.from_json(i) for i in json['aggregatableTriggerData']], + aggregatable_values=[AttributionReportingAggregatableValueEntry.from_json(i) for i in json['aggregatableValues']], + aggregatable_filtering_id_max_bytes=int(json['aggregatableFilteringIdMaxBytes']), + debug_reporting=bool(json['debugReporting']), + source_registration_time_config=AttributionReportingSourceRegistrationTimeConfig.from_json(json['sourceRegistrationTimeConfig']), + aggregatable_debug_reporting_config=AttributionReportingAggregatableDebugReportingConfig.from_json(json['aggregatableDebugReportingConfig']), + scopes=[str(i) for i in json['scopes']], + debug_key=UnsignedInt64AsBase10.from_json(json['debugKey']) if 'debugKey' in json else None, + aggregation_coordinator_origin=str(json['aggregationCoordinatorOrigin']) if 'aggregationCoordinatorOrigin' in json else None, + trigger_context_id=str(json['triggerContextId']) if 'triggerContextId' in json else None, + ) + + +class AttributionReportingEventLevelResult(enum.Enum): + SUCCESS = "success" + SUCCESS_DROPPED_LOWER_PRIORITY = "successDroppedLowerPriority" + INTERNAL_ERROR = "internalError" + NO_CAPACITY_FOR_ATTRIBUTION_DESTINATION = "noCapacityForAttributionDestination" + NO_MATCHING_SOURCES = "noMatchingSources" + DEDUPLICATED = "deduplicated" + EXCESSIVE_ATTRIBUTIONS = "excessiveAttributions" + PRIORITY_TOO_LOW = "priorityTooLow" + NEVER_ATTRIBUTED_SOURCE = "neverAttributedSource" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + NO_MATCHING_SOURCE_FILTER_DATA = "noMatchingSourceFilterData" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + NO_MATCHING_CONFIGURATIONS = "noMatchingConfigurations" + EXCESSIVE_REPORTS = "excessiveReports" + FALSELY_ATTRIBUTED_SOURCE = "falselyAttributedSource" + REPORT_WINDOW_PASSED = "reportWindowPassed" + NOT_REGISTERED = "notRegistered" + REPORT_WINDOW_NOT_STARTED = "reportWindowNotStarted" + NO_MATCHING_TRIGGER_DATA = "noMatchingTriggerData" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AttributionReportingAggregatableResult(enum.Enum): + SUCCESS = "success" + INTERNAL_ERROR = "internalError" + NO_CAPACITY_FOR_ATTRIBUTION_DESTINATION = "noCapacityForAttributionDestination" + NO_MATCHING_SOURCES = "noMatchingSources" + EXCESSIVE_ATTRIBUTIONS = "excessiveAttributions" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + NO_HISTOGRAMS = "noHistograms" + INSUFFICIENT_BUDGET = "insufficientBudget" + INSUFFICIENT_NAMED_BUDGET = "insufficientNamedBudget" + NO_MATCHING_SOURCE_FILTER_DATA = "noMatchingSourceFilterData" + NOT_REGISTERED = "notRegistered" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + DEDUPLICATED = "deduplicated" + REPORT_WINDOW_PASSED = "reportWindowPassed" + EXCESSIVE_REPORTS = "excessiveReports" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class RelatedWebsiteSet: + ''' + A single Related Website Set object. + ''' + #: The primary site of this set, along with the ccTLDs if there is any. + primary_sites: typing.List[str] + + #: The associated sites of this set, along with the ccTLDs if there is any. + associated_sites: typing.List[str] + + #: The service sites of this set, along with the ccTLDs if there is any. + service_sites: typing.List[str] + + def to_json(self): + json = dict() + json['primarySites'] = [i for i in self.primary_sites] + json['associatedSites'] = [i for i in self.associated_sites] + json['serviceSites'] = [i for i in self.service_sites] + return json + + @classmethod + def from_json(cls, json): + return cls( + primary_sites=[str(i) for i in json['primarySites']], + associated_sites=[str(i) for i in json['associatedSites']], + service_sites=[str(i) for i in json['serviceSites']], + ) + + +def get_storage_key_for_frame( + frame_id: page.FrameId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SerializedStorageKey]: + ''' + Returns a storage key given a frame id. + + :param frame_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['frameId'] = frame_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getStorageKeyForFrame', + 'params': params, + } + json = yield cmd_dict + return SerializedStorageKey.from_json(json['storageKey']) + + +def clear_data_for_origin( + origin: str, + storage_types: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears storage for origin. + + :param origin: Security origin. + :param storage_types: Comma separated list of StorageType to clear. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['storageTypes'] = storage_types + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearDataForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def clear_data_for_storage_key( + storage_key: str, + storage_types: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears storage for storage key. + + :param storage_key: Storage key. + :param storage_types: Comma separated list of StorageType to clear. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + params['storageTypes'] = storage_types + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearDataForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def get_cookies( + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[network.Cookie]]: + ''' + Returns all browser cookies. + + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + :returns: Array of cookie objects. + ''' + params: T_JSON_DICT = dict() + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getCookies', + 'params': params, + } + json = yield cmd_dict + return [network.Cookie.from_json(i) for i in json['cookies']] + + +def set_cookies( + cookies: typing.List[network.CookieParam], + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets given cookies. + + :param cookies: Cookies to be set. + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + ''' + params: T_JSON_DICT = dict() + params['cookies'] = [i.to_json() for i in cookies] + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setCookies', + 'params': params, + } + json = yield cmd_dict + + +def clear_cookies( + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears cookies. + + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + ''' + params: T_JSON_DICT = dict() + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearCookies', + 'params': params, + } + json = yield cmd_dict + + +def get_usage_and_quota( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[float, float, bool, typing.List[UsageForType]]]: + ''' + Returns usage and quota in bytes. + + :param origin: Security origin. + :returns: A tuple with the following items: + + 0. **usage** - Storage usage (bytes). + 1. **quota** - Storage quota (bytes). + 2. **overrideActive** - Whether or not the origin has an active storage quota override + 3. **usageBreakdown** - Storage usage per type (bytes). + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getUsageAndQuota', + 'params': params, + } + json = yield cmd_dict + return ( + float(json['usage']), + float(json['quota']), + bool(json['overrideActive']), + [UsageForType.from_json(i) for i in json['usageBreakdown']] + ) + + +def override_quota_for_origin( + origin: str, + quota_size: typing.Optional[float] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Override quota for the specified origin + + **EXPERIMENTAL** + + :param origin: Security origin. + :param quota_size: *(Optional)* The quota size (in bytes) to override the original quota with. If this is called multiple times, the overridden quota will be equal to the quotaSize provided in the final call. If this is called without specifying a quotaSize, the quota will be reset to the default value for the specified origin. If this is called multiple times with different origins, the override will be maintained for each origin until it is disabled (called without a quotaSize). + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + if quota_size is not None: + params['quotaSize'] = quota_size + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.overrideQuotaForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_cache_storage_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers origin to be notified when an update occurs to its cache storage list. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackCacheStorageForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_cache_storage_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers storage key to be notified when an update occurs to its cache storage list. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackCacheStorageForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def track_indexed_db_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers origin to be notified when an update occurs to its IndexedDB. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackIndexedDBForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_indexed_db_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers storage key to be notified when an update occurs to its IndexedDB. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackIndexedDBForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def untrack_cache_storage_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters origin from receiving notifications for cache storage. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackCacheStorageForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def untrack_cache_storage_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters storage key from receiving notifications for cache storage. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackCacheStorageForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def untrack_indexed_db_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters origin from receiving notifications for IndexedDB. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackIndexedDBForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def untrack_indexed_db_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters storage key from receiving notifications for IndexedDB. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackIndexedDBForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def get_trust_tokens() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[TrustTokens]]: + ''' + Returns the number of stored Trust Tokens per issuer for the + current browsing context. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getTrustTokens', + } + json = yield cmd_dict + return [TrustTokens.from_json(i) for i in json['tokens']] + + +def clear_trust_tokens( + issuer_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Removes all Trust Tokens issued by the provided issuerOrigin. + Leaves other stored data, including the issuer's Redemption Records, intact. + + **EXPERIMENTAL** + + :param issuer_origin: + :returns: True if any tokens were deleted, false otherwise. + ''' + params: T_JSON_DICT = dict() + params['issuerOrigin'] = issuer_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearTrustTokens', + 'params': params, + } + json = yield cmd_dict + return bool(json['didDeleteTokens']) + + +def get_interest_group_details( + owner_origin: str, + name: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,dict]: + ''' + Gets details for a named interest group. + + **EXPERIMENTAL** + + :param owner_origin: + :param name: + :returns: This largely corresponds to: https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup but has absolute expirationTime instead of relative lifetimeMs and also adds joiningOrigin. + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['name'] = name + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getInterestGroupDetails', + 'params': params, + } + json = yield cmd_dict + return dict(json['details']) + + +def set_interest_group_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/Disables issuing of interestGroupAccessed events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setInterestGroupTracking', + 'params': params, + } + json = yield cmd_dict + + +def set_interest_group_auction_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/Disables issuing of interestGroupAuctionEventOccurred and + interestGroupAuctionNetworkRequestCreated. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setInterestGroupAuctionTracking', + 'params': params, + } + json = yield cmd_dict + + +def get_shared_storage_metadata( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SharedStorageMetadata]: + ''' + Gets metadata for an origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :returns: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getSharedStorageMetadata', + 'params': params, + } + json = yield cmd_dict + return SharedStorageMetadata.from_json(json['metadata']) + + +def get_shared_storage_entries( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[SharedStorageEntry]]: + ''' + Gets the entries in an given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :returns: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getSharedStorageEntries', + 'params': params, + } + json = yield cmd_dict + return [SharedStorageEntry.from_json(i) for i in json['entries']] + + +def set_shared_storage_entry( + owner_origin: str, + key: str, + value: str, + ignore_if_present: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets entry with ``key`` and ``value`` for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :param key: + :param value: + :param ignore_if_present: *(Optional)* If ```ignoreIfPresent```` is included and true, then only sets the entry if ````key``` doesn't already exist. + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['key'] = key + params['value'] = value + if ignore_if_present is not None: + params['ignoreIfPresent'] = ignore_if_present + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setSharedStorageEntry', + 'params': params, + } + json = yield cmd_dict + + +def delete_shared_storage_entry( + owner_origin: str, + key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes entry for ``key`` (if it exists) for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :param key: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['key'] = key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.deleteSharedStorageEntry', + 'params': params, + } + json = yield cmd_dict + + +def clear_shared_storage_entries( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears all entries for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearSharedStorageEntries', + 'params': params, + } + json = yield cmd_dict + + +def reset_shared_storage_budget( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Resets the budget for ``ownerOrigin`` by clearing all budget withdrawals. + + **EXPERIMENTAL** + + :param owner_origin: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.resetSharedStorageBudget', + 'params': params, + } + json = yield cmd_dict + + +def set_shared_storage_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/disables issuing of sharedStorageAccessed events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setSharedStorageTracking', + 'params': params, + } + json = yield cmd_dict + + +def set_storage_bucket_tracking( + storage_key: str, + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Set tracking for a storage key's buckets. + + **EXPERIMENTAL** + + :param storage_key: + :param enable: + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setStorageBucketTracking', + 'params': params, + } + json = yield cmd_dict + + +def delete_storage_bucket( + bucket: StorageBucket + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes the Storage Bucket with the given storage key and bucket name. + + **EXPERIMENTAL** + + :param bucket: + ''' + params: T_JSON_DICT = dict() + params['bucket'] = bucket.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.deleteStorageBucket', + 'params': params, + } + json = yield cmd_dict + + +def run_bounce_tracking_mitigations() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Deletes state for sites identified as potential bounce trackers, immediately. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.runBounceTrackingMitigations', + } + json = yield cmd_dict + return [str(i) for i in json['deletedSites']] + + +def set_attribution_reporting_local_testing_mode( + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + https://wicg.github.io/attribution-reporting-api/ + + **EXPERIMENTAL** + + :param enabled: If enabled, noise is suppressed and reports are sent immediately. + ''' + params: T_JSON_DICT = dict() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setAttributionReportingLocalTestingMode', + 'params': params, + } + json = yield cmd_dict + + +def set_attribution_reporting_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/disables issuing of Attribution Reporting events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setAttributionReportingTracking', + 'params': params, + } + json = yield cmd_dict + + +def send_pending_attribution_reports() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,int]: + ''' + Sends all pending Attribution Reports immediately, regardless of their + scheduled report time. + + **EXPERIMENTAL** + + :returns: The number of reports that were sent. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.sendPendingAttributionReports', + } + json = yield cmd_dict + return int(json['numSent']) + + +def get_related_website_sets() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[RelatedWebsiteSet]]: + ''' + 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. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getRelatedWebsiteSets', + } + json = yield cmd_dict + return [RelatedWebsiteSet.from_json(i) for i in json['sets']] + + +@event_class('Storage.cacheStorageContentUpdated') +@dataclass +class CacheStorageContentUpdated: + ''' + A cache's contents have been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + #: Name of cache in origin. + cache_name: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CacheStorageContentUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']), + cache_name=str(json['cacheName']) + ) + + +@event_class('Storage.cacheStorageListUpdated') +@dataclass +class CacheStorageListUpdated: + ''' + A cache has been added/deleted. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CacheStorageListUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.indexedDBContentUpdated') +@dataclass +class IndexedDBContentUpdated: + ''' + The origin's IndexedDB object store has been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + #: Database to update. + database_name: str + #: ObjectStore to update. + object_store_name: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> IndexedDBContentUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']), + database_name=str(json['databaseName']), + object_store_name=str(json['objectStoreName']) + ) + + +@event_class('Storage.indexedDBListUpdated') +@dataclass +class IndexedDBListUpdated: + ''' + The origin's IndexedDB database list has been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> IndexedDBListUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.interestGroupAccessed') +@dataclass +class InterestGroupAccessed: + ''' + One of the interest groups was accessed. Note that these events are global + to all targets sharing an interest group store. + ''' + access_time: network.TimeSinceEpoch + type_: InterestGroupAccessType + owner_origin: str + name: str + #: For topLevelBid/topLevelAdditionalBid, and when appropriate, + #: win and additionalBidWin + component_seller_origin: typing.Optional[str] + #: For bid or somethingBid event, if done locally and not on a server. + bid: typing.Optional[float] + bid_currency: typing.Optional[str] + #: For non-global events --- links to interestGroupAuctionEvent + unique_auction_id: typing.Optional[InterestGroupAuctionId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAccessed: + return cls( + access_time=network.TimeSinceEpoch.from_json(json['accessTime']), + type_=InterestGroupAccessType.from_json(json['type']), + owner_origin=str(json['ownerOrigin']), + name=str(json['name']), + component_seller_origin=str(json['componentSellerOrigin']) if 'componentSellerOrigin' in json else None, + bid=float(json['bid']) if 'bid' in json else None, + bid_currency=str(json['bidCurrency']) if 'bidCurrency' in json else None, + unique_auction_id=InterestGroupAuctionId.from_json(json['uniqueAuctionId']) if 'uniqueAuctionId' in json else None + ) + + +@event_class('Storage.interestGroupAuctionEventOccurred') +@dataclass +class InterestGroupAuctionEventOccurred: + ''' + An auction involving interest groups is taking place. These events are + target-specific. + ''' + event_time: network.TimeSinceEpoch + type_: InterestGroupAuctionEventType + unique_auction_id: InterestGroupAuctionId + #: Set for child auctions. + parent_auction_id: typing.Optional[InterestGroupAuctionId] + #: Set for started and configResolved + auction_config: typing.Optional[dict] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAuctionEventOccurred: + return cls( + event_time=network.TimeSinceEpoch.from_json(json['eventTime']), + type_=InterestGroupAuctionEventType.from_json(json['type']), + unique_auction_id=InterestGroupAuctionId.from_json(json['uniqueAuctionId']), + parent_auction_id=InterestGroupAuctionId.from_json(json['parentAuctionId']) if 'parentAuctionId' in json else None, + auction_config=dict(json['auctionConfig']) if 'auctionConfig' in json else None + ) + + +@event_class('Storage.interestGroupAuctionNetworkRequestCreated') +@dataclass +class InterestGroupAuctionNetworkRequestCreated: + ''' + 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). + ''' + type_: InterestGroupAuctionFetchType + request_id: network.RequestId + #: 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. + auctions: typing.List[InterestGroupAuctionId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAuctionNetworkRequestCreated: + return cls( + type_=InterestGroupAuctionFetchType.from_json(json['type']), + request_id=network.RequestId.from_json(json['requestId']), + auctions=[InterestGroupAuctionId.from_json(i) for i in json['auctions']] + ) + + +@event_class('Storage.sharedStorageAccessed') +@dataclass +class SharedStorageAccessed: + ''' + Shared storage was accessed by the associated page. + The following parameters are included in all events. + ''' + #: Time of the access. + access_time: network.TimeSinceEpoch + #: Enum value indicating the Shared Storage API method invoked. + type_: SharedStorageAccessType + #: DevTools Frame Token for the primary frame tree's root. + main_frame_id: page.FrameId + #: Serialized origin for the context that invoked the Shared Storage API. + owner_origin: str + #: The sub-parameters wrapped by ``params`` are all optional and their + #: presence/absence depends on ``type``. + params: SharedStorageAccessParams + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> SharedStorageAccessed: + return cls( + access_time=network.TimeSinceEpoch.from_json(json['accessTime']), + type_=SharedStorageAccessType.from_json(json['type']), + main_frame_id=page.FrameId.from_json(json['mainFrameId']), + owner_origin=str(json['ownerOrigin']), + params=SharedStorageAccessParams.from_json(json['params']) + ) + + +@event_class('Storage.storageBucketCreatedOrUpdated') +@dataclass +class StorageBucketCreatedOrUpdated: + bucket_info: StorageBucketInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> StorageBucketCreatedOrUpdated: + return cls( + bucket_info=StorageBucketInfo.from_json(json['bucketInfo']) + ) + + +@event_class('Storage.storageBucketDeleted') +@dataclass +class StorageBucketDeleted: + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> StorageBucketDeleted: + return cls( + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.attributionReportingSourceRegistered') +@dataclass +class AttributionReportingSourceRegistered: + ''' + **EXPERIMENTAL** + + + ''' + registration: AttributionReportingSourceRegistration + result: AttributionReportingSourceRegistrationResult + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttributionReportingSourceRegistered: + return cls( + registration=AttributionReportingSourceRegistration.from_json(json['registration']), + result=AttributionReportingSourceRegistrationResult.from_json(json['result']) + ) + + +@event_class('Storage.attributionReportingTriggerRegistered') +@dataclass +class AttributionReportingTriggerRegistered: + ''' + **EXPERIMENTAL** + + + ''' + registration: AttributionReportingTriggerRegistration + event_level: AttributionReportingEventLevelResult + aggregatable: AttributionReportingAggregatableResult + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttributionReportingTriggerRegistered: + return cls( + registration=AttributionReportingTriggerRegistration.from_json(json['registration']), + event_level=AttributionReportingEventLevelResult.from_json(json['eventLevel']), + aggregatable=AttributionReportingAggregatableResult.from_json(json['aggregatable']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/system_info.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/system_info.py new file mode 100644 index 0000000..d1b2f6b --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/system_info.py @@ -0,0 +1,366 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: SystemInfo (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +@dataclass +class GPUDevice: + ''' + Describes a single graphics processor (GPU). + ''' + #: PCI ID of the GPU vendor, if available; 0 otherwise. + vendor_id: float + + #: PCI ID of the GPU device, if available; 0 otherwise. + device_id: float + + #: String description of the GPU vendor, if the PCI ID is not available. + vendor_string: str + + #: String description of the GPU device, if the PCI ID is not available. + device_string: str + + #: String description of the GPU driver vendor. + driver_vendor: str + + #: String description of the GPU driver version. + driver_version: str + + #: Sub sys ID of the GPU, only available on Windows. + sub_sys_id: typing.Optional[float] = None + + #: Revision of the GPU, only available on Windows. + revision: typing.Optional[float] = None + + def to_json(self): + json = dict() + json['vendorId'] = self.vendor_id + json['deviceId'] = self.device_id + json['vendorString'] = self.vendor_string + json['deviceString'] = self.device_string + json['driverVendor'] = self.driver_vendor + json['driverVersion'] = self.driver_version + if self.sub_sys_id is not None: + json['subSysId'] = self.sub_sys_id + if self.revision is not None: + json['revision'] = self.revision + return json + + @classmethod + def from_json(cls, json): + return cls( + vendor_id=float(json['vendorId']), + device_id=float(json['deviceId']), + vendor_string=str(json['vendorString']), + device_string=str(json['deviceString']), + driver_vendor=str(json['driverVendor']), + driver_version=str(json['driverVersion']), + sub_sys_id=float(json['subSysId']) if 'subSysId' in json else None, + revision=float(json['revision']) if 'revision' in json else None, + ) + + +@dataclass +class Size: + ''' + Describes the width and height dimensions of an entity. + ''' + #: Width in pixels. + width: int + + #: Height in pixels. + height: int + + def to_json(self): + json = dict() + json['width'] = self.width + json['height'] = self.height + return json + + @classmethod + def from_json(cls, json): + return cls( + width=int(json['width']), + height=int(json['height']), + ) + + +@dataclass +class VideoDecodeAcceleratorCapability: + ''' + Describes a supported video decoding profile with its associated minimum and + maximum resolutions. + ''' + #: Video codec profile that is supported, e.g. VP9 Profile 2. + profile: str + + #: Maximum video dimensions in pixels supported for this ``profile``. + max_resolution: Size + + #: Minimum video dimensions in pixels supported for this ``profile``. + min_resolution: Size + + def to_json(self): + json = dict() + json['profile'] = self.profile + json['maxResolution'] = self.max_resolution.to_json() + json['minResolution'] = self.min_resolution.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + profile=str(json['profile']), + max_resolution=Size.from_json(json['maxResolution']), + min_resolution=Size.from_json(json['minResolution']), + ) + + +@dataclass +class VideoEncodeAcceleratorCapability: + ''' + Describes a supported video encoding profile with its associated maximum + resolution and maximum framerate. + ''' + #: Video codec profile that is supported, e.g H264 Main. + profile: str + + #: Maximum video dimensions in pixels supported for this ``profile``. + max_resolution: Size + + #: 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. + max_framerate_numerator: int + + max_framerate_denominator: int + + def to_json(self): + json = dict() + json['profile'] = self.profile + json['maxResolution'] = self.max_resolution.to_json() + json['maxFramerateNumerator'] = self.max_framerate_numerator + json['maxFramerateDenominator'] = self.max_framerate_denominator + return json + + @classmethod + def from_json(cls, json): + return cls( + profile=str(json['profile']), + max_resolution=Size.from_json(json['maxResolution']), + max_framerate_numerator=int(json['maxFramerateNumerator']), + max_framerate_denominator=int(json['maxFramerateDenominator']), + ) + + +class SubsamplingFormat(enum.Enum): + ''' + YUV subsampling type of the pixels of a given image. + ''' + YUV420 = "yuv420" + YUV422 = "yuv422" + YUV444 = "yuv444" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ImageType(enum.Enum): + ''' + Image format of a given image. + ''' + JPEG = "jpeg" + WEBP = "webp" + UNKNOWN = "unknown" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ImageDecodeAcceleratorCapability: + ''' + Describes a supported image decoding profile with its associated minimum and + maximum resolutions and subsampling. + ''' + #: Image coded, e.g. Jpeg. + image_type: ImageType + + #: Maximum supported dimensions of the image in pixels. + max_dimensions: Size + + #: Minimum supported dimensions of the image in pixels. + min_dimensions: Size + + #: Optional array of supported subsampling formats, e.g. 4:2:0, if known. + subsamplings: typing.List[SubsamplingFormat] + + def to_json(self): + json = dict() + json['imageType'] = self.image_type.to_json() + json['maxDimensions'] = self.max_dimensions.to_json() + json['minDimensions'] = self.min_dimensions.to_json() + json['subsamplings'] = [i.to_json() for i in self.subsamplings] + return json + + @classmethod + def from_json(cls, json): + return cls( + image_type=ImageType.from_json(json['imageType']), + max_dimensions=Size.from_json(json['maxDimensions']), + min_dimensions=Size.from_json(json['minDimensions']), + subsamplings=[SubsamplingFormat.from_json(i) for i in json['subsamplings']], + ) + + +@dataclass +class GPUInfo: + ''' + Provides information about the GPU(s) on the system. + ''' + #: The graphics devices on the system. Element 0 is the primary GPU. + devices: typing.List[GPUDevice] + + #: An optional array of GPU driver bug workarounds. + driver_bug_workarounds: typing.List[str] + + #: Supported accelerated video decoding capabilities. + video_decoding: typing.List[VideoDecodeAcceleratorCapability] + + #: Supported accelerated video encoding capabilities. + video_encoding: typing.List[VideoEncodeAcceleratorCapability] + + #: Supported accelerated image decoding capabilities. + image_decoding: typing.List[ImageDecodeAcceleratorCapability] + + #: An optional dictionary of additional GPU related attributes. + aux_attributes: typing.Optional[dict] = None + + #: An optional dictionary of graphics features and their status. + feature_status: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['devices'] = [i.to_json() for i in self.devices] + json['driverBugWorkarounds'] = [i for i in self.driver_bug_workarounds] + json['videoDecoding'] = [i.to_json() for i in self.video_decoding] + json['videoEncoding'] = [i.to_json() for i in self.video_encoding] + json['imageDecoding'] = [i.to_json() for i in self.image_decoding] + if self.aux_attributes is not None: + json['auxAttributes'] = self.aux_attributes + if self.feature_status is not None: + json['featureStatus'] = self.feature_status + return json + + @classmethod + def from_json(cls, json): + return cls( + devices=[GPUDevice.from_json(i) for i in json['devices']], + driver_bug_workarounds=[str(i) for i in json['driverBugWorkarounds']], + video_decoding=[VideoDecodeAcceleratorCapability.from_json(i) for i in json['videoDecoding']], + video_encoding=[VideoEncodeAcceleratorCapability.from_json(i) for i in json['videoEncoding']], + image_decoding=[ImageDecodeAcceleratorCapability.from_json(i) for i in json['imageDecoding']], + aux_attributes=dict(json['auxAttributes']) if 'auxAttributes' in json else None, + feature_status=dict(json['featureStatus']) if 'featureStatus' in json else None, + ) + + +@dataclass +class ProcessInfo: + ''' + Represents process info. + ''' + #: Specifies process type. + type_: str + + #: Specifies process id. + id_: int + + #: Specifies cumulative CPU usage in seconds across all threads of the + #: process since the process start. + cpu_time: float + + def to_json(self): + json = dict() + json['type'] = self.type_ + json['id'] = self.id_ + json['cpuTime'] = self.cpu_time + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + id_=int(json['id']), + cpu_time=float(json['cpuTime']), + ) + + +def get_info() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[GPUInfo, str, str, str]]: + ''' + Returns information about the system. + + :returns: A tuple with the following items: + + 0. **gpu** - Information about the GPUs on the system. + 1. **modelName** - A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported. + 2. **modelVersion** - A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported. + 3. **commandLine** - The command line string used to launch the browser. Will be the empty string if not supported. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getInfo', + } + json = yield cmd_dict + return ( + GPUInfo.from_json(json['gpu']), + str(json['modelName']), + str(json['modelVersion']), + str(json['commandLine']) + ) + + +def get_feature_state( + feature_state: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Returns information about the feature state. + + :param feature_state: + :returns: + ''' + params: T_JSON_DICT = dict() + params['featureState'] = feature_state + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getFeatureState', + 'params': params, + } + json = yield cmd_dict + return bool(json['featureEnabled']) + + +def get_process_info() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[ProcessInfo]]: + ''' + Returns information about all running processes. + + :returns: An array of process info blocks. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getProcessInfo', + } + json = yield cmd_dict + return [ProcessInfo.from_json(i) for i in json['processInfo']] diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/target.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/target.py new file mode 100644 index 0000000..7087aa8 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/target.py @@ -0,0 +1,721 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Target +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import browser +from . import page + + +class TargetID(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> TargetID: + return cls(json) + + def __repr__(self): + return 'TargetID({})'.format(super().__repr__()) + + +class SessionID(str): + ''' + Unique identifier of attached debugging session. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SessionID: + return cls(json) + + def __repr__(self): + return 'SessionID({})'.format(super().__repr__()) + + +@dataclass +class TargetInfo: + target_id: TargetID + + #: 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 + type_: str + + title: str + + url: str + + #: Whether the target has an attached client. + attached: bool + + #: Whether the target has access to the originating window. + can_access_opener: bool + + #: Opener target Id + opener_id: typing.Optional[TargetID] = None + + #: Frame id of originating window (is only set if target has an opener). + opener_frame_id: typing.Optional[page.FrameId] = None + + browser_context_id: typing.Optional[browser.BrowserContextID] = None + + #: Provides additional details for specific target types. For example, for + #: the type of "page", this may be set to "prerender". + subtype: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['targetId'] = self.target_id.to_json() + json['type'] = self.type_ + json['title'] = self.title + json['url'] = self.url + json['attached'] = self.attached + json['canAccessOpener'] = self.can_access_opener + if self.opener_id is not None: + json['openerId'] = self.opener_id.to_json() + if self.opener_frame_id is not None: + json['openerFrameId'] = self.opener_frame_id.to_json() + if self.browser_context_id is not None: + json['browserContextId'] = self.browser_context_id.to_json() + if self.subtype is not None: + json['subtype'] = self.subtype + return json + + @classmethod + def from_json(cls, json): + return cls( + target_id=TargetID.from_json(json['targetId']), + type_=str(json['type']), + title=str(json['title']), + url=str(json['url']), + attached=bool(json['attached']), + can_access_opener=bool(json['canAccessOpener']), + opener_id=TargetID.from_json(json['openerId']) if 'openerId' in json else None, + opener_frame_id=page.FrameId.from_json(json['openerFrameId']) if 'openerFrameId' in json else None, + browser_context_id=browser.BrowserContextID.from_json(json['browserContextId']) if 'browserContextId' in json else None, + subtype=str(json['subtype']) if 'subtype' in json else None, + ) + + +@dataclass +class FilterEntry: + ''' + A filter used by target query/discovery/auto-attach operations. + ''' + #: If set, causes exclusion of matching targets from the list. + exclude: typing.Optional[bool] = None + + #: If not present, matches any type. + type_: typing.Optional[str] = None + + def to_json(self): + json = dict() + if self.exclude is not None: + json['exclude'] = self.exclude + if self.type_ is not None: + json['type'] = self.type_ + return json + + @classmethod + def from_json(cls, json): + return cls( + exclude=bool(json['exclude']) if 'exclude' in json else None, + type_=str(json['type']) if 'type' in json else None, + ) + + +class TargetFilter(list): + ''' + 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``). + ''' + def to_json(self) -> typing.List[FilterEntry]: + return self + + @classmethod + def from_json(cls, json: typing.List[FilterEntry]) -> TargetFilter: + return cls(json) + + def __repr__(self): + return 'TargetFilter({})'.format(super().__repr__()) + + +@dataclass +class RemoteLocation: + host: str + + port: int + + def to_json(self): + json = dict() + json['host'] = self.host + json['port'] = self.port + return json + + @classmethod + def from_json(cls, json): + return cls( + host=str(json['host']), + port=int(json['port']), + ) + + +def activate_target( + target_id: TargetID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Activates (focuses) the target. + + :param target_id: + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.activateTarget', + 'params': params, + } + json = yield cmd_dict + + +def attach_to_target( + target_id: TargetID, + flatten: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SessionID]: + ''' + Attaches to the target with given id. + + :param target_id: + :param flatten: *(Optional)* 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: Id assigned to the session. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + if flatten is not None: + params['flatten'] = flatten + cmd_dict: T_JSON_DICT = { + 'method': 'Target.attachToTarget', + 'params': params, + } + json = yield cmd_dict + return SessionID.from_json(json['sessionId']) + + +def attach_to_browser_target() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SessionID]: + ''' + Attaches to the browser target, only uses flat sessionId mode. + + **EXPERIMENTAL** + + :returns: Id assigned to the session. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Target.attachToBrowserTarget', + } + json = yield cmd_dict + return SessionID.from_json(json['sessionId']) + + +def close_target( + target_id: TargetID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Closes the target. If the target is a page that gets closed too. + + :param target_id: + :returns: Always set to true. If an error occurs, the response indicates protocol error. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.closeTarget', + 'params': params, + } + json = yield cmd_dict + return bool(json['success']) + + +def expose_dev_tools_protocol( + target_id: TargetID, + binding_name: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + **EXPERIMENTAL** + + :param target_id: + :param binding_name: *(Optional)* Binding name, 'cdp' if not specified. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + if binding_name is not None: + params['bindingName'] = binding_name + cmd_dict: T_JSON_DICT = { + 'method': 'Target.exposeDevToolsProtocol', + 'params': params, + } + json = yield cmd_dict + + +def create_browser_context( + dispose_on_detach: typing.Optional[bool] = None, + proxy_server: typing.Optional[str] = None, + proxy_bypass_list: typing.Optional[str] = None, + origins_with_universal_network_access: typing.Optional[typing.List[str]] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,browser.BrowserContextID]: + ''' + Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than + one. + + :param dispose_on_detach: **(EXPERIMENTAL)** *(Optional)* If specified, disposes this context when debugging session disconnects. + :param proxy_server: **(EXPERIMENTAL)** *(Optional)* Proxy server, similar to the one passed to --proxy-server + :param proxy_bypass_list: **(EXPERIMENTAL)** *(Optional)* Proxy bypass list, similar to the one passed to --proxy-bypass-list + :param origins_with_universal_network_access: **(EXPERIMENTAL)** *(Optional)* An optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored. + :returns: The id of the context created. + ''' + params: T_JSON_DICT = dict() + if dispose_on_detach is not None: + params['disposeOnDetach'] = dispose_on_detach + if proxy_server is not None: + params['proxyServer'] = proxy_server + if proxy_bypass_list is not None: + params['proxyBypassList'] = proxy_bypass_list + if origins_with_universal_network_access is not None: + params['originsWithUniversalNetworkAccess'] = [i for i in origins_with_universal_network_access] + cmd_dict: T_JSON_DICT = { + 'method': 'Target.createBrowserContext', + 'params': params, + } + json = yield cmd_dict + return browser.BrowserContextID.from_json(json['browserContextId']) + + +def get_browser_contexts() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[browser.BrowserContextID]]: + ''' + Returns all browser contexts created with ``Target.createBrowserContext`` method. + + :returns: An array of browser context ids. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getBrowserContexts', + } + json = yield cmd_dict + return [browser.BrowserContextID.from_json(i) for i in json['browserContextIds']] + + +def create_target( + url: str, + left: typing.Optional[int] = None, + top: typing.Optional[int] = None, + width: typing.Optional[int] = None, + height: typing.Optional[int] = None, + browser_context_id: typing.Optional[browser.BrowserContextID] = None, + enable_begin_frame_control: typing.Optional[bool] = None, + new_window: typing.Optional[bool] = None, + background: typing.Optional[bool] = None, + for_tab: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,TargetID]: + ''' + Creates a new page. + + :param url: The initial URL the page will be navigated to. An empty string indicates about:blank. + :param left: **(EXPERIMENTAL)** *(Optional)* Frame left origin in DIP (headless chrome only). + :param top: **(EXPERIMENTAL)** *(Optional)* Frame top origin in DIP (headless chrome only). + :param width: *(Optional)* Frame width in DIP (headless chrome only). + :param height: *(Optional)* Frame height in DIP (headless chrome only). + :param browser_context_id: **(EXPERIMENTAL)** *(Optional)* The browser context to create the page in. + :param enable_begin_frame_control: **(EXPERIMENTAL)** *(Optional)* Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default). + :param new_window: *(Optional)* Whether to create a new Window or Tab (chrome-only, false by default). + :param background: *(Optional)* Whether to create the target in background or foreground (chrome-only, false by default). + :param for_tab: **(EXPERIMENTAL)** *(Optional)* Whether to create the target of type "tab". + :returns: The id of the page opened. + ''' + params: T_JSON_DICT = dict() + params['url'] = url + if left is not None: + params['left'] = left + if top is not None: + params['top'] = top + if width is not None: + params['width'] = width + if height is not None: + params['height'] = height + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + if enable_begin_frame_control is not None: + params['enableBeginFrameControl'] = enable_begin_frame_control + if new_window is not None: + params['newWindow'] = new_window + if background is not None: + params['background'] = background + if for_tab is not None: + params['forTab'] = for_tab + cmd_dict: T_JSON_DICT = { + 'method': 'Target.createTarget', + 'params': params, + } + json = yield cmd_dict + return TargetID.from_json(json['targetId']) + + +def detach_from_target( + session_id: typing.Optional[SessionID] = None, + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Detaches session with given id. + + :param session_id: *(Optional)* Session to detach. + :param target_id: *(Optional)* Deprecated. + ''' + params: T_JSON_DICT = dict() + if session_id is not None: + params['sessionId'] = session_id.to_json() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.detachFromTarget', + 'params': params, + } + json = yield cmd_dict + + +def dispose_browser_context( + browser_context_id: browser.BrowserContextID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes a BrowserContext. All the belonging pages will be closed without calling their + beforeunload hooks. + + :param browser_context_id: + ''' + params: T_JSON_DICT = dict() + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.disposeBrowserContext', + 'params': params, + } + json = yield cmd_dict + + +def get_target_info( + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,TargetInfo]: + ''' + Returns information about a target. + + **EXPERIMENTAL** + + :param target_id: *(Optional)* + :returns: + ''' + params: T_JSON_DICT = dict() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getTargetInfo', + 'params': params, + } + json = yield cmd_dict + return TargetInfo.from_json(json['targetInfo']) + + +def get_targets( + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[TargetInfo]]: + ''' + Retrieves a list of available targets. + + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be reported. If filter is not specified and target discovery is currently enabled, a filter used for target discovery is used for consistency. + :returns: The list of targets. + ''' + params: T_JSON_DICT = dict() + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getTargets', + 'params': params, + } + json = yield cmd_dict + return [TargetInfo.from_json(i) for i in json['targetInfos']] + + +def send_message_to_target( + message: str, + session_id: typing.Optional[SessionID] = None, + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sends protocol message over session with given id. + Consider using flat mode instead; see commands attachToTarget, setAutoAttach, + and crbug.com/991325. + + :param message: + :param session_id: *(Optional)* Identifier of the session. + :param target_id: *(Optional)* Deprecated. + ''' + params: T_JSON_DICT = dict() + params['message'] = message + if session_id is not None: + params['sessionId'] = session_id.to_json() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.sendMessageToTarget', + 'params': params, + } + json = yield cmd_dict + + +def set_auto_attach( + auto_attach: bool, + wait_for_debugger_on_start: bool, + flatten: typing.Optional[bool] = None, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Controls whether to automatically attach to new targets which are considered to be related to + this one. 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. + + :param auto_attach: Whether to auto-attach to related targets. + :param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use ```Runtime.runIfWaitingForDebugger``` to run paused targets. + :param flatten: **(EXPERIMENTAL)** *(Optional)* 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. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. + ''' + params: T_JSON_DICT = dict() + params['autoAttach'] = auto_attach + params['waitForDebuggerOnStart'] = wait_for_debugger_on_start + if flatten is not None: + params['flatten'] = flatten + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setAutoAttach', + 'params': params, + } + json = yield cmd_dict + + +def auto_attach_related( + target_id: TargetID, + wait_for_debugger_on_start: bool, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + **EXPERIMENTAL** + + :param target_id: + :param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use ```Runtime.runIfWaitingForDebugger``` to run paused targets. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + params['waitForDebuggerOnStart'] = wait_for_debugger_on_start + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.autoAttachRelated', + 'params': params, + } + json = yield cmd_dict + + +def set_discover_targets( + discover: bool, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Controls whether to discover available targets and notify via + ``targetCreated/targetInfoChanged/targetDestroyed`` events. + + :param discover: Whether to discover available targets. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. If ```discover```` is false, ````filter``` must be omitted or empty. + ''' + params: T_JSON_DICT = dict() + params['discover'] = discover + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setDiscoverTargets', + 'params': params, + } + json = yield cmd_dict + + +def set_remote_locations( + locations: typing.List[RemoteLocation] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables target discovery for the specified locations, when ``setDiscoverTargets`` was set to + ``true``. + + **EXPERIMENTAL** + + :param locations: List of remote locations. + ''' + params: T_JSON_DICT = dict() + params['locations'] = [i.to_json() for i in locations] + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setRemoteLocations', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Target.attachedToTarget') +@dataclass +class AttachedToTarget: + ''' + **EXPERIMENTAL** + + Issued when attached to target because of auto-attach or ``attachToTarget`` command. + ''' + #: Identifier assigned to the session used to send/receive messages. + session_id: SessionID + target_info: TargetInfo + waiting_for_debugger: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttachedToTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + target_info=TargetInfo.from_json(json['targetInfo']), + waiting_for_debugger=bool(json['waitingForDebugger']) + ) + + +@event_class('Target.detachedFromTarget') +@dataclass +class DetachedFromTarget: + ''' + **EXPERIMENTAL** + + 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. + ''' + #: Detached session identifier. + session_id: SessionID + #: Deprecated. + target_id: typing.Optional[TargetID] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DetachedFromTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + target_id=TargetID.from_json(json['targetId']) if 'targetId' in json else None + ) + + +@event_class('Target.receivedMessageFromTarget') +@dataclass +class ReceivedMessageFromTarget: + ''' + Notifies about a new protocol message received from the session (as reported in + ``attachedToTarget`` event). + ''' + #: Identifier of a session which sends a message. + session_id: SessionID + message: str + #: Deprecated. + target_id: typing.Optional[TargetID] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ReceivedMessageFromTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + message=str(json['message']), + target_id=TargetID.from_json(json['targetId']) if 'targetId' in json else None + ) + + +@event_class('Target.targetCreated') +@dataclass +class TargetCreated: + ''' + Issued when a possible inspection target is created. + ''' + target_info: TargetInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetCreated: + return cls( + target_info=TargetInfo.from_json(json['targetInfo']) + ) + + +@event_class('Target.targetDestroyed') +@dataclass +class TargetDestroyed: + ''' + Issued when a target is destroyed. + ''' + target_id: TargetID + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetDestroyed: + return cls( + target_id=TargetID.from_json(json['targetId']) + ) + + +@event_class('Target.targetCrashed') +@dataclass +class TargetCrashed: + ''' + Issued when a target has crashed. + ''' + target_id: TargetID + #: Termination status type. + status: str + #: Termination error code. + error_code: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetCrashed: + return cls( + target_id=TargetID.from_json(json['targetId']), + status=str(json['status']), + error_code=int(json['errorCode']) + ) + + +@event_class('Target.targetInfoChanged') +@dataclass +class TargetInfoChanged: + ''' + Issued when some information about a target has changed. This only happens between + ``targetCreated`` and ``targetDestroyed``. + ''' + target_info: TargetInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetInfoChanged: + return cls( + target_info=TargetInfo.from_json(json['targetInfo']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/tethering.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/tethering.py new file mode 100644 index 0000000..af358ad --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/tethering.py @@ -0,0 +1,63 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Tethering (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +def bind( + port: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Request browser port binding. + + :param port: Port number to bind. + ''' + params: T_JSON_DICT = dict() + params['port'] = port + cmd_dict: T_JSON_DICT = { + 'method': 'Tethering.bind', + 'params': params, + } + json = yield cmd_dict + + +def unbind( + port: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Request browser port unbinding. + + :param port: Port number to unbind. + ''' + params: T_JSON_DICT = dict() + params['port'] = port + cmd_dict: T_JSON_DICT = { + 'method': 'Tethering.unbind', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Tethering.accepted') +@dataclass +class Accepted: + ''' + Informs that port was successfully bound and got a specified connection id. + ''' + #: Port number that was successfully bound. + port: int + #: Connection id to be used. + connection_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> Accepted: + return cls( + port=int(json['port']), + connection_id=str(json['connectionId']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/tracing.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/tracing.py new file mode 100644 index 0000000..9952697 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/tracing.py @@ -0,0 +1,360 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Tracing +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import io + + +class MemoryDumpConfig(dict): + ''' + Configuration for memory dump. Used only when "memory-infra" category is enabled. + ''' + def to_json(self) -> dict: + return self + + @classmethod + def from_json(cls, json: dict) -> MemoryDumpConfig: + return cls(json) + + def __repr__(self): + return 'MemoryDumpConfig({})'.format(super().__repr__()) + + +@dataclass +class TraceConfig: + #: Controls how the trace buffer stores data. + record_mode: typing.Optional[str] = None + + #: Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value + #: of 200 MB would be used. + trace_buffer_size_in_kb: typing.Optional[float] = None + + #: Turns on JavaScript stack sampling. + enable_sampling: typing.Optional[bool] = None + + #: Turns on system tracing. + enable_systrace: typing.Optional[bool] = None + + #: Turns on argument filter. + enable_argument_filter: typing.Optional[bool] = None + + #: Included category filters. + included_categories: typing.Optional[typing.List[str]] = None + + #: Excluded category filters. + excluded_categories: typing.Optional[typing.List[str]] = None + + #: Configuration to synthesize the delays in tracing. + synthetic_delays: typing.Optional[typing.List[str]] = None + + #: Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. + memory_dump_config: typing.Optional[MemoryDumpConfig] = None + + def to_json(self): + json = dict() + if self.record_mode is not None: + json['recordMode'] = self.record_mode + if self.trace_buffer_size_in_kb is not None: + json['traceBufferSizeInKb'] = self.trace_buffer_size_in_kb + if self.enable_sampling is not None: + json['enableSampling'] = self.enable_sampling + if self.enable_systrace is not None: + json['enableSystrace'] = self.enable_systrace + if self.enable_argument_filter is not None: + json['enableArgumentFilter'] = self.enable_argument_filter + if self.included_categories is not None: + json['includedCategories'] = [i for i in self.included_categories] + if self.excluded_categories is not None: + json['excludedCategories'] = [i for i in self.excluded_categories] + if self.synthetic_delays is not None: + json['syntheticDelays'] = [i for i in self.synthetic_delays] + if self.memory_dump_config is not None: + json['memoryDumpConfig'] = self.memory_dump_config.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + record_mode=str(json['recordMode']) if 'recordMode' in json else None, + trace_buffer_size_in_kb=float(json['traceBufferSizeInKb']) if 'traceBufferSizeInKb' in json else None, + enable_sampling=bool(json['enableSampling']) if 'enableSampling' in json else None, + enable_systrace=bool(json['enableSystrace']) if 'enableSystrace' in json else None, + enable_argument_filter=bool(json['enableArgumentFilter']) if 'enableArgumentFilter' in json else None, + included_categories=[str(i) for i in json['includedCategories']] if 'includedCategories' in json else None, + excluded_categories=[str(i) for i in json['excludedCategories']] if 'excludedCategories' in json else None, + synthetic_delays=[str(i) for i in json['syntheticDelays']] if 'syntheticDelays' in json else None, + memory_dump_config=MemoryDumpConfig.from_json(json['memoryDumpConfig']) if 'memoryDumpConfig' in json else None, + ) + + +class StreamFormat(enum.Enum): + ''' + 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. + ''' + JSON = "json" + PROTO = "proto" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class StreamCompression(enum.Enum): + ''' + Compression type to use for traces returned via streams. + ''' + NONE = "none" + GZIP = "gzip" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class MemoryDumpLevelOfDetail(enum.Enum): + ''' + Details exposed when memory request explicitly declared. + Keep consistent with memory_dump_request_args.h and + memory_instrumentation.mojom + ''' + BACKGROUND = "background" + LIGHT = "light" + DETAILED = "detailed" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class TracingBackend(enum.Enum): + ''' + 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``. + ''' + AUTO = "auto" + CHROME = "chrome" + SYSTEM = "system" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def end() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Stop trace events collection. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.end', + } + json = yield cmd_dict + + +def get_categories() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Gets supported tracing categories. + + **EXPERIMENTAL** + + :returns: A list of supported tracing categories. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.getCategories', + } + json = yield cmd_dict + return [str(i) for i in json['categories']] + + +def record_clock_sync_marker( + sync_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Record a clock sync marker in the trace. + + **EXPERIMENTAL** + + :param sync_id: The ID of this clock sync marker + ''' + params: T_JSON_DICT = dict() + params['syncId'] = sync_id + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.recordClockSyncMarker', + 'params': params, + } + json = yield cmd_dict + + +def request_memory_dump( + deterministic: typing.Optional[bool] = None, + level_of_detail: typing.Optional[MemoryDumpLevelOfDetail] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[str, bool]]: + ''' + Request a global memory dump. + + **EXPERIMENTAL** + + :param deterministic: *(Optional)* Enables more deterministic results by forcing garbage collection + :param level_of_detail: *(Optional)* Specifies level of details in memory dump. Defaults to "detailed". + :returns: A tuple with the following items: + + 0. **dumpGuid** - GUID of the resulting global memory dump. + 1. **success** - True iff the global memory dump succeeded. + ''' + params: T_JSON_DICT = dict() + if deterministic is not None: + params['deterministic'] = deterministic + if level_of_detail is not None: + params['levelOfDetail'] = level_of_detail.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.requestMemoryDump', + 'params': params, + } + json = yield cmd_dict + return ( + str(json['dumpGuid']), + bool(json['success']) + ) + + +def start( + categories: typing.Optional[str] = None, + options: typing.Optional[str] = None, + buffer_usage_reporting_interval: typing.Optional[float] = None, + transfer_mode: typing.Optional[str] = None, + stream_format: typing.Optional[StreamFormat] = None, + stream_compression: typing.Optional[StreamCompression] = None, + trace_config: typing.Optional[TraceConfig] = None, + perfetto_config: typing.Optional[str] = None, + tracing_backend: typing.Optional[TracingBackend] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Start trace events collection. + + :param categories: **(EXPERIMENTAL)** *(Optional)* Category/tag filter + :param options: **(EXPERIMENTAL)** *(Optional)* Tracing options + :param buffer_usage_reporting_interval: **(EXPERIMENTAL)** *(Optional)* If set, the agent will issue bufferUsage events at this interval, specified in milliseconds + :param transfer_mode: *(Optional)* Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ```ReportEvents````). + :param stream_format: *(Optional)* Trace data format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````json````). + :param stream_compression: **(EXPERIMENTAL)** *(Optional)* Compression format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````none````) + :param trace_config: *(Optional)* + :param perfetto_config: **(EXPERIMENTAL)** *(Optional)* Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters ````categories````, ````options````, ````traceConfig```` are ignored. + :param tracing_backend: **(EXPERIMENTAL)** *(Optional)* Backend type (defaults to ````auto```) + ''' + params: T_JSON_DICT = dict() + if categories is not None: + params['categories'] = categories + if options is not None: + params['options'] = options + if buffer_usage_reporting_interval is not None: + params['bufferUsageReportingInterval'] = buffer_usage_reporting_interval + if transfer_mode is not None: + params['transferMode'] = transfer_mode + if stream_format is not None: + params['streamFormat'] = stream_format.to_json() + if stream_compression is not None: + params['streamCompression'] = stream_compression.to_json() + if trace_config is not None: + params['traceConfig'] = trace_config.to_json() + if perfetto_config is not None: + params['perfettoConfig'] = perfetto_config + if tracing_backend is not None: + params['tracingBackend'] = tracing_backend.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.start', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Tracing.bufferUsage') +@dataclass +class BufferUsage: + ''' + **EXPERIMENTAL** + + + ''' + #: A number in range [0..1] that indicates the used size of event buffer as a fraction of its + #: total size. + percent_full: typing.Optional[float] + #: An approximate number of events in the trace log. + event_count: typing.Optional[float] + #: A number in range [0..1] that indicates the used size of event buffer as a fraction of its + #: total size. + value: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> BufferUsage: + return cls( + percent_full=float(json['percentFull']) if 'percentFull' in json else None, + event_count=float(json['eventCount']) if 'eventCount' in json else None, + value=float(json['value']) if 'value' in json else None + ) + + +@event_class('Tracing.dataCollected') +@dataclass +class DataCollected: + ''' + **EXPERIMENTAL** + + 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. + ''' + value: typing.List[dict] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DataCollected: + return cls( + value=[dict(i) for i in json['value']] + ) + + +@event_class('Tracing.tracingComplete') +@dataclass +class TracingComplete: + ''' + Signals that tracing is stopped and there is no trace buffers pending flush, all data were + delivered via dataCollected events. + ''' + #: Indicates whether some trace data is known to have been lost, e.g. because the trace ring + #: buffer wrapped around. + data_loss_occurred: bool + #: A handle of the stream that holds resulting trace data. + stream: typing.Optional[io.StreamHandle] + #: Trace data format of returned stream. + trace_format: typing.Optional[StreamFormat] + #: Compression format of returned stream. + stream_compression: typing.Optional[StreamCompression] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TracingComplete: + return cls( + data_loss_occurred=bool(json['dataLossOccurred']), + stream=io.StreamHandle.from_json(json['stream']) if 'stream' in json else None, + trace_format=StreamFormat.from_json(json['traceFormat']) if 'traceFormat' in json else None, + stream_compression=StreamCompression.from_json(json['streamCompression']) if 'streamCompression' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/util.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/util.py new file mode 100644 index 0000000..93a39ef --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/util.py @@ -0,0 +1,20 @@ + +import typing + + +T_JSON_DICT = typing.Dict[str, typing.Any] +_event_parsers = dict() + + +def event_class(method): + ''' A decorator that registers a class as an event class. ''' + def decorate(cls): + _event_parsers[method] = cls + cls.event_class = method + return cls + return decorate + + +def parse_json_event(json: T_JSON_DICT) -> typing.Any: + ''' Parse a JSON dictionary into a CDP event. ''' + return _event_parsers[json['method']].from_json(json['params']) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/web_audio.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/web_audio.py new file mode 100644 index 0000000..7e9c1c4 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/web_audio.py @@ -0,0 +1,604 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: WebAudio (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class GraphObjectId(str): + ''' + An unique ID for a graph object (AudioContext, AudioNode, AudioParam) in Web Audio API + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> GraphObjectId: + return cls(json) + + def __repr__(self): + return 'GraphObjectId({})'.format(super().__repr__()) + + +class ContextType(enum.Enum): + ''' + Enum of BaseAudioContext types + ''' + REALTIME = "realtime" + OFFLINE = "offline" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ContextState(enum.Enum): + ''' + Enum of AudioContextState from the spec + ''' + SUSPENDED = "suspended" + RUNNING = "running" + CLOSED = "closed" + INTERRUPTED = "interrupted" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class NodeType(str): + ''' + Enum of AudioNode types + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> NodeType: + return cls(json) + + def __repr__(self): + return 'NodeType({})'.format(super().__repr__()) + + +class ChannelCountMode(enum.Enum): + ''' + Enum of AudioNode::ChannelCountMode from the spec + ''' + CLAMPED_MAX = "clamped-max" + EXPLICIT = "explicit" + MAX_ = "max" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ChannelInterpretation(enum.Enum): + ''' + Enum of AudioNode::ChannelInterpretation from the spec + ''' + DISCRETE = "discrete" + SPEAKERS = "speakers" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ParamType(str): + ''' + Enum of AudioParam types + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> ParamType: + return cls(json) + + def __repr__(self): + return 'ParamType({})'.format(super().__repr__()) + + +class AutomationRate(enum.Enum): + ''' + Enum of AudioParam::AutomationRate from the spec + ''' + A_RATE = "a-rate" + K_RATE = "k-rate" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ContextRealtimeData: + ''' + Fields in AudioContext that change in real-time. + ''' + #: The current context time in second in BaseAudioContext. + current_time: float + + #: 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. + render_capacity: float + + #: A running mean of callback interval. + callback_interval_mean: float + + #: A running variance of callback interval. + callback_interval_variance: float + + def to_json(self): + json = dict() + json['currentTime'] = self.current_time + json['renderCapacity'] = self.render_capacity + json['callbackIntervalMean'] = self.callback_interval_mean + json['callbackIntervalVariance'] = self.callback_interval_variance + return json + + @classmethod + def from_json(cls, json): + return cls( + current_time=float(json['currentTime']), + render_capacity=float(json['renderCapacity']), + callback_interval_mean=float(json['callbackIntervalMean']), + callback_interval_variance=float(json['callbackIntervalVariance']), + ) + + +@dataclass +class BaseAudioContext: + ''' + Protocol object for BaseAudioContext + ''' + context_id: GraphObjectId + + context_type: ContextType + + context_state: ContextState + + #: Platform-dependent callback buffer size. + callback_buffer_size: float + + #: Number of output channels supported by audio hardware in use. + max_output_channel_count: float + + #: Context sample rate. + sample_rate: float + + realtime_data: typing.Optional[ContextRealtimeData] = None + + def to_json(self): + json = dict() + json['contextId'] = self.context_id.to_json() + json['contextType'] = self.context_type.to_json() + json['contextState'] = self.context_state.to_json() + json['callbackBufferSize'] = self.callback_buffer_size + json['maxOutputChannelCount'] = self.max_output_channel_count + json['sampleRate'] = self.sample_rate + if self.realtime_data is not None: + json['realtimeData'] = self.realtime_data.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + context_type=ContextType.from_json(json['contextType']), + context_state=ContextState.from_json(json['contextState']), + callback_buffer_size=float(json['callbackBufferSize']), + max_output_channel_count=float(json['maxOutputChannelCount']), + sample_rate=float(json['sampleRate']), + realtime_data=ContextRealtimeData.from_json(json['realtimeData']) if 'realtimeData' in json else None, + ) + + +@dataclass +class AudioListener: + ''' + Protocol object for AudioListener + ''' + listener_id: GraphObjectId + + context_id: GraphObjectId + + def to_json(self): + json = dict() + json['listenerId'] = self.listener_id.to_json() + json['contextId'] = self.context_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + listener_id=GraphObjectId.from_json(json['listenerId']), + context_id=GraphObjectId.from_json(json['contextId']), + ) + + +@dataclass +class AudioNode: + ''' + Protocol object for AudioNode + ''' + node_id: GraphObjectId + + context_id: GraphObjectId + + node_type: NodeType + + number_of_inputs: float + + number_of_outputs: float + + channel_count: float + + channel_count_mode: ChannelCountMode + + channel_interpretation: ChannelInterpretation + + def to_json(self): + json = dict() + json['nodeId'] = self.node_id.to_json() + json['contextId'] = self.context_id.to_json() + json['nodeType'] = self.node_type.to_json() + json['numberOfInputs'] = self.number_of_inputs + json['numberOfOutputs'] = self.number_of_outputs + json['channelCount'] = self.channel_count + json['channelCountMode'] = self.channel_count_mode.to_json() + json['channelInterpretation'] = self.channel_interpretation.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + node_id=GraphObjectId.from_json(json['nodeId']), + context_id=GraphObjectId.from_json(json['contextId']), + node_type=NodeType.from_json(json['nodeType']), + number_of_inputs=float(json['numberOfInputs']), + number_of_outputs=float(json['numberOfOutputs']), + channel_count=float(json['channelCount']), + channel_count_mode=ChannelCountMode.from_json(json['channelCountMode']), + channel_interpretation=ChannelInterpretation.from_json(json['channelInterpretation']), + ) + + +@dataclass +class AudioParam: + ''' + Protocol object for AudioParam + ''' + param_id: GraphObjectId + + node_id: GraphObjectId + + context_id: GraphObjectId + + param_type: ParamType + + rate: AutomationRate + + default_value: float + + min_value: float + + max_value: float + + def to_json(self): + json = dict() + json['paramId'] = self.param_id.to_json() + json['nodeId'] = self.node_id.to_json() + json['contextId'] = self.context_id.to_json() + json['paramType'] = self.param_type.to_json() + json['rate'] = self.rate.to_json() + json['defaultValue'] = self.default_value + json['minValue'] = self.min_value + json['maxValue'] = self.max_value + return json + + @classmethod + def from_json(cls, json): + return cls( + param_id=GraphObjectId.from_json(json['paramId']), + node_id=GraphObjectId.from_json(json['nodeId']), + context_id=GraphObjectId.from_json(json['contextId']), + param_type=ParamType.from_json(json['paramType']), + rate=AutomationRate.from_json(json['rate']), + default_value=float(json['defaultValue']), + min_value=float(json['minValue']), + max_value=float(json['maxValue']), + ) + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables the WebAudio domain and starts sending context lifetime events. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.enable', + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables the WebAudio domain. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.disable', + } + json = yield cmd_dict + + +def get_realtime_data( + context_id: GraphObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,ContextRealtimeData]: + ''' + Fetch the realtime data from the registered contexts. + + :param context_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['contextId'] = context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.getRealtimeData', + 'params': params, + } + json = yield cmd_dict + return ContextRealtimeData.from_json(json['realtimeData']) + + +@event_class('WebAudio.contextCreated') +@dataclass +class ContextCreated: + ''' + Notifies that a new BaseAudioContext has been created. + ''' + context: BaseAudioContext + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextCreated: + return cls( + context=BaseAudioContext.from_json(json['context']) + ) + + +@event_class('WebAudio.contextWillBeDestroyed') +@dataclass +class ContextWillBeDestroyed: + ''' + Notifies that an existing BaseAudioContext will be destroyed. + ''' + context_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']) + ) + + +@event_class('WebAudio.contextChanged') +@dataclass +class ContextChanged: + ''' + Notifies that existing BaseAudioContext has changed some properties (id stays the same).. + ''' + context: BaseAudioContext + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextChanged: + return cls( + context=BaseAudioContext.from_json(json['context']) + ) + + +@event_class('WebAudio.audioListenerCreated') +@dataclass +class AudioListenerCreated: + ''' + Notifies that the construction of an AudioListener has finished. + ''' + listener: AudioListener + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioListenerCreated: + return cls( + listener=AudioListener.from_json(json['listener']) + ) + + +@event_class('WebAudio.audioListenerWillBeDestroyed') +@dataclass +class AudioListenerWillBeDestroyed: + ''' + Notifies that a new AudioListener has been created. + ''' + context_id: GraphObjectId + listener_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioListenerWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + listener_id=GraphObjectId.from_json(json['listenerId']) + ) + + +@event_class('WebAudio.audioNodeCreated') +@dataclass +class AudioNodeCreated: + ''' + Notifies that a new AudioNode has been created. + ''' + node: AudioNode + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioNodeCreated: + return cls( + node=AudioNode.from_json(json['node']) + ) + + +@event_class('WebAudio.audioNodeWillBeDestroyed') +@dataclass +class AudioNodeWillBeDestroyed: + ''' + Notifies that an existing AudioNode has been destroyed. + ''' + context_id: GraphObjectId + node_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioNodeWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + node_id=GraphObjectId.from_json(json['nodeId']) + ) + + +@event_class('WebAudio.audioParamCreated') +@dataclass +class AudioParamCreated: + ''' + Notifies that a new AudioParam has been created. + ''' + param: AudioParam + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioParamCreated: + return cls( + param=AudioParam.from_json(json['param']) + ) + + +@event_class('WebAudio.audioParamWillBeDestroyed') +@dataclass +class AudioParamWillBeDestroyed: + ''' + Notifies that an existing AudioParam has been destroyed. + ''' + context_id: GraphObjectId + node_id: GraphObjectId + param_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioParamWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + node_id=GraphObjectId.from_json(json['nodeId']), + param_id=GraphObjectId.from_json(json['paramId']) + ) + + +@event_class('WebAudio.nodesConnected') +@dataclass +class NodesConnected: + ''' + Notifies that two AudioNodes are connected. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + destination_input_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodesConnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None, + destination_input_index=float(json['destinationInputIndex']) if 'destinationInputIndex' in json else None + ) + + +@event_class('WebAudio.nodesDisconnected') +@dataclass +class NodesDisconnected: + ''' + Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + destination_input_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodesDisconnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None, + destination_input_index=float(json['destinationInputIndex']) if 'destinationInputIndex' in json else None + ) + + +@event_class('WebAudio.nodeParamConnected') +@dataclass +class NodeParamConnected: + ''' + Notifies that an AudioNode is connected to an AudioParam. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodeParamConnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None + ) + + +@event_class('WebAudio.nodeParamDisconnected') +@dataclass +class NodeParamDisconnected: + ''' + Notifies that an AudioNode is disconnected to an AudioParam. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodeParamDisconnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v133/web_authn.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/web_authn.py new file mode 100644 index 0000000..c577b6e --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v133/web_authn.py @@ -0,0 +1,579 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: WebAuthn (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class AuthenticatorId(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> AuthenticatorId: + return cls(json) + + def __repr__(self): + return 'AuthenticatorId({})'.format(super().__repr__()) + + +class AuthenticatorProtocol(enum.Enum): + U2F = "u2f" + CTAP2 = "ctap2" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class Ctap2Version(enum.Enum): + CTAP2_0 = "ctap2_0" + CTAP2_1 = "ctap2_1" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AuthenticatorTransport(enum.Enum): + USB = "usb" + NFC = "nfc" + BLE = "ble" + CABLE = "cable" + INTERNAL = "internal" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class VirtualAuthenticatorOptions: + protocol: AuthenticatorProtocol + + transport: AuthenticatorTransport + + #: Defaults to ctap2_0. Ignored if ``protocol`` == u2f. + ctap2_version: typing.Optional[Ctap2Version] = None + + #: Defaults to false. + has_resident_key: typing.Optional[bool] = None + + #: Defaults to false. + has_user_verification: typing.Optional[bool] = None + + #: If set to true, the authenticator will support the largeBlob extension. + #: https://w3c.github.io/webauthn#largeBlob + #: Defaults to false. + has_large_blob: typing.Optional[bool] = None + + #: 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. + has_cred_blob: typing.Optional[bool] = None + + #: 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. + has_min_pin_length: typing.Optional[bool] = None + + #: If set to true, the authenticator will support the prf extension. + #: https://w3c.github.io/webauthn/#prf-extension + #: Defaults to false. + has_prf: typing.Optional[bool] = None + + #: If set to true, tests of user presence will succeed immediately. + #: Otherwise, they will not be resolved. Defaults to true. + automatic_presence_simulation: typing.Optional[bool] = None + + #: Sets whether User Verification succeeds or fails for an authenticator. + #: Defaults to false. + is_user_verified: typing.Optional[bool] = None + + #: 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 + default_backup_eligibility: typing.Optional[bool] = None + + #: 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 + default_backup_state: typing.Optional[bool] = None + + def to_json(self): + json = dict() + json['protocol'] = self.protocol.to_json() + json['transport'] = self.transport.to_json() + if self.ctap2_version is not None: + json['ctap2Version'] = self.ctap2_version.to_json() + if self.has_resident_key is not None: + json['hasResidentKey'] = self.has_resident_key + if self.has_user_verification is not None: + json['hasUserVerification'] = self.has_user_verification + if self.has_large_blob is not None: + json['hasLargeBlob'] = self.has_large_blob + if self.has_cred_blob is not None: + json['hasCredBlob'] = self.has_cred_blob + if self.has_min_pin_length is not None: + json['hasMinPinLength'] = self.has_min_pin_length + if self.has_prf is not None: + json['hasPrf'] = self.has_prf + if self.automatic_presence_simulation is not None: + json['automaticPresenceSimulation'] = self.automatic_presence_simulation + if self.is_user_verified is not None: + json['isUserVerified'] = self.is_user_verified + if self.default_backup_eligibility is not None: + json['defaultBackupEligibility'] = self.default_backup_eligibility + if self.default_backup_state is not None: + json['defaultBackupState'] = self.default_backup_state + return json + + @classmethod + def from_json(cls, json): + return cls( + protocol=AuthenticatorProtocol.from_json(json['protocol']), + transport=AuthenticatorTransport.from_json(json['transport']), + ctap2_version=Ctap2Version.from_json(json['ctap2Version']) if 'ctap2Version' in json else None, + has_resident_key=bool(json['hasResidentKey']) if 'hasResidentKey' in json else None, + has_user_verification=bool(json['hasUserVerification']) if 'hasUserVerification' in json else None, + has_large_blob=bool(json['hasLargeBlob']) if 'hasLargeBlob' in json else None, + has_cred_blob=bool(json['hasCredBlob']) if 'hasCredBlob' in json else None, + has_min_pin_length=bool(json['hasMinPinLength']) if 'hasMinPinLength' in json else None, + has_prf=bool(json['hasPrf']) if 'hasPrf' in json else None, + automatic_presence_simulation=bool(json['automaticPresenceSimulation']) if 'automaticPresenceSimulation' in json else None, + is_user_verified=bool(json['isUserVerified']) if 'isUserVerified' in json else None, + default_backup_eligibility=bool(json['defaultBackupEligibility']) if 'defaultBackupEligibility' in json else None, + default_backup_state=bool(json['defaultBackupState']) if 'defaultBackupState' in json else None, + ) + + +@dataclass +class Credential: + credential_id: str + + is_resident_credential: bool + + #: The ECDSA P-256 private key in PKCS#8 format. + private_key: str + + #: Signature counter. This is incremented by one for each successful + #: assertion. + #: See https://w3c.github.io/webauthn/#signature-counter + sign_count: int + + #: Relying Party ID the credential is scoped to. Must be set when adding a + #: credential. + rp_id: typing.Optional[str] = None + + #: An opaque byte sequence with a maximum size of 64 bytes mapping the + #: credential to a specific user. + user_handle: typing.Optional[str] = None + + #: The large blob associated with the credential. + #: See https://w3c.github.io/webauthn/#sctn-large-blob-extension + large_blob: typing.Optional[str] = None + + #: Assertions returned by this credential will have the backup eligibility + #: (BE) flag set to this value. Defaults to the authenticator's + #: defaultBackupEligibility value. + backup_eligibility: typing.Optional[bool] = None + + #: Assertions returned by this credential will have the backup state (BS) + #: flag set to this value. Defaults to the authenticator's + #: defaultBackupState value. + backup_state: typing.Optional[bool] = None + + #: The credential's user.name property. Equivalent to empty if not set. + #: https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name + user_name: typing.Optional[str] = None + + #: The credential's user.displayName property. Equivalent to empty if + #: not set. + #: https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname + user_display_name: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['credentialId'] = self.credential_id + json['isResidentCredential'] = self.is_resident_credential + json['privateKey'] = self.private_key + json['signCount'] = self.sign_count + if self.rp_id is not None: + json['rpId'] = self.rp_id + if self.user_handle is not None: + json['userHandle'] = self.user_handle + if self.large_blob is not None: + json['largeBlob'] = self.large_blob + if self.backup_eligibility is not None: + json['backupEligibility'] = self.backup_eligibility + if self.backup_state is not None: + json['backupState'] = self.backup_state + if self.user_name is not None: + json['userName'] = self.user_name + if self.user_display_name is not None: + json['userDisplayName'] = self.user_display_name + return json + + @classmethod + def from_json(cls, json): + return cls( + credential_id=str(json['credentialId']), + is_resident_credential=bool(json['isResidentCredential']), + private_key=str(json['privateKey']), + sign_count=int(json['signCount']), + rp_id=str(json['rpId']) if 'rpId' in json else None, + user_handle=str(json['userHandle']) if 'userHandle' in json else None, + large_blob=str(json['largeBlob']) if 'largeBlob' in json else None, + backup_eligibility=bool(json['backupEligibility']) if 'backupEligibility' in json else None, + backup_state=bool(json['backupState']) if 'backupState' in json else None, + user_name=str(json['userName']) if 'userName' in json else None, + user_display_name=str(json['userDisplayName']) if 'userDisplayName' in json else None, + ) + + +def enable( + enable_ui: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable the WebAuthn domain and start intercepting credential storage and + retrieval with a virtual authenticator. + + :param enable_ui: *(Optional)* Whether to enable the WebAuthn user interface. Enabling the UI is recommended for debugging and demo purposes, as it is closer to the real experience. Disabling the UI is recommended for automated testing. Supported at the embedder's discretion if UI is available. Defaults to false. + ''' + params: T_JSON_DICT = dict() + if enable_ui is not None: + params['enableUI'] = enable_ui + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.enable', + 'params': params, + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disable the WebAuthn domain. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.disable', + } + json = yield cmd_dict + + +def add_virtual_authenticator( + options: VirtualAuthenticatorOptions + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,AuthenticatorId]: + ''' + Creates and adds a virtual authenticator. + + :param options: + :returns: + ''' + params: T_JSON_DICT = dict() + params['options'] = options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.addVirtualAuthenticator', + 'params': params, + } + json = yield cmd_dict + return AuthenticatorId.from_json(json['authenticatorId']) + + +def set_response_override_bits( + authenticator_id: AuthenticatorId, + is_bogus_signature: typing.Optional[bool] = None, + is_bad_uv: typing.Optional[bool] = None, + is_bad_up: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present. + + :param authenticator_id: + :param is_bogus_signature: *(Optional)* If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false. + :param is_bad_uv: *(Optional)* If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false. + :param is_bad_up: *(Optional)* If isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false. + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + if is_bogus_signature is not None: + params['isBogusSignature'] = is_bogus_signature + if is_bad_uv is not None: + params['isBadUV'] = is_bad_uv + if is_bad_up is not None: + params['isBadUP'] = is_bad_up + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setResponseOverrideBits', + 'params': params, + } + json = yield cmd_dict + + +def remove_virtual_authenticator( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Removes the given authenticator. + + :param authenticator_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.removeVirtualAuthenticator', + 'params': params, + } + json = yield cmd_dict + + +def add_credential( + authenticator_id: AuthenticatorId, + credential: Credential + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Adds the credential to the specified authenticator. + + :param authenticator_id: + :param credential: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credential'] = credential.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.addCredential', + 'params': params, + } + json = yield cmd_dict + + +def get_credential( + authenticator_id: AuthenticatorId, + credential_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,Credential]: + ''' + Returns a single credential stored in the given virtual authenticator that + matches the credential ID. + + :param authenticator_id: + :param credential_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.getCredential', + 'params': params, + } + json = yield cmd_dict + return Credential.from_json(json['credential']) + + +def get_credentials( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Credential]]: + ''' + Returns all the credentials stored in the given virtual authenticator. + + :param authenticator_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.getCredentials', + 'params': params, + } + json = yield cmd_dict + return [Credential.from_json(i) for i in json['credentials']] + + +def remove_credential( + authenticator_id: AuthenticatorId, + credential_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Removes a credential from the authenticator. + + :param authenticator_id: + :param credential_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.removeCredential', + 'params': params, + } + json = yield cmd_dict + + +def clear_credentials( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears all the credentials from the specified device. + + :param authenticator_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.clearCredentials', + 'params': params, + } + json = yield cmd_dict + + +def set_user_verified( + authenticator_id: AuthenticatorId, + is_user_verified: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets whether User Verification succeeds or fails for an authenticator. + The default is true. + + :param authenticator_id: + :param is_user_verified: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['isUserVerified'] = is_user_verified + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setUserVerified', + 'params': params, + } + json = yield cmd_dict + + +def set_automatic_presence_simulation( + authenticator_id: AuthenticatorId, + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. + The default is true. + + :param authenticator_id: + :param enabled: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setAutomaticPresenceSimulation', + 'params': params, + } + json = yield cmd_dict + + +def set_credential_properties( + authenticator_id: AuthenticatorId, + credential_id: str, + backup_eligibility: typing.Optional[bool] = None, + backup_state: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Allows setting credential properties. + https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties + + :param authenticator_id: + :param credential_id: + :param backup_eligibility: *(Optional)* + :param backup_state: *(Optional)* + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + if backup_eligibility is not None: + params['backupEligibility'] = backup_eligibility + if backup_state is not None: + params['backupState'] = backup_state + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setCredentialProperties', + 'params': params, + } + json = yield cmd_dict + + +@event_class('WebAuthn.credentialAdded') +@dataclass +class CredentialAdded: + ''' + Triggered when a credential is added to an authenticator. + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialAdded: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) + + +@event_class('WebAuthn.credentialDeleted') +@dataclass +class CredentialDeleted: + ''' + Triggered when a credential is deleted, e.g. through + PublicKeyCredential.signalUnknownCredential(). + ''' + authenticator_id: AuthenticatorId + credential_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialDeleted: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential_id=str(json['credentialId']) + ) + + +@event_class('WebAuthn.credentialUpdated') +@dataclass +class CredentialUpdated: + ''' + Triggered when a credential is updated, e.g. through + PublicKeyCredential.signalCurrentUserDetails(). + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialUpdated: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) + + +@event_class('WebAuthn.credentialAsserted') +@dataclass +class CredentialAsserted: + ''' + Triggered when a credential is used in a webauthn assertion. + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialAsserted: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/__init__.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/__init__.py new file mode 100644 index 0000000..281cca8 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/__init__.py @@ -0,0 +1,59 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +from . import accessibility +from . import animation +from . import audits +from . import autofill +from . import background_service +from . import bluetooth_emulation +from . import browser +from . import css +from . import cache_storage +from . import cast +from . import console +from . import dom +from . import dom_debugger +from . import dom_snapshot +from . import dom_storage +from . import debugger +from . import device_access +from . import device_orientation +from . import emulation +from . import event_breakpoints +from . import extensions +from . import fed_cm +from . import fetch +from . import file_system +from . import headless_experimental +from . import heap_profiler +from . import io +from . import indexed_db +from . import input_ +from . import inspector +from . import layer_tree +from . import log +from . import media +from . import memory +from . import network +from . import overlay +from . import pwa +from . import page +from . import performance +from . import performance_timeline +from . import preload +from . import profiler +from . import runtime +from . import schema +from . import security +from . import service_worker +from . import storage +from . import system_info +from . import target +from . import tethering +from . import tracing +from . import web_audio +from . import web_authn +from . import util + diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/accessibility.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/accessibility.py new file mode 100644 index 0000000..7c4bd0a --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/accessibility.py @@ -0,0 +1,648 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Accessibility (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import dom +from . import page +from . import runtime + + +class AXNodeId(str): + ''' + Unique accessibility node identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> AXNodeId: + return cls(json) + + def __repr__(self): + return 'AXNodeId({})'.format(super().__repr__()) + + +class AXValueType(enum.Enum): + ''' + Enum of possible property types. + ''' + BOOLEAN = "boolean" + TRISTATE = "tristate" + BOOLEAN_OR_UNDEFINED = "booleanOrUndefined" + IDREF = "idref" + IDREF_LIST = "idrefList" + INTEGER = "integer" + NODE = "node" + NODE_LIST = "nodeList" + NUMBER = "number" + STRING = "string" + COMPUTED_STRING = "computedString" + TOKEN = "token" + TOKEN_LIST = "tokenList" + DOM_RELATION = "domRelation" + ROLE = "role" + INTERNAL_ROLE = "internalRole" + VALUE_UNDEFINED = "valueUndefined" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AXValueSourceType(enum.Enum): + ''' + Enum of possible property sources. + ''' + ATTRIBUTE = "attribute" + IMPLICIT = "implicit" + STYLE = "style" + CONTENTS = "contents" + PLACEHOLDER = "placeholder" + RELATED_ELEMENT = "relatedElement" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AXValueNativeSourceType(enum.Enum): + ''' + Enum of possible native property sources (as a subtype of a particular AXValueSourceType). + ''' + DESCRIPTION = "description" + FIGCAPTION = "figcaption" + LABEL = "label" + LABELFOR = "labelfor" + LABELWRAPPED = "labelwrapped" + LEGEND = "legend" + RUBYANNOTATION = "rubyannotation" + TABLECAPTION = "tablecaption" + TITLE = "title" + OTHER = "other" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class AXValueSource: + ''' + A single source for a computed AX property. + ''' + #: What type of source this is. + type_: AXValueSourceType + + #: The value of this property source. + value: typing.Optional[AXValue] = None + + #: The name of the relevant attribute, if any. + attribute: typing.Optional[str] = None + + #: The value of the relevant attribute, if any. + attribute_value: typing.Optional[AXValue] = None + + #: Whether this source is superseded by a higher priority source. + superseded: typing.Optional[bool] = None + + #: The native markup source for this value, e.g. a `` or 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. + ''' + key: PreloadingAttemptKey + + rule_set_ids: typing.List[RuleSetId] + + node_ids: typing.List[dom.BackendNodeId] + + def to_json(self): + json = dict() + json['key'] = self.key.to_json() + json['ruleSetIds'] = [i.to_json() for i in self.rule_set_ids] + json['nodeIds'] = [i.to_json() for i in self.node_ids] + return json + + @classmethod + def from_json(cls, json): + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + rule_set_ids=[RuleSetId.from_json(i) for i in json['ruleSetIds']], + node_ids=[dom.BackendNodeId.from_json(i) for i in json['nodeIds']], + ) + + +class PreloadPipelineId(str): + ''' + Chrome manages different types of preloads together using a + concept of preloading pipeline. For example, if a site uses a + SpeculationRules for prerender, Chrome first starts a prefetch and + then upgrades it to prerender. + + CDP events for them are emitted separately but they share + ``PreloadPipelineId``. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> PreloadPipelineId: + return cls(json) + + def __repr__(self): + return 'PreloadPipelineId({})'.format(super().__repr__()) + + +class PrerenderFinalStatus(enum.Enum): + ''' + List of FinalStatus reasons for Prerender2. + ''' + ACTIVATED = "Activated" + DESTROYED = "Destroyed" + LOW_END_DEVICE = "LowEndDevice" + INVALID_SCHEME_REDIRECT = "InvalidSchemeRedirect" + INVALID_SCHEME_NAVIGATION = "InvalidSchemeNavigation" + NAVIGATION_REQUEST_BLOCKED_BY_CSP = "NavigationRequestBlockedByCsp" + MAIN_FRAME_NAVIGATION = "MainFrameNavigation" + MOJO_BINDER_POLICY = "MojoBinderPolicy" + RENDERER_PROCESS_CRASHED = "RendererProcessCrashed" + RENDERER_PROCESS_KILLED = "RendererProcessKilled" + DOWNLOAD = "Download" + TRIGGER_DESTROYED = "TriggerDestroyed" + NAVIGATION_NOT_COMMITTED = "NavigationNotCommitted" + NAVIGATION_BAD_HTTP_STATUS = "NavigationBadHttpStatus" + CLIENT_CERT_REQUESTED = "ClientCertRequested" + NAVIGATION_REQUEST_NETWORK_ERROR = "NavigationRequestNetworkError" + CANCEL_ALL_HOSTS_FOR_TESTING = "CancelAllHostsForTesting" + DID_FAIL_LOAD = "DidFailLoad" + STOP = "Stop" + SSL_CERTIFICATE_ERROR = "SslCertificateError" + LOGIN_AUTH_REQUESTED = "LoginAuthRequested" + UA_CHANGE_REQUIRES_RELOAD = "UaChangeRequiresReload" + BLOCKED_BY_CLIENT = "BlockedByClient" + AUDIO_OUTPUT_DEVICE_REQUESTED = "AudioOutputDeviceRequested" + MIXED_CONTENT = "MixedContent" + TRIGGER_BACKGROUNDED = "TriggerBackgrounded" + MEMORY_LIMIT_EXCEEDED = "MemoryLimitExceeded" + DATA_SAVER_ENABLED = "DataSaverEnabled" + TRIGGER_URL_HAS_EFFECTIVE_URL = "TriggerUrlHasEffectiveUrl" + ACTIVATED_BEFORE_STARTED = "ActivatedBeforeStarted" + INACTIVE_PAGE_RESTRICTION = "InactivePageRestriction" + START_FAILED = "StartFailed" + TIMEOUT_BACKGROUNDED = "TimeoutBackgrounded" + CROSS_SITE_REDIRECT_IN_INITIAL_NAVIGATION = "CrossSiteRedirectInInitialNavigation" + CROSS_SITE_NAVIGATION_IN_INITIAL_NAVIGATION = "CrossSiteNavigationInInitialNavigation" + SAME_SITE_CROSS_ORIGIN_REDIRECT_NOT_OPT_IN_IN_INITIAL_NAVIGATION = "SameSiteCrossOriginRedirectNotOptInInInitialNavigation" + SAME_SITE_CROSS_ORIGIN_NAVIGATION_NOT_OPT_IN_IN_INITIAL_NAVIGATION = "SameSiteCrossOriginNavigationNotOptInInInitialNavigation" + ACTIVATION_NAVIGATION_PARAMETER_MISMATCH = "ActivationNavigationParameterMismatch" + ACTIVATED_IN_BACKGROUND = "ActivatedInBackground" + EMBEDDER_HOST_DISALLOWED = "EmbedderHostDisallowed" + ACTIVATION_NAVIGATION_DESTROYED_BEFORE_SUCCESS = "ActivationNavigationDestroyedBeforeSuccess" + TAB_CLOSED_BY_USER_GESTURE = "TabClosedByUserGesture" + TAB_CLOSED_WITHOUT_USER_GESTURE = "TabClosedWithoutUserGesture" + PRIMARY_MAIN_FRAME_RENDERER_PROCESS_CRASHED = "PrimaryMainFrameRendererProcessCrashed" + PRIMARY_MAIN_FRAME_RENDERER_PROCESS_KILLED = "PrimaryMainFrameRendererProcessKilled" + ACTIVATION_FRAME_POLICY_NOT_COMPATIBLE = "ActivationFramePolicyNotCompatible" + PRELOADING_DISABLED = "PreloadingDisabled" + BATTERY_SAVER_ENABLED = "BatterySaverEnabled" + ACTIVATED_DURING_MAIN_FRAME_NAVIGATION = "ActivatedDuringMainFrameNavigation" + PRELOADING_UNSUPPORTED_BY_WEB_CONTENTS = "PreloadingUnsupportedByWebContents" + CROSS_SITE_REDIRECT_IN_MAIN_FRAME_NAVIGATION = "CrossSiteRedirectInMainFrameNavigation" + CROSS_SITE_NAVIGATION_IN_MAIN_FRAME_NAVIGATION = "CrossSiteNavigationInMainFrameNavigation" + SAME_SITE_CROSS_ORIGIN_REDIRECT_NOT_OPT_IN_IN_MAIN_FRAME_NAVIGATION = "SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation" + SAME_SITE_CROSS_ORIGIN_NAVIGATION_NOT_OPT_IN_IN_MAIN_FRAME_NAVIGATION = "SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation" + MEMORY_PRESSURE_ON_TRIGGER = "MemoryPressureOnTrigger" + MEMORY_PRESSURE_AFTER_TRIGGERED = "MemoryPressureAfterTriggered" + PRERENDERING_DISABLED_BY_DEV_TOOLS = "PrerenderingDisabledByDevTools" + SPECULATION_RULE_REMOVED = "SpeculationRuleRemoved" + ACTIVATED_WITH_AUXILIARY_BROWSING_CONTEXTS = "ActivatedWithAuxiliaryBrowsingContexts" + MAX_NUM_OF_RUNNING_EAGER_PRERENDERS_EXCEEDED = "MaxNumOfRunningEagerPrerendersExceeded" + MAX_NUM_OF_RUNNING_NON_EAGER_PRERENDERS_EXCEEDED = "MaxNumOfRunningNonEagerPrerendersExceeded" + MAX_NUM_OF_RUNNING_EMBEDDER_PRERENDERS_EXCEEDED = "MaxNumOfRunningEmbedderPrerendersExceeded" + PRERENDERING_URL_HAS_EFFECTIVE_URL = "PrerenderingUrlHasEffectiveUrl" + REDIRECTED_PRERENDERING_URL_HAS_EFFECTIVE_URL = "RedirectedPrerenderingUrlHasEffectiveUrl" + ACTIVATION_URL_HAS_EFFECTIVE_URL = "ActivationUrlHasEffectiveUrl" + JAVA_SCRIPT_INTERFACE_ADDED = "JavaScriptInterfaceAdded" + JAVA_SCRIPT_INTERFACE_REMOVED = "JavaScriptInterfaceRemoved" + ALL_PRERENDERING_CANCELED = "AllPrerenderingCanceled" + WINDOW_CLOSED = "WindowClosed" + SLOW_NETWORK = "SlowNetwork" + OTHER_PRERENDERED_PAGE_ACTIVATED = "OtherPrerenderedPageActivated" + V8_OPTIMIZER_DISABLED = "V8OptimizerDisabled" + PRERENDER_FAILED_DURING_PREFETCH = "PrerenderFailedDuringPrefetch" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class PreloadingStatus(enum.Enum): + ''' + Preloading status values, see also PreloadingTriggeringOutcome. This + status is shared by prefetchStatusUpdated and prerenderStatusUpdated. + ''' + PENDING = "Pending" + RUNNING = "Running" + READY = "Ready" + SUCCESS = "Success" + FAILURE = "Failure" + NOT_SUPPORTED = "NotSupported" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class PrefetchStatus(enum.Enum): + ''' + TODO(https://crbug.com/1384419): revisit the list of PrefetchStatus and + filter out the ones that aren't necessary to the developers. + ''' + PREFETCH_ALLOWED = "PrefetchAllowed" + PREFETCH_FAILED_INELIGIBLE_REDIRECT = "PrefetchFailedIneligibleRedirect" + PREFETCH_FAILED_INVALID_REDIRECT = "PrefetchFailedInvalidRedirect" + PREFETCH_FAILED_MIME_NOT_SUPPORTED = "PrefetchFailedMIMENotSupported" + PREFETCH_FAILED_NET_ERROR = "PrefetchFailedNetError" + PREFETCH_FAILED_NON2_XX = "PrefetchFailedNon2XX" + PREFETCH_EVICTED_AFTER_CANDIDATE_REMOVED = "PrefetchEvictedAfterCandidateRemoved" + PREFETCH_EVICTED_FOR_NEWER_PREFETCH = "PrefetchEvictedForNewerPrefetch" + PREFETCH_HELDBACK = "PrefetchHeldback" + PREFETCH_INELIGIBLE_RETRY_AFTER = "PrefetchIneligibleRetryAfter" + PREFETCH_IS_PRIVACY_DECOY = "PrefetchIsPrivacyDecoy" + PREFETCH_IS_STALE = "PrefetchIsStale" + PREFETCH_NOT_ELIGIBLE_BROWSER_CONTEXT_OFF_THE_RECORD = "PrefetchNotEligibleBrowserContextOffTheRecord" + PREFETCH_NOT_ELIGIBLE_DATA_SAVER_ENABLED = "PrefetchNotEligibleDataSaverEnabled" + PREFETCH_NOT_ELIGIBLE_EXISTING_PROXY = "PrefetchNotEligibleExistingProxy" + PREFETCH_NOT_ELIGIBLE_HOST_IS_NON_UNIQUE = "PrefetchNotEligibleHostIsNonUnique" + PREFETCH_NOT_ELIGIBLE_NON_DEFAULT_STORAGE_PARTITION = "PrefetchNotEligibleNonDefaultStoragePartition" + PREFETCH_NOT_ELIGIBLE_SAME_SITE_CROSS_ORIGIN_PREFETCH_REQUIRED_PROXY = "PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy" + PREFETCH_NOT_ELIGIBLE_SCHEME_IS_NOT_HTTPS = "PrefetchNotEligibleSchemeIsNotHttps" + PREFETCH_NOT_ELIGIBLE_USER_HAS_COOKIES = "PrefetchNotEligibleUserHasCookies" + PREFETCH_NOT_ELIGIBLE_USER_HAS_SERVICE_WORKER = "PrefetchNotEligibleUserHasServiceWorker" + PREFETCH_NOT_ELIGIBLE_BATTERY_SAVER_ENABLED = "PrefetchNotEligibleBatterySaverEnabled" + PREFETCH_NOT_ELIGIBLE_PRELOADING_DISABLED = "PrefetchNotEligiblePreloadingDisabled" + PREFETCH_NOT_FINISHED_IN_TIME = "PrefetchNotFinishedInTime" + PREFETCH_NOT_STARTED = "PrefetchNotStarted" + PREFETCH_NOT_USED_COOKIES_CHANGED = "PrefetchNotUsedCookiesChanged" + PREFETCH_PROXY_NOT_AVAILABLE = "PrefetchProxyNotAvailable" + PREFETCH_RESPONSE_USED = "PrefetchResponseUsed" + PREFETCH_SUCCESSFUL_BUT_NOT_USED = "PrefetchSuccessfulButNotUsed" + PREFETCH_NOT_USED_PROBE_FAILED = "PrefetchNotUsedProbeFailed" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class PrerenderMismatchedHeaders: + ''' + Information of headers to be displayed when the header mismatch occurred. + ''' + header_name: str + + initial_value: typing.Optional[str] = None + + activation_value: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['headerName'] = self.header_name + if self.initial_value is not None: + json['initialValue'] = self.initial_value + if self.activation_value is not None: + json['activationValue'] = self.activation_value + return json + + @classmethod + def from_json(cls, json): + return cls( + header_name=str(json['headerName']), + initial_value=str(json['initialValue']) if 'initialValue' in json else None, + activation_value=str(json['activationValue']) if 'activationValue' in json else None, + ) + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Preload.enable', + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Preload.disable', + } + json = yield cmd_dict + + +@event_class('Preload.ruleSetUpdated') +@dataclass +class RuleSetUpdated: + ''' + Upsert. Currently, it is only emitted when a rule set added. + ''' + rule_set: RuleSet + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> RuleSetUpdated: + return cls( + rule_set=RuleSet.from_json(json['ruleSet']) + ) + + +@event_class('Preload.ruleSetRemoved') +@dataclass +class RuleSetRemoved: + id_: RuleSetId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> RuleSetRemoved: + return cls( + id_=RuleSetId.from_json(json['id']) + ) + + +@event_class('Preload.preloadEnabledStateUpdated') +@dataclass +class PreloadEnabledStateUpdated: + ''' + Fired when a preload enabled state is updated. + ''' + disabled_by_preference: bool + disabled_by_data_saver: bool + disabled_by_battery_saver: bool + disabled_by_holdback_prefetch_speculation_rules: bool + disabled_by_holdback_prerender_speculation_rules: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreloadEnabledStateUpdated: + return cls( + disabled_by_preference=bool(json['disabledByPreference']), + disabled_by_data_saver=bool(json['disabledByDataSaver']), + disabled_by_battery_saver=bool(json['disabledByBatterySaver']), + disabled_by_holdback_prefetch_speculation_rules=bool(json['disabledByHoldbackPrefetchSpeculationRules']), + disabled_by_holdback_prerender_speculation_rules=bool(json['disabledByHoldbackPrerenderSpeculationRules']) + ) + + +@event_class('Preload.prefetchStatusUpdated') +@dataclass +class PrefetchStatusUpdated: + ''' + Fired when a prefetch attempt is updated. + ''' + key: PreloadingAttemptKey + pipeline_id: PreloadPipelineId + #: The frame id of the frame initiating prefetch. + initiating_frame_id: page.FrameId + prefetch_url: str + status: PreloadingStatus + prefetch_status: PrefetchStatus + request_id: network.RequestId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PrefetchStatusUpdated: + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + pipeline_id=PreloadPipelineId.from_json(json['pipelineId']), + initiating_frame_id=page.FrameId.from_json(json['initiatingFrameId']), + prefetch_url=str(json['prefetchUrl']), + status=PreloadingStatus.from_json(json['status']), + prefetch_status=PrefetchStatus.from_json(json['prefetchStatus']), + request_id=network.RequestId.from_json(json['requestId']) + ) + + +@event_class('Preload.prerenderStatusUpdated') +@dataclass +class PrerenderStatusUpdated: + ''' + Fired when a prerender attempt is updated. + ''' + key: PreloadingAttemptKey + pipeline_id: PreloadPipelineId + status: PreloadingStatus + prerender_status: typing.Optional[PrerenderFinalStatus] + #: 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. + disallowed_mojo_interface: typing.Optional[str] + mismatched_headers: typing.Optional[typing.List[PrerenderMismatchedHeaders]] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PrerenderStatusUpdated: + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + pipeline_id=PreloadPipelineId.from_json(json['pipelineId']), + status=PreloadingStatus.from_json(json['status']), + prerender_status=PrerenderFinalStatus.from_json(json['prerenderStatus']) if 'prerenderStatus' in json else None, + disallowed_mojo_interface=str(json['disallowedMojoInterface']) if 'disallowedMojoInterface' in json else None, + mismatched_headers=[PrerenderMismatchedHeaders.from_json(i) for i in json['mismatchedHeaders']] if 'mismatchedHeaders' in json else None + ) + + +@event_class('Preload.preloadingAttemptSourcesUpdated') +@dataclass +class PreloadingAttemptSourcesUpdated: + ''' + Send a list of sources for all preloading attempts in a document. + ''' + loader_id: network.LoaderId + preloading_attempt_sources: typing.List[PreloadingAttemptSource] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreloadingAttemptSourcesUpdated: + return cls( + loader_id=network.LoaderId.from_json(json['loaderId']), + preloading_attempt_sources=[PreloadingAttemptSource.from_json(i) for i in json['preloadingAttemptSources']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/profiler.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/profiler.py new file mode 100644 index 0000000..ab2ff07 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/profiler.py @@ -0,0 +1,418 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Profiler +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import debugger +from . import runtime + + +@dataclass +class ProfileNode: + ''' + Profile node. Holds callsite information, execution statistics and child nodes. + ''' + #: Unique id of the node. + id_: int + + #: Function location. + call_frame: runtime.CallFrame + + #: Number of samples where this node was on top of the call stack. + hit_count: typing.Optional[int] = None + + #: Child node ids. + children: typing.Optional[typing.List[int]] = None + + #: The reason of being not optimized. The function may be deoptimized or marked as don't + #: optimize. + deopt_reason: typing.Optional[str] = None + + #: An array of source position ticks. + position_ticks: typing.Optional[typing.List[PositionTickInfo]] = None + + def to_json(self): + json = dict() + json['id'] = self.id_ + json['callFrame'] = self.call_frame.to_json() + if self.hit_count is not None: + json['hitCount'] = self.hit_count + if self.children is not None: + json['children'] = [i for i in self.children] + if self.deopt_reason is not None: + json['deoptReason'] = self.deopt_reason + if self.position_ticks is not None: + json['positionTicks'] = [i.to_json() for i in self.position_ticks] + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=int(json['id']), + call_frame=runtime.CallFrame.from_json(json['callFrame']), + hit_count=int(json['hitCount']) if 'hitCount' in json else None, + children=[int(i) for i in json['children']] if 'children' in json else None, + deopt_reason=str(json['deoptReason']) if 'deoptReason' in json else None, + position_ticks=[PositionTickInfo.from_json(i) for i in json['positionTicks']] if 'positionTicks' in json else None, + ) + + +@dataclass +class Profile: + ''' + Profile. + ''' + #: The list of profile nodes. First item is the root node. + nodes: typing.List[ProfileNode] + + #: Profiling start timestamp in microseconds. + start_time: float + + #: Profiling end timestamp in microseconds. + end_time: float + + #: Ids of samples top nodes. + samples: typing.Optional[typing.List[int]] = None + + #: Time intervals between adjacent samples in microseconds. The first delta is relative to the + #: profile startTime. + time_deltas: typing.Optional[typing.List[int]] = None + + def to_json(self): + json = dict() + json['nodes'] = [i.to_json() for i in self.nodes] + json['startTime'] = self.start_time + json['endTime'] = self.end_time + if self.samples is not None: + json['samples'] = [i for i in self.samples] + if self.time_deltas is not None: + json['timeDeltas'] = [i for i in self.time_deltas] + return json + + @classmethod + def from_json(cls, json): + return cls( + nodes=[ProfileNode.from_json(i) for i in json['nodes']], + start_time=float(json['startTime']), + end_time=float(json['endTime']), + samples=[int(i) for i in json['samples']] if 'samples' in json else None, + time_deltas=[int(i) for i in json['timeDeltas']] if 'timeDeltas' in json else None, + ) + + +@dataclass +class PositionTickInfo: + ''' + Specifies a number of samples attributed to a certain source position. + ''' + #: Source line number (1-based). + line: int + + #: Number of samples attributed to the source line. + ticks: int + + def to_json(self): + json = dict() + json['line'] = self.line + json['ticks'] = self.ticks + return json + + @classmethod + def from_json(cls, json): + return cls( + line=int(json['line']), + ticks=int(json['ticks']), + ) + + +@dataclass +class CoverageRange: + ''' + Coverage data for a source range. + ''' + #: JavaScript script source offset for the range start. + start_offset: int + + #: JavaScript script source offset for the range end. + end_offset: int + + #: Collected execution count of the source range. + count: int + + def to_json(self): + json = dict() + json['startOffset'] = self.start_offset + json['endOffset'] = self.end_offset + json['count'] = self.count + return json + + @classmethod + def from_json(cls, json): + return cls( + start_offset=int(json['startOffset']), + end_offset=int(json['endOffset']), + count=int(json['count']), + ) + + +@dataclass +class FunctionCoverage: + ''' + Coverage data for a JavaScript function. + ''' + #: JavaScript function name. + function_name: str + + #: Source ranges inside the function with coverage data. + ranges: typing.List[CoverageRange] + + #: Whether coverage data for this function has block granularity. + is_block_coverage: bool + + def to_json(self): + json = dict() + json['functionName'] = self.function_name + json['ranges'] = [i.to_json() for i in self.ranges] + json['isBlockCoverage'] = self.is_block_coverage + return json + + @classmethod + def from_json(cls, json): + return cls( + function_name=str(json['functionName']), + ranges=[CoverageRange.from_json(i) for i in json['ranges']], + is_block_coverage=bool(json['isBlockCoverage']), + ) + + +@dataclass +class ScriptCoverage: + ''' + Coverage data for a JavaScript script. + ''' + #: JavaScript script id. + script_id: runtime.ScriptId + + #: JavaScript script name or url. + url: str + + #: Functions contained in the script that has coverage data. + functions: typing.List[FunctionCoverage] + + def to_json(self): + json = dict() + json['scriptId'] = self.script_id.to_json() + json['url'] = self.url + json['functions'] = [i.to_json() for i in self.functions] + return json + + @classmethod + def from_json(cls, json): + return cls( + script_id=runtime.ScriptId.from_json(json['scriptId']), + url=str(json['url']), + functions=[FunctionCoverage.from_json(i) for i in json['functions']], + ) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.disable', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.enable', + } + json = yield cmd_dict + + +def get_best_effort_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[ScriptCoverage]]: + ''' + Collect coverage data for the current isolate. The coverage data may be incomplete due to + garbage collection. + + :returns: Coverage data for the current isolate. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.getBestEffortCoverage', + } + json = yield cmd_dict + return [ScriptCoverage.from_json(i) for i in json['result']] + + +def set_sampling_interval( + interval: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + + :param interval: New sampling interval in microseconds. + ''' + params: T_JSON_DICT = dict() + params['interval'] = interval + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.setSamplingInterval', + 'params': params, + } + json = yield cmd_dict + + +def start() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.start', + } + json = yield cmd_dict + + +def start_precise_coverage( + call_count: typing.Optional[bool] = None, + detailed: typing.Optional[bool] = None, + allow_triggered_updates: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,float]: + ''' + 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. + + :param call_count: *(Optional)* Collect accurate call counts beyond simple 'covered' or 'not covered'. + :param detailed: *(Optional)* Collect block-based coverage. + :param allow_triggered_updates: *(Optional)* Allow the backend to send updates on its own initiative + :returns: Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + ''' + params: T_JSON_DICT = dict() + if call_count is not None: + params['callCount'] = call_count + if detailed is not None: + params['detailed'] = detailed + if allow_triggered_updates is not None: + params['allowTriggeredUpdates'] = allow_triggered_updates + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.startPreciseCoverage', + 'params': params, + } + json = yield cmd_dict + return float(json['timestamp']) + + +def stop() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,Profile]: + ''' + + + :returns: Recorded profile. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.stop', + } + json = yield cmd_dict + return Profile.from_json(json['profile']) + + +def stop_precise_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disable precise code coverage. Disabling releases unnecessary execution count records and allows + executing optimized code. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.stopPreciseCoverage', + } + json = yield cmd_dict + + +def take_precise_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.List[ScriptCoverage], float]]: + ''' + Collect coverage data for the current isolate, and resets execution counters. Precise code + coverage needs to have started. + + :returns: A tuple with the following items: + + 0. **result** - Coverage data for the current isolate. + 1. **timestamp** - Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.takePreciseCoverage', + } + json = yield cmd_dict + return ( + [ScriptCoverage.from_json(i) for i in json['result']], + float(json['timestamp']) + ) + + +@event_class('Profiler.consoleProfileFinished') +@dataclass +class ConsoleProfileFinished: + id_: str + #: Location of console.profileEnd(). + location: debugger.Location + profile: Profile + #: Profile title passed as an argument to console.profile(). + title: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleProfileFinished: + return cls( + id_=str(json['id']), + location=debugger.Location.from_json(json['location']), + profile=Profile.from_json(json['profile']), + title=str(json['title']) if 'title' in json else None + ) + + +@event_class('Profiler.consoleProfileStarted') +@dataclass +class ConsoleProfileStarted: + ''' + Sent when new profile recording is started using console.profile() call. + ''' + id_: str + #: Location of console.profile(). + location: debugger.Location + #: Profile title passed as an argument to console.profile(). + title: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleProfileStarted: + return cls( + id_=str(json['id']), + location=debugger.Location.from_json(json['location']), + title=str(json['title']) if 'title' in json else None + ) + + +@event_class('Profiler.preciseCoverageDeltaUpdate') +@dataclass +class PreciseCoverageDeltaUpdate: + ''' + **EXPERIMENTAL** + + 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. + ''' + #: Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + timestamp: float + #: Identifier for distinguishing coverage events. + occasion: str + #: Coverage data for the current isolate. + result: typing.List[ScriptCoverage] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreciseCoverageDeltaUpdate: + return cls( + timestamp=float(json['timestamp']), + occasion=str(json['occasion']), + result=[ScriptCoverage.from_json(i) for i in json['result']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/pwa.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/pwa.py new file mode 100644 index 0000000..8def6e8 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/pwa.py @@ -0,0 +1,260 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: PWA (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import target + + +@dataclass +class FileHandlerAccept: + ''' + 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 + ''' + #: New name of the mimetype according to + #: https://www.iana.org/assignments/media-types/media-types.xhtml + media_type: str + + file_extensions: typing.List[str] + + def to_json(self): + json = dict() + json['mediaType'] = self.media_type + json['fileExtensions'] = [i for i in self.file_extensions] + return json + + @classmethod + def from_json(cls, json): + return cls( + media_type=str(json['mediaType']), + file_extensions=[str(i) for i in json['fileExtensions']], + ) + + +@dataclass +class FileHandler: + action: str + + accepts: typing.List[FileHandlerAccept] + + display_name: str + + def to_json(self): + json = dict() + json['action'] = self.action + json['accepts'] = [i.to_json() for i in self.accepts] + json['displayName'] = self.display_name + return json + + @classmethod + def from_json(cls, json): + return cls( + action=str(json['action']), + accepts=[FileHandlerAccept.from_json(i) for i in json['accepts']], + display_name=str(json['displayName']), + ) + + +class DisplayMode(enum.Enum): + ''' + If user prefers opening the app in browser or an app window. + ''' + STANDALONE = "standalone" + BROWSER = "browser" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def get_os_app_state( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[int, typing.List[FileHandler]]]: + ''' + Returns the following OS state for the given manifest id. + + :param manifest_id: The id from the webapp's manifest file, commonly it's the url of the site installing the webapp. See https://web.dev/learn/pwa/web-app-manifest. + :returns: A tuple with the following items: + + 0. **badgeCount** - + 1. **fileHandlers** - + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.getOsAppState', + 'params': params, + } + json = yield cmd_dict + return ( + int(json['badgeCount']), + [FileHandler.from_json(i) for i in json['fileHandlers']] + ) + + +def install( + manifest_id: str, + install_url_or_bundle_url: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Installs the given manifest identity, optionally using the given install_url + or IWA bundle location. + + TODO(crbug.com/337872319) Support IWA to meet the following specific + requirement. + IWA-specific install description: If the manifest_id is isolated-app://, + install_url_or_bundle_url is required, and can be either an http(s) URL or + file:// URL pointing to a signed web bundle (.swbn). The .swbn file's + signing key must correspond to manifest_id. If Chrome is not in IWA dev + mode, the installation will fail, regardless of the state of the allowlist. + + :param manifest_id: + :param install_url_or_bundle_url: *(Optional)* The location of the app or bundle overriding the one derived from the manifestId. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if install_url_or_bundle_url is not None: + params['installUrlOrBundleUrl'] = install_url_or_bundle_url + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.install', + 'params': params, + } + json = yield cmd_dict + + +def uninstall( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Uninstalls the given manifest_id and closes any opened app windows. + + :param manifest_id: + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.uninstall', + 'params': params, + } + json = yield cmd_dict + + +def launch( + manifest_id: str, + url: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,target.TargetID]: + ''' + 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. + + :param manifest_id: + :param url: *(Optional)* + :returns: ID of the tab target created as a result. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if url is not None: + params['url'] = url + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.launch', + 'params': params, + } + json = yield cmd_dict + return target.TargetID.from_json(json['targetId']) + + +def launch_files_in_app( + manifest_id: str, + files: typing.List[str] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[target.TargetID]]: + ''' + 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. + + :param manifest_id: + :param files: + :returns: IDs of the tab targets created as the result. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + params['files'] = [i for i in files] + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.launchFilesInApp', + 'params': params, + } + json = yield cmd_dict + return [target.TargetID.from_json(i) for i in json['targetIds']] + + +def open_current_page_in_app( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param manifest_id: + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.openCurrentPageInApp', + 'params': params, + } + json = yield cmd_dict + + +def change_app_user_settings( + manifest_id: str, + link_capturing: typing.Optional[bool] = None, + display_mode: typing.Optional[DisplayMode] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param manifest_id: + :param link_capturing: *(Optional)* If user allows the links clicked on by the user in the app's scope, or extended 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 the initial value, uninstalling and installing the web app again will reset it. TODO(crbug.com/339453269): Setting this value on ChromeOS is not supported yet. + :param display_mode: *(Optional)* + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if link_capturing is not None: + params['linkCapturing'] = link_capturing + if display_mode is not None: + params['displayMode'] = display_mode.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.changeAppUserSettings', + 'params': params, + } + json = yield cmd_dict diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/py.typed b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/runtime.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/runtime.py new file mode 100644 index 0000000..97220af --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/runtime.py @@ -0,0 +1,1587 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Runtime +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class ScriptId(str): + ''' + Unique script identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> ScriptId: + return cls(json) + + def __repr__(self): + return 'ScriptId({})'.format(super().__repr__()) + + +@dataclass +class SerializationOptions: + ''' + Represents options for serialization. Overrides ``generatePreview`` and ``returnByValue``. + ''' + serialization: str + + #: Deep serialization depth. Default is full depth. Respected only in ``deep`` serialization mode. + max_depth: typing.Optional[int] = None + + #: 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. + additional_parameters: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['serialization'] = self.serialization + if self.max_depth is not None: + json['maxDepth'] = self.max_depth + if self.additional_parameters is not None: + json['additionalParameters'] = self.additional_parameters + return json + + @classmethod + def from_json(cls, json): + return cls( + serialization=str(json['serialization']), + max_depth=int(json['maxDepth']) if 'maxDepth' in json else None, + additional_parameters=dict(json['additionalParameters']) if 'additionalParameters' in json else None, + ) + + +@dataclass +class DeepSerializedValue: + ''' + Represents deep serialized value. + ''' + type_: str + + value: typing.Optional[typing.Any] = None + + object_id: typing.Optional[str] = None + + #: 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. + weak_local_object_reference: typing.Optional[int] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + if self.value is not None: + json['value'] = self.value + if self.object_id is not None: + json['objectId'] = self.object_id + if self.weak_local_object_reference is not None: + json['weakLocalObjectReference'] = self.weak_local_object_reference + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + value=json['value'] if 'value' in json else None, + object_id=str(json['objectId']) if 'objectId' in json else None, + weak_local_object_reference=int(json['weakLocalObjectReference']) if 'weakLocalObjectReference' in json else None, + ) + + +class RemoteObjectId(str): + ''' + Unique object identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> RemoteObjectId: + return cls(json) + + def __repr__(self): + return 'RemoteObjectId({})'.format(super().__repr__()) + + +class UnserializableValue(str): + ''' + Primitive value which cannot be JSON-stringified. Includes values ``-0``, ``NaN``, ``Infinity``, + ``-Infinity``, and bigint literals. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnserializableValue: + return cls(json) + + def __repr__(self): + return 'UnserializableValue({})'.format(super().__repr__()) + + +@dataclass +class RemoteObject: + ''' + Mirror object referencing original JavaScript object. + ''' + #: Object type. + type_: str + + #: 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. + subtype: typing.Optional[str] = None + + #: Object class (constructor) name. Specified for ``object`` type values only. + class_name: typing.Optional[str] = None + + #: Remote object value in case of primitive values or JSON values (if it was requested). + value: typing.Optional[typing.Any] = None + + #: Primitive value which can not be JSON-stringified does not have ``value``, but gets this + #: property. + unserializable_value: typing.Optional[UnserializableValue] = None + + #: String representation of the object. + description: typing.Optional[str] = None + + #: Deep serialized value. + deep_serialized_value: typing.Optional[DeepSerializedValue] = None + + #: Unique object identifier (for non-primitive values). + object_id: typing.Optional[RemoteObjectId] = None + + #: Preview containing abbreviated property values. Specified for ``object`` type values only. + preview: typing.Optional[ObjectPreview] = None + + custom_preview: typing.Optional[CustomPreview] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + if self.subtype is not None: + json['subtype'] = self.subtype + if self.class_name is not None: + json['className'] = self.class_name + if self.value is not None: + json['value'] = self.value + if self.unserializable_value is not None: + json['unserializableValue'] = self.unserializable_value.to_json() + if self.description is not None: + json['description'] = self.description + if self.deep_serialized_value is not None: + json['deepSerializedValue'] = self.deep_serialized_value.to_json() + if self.object_id is not None: + json['objectId'] = self.object_id.to_json() + if self.preview is not None: + json['preview'] = self.preview.to_json() + if self.custom_preview is not None: + json['customPreview'] = self.custom_preview.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + subtype=str(json['subtype']) if 'subtype' in json else None, + class_name=str(json['className']) if 'className' in json else None, + value=json['value'] if 'value' in json else None, + unserializable_value=UnserializableValue.from_json(json['unserializableValue']) if 'unserializableValue' in json else None, + description=str(json['description']) if 'description' in json else None, + deep_serialized_value=DeepSerializedValue.from_json(json['deepSerializedValue']) if 'deepSerializedValue' in json else None, + object_id=RemoteObjectId.from_json(json['objectId']) if 'objectId' in json else None, + preview=ObjectPreview.from_json(json['preview']) if 'preview' in json else None, + custom_preview=CustomPreview.from_json(json['customPreview']) if 'customPreview' in json else None, + ) + + +@dataclass +class CustomPreview: + #: The JSON-stringified result of formatter.header(object, config) call. + #: It contains json ML array that represents RemoteObject. + header: str + + #: 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. + body_getter_id: typing.Optional[RemoteObjectId] = None + + def to_json(self): + json = dict() + json['header'] = self.header + if self.body_getter_id is not None: + json['bodyGetterId'] = self.body_getter_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + header=str(json['header']), + body_getter_id=RemoteObjectId.from_json(json['bodyGetterId']) if 'bodyGetterId' in json else None, + ) + + +@dataclass +class ObjectPreview: + ''' + Object containing abbreviated remote object value. + ''' + #: Object type. + type_: str + + #: True iff some of the properties or entries of the original object did not fit. + overflow: bool + + #: List of the properties. + properties: typing.List[PropertyPreview] + + #: Object subtype hint. Specified for ``object`` type values only. + subtype: typing.Optional[str] = None + + #: String representation of the object. + description: typing.Optional[str] = None + + #: List of the entries. Specified for ``map`` and ``set`` subtype values only. + entries: typing.Optional[typing.List[EntryPreview]] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + json['overflow'] = self.overflow + json['properties'] = [i.to_json() for i in self.properties] + if self.subtype is not None: + json['subtype'] = self.subtype + if self.description is not None: + json['description'] = self.description + if self.entries is not None: + json['entries'] = [i.to_json() for i in self.entries] + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + overflow=bool(json['overflow']), + properties=[PropertyPreview.from_json(i) for i in json['properties']], + subtype=str(json['subtype']) if 'subtype' in json else None, + description=str(json['description']) if 'description' in json else None, + entries=[EntryPreview.from_json(i) for i in json['entries']] if 'entries' in json else None, + ) + + +@dataclass +class PropertyPreview: + #: Property name. + name: str + + #: Object type. Accessor means that the property itself is an accessor property. + type_: str + + #: User-friendly property value string. + value: typing.Optional[str] = None + + #: Nested value preview. + value_preview: typing.Optional[ObjectPreview] = None + + #: Object subtype hint. Specified for ``object`` type values only. + subtype: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['name'] = self.name + json['type'] = self.type_ + if self.value is not None: + json['value'] = self.value + if self.value_preview is not None: + json['valuePreview'] = self.value_preview.to_json() + if self.subtype is not None: + json['subtype'] = self.subtype + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + type_=str(json['type']), + value=str(json['value']) if 'value' in json else None, + value_preview=ObjectPreview.from_json(json['valuePreview']) if 'valuePreview' in json else None, + subtype=str(json['subtype']) if 'subtype' in json else None, + ) + + +@dataclass +class EntryPreview: + #: Preview of the value. + value: ObjectPreview + + #: Preview of the key. Specified for map-like collection entries. + key: typing.Optional[ObjectPreview] = None + + def to_json(self): + json = dict() + json['value'] = self.value.to_json() + if self.key is not None: + json['key'] = self.key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + value=ObjectPreview.from_json(json['value']), + key=ObjectPreview.from_json(json['key']) if 'key' in json else None, + ) + + +@dataclass +class PropertyDescriptor: + ''' + Object property descriptor. + ''' + #: Property name or symbol description. + name: str + + #: True if the type of this property descriptor may be changed and if the property may be + #: deleted from the corresponding object. + configurable: bool + + #: True if this property shows up during enumeration of the properties on the corresponding + #: object. + enumerable: bool + + #: The value associated with the property. + value: typing.Optional[RemoteObject] = None + + #: True if the value associated with the property may be changed (data descriptors only). + writable: typing.Optional[bool] = None + + #: A function which serves as a getter for the property, or ``undefined`` if there is no getter + #: (accessor descriptors only). + get: typing.Optional[RemoteObject] = None + + #: A function which serves as a setter for the property, or ``undefined`` if there is no setter + #: (accessor descriptors only). + set_: typing.Optional[RemoteObject] = None + + #: True if the result was thrown during the evaluation. + was_thrown: typing.Optional[bool] = None + + #: True if the property is owned for the object. + is_own: typing.Optional[bool] = None + + #: Property symbol object, if the property is of the ``symbol`` type. + symbol: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + json['configurable'] = self.configurable + json['enumerable'] = self.enumerable + if self.value is not None: + json['value'] = self.value.to_json() + if self.writable is not None: + json['writable'] = self.writable + if self.get is not None: + json['get'] = self.get.to_json() + if self.set_ is not None: + json['set'] = self.set_.to_json() + if self.was_thrown is not None: + json['wasThrown'] = self.was_thrown + if self.is_own is not None: + json['isOwn'] = self.is_own + if self.symbol is not None: + json['symbol'] = self.symbol.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + configurable=bool(json['configurable']), + enumerable=bool(json['enumerable']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + writable=bool(json['writable']) if 'writable' in json else None, + get=RemoteObject.from_json(json['get']) if 'get' in json else None, + set_=RemoteObject.from_json(json['set']) if 'set' in json else None, + was_thrown=bool(json['wasThrown']) if 'wasThrown' in json else None, + is_own=bool(json['isOwn']) if 'isOwn' in json else None, + symbol=RemoteObject.from_json(json['symbol']) if 'symbol' in json else None, + ) + + +@dataclass +class InternalPropertyDescriptor: + ''' + Object internal property descriptor. This property isn't normally visible in JavaScript code. + ''' + #: Conventional property name. + name: str + + #: The value associated with the property. + value: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + if self.value is not None: + json['value'] = self.value.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + ) + + +@dataclass +class PrivatePropertyDescriptor: + ''' + Object private field descriptor. + ''' + #: Private property name. + name: str + + #: The value associated with the private property. + value: typing.Optional[RemoteObject] = None + + #: A function which serves as a getter for the private property, + #: or ``undefined`` if there is no getter (accessor descriptors only). + get: typing.Optional[RemoteObject] = None + + #: A function which serves as a setter for the private property, + #: or ``undefined`` if there is no setter (accessor descriptors only). + set_: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + if self.value is not None: + json['value'] = self.value.to_json() + if self.get is not None: + json['get'] = self.get.to_json() + if self.set_ is not None: + json['set'] = self.set_.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + get=RemoteObject.from_json(json['get']) if 'get' in json else None, + set_=RemoteObject.from_json(json['set']) if 'set' in json else None, + ) + + +@dataclass +class CallArgument: + ''' + Represents function call argument. Either remote object id ``objectId``, primitive ``value``, + unserializable primitive value or neither of (for undefined) them should be specified. + ''' + #: Primitive value or serializable javascript object. + value: typing.Optional[typing.Any] = None + + #: Primitive value which can not be JSON-stringified. + unserializable_value: typing.Optional[UnserializableValue] = None + + #: Remote object handle. + object_id: typing.Optional[RemoteObjectId] = None + + def to_json(self): + json = dict() + if self.value is not None: + json['value'] = self.value + if self.unserializable_value is not None: + json['unserializableValue'] = self.unserializable_value.to_json() + if self.object_id is not None: + json['objectId'] = self.object_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + value=json['value'] if 'value' in json else None, + unserializable_value=UnserializableValue.from_json(json['unserializableValue']) if 'unserializableValue' in json else None, + object_id=RemoteObjectId.from_json(json['objectId']) if 'objectId' in json else None, + ) + + +class ExecutionContextId(int): + ''' + Id of an execution context. + ''' + def to_json(self) -> int: + return self + + @classmethod + def from_json(cls, json: int) -> ExecutionContextId: + return cls(json) + + def __repr__(self): + return 'ExecutionContextId({})'.format(super().__repr__()) + + +@dataclass +class ExecutionContextDescription: + ''' + Description of an isolated world. + ''' + #: Unique id of the execution context. It can be used to specify in which execution context + #: script evaluation should be performed. + id_: ExecutionContextId + + #: Execution context origin. + origin: str + + #: Human readable name describing given context. + name: str + + #: 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. + unique_id: str + + #: Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'``'isolated'``'worker', frameId: string} + aux_data: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['id'] = self.id_.to_json() + json['origin'] = self.origin + json['name'] = self.name + json['uniqueId'] = self.unique_id + if self.aux_data is not None: + json['auxData'] = self.aux_data + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=ExecutionContextId.from_json(json['id']), + origin=str(json['origin']), + name=str(json['name']), + unique_id=str(json['uniqueId']), + aux_data=dict(json['auxData']) if 'auxData' in json else None, + ) + + +@dataclass +class ExceptionDetails: + ''' + Detailed information about exception (or error) that was thrown during script compilation or + execution. + ''' + #: Exception id. + exception_id: int + + #: Exception text, which should be used together with exception object when available. + text: str + + #: Line number of the exception location (0-based). + line_number: int + + #: Column number of the exception location (0-based). + column_number: int + + #: Script ID of the exception location. + script_id: typing.Optional[ScriptId] = None + + #: URL of the exception location, to be used when the script was not reported. + url: typing.Optional[str] = None + + #: JavaScript stack trace if available. + stack_trace: typing.Optional[StackTrace] = None + + #: Exception object if available. + exception: typing.Optional[RemoteObject] = None + + #: Identifier of the context where exception happened. + execution_context_id: typing.Optional[ExecutionContextId] = None + + #: Dictionary with entries of meta data that the client associated + #: with this exception, such as information about associated network + #: requests, etc. + exception_meta_data: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['exceptionId'] = self.exception_id + json['text'] = self.text + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + if self.script_id is not None: + json['scriptId'] = self.script_id.to_json() + if self.url is not None: + json['url'] = self.url + if self.stack_trace is not None: + json['stackTrace'] = self.stack_trace.to_json() + if self.exception is not None: + json['exception'] = self.exception.to_json() + if self.execution_context_id is not None: + json['executionContextId'] = self.execution_context_id.to_json() + if self.exception_meta_data is not None: + json['exceptionMetaData'] = self.exception_meta_data + return json + + @classmethod + def from_json(cls, json): + return cls( + exception_id=int(json['exceptionId']), + text=str(json['text']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + script_id=ScriptId.from_json(json['scriptId']) if 'scriptId' in json else None, + url=str(json['url']) if 'url' in json else None, + stack_trace=StackTrace.from_json(json['stackTrace']) if 'stackTrace' in json else None, + exception=RemoteObject.from_json(json['exception']) if 'exception' in json else None, + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) if 'executionContextId' in json else None, + exception_meta_data=dict(json['exceptionMetaData']) if 'exceptionMetaData' in json else None, + ) + + +class Timestamp(float): + ''' + Number of milliseconds since epoch. + ''' + def to_json(self) -> float: + return self + + @classmethod + def from_json(cls, json: float) -> Timestamp: + return cls(json) + + def __repr__(self): + return 'Timestamp({})'.format(super().__repr__()) + + +class TimeDelta(float): + ''' + Number of milliseconds. + ''' + def to_json(self) -> float: + return self + + @classmethod + def from_json(cls, json: float) -> TimeDelta: + return cls(json) + + def __repr__(self): + return 'TimeDelta({})'.format(super().__repr__()) + + +@dataclass +class CallFrame: + ''' + Stack entry for runtime errors and assertions. + ''' + #: JavaScript function name. + function_name: str + + #: JavaScript script id. + script_id: ScriptId + + #: JavaScript script name or url. + url: str + + #: JavaScript script line number (0-based). + line_number: int + + #: JavaScript script column number (0-based). + column_number: int + + def to_json(self): + json = dict() + json['functionName'] = self.function_name + json['scriptId'] = self.script_id.to_json() + json['url'] = self.url + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + return json + + @classmethod + def from_json(cls, json): + return cls( + function_name=str(json['functionName']), + script_id=ScriptId.from_json(json['scriptId']), + url=str(json['url']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + ) + + +@dataclass +class StackTrace: + ''' + Call frames for assertions or error messages. + ''' + #: JavaScript function name. + call_frames: typing.List[CallFrame] + + #: String label of this stack trace. For async traces this may be a name of the function that + #: initiated the async call. + description: typing.Optional[str] = None + + #: Asynchronous JavaScript stack trace that preceded this stack, if available. + parent: typing.Optional[StackTrace] = None + + #: Asynchronous JavaScript stack trace that preceded this stack, if available. + parent_id: typing.Optional[StackTraceId] = None + + def to_json(self): + json = dict() + json['callFrames'] = [i.to_json() for i in self.call_frames] + if self.description is not None: + json['description'] = self.description + if self.parent is not None: + json['parent'] = self.parent.to_json() + if self.parent_id is not None: + json['parentId'] = self.parent_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + call_frames=[CallFrame.from_json(i) for i in json['callFrames']], + description=str(json['description']) if 'description' in json else None, + parent=StackTrace.from_json(json['parent']) if 'parent' in json else None, + parent_id=StackTraceId.from_json(json['parentId']) if 'parentId' in json else None, + ) + + +class UniqueDebuggerId(str): + ''' + Unique identifier of current debugger. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UniqueDebuggerId: + return cls(json) + + def __repr__(self): + return 'UniqueDebuggerId({})'.format(super().__repr__()) + + +@dataclass +class StackTraceId: + ''' + 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. + ''' + id_: str + + debugger_id: typing.Optional[UniqueDebuggerId] = None + + def to_json(self): + json = dict() + json['id'] = self.id_ + if self.debugger_id is not None: + json['debuggerId'] = self.debugger_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=str(json['id']), + debugger_id=UniqueDebuggerId.from_json(json['debuggerId']) if 'debuggerId' in json else None, + ) + + +def await_promise( + promise_object_id: RemoteObjectId, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Add handler to promise with given promise object id. + + :param promise_object_id: Identifier of the promise. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object that should be sent by value. + :param generate_preview: *(Optional)* Whether preview should be generated for the result. + :returns: A tuple with the following items: + + 0. **result** - Promise result. Will contain rejected value if promise was rejected. + 1. **exceptionDetails** - *(Optional)* Exception details if stack strace is available. + ''' + params: T_JSON_DICT = dict() + params['promiseObjectId'] = promise_object_id.to_json() + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.awaitPromise', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def call_function_on( + function_declaration: str, + object_id: typing.Optional[RemoteObjectId] = None, + arguments: typing.Optional[typing.List[CallArgument]] = None, + silent: typing.Optional[bool] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + user_gesture: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None, + execution_context_id: typing.Optional[ExecutionContextId] = None, + object_group: typing.Optional[str] = None, + throw_on_side_effect: typing.Optional[bool] = None, + unique_context_id: typing.Optional[str] = None, + serialization_options: typing.Optional[SerializationOptions] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Calls function with given declaration on the given object. Object group of the result is + inherited from the target object. + + :param function_declaration: Declaration of the function to call. + :param object_id: *(Optional)* Identifier of the object to call function on. Either objectId or executionContextId should be specified. + :param arguments: *(Optional)* Call arguments. All call arguments must belong to the same JavaScript world as the target object. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object which should be sent by value. Can be overriden by ````serializationOptions````. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the result. + :param user_gesture: *(Optional)* Whether execution should be treated as initiated by user in the UI. + :param await_promise: *(Optional)* Whether execution should ````await```` for resulting value and return once awaited promise is resolved. + :param execution_context_id: *(Optional)* Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + :param throw_on_side_effect: **(EXPERIMENTAL)** *(Optional)* Whether to throw an exception if side effect cannot be ruled out during evaluation. + :param unique_context_id: **(EXPERIMENTAL)** *(Optional)* 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 be system-unique, so it can be used to prevent accidental function call in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with ````executionContextId````. + :param serialization_options: **(EXPERIMENTAL)** *(Optional)* Specifies the result serialization. If provided, overrides ````generatePreview```` and ````returnByValue```. + :returns: A tuple with the following items: + + 0. **result** - Call result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['functionDeclaration'] = function_declaration + if object_id is not None: + params['objectId'] = object_id.to_json() + if arguments is not None: + params['arguments'] = [i.to_json() for i in arguments] + if silent is not None: + params['silent'] = silent + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if user_gesture is not None: + params['userGesture'] = user_gesture + if await_promise is not None: + params['awaitPromise'] = await_promise + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + if throw_on_side_effect is not None: + params['throwOnSideEffect'] = throw_on_side_effect + if unique_context_id is not None: + params['uniqueContextId'] = unique_context_id + if serialization_options is not None: + params['serializationOptions'] = serialization_options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.callFunctionOn', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def compile_script( + expression: str, + source_url: str, + persist_script: bool, + execution_context_id: typing.Optional[ExecutionContextId] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.Optional[ScriptId], typing.Optional[ExceptionDetails]]]: + ''' + Compiles expression. + + :param expression: Expression to compile. + :param source_url: Source url to be set for the script. + :param persist_script: Specifies whether the compiled script should be persisted. + :param execution_context_id: *(Optional)* Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + :returns: A tuple with the following items: + + 0. **scriptId** - *(Optional)* Id of the script. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['expression'] = expression + params['sourceURL'] = source_url + params['persistScript'] = persist_script + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.compileScript', + 'params': params, + } + json = yield cmd_dict + return ( + ScriptId.from_json(json['scriptId']) if 'scriptId' in json else None, + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables reporting of execution contexts creation. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.disable', + } + json = yield cmd_dict + + +def discard_console_entries() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Discards collected exceptions and console API calls. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.discardConsoleEntries', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.enable', + } + json = yield cmd_dict + + +def evaluate( + expression: str, + object_group: typing.Optional[str] = None, + include_command_line_api: typing.Optional[bool] = None, + silent: typing.Optional[bool] = None, + context_id: typing.Optional[ExecutionContextId] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + user_gesture: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None, + throw_on_side_effect: typing.Optional[bool] = None, + timeout: typing.Optional[TimeDelta] = None, + disable_breaks: typing.Optional[bool] = None, + repl_mode: typing.Optional[bool] = None, + allow_unsafe_eval_blocked_by_csp: typing.Optional[bool] = None, + unique_context_id: typing.Optional[str] = None, + serialization_options: typing.Optional[SerializationOptions] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Evaluates expression on global object. + + :param expression: Expression to evaluate. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. + :param include_command_line_api: *(Optional)* Determines whether Command Line API should be available during the evaluation. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param context_id: *(Optional)* Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. This is mutually exclusive with ````uniqueContextId````, which offers an alternative way to identify the execution context that is more reliable in a multi-process environment. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object that should be sent by value. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the result. + :param user_gesture: *(Optional)* Whether execution should be treated as initiated by user in the UI. + :param await_promise: *(Optional)* Whether execution should ````await```` for resulting value and return once awaited promise is resolved. + :param throw_on_side_effect: **(EXPERIMENTAL)** *(Optional)* Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies ````disableBreaks```` below. + :param timeout: **(EXPERIMENTAL)** *(Optional)* Terminate execution after timing out (number of milliseconds). + :param disable_breaks: **(EXPERIMENTAL)** *(Optional)* Disable breakpoints during execution. + :param repl_mode: **(EXPERIMENTAL)** *(Optional)* 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. + :param allow_unsafe_eval_blocked_by_csp: **(EXPERIMENTAL)** *(Optional)* 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 this evaluation and allows unsafe-eval. Defaults to true. + :param unique_context_id: **(EXPERIMENTAL)** *(Optional)* An alternative way to specify the execution context to evaluate in. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental evaluation of the expression in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with ````contextId````. + :param serialization_options: **(EXPERIMENTAL)** *(Optional)* Specifies the result serialization. If provided, overrides ````generatePreview```` and ````returnByValue```. + :returns: A tuple with the following items: + + 0. **result** - Evaluation result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['expression'] = expression + if object_group is not None: + params['objectGroup'] = object_group + if include_command_line_api is not None: + params['includeCommandLineAPI'] = include_command_line_api + if silent is not None: + params['silent'] = silent + if context_id is not None: + params['contextId'] = context_id.to_json() + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if user_gesture is not None: + params['userGesture'] = user_gesture + if await_promise is not None: + params['awaitPromise'] = await_promise + if throw_on_side_effect is not None: + params['throwOnSideEffect'] = throw_on_side_effect + if timeout is not None: + params['timeout'] = timeout.to_json() + if disable_breaks is not None: + params['disableBreaks'] = disable_breaks + if repl_mode is not None: + params['replMode'] = repl_mode + if allow_unsafe_eval_blocked_by_csp is not None: + params['allowUnsafeEvalBlockedByCSP'] = allow_unsafe_eval_blocked_by_csp + if unique_context_id is not None: + params['uniqueContextId'] = unique_context_id + if serialization_options is not None: + params['serializationOptions'] = serialization_options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.evaluate', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def get_isolate_id() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: + ''' + Returns the isolate id. + + **EXPERIMENTAL** + + :returns: The isolate id. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getIsolateId', + } + json = yield cmd_dict + return str(json['id']) + + +def get_heap_usage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[float, float, float, float]]: + ''' + Returns the JavaScript heap usage. + It is the total usage of the corresponding isolate not scoped to a particular Runtime. + + **EXPERIMENTAL** + + :returns: A tuple with the following items: + + 0. **usedSize** - Used JavaScript heap size in bytes. + 1. **totalSize** - Allocated JavaScript heap size in bytes. + 2. **embedderHeapUsedSize** - Used size in bytes in the embedder's garbage-collected heap. + 3. **backingStorageSize** - Size in bytes of backing storage for array buffers and external strings. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getHeapUsage', + } + json = yield cmd_dict + return ( + float(json['usedSize']), + float(json['totalSize']), + float(json['embedderHeapUsedSize']), + float(json['backingStorageSize']) + ) + + +def get_properties( + object_id: RemoteObjectId, + own_properties: typing.Optional[bool] = None, + accessor_properties_only: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + non_indexed_properties_only: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.List[PropertyDescriptor], typing.Optional[typing.List[InternalPropertyDescriptor]], typing.Optional[typing.List[PrivatePropertyDescriptor]], typing.Optional[ExceptionDetails]]]: + ''' + Returns properties of a given object. Object group of the result is inherited from the target + object. + + :param object_id: Identifier of the object to return properties for. + :param own_properties: *(Optional)* If true, returns properties belonging only to the element itself, not to its prototype chain. + :param accessor_properties_only: **(EXPERIMENTAL)** *(Optional)* If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the results. + :param non_indexed_properties_only: **(EXPERIMENTAL)** *(Optional)* If true, returns non-indexed properties only. + :returns: A tuple with the following items: + + 0. **result** - Object properties. + 1. **internalProperties** - *(Optional)* Internal object properties (only of the element itself). + 2. **privateProperties** - *(Optional)* Object private properties. + 3. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['objectId'] = object_id.to_json() + if own_properties is not None: + params['ownProperties'] = own_properties + if accessor_properties_only is not None: + params['accessorPropertiesOnly'] = accessor_properties_only + if generate_preview is not None: + params['generatePreview'] = generate_preview + if non_indexed_properties_only is not None: + params['nonIndexedPropertiesOnly'] = non_indexed_properties_only + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getProperties', + 'params': params, + } + json = yield cmd_dict + return ( + [PropertyDescriptor.from_json(i) for i in json['result']], + [InternalPropertyDescriptor.from_json(i) for i in json['internalProperties']] if 'internalProperties' in json else None, + [PrivatePropertyDescriptor.from_json(i) for i in json['privateProperties']] if 'privateProperties' in json else None, + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def global_lexical_scope_names( + execution_context_id: typing.Optional[ExecutionContextId] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Returns all let, const and class variables from global scope. + + :param execution_context_id: *(Optional)* Specifies in which execution context to lookup global scope variables. + :returns: + ''' + params: T_JSON_DICT = dict() + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.globalLexicalScopeNames', + 'params': params, + } + json = yield cmd_dict + return [str(i) for i in json['names']] + + +def query_objects( + prototype_object_id: RemoteObjectId, + object_group: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,RemoteObject]: + ''' + :param prototype_object_id: Identifier of the prototype to return objects for. + :param object_group: *(Optional)* Symbolic group name that can be used to release the results. + :returns: Array with objects. + ''' + params: T_JSON_DICT = dict() + params['prototypeObjectId'] = prototype_object_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.queryObjects', + 'params': params, + } + json = yield cmd_dict + return RemoteObject.from_json(json['objects']) + + +def release_object( + object_id: RemoteObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Releases remote object with given id. + + :param object_id: Identifier of the object to release. + ''' + params: T_JSON_DICT = dict() + params['objectId'] = object_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.releaseObject', + 'params': params, + } + json = yield cmd_dict + + +def release_object_group( + object_group: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Releases all remote objects that belong to a given group. + + :param object_group: Symbolic object group name. + ''' + params: T_JSON_DICT = dict() + params['objectGroup'] = object_group + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.releaseObjectGroup', + 'params': params, + } + json = yield cmd_dict + + +def run_if_waiting_for_debugger() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Tells inspected instance to run if it was waiting for debugger to attach. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.runIfWaitingForDebugger', + } + json = yield cmd_dict + + +def run_script( + script_id: ScriptId, + execution_context_id: typing.Optional[ExecutionContextId] = None, + object_group: typing.Optional[str] = None, + silent: typing.Optional[bool] = None, + include_command_line_api: typing.Optional[bool] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Runs script with given id in a given context. + + :param script_id: Id of the script to run. + :param execution_context_id: *(Optional)* Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param include_command_line_api: *(Optional)* Determines whether Command Line API should be available during the evaluation. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object which should be sent by value. + :param generate_preview: *(Optional)* Whether preview should be generated for the result. + :param await_promise: *(Optional)* Whether execution should ````await``` for resulting value and return once awaited promise is resolved. + :returns: A tuple with the following items: + + 0. **result** - Run result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['scriptId'] = script_id.to_json() + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + if silent is not None: + params['silent'] = silent + if include_command_line_api is not None: + params['includeCommandLineAPI'] = include_command_line_api + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if await_promise is not None: + params['awaitPromise'] = await_promise + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.runScript', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def set_async_call_stack_depth( + max_depth: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables or disables async call stacks tracking. + + :param max_depth: Maximum depth of async call stacks. Setting to ```0``` will effectively disable collecting async call stacks (default). + ''' + params: T_JSON_DICT = dict() + params['maxDepth'] = max_depth + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setAsyncCallStackDepth', + 'params': params, + } + json = yield cmd_dict + + +def set_custom_object_formatter_enabled( + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + + + **EXPERIMENTAL** + + :param enabled: + ''' + params: T_JSON_DICT = dict() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setCustomObjectFormatterEnabled', + 'params': params, + } + json = yield cmd_dict + + +def set_max_call_stack_size_to_capture( + size: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + + + **EXPERIMENTAL** + + :param size: + ''' + params: T_JSON_DICT = dict() + params['size'] = size + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setMaxCallStackSizeToCapture', + 'params': params, + } + json = yield cmd_dict + + +def terminate_execution() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Terminate current or next JavaScript execution. + Will cancel the termination when the outer-most script execution ends. + + **EXPERIMENTAL** + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.terminateExecution', + } + json = yield cmd_dict + + +def add_binding( + name: str, + execution_context_id: typing.Optional[ExecutionContextId] = None, + execution_context_name: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param name: + :param execution_context_id: **(EXPERIMENTAL)** *(Optional)* If specified, the binding would only be exposed to the specified execution 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 case and bugs in implementation (crbug.com/1169639). ````executionContextId```` will be removed in the future. + :param execution_context_name: *(Optional)* If specified, the binding is exposed to the executionContext with matching 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```. + ''' + params: T_JSON_DICT = dict() + params['name'] = name + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if execution_context_name is not None: + params['executionContextName'] = execution_context_name + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.addBinding', + 'params': params, + } + json = yield cmd_dict + + +def remove_binding( + name: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + This method does not remove binding function from global object but + unsubscribes current runtime agent from Runtime.bindingCalled notifications. + + :param name: + ''' + params: T_JSON_DICT = dict() + params['name'] = name + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.removeBinding', + 'params': params, + } + json = yield cmd_dict + + +def get_exception_details( + error_object_id: RemoteObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Optional[ExceptionDetails]]: + ''' + 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. + + **EXPERIMENTAL** + + :param error_object_id: The error object for which to resolve the exception details. + :returns: + ''' + params: T_JSON_DICT = dict() + params['errorObjectId'] = error_object_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getExceptionDetails', + 'params': params, + } + json = yield cmd_dict + return ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + + +@event_class('Runtime.bindingCalled') +@dataclass +class BindingCalled: + ''' + **EXPERIMENTAL** + + Notification is issued every time when binding is called. + ''' + name: str + payload: str + #: Identifier of the context where the call was made. + execution_context_id: ExecutionContextId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> BindingCalled: + return cls( + name=str(json['name']), + payload=str(json['payload']), + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) + ) + + +@event_class('Runtime.consoleAPICalled') +@dataclass +class ConsoleAPICalled: + ''' + Issued when console API was called. + ''' + #: Type of the call. + type_: str + #: Call arguments. + args: typing.List[RemoteObject] + #: Identifier of the context where the call was made. + execution_context_id: ExecutionContextId + #: Call timestamp. + timestamp: Timestamp + #: 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. + stack_trace: typing.Optional[StackTrace] + #: 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. + context: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleAPICalled: + return cls( + type_=str(json['type']), + args=[RemoteObject.from_json(i) for i in json['args']], + execution_context_id=ExecutionContextId.from_json(json['executionContextId']), + timestamp=Timestamp.from_json(json['timestamp']), + stack_trace=StackTrace.from_json(json['stackTrace']) if 'stackTrace' in json else None, + context=str(json['context']) if 'context' in json else None + ) + + +@event_class('Runtime.exceptionRevoked') +@dataclass +class ExceptionRevoked: + ''' + Issued when unhandled exception was revoked. + ''' + #: Reason describing why exception was revoked. + reason: str + #: The id of revoked exception, as reported in ``exceptionThrown``. + exception_id: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExceptionRevoked: + return cls( + reason=str(json['reason']), + exception_id=int(json['exceptionId']) + ) + + +@event_class('Runtime.exceptionThrown') +@dataclass +class ExceptionThrown: + ''' + Issued when exception was thrown and unhandled. + ''' + #: Timestamp of the exception. + timestamp: Timestamp + exception_details: ExceptionDetails + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExceptionThrown: + return cls( + timestamp=Timestamp.from_json(json['timestamp']), + exception_details=ExceptionDetails.from_json(json['exceptionDetails']) + ) + + +@event_class('Runtime.executionContextCreated') +@dataclass +class ExecutionContextCreated: + ''' + Issued when new execution context is created. + ''' + #: A newly created execution context. + context: ExecutionContextDescription + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextCreated: + return cls( + context=ExecutionContextDescription.from_json(json['context']) + ) + + +@event_class('Runtime.executionContextDestroyed') +@dataclass +class ExecutionContextDestroyed: + ''' + Issued when execution context is destroyed. + ''' + #: Id of the destroyed context + execution_context_id: ExecutionContextId + #: Unique Id of the destroyed context + execution_context_unique_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextDestroyed: + return cls( + execution_context_id=ExecutionContextId.from_json(json['executionContextId']), + execution_context_unique_id=str(json['executionContextUniqueId']) + ) + + +@event_class('Runtime.executionContextsCleared') +@dataclass +class ExecutionContextsCleared: + ''' + Issued when all executionContexts were cleared in browser + ''' + + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextsCleared: + return cls( + + ) + + +@event_class('Runtime.inspectRequested') +@dataclass +class InspectRequested: + ''' + Issued when object should be inspected (for example, as a result of inspect() command line API + call). + ''' + object_: RemoteObject + hints: dict + #: Identifier of the context where the call was made. + execution_context_id: typing.Optional[ExecutionContextId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InspectRequested: + return cls( + object_=RemoteObject.from_json(json['object']), + hints=dict(json['hints']), + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) if 'executionContextId' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/schema.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/schema.py new file mode 100644 index 0000000..5077f78 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/schema.py @@ -0,0 +1,48 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Schema +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +@dataclass +class Domain: + ''' + Description of the protocol domain. + ''' + #: Domain name. + name: str + + #: Domain version. + version: str + + def to_json(self): + json = dict() + json['name'] = self.name + json['version'] = self.version + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + version=str(json['version']), + ) + + +def get_domains() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Domain]]: + ''' + Returns supported domains. + + :returns: List of supported domains. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Schema.getDomains', + } + json = yield cmd_dict + return [Domain.from_json(i) for i in json['domains']] diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/security.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/security.py new file mode 100644 index 0000000..e7714fe --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/security.py @@ -0,0 +1,507 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Security +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import network + + +class CertificateId(int): + ''' + An internal certificate ID value. + ''' + def to_json(self) -> int: + return self + + @classmethod + def from_json(cls, json: int) -> CertificateId: + return cls(json) + + def __repr__(self): + return 'CertificateId({})'.format(super().__repr__()) + + +class MixedContentType(enum.Enum): + ''' + A description of mixed content (HTTP resources on HTTPS pages), as defined by + https://www.w3.org/TR/mixed-content/#categories + ''' + BLOCKABLE = "blockable" + OPTIONALLY_BLOCKABLE = "optionally-blockable" + NONE = "none" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class SecurityState(enum.Enum): + ''' + The security level of a page or resource. + ''' + UNKNOWN = "unknown" + NEUTRAL = "neutral" + INSECURE = "insecure" + SECURE = "secure" + INFO = "info" + INSECURE_BROKEN = "insecure-broken" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class CertificateSecurityState: + ''' + Details about the security state of the page certificate. + ''' + #: Protocol name (e.g. "TLS 1.2" or "QUIC"). + protocol: str + + #: Key Exchange used by the connection, or the empty string if not applicable. + key_exchange: str + + #: Cipher name. + cipher: str + + #: Page certificate. + certificate: typing.List[str] + + #: Certificate subject name. + subject_name: str + + #: Name of the issuing CA. + issuer: str + + #: Certificate valid from date. + valid_from: network.TimeSinceEpoch + + #: Certificate valid to (expiration) date + valid_to: network.TimeSinceEpoch + + #: True if the certificate uses a weak signature algorithm. + certificate_has_weak_signature: bool + + #: True if the certificate has a SHA1 signature in the chain. + certificate_has_sha1_signature: bool + + #: True if modern SSL + modern_ssl: bool + + #: True if the connection is using an obsolete SSL protocol. + obsolete_ssl_protocol: bool + + #: True if the connection is using an obsolete SSL key exchange. + obsolete_ssl_key_exchange: bool + + #: True if the connection is using an obsolete SSL cipher. + obsolete_ssl_cipher: bool + + #: True if the connection is using an obsolete SSL signature. + obsolete_ssl_signature: bool + + #: (EC)DH group used by the connection, if applicable. + key_exchange_group: typing.Optional[str] = None + + #: TLS MAC. Note that AEAD ciphers do not have separate MACs. + mac: typing.Optional[str] = None + + #: The highest priority network error code, if the certificate has an error. + certificate_network_error: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['protocol'] = self.protocol + json['keyExchange'] = self.key_exchange + json['cipher'] = self.cipher + json['certificate'] = [i for i in self.certificate] + json['subjectName'] = self.subject_name + json['issuer'] = self.issuer + json['validFrom'] = self.valid_from.to_json() + json['validTo'] = self.valid_to.to_json() + json['certificateHasWeakSignature'] = self.certificate_has_weak_signature + json['certificateHasSha1Signature'] = self.certificate_has_sha1_signature + json['modernSSL'] = self.modern_ssl + json['obsoleteSslProtocol'] = self.obsolete_ssl_protocol + json['obsoleteSslKeyExchange'] = self.obsolete_ssl_key_exchange + json['obsoleteSslCipher'] = self.obsolete_ssl_cipher + json['obsoleteSslSignature'] = self.obsolete_ssl_signature + if self.key_exchange_group is not None: + json['keyExchangeGroup'] = self.key_exchange_group + if self.mac is not None: + json['mac'] = self.mac + if self.certificate_network_error is not None: + json['certificateNetworkError'] = self.certificate_network_error + return json + + @classmethod + def from_json(cls, json): + return cls( + protocol=str(json['protocol']), + key_exchange=str(json['keyExchange']), + cipher=str(json['cipher']), + certificate=[str(i) for i in json['certificate']], + subject_name=str(json['subjectName']), + issuer=str(json['issuer']), + valid_from=network.TimeSinceEpoch.from_json(json['validFrom']), + valid_to=network.TimeSinceEpoch.from_json(json['validTo']), + certificate_has_weak_signature=bool(json['certificateHasWeakSignature']), + certificate_has_sha1_signature=bool(json['certificateHasSha1Signature']), + modern_ssl=bool(json['modernSSL']), + obsolete_ssl_protocol=bool(json['obsoleteSslProtocol']), + obsolete_ssl_key_exchange=bool(json['obsoleteSslKeyExchange']), + obsolete_ssl_cipher=bool(json['obsoleteSslCipher']), + obsolete_ssl_signature=bool(json['obsoleteSslSignature']), + key_exchange_group=str(json['keyExchangeGroup']) if 'keyExchangeGroup' in json else None, + mac=str(json['mac']) if 'mac' in json else None, + certificate_network_error=str(json['certificateNetworkError']) if 'certificateNetworkError' in json else None, + ) + + +class SafetyTipStatus(enum.Enum): + BAD_REPUTATION = "badReputation" + LOOKALIKE = "lookalike" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class SafetyTipInfo: + #: Describes whether the page triggers any safety tips or reputation warnings. Default is unknown. + safety_tip_status: SafetyTipStatus + + #: The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches. + safe_url: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['safetyTipStatus'] = self.safety_tip_status.to_json() + if self.safe_url is not None: + json['safeUrl'] = self.safe_url + return json + + @classmethod + def from_json(cls, json): + return cls( + safety_tip_status=SafetyTipStatus.from_json(json['safetyTipStatus']), + safe_url=str(json['safeUrl']) if 'safeUrl' in json else None, + ) + + +@dataclass +class VisibleSecurityState: + ''' + Security state information about the page. + ''' + #: The security level of the page. + security_state: SecurityState + + #: Array of security state issues ids. + security_state_issue_ids: typing.List[str] + + #: Security state details about the page certificate. + certificate_security_state: typing.Optional[CertificateSecurityState] = None + + #: 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. + safety_tip_info: typing.Optional[SafetyTipInfo] = None + + def to_json(self): + json = dict() + json['securityState'] = self.security_state.to_json() + json['securityStateIssueIds'] = [i for i in self.security_state_issue_ids] + if self.certificate_security_state is not None: + json['certificateSecurityState'] = self.certificate_security_state.to_json() + if self.safety_tip_info is not None: + json['safetyTipInfo'] = self.safety_tip_info.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + security_state=SecurityState.from_json(json['securityState']), + security_state_issue_ids=[str(i) for i in json['securityStateIssueIds']], + certificate_security_state=CertificateSecurityState.from_json(json['certificateSecurityState']) if 'certificateSecurityState' in json else None, + safety_tip_info=SafetyTipInfo.from_json(json['safetyTipInfo']) if 'safetyTipInfo' in json else None, + ) + + +@dataclass +class SecurityStateExplanation: + ''' + An explanation of an factor contributing to the security state. + ''' + #: Security state representing the severity of the factor being explained. + security_state: SecurityState + + #: Title describing the type of factor. + title: str + + #: Short phrase describing the type of factor. + summary: str + + #: Full text explanation of the factor. + description: str + + #: The type of mixed content described by the explanation. + mixed_content_type: MixedContentType + + #: Page certificate. + certificate: typing.List[str] + + #: Recommendations to fix any issues. + recommendations: typing.Optional[typing.List[str]] = None + + def to_json(self): + json = dict() + json['securityState'] = self.security_state.to_json() + json['title'] = self.title + json['summary'] = self.summary + json['description'] = self.description + json['mixedContentType'] = self.mixed_content_type.to_json() + json['certificate'] = [i for i in self.certificate] + if self.recommendations is not None: + json['recommendations'] = [i for i in self.recommendations] + return json + + @classmethod + def from_json(cls, json): + return cls( + security_state=SecurityState.from_json(json['securityState']), + title=str(json['title']), + summary=str(json['summary']), + description=str(json['description']), + mixed_content_type=MixedContentType.from_json(json['mixedContentType']), + certificate=[str(i) for i in json['certificate']], + recommendations=[str(i) for i in json['recommendations']] if 'recommendations' in json else None, + ) + + +@dataclass +class InsecureContentStatus: + ''' + Information about insecure content on the page. + ''' + #: Always false. + ran_mixed_content: bool + + #: Always false. + displayed_mixed_content: bool + + #: Always false. + contained_mixed_form: bool + + #: Always false. + ran_content_with_cert_errors: bool + + #: Always false. + displayed_content_with_cert_errors: bool + + #: Always set to unknown. + ran_insecure_content_style: SecurityState + + #: Always set to unknown. + displayed_insecure_content_style: SecurityState + + def to_json(self): + json = dict() + json['ranMixedContent'] = self.ran_mixed_content + json['displayedMixedContent'] = self.displayed_mixed_content + json['containedMixedForm'] = self.contained_mixed_form + json['ranContentWithCertErrors'] = self.ran_content_with_cert_errors + json['displayedContentWithCertErrors'] = self.displayed_content_with_cert_errors + json['ranInsecureContentStyle'] = self.ran_insecure_content_style.to_json() + json['displayedInsecureContentStyle'] = self.displayed_insecure_content_style.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + ran_mixed_content=bool(json['ranMixedContent']), + displayed_mixed_content=bool(json['displayedMixedContent']), + contained_mixed_form=bool(json['containedMixedForm']), + ran_content_with_cert_errors=bool(json['ranContentWithCertErrors']), + displayed_content_with_cert_errors=bool(json['displayedContentWithCertErrors']), + ran_insecure_content_style=SecurityState.from_json(json['ranInsecureContentStyle']), + displayed_insecure_content_style=SecurityState.from_json(json['displayedInsecureContentStyle']), + ) + + +class CertificateErrorAction(enum.Enum): + ''' + The action to take when a certificate error occurs. continue will continue processing the + request and cancel will cancel the request. + ''' + CONTINUE = "continue" + CANCEL = "cancel" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables tracking security state changes. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Security.disable', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables tracking security state changes. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Security.enable', + } + json = yield cmd_dict + + +def set_ignore_certificate_errors( + ignore: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable/disable whether all certificate errors should be ignored. + + :param ignore: If true, all certificate errors will be ignored. + ''' + params: T_JSON_DICT = dict() + params['ignore'] = ignore + cmd_dict: T_JSON_DICT = { + 'method': 'Security.setIgnoreCertificateErrors', + 'params': params, + } + json = yield cmd_dict + + +def handle_certificate_error( + event_id: int, + action: CertificateErrorAction + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Handles a certificate error that fired a certificateError event. + + :param event_id: The ID of the event. + :param action: The action to take on the certificate error. + ''' + params: T_JSON_DICT = dict() + params['eventId'] = event_id + params['action'] = action.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Security.handleCertificateError', + 'params': params, + } + json = yield cmd_dict + + +def set_override_certificate_errors( + override: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable/disable overriding certificate errors. If enabled, all certificate error events need to + be handled by the DevTools client and should be answered with ``handleCertificateError`` commands. + + :param override: If true, certificate errors will be overridden. + ''' + params: T_JSON_DICT = dict() + params['override'] = override + cmd_dict: T_JSON_DICT = { + 'method': 'Security.setOverrideCertificateErrors', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Security.certificateError') +@dataclass +class CertificateError: + ''' + 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. + ''' + #: The ID of the event. + event_id: int + #: The type of the error. + error_type: str + #: The url that was requested. + request_url: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CertificateError: + return cls( + event_id=int(json['eventId']), + error_type=str(json['errorType']), + request_url=str(json['requestURL']) + ) + + +@event_class('Security.visibleSecurityStateChanged') +@dataclass +class VisibleSecurityStateChanged: + ''' + **EXPERIMENTAL** + + The security state of the page changed. + ''' + #: Security state information about the page. + visible_security_state: VisibleSecurityState + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> VisibleSecurityStateChanged: + return cls( + visible_security_state=VisibleSecurityState.from_json(json['visibleSecurityState']) + ) + + +@event_class('Security.securityStateChanged') +@dataclass +class SecurityStateChanged: + ''' + The security state of the page changed. No longer being sent. + ''' + #: Security state. + security_state: SecurityState + #: True if the page was loaded over cryptographic transport such as HTTPS. + scheme_is_cryptographic: bool + #: Previously a list of explanations for the security state. Now always + #: empty. + explanations: typing.List[SecurityStateExplanation] + #: Information about insecure content on the page. + insecure_content_status: InsecureContentStatus + #: Overrides user-visible description of the state. Always omitted. + summary: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> SecurityStateChanged: + return cls( + security_state=SecurityState.from_json(json['securityState']), + scheme_is_cryptographic=bool(json['schemeIsCryptographic']), + explanations=[SecurityStateExplanation.from_json(i) for i in json['explanations']], + insecure_content_status=InsecureContentStatus.from_json(json['insecureContentStatus']), + summary=str(json['summary']) if 'summary' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/service_worker.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/service_worker.py new file mode 100644 index 0000000..9dd80b1 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/service_worker.py @@ -0,0 +1,414 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: ServiceWorker (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import target + + +class RegistrationID(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> RegistrationID: + return cls(json) + + def __repr__(self): + return 'RegistrationID({})'.format(super().__repr__()) + + +@dataclass +class ServiceWorkerRegistration: + ''' + ServiceWorker registration. + ''' + registration_id: RegistrationID + + scope_url: str + + is_deleted: bool + + def to_json(self): + json = dict() + json['registrationId'] = self.registration_id.to_json() + json['scopeURL'] = self.scope_url + json['isDeleted'] = self.is_deleted + return json + + @classmethod + def from_json(cls, json): + return cls( + registration_id=RegistrationID.from_json(json['registrationId']), + scope_url=str(json['scopeURL']), + is_deleted=bool(json['isDeleted']), + ) + + +class ServiceWorkerVersionRunningStatus(enum.Enum): + STOPPED = "stopped" + STARTING = "starting" + RUNNING = "running" + STOPPING = "stopping" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ServiceWorkerVersionStatus(enum.Enum): + NEW = "new" + INSTALLING = "installing" + INSTALLED = "installed" + ACTIVATING = "activating" + ACTIVATED = "activated" + REDUNDANT = "redundant" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ServiceWorkerVersion: + ''' + ServiceWorker version. + ''' + version_id: str + + registration_id: RegistrationID + + script_url: str + + running_status: ServiceWorkerVersionRunningStatus + + status: ServiceWorkerVersionStatus + + #: The Last-Modified header value of the main script. + script_last_modified: typing.Optional[float] = None + + #: 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. + script_response_time: typing.Optional[float] = None + + controlled_clients: typing.Optional[typing.List[target.TargetID]] = None + + target_id: typing.Optional[target.TargetID] = None + + router_rules: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['versionId'] = self.version_id + json['registrationId'] = self.registration_id.to_json() + json['scriptURL'] = self.script_url + json['runningStatus'] = self.running_status.to_json() + json['status'] = self.status.to_json() + if self.script_last_modified is not None: + json['scriptLastModified'] = self.script_last_modified + if self.script_response_time is not None: + json['scriptResponseTime'] = self.script_response_time + if self.controlled_clients is not None: + json['controlledClients'] = [i.to_json() for i in self.controlled_clients] + if self.target_id is not None: + json['targetId'] = self.target_id.to_json() + if self.router_rules is not None: + json['routerRules'] = self.router_rules + return json + + @classmethod + def from_json(cls, json): + return cls( + version_id=str(json['versionId']), + registration_id=RegistrationID.from_json(json['registrationId']), + script_url=str(json['scriptURL']), + running_status=ServiceWorkerVersionRunningStatus.from_json(json['runningStatus']), + status=ServiceWorkerVersionStatus.from_json(json['status']), + script_last_modified=float(json['scriptLastModified']) if 'scriptLastModified' in json else None, + script_response_time=float(json['scriptResponseTime']) if 'scriptResponseTime' in json else None, + controlled_clients=[target.TargetID.from_json(i) for i in json['controlledClients']] if 'controlledClients' in json else None, + target_id=target.TargetID.from_json(json['targetId']) if 'targetId' in json else None, + router_rules=str(json['routerRules']) if 'routerRules' in json else None, + ) + + +@dataclass +class ServiceWorkerErrorMessage: + ''' + ServiceWorker error message. + ''' + error_message: str + + registration_id: RegistrationID + + version_id: str + + source_url: str + + line_number: int + + column_number: int + + def to_json(self): + json = dict() + json['errorMessage'] = self.error_message + json['registrationId'] = self.registration_id.to_json() + json['versionId'] = self.version_id + json['sourceURL'] = self.source_url + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + return json + + @classmethod + def from_json(cls, json): + return cls( + error_message=str(json['errorMessage']), + registration_id=RegistrationID.from_json(json['registrationId']), + version_id=str(json['versionId']), + source_url=str(json['sourceURL']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + ) + + +def deliver_push_message( + origin: str, + registration_id: RegistrationID, + data: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param data: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['data'] = data + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.deliverPushMessage', + 'params': params, + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.disable', + } + json = yield cmd_dict + + +def dispatch_sync_event( + origin: str, + registration_id: RegistrationID, + tag: str, + last_chance: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param tag: + :param last_chance: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['tag'] = tag + params['lastChance'] = last_chance + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.dispatchSyncEvent', + 'params': params, + } + json = yield cmd_dict + + +def dispatch_periodic_sync_event( + origin: str, + registration_id: RegistrationID, + tag: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param tag: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['tag'] = tag + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.dispatchPeriodicSyncEvent', + 'params': params, + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.enable', + } + json = yield cmd_dict + + +def inspect_worker( + version_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param version_id: + ''' + params: T_JSON_DICT = dict() + params['versionId'] = version_id + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.inspectWorker', + 'params': params, + } + json = yield cmd_dict + + +def set_force_update_on_page_load( + force_update_on_page_load: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param force_update_on_page_load: + ''' + params: T_JSON_DICT = dict() + params['forceUpdateOnPageLoad'] = force_update_on_page_load + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.setForceUpdateOnPageLoad', + 'params': params, + } + json = yield cmd_dict + + +def skip_waiting( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.skipWaiting', + 'params': params, + } + json = yield cmd_dict + + +def start_worker( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.startWorker', + 'params': params, + } + json = yield cmd_dict + + +def stop_all_workers() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.stopAllWorkers', + } + json = yield cmd_dict + + +def stop_worker( + version_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param version_id: + ''' + params: T_JSON_DICT = dict() + params['versionId'] = version_id + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.stopWorker', + 'params': params, + } + json = yield cmd_dict + + +def unregister( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.unregister', + 'params': params, + } + json = yield cmd_dict + + +def update_registration( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.updateRegistration', + 'params': params, + } + json = yield cmd_dict + + +@event_class('ServiceWorker.workerErrorReported') +@dataclass +class WorkerErrorReported: + error_message: ServiceWorkerErrorMessage + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerErrorReported: + return cls( + error_message=ServiceWorkerErrorMessage.from_json(json['errorMessage']) + ) + + +@event_class('ServiceWorker.workerRegistrationUpdated') +@dataclass +class WorkerRegistrationUpdated: + registrations: typing.List[ServiceWorkerRegistration] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerRegistrationUpdated: + return cls( + registrations=[ServiceWorkerRegistration.from_json(i) for i in json['registrations']] + ) + + +@event_class('ServiceWorker.workerVersionUpdated') +@dataclass +class WorkerVersionUpdated: + versions: typing.List[ServiceWorkerVersion] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerVersionUpdated: + return cls( + versions=[ServiceWorkerVersion.from_json(i) for i in json['versions']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/storage.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/storage.py new file mode 100644 index 0000000..8cae0ab --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/storage.py @@ -0,0 +1,2120 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Storage (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import browser +from . import network +from . import page + + +class SerializedStorageKey(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SerializedStorageKey: + return cls(json) + + def __repr__(self): + return 'SerializedStorageKey({})'.format(super().__repr__()) + + +class StorageType(enum.Enum): + ''' + Enum of possible storage types. + ''' + COOKIES = "cookies" + FILE_SYSTEMS = "file_systems" + INDEXEDDB = "indexeddb" + LOCAL_STORAGE = "local_storage" + SHADER_CACHE = "shader_cache" + WEBSQL = "websql" + SERVICE_WORKERS = "service_workers" + CACHE_STORAGE = "cache_storage" + INTEREST_GROUPS = "interest_groups" + SHARED_STORAGE = "shared_storage" + STORAGE_BUCKETS = "storage_buckets" + ALL_ = "all" + OTHER = "other" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class UsageForType: + ''' + Usage for a storage type. + ''' + #: Name of storage type. + storage_type: StorageType + + #: Storage usage (bytes). + usage: float + + def to_json(self): + json = dict() + json['storageType'] = self.storage_type.to_json() + json['usage'] = self.usage + return json + + @classmethod + def from_json(cls, json): + return cls( + storage_type=StorageType.from_json(json['storageType']), + usage=float(json['usage']), + ) + + +@dataclass +class TrustTokens: + ''' + Pair of issuer origin and number of available (signed, but not used) Trust + Tokens from that issuer. + ''' + issuer_origin: str + + count: float + + def to_json(self): + json = dict() + json['issuerOrigin'] = self.issuer_origin + json['count'] = self.count + return json + + @classmethod + def from_json(cls, json): + return cls( + issuer_origin=str(json['issuerOrigin']), + count=float(json['count']), + ) + + +class InterestGroupAuctionId(str): + ''' + Protected audience interest group auction identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> InterestGroupAuctionId: + return cls(json) + + def __repr__(self): + return 'InterestGroupAuctionId({})'.format(super().__repr__()) + + +class InterestGroupAccessType(enum.Enum): + ''' + Enum of interest group access types. + ''' + JOIN = "join" + LEAVE = "leave" + UPDATE = "update" + LOADED = "loaded" + BID = "bid" + WIN = "win" + ADDITIONAL_BID = "additionalBid" + ADDITIONAL_BID_WIN = "additionalBidWin" + TOP_LEVEL_BID = "topLevelBid" + TOP_LEVEL_ADDITIONAL_BID = "topLevelAdditionalBid" + CLEAR = "clear" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class InterestGroupAuctionEventType(enum.Enum): + ''' + Enum of auction events. + ''' + STARTED = "started" + CONFIG_RESOLVED = "configResolved" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class InterestGroupAuctionFetchType(enum.Enum): + ''' + Enum of network fetches auctions can do. + ''' + BIDDER_JS = "bidderJs" + BIDDER_WASM = "bidderWasm" + SELLER_JS = "sellerJs" + BIDDER_TRUSTED_SIGNALS = "bidderTrustedSignals" + SELLER_TRUSTED_SIGNALS = "sellerTrustedSignals" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class SharedStorageAccessType(enum.Enum): + ''' + Enum of shared storage access types. + ''' + DOCUMENT_ADD_MODULE = "documentAddModule" + DOCUMENT_SELECT_URL = "documentSelectURL" + DOCUMENT_RUN = "documentRun" + DOCUMENT_SET = "documentSet" + DOCUMENT_APPEND = "documentAppend" + DOCUMENT_DELETE = "documentDelete" + DOCUMENT_CLEAR = "documentClear" + DOCUMENT_GET = "documentGet" + WORKLET_SET = "workletSet" + WORKLET_APPEND = "workletAppend" + WORKLET_DELETE = "workletDelete" + WORKLET_CLEAR = "workletClear" + WORKLET_GET = "workletGet" + WORKLET_KEYS = "workletKeys" + WORKLET_ENTRIES = "workletEntries" + WORKLET_LENGTH = "workletLength" + WORKLET_REMAINING_BUDGET = "workletRemainingBudget" + HEADER_SET = "headerSet" + HEADER_APPEND = "headerAppend" + HEADER_DELETE = "headerDelete" + HEADER_CLEAR = "headerClear" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class SharedStorageEntry: + ''' + Struct for a single key-value pair in an origin's shared storage. + ''' + key: str + + value: str + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=str(json['value']), + ) + + +@dataclass +class SharedStorageMetadata: + ''' + Details for an origin's shared storage. + ''' + #: Time when the origin's shared storage was last created. + creation_time: network.TimeSinceEpoch + + #: Number of key-value pairs stored in origin's shared storage. + length: int + + #: Current amount of bits of entropy remaining in the navigation budget. + remaining_budget: float + + #: Total number of bytes stored as key-value pairs in origin's shared + #: storage. + bytes_used: int + + def to_json(self): + json = dict() + json['creationTime'] = self.creation_time.to_json() + json['length'] = self.length + json['remainingBudget'] = self.remaining_budget + json['bytesUsed'] = self.bytes_used + return json + + @classmethod + def from_json(cls, json): + return cls( + creation_time=network.TimeSinceEpoch.from_json(json['creationTime']), + length=int(json['length']), + remaining_budget=float(json['remainingBudget']), + bytes_used=int(json['bytesUsed']), + ) + + +@dataclass +class SharedStorageReportingMetadata: + ''' + Pair of reporting metadata details for a candidate URL for ``selectURL()``. + ''' + event_type: str + + reporting_url: str + + def to_json(self): + json = dict() + json['eventType'] = self.event_type + json['reportingUrl'] = self.reporting_url + return json + + @classmethod + def from_json(cls, json): + return cls( + event_type=str(json['eventType']), + reporting_url=str(json['reportingUrl']), + ) + + +@dataclass +class SharedStorageUrlWithMetadata: + ''' + Bundles a candidate URL with its reporting metadata. + ''' + #: Spec of candidate URL. + url: str + + #: Any associated reporting metadata. + reporting_metadata: typing.List[SharedStorageReportingMetadata] + + def to_json(self): + json = dict() + json['url'] = self.url + json['reportingMetadata'] = [i.to_json() for i in self.reporting_metadata] + return json + + @classmethod + def from_json(cls, json): + return cls( + url=str(json['url']), + reporting_metadata=[SharedStorageReportingMetadata.from_json(i) for i in json['reportingMetadata']], + ) + + +@dataclass +class SharedStorageAccessParams: + ''' + Bundles the parameters for shared storage access events whose + presence/absence can vary according to SharedStorageAccessType. + ''' + #: Spec of the module script URL. + #: Present only for SharedStorageAccessType.documentAddModule. + script_source_url: typing.Optional[str] = None + + #: Name of the registered operation to be run. + #: Present only for SharedStorageAccessType.documentRun and + #: SharedStorageAccessType.documentSelectURL. + operation_name: typing.Optional[str] = None + + #: The operation's serialized data in bytes (converted to a string). + #: Present only for SharedStorageAccessType.documentRun and + #: SharedStorageAccessType.documentSelectURL. + serialized_data: typing.Optional[str] = None + + #: Array of candidate URLs' specs, along with any associated metadata. + #: Present only for SharedStorageAccessType.documentSelectURL. + urls_with_metadata: typing.Optional[typing.List[SharedStorageUrlWithMetadata]] = None + + #: Key for a specific entry in an origin's shared storage. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.documentAppend, + #: SharedStorageAccessType.documentDelete, + #: SharedStorageAccessType.workletSet, + #: SharedStorageAccessType.workletAppend, + #: SharedStorageAccessType.workletDelete, + #: SharedStorageAccessType.workletGet, + #: SharedStorageAccessType.headerSet, + #: SharedStorageAccessType.headerAppend, and + #: SharedStorageAccessType.headerDelete. + key: typing.Optional[str] = None + + #: Value for a specific entry in an origin's shared storage. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.documentAppend, + #: SharedStorageAccessType.workletSet, + #: SharedStorageAccessType.workletAppend, + #: SharedStorageAccessType.headerSet, and + #: SharedStorageAccessType.headerAppend. + value: typing.Optional[str] = None + + #: Whether or not to set an entry for a key if that key is already present. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.workletSet, and + #: SharedStorageAccessType.headerSet. + ignore_if_present: typing.Optional[bool] = None + + def to_json(self): + json = dict() + if self.script_source_url is not None: + json['scriptSourceUrl'] = self.script_source_url + if self.operation_name is not None: + json['operationName'] = self.operation_name + if self.serialized_data is not None: + json['serializedData'] = self.serialized_data + if self.urls_with_metadata is not None: + json['urlsWithMetadata'] = [i.to_json() for i in self.urls_with_metadata] + if self.key is not None: + json['key'] = self.key + if self.value is not None: + json['value'] = self.value + if self.ignore_if_present is not None: + json['ignoreIfPresent'] = self.ignore_if_present + return json + + @classmethod + def from_json(cls, json): + return cls( + script_source_url=str(json['scriptSourceUrl']) if 'scriptSourceUrl' in json else None, + operation_name=str(json['operationName']) if 'operationName' in json else None, + serialized_data=str(json['serializedData']) if 'serializedData' in json else None, + urls_with_metadata=[SharedStorageUrlWithMetadata.from_json(i) for i in json['urlsWithMetadata']] if 'urlsWithMetadata' in json else None, + key=str(json['key']) if 'key' in json else None, + value=str(json['value']) if 'value' in json else None, + ignore_if_present=bool(json['ignoreIfPresent']) if 'ignoreIfPresent' in json else None, + ) + + +class StorageBucketsDurability(enum.Enum): + RELAXED = "relaxed" + STRICT = "strict" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class StorageBucket: + storage_key: SerializedStorageKey + + #: If not specified, it is the default bucket of the storageKey. + name: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['storageKey'] = self.storage_key.to_json() + if self.name is not None: + json['name'] = self.name + return json + + @classmethod + def from_json(cls, json): + return cls( + storage_key=SerializedStorageKey.from_json(json['storageKey']), + name=str(json['name']) if 'name' in json else None, + ) + + +@dataclass +class StorageBucketInfo: + bucket: StorageBucket + + id_: str + + expiration: network.TimeSinceEpoch + + #: Storage quota (bytes). + quota: float + + persistent: bool + + durability: StorageBucketsDurability + + def to_json(self): + json = dict() + json['bucket'] = self.bucket.to_json() + json['id'] = self.id_ + json['expiration'] = self.expiration.to_json() + json['quota'] = self.quota + json['persistent'] = self.persistent + json['durability'] = self.durability.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + bucket=StorageBucket.from_json(json['bucket']), + id_=str(json['id']), + expiration=network.TimeSinceEpoch.from_json(json['expiration']), + quota=float(json['quota']), + persistent=bool(json['persistent']), + durability=StorageBucketsDurability.from_json(json['durability']), + ) + + +class AttributionReportingSourceType(enum.Enum): + NAVIGATION = "navigation" + EVENT = "event" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class UnsignedInt64AsBase10(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnsignedInt64AsBase10: + return cls(json) + + def __repr__(self): + return 'UnsignedInt64AsBase10({})'.format(super().__repr__()) + + +class UnsignedInt128AsBase16(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnsignedInt128AsBase16: + return cls(json) + + def __repr__(self): + return 'UnsignedInt128AsBase16({})'.format(super().__repr__()) + + +class SignedInt64AsBase10(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SignedInt64AsBase10: + return cls(json) + + def __repr__(self): + return 'SignedInt64AsBase10({})'.format(super().__repr__()) + + +@dataclass +class AttributionReportingFilterDataEntry: + key: str + + values: typing.List[str] + + def to_json(self): + json = dict() + json['key'] = self.key + json['values'] = [i for i in self.values] + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + values=[str(i) for i in json['values']], + ) + + +@dataclass +class AttributionReportingFilterConfig: + filter_values: typing.List[AttributionReportingFilterDataEntry] + + #: duration in seconds + lookback_window: typing.Optional[int] = None + + def to_json(self): + json = dict() + json['filterValues'] = [i.to_json() for i in self.filter_values] + if self.lookback_window is not None: + json['lookbackWindow'] = self.lookback_window + return json + + @classmethod + def from_json(cls, json): + return cls( + filter_values=[AttributionReportingFilterDataEntry.from_json(i) for i in json['filterValues']], + lookback_window=int(json['lookbackWindow']) if 'lookbackWindow' in json else None, + ) + + +@dataclass +class AttributionReportingFilterPair: + filters: typing.List[AttributionReportingFilterConfig] + + not_filters: typing.List[AttributionReportingFilterConfig] + + def to_json(self): + json = dict() + json['filters'] = [i.to_json() for i in self.filters] + json['notFilters'] = [i.to_json() for i in self.not_filters] + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=[AttributionReportingFilterConfig.from_json(i) for i in json['filters']], + not_filters=[AttributionReportingFilterConfig.from_json(i) for i in json['notFilters']], + ) + + +@dataclass +class AttributionReportingAggregationKeysEntry: + key: str + + value: UnsignedInt128AsBase16 + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=UnsignedInt128AsBase16.from_json(json['value']), + ) + + +@dataclass +class AttributionReportingEventReportWindows: + #: duration in seconds + start: int + + #: duration in seconds + ends: typing.List[int] + + def to_json(self): + json = dict() + json['start'] = self.start + json['ends'] = [i for i in self.ends] + return json + + @classmethod + def from_json(cls, json): + return cls( + start=int(json['start']), + ends=[int(i) for i in json['ends']], + ) + + +@dataclass +class AttributionReportingTriggerSpec: + #: number instead of integer because not all uint32 can be represented by + #: int + trigger_data: typing.List[float] + + event_report_windows: AttributionReportingEventReportWindows + + def to_json(self): + json = dict() + json['triggerData'] = [i for i in self.trigger_data] + json['eventReportWindows'] = self.event_report_windows.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + trigger_data=[float(i) for i in json['triggerData']], + event_report_windows=AttributionReportingEventReportWindows.from_json(json['eventReportWindows']), + ) + + +class AttributionReportingTriggerDataMatching(enum.Enum): + EXACT = "exact" + MODULUS = "modulus" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class AttributionReportingAggregatableDebugReportingData: + key_piece: UnsignedInt128AsBase16 + + #: number instead of integer because not all uint32 can be represented by + #: int + value: float + + types: typing.List[str] + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['value'] = self.value + json['types'] = [i for i in self.types] + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + value=float(json['value']), + types=[str(i) for i in json['types']], + ) + + +@dataclass +class AttributionReportingAggregatableDebugReportingConfig: + key_piece: UnsignedInt128AsBase16 + + debug_data: typing.List[AttributionReportingAggregatableDebugReportingData] + + #: number instead of integer because not all uint32 can be represented by + #: int, only present for source registrations + budget: typing.Optional[float] = None + + aggregation_coordinator_origin: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['debugData'] = [i.to_json() for i in self.debug_data] + if self.budget is not None: + json['budget'] = self.budget + if self.aggregation_coordinator_origin is not None: + json['aggregationCoordinatorOrigin'] = self.aggregation_coordinator_origin + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + debug_data=[AttributionReportingAggregatableDebugReportingData.from_json(i) for i in json['debugData']], + budget=float(json['budget']) if 'budget' in json else None, + aggregation_coordinator_origin=str(json['aggregationCoordinatorOrigin']) if 'aggregationCoordinatorOrigin' in json else None, + ) + + +@dataclass +class AttributionScopesData: + values: typing.List[str] + + #: number instead of integer because not all uint32 can be represented by + #: int + limit: float + + max_event_states: float + + def to_json(self): + json = dict() + json['values'] = [i for i in self.values] + json['limit'] = self.limit + json['maxEventStates'] = self.max_event_states + return json + + @classmethod + def from_json(cls, json): + return cls( + values=[str(i) for i in json['values']], + limit=float(json['limit']), + max_event_states=float(json['maxEventStates']), + ) + + +@dataclass +class AttributionReportingSourceRegistration: + time: network.TimeSinceEpoch + + #: duration in seconds + expiry: int + + trigger_specs: typing.List[AttributionReportingTriggerSpec] + + #: duration in seconds + aggregatable_report_window: int + + type_: AttributionReportingSourceType + + source_origin: str + + reporting_origin: str + + destination_sites: typing.List[str] + + event_id: UnsignedInt64AsBase10 + + priority: SignedInt64AsBase10 + + filter_data: typing.List[AttributionReportingFilterDataEntry] + + aggregation_keys: typing.List[AttributionReportingAggregationKeysEntry] + + trigger_data_matching: AttributionReportingTriggerDataMatching + + destination_limit_priority: SignedInt64AsBase10 + + aggregatable_debug_reporting_config: AttributionReportingAggregatableDebugReportingConfig + + max_event_level_reports: int + + debug_key: typing.Optional[UnsignedInt64AsBase10] = None + + scopes_data: typing.Optional[AttributionScopesData] = None + + def to_json(self): + json = dict() + json['time'] = self.time.to_json() + json['expiry'] = self.expiry + json['triggerSpecs'] = [i.to_json() for i in self.trigger_specs] + json['aggregatableReportWindow'] = self.aggregatable_report_window + json['type'] = self.type_.to_json() + json['sourceOrigin'] = self.source_origin + json['reportingOrigin'] = self.reporting_origin + json['destinationSites'] = [i for i in self.destination_sites] + json['eventId'] = self.event_id.to_json() + json['priority'] = self.priority.to_json() + json['filterData'] = [i.to_json() for i in self.filter_data] + json['aggregationKeys'] = [i.to_json() for i in self.aggregation_keys] + json['triggerDataMatching'] = self.trigger_data_matching.to_json() + json['destinationLimitPriority'] = self.destination_limit_priority.to_json() + json['aggregatableDebugReportingConfig'] = self.aggregatable_debug_reporting_config.to_json() + json['maxEventLevelReports'] = self.max_event_level_reports + if self.debug_key is not None: + json['debugKey'] = self.debug_key.to_json() + if self.scopes_data is not None: + json['scopesData'] = self.scopes_data.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + time=network.TimeSinceEpoch.from_json(json['time']), + expiry=int(json['expiry']), + trigger_specs=[AttributionReportingTriggerSpec.from_json(i) for i in json['triggerSpecs']], + aggregatable_report_window=int(json['aggregatableReportWindow']), + type_=AttributionReportingSourceType.from_json(json['type']), + source_origin=str(json['sourceOrigin']), + reporting_origin=str(json['reportingOrigin']), + destination_sites=[str(i) for i in json['destinationSites']], + event_id=UnsignedInt64AsBase10.from_json(json['eventId']), + priority=SignedInt64AsBase10.from_json(json['priority']), + filter_data=[AttributionReportingFilterDataEntry.from_json(i) for i in json['filterData']], + aggregation_keys=[AttributionReportingAggregationKeysEntry.from_json(i) for i in json['aggregationKeys']], + trigger_data_matching=AttributionReportingTriggerDataMatching.from_json(json['triggerDataMatching']), + destination_limit_priority=SignedInt64AsBase10.from_json(json['destinationLimitPriority']), + aggregatable_debug_reporting_config=AttributionReportingAggregatableDebugReportingConfig.from_json(json['aggregatableDebugReportingConfig']), + max_event_level_reports=int(json['maxEventLevelReports']), + debug_key=UnsignedInt64AsBase10.from_json(json['debugKey']) if 'debugKey' in json else None, + scopes_data=AttributionScopesData.from_json(json['scopesData']) if 'scopesData' in json else None, + ) + + +class AttributionReportingSourceRegistrationResult(enum.Enum): + SUCCESS = "success" + INTERNAL_ERROR = "internalError" + INSUFFICIENT_SOURCE_CAPACITY = "insufficientSourceCapacity" + INSUFFICIENT_UNIQUE_DESTINATION_CAPACITY = "insufficientUniqueDestinationCapacity" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + SUCCESS_NOISED = "successNoised" + DESTINATION_REPORTING_LIMIT_REACHED = "destinationReportingLimitReached" + DESTINATION_GLOBAL_LIMIT_REACHED = "destinationGlobalLimitReached" + DESTINATION_BOTH_LIMITS_REACHED = "destinationBothLimitsReached" + REPORTING_ORIGINS_PER_SITE_LIMIT_REACHED = "reportingOriginsPerSiteLimitReached" + EXCEEDS_MAX_CHANNEL_CAPACITY = "exceedsMaxChannelCapacity" + EXCEEDS_MAX_SCOPES_CHANNEL_CAPACITY = "exceedsMaxScopesChannelCapacity" + EXCEEDS_MAX_TRIGGER_STATE_CARDINALITY = "exceedsMaxTriggerStateCardinality" + EXCEEDS_MAX_EVENT_STATES_LIMIT = "exceedsMaxEventStatesLimit" + DESTINATION_PER_DAY_REPORTING_LIMIT_REACHED = "destinationPerDayReportingLimitReached" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AttributionReportingSourceRegistrationTimeConfig(enum.Enum): + INCLUDE = "include" + EXCLUDE = "exclude" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class AttributionReportingAggregatableValueDictEntry: + key: str + + #: number instead of integer because not all uint32 can be represented by + #: int + value: float + + filtering_id: UnsignedInt64AsBase10 + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value + json['filteringId'] = self.filtering_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=float(json['value']), + filtering_id=UnsignedInt64AsBase10.from_json(json['filteringId']), + ) + + +@dataclass +class AttributionReportingAggregatableValueEntry: + values: typing.List[AttributionReportingAggregatableValueDictEntry] + + filters: AttributionReportingFilterPair + + def to_json(self): + json = dict() + json['values'] = [i.to_json() for i in self.values] + json['filters'] = self.filters.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + values=[AttributionReportingAggregatableValueDictEntry.from_json(i) for i in json['values']], + filters=AttributionReportingFilterPair.from_json(json['filters']), + ) + + +@dataclass +class AttributionReportingEventTriggerData: + data: UnsignedInt64AsBase10 + + priority: SignedInt64AsBase10 + + filters: AttributionReportingFilterPair + + dedup_key: typing.Optional[UnsignedInt64AsBase10] = None + + def to_json(self): + json = dict() + json['data'] = self.data.to_json() + json['priority'] = self.priority.to_json() + json['filters'] = self.filters.to_json() + if self.dedup_key is not None: + json['dedupKey'] = self.dedup_key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + data=UnsignedInt64AsBase10.from_json(json['data']), + priority=SignedInt64AsBase10.from_json(json['priority']), + filters=AttributionReportingFilterPair.from_json(json['filters']), + dedup_key=UnsignedInt64AsBase10.from_json(json['dedupKey']) if 'dedupKey' in json else None, + ) + + +@dataclass +class AttributionReportingAggregatableTriggerData: + key_piece: UnsignedInt128AsBase16 + + source_keys: typing.List[str] + + filters: AttributionReportingFilterPair + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['sourceKeys'] = [i for i in self.source_keys] + json['filters'] = self.filters.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + source_keys=[str(i) for i in json['sourceKeys']], + filters=AttributionReportingFilterPair.from_json(json['filters']), + ) + + +@dataclass +class AttributionReportingAggregatableDedupKey: + filters: AttributionReportingFilterPair + + dedup_key: typing.Optional[UnsignedInt64AsBase10] = None + + def to_json(self): + json = dict() + json['filters'] = self.filters.to_json() + if self.dedup_key is not None: + json['dedupKey'] = self.dedup_key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=AttributionReportingFilterPair.from_json(json['filters']), + dedup_key=UnsignedInt64AsBase10.from_json(json['dedupKey']) if 'dedupKey' in json else None, + ) + + +@dataclass +class AttributionReportingTriggerRegistration: + filters: AttributionReportingFilterPair + + aggregatable_dedup_keys: typing.List[AttributionReportingAggregatableDedupKey] + + event_trigger_data: typing.List[AttributionReportingEventTriggerData] + + aggregatable_trigger_data: typing.List[AttributionReportingAggregatableTriggerData] + + aggregatable_values: typing.List[AttributionReportingAggregatableValueEntry] + + aggregatable_filtering_id_max_bytes: int + + debug_reporting: bool + + source_registration_time_config: AttributionReportingSourceRegistrationTimeConfig + + aggregatable_debug_reporting_config: AttributionReportingAggregatableDebugReportingConfig + + scopes: typing.List[str] + + debug_key: typing.Optional[UnsignedInt64AsBase10] = None + + aggregation_coordinator_origin: typing.Optional[str] = None + + trigger_context_id: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['filters'] = self.filters.to_json() + json['aggregatableDedupKeys'] = [i.to_json() for i in self.aggregatable_dedup_keys] + json['eventTriggerData'] = [i.to_json() for i in self.event_trigger_data] + json['aggregatableTriggerData'] = [i.to_json() for i in self.aggregatable_trigger_data] + json['aggregatableValues'] = [i.to_json() for i in self.aggregatable_values] + json['aggregatableFilteringIdMaxBytes'] = self.aggregatable_filtering_id_max_bytes + json['debugReporting'] = self.debug_reporting + json['sourceRegistrationTimeConfig'] = self.source_registration_time_config.to_json() + json['aggregatableDebugReportingConfig'] = self.aggregatable_debug_reporting_config.to_json() + json['scopes'] = [i for i in self.scopes] + if self.debug_key is not None: + json['debugKey'] = self.debug_key.to_json() + if self.aggregation_coordinator_origin is not None: + json['aggregationCoordinatorOrigin'] = self.aggregation_coordinator_origin + if self.trigger_context_id is not None: + json['triggerContextId'] = self.trigger_context_id + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=AttributionReportingFilterPair.from_json(json['filters']), + aggregatable_dedup_keys=[AttributionReportingAggregatableDedupKey.from_json(i) for i in json['aggregatableDedupKeys']], + event_trigger_data=[AttributionReportingEventTriggerData.from_json(i) for i in json['eventTriggerData']], + aggregatable_trigger_data=[AttributionReportingAggregatableTriggerData.from_json(i) for i in json['aggregatableTriggerData']], + aggregatable_values=[AttributionReportingAggregatableValueEntry.from_json(i) for i in json['aggregatableValues']], + aggregatable_filtering_id_max_bytes=int(json['aggregatableFilteringIdMaxBytes']), + debug_reporting=bool(json['debugReporting']), + source_registration_time_config=AttributionReportingSourceRegistrationTimeConfig.from_json(json['sourceRegistrationTimeConfig']), + aggregatable_debug_reporting_config=AttributionReportingAggregatableDebugReportingConfig.from_json(json['aggregatableDebugReportingConfig']), + scopes=[str(i) for i in json['scopes']], + debug_key=UnsignedInt64AsBase10.from_json(json['debugKey']) if 'debugKey' in json else None, + aggregation_coordinator_origin=str(json['aggregationCoordinatorOrigin']) if 'aggregationCoordinatorOrigin' in json else None, + trigger_context_id=str(json['triggerContextId']) if 'triggerContextId' in json else None, + ) + + +class AttributionReportingEventLevelResult(enum.Enum): + SUCCESS = "success" + SUCCESS_DROPPED_LOWER_PRIORITY = "successDroppedLowerPriority" + INTERNAL_ERROR = "internalError" + NO_CAPACITY_FOR_ATTRIBUTION_DESTINATION = "noCapacityForAttributionDestination" + NO_MATCHING_SOURCES = "noMatchingSources" + DEDUPLICATED = "deduplicated" + EXCESSIVE_ATTRIBUTIONS = "excessiveAttributions" + PRIORITY_TOO_LOW = "priorityTooLow" + NEVER_ATTRIBUTED_SOURCE = "neverAttributedSource" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + NO_MATCHING_SOURCE_FILTER_DATA = "noMatchingSourceFilterData" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + NO_MATCHING_CONFIGURATIONS = "noMatchingConfigurations" + EXCESSIVE_REPORTS = "excessiveReports" + FALSELY_ATTRIBUTED_SOURCE = "falselyAttributedSource" + REPORT_WINDOW_PASSED = "reportWindowPassed" + NOT_REGISTERED = "notRegistered" + REPORT_WINDOW_NOT_STARTED = "reportWindowNotStarted" + NO_MATCHING_TRIGGER_DATA = "noMatchingTriggerData" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AttributionReportingAggregatableResult(enum.Enum): + SUCCESS = "success" + INTERNAL_ERROR = "internalError" + NO_CAPACITY_FOR_ATTRIBUTION_DESTINATION = "noCapacityForAttributionDestination" + NO_MATCHING_SOURCES = "noMatchingSources" + EXCESSIVE_ATTRIBUTIONS = "excessiveAttributions" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + NO_HISTOGRAMS = "noHistograms" + INSUFFICIENT_BUDGET = "insufficientBudget" + INSUFFICIENT_NAMED_BUDGET = "insufficientNamedBudget" + NO_MATCHING_SOURCE_FILTER_DATA = "noMatchingSourceFilterData" + NOT_REGISTERED = "notRegistered" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + DEDUPLICATED = "deduplicated" + REPORT_WINDOW_PASSED = "reportWindowPassed" + EXCESSIVE_REPORTS = "excessiveReports" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class RelatedWebsiteSet: + ''' + A single Related Website Set object. + ''' + #: The primary site of this set, along with the ccTLDs if there is any. + primary_sites: typing.List[str] + + #: The associated sites of this set, along with the ccTLDs if there is any. + associated_sites: typing.List[str] + + #: The service sites of this set, along with the ccTLDs if there is any. + service_sites: typing.List[str] + + def to_json(self): + json = dict() + json['primarySites'] = [i for i in self.primary_sites] + json['associatedSites'] = [i for i in self.associated_sites] + json['serviceSites'] = [i for i in self.service_sites] + return json + + @classmethod + def from_json(cls, json): + return cls( + primary_sites=[str(i) for i in json['primarySites']], + associated_sites=[str(i) for i in json['associatedSites']], + service_sites=[str(i) for i in json['serviceSites']], + ) + + +def get_storage_key_for_frame( + frame_id: page.FrameId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SerializedStorageKey]: + ''' + Returns a storage key given a frame id. + + :param frame_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['frameId'] = frame_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getStorageKeyForFrame', + 'params': params, + } + json = yield cmd_dict + return SerializedStorageKey.from_json(json['storageKey']) + + +def clear_data_for_origin( + origin: str, + storage_types: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears storage for origin. + + :param origin: Security origin. + :param storage_types: Comma separated list of StorageType to clear. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['storageTypes'] = storage_types + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearDataForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def clear_data_for_storage_key( + storage_key: str, + storage_types: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears storage for storage key. + + :param storage_key: Storage key. + :param storage_types: Comma separated list of StorageType to clear. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + params['storageTypes'] = storage_types + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearDataForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def get_cookies( + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[network.Cookie]]: + ''' + Returns all browser cookies. + + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + :returns: Array of cookie objects. + ''' + params: T_JSON_DICT = dict() + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getCookies', + 'params': params, + } + json = yield cmd_dict + return [network.Cookie.from_json(i) for i in json['cookies']] + + +def set_cookies( + cookies: typing.List[network.CookieParam], + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets given cookies. + + :param cookies: Cookies to be set. + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + ''' + params: T_JSON_DICT = dict() + params['cookies'] = [i.to_json() for i in cookies] + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setCookies', + 'params': params, + } + json = yield cmd_dict + + +def clear_cookies( + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears cookies. + + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + ''' + params: T_JSON_DICT = dict() + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearCookies', + 'params': params, + } + json = yield cmd_dict + + +def get_usage_and_quota( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[float, float, bool, typing.List[UsageForType]]]: + ''' + Returns usage and quota in bytes. + + :param origin: Security origin. + :returns: A tuple with the following items: + + 0. **usage** - Storage usage (bytes). + 1. **quota** - Storage quota (bytes). + 2. **overrideActive** - Whether or not the origin has an active storage quota override + 3. **usageBreakdown** - Storage usage per type (bytes). + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getUsageAndQuota', + 'params': params, + } + json = yield cmd_dict + return ( + float(json['usage']), + float(json['quota']), + bool(json['overrideActive']), + [UsageForType.from_json(i) for i in json['usageBreakdown']] + ) + + +def override_quota_for_origin( + origin: str, + quota_size: typing.Optional[float] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Override quota for the specified origin + + **EXPERIMENTAL** + + :param origin: Security origin. + :param quota_size: *(Optional)* The quota size (in bytes) to override the original quota with. If this is called multiple times, the overridden quota will be equal to the quotaSize provided in the final call. If this is called without specifying a quotaSize, the quota will be reset to the default value for the specified origin. If this is called multiple times with different origins, the override will be maintained for each origin until it is disabled (called without a quotaSize). + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + if quota_size is not None: + params['quotaSize'] = quota_size + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.overrideQuotaForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_cache_storage_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers origin to be notified when an update occurs to its cache storage list. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackCacheStorageForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_cache_storage_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers storage key to be notified when an update occurs to its cache storage list. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackCacheStorageForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def track_indexed_db_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers origin to be notified when an update occurs to its IndexedDB. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackIndexedDBForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_indexed_db_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers storage key to be notified when an update occurs to its IndexedDB. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackIndexedDBForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def untrack_cache_storage_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters origin from receiving notifications for cache storage. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackCacheStorageForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def untrack_cache_storage_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters storage key from receiving notifications for cache storage. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackCacheStorageForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def untrack_indexed_db_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters origin from receiving notifications for IndexedDB. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackIndexedDBForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def untrack_indexed_db_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters storage key from receiving notifications for IndexedDB. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackIndexedDBForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def get_trust_tokens() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[TrustTokens]]: + ''' + Returns the number of stored Trust Tokens per issuer for the + current browsing context. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getTrustTokens', + } + json = yield cmd_dict + return [TrustTokens.from_json(i) for i in json['tokens']] + + +def clear_trust_tokens( + issuer_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Removes all Trust Tokens issued by the provided issuerOrigin. + Leaves other stored data, including the issuer's Redemption Records, intact. + + **EXPERIMENTAL** + + :param issuer_origin: + :returns: True if any tokens were deleted, false otherwise. + ''' + params: T_JSON_DICT = dict() + params['issuerOrigin'] = issuer_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearTrustTokens', + 'params': params, + } + json = yield cmd_dict + return bool(json['didDeleteTokens']) + + +def get_interest_group_details( + owner_origin: str, + name: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,dict]: + ''' + Gets details for a named interest group. + + **EXPERIMENTAL** + + :param owner_origin: + :param name: + :returns: This largely corresponds to: https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup but has absolute expirationTime instead of relative lifetimeMs and also adds joiningOrigin. + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['name'] = name + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getInterestGroupDetails', + 'params': params, + } + json = yield cmd_dict + return dict(json['details']) + + +def set_interest_group_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/Disables issuing of interestGroupAccessed events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setInterestGroupTracking', + 'params': params, + } + json = yield cmd_dict + + +def set_interest_group_auction_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/Disables issuing of interestGroupAuctionEventOccurred and + interestGroupAuctionNetworkRequestCreated. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setInterestGroupAuctionTracking', + 'params': params, + } + json = yield cmd_dict + + +def get_shared_storage_metadata( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SharedStorageMetadata]: + ''' + Gets metadata for an origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :returns: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getSharedStorageMetadata', + 'params': params, + } + json = yield cmd_dict + return SharedStorageMetadata.from_json(json['metadata']) + + +def get_shared_storage_entries( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[SharedStorageEntry]]: + ''' + Gets the entries in an given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :returns: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getSharedStorageEntries', + 'params': params, + } + json = yield cmd_dict + return [SharedStorageEntry.from_json(i) for i in json['entries']] + + +def set_shared_storage_entry( + owner_origin: str, + key: str, + value: str, + ignore_if_present: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets entry with ``key`` and ``value`` for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :param key: + :param value: + :param ignore_if_present: *(Optional)* If ```ignoreIfPresent```` is included and true, then only sets the entry if ````key``` doesn't already exist. + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['key'] = key + params['value'] = value + if ignore_if_present is not None: + params['ignoreIfPresent'] = ignore_if_present + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setSharedStorageEntry', + 'params': params, + } + json = yield cmd_dict + + +def delete_shared_storage_entry( + owner_origin: str, + key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes entry for ``key`` (if it exists) for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :param key: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['key'] = key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.deleteSharedStorageEntry', + 'params': params, + } + json = yield cmd_dict + + +def clear_shared_storage_entries( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears all entries for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearSharedStorageEntries', + 'params': params, + } + json = yield cmd_dict + + +def reset_shared_storage_budget( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Resets the budget for ``ownerOrigin`` by clearing all budget withdrawals. + + **EXPERIMENTAL** + + :param owner_origin: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.resetSharedStorageBudget', + 'params': params, + } + json = yield cmd_dict + + +def set_shared_storage_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/disables issuing of sharedStorageAccessed events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setSharedStorageTracking', + 'params': params, + } + json = yield cmd_dict + + +def set_storage_bucket_tracking( + storage_key: str, + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Set tracking for a storage key's buckets. + + **EXPERIMENTAL** + + :param storage_key: + :param enable: + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setStorageBucketTracking', + 'params': params, + } + json = yield cmd_dict + + +def delete_storage_bucket( + bucket: StorageBucket + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes the Storage Bucket with the given storage key and bucket name. + + **EXPERIMENTAL** + + :param bucket: + ''' + params: T_JSON_DICT = dict() + params['bucket'] = bucket.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.deleteStorageBucket', + 'params': params, + } + json = yield cmd_dict + + +def run_bounce_tracking_mitigations() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Deletes state for sites identified as potential bounce trackers, immediately. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.runBounceTrackingMitigations', + } + json = yield cmd_dict + return [str(i) for i in json['deletedSites']] + + +def set_attribution_reporting_local_testing_mode( + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + https://wicg.github.io/attribution-reporting-api/ + + **EXPERIMENTAL** + + :param enabled: If enabled, noise is suppressed and reports are sent immediately. + ''' + params: T_JSON_DICT = dict() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setAttributionReportingLocalTestingMode', + 'params': params, + } + json = yield cmd_dict + + +def set_attribution_reporting_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/disables issuing of Attribution Reporting events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setAttributionReportingTracking', + 'params': params, + } + json = yield cmd_dict + + +def send_pending_attribution_reports() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,int]: + ''' + Sends all pending Attribution Reports immediately, regardless of their + scheduled report time. + + **EXPERIMENTAL** + + :returns: The number of reports that were sent. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.sendPendingAttributionReports', + } + json = yield cmd_dict + return int(json['numSent']) + + +def get_related_website_sets() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[RelatedWebsiteSet]]: + ''' + 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. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getRelatedWebsiteSets', + } + json = yield cmd_dict + return [RelatedWebsiteSet.from_json(i) for i in json['sets']] + + +def get_affected_urls_for_third_party_cookie_metadata( + first_party_url: str, + third_party_urls: typing.List[str] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + 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 + + **EXPERIMENTAL** + + :param first_party_url: The URL of the page currently being visited. + :param third_party_urls: The list of embedded resource URLs from the page. + :returns: Array of matching URLs. If there is a primary pattern match for the first- party URL, only the first-party URL is returned in the array. + ''' + params: T_JSON_DICT = dict() + params['firstPartyUrl'] = first_party_url + params['thirdPartyUrls'] = [i for i in third_party_urls] + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getAffectedUrlsForThirdPartyCookieMetadata', + 'params': params, + } + json = yield cmd_dict + return [str(i) for i in json['matchedUrls']] + + +@event_class('Storage.cacheStorageContentUpdated') +@dataclass +class CacheStorageContentUpdated: + ''' + A cache's contents have been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + #: Name of cache in origin. + cache_name: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CacheStorageContentUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']), + cache_name=str(json['cacheName']) + ) + + +@event_class('Storage.cacheStorageListUpdated') +@dataclass +class CacheStorageListUpdated: + ''' + A cache has been added/deleted. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CacheStorageListUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.indexedDBContentUpdated') +@dataclass +class IndexedDBContentUpdated: + ''' + The origin's IndexedDB object store has been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + #: Database to update. + database_name: str + #: ObjectStore to update. + object_store_name: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> IndexedDBContentUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']), + database_name=str(json['databaseName']), + object_store_name=str(json['objectStoreName']) + ) + + +@event_class('Storage.indexedDBListUpdated') +@dataclass +class IndexedDBListUpdated: + ''' + The origin's IndexedDB database list has been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> IndexedDBListUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.interestGroupAccessed') +@dataclass +class InterestGroupAccessed: + ''' + One of the interest groups was accessed. Note that these events are global + to all targets sharing an interest group store. + ''' + access_time: network.TimeSinceEpoch + type_: InterestGroupAccessType + owner_origin: str + name: str + #: For topLevelBid/topLevelAdditionalBid, and when appropriate, + #: win and additionalBidWin + component_seller_origin: typing.Optional[str] + #: For bid or somethingBid event, if done locally and not on a server. + bid: typing.Optional[float] + bid_currency: typing.Optional[str] + #: For non-global events --- links to interestGroupAuctionEvent + unique_auction_id: typing.Optional[InterestGroupAuctionId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAccessed: + return cls( + access_time=network.TimeSinceEpoch.from_json(json['accessTime']), + type_=InterestGroupAccessType.from_json(json['type']), + owner_origin=str(json['ownerOrigin']), + name=str(json['name']), + component_seller_origin=str(json['componentSellerOrigin']) if 'componentSellerOrigin' in json else None, + bid=float(json['bid']) if 'bid' in json else None, + bid_currency=str(json['bidCurrency']) if 'bidCurrency' in json else None, + unique_auction_id=InterestGroupAuctionId.from_json(json['uniqueAuctionId']) if 'uniqueAuctionId' in json else None + ) + + +@event_class('Storage.interestGroupAuctionEventOccurred') +@dataclass +class InterestGroupAuctionEventOccurred: + ''' + An auction involving interest groups is taking place. These events are + target-specific. + ''' + event_time: network.TimeSinceEpoch + type_: InterestGroupAuctionEventType + unique_auction_id: InterestGroupAuctionId + #: Set for child auctions. + parent_auction_id: typing.Optional[InterestGroupAuctionId] + #: Set for started and configResolved + auction_config: typing.Optional[dict] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAuctionEventOccurred: + return cls( + event_time=network.TimeSinceEpoch.from_json(json['eventTime']), + type_=InterestGroupAuctionEventType.from_json(json['type']), + unique_auction_id=InterestGroupAuctionId.from_json(json['uniqueAuctionId']), + parent_auction_id=InterestGroupAuctionId.from_json(json['parentAuctionId']) if 'parentAuctionId' in json else None, + auction_config=dict(json['auctionConfig']) if 'auctionConfig' in json else None + ) + + +@event_class('Storage.interestGroupAuctionNetworkRequestCreated') +@dataclass +class InterestGroupAuctionNetworkRequestCreated: + ''' + 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). + ''' + type_: InterestGroupAuctionFetchType + request_id: network.RequestId + #: 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. + auctions: typing.List[InterestGroupAuctionId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAuctionNetworkRequestCreated: + return cls( + type_=InterestGroupAuctionFetchType.from_json(json['type']), + request_id=network.RequestId.from_json(json['requestId']), + auctions=[InterestGroupAuctionId.from_json(i) for i in json['auctions']] + ) + + +@event_class('Storage.sharedStorageAccessed') +@dataclass +class SharedStorageAccessed: + ''' + Shared storage was accessed by the associated page. + The following parameters are included in all events. + ''' + #: Time of the access. + access_time: network.TimeSinceEpoch + #: Enum value indicating the Shared Storage API method invoked. + type_: SharedStorageAccessType + #: DevTools Frame Token for the primary frame tree's root. + main_frame_id: page.FrameId + #: Serialized origin for the context that invoked the Shared Storage API. + owner_origin: str + #: The sub-parameters wrapped by ``params`` are all optional and their + #: presence/absence depends on ``type``. + params: SharedStorageAccessParams + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> SharedStorageAccessed: + return cls( + access_time=network.TimeSinceEpoch.from_json(json['accessTime']), + type_=SharedStorageAccessType.from_json(json['type']), + main_frame_id=page.FrameId.from_json(json['mainFrameId']), + owner_origin=str(json['ownerOrigin']), + params=SharedStorageAccessParams.from_json(json['params']) + ) + + +@event_class('Storage.storageBucketCreatedOrUpdated') +@dataclass +class StorageBucketCreatedOrUpdated: + bucket_info: StorageBucketInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> StorageBucketCreatedOrUpdated: + return cls( + bucket_info=StorageBucketInfo.from_json(json['bucketInfo']) + ) + + +@event_class('Storage.storageBucketDeleted') +@dataclass +class StorageBucketDeleted: + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> StorageBucketDeleted: + return cls( + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.attributionReportingSourceRegistered') +@dataclass +class AttributionReportingSourceRegistered: + ''' + **EXPERIMENTAL** + + + ''' + registration: AttributionReportingSourceRegistration + result: AttributionReportingSourceRegistrationResult + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttributionReportingSourceRegistered: + return cls( + registration=AttributionReportingSourceRegistration.from_json(json['registration']), + result=AttributionReportingSourceRegistrationResult.from_json(json['result']) + ) + + +@event_class('Storage.attributionReportingTriggerRegistered') +@dataclass +class AttributionReportingTriggerRegistered: + ''' + **EXPERIMENTAL** + + + ''' + registration: AttributionReportingTriggerRegistration + event_level: AttributionReportingEventLevelResult + aggregatable: AttributionReportingAggregatableResult + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttributionReportingTriggerRegistered: + return cls( + registration=AttributionReportingTriggerRegistration.from_json(json['registration']), + event_level=AttributionReportingEventLevelResult.from_json(json['eventLevel']), + aggregatable=AttributionReportingAggregatableResult.from_json(json['aggregatable']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/system_info.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/system_info.py new file mode 100644 index 0000000..d1b2f6b --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/system_info.py @@ -0,0 +1,366 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: SystemInfo (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +@dataclass +class GPUDevice: + ''' + Describes a single graphics processor (GPU). + ''' + #: PCI ID of the GPU vendor, if available; 0 otherwise. + vendor_id: float + + #: PCI ID of the GPU device, if available; 0 otherwise. + device_id: float + + #: String description of the GPU vendor, if the PCI ID is not available. + vendor_string: str + + #: String description of the GPU device, if the PCI ID is not available. + device_string: str + + #: String description of the GPU driver vendor. + driver_vendor: str + + #: String description of the GPU driver version. + driver_version: str + + #: Sub sys ID of the GPU, only available on Windows. + sub_sys_id: typing.Optional[float] = None + + #: Revision of the GPU, only available on Windows. + revision: typing.Optional[float] = None + + def to_json(self): + json = dict() + json['vendorId'] = self.vendor_id + json['deviceId'] = self.device_id + json['vendorString'] = self.vendor_string + json['deviceString'] = self.device_string + json['driverVendor'] = self.driver_vendor + json['driverVersion'] = self.driver_version + if self.sub_sys_id is not None: + json['subSysId'] = self.sub_sys_id + if self.revision is not None: + json['revision'] = self.revision + return json + + @classmethod + def from_json(cls, json): + return cls( + vendor_id=float(json['vendorId']), + device_id=float(json['deviceId']), + vendor_string=str(json['vendorString']), + device_string=str(json['deviceString']), + driver_vendor=str(json['driverVendor']), + driver_version=str(json['driverVersion']), + sub_sys_id=float(json['subSysId']) if 'subSysId' in json else None, + revision=float(json['revision']) if 'revision' in json else None, + ) + + +@dataclass +class Size: + ''' + Describes the width and height dimensions of an entity. + ''' + #: Width in pixels. + width: int + + #: Height in pixels. + height: int + + def to_json(self): + json = dict() + json['width'] = self.width + json['height'] = self.height + return json + + @classmethod + def from_json(cls, json): + return cls( + width=int(json['width']), + height=int(json['height']), + ) + + +@dataclass +class VideoDecodeAcceleratorCapability: + ''' + Describes a supported video decoding profile with its associated minimum and + maximum resolutions. + ''' + #: Video codec profile that is supported, e.g. VP9 Profile 2. + profile: str + + #: Maximum video dimensions in pixels supported for this ``profile``. + max_resolution: Size + + #: Minimum video dimensions in pixels supported for this ``profile``. + min_resolution: Size + + def to_json(self): + json = dict() + json['profile'] = self.profile + json['maxResolution'] = self.max_resolution.to_json() + json['minResolution'] = self.min_resolution.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + profile=str(json['profile']), + max_resolution=Size.from_json(json['maxResolution']), + min_resolution=Size.from_json(json['minResolution']), + ) + + +@dataclass +class VideoEncodeAcceleratorCapability: + ''' + Describes a supported video encoding profile with its associated maximum + resolution and maximum framerate. + ''' + #: Video codec profile that is supported, e.g H264 Main. + profile: str + + #: Maximum video dimensions in pixels supported for this ``profile``. + max_resolution: Size + + #: 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. + max_framerate_numerator: int + + max_framerate_denominator: int + + def to_json(self): + json = dict() + json['profile'] = self.profile + json['maxResolution'] = self.max_resolution.to_json() + json['maxFramerateNumerator'] = self.max_framerate_numerator + json['maxFramerateDenominator'] = self.max_framerate_denominator + return json + + @classmethod + def from_json(cls, json): + return cls( + profile=str(json['profile']), + max_resolution=Size.from_json(json['maxResolution']), + max_framerate_numerator=int(json['maxFramerateNumerator']), + max_framerate_denominator=int(json['maxFramerateDenominator']), + ) + + +class SubsamplingFormat(enum.Enum): + ''' + YUV subsampling type of the pixels of a given image. + ''' + YUV420 = "yuv420" + YUV422 = "yuv422" + YUV444 = "yuv444" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ImageType(enum.Enum): + ''' + Image format of a given image. + ''' + JPEG = "jpeg" + WEBP = "webp" + UNKNOWN = "unknown" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ImageDecodeAcceleratorCapability: + ''' + Describes a supported image decoding profile with its associated minimum and + maximum resolutions and subsampling. + ''' + #: Image coded, e.g. Jpeg. + image_type: ImageType + + #: Maximum supported dimensions of the image in pixels. + max_dimensions: Size + + #: Minimum supported dimensions of the image in pixels. + min_dimensions: Size + + #: Optional array of supported subsampling formats, e.g. 4:2:0, if known. + subsamplings: typing.List[SubsamplingFormat] + + def to_json(self): + json = dict() + json['imageType'] = self.image_type.to_json() + json['maxDimensions'] = self.max_dimensions.to_json() + json['minDimensions'] = self.min_dimensions.to_json() + json['subsamplings'] = [i.to_json() for i in self.subsamplings] + return json + + @classmethod + def from_json(cls, json): + return cls( + image_type=ImageType.from_json(json['imageType']), + max_dimensions=Size.from_json(json['maxDimensions']), + min_dimensions=Size.from_json(json['minDimensions']), + subsamplings=[SubsamplingFormat.from_json(i) for i in json['subsamplings']], + ) + + +@dataclass +class GPUInfo: + ''' + Provides information about the GPU(s) on the system. + ''' + #: The graphics devices on the system. Element 0 is the primary GPU. + devices: typing.List[GPUDevice] + + #: An optional array of GPU driver bug workarounds. + driver_bug_workarounds: typing.List[str] + + #: Supported accelerated video decoding capabilities. + video_decoding: typing.List[VideoDecodeAcceleratorCapability] + + #: Supported accelerated video encoding capabilities. + video_encoding: typing.List[VideoEncodeAcceleratorCapability] + + #: Supported accelerated image decoding capabilities. + image_decoding: typing.List[ImageDecodeAcceleratorCapability] + + #: An optional dictionary of additional GPU related attributes. + aux_attributes: typing.Optional[dict] = None + + #: An optional dictionary of graphics features and their status. + feature_status: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['devices'] = [i.to_json() for i in self.devices] + json['driverBugWorkarounds'] = [i for i in self.driver_bug_workarounds] + json['videoDecoding'] = [i.to_json() for i in self.video_decoding] + json['videoEncoding'] = [i.to_json() for i in self.video_encoding] + json['imageDecoding'] = [i.to_json() for i in self.image_decoding] + if self.aux_attributes is not None: + json['auxAttributes'] = self.aux_attributes + if self.feature_status is not None: + json['featureStatus'] = self.feature_status + return json + + @classmethod + def from_json(cls, json): + return cls( + devices=[GPUDevice.from_json(i) for i in json['devices']], + driver_bug_workarounds=[str(i) for i in json['driverBugWorkarounds']], + video_decoding=[VideoDecodeAcceleratorCapability.from_json(i) for i in json['videoDecoding']], + video_encoding=[VideoEncodeAcceleratorCapability.from_json(i) for i in json['videoEncoding']], + image_decoding=[ImageDecodeAcceleratorCapability.from_json(i) for i in json['imageDecoding']], + aux_attributes=dict(json['auxAttributes']) if 'auxAttributes' in json else None, + feature_status=dict(json['featureStatus']) if 'featureStatus' in json else None, + ) + + +@dataclass +class ProcessInfo: + ''' + Represents process info. + ''' + #: Specifies process type. + type_: str + + #: Specifies process id. + id_: int + + #: Specifies cumulative CPU usage in seconds across all threads of the + #: process since the process start. + cpu_time: float + + def to_json(self): + json = dict() + json['type'] = self.type_ + json['id'] = self.id_ + json['cpuTime'] = self.cpu_time + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + id_=int(json['id']), + cpu_time=float(json['cpuTime']), + ) + + +def get_info() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[GPUInfo, str, str, str]]: + ''' + Returns information about the system. + + :returns: A tuple with the following items: + + 0. **gpu** - Information about the GPUs on the system. + 1. **modelName** - A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported. + 2. **modelVersion** - A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported. + 3. **commandLine** - The command line string used to launch the browser. Will be the empty string if not supported. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getInfo', + } + json = yield cmd_dict + return ( + GPUInfo.from_json(json['gpu']), + str(json['modelName']), + str(json['modelVersion']), + str(json['commandLine']) + ) + + +def get_feature_state( + feature_state: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Returns information about the feature state. + + :param feature_state: + :returns: + ''' + params: T_JSON_DICT = dict() + params['featureState'] = feature_state + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getFeatureState', + 'params': params, + } + json = yield cmd_dict + return bool(json['featureEnabled']) + + +def get_process_info() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[ProcessInfo]]: + ''' + Returns information about all running processes. + + :returns: An array of process info blocks. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getProcessInfo', + } + json = yield cmd_dict + return [ProcessInfo.from_json(i) for i in json['processInfo']] diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/target.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/target.py new file mode 100644 index 0000000..fe29f4a --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/target.py @@ -0,0 +1,742 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Target +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import browser +from . import page + + +class TargetID(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> TargetID: + return cls(json) + + def __repr__(self): + return 'TargetID({})'.format(super().__repr__()) + + +class SessionID(str): + ''' + Unique identifier of attached debugging session. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SessionID: + return cls(json) + + def __repr__(self): + return 'SessionID({})'.format(super().__repr__()) + + +@dataclass +class TargetInfo: + target_id: TargetID + + #: 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 + type_: str + + title: str + + url: str + + #: Whether the target has an attached client. + attached: bool + + #: Whether the target has access to the originating window. + can_access_opener: bool + + #: Opener target Id + opener_id: typing.Optional[TargetID] = None + + #: Frame id of originating window (is only set if target has an opener). + opener_frame_id: typing.Optional[page.FrameId] = None + + browser_context_id: typing.Optional[browser.BrowserContextID] = None + + #: Provides additional details for specific target types. For example, for + #: the type of "page", this may be set to "prerender". + subtype: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['targetId'] = self.target_id.to_json() + json['type'] = self.type_ + json['title'] = self.title + json['url'] = self.url + json['attached'] = self.attached + json['canAccessOpener'] = self.can_access_opener + if self.opener_id is not None: + json['openerId'] = self.opener_id.to_json() + if self.opener_frame_id is not None: + json['openerFrameId'] = self.opener_frame_id.to_json() + if self.browser_context_id is not None: + json['browserContextId'] = self.browser_context_id.to_json() + if self.subtype is not None: + json['subtype'] = self.subtype + return json + + @classmethod + def from_json(cls, json): + return cls( + target_id=TargetID.from_json(json['targetId']), + type_=str(json['type']), + title=str(json['title']), + url=str(json['url']), + attached=bool(json['attached']), + can_access_opener=bool(json['canAccessOpener']), + opener_id=TargetID.from_json(json['openerId']) if 'openerId' in json else None, + opener_frame_id=page.FrameId.from_json(json['openerFrameId']) if 'openerFrameId' in json else None, + browser_context_id=browser.BrowserContextID.from_json(json['browserContextId']) if 'browserContextId' in json else None, + subtype=str(json['subtype']) if 'subtype' in json else None, + ) + + +@dataclass +class FilterEntry: + ''' + A filter used by target query/discovery/auto-attach operations. + ''' + #: If set, causes exclusion of matching targets from the list. + exclude: typing.Optional[bool] = None + + #: If not present, matches any type. + type_: typing.Optional[str] = None + + def to_json(self): + json = dict() + if self.exclude is not None: + json['exclude'] = self.exclude + if self.type_ is not None: + json['type'] = self.type_ + return json + + @classmethod + def from_json(cls, json): + return cls( + exclude=bool(json['exclude']) if 'exclude' in json else None, + type_=str(json['type']) if 'type' in json else None, + ) + + +class TargetFilter(list): + ''' + 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``). + ''' + def to_json(self) -> typing.List[FilterEntry]: + return self + + @classmethod + def from_json(cls, json: typing.List[FilterEntry]) -> TargetFilter: + return cls(json) + + def __repr__(self): + return 'TargetFilter({})'.format(super().__repr__()) + + +@dataclass +class RemoteLocation: + host: str + + port: int + + def to_json(self): + json = dict() + json['host'] = self.host + json['port'] = self.port + return json + + @classmethod + def from_json(cls, json): + return cls( + host=str(json['host']), + port=int(json['port']), + ) + + +class WindowState(enum.Enum): + ''' + The state of the target window. + ''' + NORMAL = "normal" + MINIMIZED = "minimized" + MAXIMIZED = "maximized" + FULLSCREEN = "fullscreen" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def activate_target( + target_id: TargetID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Activates (focuses) the target. + + :param target_id: + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.activateTarget', + 'params': params, + } + json = yield cmd_dict + + +def attach_to_target( + target_id: TargetID, + flatten: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SessionID]: + ''' + Attaches to the target with given id. + + :param target_id: + :param flatten: *(Optional)* 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: Id assigned to the session. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + if flatten is not None: + params['flatten'] = flatten + cmd_dict: T_JSON_DICT = { + 'method': 'Target.attachToTarget', + 'params': params, + } + json = yield cmd_dict + return SessionID.from_json(json['sessionId']) + + +def attach_to_browser_target() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SessionID]: + ''' + Attaches to the browser target, only uses flat sessionId mode. + + **EXPERIMENTAL** + + :returns: Id assigned to the session. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Target.attachToBrowserTarget', + } + json = yield cmd_dict + return SessionID.from_json(json['sessionId']) + + +def close_target( + target_id: TargetID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Closes the target. If the target is a page that gets closed too. + + :param target_id: + :returns: Always set to true. If an error occurs, the response indicates protocol error. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.closeTarget', + 'params': params, + } + json = yield cmd_dict + return bool(json['success']) + + +def expose_dev_tools_protocol( + target_id: TargetID, + binding_name: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + **EXPERIMENTAL** + + :param target_id: + :param binding_name: *(Optional)* Binding name, 'cdp' if not specified. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + if binding_name is not None: + params['bindingName'] = binding_name + cmd_dict: T_JSON_DICT = { + 'method': 'Target.exposeDevToolsProtocol', + 'params': params, + } + json = yield cmd_dict + + +def create_browser_context( + dispose_on_detach: typing.Optional[bool] = None, + proxy_server: typing.Optional[str] = None, + proxy_bypass_list: typing.Optional[str] = None, + origins_with_universal_network_access: typing.Optional[typing.List[str]] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,browser.BrowserContextID]: + ''' + Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than + one. + + :param dispose_on_detach: **(EXPERIMENTAL)** *(Optional)* If specified, disposes this context when debugging session disconnects. + :param proxy_server: **(EXPERIMENTAL)** *(Optional)* Proxy server, similar to the one passed to --proxy-server + :param proxy_bypass_list: **(EXPERIMENTAL)** *(Optional)* Proxy bypass list, similar to the one passed to --proxy-bypass-list + :param origins_with_universal_network_access: **(EXPERIMENTAL)** *(Optional)* An optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored. + :returns: The id of the context created. + ''' + params: T_JSON_DICT = dict() + if dispose_on_detach is not None: + params['disposeOnDetach'] = dispose_on_detach + if proxy_server is not None: + params['proxyServer'] = proxy_server + if proxy_bypass_list is not None: + params['proxyBypassList'] = proxy_bypass_list + if origins_with_universal_network_access is not None: + params['originsWithUniversalNetworkAccess'] = [i for i in origins_with_universal_network_access] + cmd_dict: T_JSON_DICT = { + 'method': 'Target.createBrowserContext', + 'params': params, + } + json = yield cmd_dict + return browser.BrowserContextID.from_json(json['browserContextId']) + + +def get_browser_contexts() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[browser.BrowserContextID]]: + ''' + Returns all browser contexts created with ``Target.createBrowserContext`` method. + + :returns: An array of browser context ids. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getBrowserContexts', + } + json = yield cmd_dict + return [browser.BrowserContextID.from_json(i) for i in json['browserContextIds']] + + +def create_target( + url: str, + left: typing.Optional[int] = None, + top: typing.Optional[int] = None, + width: typing.Optional[int] = None, + height: typing.Optional[int] = None, + window_state: typing.Optional[WindowState] = None, + browser_context_id: typing.Optional[browser.BrowserContextID] = None, + enable_begin_frame_control: typing.Optional[bool] = None, + new_window: typing.Optional[bool] = None, + background: typing.Optional[bool] = None, + for_tab: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,TargetID]: + ''' + Creates a new page. + + :param url: The initial URL the page will be navigated to. An empty string indicates about:blank. + :param left: **(EXPERIMENTAL)** *(Optional)* Frame left origin in DIP (requires newWindow to be true or headless shell). + :param top: **(EXPERIMENTAL)** *(Optional)* Frame top origin in DIP (requires newWindow to be true or headless shell). + :param width: *(Optional)* Frame width in DIP (requires newWindow to be true or headless shell). + :param height: *(Optional)* Frame height in DIP (requires newWindow to be true or headless shell). + :param window_state: *(Optional)* Frame window state (requires newWindow to be true or headless shell). Default is normal. + :param browser_context_id: **(EXPERIMENTAL)** *(Optional)* The browser context to create the page in. + :param enable_begin_frame_control: **(EXPERIMENTAL)** *(Optional)* Whether BeginFrames for this target will be controlled via DevTools (headless shell only, not supported on MacOS yet, false by default). + :param new_window: *(Optional)* Whether to create a new Window or Tab (false by default, not supported by headless shell). + :param background: *(Optional)* Whether to create the target in background or foreground (false by default, not supported by headless shell). + :param for_tab: **(EXPERIMENTAL)** *(Optional)* Whether to create the target of type "tab". + :returns: The id of the page opened. + ''' + params: T_JSON_DICT = dict() + params['url'] = url + if left is not None: + params['left'] = left + if top is not None: + params['top'] = top + if width is not None: + params['width'] = width + if height is not None: + params['height'] = height + if window_state is not None: + params['windowState'] = window_state.to_json() + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + if enable_begin_frame_control is not None: + params['enableBeginFrameControl'] = enable_begin_frame_control + if new_window is not None: + params['newWindow'] = new_window + if background is not None: + params['background'] = background + if for_tab is not None: + params['forTab'] = for_tab + cmd_dict: T_JSON_DICT = { + 'method': 'Target.createTarget', + 'params': params, + } + json = yield cmd_dict + return TargetID.from_json(json['targetId']) + + +def detach_from_target( + session_id: typing.Optional[SessionID] = None, + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Detaches session with given id. + + :param session_id: *(Optional)* Session to detach. + :param target_id: *(Optional)* Deprecated. + ''' + params: T_JSON_DICT = dict() + if session_id is not None: + params['sessionId'] = session_id.to_json() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.detachFromTarget', + 'params': params, + } + json = yield cmd_dict + + +def dispose_browser_context( + browser_context_id: browser.BrowserContextID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes a BrowserContext. All the belonging pages will be closed without calling their + beforeunload hooks. + + :param browser_context_id: + ''' + params: T_JSON_DICT = dict() + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.disposeBrowserContext', + 'params': params, + } + json = yield cmd_dict + + +def get_target_info( + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,TargetInfo]: + ''' + Returns information about a target. + + **EXPERIMENTAL** + + :param target_id: *(Optional)* + :returns: + ''' + params: T_JSON_DICT = dict() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getTargetInfo', + 'params': params, + } + json = yield cmd_dict + return TargetInfo.from_json(json['targetInfo']) + + +def get_targets( + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[TargetInfo]]: + ''' + Retrieves a list of available targets. + + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be reported. If filter is not specified and target discovery is currently enabled, a filter used for target discovery is used for consistency. + :returns: The list of targets. + ''' + params: T_JSON_DICT = dict() + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getTargets', + 'params': params, + } + json = yield cmd_dict + return [TargetInfo.from_json(i) for i in json['targetInfos']] + + +def send_message_to_target( + message: str, + session_id: typing.Optional[SessionID] = None, + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sends protocol message over session with given id. + Consider using flat mode instead; see commands attachToTarget, setAutoAttach, + and crbug.com/991325. + + :param message: + :param session_id: *(Optional)* Identifier of the session. + :param target_id: *(Optional)* Deprecated. + ''' + params: T_JSON_DICT = dict() + params['message'] = message + if session_id is not None: + params['sessionId'] = session_id.to_json() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.sendMessageToTarget', + 'params': params, + } + json = yield cmd_dict + + +def set_auto_attach( + auto_attach: bool, + wait_for_debugger_on_start: bool, + flatten: typing.Optional[bool] = None, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Controls whether to automatically attach to new targets which are considered to be related to + this one. 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. + + :param auto_attach: Whether to auto-attach to related targets. + :param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use ```Runtime.runIfWaitingForDebugger``` to run paused targets. + :param flatten: **(EXPERIMENTAL)** *(Optional)* 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. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. + ''' + params: T_JSON_DICT = dict() + params['autoAttach'] = auto_attach + params['waitForDebuggerOnStart'] = wait_for_debugger_on_start + if flatten is not None: + params['flatten'] = flatten + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setAutoAttach', + 'params': params, + } + json = yield cmd_dict + + +def auto_attach_related( + target_id: TargetID, + wait_for_debugger_on_start: bool, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + **EXPERIMENTAL** + + :param target_id: + :param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use ```Runtime.runIfWaitingForDebugger``` to run paused targets. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + params['waitForDebuggerOnStart'] = wait_for_debugger_on_start + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.autoAttachRelated', + 'params': params, + } + json = yield cmd_dict + + +def set_discover_targets( + discover: bool, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Controls whether to discover available targets and notify via + ``targetCreated/targetInfoChanged/targetDestroyed`` events. + + :param discover: Whether to discover available targets. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. If ```discover```` is false, ````filter``` must be omitted or empty. + ''' + params: T_JSON_DICT = dict() + params['discover'] = discover + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setDiscoverTargets', + 'params': params, + } + json = yield cmd_dict + + +def set_remote_locations( + locations: typing.List[RemoteLocation] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables target discovery for the specified locations, when ``setDiscoverTargets`` was set to + ``true``. + + **EXPERIMENTAL** + + :param locations: List of remote locations. + ''' + params: T_JSON_DICT = dict() + params['locations'] = [i.to_json() for i in locations] + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setRemoteLocations', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Target.attachedToTarget') +@dataclass +class AttachedToTarget: + ''' + **EXPERIMENTAL** + + Issued when attached to target because of auto-attach or ``attachToTarget`` command. + ''' + #: Identifier assigned to the session used to send/receive messages. + session_id: SessionID + target_info: TargetInfo + waiting_for_debugger: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttachedToTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + target_info=TargetInfo.from_json(json['targetInfo']), + waiting_for_debugger=bool(json['waitingForDebugger']) + ) + + +@event_class('Target.detachedFromTarget') +@dataclass +class DetachedFromTarget: + ''' + **EXPERIMENTAL** + + 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. + ''' + #: Detached session identifier. + session_id: SessionID + #: Deprecated. + target_id: typing.Optional[TargetID] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DetachedFromTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + target_id=TargetID.from_json(json['targetId']) if 'targetId' in json else None + ) + + +@event_class('Target.receivedMessageFromTarget') +@dataclass +class ReceivedMessageFromTarget: + ''' + Notifies about a new protocol message received from the session (as reported in + ``attachedToTarget`` event). + ''' + #: Identifier of a session which sends a message. + session_id: SessionID + message: str + #: Deprecated. + target_id: typing.Optional[TargetID] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ReceivedMessageFromTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + message=str(json['message']), + target_id=TargetID.from_json(json['targetId']) if 'targetId' in json else None + ) + + +@event_class('Target.targetCreated') +@dataclass +class TargetCreated: + ''' + Issued when a possible inspection target is created. + ''' + target_info: TargetInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetCreated: + return cls( + target_info=TargetInfo.from_json(json['targetInfo']) + ) + + +@event_class('Target.targetDestroyed') +@dataclass +class TargetDestroyed: + ''' + Issued when a target is destroyed. + ''' + target_id: TargetID + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetDestroyed: + return cls( + target_id=TargetID.from_json(json['targetId']) + ) + + +@event_class('Target.targetCrashed') +@dataclass +class TargetCrashed: + ''' + Issued when a target has crashed. + ''' + target_id: TargetID + #: Termination status type. + status: str + #: Termination error code. + error_code: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetCrashed: + return cls( + target_id=TargetID.from_json(json['targetId']), + status=str(json['status']), + error_code=int(json['errorCode']) + ) + + +@event_class('Target.targetInfoChanged') +@dataclass +class TargetInfoChanged: + ''' + Issued when some information about a target has changed. This only happens between + ``targetCreated`` and ``targetDestroyed``. + ''' + target_info: TargetInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetInfoChanged: + return cls( + target_info=TargetInfo.from_json(json['targetInfo']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/tethering.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/tethering.py new file mode 100644 index 0000000..af358ad --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/tethering.py @@ -0,0 +1,63 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Tethering (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +def bind( + port: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Request browser port binding. + + :param port: Port number to bind. + ''' + params: T_JSON_DICT = dict() + params['port'] = port + cmd_dict: T_JSON_DICT = { + 'method': 'Tethering.bind', + 'params': params, + } + json = yield cmd_dict + + +def unbind( + port: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Request browser port unbinding. + + :param port: Port number to unbind. + ''' + params: T_JSON_DICT = dict() + params['port'] = port + cmd_dict: T_JSON_DICT = { + 'method': 'Tethering.unbind', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Tethering.accepted') +@dataclass +class Accepted: + ''' + Informs that port was successfully bound and got a specified connection id. + ''' + #: Port number that was successfully bound. + port: int + #: Connection id to be used. + connection_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> Accepted: + return cls( + port=int(json['port']), + connection_id=str(json['connectionId']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/tracing.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/tracing.py new file mode 100644 index 0000000..9952697 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/tracing.py @@ -0,0 +1,360 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Tracing +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import io + + +class MemoryDumpConfig(dict): + ''' + Configuration for memory dump. Used only when "memory-infra" category is enabled. + ''' + def to_json(self) -> dict: + return self + + @classmethod + def from_json(cls, json: dict) -> MemoryDumpConfig: + return cls(json) + + def __repr__(self): + return 'MemoryDumpConfig({})'.format(super().__repr__()) + + +@dataclass +class TraceConfig: + #: Controls how the trace buffer stores data. + record_mode: typing.Optional[str] = None + + #: Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value + #: of 200 MB would be used. + trace_buffer_size_in_kb: typing.Optional[float] = None + + #: Turns on JavaScript stack sampling. + enable_sampling: typing.Optional[bool] = None + + #: Turns on system tracing. + enable_systrace: typing.Optional[bool] = None + + #: Turns on argument filter. + enable_argument_filter: typing.Optional[bool] = None + + #: Included category filters. + included_categories: typing.Optional[typing.List[str]] = None + + #: Excluded category filters. + excluded_categories: typing.Optional[typing.List[str]] = None + + #: Configuration to synthesize the delays in tracing. + synthetic_delays: typing.Optional[typing.List[str]] = None + + #: Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. + memory_dump_config: typing.Optional[MemoryDumpConfig] = None + + def to_json(self): + json = dict() + if self.record_mode is not None: + json['recordMode'] = self.record_mode + if self.trace_buffer_size_in_kb is not None: + json['traceBufferSizeInKb'] = self.trace_buffer_size_in_kb + if self.enable_sampling is not None: + json['enableSampling'] = self.enable_sampling + if self.enable_systrace is not None: + json['enableSystrace'] = self.enable_systrace + if self.enable_argument_filter is not None: + json['enableArgumentFilter'] = self.enable_argument_filter + if self.included_categories is not None: + json['includedCategories'] = [i for i in self.included_categories] + if self.excluded_categories is not None: + json['excludedCategories'] = [i for i in self.excluded_categories] + if self.synthetic_delays is not None: + json['syntheticDelays'] = [i for i in self.synthetic_delays] + if self.memory_dump_config is not None: + json['memoryDumpConfig'] = self.memory_dump_config.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + record_mode=str(json['recordMode']) if 'recordMode' in json else None, + trace_buffer_size_in_kb=float(json['traceBufferSizeInKb']) if 'traceBufferSizeInKb' in json else None, + enable_sampling=bool(json['enableSampling']) if 'enableSampling' in json else None, + enable_systrace=bool(json['enableSystrace']) if 'enableSystrace' in json else None, + enable_argument_filter=bool(json['enableArgumentFilter']) if 'enableArgumentFilter' in json else None, + included_categories=[str(i) for i in json['includedCategories']] if 'includedCategories' in json else None, + excluded_categories=[str(i) for i in json['excludedCategories']] if 'excludedCategories' in json else None, + synthetic_delays=[str(i) for i in json['syntheticDelays']] if 'syntheticDelays' in json else None, + memory_dump_config=MemoryDumpConfig.from_json(json['memoryDumpConfig']) if 'memoryDumpConfig' in json else None, + ) + + +class StreamFormat(enum.Enum): + ''' + 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. + ''' + JSON = "json" + PROTO = "proto" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class StreamCompression(enum.Enum): + ''' + Compression type to use for traces returned via streams. + ''' + NONE = "none" + GZIP = "gzip" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class MemoryDumpLevelOfDetail(enum.Enum): + ''' + Details exposed when memory request explicitly declared. + Keep consistent with memory_dump_request_args.h and + memory_instrumentation.mojom + ''' + BACKGROUND = "background" + LIGHT = "light" + DETAILED = "detailed" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class TracingBackend(enum.Enum): + ''' + 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``. + ''' + AUTO = "auto" + CHROME = "chrome" + SYSTEM = "system" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def end() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Stop trace events collection. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.end', + } + json = yield cmd_dict + + +def get_categories() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Gets supported tracing categories. + + **EXPERIMENTAL** + + :returns: A list of supported tracing categories. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.getCategories', + } + json = yield cmd_dict + return [str(i) for i in json['categories']] + + +def record_clock_sync_marker( + sync_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Record a clock sync marker in the trace. + + **EXPERIMENTAL** + + :param sync_id: The ID of this clock sync marker + ''' + params: T_JSON_DICT = dict() + params['syncId'] = sync_id + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.recordClockSyncMarker', + 'params': params, + } + json = yield cmd_dict + + +def request_memory_dump( + deterministic: typing.Optional[bool] = None, + level_of_detail: typing.Optional[MemoryDumpLevelOfDetail] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[str, bool]]: + ''' + Request a global memory dump. + + **EXPERIMENTAL** + + :param deterministic: *(Optional)* Enables more deterministic results by forcing garbage collection + :param level_of_detail: *(Optional)* Specifies level of details in memory dump. Defaults to "detailed". + :returns: A tuple with the following items: + + 0. **dumpGuid** - GUID of the resulting global memory dump. + 1. **success** - True iff the global memory dump succeeded. + ''' + params: T_JSON_DICT = dict() + if deterministic is not None: + params['deterministic'] = deterministic + if level_of_detail is not None: + params['levelOfDetail'] = level_of_detail.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.requestMemoryDump', + 'params': params, + } + json = yield cmd_dict + return ( + str(json['dumpGuid']), + bool(json['success']) + ) + + +def start( + categories: typing.Optional[str] = None, + options: typing.Optional[str] = None, + buffer_usage_reporting_interval: typing.Optional[float] = None, + transfer_mode: typing.Optional[str] = None, + stream_format: typing.Optional[StreamFormat] = None, + stream_compression: typing.Optional[StreamCompression] = None, + trace_config: typing.Optional[TraceConfig] = None, + perfetto_config: typing.Optional[str] = None, + tracing_backend: typing.Optional[TracingBackend] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Start trace events collection. + + :param categories: **(EXPERIMENTAL)** *(Optional)* Category/tag filter + :param options: **(EXPERIMENTAL)** *(Optional)* Tracing options + :param buffer_usage_reporting_interval: **(EXPERIMENTAL)** *(Optional)* If set, the agent will issue bufferUsage events at this interval, specified in milliseconds + :param transfer_mode: *(Optional)* Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ```ReportEvents````). + :param stream_format: *(Optional)* Trace data format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````json````). + :param stream_compression: **(EXPERIMENTAL)** *(Optional)* Compression format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````none````) + :param trace_config: *(Optional)* + :param perfetto_config: **(EXPERIMENTAL)** *(Optional)* Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters ````categories````, ````options````, ````traceConfig```` are ignored. + :param tracing_backend: **(EXPERIMENTAL)** *(Optional)* Backend type (defaults to ````auto```) + ''' + params: T_JSON_DICT = dict() + if categories is not None: + params['categories'] = categories + if options is not None: + params['options'] = options + if buffer_usage_reporting_interval is not None: + params['bufferUsageReportingInterval'] = buffer_usage_reporting_interval + if transfer_mode is not None: + params['transferMode'] = transfer_mode + if stream_format is not None: + params['streamFormat'] = stream_format.to_json() + if stream_compression is not None: + params['streamCompression'] = stream_compression.to_json() + if trace_config is not None: + params['traceConfig'] = trace_config.to_json() + if perfetto_config is not None: + params['perfettoConfig'] = perfetto_config + if tracing_backend is not None: + params['tracingBackend'] = tracing_backend.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.start', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Tracing.bufferUsage') +@dataclass +class BufferUsage: + ''' + **EXPERIMENTAL** + + + ''' + #: A number in range [0..1] that indicates the used size of event buffer as a fraction of its + #: total size. + percent_full: typing.Optional[float] + #: An approximate number of events in the trace log. + event_count: typing.Optional[float] + #: A number in range [0..1] that indicates the used size of event buffer as a fraction of its + #: total size. + value: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> BufferUsage: + return cls( + percent_full=float(json['percentFull']) if 'percentFull' in json else None, + event_count=float(json['eventCount']) if 'eventCount' in json else None, + value=float(json['value']) if 'value' in json else None + ) + + +@event_class('Tracing.dataCollected') +@dataclass +class DataCollected: + ''' + **EXPERIMENTAL** + + 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. + ''' + value: typing.List[dict] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DataCollected: + return cls( + value=[dict(i) for i in json['value']] + ) + + +@event_class('Tracing.tracingComplete') +@dataclass +class TracingComplete: + ''' + Signals that tracing is stopped and there is no trace buffers pending flush, all data were + delivered via dataCollected events. + ''' + #: Indicates whether some trace data is known to have been lost, e.g. because the trace ring + #: buffer wrapped around. + data_loss_occurred: bool + #: A handle of the stream that holds resulting trace data. + stream: typing.Optional[io.StreamHandle] + #: Trace data format of returned stream. + trace_format: typing.Optional[StreamFormat] + #: Compression format of returned stream. + stream_compression: typing.Optional[StreamCompression] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TracingComplete: + return cls( + data_loss_occurred=bool(json['dataLossOccurred']), + stream=io.StreamHandle.from_json(json['stream']) if 'stream' in json else None, + trace_format=StreamFormat.from_json(json['traceFormat']) if 'traceFormat' in json else None, + stream_compression=StreamCompression.from_json(json['streamCompression']) if 'streamCompression' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/util.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/util.py new file mode 100644 index 0000000..93a39ef --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/util.py @@ -0,0 +1,20 @@ + +import typing + + +T_JSON_DICT = typing.Dict[str, typing.Any] +_event_parsers = dict() + + +def event_class(method): + ''' A decorator that registers a class as an event class. ''' + def decorate(cls): + _event_parsers[method] = cls + cls.event_class = method + return cls + return decorate + + +def parse_json_event(json: T_JSON_DICT) -> typing.Any: + ''' Parse a JSON dictionary into a CDP event. ''' + return _event_parsers[json['method']].from_json(json['params']) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/web_audio.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/web_audio.py new file mode 100644 index 0000000..7e9c1c4 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/web_audio.py @@ -0,0 +1,604 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: WebAudio (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class GraphObjectId(str): + ''' + An unique ID for a graph object (AudioContext, AudioNode, AudioParam) in Web Audio API + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> GraphObjectId: + return cls(json) + + def __repr__(self): + return 'GraphObjectId({})'.format(super().__repr__()) + + +class ContextType(enum.Enum): + ''' + Enum of BaseAudioContext types + ''' + REALTIME = "realtime" + OFFLINE = "offline" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ContextState(enum.Enum): + ''' + Enum of AudioContextState from the spec + ''' + SUSPENDED = "suspended" + RUNNING = "running" + CLOSED = "closed" + INTERRUPTED = "interrupted" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class NodeType(str): + ''' + Enum of AudioNode types + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> NodeType: + return cls(json) + + def __repr__(self): + return 'NodeType({})'.format(super().__repr__()) + + +class ChannelCountMode(enum.Enum): + ''' + Enum of AudioNode::ChannelCountMode from the spec + ''' + CLAMPED_MAX = "clamped-max" + EXPLICIT = "explicit" + MAX_ = "max" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ChannelInterpretation(enum.Enum): + ''' + Enum of AudioNode::ChannelInterpretation from the spec + ''' + DISCRETE = "discrete" + SPEAKERS = "speakers" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ParamType(str): + ''' + Enum of AudioParam types + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> ParamType: + return cls(json) + + def __repr__(self): + return 'ParamType({})'.format(super().__repr__()) + + +class AutomationRate(enum.Enum): + ''' + Enum of AudioParam::AutomationRate from the spec + ''' + A_RATE = "a-rate" + K_RATE = "k-rate" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ContextRealtimeData: + ''' + Fields in AudioContext that change in real-time. + ''' + #: The current context time in second in BaseAudioContext. + current_time: float + + #: 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. + render_capacity: float + + #: A running mean of callback interval. + callback_interval_mean: float + + #: A running variance of callback interval. + callback_interval_variance: float + + def to_json(self): + json = dict() + json['currentTime'] = self.current_time + json['renderCapacity'] = self.render_capacity + json['callbackIntervalMean'] = self.callback_interval_mean + json['callbackIntervalVariance'] = self.callback_interval_variance + return json + + @classmethod + def from_json(cls, json): + return cls( + current_time=float(json['currentTime']), + render_capacity=float(json['renderCapacity']), + callback_interval_mean=float(json['callbackIntervalMean']), + callback_interval_variance=float(json['callbackIntervalVariance']), + ) + + +@dataclass +class BaseAudioContext: + ''' + Protocol object for BaseAudioContext + ''' + context_id: GraphObjectId + + context_type: ContextType + + context_state: ContextState + + #: Platform-dependent callback buffer size. + callback_buffer_size: float + + #: Number of output channels supported by audio hardware in use. + max_output_channel_count: float + + #: Context sample rate. + sample_rate: float + + realtime_data: typing.Optional[ContextRealtimeData] = None + + def to_json(self): + json = dict() + json['contextId'] = self.context_id.to_json() + json['contextType'] = self.context_type.to_json() + json['contextState'] = self.context_state.to_json() + json['callbackBufferSize'] = self.callback_buffer_size + json['maxOutputChannelCount'] = self.max_output_channel_count + json['sampleRate'] = self.sample_rate + if self.realtime_data is not None: + json['realtimeData'] = self.realtime_data.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + context_type=ContextType.from_json(json['contextType']), + context_state=ContextState.from_json(json['contextState']), + callback_buffer_size=float(json['callbackBufferSize']), + max_output_channel_count=float(json['maxOutputChannelCount']), + sample_rate=float(json['sampleRate']), + realtime_data=ContextRealtimeData.from_json(json['realtimeData']) if 'realtimeData' in json else None, + ) + + +@dataclass +class AudioListener: + ''' + Protocol object for AudioListener + ''' + listener_id: GraphObjectId + + context_id: GraphObjectId + + def to_json(self): + json = dict() + json['listenerId'] = self.listener_id.to_json() + json['contextId'] = self.context_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + listener_id=GraphObjectId.from_json(json['listenerId']), + context_id=GraphObjectId.from_json(json['contextId']), + ) + + +@dataclass +class AudioNode: + ''' + Protocol object for AudioNode + ''' + node_id: GraphObjectId + + context_id: GraphObjectId + + node_type: NodeType + + number_of_inputs: float + + number_of_outputs: float + + channel_count: float + + channel_count_mode: ChannelCountMode + + channel_interpretation: ChannelInterpretation + + def to_json(self): + json = dict() + json['nodeId'] = self.node_id.to_json() + json['contextId'] = self.context_id.to_json() + json['nodeType'] = self.node_type.to_json() + json['numberOfInputs'] = self.number_of_inputs + json['numberOfOutputs'] = self.number_of_outputs + json['channelCount'] = self.channel_count + json['channelCountMode'] = self.channel_count_mode.to_json() + json['channelInterpretation'] = self.channel_interpretation.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + node_id=GraphObjectId.from_json(json['nodeId']), + context_id=GraphObjectId.from_json(json['contextId']), + node_type=NodeType.from_json(json['nodeType']), + number_of_inputs=float(json['numberOfInputs']), + number_of_outputs=float(json['numberOfOutputs']), + channel_count=float(json['channelCount']), + channel_count_mode=ChannelCountMode.from_json(json['channelCountMode']), + channel_interpretation=ChannelInterpretation.from_json(json['channelInterpretation']), + ) + + +@dataclass +class AudioParam: + ''' + Protocol object for AudioParam + ''' + param_id: GraphObjectId + + node_id: GraphObjectId + + context_id: GraphObjectId + + param_type: ParamType + + rate: AutomationRate + + default_value: float + + min_value: float + + max_value: float + + def to_json(self): + json = dict() + json['paramId'] = self.param_id.to_json() + json['nodeId'] = self.node_id.to_json() + json['contextId'] = self.context_id.to_json() + json['paramType'] = self.param_type.to_json() + json['rate'] = self.rate.to_json() + json['defaultValue'] = self.default_value + json['minValue'] = self.min_value + json['maxValue'] = self.max_value + return json + + @classmethod + def from_json(cls, json): + return cls( + param_id=GraphObjectId.from_json(json['paramId']), + node_id=GraphObjectId.from_json(json['nodeId']), + context_id=GraphObjectId.from_json(json['contextId']), + param_type=ParamType.from_json(json['paramType']), + rate=AutomationRate.from_json(json['rate']), + default_value=float(json['defaultValue']), + min_value=float(json['minValue']), + max_value=float(json['maxValue']), + ) + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables the WebAudio domain and starts sending context lifetime events. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.enable', + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables the WebAudio domain. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.disable', + } + json = yield cmd_dict + + +def get_realtime_data( + context_id: GraphObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,ContextRealtimeData]: + ''' + Fetch the realtime data from the registered contexts. + + :param context_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['contextId'] = context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.getRealtimeData', + 'params': params, + } + json = yield cmd_dict + return ContextRealtimeData.from_json(json['realtimeData']) + + +@event_class('WebAudio.contextCreated') +@dataclass +class ContextCreated: + ''' + Notifies that a new BaseAudioContext has been created. + ''' + context: BaseAudioContext + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextCreated: + return cls( + context=BaseAudioContext.from_json(json['context']) + ) + + +@event_class('WebAudio.contextWillBeDestroyed') +@dataclass +class ContextWillBeDestroyed: + ''' + Notifies that an existing BaseAudioContext will be destroyed. + ''' + context_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']) + ) + + +@event_class('WebAudio.contextChanged') +@dataclass +class ContextChanged: + ''' + Notifies that existing BaseAudioContext has changed some properties (id stays the same).. + ''' + context: BaseAudioContext + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextChanged: + return cls( + context=BaseAudioContext.from_json(json['context']) + ) + + +@event_class('WebAudio.audioListenerCreated') +@dataclass +class AudioListenerCreated: + ''' + Notifies that the construction of an AudioListener has finished. + ''' + listener: AudioListener + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioListenerCreated: + return cls( + listener=AudioListener.from_json(json['listener']) + ) + + +@event_class('WebAudio.audioListenerWillBeDestroyed') +@dataclass +class AudioListenerWillBeDestroyed: + ''' + Notifies that a new AudioListener has been created. + ''' + context_id: GraphObjectId + listener_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioListenerWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + listener_id=GraphObjectId.from_json(json['listenerId']) + ) + + +@event_class('WebAudio.audioNodeCreated') +@dataclass +class AudioNodeCreated: + ''' + Notifies that a new AudioNode has been created. + ''' + node: AudioNode + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioNodeCreated: + return cls( + node=AudioNode.from_json(json['node']) + ) + + +@event_class('WebAudio.audioNodeWillBeDestroyed') +@dataclass +class AudioNodeWillBeDestroyed: + ''' + Notifies that an existing AudioNode has been destroyed. + ''' + context_id: GraphObjectId + node_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioNodeWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + node_id=GraphObjectId.from_json(json['nodeId']) + ) + + +@event_class('WebAudio.audioParamCreated') +@dataclass +class AudioParamCreated: + ''' + Notifies that a new AudioParam has been created. + ''' + param: AudioParam + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioParamCreated: + return cls( + param=AudioParam.from_json(json['param']) + ) + + +@event_class('WebAudio.audioParamWillBeDestroyed') +@dataclass +class AudioParamWillBeDestroyed: + ''' + Notifies that an existing AudioParam has been destroyed. + ''' + context_id: GraphObjectId + node_id: GraphObjectId + param_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioParamWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + node_id=GraphObjectId.from_json(json['nodeId']), + param_id=GraphObjectId.from_json(json['paramId']) + ) + + +@event_class('WebAudio.nodesConnected') +@dataclass +class NodesConnected: + ''' + Notifies that two AudioNodes are connected. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + destination_input_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodesConnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None, + destination_input_index=float(json['destinationInputIndex']) if 'destinationInputIndex' in json else None + ) + + +@event_class('WebAudio.nodesDisconnected') +@dataclass +class NodesDisconnected: + ''' + Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + destination_input_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodesDisconnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None, + destination_input_index=float(json['destinationInputIndex']) if 'destinationInputIndex' in json else None + ) + + +@event_class('WebAudio.nodeParamConnected') +@dataclass +class NodeParamConnected: + ''' + Notifies that an AudioNode is connected to an AudioParam. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodeParamConnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None + ) + + +@event_class('WebAudio.nodeParamDisconnected') +@dataclass +class NodeParamDisconnected: + ''' + Notifies that an AudioNode is disconnected to an AudioParam. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodeParamDisconnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v134/web_authn.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/web_authn.py new file mode 100644 index 0000000..c577b6e --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v134/web_authn.py @@ -0,0 +1,579 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: WebAuthn (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class AuthenticatorId(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> AuthenticatorId: + return cls(json) + + def __repr__(self): + return 'AuthenticatorId({})'.format(super().__repr__()) + + +class AuthenticatorProtocol(enum.Enum): + U2F = "u2f" + CTAP2 = "ctap2" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class Ctap2Version(enum.Enum): + CTAP2_0 = "ctap2_0" + CTAP2_1 = "ctap2_1" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AuthenticatorTransport(enum.Enum): + USB = "usb" + NFC = "nfc" + BLE = "ble" + CABLE = "cable" + INTERNAL = "internal" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class VirtualAuthenticatorOptions: + protocol: AuthenticatorProtocol + + transport: AuthenticatorTransport + + #: Defaults to ctap2_0. Ignored if ``protocol`` == u2f. + ctap2_version: typing.Optional[Ctap2Version] = None + + #: Defaults to false. + has_resident_key: typing.Optional[bool] = None + + #: Defaults to false. + has_user_verification: typing.Optional[bool] = None + + #: If set to true, the authenticator will support the largeBlob extension. + #: https://w3c.github.io/webauthn#largeBlob + #: Defaults to false. + has_large_blob: typing.Optional[bool] = None + + #: 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. + has_cred_blob: typing.Optional[bool] = None + + #: 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. + has_min_pin_length: typing.Optional[bool] = None + + #: If set to true, the authenticator will support the prf extension. + #: https://w3c.github.io/webauthn/#prf-extension + #: Defaults to false. + has_prf: typing.Optional[bool] = None + + #: If set to true, tests of user presence will succeed immediately. + #: Otherwise, they will not be resolved. Defaults to true. + automatic_presence_simulation: typing.Optional[bool] = None + + #: Sets whether User Verification succeeds or fails for an authenticator. + #: Defaults to false. + is_user_verified: typing.Optional[bool] = None + + #: 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 + default_backup_eligibility: typing.Optional[bool] = None + + #: 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 + default_backup_state: typing.Optional[bool] = None + + def to_json(self): + json = dict() + json['protocol'] = self.protocol.to_json() + json['transport'] = self.transport.to_json() + if self.ctap2_version is not None: + json['ctap2Version'] = self.ctap2_version.to_json() + if self.has_resident_key is not None: + json['hasResidentKey'] = self.has_resident_key + if self.has_user_verification is not None: + json['hasUserVerification'] = self.has_user_verification + if self.has_large_blob is not None: + json['hasLargeBlob'] = self.has_large_blob + if self.has_cred_blob is not None: + json['hasCredBlob'] = self.has_cred_blob + if self.has_min_pin_length is not None: + json['hasMinPinLength'] = self.has_min_pin_length + if self.has_prf is not None: + json['hasPrf'] = self.has_prf + if self.automatic_presence_simulation is not None: + json['automaticPresenceSimulation'] = self.automatic_presence_simulation + if self.is_user_verified is not None: + json['isUserVerified'] = self.is_user_verified + if self.default_backup_eligibility is not None: + json['defaultBackupEligibility'] = self.default_backup_eligibility + if self.default_backup_state is not None: + json['defaultBackupState'] = self.default_backup_state + return json + + @classmethod + def from_json(cls, json): + return cls( + protocol=AuthenticatorProtocol.from_json(json['protocol']), + transport=AuthenticatorTransport.from_json(json['transport']), + ctap2_version=Ctap2Version.from_json(json['ctap2Version']) if 'ctap2Version' in json else None, + has_resident_key=bool(json['hasResidentKey']) if 'hasResidentKey' in json else None, + has_user_verification=bool(json['hasUserVerification']) if 'hasUserVerification' in json else None, + has_large_blob=bool(json['hasLargeBlob']) if 'hasLargeBlob' in json else None, + has_cred_blob=bool(json['hasCredBlob']) if 'hasCredBlob' in json else None, + has_min_pin_length=bool(json['hasMinPinLength']) if 'hasMinPinLength' in json else None, + has_prf=bool(json['hasPrf']) if 'hasPrf' in json else None, + automatic_presence_simulation=bool(json['automaticPresenceSimulation']) if 'automaticPresenceSimulation' in json else None, + is_user_verified=bool(json['isUserVerified']) if 'isUserVerified' in json else None, + default_backup_eligibility=bool(json['defaultBackupEligibility']) if 'defaultBackupEligibility' in json else None, + default_backup_state=bool(json['defaultBackupState']) if 'defaultBackupState' in json else None, + ) + + +@dataclass +class Credential: + credential_id: str + + is_resident_credential: bool + + #: The ECDSA P-256 private key in PKCS#8 format. + private_key: str + + #: Signature counter. This is incremented by one for each successful + #: assertion. + #: See https://w3c.github.io/webauthn/#signature-counter + sign_count: int + + #: Relying Party ID the credential is scoped to. Must be set when adding a + #: credential. + rp_id: typing.Optional[str] = None + + #: An opaque byte sequence with a maximum size of 64 bytes mapping the + #: credential to a specific user. + user_handle: typing.Optional[str] = None + + #: The large blob associated with the credential. + #: See https://w3c.github.io/webauthn/#sctn-large-blob-extension + large_blob: typing.Optional[str] = None + + #: Assertions returned by this credential will have the backup eligibility + #: (BE) flag set to this value. Defaults to the authenticator's + #: defaultBackupEligibility value. + backup_eligibility: typing.Optional[bool] = None + + #: Assertions returned by this credential will have the backup state (BS) + #: flag set to this value. Defaults to the authenticator's + #: defaultBackupState value. + backup_state: typing.Optional[bool] = None + + #: The credential's user.name property. Equivalent to empty if not set. + #: https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name + user_name: typing.Optional[str] = None + + #: The credential's user.displayName property. Equivalent to empty if + #: not set. + #: https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname + user_display_name: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['credentialId'] = self.credential_id + json['isResidentCredential'] = self.is_resident_credential + json['privateKey'] = self.private_key + json['signCount'] = self.sign_count + if self.rp_id is not None: + json['rpId'] = self.rp_id + if self.user_handle is not None: + json['userHandle'] = self.user_handle + if self.large_blob is not None: + json['largeBlob'] = self.large_blob + if self.backup_eligibility is not None: + json['backupEligibility'] = self.backup_eligibility + if self.backup_state is not None: + json['backupState'] = self.backup_state + if self.user_name is not None: + json['userName'] = self.user_name + if self.user_display_name is not None: + json['userDisplayName'] = self.user_display_name + return json + + @classmethod + def from_json(cls, json): + return cls( + credential_id=str(json['credentialId']), + is_resident_credential=bool(json['isResidentCredential']), + private_key=str(json['privateKey']), + sign_count=int(json['signCount']), + rp_id=str(json['rpId']) if 'rpId' in json else None, + user_handle=str(json['userHandle']) if 'userHandle' in json else None, + large_blob=str(json['largeBlob']) if 'largeBlob' in json else None, + backup_eligibility=bool(json['backupEligibility']) if 'backupEligibility' in json else None, + backup_state=bool(json['backupState']) if 'backupState' in json else None, + user_name=str(json['userName']) if 'userName' in json else None, + user_display_name=str(json['userDisplayName']) if 'userDisplayName' in json else None, + ) + + +def enable( + enable_ui: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable the WebAuthn domain and start intercepting credential storage and + retrieval with a virtual authenticator. + + :param enable_ui: *(Optional)* Whether to enable the WebAuthn user interface. Enabling the UI is recommended for debugging and demo purposes, as it is closer to the real experience. Disabling the UI is recommended for automated testing. Supported at the embedder's discretion if UI is available. Defaults to false. + ''' + params: T_JSON_DICT = dict() + if enable_ui is not None: + params['enableUI'] = enable_ui + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.enable', + 'params': params, + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disable the WebAuthn domain. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.disable', + } + json = yield cmd_dict + + +def add_virtual_authenticator( + options: VirtualAuthenticatorOptions + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,AuthenticatorId]: + ''' + Creates and adds a virtual authenticator. + + :param options: + :returns: + ''' + params: T_JSON_DICT = dict() + params['options'] = options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.addVirtualAuthenticator', + 'params': params, + } + json = yield cmd_dict + return AuthenticatorId.from_json(json['authenticatorId']) + + +def set_response_override_bits( + authenticator_id: AuthenticatorId, + is_bogus_signature: typing.Optional[bool] = None, + is_bad_uv: typing.Optional[bool] = None, + is_bad_up: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present. + + :param authenticator_id: + :param is_bogus_signature: *(Optional)* If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false. + :param is_bad_uv: *(Optional)* If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false. + :param is_bad_up: *(Optional)* If isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false. + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + if is_bogus_signature is not None: + params['isBogusSignature'] = is_bogus_signature + if is_bad_uv is not None: + params['isBadUV'] = is_bad_uv + if is_bad_up is not None: + params['isBadUP'] = is_bad_up + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setResponseOverrideBits', + 'params': params, + } + json = yield cmd_dict + + +def remove_virtual_authenticator( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Removes the given authenticator. + + :param authenticator_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.removeVirtualAuthenticator', + 'params': params, + } + json = yield cmd_dict + + +def add_credential( + authenticator_id: AuthenticatorId, + credential: Credential + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Adds the credential to the specified authenticator. + + :param authenticator_id: + :param credential: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credential'] = credential.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.addCredential', + 'params': params, + } + json = yield cmd_dict + + +def get_credential( + authenticator_id: AuthenticatorId, + credential_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,Credential]: + ''' + Returns a single credential stored in the given virtual authenticator that + matches the credential ID. + + :param authenticator_id: + :param credential_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.getCredential', + 'params': params, + } + json = yield cmd_dict + return Credential.from_json(json['credential']) + + +def get_credentials( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Credential]]: + ''' + Returns all the credentials stored in the given virtual authenticator. + + :param authenticator_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.getCredentials', + 'params': params, + } + json = yield cmd_dict + return [Credential.from_json(i) for i in json['credentials']] + + +def remove_credential( + authenticator_id: AuthenticatorId, + credential_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Removes a credential from the authenticator. + + :param authenticator_id: + :param credential_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.removeCredential', + 'params': params, + } + json = yield cmd_dict + + +def clear_credentials( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears all the credentials from the specified device. + + :param authenticator_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.clearCredentials', + 'params': params, + } + json = yield cmd_dict + + +def set_user_verified( + authenticator_id: AuthenticatorId, + is_user_verified: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets whether User Verification succeeds or fails for an authenticator. + The default is true. + + :param authenticator_id: + :param is_user_verified: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['isUserVerified'] = is_user_verified + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setUserVerified', + 'params': params, + } + json = yield cmd_dict + + +def set_automatic_presence_simulation( + authenticator_id: AuthenticatorId, + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. + The default is true. + + :param authenticator_id: + :param enabled: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setAutomaticPresenceSimulation', + 'params': params, + } + json = yield cmd_dict + + +def set_credential_properties( + authenticator_id: AuthenticatorId, + credential_id: str, + backup_eligibility: typing.Optional[bool] = None, + backup_state: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Allows setting credential properties. + https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties + + :param authenticator_id: + :param credential_id: + :param backup_eligibility: *(Optional)* + :param backup_state: *(Optional)* + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + if backup_eligibility is not None: + params['backupEligibility'] = backup_eligibility + if backup_state is not None: + params['backupState'] = backup_state + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setCredentialProperties', + 'params': params, + } + json = yield cmd_dict + + +@event_class('WebAuthn.credentialAdded') +@dataclass +class CredentialAdded: + ''' + Triggered when a credential is added to an authenticator. + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialAdded: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) + + +@event_class('WebAuthn.credentialDeleted') +@dataclass +class CredentialDeleted: + ''' + Triggered when a credential is deleted, e.g. through + PublicKeyCredential.signalUnknownCredential(). + ''' + authenticator_id: AuthenticatorId + credential_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialDeleted: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential_id=str(json['credentialId']) + ) + + +@event_class('WebAuthn.credentialUpdated') +@dataclass +class CredentialUpdated: + ''' + Triggered when a credential is updated, e.g. through + PublicKeyCredential.signalCurrentUserDetails(). + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialUpdated: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) + + +@event_class('WebAuthn.credentialAsserted') +@dataclass +class CredentialAsserted: + ''' + Triggered when a credential is used in a webauthn assertion. + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialAsserted: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/__init__.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/__init__.py new file mode 100644 index 0000000..281cca8 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/__init__.py @@ -0,0 +1,59 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +from . import accessibility +from . import animation +from . import audits +from . import autofill +from . import background_service +from . import bluetooth_emulation +from . import browser +from . import css +from . import cache_storage +from . import cast +from . import console +from . import dom +from . import dom_debugger +from . import dom_snapshot +from . import dom_storage +from . import debugger +from . import device_access +from . import device_orientation +from . import emulation +from . import event_breakpoints +from . import extensions +from . import fed_cm +from . import fetch +from . import file_system +from . import headless_experimental +from . import heap_profiler +from . import io +from . import indexed_db +from . import input_ +from . import inspector +from . import layer_tree +from . import log +from . import media +from . import memory +from . import network +from . import overlay +from . import pwa +from . import page +from . import performance +from . import performance_timeline +from . import preload +from . import profiler +from . import runtime +from . import schema +from . import security +from . import service_worker +from . import storage +from . import system_info +from . import target +from . import tethering +from . import tracing +from . import web_audio +from . import web_authn +from . import util + diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/accessibility.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/accessibility.py new file mode 100644 index 0000000..7c4bd0a --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/accessibility.py @@ -0,0 +1,648 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Accessibility (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import dom +from . import page +from . import runtime + + +class AXNodeId(str): + ''' + Unique accessibility node identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> AXNodeId: + return cls(json) + + def __repr__(self): + return 'AXNodeId({})'.format(super().__repr__()) + + +class AXValueType(enum.Enum): + ''' + Enum of possible property types. + ''' + BOOLEAN = "boolean" + TRISTATE = "tristate" + BOOLEAN_OR_UNDEFINED = "booleanOrUndefined" + IDREF = "idref" + IDREF_LIST = "idrefList" + INTEGER = "integer" + NODE = "node" + NODE_LIST = "nodeList" + NUMBER = "number" + STRING = "string" + COMPUTED_STRING = "computedString" + TOKEN = "token" + TOKEN_LIST = "tokenList" + DOM_RELATION = "domRelation" + ROLE = "role" + INTERNAL_ROLE = "internalRole" + VALUE_UNDEFINED = "valueUndefined" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AXValueSourceType(enum.Enum): + ''' + Enum of possible property sources. + ''' + ATTRIBUTE = "attribute" + IMPLICIT = "implicit" + STYLE = "style" + CONTENTS = "contents" + PLACEHOLDER = "placeholder" + RELATED_ELEMENT = "relatedElement" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AXValueNativeSourceType(enum.Enum): + ''' + Enum of possible native property sources (as a subtype of a particular AXValueSourceType). + ''' + DESCRIPTION = "description" + FIGCAPTION = "figcaption" + LABEL = "label" + LABELFOR = "labelfor" + LABELWRAPPED = "labelwrapped" + LEGEND = "legend" + RUBYANNOTATION = "rubyannotation" + TABLECAPTION = "tablecaption" + TITLE = "title" + OTHER = "other" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class AXValueSource: + ''' + A single source for a computed AX property. + ''' + #: What type of source this is. + type_: AXValueSourceType + + #: The value of this property source. + value: typing.Optional[AXValue] = None + + #: The name of the relevant attribute, if any. + attribute: typing.Optional[str] = None + + #: The value of the relevant attribute, if any. + attribute_value: typing.Optional[AXValue] = None + + #: Whether this source is superseded by a higher priority source. + superseded: typing.Optional[bool] = None + + #: The native markup source for this value, e.g. a `` or 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. + ''' + key: PreloadingAttemptKey + + rule_set_ids: typing.List[RuleSetId] + + node_ids: typing.List[dom.BackendNodeId] + + def to_json(self): + json = dict() + json['key'] = self.key.to_json() + json['ruleSetIds'] = [i.to_json() for i in self.rule_set_ids] + json['nodeIds'] = [i.to_json() for i in self.node_ids] + return json + + @classmethod + def from_json(cls, json): + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + rule_set_ids=[RuleSetId.from_json(i) for i in json['ruleSetIds']], + node_ids=[dom.BackendNodeId.from_json(i) for i in json['nodeIds']], + ) + + +class PreloadPipelineId(str): + ''' + Chrome manages different types of preloads together using a + concept of preloading pipeline. For example, if a site uses a + SpeculationRules for prerender, Chrome first starts a prefetch and + then upgrades it to prerender. + + CDP events for them are emitted separately but they share + ``PreloadPipelineId``. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> PreloadPipelineId: + return cls(json) + + def __repr__(self): + return 'PreloadPipelineId({})'.format(super().__repr__()) + + +class PrerenderFinalStatus(enum.Enum): + ''' + List of FinalStatus reasons for Prerender2. + ''' + ACTIVATED = "Activated" + DESTROYED = "Destroyed" + LOW_END_DEVICE = "LowEndDevice" + INVALID_SCHEME_REDIRECT = "InvalidSchemeRedirect" + INVALID_SCHEME_NAVIGATION = "InvalidSchemeNavigation" + NAVIGATION_REQUEST_BLOCKED_BY_CSP = "NavigationRequestBlockedByCsp" + MAIN_FRAME_NAVIGATION = "MainFrameNavigation" + MOJO_BINDER_POLICY = "MojoBinderPolicy" + RENDERER_PROCESS_CRASHED = "RendererProcessCrashed" + RENDERER_PROCESS_KILLED = "RendererProcessKilled" + DOWNLOAD = "Download" + TRIGGER_DESTROYED = "TriggerDestroyed" + NAVIGATION_NOT_COMMITTED = "NavigationNotCommitted" + NAVIGATION_BAD_HTTP_STATUS = "NavigationBadHttpStatus" + CLIENT_CERT_REQUESTED = "ClientCertRequested" + NAVIGATION_REQUEST_NETWORK_ERROR = "NavigationRequestNetworkError" + CANCEL_ALL_HOSTS_FOR_TESTING = "CancelAllHostsForTesting" + DID_FAIL_LOAD = "DidFailLoad" + STOP = "Stop" + SSL_CERTIFICATE_ERROR = "SslCertificateError" + LOGIN_AUTH_REQUESTED = "LoginAuthRequested" + UA_CHANGE_REQUIRES_RELOAD = "UaChangeRequiresReload" + BLOCKED_BY_CLIENT = "BlockedByClient" + AUDIO_OUTPUT_DEVICE_REQUESTED = "AudioOutputDeviceRequested" + MIXED_CONTENT = "MixedContent" + TRIGGER_BACKGROUNDED = "TriggerBackgrounded" + MEMORY_LIMIT_EXCEEDED = "MemoryLimitExceeded" + DATA_SAVER_ENABLED = "DataSaverEnabled" + TRIGGER_URL_HAS_EFFECTIVE_URL = "TriggerUrlHasEffectiveUrl" + ACTIVATED_BEFORE_STARTED = "ActivatedBeforeStarted" + INACTIVE_PAGE_RESTRICTION = "InactivePageRestriction" + START_FAILED = "StartFailed" + TIMEOUT_BACKGROUNDED = "TimeoutBackgrounded" + CROSS_SITE_REDIRECT_IN_INITIAL_NAVIGATION = "CrossSiteRedirectInInitialNavigation" + CROSS_SITE_NAVIGATION_IN_INITIAL_NAVIGATION = "CrossSiteNavigationInInitialNavigation" + SAME_SITE_CROSS_ORIGIN_REDIRECT_NOT_OPT_IN_IN_INITIAL_NAVIGATION = "SameSiteCrossOriginRedirectNotOptInInInitialNavigation" + SAME_SITE_CROSS_ORIGIN_NAVIGATION_NOT_OPT_IN_IN_INITIAL_NAVIGATION = "SameSiteCrossOriginNavigationNotOptInInInitialNavigation" + ACTIVATION_NAVIGATION_PARAMETER_MISMATCH = "ActivationNavigationParameterMismatch" + ACTIVATED_IN_BACKGROUND = "ActivatedInBackground" + EMBEDDER_HOST_DISALLOWED = "EmbedderHostDisallowed" + ACTIVATION_NAVIGATION_DESTROYED_BEFORE_SUCCESS = "ActivationNavigationDestroyedBeforeSuccess" + TAB_CLOSED_BY_USER_GESTURE = "TabClosedByUserGesture" + TAB_CLOSED_WITHOUT_USER_GESTURE = "TabClosedWithoutUserGesture" + PRIMARY_MAIN_FRAME_RENDERER_PROCESS_CRASHED = "PrimaryMainFrameRendererProcessCrashed" + PRIMARY_MAIN_FRAME_RENDERER_PROCESS_KILLED = "PrimaryMainFrameRendererProcessKilled" + ACTIVATION_FRAME_POLICY_NOT_COMPATIBLE = "ActivationFramePolicyNotCompatible" + PRELOADING_DISABLED = "PreloadingDisabled" + BATTERY_SAVER_ENABLED = "BatterySaverEnabled" + ACTIVATED_DURING_MAIN_FRAME_NAVIGATION = "ActivatedDuringMainFrameNavigation" + PRELOADING_UNSUPPORTED_BY_WEB_CONTENTS = "PreloadingUnsupportedByWebContents" + CROSS_SITE_REDIRECT_IN_MAIN_FRAME_NAVIGATION = "CrossSiteRedirectInMainFrameNavigation" + CROSS_SITE_NAVIGATION_IN_MAIN_FRAME_NAVIGATION = "CrossSiteNavigationInMainFrameNavigation" + SAME_SITE_CROSS_ORIGIN_REDIRECT_NOT_OPT_IN_IN_MAIN_FRAME_NAVIGATION = "SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation" + SAME_SITE_CROSS_ORIGIN_NAVIGATION_NOT_OPT_IN_IN_MAIN_FRAME_NAVIGATION = "SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation" + MEMORY_PRESSURE_ON_TRIGGER = "MemoryPressureOnTrigger" + MEMORY_PRESSURE_AFTER_TRIGGERED = "MemoryPressureAfterTriggered" + PRERENDERING_DISABLED_BY_DEV_TOOLS = "PrerenderingDisabledByDevTools" + SPECULATION_RULE_REMOVED = "SpeculationRuleRemoved" + ACTIVATED_WITH_AUXILIARY_BROWSING_CONTEXTS = "ActivatedWithAuxiliaryBrowsingContexts" + MAX_NUM_OF_RUNNING_EAGER_PRERENDERS_EXCEEDED = "MaxNumOfRunningEagerPrerendersExceeded" + MAX_NUM_OF_RUNNING_NON_EAGER_PRERENDERS_EXCEEDED = "MaxNumOfRunningNonEagerPrerendersExceeded" + MAX_NUM_OF_RUNNING_EMBEDDER_PRERENDERS_EXCEEDED = "MaxNumOfRunningEmbedderPrerendersExceeded" + PRERENDERING_URL_HAS_EFFECTIVE_URL = "PrerenderingUrlHasEffectiveUrl" + REDIRECTED_PRERENDERING_URL_HAS_EFFECTIVE_URL = "RedirectedPrerenderingUrlHasEffectiveUrl" + ACTIVATION_URL_HAS_EFFECTIVE_URL = "ActivationUrlHasEffectiveUrl" + JAVA_SCRIPT_INTERFACE_ADDED = "JavaScriptInterfaceAdded" + JAVA_SCRIPT_INTERFACE_REMOVED = "JavaScriptInterfaceRemoved" + ALL_PRERENDERING_CANCELED = "AllPrerenderingCanceled" + WINDOW_CLOSED = "WindowClosed" + SLOW_NETWORK = "SlowNetwork" + OTHER_PRERENDERED_PAGE_ACTIVATED = "OtherPrerenderedPageActivated" + V8_OPTIMIZER_DISABLED = "V8OptimizerDisabled" + PRERENDER_FAILED_DURING_PREFETCH = "PrerenderFailedDuringPrefetch" + BROWSING_DATA_REMOVED = "BrowsingDataRemoved" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class PreloadingStatus(enum.Enum): + ''' + Preloading status values, see also PreloadingTriggeringOutcome. This + status is shared by prefetchStatusUpdated and prerenderStatusUpdated. + ''' + PENDING = "Pending" + RUNNING = "Running" + READY = "Ready" + SUCCESS = "Success" + FAILURE = "Failure" + NOT_SUPPORTED = "NotSupported" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class PrefetchStatus(enum.Enum): + ''' + TODO(https://crbug.com/1384419): revisit the list of PrefetchStatus and + filter out the ones that aren't necessary to the developers. + ''' + PREFETCH_ALLOWED = "PrefetchAllowed" + PREFETCH_FAILED_INELIGIBLE_REDIRECT = "PrefetchFailedIneligibleRedirect" + PREFETCH_FAILED_INVALID_REDIRECT = "PrefetchFailedInvalidRedirect" + PREFETCH_FAILED_MIME_NOT_SUPPORTED = "PrefetchFailedMIMENotSupported" + PREFETCH_FAILED_NET_ERROR = "PrefetchFailedNetError" + PREFETCH_FAILED_NON2_XX = "PrefetchFailedNon2XX" + PREFETCH_EVICTED_AFTER_CANDIDATE_REMOVED = "PrefetchEvictedAfterCandidateRemoved" + PREFETCH_EVICTED_FOR_NEWER_PREFETCH = "PrefetchEvictedForNewerPrefetch" + PREFETCH_HELDBACK = "PrefetchHeldback" + PREFETCH_INELIGIBLE_RETRY_AFTER = "PrefetchIneligibleRetryAfter" + PREFETCH_IS_PRIVACY_DECOY = "PrefetchIsPrivacyDecoy" + PREFETCH_IS_STALE = "PrefetchIsStale" + PREFETCH_NOT_ELIGIBLE_BROWSER_CONTEXT_OFF_THE_RECORD = "PrefetchNotEligibleBrowserContextOffTheRecord" + PREFETCH_NOT_ELIGIBLE_DATA_SAVER_ENABLED = "PrefetchNotEligibleDataSaverEnabled" + PREFETCH_NOT_ELIGIBLE_EXISTING_PROXY = "PrefetchNotEligibleExistingProxy" + PREFETCH_NOT_ELIGIBLE_HOST_IS_NON_UNIQUE = "PrefetchNotEligibleHostIsNonUnique" + PREFETCH_NOT_ELIGIBLE_NON_DEFAULT_STORAGE_PARTITION = "PrefetchNotEligibleNonDefaultStoragePartition" + PREFETCH_NOT_ELIGIBLE_SAME_SITE_CROSS_ORIGIN_PREFETCH_REQUIRED_PROXY = "PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy" + PREFETCH_NOT_ELIGIBLE_SCHEME_IS_NOT_HTTPS = "PrefetchNotEligibleSchemeIsNotHttps" + PREFETCH_NOT_ELIGIBLE_USER_HAS_COOKIES = "PrefetchNotEligibleUserHasCookies" + PREFETCH_NOT_ELIGIBLE_USER_HAS_SERVICE_WORKER = "PrefetchNotEligibleUserHasServiceWorker" + PREFETCH_NOT_ELIGIBLE_BATTERY_SAVER_ENABLED = "PrefetchNotEligibleBatterySaverEnabled" + PREFETCH_NOT_ELIGIBLE_PRELOADING_DISABLED = "PrefetchNotEligiblePreloadingDisabled" + PREFETCH_NOT_FINISHED_IN_TIME = "PrefetchNotFinishedInTime" + PREFETCH_NOT_STARTED = "PrefetchNotStarted" + PREFETCH_NOT_USED_COOKIES_CHANGED = "PrefetchNotUsedCookiesChanged" + PREFETCH_PROXY_NOT_AVAILABLE = "PrefetchProxyNotAvailable" + PREFETCH_RESPONSE_USED = "PrefetchResponseUsed" + PREFETCH_SUCCESSFUL_BUT_NOT_USED = "PrefetchSuccessfulButNotUsed" + PREFETCH_NOT_USED_PROBE_FAILED = "PrefetchNotUsedProbeFailed" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class PrerenderMismatchedHeaders: + ''' + Information of headers to be displayed when the header mismatch occurred. + ''' + header_name: str + + initial_value: typing.Optional[str] = None + + activation_value: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['headerName'] = self.header_name + if self.initial_value is not None: + json['initialValue'] = self.initial_value + if self.activation_value is not None: + json['activationValue'] = self.activation_value + return json + + @classmethod + def from_json(cls, json): + return cls( + header_name=str(json['headerName']), + initial_value=str(json['initialValue']) if 'initialValue' in json else None, + activation_value=str(json['activationValue']) if 'activationValue' in json else None, + ) + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Preload.enable', + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Preload.disable', + } + json = yield cmd_dict + + +@event_class('Preload.ruleSetUpdated') +@dataclass +class RuleSetUpdated: + ''' + Upsert. Currently, it is only emitted when a rule set added. + ''' + rule_set: RuleSet + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> RuleSetUpdated: + return cls( + rule_set=RuleSet.from_json(json['ruleSet']) + ) + + +@event_class('Preload.ruleSetRemoved') +@dataclass +class RuleSetRemoved: + id_: RuleSetId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> RuleSetRemoved: + return cls( + id_=RuleSetId.from_json(json['id']) + ) + + +@event_class('Preload.preloadEnabledStateUpdated') +@dataclass +class PreloadEnabledStateUpdated: + ''' + Fired when a preload enabled state is updated. + ''' + disabled_by_preference: bool + disabled_by_data_saver: bool + disabled_by_battery_saver: bool + disabled_by_holdback_prefetch_speculation_rules: bool + disabled_by_holdback_prerender_speculation_rules: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreloadEnabledStateUpdated: + return cls( + disabled_by_preference=bool(json['disabledByPreference']), + disabled_by_data_saver=bool(json['disabledByDataSaver']), + disabled_by_battery_saver=bool(json['disabledByBatterySaver']), + disabled_by_holdback_prefetch_speculation_rules=bool(json['disabledByHoldbackPrefetchSpeculationRules']), + disabled_by_holdback_prerender_speculation_rules=bool(json['disabledByHoldbackPrerenderSpeculationRules']) + ) + + +@event_class('Preload.prefetchStatusUpdated') +@dataclass +class PrefetchStatusUpdated: + ''' + Fired when a prefetch attempt is updated. + ''' + key: PreloadingAttemptKey + pipeline_id: PreloadPipelineId + #: The frame id of the frame initiating prefetch. + initiating_frame_id: page.FrameId + prefetch_url: str + status: PreloadingStatus + prefetch_status: PrefetchStatus + request_id: network.RequestId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PrefetchStatusUpdated: + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + pipeline_id=PreloadPipelineId.from_json(json['pipelineId']), + initiating_frame_id=page.FrameId.from_json(json['initiatingFrameId']), + prefetch_url=str(json['prefetchUrl']), + status=PreloadingStatus.from_json(json['status']), + prefetch_status=PrefetchStatus.from_json(json['prefetchStatus']), + request_id=network.RequestId.from_json(json['requestId']) + ) + + +@event_class('Preload.prerenderStatusUpdated') +@dataclass +class PrerenderStatusUpdated: + ''' + Fired when a prerender attempt is updated. + ''' + key: PreloadingAttemptKey + pipeline_id: PreloadPipelineId + status: PreloadingStatus + prerender_status: typing.Optional[PrerenderFinalStatus] + #: 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. + disallowed_mojo_interface: typing.Optional[str] + mismatched_headers: typing.Optional[typing.List[PrerenderMismatchedHeaders]] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PrerenderStatusUpdated: + return cls( + key=PreloadingAttemptKey.from_json(json['key']), + pipeline_id=PreloadPipelineId.from_json(json['pipelineId']), + status=PreloadingStatus.from_json(json['status']), + prerender_status=PrerenderFinalStatus.from_json(json['prerenderStatus']) if 'prerenderStatus' in json else None, + disallowed_mojo_interface=str(json['disallowedMojoInterface']) if 'disallowedMojoInterface' in json else None, + mismatched_headers=[PrerenderMismatchedHeaders.from_json(i) for i in json['mismatchedHeaders']] if 'mismatchedHeaders' in json else None + ) + + +@event_class('Preload.preloadingAttemptSourcesUpdated') +@dataclass +class PreloadingAttemptSourcesUpdated: + ''' + Send a list of sources for all preloading attempts in a document. + ''' + loader_id: network.LoaderId + preloading_attempt_sources: typing.List[PreloadingAttemptSource] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreloadingAttemptSourcesUpdated: + return cls( + loader_id=network.LoaderId.from_json(json['loaderId']), + preloading_attempt_sources=[PreloadingAttemptSource.from_json(i) for i in json['preloadingAttemptSources']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/profiler.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/profiler.py new file mode 100644 index 0000000..ab2ff07 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/profiler.py @@ -0,0 +1,418 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Profiler +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import debugger +from . import runtime + + +@dataclass +class ProfileNode: + ''' + Profile node. Holds callsite information, execution statistics and child nodes. + ''' + #: Unique id of the node. + id_: int + + #: Function location. + call_frame: runtime.CallFrame + + #: Number of samples where this node was on top of the call stack. + hit_count: typing.Optional[int] = None + + #: Child node ids. + children: typing.Optional[typing.List[int]] = None + + #: The reason of being not optimized. The function may be deoptimized or marked as don't + #: optimize. + deopt_reason: typing.Optional[str] = None + + #: An array of source position ticks. + position_ticks: typing.Optional[typing.List[PositionTickInfo]] = None + + def to_json(self): + json = dict() + json['id'] = self.id_ + json['callFrame'] = self.call_frame.to_json() + if self.hit_count is not None: + json['hitCount'] = self.hit_count + if self.children is not None: + json['children'] = [i for i in self.children] + if self.deopt_reason is not None: + json['deoptReason'] = self.deopt_reason + if self.position_ticks is not None: + json['positionTicks'] = [i.to_json() for i in self.position_ticks] + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=int(json['id']), + call_frame=runtime.CallFrame.from_json(json['callFrame']), + hit_count=int(json['hitCount']) if 'hitCount' in json else None, + children=[int(i) for i in json['children']] if 'children' in json else None, + deopt_reason=str(json['deoptReason']) if 'deoptReason' in json else None, + position_ticks=[PositionTickInfo.from_json(i) for i in json['positionTicks']] if 'positionTicks' in json else None, + ) + + +@dataclass +class Profile: + ''' + Profile. + ''' + #: The list of profile nodes. First item is the root node. + nodes: typing.List[ProfileNode] + + #: Profiling start timestamp in microseconds. + start_time: float + + #: Profiling end timestamp in microseconds. + end_time: float + + #: Ids of samples top nodes. + samples: typing.Optional[typing.List[int]] = None + + #: Time intervals between adjacent samples in microseconds. The first delta is relative to the + #: profile startTime. + time_deltas: typing.Optional[typing.List[int]] = None + + def to_json(self): + json = dict() + json['nodes'] = [i.to_json() for i in self.nodes] + json['startTime'] = self.start_time + json['endTime'] = self.end_time + if self.samples is not None: + json['samples'] = [i for i in self.samples] + if self.time_deltas is not None: + json['timeDeltas'] = [i for i in self.time_deltas] + return json + + @classmethod + def from_json(cls, json): + return cls( + nodes=[ProfileNode.from_json(i) for i in json['nodes']], + start_time=float(json['startTime']), + end_time=float(json['endTime']), + samples=[int(i) for i in json['samples']] if 'samples' in json else None, + time_deltas=[int(i) for i in json['timeDeltas']] if 'timeDeltas' in json else None, + ) + + +@dataclass +class PositionTickInfo: + ''' + Specifies a number of samples attributed to a certain source position. + ''' + #: Source line number (1-based). + line: int + + #: Number of samples attributed to the source line. + ticks: int + + def to_json(self): + json = dict() + json['line'] = self.line + json['ticks'] = self.ticks + return json + + @classmethod + def from_json(cls, json): + return cls( + line=int(json['line']), + ticks=int(json['ticks']), + ) + + +@dataclass +class CoverageRange: + ''' + Coverage data for a source range. + ''' + #: JavaScript script source offset for the range start. + start_offset: int + + #: JavaScript script source offset for the range end. + end_offset: int + + #: Collected execution count of the source range. + count: int + + def to_json(self): + json = dict() + json['startOffset'] = self.start_offset + json['endOffset'] = self.end_offset + json['count'] = self.count + return json + + @classmethod + def from_json(cls, json): + return cls( + start_offset=int(json['startOffset']), + end_offset=int(json['endOffset']), + count=int(json['count']), + ) + + +@dataclass +class FunctionCoverage: + ''' + Coverage data for a JavaScript function. + ''' + #: JavaScript function name. + function_name: str + + #: Source ranges inside the function with coverage data. + ranges: typing.List[CoverageRange] + + #: Whether coverage data for this function has block granularity. + is_block_coverage: bool + + def to_json(self): + json = dict() + json['functionName'] = self.function_name + json['ranges'] = [i.to_json() for i in self.ranges] + json['isBlockCoverage'] = self.is_block_coverage + return json + + @classmethod + def from_json(cls, json): + return cls( + function_name=str(json['functionName']), + ranges=[CoverageRange.from_json(i) for i in json['ranges']], + is_block_coverage=bool(json['isBlockCoverage']), + ) + + +@dataclass +class ScriptCoverage: + ''' + Coverage data for a JavaScript script. + ''' + #: JavaScript script id. + script_id: runtime.ScriptId + + #: JavaScript script name or url. + url: str + + #: Functions contained in the script that has coverage data. + functions: typing.List[FunctionCoverage] + + def to_json(self): + json = dict() + json['scriptId'] = self.script_id.to_json() + json['url'] = self.url + json['functions'] = [i.to_json() for i in self.functions] + return json + + @classmethod + def from_json(cls, json): + return cls( + script_id=runtime.ScriptId.from_json(json['scriptId']), + url=str(json['url']), + functions=[FunctionCoverage.from_json(i) for i in json['functions']], + ) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.disable', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.enable', + } + json = yield cmd_dict + + +def get_best_effort_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[ScriptCoverage]]: + ''' + Collect coverage data for the current isolate. The coverage data may be incomplete due to + garbage collection. + + :returns: Coverage data for the current isolate. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.getBestEffortCoverage', + } + json = yield cmd_dict + return [ScriptCoverage.from_json(i) for i in json['result']] + + +def set_sampling_interval( + interval: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + + :param interval: New sampling interval in microseconds. + ''' + params: T_JSON_DICT = dict() + params['interval'] = interval + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.setSamplingInterval', + 'params': params, + } + json = yield cmd_dict + + +def start() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.start', + } + json = yield cmd_dict + + +def start_precise_coverage( + call_count: typing.Optional[bool] = None, + detailed: typing.Optional[bool] = None, + allow_triggered_updates: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,float]: + ''' + 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. + + :param call_count: *(Optional)* Collect accurate call counts beyond simple 'covered' or 'not covered'. + :param detailed: *(Optional)* Collect block-based coverage. + :param allow_triggered_updates: *(Optional)* Allow the backend to send updates on its own initiative + :returns: Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + ''' + params: T_JSON_DICT = dict() + if call_count is not None: + params['callCount'] = call_count + if detailed is not None: + params['detailed'] = detailed + if allow_triggered_updates is not None: + params['allowTriggeredUpdates'] = allow_triggered_updates + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.startPreciseCoverage', + 'params': params, + } + json = yield cmd_dict + return float(json['timestamp']) + + +def stop() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,Profile]: + ''' + + + :returns: Recorded profile. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.stop', + } + json = yield cmd_dict + return Profile.from_json(json['profile']) + + +def stop_precise_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disable precise code coverage. Disabling releases unnecessary execution count records and allows + executing optimized code. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.stopPreciseCoverage', + } + json = yield cmd_dict + + +def take_precise_coverage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.List[ScriptCoverage], float]]: + ''' + Collect coverage data for the current isolate, and resets execution counters. Precise code + coverage needs to have started. + + :returns: A tuple with the following items: + + 0. **result** - Coverage data for the current isolate. + 1. **timestamp** - Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Profiler.takePreciseCoverage', + } + json = yield cmd_dict + return ( + [ScriptCoverage.from_json(i) for i in json['result']], + float(json['timestamp']) + ) + + +@event_class('Profiler.consoleProfileFinished') +@dataclass +class ConsoleProfileFinished: + id_: str + #: Location of console.profileEnd(). + location: debugger.Location + profile: Profile + #: Profile title passed as an argument to console.profile(). + title: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleProfileFinished: + return cls( + id_=str(json['id']), + location=debugger.Location.from_json(json['location']), + profile=Profile.from_json(json['profile']), + title=str(json['title']) if 'title' in json else None + ) + + +@event_class('Profiler.consoleProfileStarted') +@dataclass +class ConsoleProfileStarted: + ''' + Sent when new profile recording is started using console.profile() call. + ''' + id_: str + #: Location of console.profile(). + location: debugger.Location + #: Profile title passed as an argument to console.profile(). + title: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleProfileStarted: + return cls( + id_=str(json['id']), + location=debugger.Location.from_json(json['location']), + title=str(json['title']) if 'title' in json else None + ) + + +@event_class('Profiler.preciseCoverageDeltaUpdate') +@dataclass +class PreciseCoverageDeltaUpdate: + ''' + **EXPERIMENTAL** + + 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. + ''' + #: Monotonically increasing time (in seconds) when the coverage update was taken in the backend. + timestamp: float + #: Identifier for distinguishing coverage events. + occasion: str + #: Coverage data for the current isolate. + result: typing.List[ScriptCoverage] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> PreciseCoverageDeltaUpdate: + return cls( + timestamp=float(json['timestamp']), + occasion=str(json['occasion']), + result=[ScriptCoverage.from_json(i) for i in json['result']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/pwa.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/pwa.py new file mode 100644 index 0000000..8def6e8 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/pwa.py @@ -0,0 +1,260 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: PWA (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import target + + +@dataclass +class FileHandlerAccept: + ''' + 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 + ''' + #: New name of the mimetype according to + #: https://www.iana.org/assignments/media-types/media-types.xhtml + media_type: str + + file_extensions: typing.List[str] + + def to_json(self): + json = dict() + json['mediaType'] = self.media_type + json['fileExtensions'] = [i for i in self.file_extensions] + return json + + @classmethod + def from_json(cls, json): + return cls( + media_type=str(json['mediaType']), + file_extensions=[str(i) for i in json['fileExtensions']], + ) + + +@dataclass +class FileHandler: + action: str + + accepts: typing.List[FileHandlerAccept] + + display_name: str + + def to_json(self): + json = dict() + json['action'] = self.action + json['accepts'] = [i.to_json() for i in self.accepts] + json['displayName'] = self.display_name + return json + + @classmethod + def from_json(cls, json): + return cls( + action=str(json['action']), + accepts=[FileHandlerAccept.from_json(i) for i in json['accepts']], + display_name=str(json['displayName']), + ) + + +class DisplayMode(enum.Enum): + ''' + If user prefers opening the app in browser or an app window. + ''' + STANDALONE = "standalone" + BROWSER = "browser" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def get_os_app_state( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[int, typing.List[FileHandler]]]: + ''' + Returns the following OS state for the given manifest id. + + :param manifest_id: The id from the webapp's manifest file, commonly it's the url of the site installing the webapp. See https://web.dev/learn/pwa/web-app-manifest. + :returns: A tuple with the following items: + + 0. **badgeCount** - + 1. **fileHandlers** - + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.getOsAppState', + 'params': params, + } + json = yield cmd_dict + return ( + int(json['badgeCount']), + [FileHandler.from_json(i) for i in json['fileHandlers']] + ) + + +def install( + manifest_id: str, + install_url_or_bundle_url: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Installs the given manifest identity, optionally using the given install_url + or IWA bundle location. + + TODO(crbug.com/337872319) Support IWA to meet the following specific + requirement. + IWA-specific install description: If the manifest_id is isolated-app://, + install_url_or_bundle_url is required, and can be either an http(s) URL or + file:// URL pointing to a signed web bundle (.swbn). The .swbn file's + signing key must correspond to manifest_id. If Chrome is not in IWA dev + mode, the installation will fail, regardless of the state of the allowlist. + + :param manifest_id: + :param install_url_or_bundle_url: *(Optional)* The location of the app or bundle overriding the one derived from the manifestId. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if install_url_or_bundle_url is not None: + params['installUrlOrBundleUrl'] = install_url_or_bundle_url + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.install', + 'params': params, + } + json = yield cmd_dict + + +def uninstall( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Uninstalls the given manifest_id and closes any opened app windows. + + :param manifest_id: + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.uninstall', + 'params': params, + } + json = yield cmd_dict + + +def launch( + manifest_id: str, + url: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,target.TargetID]: + ''' + 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. + + :param manifest_id: + :param url: *(Optional)* + :returns: ID of the tab target created as a result. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if url is not None: + params['url'] = url + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.launch', + 'params': params, + } + json = yield cmd_dict + return target.TargetID.from_json(json['targetId']) + + +def launch_files_in_app( + manifest_id: str, + files: typing.List[str] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[target.TargetID]]: + ''' + 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. + + :param manifest_id: + :param files: + :returns: IDs of the tab targets created as the result. + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + params['files'] = [i for i in files] + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.launchFilesInApp', + 'params': params, + } + json = yield cmd_dict + return [target.TargetID.from_json(i) for i in json['targetIds']] + + +def open_current_page_in_app( + manifest_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param manifest_id: + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.openCurrentPageInApp', + 'params': params, + } + json = yield cmd_dict + + +def change_app_user_settings( + manifest_id: str, + link_capturing: typing.Optional[bool] = None, + display_mode: typing.Optional[DisplayMode] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param manifest_id: + :param link_capturing: *(Optional)* If user allows the links clicked on by the user in the app's scope, or extended 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 the initial value, uninstalling and installing the web app again will reset it. TODO(crbug.com/339453269): Setting this value on ChromeOS is not supported yet. + :param display_mode: *(Optional)* + ''' + params: T_JSON_DICT = dict() + params['manifestId'] = manifest_id + if link_capturing is not None: + params['linkCapturing'] = link_capturing + if display_mode is not None: + params['displayMode'] = display_mode.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'PWA.changeAppUserSettings', + 'params': params, + } + json = yield cmd_dict diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/py.typed b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/runtime.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/runtime.py new file mode 100644 index 0000000..97220af --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/runtime.py @@ -0,0 +1,1587 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Runtime +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class ScriptId(str): + ''' + Unique script identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> ScriptId: + return cls(json) + + def __repr__(self): + return 'ScriptId({})'.format(super().__repr__()) + + +@dataclass +class SerializationOptions: + ''' + Represents options for serialization. Overrides ``generatePreview`` and ``returnByValue``. + ''' + serialization: str + + #: Deep serialization depth. Default is full depth. Respected only in ``deep`` serialization mode. + max_depth: typing.Optional[int] = None + + #: 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. + additional_parameters: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['serialization'] = self.serialization + if self.max_depth is not None: + json['maxDepth'] = self.max_depth + if self.additional_parameters is not None: + json['additionalParameters'] = self.additional_parameters + return json + + @classmethod + def from_json(cls, json): + return cls( + serialization=str(json['serialization']), + max_depth=int(json['maxDepth']) if 'maxDepth' in json else None, + additional_parameters=dict(json['additionalParameters']) if 'additionalParameters' in json else None, + ) + + +@dataclass +class DeepSerializedValue: + ''' + Represents deep serialized value. + ''' + type_: str + + value: typing.Optional[typing.Any] = None + + object_id: typing.Optional[str] = None + + #: 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. + weak_local_object_reference: typing.Optional[int] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + if self.value is not None: + json['value'] = self.value + if self.object_id is not None: + json['objectId'] = self.object_id + if self.weak_local_object_reference is not None: + json['weakLocalObjectReference'] = self.weak_local_object_reference + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + value=json['value'] if 'value' in json else None, + object_id=str(json['objectId']) if 'objectId' in json else None, + weak_local_object_reference=int(json['weakLocalObjectReference']) if 'weakLocalObjectReference' in json else None, + ) + + +class RemoteObjectId(str): + ''' + Unique object identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> RemoteObjectId: + return cls(json) + + def __repr__(self): + return 'RemoteObjectId({})'.format(super().__repr__()) + + +class UnserializableValue(str): + ''' + Primitive value which cannot be JSON-stringified. Includes values ``-0``, ``NaN``, ``Infinity``, + ``-Infinity``, and bigint literals. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnserializableValue: + return cls(json) + + def __repr__(self): + return 'UnserializableValue({})'.format(super().__repr__()) + + +@dataclass +class RemoteObject: + ''' + Mirror object referencing original JavaScript object. + ''' + #: Object type. + type_: str + + #: 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. + subtype: typing.Optional[str] = None + + #: Object class (constructor) name. Specified for ``object`` type values only. + class_name: typing.Optional[str] = None + + #: Remote object value in case of primitive values or JSON values (if it was requested). + value: typing.Optional[typing.Any] = None + + #: Primitive value which can not be JSON-stringified does not have ``value``, but gets this + #: property. + unserializable_value: typing.Optional[UnserializableValue] = None + + #: String representation of the object. + description: typing.Optional[str] = None + + #: Deep serialized value. + deep_serialized_value: typing.Optional[DeepSerializedValue] = None + + #: Unique object identifier (for non-primitive values). + object_id: typing.Optional[RemoteObjectId] = None + + #: Preview containing abbreviated property values. Specified for ``object`` type values only. + preview: typing.Optional[ObjectPreview] = None + + custom_preview: typing.Optional[CustomPreview] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + if self.subtype is not None: + json['subtype'] = self.subtype + if self.class_name is not None: + json['className'] = self.class_name + if self.value is not None: + json['value'] = self.value + if self.unserializable_value is not None: + json['unserializableValue'] = self.unserializable_value.to_json() + if self.description is not None: + json['description'] = self.description + if self.deep_serialized_value is not None: + json['deepSerializedValue'] = self.deep_serialized_value.to_json() + if self.object_id is not None: + json['objectId'] = self.object_id.to_json() + if self.preview is not None: + json['preview'] = self.preview.to_json() + if self.custom_preview is not None: + json['customPreview'] = self.custom_preview.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + subtype=str(json['subtype']) if 'subtype' in json else None, + class_name=str(json['className']) if 'className' in json else None, + value=json['value'] if 'value' in json else None, + unserializable_value=UnserializableValue.from_json(json['unserializableValue']) if 'unserializableValue' in json else None, + description=str(json['description']) if 'description' in json else None, + deep_serialized_value=DeepSerializedValue.from_json(json['deepSerializedValue']) if 'deepSerializedValue' in json else None, + object_id=RemoteObjectId.from_json(json['objectId']) if 'objectId' in json else None, + preview=ObjectPreview.from_json(json['preview']) if 'preview' in json else None, + custom_preview=CustomPreview.from_json(json['customPreview']) if 'customPreview' in json else None, + ) + + +@dataclass +class CustomPreview: + #: The JSON-stringified result of formatter.header(object, config) call. + #: It contains json ML array that represents RemoteObject. + header: str + + #: 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. + body_getter_id: typing.Optional[RemoteObjectId] = None + + def to_json(self): + json = dict() + json['header'] = self.header + if self.body_getter_id is not None: + json['bodyGetterId'] = self.body_getter_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + header=str(json['header']), + body_getter_id=RemoteObjectId.from_json(json['bodyGetterId']) if 'bodyGetterId' in json else None, + ) + + +@dataclass +class ObjectPreview: + ''' + Object containing abbreviated remote object value. + ''' + #: Object type. + type_: str + + #: True iff some of the properties or entries of the original object did not fit. + overflow: bool + + #: List of the properties. + properties: typing.List[PropertyPreview] + + #: Object subtype hint. Specified for ``object`` type values only. + subtype: typing.Optional[str] = None + + #: String representation of the object. + description: typing.Optional[str] = None + + #: List of the entries. Specified for ``map`` and ``set`` subtype values only. + entries: typing.Optional[typing.List[EntryPreview]] = None + + def to_json(self): + json = dict() + json['type'] = self.type_ + json['overflow'] = self.overflow + json['properties'] = [i.to_json() for i in self.properties] + if self.subtype is not None: + json['subtype'] = self.subtype + if self.description is not None: + json['description'] = self.description + if self.entries is not None: + json['entries'] = [i.to_json() for i in self.entries] + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + overflow=bool(json['overflow']), + properties=[PropertyPreview.from_json(i) for i in json['properties']], + subtype=str(json['subtype']) if 'subtype' in json else None, + description=str(json['description']) if 'description' in json else None, + entries=[EntryPreview.from_json(i) for i in json['entries']] if 'entries' in json else None, + ) + + +@dataclass +class PropertyPreview: + #: Property name. + name: str + + #: Object type. Accessor means that the property itself is an accessor property. + type_: str + + #: User-friendly property value string. + value: typing.Optional[str] = None + + #: Nested value preview. + value_preview: typing.Optional[ObjectPreview] = None + + #: Object subtype hint. Specified for ``object`` type values only. + subtype: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['name'] = self.name + json['type'] = self.type_ + if self.value is not None: + json['value'] = self.value + if self.value_preview is not None: + json['valuePreview'] = self.value_preview.to_json() + if self.subtype is not None: + json['subtype'] = self.subtype + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + type_=str(json['type']), + value=str(json['value']) if 'value' in json else None, + value_preview=ObjectPreview.from_json(json['valuePreview']) if 'valuePreview' in json else None, + subtype=str(json['subtype']) if 'subtype' in json else None, + ) + + +@dataclass +class EntryPreview: + #: Preview of the value. + value: ObjectPreview + + #: Preview of the key. Specified for map-like collection entries. + key: typing.Optional[ObjectPreview] = None + + def to_json(self): + json = dict() + json['value'] = self.value.to_json() + if self.key is not None: + json['key'] = self.key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + value=ObjectPreview.from_json(json['value']), + key=ObjectPreview.from_json(json['key']) if 'key' in json else None, + ) + + +@dataclass +class PropertyDescriptor: + ''' + Object property descriptor. + ''' + #: Property name or symbol description. + name: str + + #: True if the type of this property descriptor may be changed and if the property may be + #: deleted from the corresponding object. + configurable: bool + + #: True if this property shows up during enumeration of the properties on the corresponding + #: object. + enumerable: bool + + #: The value associated with the property. + value: typing.Optional[RemoteObject] = None + + #: True if the value associated with the property may be changed (data descriptors only). + writable: typing.Optional[bool] = None + + #: A function which serves as a getter for the property, or ``undefined`` if there is no getter + #: (accessor descriptors only). + get: typing.Optional[RemoteObject] = None + + #: A function which serves as a setter for the property, or ``undefined`` if there is no setter + #: (accessor descriptors only). + set_: typing.Optional[RemoteObject] = None + + #: True if the result was thrown during the evaluation. + was_thrown: typing.Optional[bool] = None + + #: True if the property is owned for the object. + is_own: typing.Optional[bool] = None + + #: Property symbol object, if the property is of the ``symbol`` type. + symbol: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + json['configurable'] = self.configurable + json['enumerable'] = self.enumerable + if self.value is not None: + json['value'] = self.value.to_json() + if self.writable is not None: + json['writable'] = self.writable + if self.get is not None: + json['get'] = self.get.to_json() + if self.set_ is not None: + json['set'] = self.set_.to_json() + if self.was_thrown is not None: + json['wasThrown'] = self.was_thrown + if self.is_own is not None: + json['isOwn'] = self.is_own + if self.symbol is not None: + json['symbol'] = self.symbol.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + configurable=bool(json['configurable']), + enumerable=bool(json['enumerable']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + writable=bool(json['writable']) if 'writable' in json else None, + get=RemoteObject.from_json(json['get']) if 'get' in json else None, + set_=RemoteObject.from_json(json['set']) if 'set' in json else None, + was_thrown=bool(json['wasThrown']) if 'wasThrown' in json else None, + is_own=bool(json['isOwn']) if 'isOwn' in json else None, + symbol=RemoteObject.from_json(json['symbol']) if 'symbol' in json else None, + ) + + +@dataclass +class InternalPropertyDescriptor: + ''' + Object internal property descriptor. This property isn't normally visible in JavaScript code. + ''' + #: Conventional property name. + name: str + + #: The value associated with the property. + value: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + if self.value is not None: + json['value'] = self.value.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + ) + + +@dataclass +class PrivatePropertyDescriptor: + ''' + Object private field descriptor. + ''' + #: Private property name. + name: str + + #: The value associated with the private property. + value: typing.Optional[RemoteObject] = None + + #: A function which serves as a getter for the private property, + #: or ``undefined`` if there is no getter (accessor descriptors only). + get: typing.Optional[RemoteObject] = None + + #: A function which serves as a setter for the private property, + #: or ``undefined`` if there is no setter (accessor descriptors only). + set_: typing.Optional[RemoteObject] = None + + def to_json(self): + json = dict() + json['name'] = self.name + if self.value is not None: + json['value'] = self.value.to_json() + if self.get is not None: + json['get'] = self.get.to_json() + if self.set_ is not None: + json['set'] = self.set_.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + value=RemoteObject.from_json(json['value']) if 'value' in json else None, + get=RemoteObject.from_json(json['get']) if 'get' in json else None, + set_=RemoteObject.from_json(json['set']) if 'set' in json else None, + ) + + +@dataclass +class CallArgument: + ''' + Represents function call argument. Either remote object id ``objectId``, primitive ``value``, + unserializable primitive value or neither of (for undefined) them should be specified. + ''' + #: Primitive value or serializable javascript object. + value: typing.Optional[typing.Any] = None + + #: Primitive value which can not be JSON-stringified. + unserializable_value: typing.Optional[UnserializableValue] = None + + #: Remote object handle. + object_id: typing.Optional[RemoteObjectId] = None + + def to_json(self): + json = dict() + if self.value is not None: + json['value'] = self.value + if self.unserializable_value is not None: + json['unserializableValue'] = self.unserializable_value.to_json() + if self.object_id is not None: + json['objectId'] = self.object_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + value=json['value'] if 'value' in json else None, + unserializable_value=UnserializableValue.from_json(json['unserializableValue']) if 'unserializableValue' in json else None, + object_id=RemoteObjectId.from_json(json['objectId']) if 'objectId' in json else None, + ) + + +class ExecutionContextId(int): + ''' + Id of an execution context. + ''' + def to_json(self) -> int: + return self + + @classmethod + def from_json(cls, json: int) -> ExecutionContextId: + return cls(json) + + def __repr__(self): + return 'ExecutionContextId({})'.format(super().__repr__()) + + +@dataclass +class ExecutionContextDescription: + ''' + Description of an isolated world. + ''' + #: Unique id of the execution context. It can be used to specify in which execution context + #: script evaluation should be performed. + id_: ExecutionContextId + + #: Execution context origin. + origin: str + + #: Human readable name describing given context. + name: str + + #: 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. + unique_id: str + + #: Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'``'isolated'``'worker', frameId: string} + aux_data: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['id'] = self.id_.to_json() + json['origin'] = self.origin + json['name'] = self.name + json['uniqueId'] = self.unique_id + if self.aux_data is not None: + json['auxData'] = self.aux_data + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=ExecutionContextId.from_json(json['id']), + origin=str(json['origin']), + name=str(json['name']), + unique_id=str(json['uniqueId']), + aux_data=dict(json['auxData']) if 'auxData' in json else None, + ) + + +@dataclass +class ExceptionDetails: + ''' + Detailed information about exception (or error) that was thrown during script compilation or + execution. + ''' + #: Exception id. + exception_id: int + + #: Exception text, which should be used together with exception object when available. + text: str + + #: Line number of the exception location (0-based). + line_number: int + + #: Column number of the exception location (0-based). + column_number: int + + #: Script ID of the exception location. + script_id: typing.Optional[ScriptId] = None + + #: URL of the exception location, to be used when the script was not reported. + url: typing.Optional[str] = None + + #: JavaScript stack trace if available. + stack_trace: typing.Optional[StackTrace] = None + + #: Exception object if available. + exception: typing.Optional[RemoteObject] = None + + #: Identifier of the context where exception happened. + execution_context_id: typing.Optional[ExecutionContextId] = None + + #: Dictionary with entries of meta data that the client associated + #: with this exception, such as information about associated network + #: requests, etc. + exception_meta_data: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['exceptionId'] = self.exception_id + json['text'] = self.text + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + if self.script_id is not None: + json['scriptId'] = self.script_id.to_json() + if self.url is not None: + json['url'] = self.url + if self.stack_trace is not None: + json['stackTrace'] = self.stack_trace.to_json() + if self.exception is not None: + json['exception'] = self.exception.to_json() + if self.execution_context_id is not None: + json['executionContextId'] = self.execution_context_id.to_json() + if self.exception_meta_data is not None: + json['exceptionMetaData'] = self.exception_meta_data + return json + + @classmethod + def from_json(cls, json): + return cls( + exception_id=int(json['exceptionId']), + text=str(json['text']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + script_id=ScriptId.from_json(json['scriptId']) if 'scriptId' in json else None, + url=str(json['url']) if 'url' in json else None, + stack_trace=StackTrace.from_json(json['stackTrace']) if 'stackTrace' in json else None, + exception=RemoteObject.from_json(json['exception']) if 'exception' in json else None, + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) if 'executionContextId' in json else None, + exception_meta_data=dict(json['exceptionMetaData']) if 'exceptionMetaData' in json else None, + ) + + +class Timestamp(float): + ''' + Number of milliseconds since epoch. + ''' + def to_json(self) -> float: + return self + + @classmethod + def from_json(cls, json: float) -> Timestamp: + return cls(json) + + def __repr__(self): + return 'Timestamp({})'.format(super().__repr__()) + + +class TimeDelta(float): + ''' + Number of milliseconds. + ''' + def to_json(self) -> float: + return self + + @classmethod + def from_json(cls, json: float) -> TimeDelta: + return cls(json) + + def __repr__(self): + return 'TimeDelta({})'.format(super().__repr__()) + + +@dataclass +class CallFrame: + ''' + Stack entry for runtime errors and assertions. + ''' + #: JavaScript function name. + function_name: str + + #: JavaScript script id. + script_id: ScriptId + + #: JavaScript script name or url. + url: str + + #: JavaScript script line number (0-based). + line_number: int + + #: JavaScript script column number (0-based). + column_number: int + + def to_json(self): + json = dict() + json['functionName'] = self.function_name + json['scriptId'] = self.script_id.to_json() + json['url'] = self.url + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + return json + + @classmethod + def from_json(cls, json): + return cls( + function_name=str(json['functionName']), + script_id=ScriptId.from_json(json['scriptId']), + url=str(json['url']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + ) + + +@dataclass +class StackTrace: + ''' + Call frames for assertions or error messages. + ''' + #: JavaScript function name. + call_frames: typing.List[CallFrame] + + #: String label of this stack trace. For async traces this may be a name of the function that + #: initiated the async call. + description: typing.Optional[str] = None + + #: Asynchronous JavaScript stack trace that preceded this stack, if available. + parent: typing.Optional[StackTrace] = None + + #: Asynchronous JavaScript stack trace that preceded this stack, if available. + parent_id: typing.Optional[StackTraceId] = None + + def to_json(self): + json = dict() + json['callFrames'] = [i.to_json() for i in self.call_frames] + if self.description is not None: + json['description'] = self.description + if self.parent is not None: + json['parent'] = self.parent.to_json() + if self.parent_id is not None: + json['parentId'] = self.parent_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + call_frames=[CallFrame.from_json(i) for i in json['callFrames']], + description=str(json['description']) if 'description' in json else None, + parent=StackTrace.from_json(json['parent']) if 'parent' in json else None, + parent_id=StackTraceId.from_json(json['parentId']) if 'parentId' in json else None, + ) + + +class UniqueDebuggerId(str): + ''' + Unique identifier of current debugger. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UniqueDebuggerId: + return cls(json) + + def __repr__(self): + return 'UniqueDebuggerId({})'.format(super().__repr__()) + + +@dataclass +class StackTraceId: + ''' + 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. + ''' + id_: str + + debugger_id: typing.Optional[UniqueDebuggerId] = None + + def to_json(self): + json = dict() + json['id'] = self.id_ + if self.debugger_id is not None: + json['debuggerId'] = self.debugger_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + id_=str(json['id']), + debugger_id=UniqueDebuggerId.from_json(json['debuggerId']) if 'debuggerId' in json else None, + ) + + +def await_promise( + promise_object_id: RemoteObjectId, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Add handler to promise with given promise object id. + + :param promise_object_id: Identifier of the promise. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object that should be sent by value. + :param generate_preview: *(Optional)* Whether preview should be generated for the result. + :returns: A tuple with the following items: + + 0. **result** - Promise result. Will contain rejected value if promise was rejected. + 1. **exceptionDetails** - *(Optional)* Exception details if stack strace is available. + ''' + params: T_JSON_DICT = dict() + params['promiseObjectId'] = promise_object_id.to_json() + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.awaitPromise', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def call_function_on( + function_declaration: str, + object_id: typing.Optional[RemoteObjectId] = None, + arguments: typing.Optional[typing.List[CallArgument]] = None, + silent: typing.Optional[bool] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + user_gesture: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None, + execution_context_id: typing.Optional[ExecutionContextId] = None, + object_group: typing.Optional[str] = None, + throw_on_side_effect: typing.Optional[bool] = None, + unique_context_id: typing.Optional[str] = None, + serialization_options: typing.Optional[SerializationOptions] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Calls function with given declaration on the given object. Object group of the result is + inherited from the target object. + + :param function_declaration: Declaration of the function to call. + :param object_id: *(Optional)* Identifier of the object to call function on. Either objectId or executionContextId should be specified. + :param arguments: *(Optional)* Call arguments. All call arguments must belong to the same JavaScript world as the target object. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object which should be sent by value. Can be overriden by ````serializationOptions````. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the result. + :param user_gesture: *(Optional)* Whether execution should be treated as initiated by user in the UI. + :param await_promise: *(Optional)* Whether execution should ````await```` for resulting value and return once awaited promise is resolved. + :param execution_context_id: *(Optional)* Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + :param throw_on_side_effect: **(EXPERIMENTAL)** *(Optional)* Whether to throw an exception if side effect cannot be ruled out during evaluation. + :param unique_context_id: **(EXPERIMENTAL)** *(Optional)* 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 be system-unique, so it can be used to prevent accidental function call in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with ````executionContextId````. + :param serialization_options: **(EXPERIMENTAL)** *(Optional)* Specifies the result serialization. If provided, overrides ````generatePreview```` and ````returnByValue```. + :returns: A tuple with the following items: + + 0. **result** - Call result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['functionDeclaration'] = function_declaration + if object_id is not None: + params['objectId'] = object_id.to_json() + if arguments is not None: + params['arguments'] = [i.to_json() for i in arguments] + if silent is not None: + params['silent'] = silent + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if user_gesture is not None: + params['userGesture'] = user_gesture + if await_promise is not None: + params['awaitPromise'] = await_promise + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + if throw_on_side_effect is not None: + params['throwOnSideEffect'] = throw_on_side_effect + if unique_context_id is not None: + params['uniqueContextId'] = unique_context_id + if serialization_options is not None: + params['serializationOptions'] = serialization_options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.callFunctionOn', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def compile_script( + expression: str, + source_url: str, + persist_script: bool, + execution_context_id: typing.Optional[ExecutionContextId] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.Optional[ScriptId], typing.Optional[ExceptionDetails]]]: + ''' + Compiles expression. + + :param expression: Expression to compile. + :param source_url: Source url to be set for the script. + :param persist_script: Specifies whether the compiled script should be persisted. + :param execution_context_id: *(Optional)* Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + :returns: A tuple with the following items: + + 0. **scriptId** - *(Optional)* Id of the script. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['expression'] = expression + params['sourceURL'] = source_url + params['persistScript'] = persist_script + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.compileScript', + 'params': params, + } + json = yield cmd_dict + return ( + ScriptId.from_json(json['scriptId']) if 'scriptId' in json else None, + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables reporting of execution contexts creation. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.disable', + } + json = yield cmd_dict + + +def discard_console_entries() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Discards collected exceptions and console API calls. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.discardConsoleEntries', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.enable', + } + json = yield cmd_dict + + +def evaluate( + expression: str, + object_group: typing.Optional[str] = None, + include_command_line_api: typing.Optional[bool] = None, + silent: typing.Optional[bool] = None, + context_id: typing.Optional[ExecutionContextId] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + user_gesture: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None, + throw_on_side_effect: typing.Optional[bool] = None, + timeout: typing.Optional[TimeDelta] = None, + disable_breaks: typing.Optional[bool] = None, + repl_mode: typing.Optional[bool] = None, + allow_unsafe_eval_blocked_by_csp: typing.Optional[bool] = None, + unique_context_id: typing.Optional[str] = None, + serialization_options: typing.Optional[SerializationOptions] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Evaluates expression on global object. + + :param expression: Expression to evaluate. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. + :param include_command_line_api: *(Optional)* Determines whether Command Line API should be available during the evaluation. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param context_id: *(Optional)* Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. This is mutually exclusive with ````uniqueContextId````, which offers an alternative way to identify the execution context that is more reliable in a multi-process environment. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object that should be sent by value. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the result. + :param user_gesture: *(Optional)* Whether execution should be treated as initiated by user in the UI. + :param await_promise: *(Optional)* Whether execution should ````await```` for resulting value and return once awaited promise is resolved. + :param throw_on_side_effect: **(EXPERIMENTAL)** *(Optional)* Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies ````disableBreaks```` below. + :param timeout: **(EXPERIMENTAL)** *(Optional)* Terminate execution after timing out (number of milliseconds). + :param disable_breaks: **(EXPERIMENTAL)** *(Optional)* Disable breakpoints during execution. + :param repl_mode: **(EXPERIMENTAL)** *(Optional)* 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. + :param allow_unsafe_eval_blocked_by_csp: **(EXPERIMENTAL)** *(Optional)* 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 this evaluation and allows unsafe-eval. Defaults to true. + :param unique_context_id: **(EXPERIMENTAL)** *(Optional)* An alternative way to specify the execution context to evaluate in. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental evaluation of the expression in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with ````contextId````. + :param serialization_options: **(EXPERIMENTAL)** *(Optional)* Specifies the result serialization. If provided, overrides ````generatePreview```` and ````returnByValue```. + :returns: A tuple with the following items: + + 0. **result** - Evaluation result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['expression'] = expression + if object_group is not None: + params['objectGroup'] = object_group + if include_command_line_api is not None: + params['includeCommandLineAPI'] = include_command_line_api + if silent is not None: + params['silent'] = silent + if context_id is not None: + params['contextId'] = context_id.to_json() + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if user_gesture is not None: + params['userGesture'] = user_gesture + if await_promise is not None: + params['awaitPromise'] = await_promise + if throw_on_side_effect is not None: + params['throwOnSideEffect'] = throw_on_side_effect + if timeout is not None: + params['timeout'] = timeout.to_json() + if disable_breaks is not None: + params['disableBreaks'] = disable_breaks + if repl_mode is not None: + params['replMode'] = repl_mode + if allow_unsafe_eval_blocked_by_csp is not None: + params['allowUnsafeEvalBlockedByCSP'] = allow_unsafe_eval_blocked_by_csp + if unique_context_id is not None: + params['uniqueContextId'] = unique_context_id + if serialization_options is not None: + params['serializationOptions'] = serialization_options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.evaluate', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def get_isolate_id() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,str]: + ''' + Returns the isolate id. + + **EXPERIMENTAL** + + :returns: The isolate id. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getIsolateId', + } + json = yield cmd_dict + return str(json['id']) + + +def get_heap_usage() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[float, float, float, float]]: + ''' + Returns the JavaScript heap usage. + It is the total usage of the corresponding isolate not scoped to a particular Runtime. + + **EXPERIMENTAL** + + :returns: A tuple with the following items: + + 0. **usedSize** - Used JavaScript heap size in bytes. + 1. **totalSize** - Allocated JavaScript heap size in bytes. + 2. **embedderHeapUsedSize** - Used size in bytes in the embedder's garbage-collected heap. + 3. **backingStorageSize** - Size in bytes of backing storage for array buffers and external strings. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getHeapUsage', + } + json = yield cmd_dict + return ( + float(json['usedSize']), + float(json['totalSize']), + float(json['embedderHeapUsedSize']), + float(json['backingStorageSize']) + ) + + +def get_properties( + object_id: RemoteObjectId, + own_properties: typing.Optional[bool] = None, + accessor_properties_only: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + non_indexed_properties_only: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.List[PropertyDescriptor], typing.Optional[typing.List[InternalPropertyDescriptor]], typing.Optional[typing.List[PrivatePropertyDescriptor]], typing.Optional[ExceptionDetails]]]: + ''' + Returns properties of a given object. Object group of the result is inherited from the target + object. + + :param object_id: Identifier of the object to return properties for. + :param own_properties: *(Optional)* If true, returns properties belonging only to the element itself, not to its prototype chain. + :param accessor_properties_only: **(EXPERIMENTAL)** *(Optional)* If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the results. + :param non_indexed_properties_only: **(EXPERIMENTAL)** *(Optional)* If true, returns non-indexed properties only. + :returns: A tuple with the following items: + + 0. **result** - Object properties. + 1. **internalProperties** - *(Optional)* Internal object properties (only of the element itself). + 2. **privateProperties** - *(Optional)* Object private properties. + 3. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['objectId'] = object_id.to_json() + if own_properties is not None: + params['ownProperties'] = own_properties + if accessor_properties_only is not None: + params['accessorPropertiesOnly'] = accessor_properties_only + if generate_preview is not None: + params['generatePreview'] = generate_preview + if non_indexed_properties_only is not None: + params['nonIndexedPropertiesOnly'] = non_indexed_properties_only + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getProperties', + 'params': params, + } + json = yield cmd_dict + return ( + [PropertyDescriptor.from_json(i) for i in json['result']], + [InternalPropertyDescriptor.from_json(i) for i in json['internalProperties']] if 'internalProperties' in json else None, + [PrivatePropertyDescriptor.from_json(i) for i in json['privateProperties']] if 'privateProperties' in json else None, + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def global_lexical_scope_names( + execution_context_id: typing.Optional[ExecutionContextId] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Returns all let, const and class variables from global scope. + + :param execution_context_id: *(Optional)* Specifies in which execution context to lookup global scope variables. + :returns: + ''' + params: T_JSON_DICT = dict() + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.globalLexicalScopeNames', + 'params': params, + } + json = yield cmd_dict + return [str(i) for i in json['names']] + + +def query_objects( + prototype_object_id: RemoteObjectId, + object_group: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,RemoteObject]: + ''' + :param prototype_object_id: Identifier of the prototype to return objects for. + :param object_group: *(Optional)* Symbolic group name that can be used to release the results. + :returns: Array with objects. + ''' + params: T_JSON_DICT = dict() + params['prototypeObjectId'] = prototype_object_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.queryObjects', + 'params': params, + } + json = yield cmd_dict + return RemoteObject.from_json(json['objects']) + + +def release_object( + object_id: RemoteObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Releases remote object with given id. + + :param object_id: Identifier of the object to release. + ''' + params: T_JSON_DICT = dict() + params['objectId'] = object_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.releaseObject', + 'params': params, + } + json = yield cmd_dict + + +def release_object_group( + object_group: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Releases all remote objects that belong to a given group. + + :param object_group: Symbolic object group name. + ''' + params: T_JSON_DICT = dict() + params['objectGroup'] = object_group + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.releaseObjectGroup', + 'params': params, + } + json = yield cmd_dict + + +def run_if_waiting_for_debugger() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Tells inspected instance to run if it was waiting for debugger to attach. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.runIfWaitingForDebugger', + } + json = yield cmd_dict + + +def run_script( + script_id: ScriptId, + execution_context_id: typing.Optional[ExecutionContextId] = None, + object_group: typing.Optional[str] = None, + silent: typing.Optional[bool] = None, + include_command_line_api: typing.Optional[bool] = None, + return_by_value: typing.Optional[bool] = None, + generate_preview: typing.Optional[bool] = None, + await_promise: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[RemoteObject, typing.Optional[ExceptionDetails]]]: + ''' + Runs script with given id in a given context. + + :param script_id: Id of the script to run. + :param execution_context_id: *(Optional)* Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects. + :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ```setPauseOnException```` state. + :param include_command_line_api: *(Optional)* Determines whether Command Line API should be available during the evaluation. + :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object which should be sent by value. + :param generate_preview: *(Optional)* Whether preview should be generated for the result. + :param await_promise: *(Optional)* Whether execution should ````await``` for resulting value and return once awaited promise is resolved. + :returns: A tuple with the following items: + + 0. **result** - Run result. + 1. **exceptionDetails** - *(Optional)* Exception details. + ''' + params: T_JSON_DICT = dict() + params['scriptId'] = script_id.to_json() + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if object_group is not None: + params['objectGroup'] = object_group + if silent is not None: + params['silent'] = silent + if include_command_line_api is not None: + params['includeCommandLineAPI'] = include_command_line_api + if return_by_value is not None: + params['returnByValue'] = return_by_value + if generate_preview is not None: + params['generatePreview'] = generate_preview + if await_promise is not None: + params['awaitPromise'] = await_promise + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.runScript', + 'params': params, + } + json = yield cmd_dict + return ( + RemoteObject.from_json(json['result']), + ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + ) + + +def set_async_call_stack_depth( + max_depth: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables or disables async call stacks tracking. + + :param max_depth: Maximum depth of async call stacks. Setting to ```0``` will effectively disable collecting async call stacks (default). + ''' + params: T_JSON_DICT = dict() + params['maxDepth'] = max_depth + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setAsyncCallStackDepth', + 'params': params, + } + json = yield cmd_dict + + +def set_custom_object_formatter_enabled( + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + + + **EXPERIMENTAL** + + :param enabled: + ''' + params: T_JSON_DICT = dict() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setCustomObjectFormatterEnabled', + 'params': params, + } + json = yield cmd_dict + + +def set_max_call_stack_size_to_capture( + size: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + + + **EXPERIMENTAL** + + :param size: + ''' + params: T_JSON_DICT = dict() + params['size'] = size + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.setMaxCallStackSizeToCapture', + 'params': params, + } + json = yield cmd_dict + + +def terminate_execution() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Terminate current or next JavaScript execution. + Will cancel the termination when the outer-most script execution ends. + + **EXPERIMENTAL** + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.terminateExecution', + } + json = yield cmd_dict + + +def add_binding( + name: str, + execution_context_id: typing.Optional[ExecutionContextId] = None, + execution_context_name: typing.Optional[str] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + :param name: + :param execution_context_id: **(EXPERIMENTAL)** *(Optional)* If specified, the binding would only be exposed to the specified execution 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 case and bugs in implementation (crbug.com/1169639). ````executionContextId```` will be removed in the future. + :param execution_context_name: *(Optional)* If specified, the binding is exposed to the executionContext with matching 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```. + ''' + params: T_JSON_DICT = dict() + params['name'] = name + if execution_context_id is not None: + params['executionContextId'] = execution_context_id.to_json() + if execution_context_name is not None: + params['executionContextName'] = execution_context_name + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.addBinding', + 'params': params, + } + json = yield cmd_dict + + +def remove_binding( + name: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + This method does not remove binding function from global object but + unsubscribes current runtime agent from Runtime.bindingCalled notifications. + + :param name: + ''' + params: T_JSON_DICT = dict() + params['name'] = name + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.removeBinding', + 'params': params, + } + json = yield cmd_dict + + +def get_exception_details( + error_object_id: RemoteObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Optional[ExceptionDetails]]: + ''' + 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. + + **EXPERIMENTAL** + + :param error_object_id: The error object for which to resolve the exception details. + :returns: + ''' + params: T_JSON_DICT = dict() + params['errorObjectId'] = error_object_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Runtime.getExceptionDetails', + 'params': params, + } + json = yield cmd_dict + return ExceptionDetails.from_json(json['exceptionDetails']) if 'exceptionDetails' in json else None + + +@event_class('Runtime.bindingCalled') +@dataclass +class BindingCalled: + ''' + **EXPERIMENTAL** + + Notification is issued every time when binding is called. + ''' + name: str + payload: str + #: Identifier of the context where the call was made. + execution_context_id: ExecutionContextId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> BindingCalled: + return cls( + name=str(json['name']), + payload=str(json['payload']), + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) + ) + + +@event_class('Runtime.consoleAPICalled') +@dataclass +class ConsoleAPICalled: + ''' + Issued when console API was called. + ''' + #: Type of the call. + type_: str + #: Call arguments. + args: typing.List[RemoteObject] + #: Identifier of the context where the call was made. + execution_context_id: ExecutionContextId + #: Call timestamp. + timestamp: Timestamp + #: 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. + stack_trace: typing.Optional[StackTrace] + #: 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. + context: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ConsoleAPICalled: + return cls( + type_=str(json['type']), + args=[RemoteObject.from_json(i) for i in json['args']], + execution_context_id=ExecutionContextId.from_json(json['executionContextId']), + timestamp=Timestamp.from_json(json['timestamp']), + stack_trace=StackTrace.from_json(json['stackTrace']) if 'stackTrace' in json else None, + context=str(json['context']) if 'context' in json else None + ) + + +@event_class('Runtime.exceptionRevoked') +@dataclass +class ExceptionRevoked: + ''' + Issued when unhandled exception was revoked. + ''' + #: Reason describing why exception was revoked. + reason: str + #: The id of revoked exception, as reported in ``exceptionThrown``. + exception_id: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExceptionRevoked: + return cls( + reason=str(json['reason']), + exception_id=int(json['exceptionId']) + ) + + +@event_class('Runtime.exceptionThrown') +@dataclass +class ExceptionThrown: + ''' + Issued when exception was thrown and unhandled. + ''' + #: Timestamp of the exception. + timestamp: Timestamp + exception_details: ExceptionDetails + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExceptionThrown: + return cls( + timestamp=Timestamp.from_json(json['timestamp']), + exception_details=ExceptionDetails.from_json(json['exceptionDetails']) + ) + + +@event_class('Runtime.executionContextCreated') +@dataclass +class ExecutionContextCreated: + ''' + Issued when new execution context is created. + ''' + #: A newly created execution context. + context: ExecutionContextDescription + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextCreated: + return cls( + context=ExecutionContextDescription.from_json(json['context']) + ) + + +@event_class('Runtime.executionContextDestroyed') +@dataclass +class ExecutionContextDestroyed: + ''' + Issued when execution context is destroyed. + ''' + #: Id of the destroyed context + execution_context_id: ExecutionContextId + #: Unique Id of the destroyed context + execution_context_unique_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextDestroyed: + return cls( + execution_context_id=ExecutionContextId.from_json(json['executionContextId']), + execution_context_unique_id=str(json['executionContextUniqueId']) + ) + + +@event_class('Runtime.executionContextsCleared') +@dataclass +class ExecutionContextsCleared: + ''' + Issued when all executionContexts were cleared in browser + ''' + + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ExecutionContextsCleared: + return cls( + + ) + + +@event_class('Runtime.inspectRequested') +@dataclass +class InspectRequested: + ''' + Issued when object should be inspected (for example, as a result of inspect() command line API + call). + ''' + object_: RemoteObject + hints: dict + #: Identifier of the context where the call was made. + execution_context_id: typing.Optional[ExecutionContextId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InspectRequested: + return cls( + object_=RemoteObject.from_json(json['object']), + hints=dict(json['hints']), + execution_context_id=ExecutionContextId.from_json(json['executionContextId']) if 'executionContextId' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/schema.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/schema.py new file mode 100644 index 0000000..5077f78 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/schema.py @@ -0,0 +1,48 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Schema +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +@dataclass +class Domain: + ''' + Description of the protocol domain. + ''' + #: Domain name. + name: str + + #: Domain version. + version: str + + def to_json(self): + json = dict() + json['name'] = self.name + json['version'] = self.version + return json + + @classmethod + def from_json(cls, json): + return cls( + name=str(json['name']), + version=str(json['version']), + ) + + +def get_domains() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Domain]]: + ''' + Returns supported domains. + + :returns: List of supported domains. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Schema.getDomains', + } + json = yield cmd_dict + return [Domain.from_json(i) for i in json['domains']] diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/security.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/security.py new file mode 100644 index 0000000..e7714fe --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/security.py @@ -0,0 +1,507 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Security +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import network + + +class CertificateId(int): + ''' + An internal certificate ID value. + ''' + def to_json(self) -> int: + return self + + @classmethod + def from_json(cls, json: int) -> CertificateId: + return cls(json) + + def __repr__(self): + return 'CertificateId({})'.format(super().__repr__()) + + +class MixedContentType(enum.Enum): + ''' + A description of mixed content (HTTP resources on HTTPS pages), as defined by + https://www.w3.org/TR/mixed-content/#categories + ''' + BLOCKABLE = "blockable" + OPTIONALLY_BLOCKABLE = "optionally-blockable" + NONE = "none" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class SecurityState(enum.Enum): + ''' + The security level of a page or resource. + ''' + UNKNOWN = "unknown" + NEUTRAL = "neutral" + INSECURE = "insecure" + SECURE = "secure" + INFO = "info" + INSECURE_BROKEN = "insecure-broken" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class CertificateSecurityState: + ''' + Details about the security state of the page certificate. + ''' + #: Protocol name (e.g. "TLS 1.2" or "QUIC"). + protocol: str + + #: Key Exchange used by the connection, or the empty string if not applicable. + key_exchange: str + + #: Cipher name. + cipher: str + + #: Page certificate. + certificate: typing.List[str] + + #: Certificate subject name. + subject_name: str + + #: Name of the issuing CA. + issuer: str + + #: Certificate valid from date. + valid_from: network.TimeSinceEpoch + + #: Certificate valid to (expiration) date + valid_to: network.TimeSinceEpoch + + #: True if the certificate uses a weak signature algorithm. + certificate_has_weak_signature: bool + + #: True if the certificate has a SHA1 signature in the chain. + certificate_has_sha1_signature: bool + + #: True if modern SSL + modern_ssl: bool + + #: True if the connection is using an obsolete SSL protocol. + obsolete_ssl_protocol: bool + + #: True if the connection is using an obsolete SSL key exchange. + obsolete_ssl_key_exchange: bool + + #: True if the connection is using an obsolete SSL cipher. + obsolete_ssl_cipher: bool + + #: True if the connection is using an obsolete SSL signature. + obsolete_ssl_signature: bool + + #: (EC)DH group used by the connection, if applicable. + key_exchange_group: typing.Optional[str] = None + + #: TLS MAC. Note that AEAD ciphers do not have separate MACs. + mac: typing.Optional[str] = None + + #: The highest priority network error code, if the certificate has an error. + certificate_network_error: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['protocol'] = self.protocol + json['keyExchange'] = self.key_exchange + json['cipher'] = self.cipher + json['certificate'] = [i for i in self.certificate] + json['subjectName'] = self.subject_name + json['issuer'] = self.issuer + json['validFrom'] = self.valid_from.to_json() + json['validTo'] = self.valid_to.to_json() + json['certificateHasWeakSignature'] = self.certificate_has_weak_signature + json['certificateHasSha1Signature'] = self.certificate_has_sha1_signature + json['modernSSL'] = self.modern_ssl + json['obsoleteSslProtocol'] = self.obsolete_ssl_protocol + json['obsoleteSslKeyExchange'] = self.obsolete_ssl_key_exchange + json['obsoleteSslCipher'] = self.obsolete_ssl_cipher + json['obsoleteSslSignature'] = self.obsolete_ssl_signature + if self.key_exchange_group is not None: + json['keyExchangeGroup'] = self.key_exchange_group + if self.mac is not None: + json['mac'] = self.mac + if self.certificate_network_error is not None: + json['certificateNetworkError'] = self.certificate_network_error + return json + + @classmethod + def from_json(cls, json): + return cls( + protocol=str(json['protocol']), + key_exchange=str(json['keyExchange']), + cipher=str(json['cipher']), + certificate=[str(i) for i in json['certificate']], + subject_name=str(json['subjectName']), + issuer=str(json['issuer']), + valid_from=network.TimeSinceEpoch.from_json(json['validFrom']), + valid_to=network.TimeSinceEpoch.from_json(json['validTo']), + certificate_has_weak_signature=bool(json['certificateHasWeakSignature']), + certificate_has_sha1_signature=bool(json['certificateHasSha1Signature']), + modern_ssl=bool(json['modernSSL']), + obsolete_ssl_protocol=bool(json['obsoleteSslProtocol']), + obsolete_ssl_key_exchange=bool(json['obsoleteSslKeyExchange']), + obsolete_ssl_cipher=bool(json['obsoleteSslCipher']), + obsolete_ssl_signature=bool(json['obsoleteSslSignature']), + key_exchange_group=str(json['keyExchangeGroup']) if 'keyExchangeGroup' in json else None, + mac=str(json['mac']) if 'mac' in json else None, + certificate_network_error=str(json['certificateNetworkError']) if 'certificateNetworkError' in json else None, + ) + + +class SafetyTipStatus(enum.Enum): + BAD_REPUTATION = "badReputation" + LOOKALIKE = "lookalike" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class SafetyTipInfo: + #: Describes whether the page triggers any safety tips or reputation warnings. Default is unknown. + safety_tip_status: SafetyTipStatus + + #: The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches. + safe_url: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['safetyTipStatus'] = self.safety_tip_status.to_json() + if self.safe_url is not None: + json['safeUrl'] = self.safe_url + return json + + @classmethod + def from_json(cls, json): + return cls( + safety_tip_status=SafetyTipStatus.from_json(json['safetyTipStatus']), + safe_url=str(json['safeUrl']) if 'safeUrl' in json else None, + ) + + +@dataclass +class VisibleSecurityState: + ''' + Security state information about the page. + ''' + #: The security level of the page. + security_state: SecurityState + + #: Array of security state issues ids. + security_state_issue_ids: typing.List[str] + + #: Security state details about the page certificate. + certificate_security_state: typing.Optional[CertificateSecurityState] = None + + #: 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. + safety_tip_info: typing.Optional[SafetyTipInfo] = None + + def to_json(self): + json = dict() + json['securityState'] = self.security_state.to_json() + json['securityStateIssueIds'] = [i for i in self.security_state_issue_ids] + if self.certificate_security_state is not None: + json['certificateSecurityState'] = self.certificate_security_state.to_json() + if self.safety_tip_info is not None: + json['safetyTipInfo'] = self.safety_tip_info.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + security_state=SecurityState.from_json(json['securityState']), + security_state_issue_ids=[str(i) for i in json['securityStateIssueIds']], + certificate_security_state=CertificateSecurityState.from_json(json['certificateSecurityState']) if 'certificateSecurityState' in json else None, + safety_tip_info=SafetyTipInfo.from_json(json['safetyTipInfo']) if 'safetyTipInfo' in json else None, + ) + + +@dataclass +class SecurityStateExplanation: + ''' + An explanation of an factor contributing to the security state. + ''' + #: Security state representing the severity of the factor being explained. + security_state: SecurityState + + #: Title describing the type of factor. + title: str + + #: Short phrase describing the type of factor. + summary: str + + #: Full text explanation of the factor. + description: str + + #: The type of mixed content described by the explanation. + mixed_content_type: MixedContentType + + #: Page certificate. + certificate: typing.List[str] + + #: Recommendations to fix any issues. + recommendations: typing.Optional[typing.List[str]] = None + + def to_json(self): + json = dict() + json['securityState'] = self.security_state.to_json() + json['title'] = self.title + json['summary'] = self.summary + json['description'] = self.description + json['mixedContentType'] = self.mixed_content_type.to_json() + json['certificate'] = [i for i in self.certificate] + if self.recommendations is not None: + json['recommendations'] = [i for i in self.recommendations] + return json + + @classmethod + def from_json(cls, json): + return cls( + security_state=SecurityState.from_json(json['securityState']), + title=str(json['title']), + summary=str(json['summary']), + description=str(json['description']), + mixed_content_type=MixedContentType.from_json(json['mixedContentType']), + certificate=[str(i) for i in json['certificate']], + recommendations=[str(i) for i in json['recommendations']] if 'recommendations' in json else None, + ) + + +@dataclass +class InsecureContentStatus: + ''' + Information about insecure content on the page. + ''' + #: Always false. + ran_mixed_content: bool + + #: Always false. + displayed_mixed_content: bool + + #: Always false. + contained_mixed_form: bool + + #: Always false. + ran_content_with_cert_errors: bool + + #: Always false. + displayed_content_with_cert_errors: bool + + #: Always set to unknown. + ran_insecure_content_style: SecurityState + + #: Always set to unknown. + displayed_insecure_content_style: SecurityState + + def to_json(self): + json = dict() + json['ranMixedContent'] = self.ran_mixed_content + json['displayedMixedContent'] = self.displayed_mixed_content + json['containedMixedForm'] = self.contained_mixed_form + json['ranContentWithCertErrors'] = self.ran_content_with_cert_errors + json['displayedContentWithCertErrors'] = self.displayed_content_with_cert_errors + json['ranInsecureContentStyle'] = self.ran_insecure_content_style.to_json() + json['displayedInsecureContentStyle'] = self.displayed_insecure_content_style.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + ran_mixed_content=bool(json['ranMixedContent']), + displayed_mixed_content=bool(json['displayedMixedContent']), + contained_mixed_form=bool(json['containedMixedForm']), + ran_content_with_cert_errors=bool(json['ranContentWithCertErrors']), + displayed_content_with_cert_errors=bool(json['displayedContentWithCertErrors']), + ran_insecure_content_style=SecurityState.from_json(json['ranInsecureContentStyle']), + displayed_insecure_content_style=SecurityState.from_json(json['displayedInsecureContentStyle']), + ) + + +class CertificateErrorAction(enum.Enum): + ''' + The action to take when a certificate error occurs. continue will continue processing the + request and cancel will cancel the request. + ''' + CONTINUE = "continue" + CANCEL = "cancel" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables tracking security state changes. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Security.disable', + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables tracking security state changes. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Security.enable', + } + json = yield cmd_dict + + +def set_ignore_certificate_errors( + ignore: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable/disable whether all certificate errors should be ignored. + + :param ignore: If true, all certificate errors will be ignored. + ''' + params: T_JSON_DICT = dict() + params['ignore'] = ignore + cmd_dict: T_JSON_DICT = { + 'method': 'Security.setIgnoreCertificateErrors', + 'params': params, + } + json = yield cmd_dict + + +def handle_certificate_error( + event_id: int, + action: CertificateErrorAction + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Handles a certificate error that fired a certificateError event. + + :param event_id: The ID of the event. + :param action: The action to take on the certificate error. + ''' + params: T_JSON_DICT = dict() + params['eventId'] = event_id + params['action'] = action.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Security.handleCertificateError', + 'params': params, + } + json = yield cmd_dict + + +def set_override_certificate_errors( + override: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable/disable overriding certificate errors. If enabled, all certificate error events need to + be handled by the DevTools client and should be answered with ``handleCertificateError`` commands. + + :param override: If true, certificate errors will be overridden. + ''' + params: T_JSON_DICT = dict() + params['override'] = override + cmd_dict: T_JSON_DICT = { + 'method': 'Security.setOverrideCertificateErrors', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Security.certificateError') +@dataclass +class CertificateError: + ''' + 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. + ''' + #: The ID of the event. + event_id: int + #: The type of the error. + error_type: str + #: The url that was requested. + request_url: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CertificateError: + return cls( + event_id=int(json['eventId']), + error_type=str(json['errorType']), + request_url=str(json['requestURL']) + ) + + +@event_class('Security.visibleSecurityStateChanged') +@dataclass +class VisibleSecurityStateChanged: + ''' + **EXPERIMENTAL** + + The security state of the page changed. + ''' + #: Security state information about the page. + visible_security_state: VisibleSecurityState + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> VisibleSecurityStateChanged: + return cls( + visible_security_state=VisibleSecurityState.from_json(json['visibleSecurityState']) + ) + + +@event_class('Security.securityStateChanged') +@dataclass +class SecurityStateChanged: + ''' + The security state of the page changed. No longer being sent. + ''' + #: Security state. + security_state: SecurityState + #: True if the page was loaded over cryptographic transport such as HTTPS. + scheme_is_cryptographic: bool + #: Previously a list of explanations for the security state. Now always + #: empty. + explanations: typing.List[SecurityStateExplanation] + #: Information about insecure content on the page. + insecure_content_status: InsecureContentStatus + #: Overrides user-visible description of the state. Always omitted. + summary: typing.Optional[str] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> SecurityStateChanged: + return cls( + security_state=SecurityState.from_json(json['securityState']), + scheme_is_cryptographic=bool(json['schemeIsCryptographic']), + explanations=[SecurityStateExplanation.from_json(i) for i in json['explanations']], + insecure_content_status=InsecureContentStatus.from_json(json['insecureContentStatus']), + summary=str(json['summary']) if 'summary' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/service_worker.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/service_worker.py new file mode 100644 index 0000000..9dd80b1 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/service_worker.py @@ -0,0 +1,414 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: ServiceWorker (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import target + + +class RegistrationID(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> RegistrationID: + return cls(json) + + def __repr__(self): + return 'RegistrationID({})'.format(super().__repr__()) + + +@dataclass +class ServiceWorkerRegistration: + ''' + ServiceWorker registration. + ''' + registration_id: RegistrationID + + scope_url: str + + is_deleted: bool + + def to_json(self): + json = dict() + json['registrationId'] = self.registration_id.to_json() + json['scopeURL'] = self.scope_url + json['isDeleted'] = self.is_deleted + return json + + @classmethod + def from_json(cls, json): + return cls( + registration_id=RegistrationID.from_json(json['registrationId']), + scope_url=str(json['scopeURL']), + is_deleted=bool(json['isDeleted']), + ) + + +class ServiceWorkerVersionRunningStatus(enum.Enum): + STOPPED = "stopped" + STARTING = "starting" + RUNNING = "running" + STOPPING = "stopping" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ServiceWorkerVersionStatus(enum.Enum): + NEW = "new" + INSTALLING = "installing" + INSTALLED = "installed" + ACTIVATING = "activating" + ACTIVATED = "activated" + REDUNDANT = "redundant" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ServiceWorkerVersion: + ''' + ServiceWorker version. + ''' + version_id: str + + registration_id: RegistrationID + + script_url: str + + running_status: ServiceWorkerVersionRunningStatus + + status: ServiceWorkerVersionStatus + + #: The Last-Modified header value of the main script. + script_last_modified: typing.Optional[float] = None + + #: 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. + script_response_time: typing.Optional[float] = None + + controlled_clients: typing.Optional[typing.List[target.TargetID]] = None + + target_id: typing.Optional[target.TargetID] = None + + router_rules: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['versionId'] = self.version_id + json['registrationId'] = self.registration_id.to_json() + json['scriptURL'] = self.script_url + json['runningStatus'] = self.running_status.to_json() + json['status'] = self.status.to_json() + if self.script_last_modified is not None: + json['scriptLastModified'] = self.script_last_modified + if self.script_response_time is not None: + json['scriptResponseTime'] = self.script_response_time + if self.controlled_clients is not None: + json['controlledClients'] = [i.to_json() for i in self.controlled_clients] + if self.target_id is not None: + json['targetId'] = self.target_id.to_json() + if self.router_rules is not None: + json['routerRules'] = self.router_rules + return json + + @classmethod + def from_json(cls, json): + return cls( + version_id=str(json['versionId']), + registration_id=RegistrationID.from_json(json['registrationId']), + script_url=str(json['scriptURL']), + running_status=ServiceWorkerVersionRunningStatus.from_json(json['runningStatus']), + status=ServiceWorkerVersionStatus.from_json(json['status']), + script_last_modified=float(json['scriptLastModified']) if 'scriptLastModified' in json else None, + script_response_time=float(json['scriptResponseTime']) if 'scriptResponseTime' in json else None, + controlled_clients=[target.TargetID.from_json(i) for i in json['controlledClients']] if 'controlledClients' in json else None, + target_id=target.TargetID.from_json(json['targetId']) if 'targetId' in json else None, + router_rules=str(json['routerRules']) if 'routerRules' in json else None, + ) + + +@dataclass +class ServiceWorkerErrorMessage: + ''' + ServiceWorker error message. + ''' + error_message: str + + registration_id: RegistrationID + + version_id: str + + source_url: str + + line_number: int + + column_number: int + + def to_json(self): + json = dict() + json['errorMessage'] = self.error_message + json['registrationId'] = self.registration_id.to_json() + json['versionId'] = self.version_id + json['sourceURL'] = self.source_url + json['lineNumber'] = self.line_number + json['columnNumber'] = self.column_number + return json + + @classmethod + def from_json(cls, json): + return cls( + error_message=str(json['errorMessage']), + registration_id=RegistrationID.from_json(json['registrationId']), + version_id=str(json['versionId']), + source_url=str(json['sourceURL']), + line_number=int(json['lineNumber']), + column_number=int(json['columnNumber']), + ) + + +def deliver_push_message( + origin: str, + registration_id: RegistrationID, + data: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param data: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['data'] = data + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.deliverPushMessage', + 'params': params, + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.disable', + } + json = yield cmd_dict + + +def dispatch_sync_event( + origin: str, + registration_id: RegistrationID, + tag: str, + last_chance: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param tag: + :param last_chance: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['tag'] = tag + params['lastChance'] = last_chance + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.dispatchSyncEvent', + 'params': params, + } + json = yield cmd_dict + + +def dispatch_periodic_sync_event( + origin: str, + registration_id: RegistrationID, + tag: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param origin: + :param registration_id: + :param tag: + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['registrationId'] = registration_id.to_json() + params['tag'] = tag + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.dispatchPeriodicSyncEvent', + 'params': params, + } + json = yield cmd_dict + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.enable', + } + json = yield cmd_dict + + +def inspect_worker( + version_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param version_id: + ''' + params: T_JSON_DICT = dict() + params['versionId'] = version_id + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.inspectWorker', + 'params': params, + } + json = yield cmd_dict + + +def set_force_update_on_page_load( + force_update_on_page_load: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param force_update_on_page_load: + ''' + params: T_JSON_DICT = dict() + params['forceUpdateOnPageLoad'] = force_update_on_page_load + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.setForceUpdateOnPageLoad', + 'params': params, + } + json = yield cmd_dict + + +def skip_waiting( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.skipWaiting', + 'params': params, + } + json = yield cmd_dict + + +def start_worker( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.startWorker', + 'params': params, + } + json = yield cmd_dict + + +def stop_all_workers() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.stopAllWorkers', + } + json = yield cmd_dict + + +def stop_worker( + version_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param version_id: + ''' + params: T_JSON_DICT = dict() + params['versionId'] = version_id + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.stopWorker', + 'params': params, + } + json = yield cmd_dict + + +def unregister( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.unregister', + 'params': params, + } + json = yield cmd_dict + + +def update_registration( + scope_url: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + :param scope_url: + ''' + params: T_JSON_DICT = dict() + params['scopeURL'] = scope_url + cmd_dict: T_JSON_DICT = { + 'method': 'ServiceWorker.updateRegistration', + 'params': params, + } + json = yield cmd_dict + + +@event_class('ServiceWorker.workerErrorReported') +@dataclass +class WorkerErrorReported: + error_message: ServiceWorkerErrorMessage + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerErrorReported: + return cls( + error_message=ServiceWorkerErrorMessage.from_json(json['errorMessage']) + ) + + +@event_class('ServiceWorker.workerRegistrationUpdated') +@dataclass +class WorkerRegistrationUpdated: + registrations: typing.List[ServiceWorkerRegistration] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerRegistrationUpdated: + return cls( + registrations=[ServiceWorkerRegistration.from_json(i) for i in json['registrations']] + ) + + +@event_class('ServiceWorker.workerVersionUpdated') +@dataclass +class WorkerVersionUpdated: + versions: typing.List[ServiceWorkerVersion] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> WorkerVersionUpdated: + return cls( + versions=[ServiceWorkerVersion.from_json(i) for i in json['versions']] + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/storage.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/storage.py new file mode 100644 index 0000000..8cae0ab --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/storage.py @@ -0,0 +1,2120 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Storage (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import browser +from . import network +from . import page + + +class SerializedStorageKey(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SerializedStorageKey: + return cls(json) + + def __repr__(self): + return 'SerializedStorageKey({})'.format(super().__repr__()) + + +class StorageType(enum.Enum): + ''' + Enum of possible storage types. + ''' + COOKIES = "cookies" + FILE_SYSTEMS = "file_systems" + INDEXEDDB = "indexeddb" + LOCAL_STORAGE = "local_storage" + SHADER_CACHE = "shader_cache" + WEBSQL = "websql" + SERVICE_WORKERS = "service_workers" + CACHE_STORAGE = "cache_storage" + INTEREST_GROUPS = "interest_groups" + SHARED_STORAGE = "shared_storage" + STORAGE_BUCKETS = "storage_buckets" + ALL_ = "all" + OTHER = "other" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class UsageForType: + ''' + Usage for a storage type. + ''' + #: Name of storage type. + storage_type: StorageType + + #: Storage usage (bytes). + usage: float + + def to_json(self): + json = dict() + json['storageType'] = self.storage_type.to_json() + json['usage'] = self.usage + return json + + @classmethod + def from_json(cls, json): + return cls( + storage_type=StorageType.from_json(json['storageType']), + usage=float(json['usage']), + ) + + +@dataclass +class TrustTokens: + ''' + Pair of issuer origin and number of available (signed, but not used) Trust + Tokens from that issuer. + ''' + issuer_origin: str + + count: float + + def to_json(self): + json = dict() + json['issuerOrigin'] = self.issuer_origin + json['count'] = self.count + return json + + @classmethod + def from_json(cls, json): + return cls( + issuer_origin=str(json['issuerOrigin']), + count=float(json['count']), + ) + + +class InterestGroupAuctionId(str): + ''' + Protected audience interest group auction identifier. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> InterestGroupAuctionId: + return cls(json) + + def __repr__(self): + return 'InterestGroupAuctionId({})'.format(super().__repr__()) + + +class InterestGroupAccessType(enum.Enum): + ''' + Enum of interest group access types. + ''' + JOIN = "join" + LEAVE = "leave" + UPDATE = "update" + LOADED = "loaded" + BID = "bid" + WIN = "win" + ADDITIONAL_BID = "additionalBid" + ADDITIONAL_BID_WIN = "additionalBidWin" + TOP_LEVEL_BID = "topLevelBid" + TOP_LEVEL_ADDITIONAL_BID = "topLevelAdditionalBid" + CLEAR = "clear" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class InterestGroupAuctionEventType(enum.Enum): + ''' + Enum of auction events. + ''' + STARTED = "started" + CONFIG_RESOLVED = "configResolved" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class InterestGroupAuctionFetchType(enum.Enum): + ''' + Enum of network fetches auctions can do. + ''' + BIDDER_JS = "bidderJs" + BIDDER_WASM = "bidderWasm" + SELLER_JS = "sellerJs" + BIDDER_TRUSTED_SIGNALS = "bidderTrustedSignals" + SELLER_TRUSTED_SIGNALS = "sellerTrustedSignals" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class SharedStorageAccessType(enum.Enum): + ''' + Enum of shared storage access types. + ''' + DOCUMENT_ADD_MODULE = "documentAddModule" + DOCUMENT_SELECT_URL = "documentSelectURL" + DOCUMENT_RUN = "documentRun" + DOCUMENT_SET = "documentSet" + DOCUMENT_APPEND = "documentAppend" + DOCUMENT_DELETE = "documentDelete" + DOCUMENT_CLEAR = "documentClear" + DOCUMENT_GET = "documentGet" + WORKLET_SET = "workletSet" + WORKLET_APPEND = "workletAppend" + WORKLET_DELETE = "workletDelete" + WORKLET_CLEAR = "workletClear" + WORKLET_GET = "workletGet" + WORKLET_KEYS = "workletKeys" + WORKLET_ENTRIES = "workletEntries" + WORKLET_LENGTH = "workletLength" + WORKLET_REMAINING_BUDGET = "workletRemainingBudget" + HEADER_SET = "headerSet" + HEADER_APPEND = "headerAppend" + HEADER_DELETE = "headerDelete" + HEADER_CLEAR = "headerClear" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class SharedStorageEntry: + ''' + Struct for a single key-value pair in an origin's shared storage. + ''' + key: str + + value: str + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=str(json['value']), + ) + + +@dataclass +class SharedStorageMetadata: + ''' + Details for an origin's shared storage. + ''' + #: Time when the origin's shared storage was last created. + creation_time: network.TimeSinceEpoch + + #: Number of key-value pairs stored in origin's shared storage. + length: int + + #: Current amount of bits of entropy remaining in the navigation budget. + remaining_budget: float + + #: Total number of bytes stored as key-value pairs in origin's shared + #: storage. + bytes_used: int + + def to_json(self): + json = dict() + json['creationTime'] = self.creation_time.to_json() + json['length'] = self.length + json['remainingBudget'] = self.remaining_budget + json['bytesUsed'] = self.bytes_used + return json + + @classmethod + def from_json(cls, json): + return cls( + creation_time=network.TimeSinceEpoch.from_json(json['creationTime']), + length=int(json['length']), + remaining_budget=float(json['remainingBudget']), + bytes_used=int(json['bytesUsed']), + ) + + +@dataclass +class SharedStorageReportingMetadata: + ''' + Pair of reporting metadata details for a candidate URL for ``selectURL()``. + ''' + event_type: str + + reporting_url: str + + def to_json(self): + json = dict() + json['eventType'] = self.event_type + json['reportingUrl'] = self.reporting_url + return json + + @classmethod + def from_json(cls, json): + return cls( + event_type=str(json['eventType']), + reporting_url=str(json['reportingUrl']), + ) + + +@dataclass +class SharedStorageUrlWithMetadata: + ''' + Bundles a candidate URL with its reporting metadata. + ''' + #: Spec of candidate URL. + url: str + + #: Any associated reporting metadata. + reporting_metadata: typing.List[SharedStorageReportingMetadata] + + def to_json(self): + json = dict() + json['url'] = self.url + json['reportingMetadata'] = [i.to_json() for i in self.reporting_metadata] + return json + + @classmethod + def from_json(cls, json): + return cls( + url=str(json['url']), + reporting_metadata=[SharedStorageReportingMetadata.from_json(i) for i in json['reportingMetadata']], + ) + + +@dataclass +class SharedStorageAccessParams: + ''' + Bundles the parameters for shared storage access events whose + presence/absence can vary according to SharedStorageAccessType. + ''' + #: Spec of the module script URL. + #: Present only for SharedStorageAccessType.documentAddModule. + script_source_url: typing.Optional[str] = None + + #: Name of the registered operation to be run. + #: Present only for SharedStorageAccessType.documentRun and + #: SharedStorageAccessType.documentSelectURL. + operation_name: typing.Optional[str] = None + + #: The operation's serialized data in bytes (converted to a string). + #: Present only for SharedStorageAccessType.documentRun and + #: SharedStorageAccessType.documentSelectURL. + serialized_data: typing.Optional[str] = None + + #: Array of candidate URLs' specs, along with any associated metadata. + #: Present only for SharedStorageAccessType.documentSelectURL. + urls_with_metadata: typing.Optional[typing.List[SharedStorageUrlWithMetadata]] = None + + #: Key for a specific entry in an origin's shared storage. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.documentAppend, + #: SharedStorageAccessType.documentDelete, + #: SharedStorageAccessType.workletSet, + #: SharedStorageAccessType.workletAppend, + #: SharedStorageAccessType.workletDelete, + #: SharedStorageAccessType.workletGet, + #: SharedStorageAccessType.headerSet, + #: SharedStorageAccessType.headerAppend, and + #: SharedStorageAccessType.headerDelete. + key: typing.Optional[str] = None + + #: Value for a specific entry in an origin's shared storage. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.documentAppend, + #: SharedStorageAccessType.workletSet, + #: SharedStorageAccessType.workletAppend, + #: SharedStorageAccessType.headerSet, and + #: SharedStorageAccessType.headerAppend. + value: typing.Optional[str] = None + + #: Whether or not to set an entry for a key if that key is already present. + #: Present only for SharedStorageAccessType.documentSet, + #: SharedStorageAccessType.workletSet, and + #: SharedStorageAccessType.headerSet. + ignore_if_present: typing.Optional[bool] = None + + def to_json(self): + json = dict() + if self.script_source_url is not None: + json['scriptSourceUrl'] = self.script_source_url + if self.operation_name is not None: + json['operationName'] = self.operation_name + if self.serialized_data is not None: + json['serializedData'] = self.serialized_data + if self.urls_with_metadata is not None: + json['urlsWithMetadata'] = [i.to_json() for i in self.urls_with_metadata] + if self.key is not None: + json['key'] = self.key + if self.value is not None: + json['value'] = self.value + if self.ignore_if_present is not None: + json['ignoreIfPresent'] = self.ignore_if_present + return json + + @classmethod + def from_json(cls, json): + return cls( + script_source_url=str(json['scriptSourceUrl']) if 'scriptSourceUrl' in json else None, + operation_name=str(json['operationName']) if 'operationName' in json else None, + serialized_data=str(json['serializedData']) if 'serializedData' in json else None, + urls_with_metadata=[SharedStorageUrlWithMetadata.from_json(i) for i in json['urlsWithMetadata']] if 'urlsWithMetadata' in json else None, + key=str(json['key']) if 'key' in json else None, + value=str(json['value']) if 'value' in json else None, + ignore_if_present=bool(json['ignoreIfPresent']) if 'ignoreIfPresent' in json else None, + ) + + +class StorageBucketsDurability(enum.Enum): + RELAXED = "relaxed" + STRICT = "strict" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class StorageBucket: + storage_key: SerializedStorageKey + + #: If not specified, it is the default bucket of the storageKey. + name: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['storageKey'] = self.storage_key.to_json() + if self.name is not None: + json['name'] = self.name + return json + + @classmethod + def from_json(cls, json): + return cls( + storage_key=SerializedStorageKey.from_json(json['storageKey']), + name=str(json['name']) if 'name' in json else None, + ) + + +@dataclass +class StorageBucketInfo: + bucket: StorageBucket + + id_: str + + expiration: network.TimeSinceEpoch + + #: Storage quota (bytes). + quota: float + + persistent: bool + + durability: StorageBucketsDurability + + def to_json(self): + json = dict() + json['bucket'] = self.bucket.to_json() + json['id'] = self.id_ + json['expiration'] = self.expiration.to_json() + json['quota'] = self.quota + json['persistent'] = self.persistent + json['durability'] = self.durability.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + bucket=StorageBucket.from_json(json['bucket']), + id_=str(json['id']), + expiration=network.TimeSinceEpoch.from_json(json['expiration']), + quota=float(json['quota']), + persistent=bool(json['persistent']), + durability=StorageBucketsDurability.from_json(json['durability']), + ) + + +class AttributionReportingSourceType(enum.Enum): + NAVIGATION = "navigation" + EVENT = "event" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class UnsignedInt64AsBase10(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnsignedInt64AsBase10: + return cls(json) + + def __repr__(self): + return 'UnsignedInt64AsBase10({})'.format(super().__repr__()) + + +class UnsignedInt128AsBase16(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> UnsignedInt128AsBase16: + return cls(json) + + def __repr__(self): + return 'UnsignedInt128AsBase16({})'.format(super().__repr__()) + + +class SignedInt64AsBase10(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SignedInt64AsBase10: + return cls(json) + + def __repr__(self): + return 'SignedInt64AsBase10({})'.format(super().__repr__()) + + +@dataclass +class AttributionReportingFilterDataEntry: + key: str + + values: typing.List[str] + + def to_json(self): + json = dict() + json['key'] = self.key + json['values'] = [i for i in self.values] + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + values=[str(i) for i in json['values']], + ) + + +@dataclass +class AttributionReportingFilterConfig: + filter_values: typing.List[AttributionReportingFilterDataEntry] + + #: duration in seconds + lookback_window: typing.Optional[int] = None + + def to_json(self): + json = dict() + json['filterValues'] = [i.to_json() for i in self.filter_values] + if self.lookback_window is not None: + json['lookbackWindow'] = self.lookback_window + return json + + @classmethod + def from_json(cls, json): + return cls( + filter_values=[AttributionReportingFilterDataEntry.from_json(i) for i in json['filterValues']], + lookback_window=int(json['lookbackWindow']) if 'lookbackWindow' in json else None, + ) + + +@dataclass +class AttributionReportingFilterPair: + filters: typing.List[AttributionReportingFilterConfig] + + not_filters: typing.List[AttributionReportingFilterConfig] + + def to_json(self): + json = dict() + json['filters'] = [i.to_json() for i in self.filters] + json['notFilters'] = [i.to_json() for i in self.not_filters] + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=[AttributionReportingFilterConfig.from_json(i) for i in json['filters']], + not_filters=[AttributionReportingFilterConfig.from_json(i) for i in json['notFilters']], + ) + + +@dataclass +class AttributionReportingAggregationKeysEntry: + key: str + + value: UnsignedInt128AsBase16 + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=UnsignedInt128AsBase16.from_json(json['value']), + ) + + +@dataclass +class AttributionReportingEventReportWindows: + #: duration in seconds + start: int + + #: duration in seconds + ends: typing.List[int] + + def to_json(self): + json = dict() + json['start'] = self.start + json['ends'] = [i for i in self.ends] + return json + + @classmethod + def from_json(cls, json): + return cls( + start=int(json['start']), + ends=[int(i) for i in json['ends']], + ) + + +@dataclass +class AttributionReportingTriggerSpec: + #: number instead of integer because not all uint32 can be represented by + #: int + trigger_data: typing.List[float] + + event_report_windows: AttributionReportingEventReportWindows + + def to_json(self): + json = dict() + json['triggerData'] = [i for i in self.trigger_data] + json['eventReportWindows'] = self.event_report_windows.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + trigger_data=[float(i) for i in json['triggerData']], + event_report_windows=AttributionReportingEventReportWindows.from_json(json['eventReportWindows']), + ) + + +class AttributionReportingTriggerDataMatching(enum.Enum): + EXACT = "exact" + MODULUS = "modulus" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class AttributionReportingAggregatableDebugReportingData: + key_piece: UnsignedInt128AsBase16 + + #: number instead of integer because not all uint32 can be represented by + #: int + value: float + + types: typing.List[str] + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['value'] = self.value + json['types'] = [i for i in self.types] + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + value=float(json['value']), + types=[str(i) for i in json['types']], + ) + + +@dataclass +class AttributionReportingAggregatableDebugReportingConfig: + key_piece: UnsignedInt128AsBase16 + + debug_data: typing.List[AttributionReportingAggregatableDebugReportingData] + + #: number instead of integer because not all uint32 can be represented by + #: int, only present for source registrations + budget: typing.Optional[float] = None + + aggregation_coordinator_origin: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['debugData'] = [i.to_json() for i in self.debug_data] + if self.budget is not None: + json['budget'] = self.budget + if self.aggregation_coordinator_origin is not None: + json['aggregationCoordinatorOrigin'] = self.aggregation_coordinator_origin + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + debug_data=[AttributionReportingAggregatableDebugReportingData.from_json(i) for i in json['debugData']], + budget=float(json['budget']) if 'budget' in json else None, + aggregation_coordinator_origin=str(json['aggregationCoordinatorOrigin']) if 'aggregationCoordinatorOrigin' in json else None, + ) + + +@dataclass +class AttributionScopesData: + values: typing.List[str] + + #: number instead of integer because not all uint32 can be represented by + #: int + limit: float + + max_event_states: float + + def to_json(self): + json = dict() + json['values'] = [i for i in self.values] + json['limit'] = self.limit + json['maxEventStates'] = self.max_event_states + return json + + @classmethod + def from_json(cls, json): + return cls( + values=[str(i) for i in json['values']], + limit=float(json['limit']), + max_event_states=float(json['maxEventStates']), + ) + + +@dataclass +class AttributionReportingSourceRegistration: + time: network.TimeSinceEpoch + + #: duration in seconds + expiry: int + + trigger_specs: typing.List[AttributionReportingTriggerSpec] + + #: duration in seconds + aggregatable_report_window: int + + type_: AttributionReportingSourceType + + source_origin: str + + reporting_origin: str + + destination_sites: typing.List[str] + + event_id: UnsignedInt64AsBase10 + + priority: SignedInt64AsBase10 + + filter_data: typing.List[AttributionReportingFilterDataEntry] + + aggregation_keys: typing.List[AttributionReportingAggregationKeysEntry] + + trigger_data_matching: AttributionReportingTriggerDataMatching + + destination_limit_priority: SignedInt64AsBase10 + + aggregatable_debug_reporting_config: AttributionReportingAggregatableDebugReportingConfig + + max_event_level_reports: int + + debug_key: typing.Optional[UnsignedInt64AsBase10] = None + + scopes_data: typing.Optional[AttributionScopesData] = None + + def to_json(self): + json = dict() + json['time'] = self.time.to_json() + json['expiry'] = self.expiry + json['triggerSpecs'] = [i.to_json() for i in self.trigger_specs] + json['aggregatableReportWindow'] = self.aggregatable_report_window + json['type'] = self.type_.to_json() + json['sourceOrigin'] = self.source_origin + json['reportingOrigin'] = self.reporting_origin + json['destinationSites'] = [i for i in self.destination_sites] + json['eventId'] = self.event_id.to_json() + json['priority'] = self.priority.to_json() + json['filterData'] = [i.to_json() for i in self.filter_data] + json['aggregationKeys'] = [i.to_json() for i in self.aggregation_keys] + json['triggerDataMatching'] = self.trigger_data_matching.to_json() + json['destinationLimitPriority'] = self.destination_limit_priority.to_json() + json['aggregatableDebugReportingConfig'] = self.aggregatable_debug_reporting_config.to_json() + json['maxEventLevelReports'] = self.max_event_level_reports + if self.debug_key is not None: + json['debugKey'] = self.debug_key.to_json() + if self.scopes_data is not None: + json['scopesData'] = self.scopes_data.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + time=network.TimeSinceEpoch.from_json(json['time']), + expiry=int(json['expiry']), + trigger_specs=[AttributionReportingTriggerSpec.from_json(i) for i in json['triggerSpecs']], + aggregatable_report_window=int(json['aggregatableReportWindow']), + type_=AttributionReportingSourceType.from_json(json['type']), + source_origin=str(json['sourceOrigin']), + reporting_origin=str(json['reportingOrigin']), + destination_sites=[str(i) for i in json['destinationSites']], + event_id=UnsignedInt64AsBase10.from_json(json['eventId']), + priority=SignedInt64AsBase10.from_json(json['priority']), + filter_data=[AttributionReportingFilterDataEntry.from_json(i) for i in json['filterData']], + aggregation_keys=[AttributionReportingAggregationKeysEntry.from_json(i) for i in json['aggregationKeys']], + trigger_data_matching=AttributionReportingTriggerDataMatching.from_json(json['triggerDataMatching']), + destination_limit_priority=SignedInt64AsBase10.from_json(json['destinationLimitPriority']), + aggregatable_debug_reporting_config=AttributionReportingAggregatableDebugReportingConfig.from_json(json['aggregatableDebugReportingConfig']), + max_event_level_reports=int(json['maxEventLevelReports']), + debug_key=UnsignedInt64AsBase10.from_json(json['debugKey']) if 'debugKey' in json else None, + scopes_data=AttributionScopesData.from_json(json['scopesData']) if 'scopesData' in json else None, + ) + + +class AttributionReportingSourceRegistrationResult(enum.Enum): + SUCCESS = "success" + INTERNAL_ERROR = "internalError" + INSUFFICIENT_SOURCE_CAPACITY = "insufficientSourceCapacity" + INSUFFICIENT_UNIQUE_DESTINATION_CAPACITY = "insufficientUniqueDestinationCapacity" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + SUCCESS_NOISED = "successNoised" + DESTINATION_REPORTING_LIMIT_REACHED = "destinationReportingLimitReached" + DESTINATION_GLOBAL_LIMIT_REACHED = "destinationGlobalLimitReached" + DESTINATION_BOTH_LIMITS_REACHED = "destinationBothLimitsReached" + REPORTING_ORIGINS_PER_SITE_LIMIT_REACHED = "reportingOriginsPerSiteLimitReached" + EXCEEDS_MAX_CHANNEL_CAPACITY = "exceedsMaxChannelCapacity" + EXCEEDS_MAX_SCOPES_CHANNEL_CAPACITY = "exceedsMaxScopesChannelCapacity" + EXCEEDS_MAX_TRIGGER_STATE_CARDINALITY = "exceedsMaxTriggerStateCardinality" + EXCEEDS_MAX_EVENT_STATES_LIMIT = "exceedsMaxEventStatesLimit" + DESTINATION_PER_DAY_REPORTING_LIMIT_REACHED = "destinationPerDayReportingLimitReached" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AttributionReportingSourceRegistrationTimeConfig(enum.Enum): + INCLUDE = "include" + EXCLUDE = "exclude" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class AttributionReportingAggregatableValueDictEntry: + key: str + + #: number instead of integer because not all uint32 can be represented by + #: int + value: float + + filtering_id: UnsignedInt64AsBase10 + + def to_json(self): + json = dict() + json['key'] = self.key + json['value'] = self.value + json['filteringId'] = self.filtering_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key=str(json['key']), + value=float(json['value']), + filtering_id=UnsignedInt64AsBase10.from_json(json['filteringId']), + ) + + +@dataclass +class AttributionReportingAggregatableValueEntry: + values: typing.List[AttributionReportingAggregatableValueDictEntry] + + filters: AttributionReportingFilterPair + + def to_json(self): + json = dict() + json['values'] = [i.to_json() for i in self.values] + json['filters'] = self.filters.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + values=[AttributionReportingAggregatableValueDictEntry.from_json(i) for i in json['values']], + filters=AttributionReportingFilterPair.from_json(json['filters']), + ) + + +@dataclass +class AttributionReportingEventTriggerData: + data: UnsignedInt64AsBase10 + + priority: SignedInt64AsBase10 + + filters: AttributionReportingFilterPair + + dedup_key: typing.Optional[UnsignedInt64AsBase10] = None + + def to_json(self): + json = dict() + json['data'] = self.data.to_json() + json['priority'] = self.priority.to_json() + json['filters'] = self.filters.to_json() + if self.dedup_key is not None: + json['dedupKey'] = self.dedup_key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + data=UnsignedInt64AsBase10.from_json(json['data']), + priority=SignedInt64AsBase10.from_json(json['priority']), + filters=AttributionReportingFilterPair.from_json(json['filters']), + dedup_key=UnsignedInt64AsBase10.from_json(json['dedupKey']) if 'dedupKey' in json else None, + ) + + +@dataclass +class AttributionReportingAggregatableTriggerData: + key_piece: UnsignedInt128AsBase16 + + source_keys: typing.List[str] + + filters: AttributionReportingFilterPair + + def to_json(self): + json = dict() + json['keyPiece'] = self.key_piece.to_json() + json['sourceKeys'] = [i for i in self.source_keys] + json['filters'] = self.filters.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + key_piece=UnsignedInt128AsBase16.from_json(json['keyPiece']), + source_keys=[str(i) for i in json['sourceKeys']], + filters=AttributionReportingFilterPair.from_json(json['filters']), + ) + + +@dataclass +class AttributionReportingAggregatableDedupKey: + filters: AttributionReportingFilterPair + + dedup_key: typing.Optional[UnsignedInt64AsBase10] = None + + def to_json(self): + json = dict() + json['filters'] = self.filters.to_json() + if self.dedup_key is not None: + json['dedupKey'] = self.dedup_key.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=AttributionReportingFilterPair.from_json(json['filters']), + dedup_key=UnsignedInt64AsBase10.from_json(json['dedupKey']) if 'dedupKey' in json else None, + ) + + +@dataclass +class AttributionReportingTriggerRegistration: + filters: AttributionReportingFilterPair + + aggregatable_dedup_keys: typing.List[AttributionReportingAggregatableDedupKey] + + event_trigger_data: typing.List[AttributionReportingEventTriggerData] + + aggregatable_trigger_data: typing.List[AttributionReportingAggregatableTriggerData] + + aggregatable_values: typing.List[AttributionReportingAggregatableValueEntry] + + aggregatable_filtering_id_max_bytes: int + + debug_reporting: bool + + source_registration_time_config: AttributionReportingSourceRegistrationTimeConfig + + aggregatable_debug_reporting_config: AttributionReportingAggregatableDebugReportingConfig + + scopes: typing.List[str] + + debug_key: typing.Optional[UnsignedInt64AsBase10] = None + + aggregation_coordinator_origin: typing.Optional[str] = None + + trigger_context_id: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['filters'] = self.filters.to_json() + json['aggregatableDedupKeys'] = [i.to_json() for i in self.aggregatable_dedup_keys] + json['eventTriggerData'] = [i.to_json() for i in self.event_trigger_data] + json['aggregatableTriggerData'] = [i.to_json() for i in self.aggregatable_trigger_data] + json['aggregatableValues'] = [i.to_json() for i in self.aggregatable_values] + json['aggregatableFilteringIdMaxBytes'] = self.aggregatable_filtering_id_max_bytes + json['debugReporting'] = self.debug_reporting + json['sourceRegistrationTimeConfig'] = self.source_registration_time_config.to_json() + json['aggregatableDebugReportingConfig'] = self.aggregatable_debug_reporting_config.to_json() + json['scopes'] = [i for i in self.scopes] + if self.debug_key is not None: + json['debugKey'] = self.debug_key.to_json() + if self.aggregation_coordinator_origin is not None: + json['aggregationCoordinatorOrigin'] = self.aggregation_coordinator_origin + if self.trigger_context_id is not None: + json['triggerContextId'] = self.trigger_context_id + return json + + @classmethod + def from_json(cls, json): + return cls( + filters=AttributionReportingFilterPair.from_json(json['filters']), + aggregatable_dedup_keys=[AttributionReportingAggregatableDedupKey.from_json(i) for i in json['aggregatableDedupKeys']], + event_trigger_data=[AttributionReportingEventTriggerData.from_json(i) for i in json['eventTriggerData']], + aggregatable_trigger_data=[AttributionReportingAggregatableTriggerData.from_json(i) for i in json['aggregatableTriggerData']], + aggregatable_values=[AttributionReportingAggregatableValueEntry.from_json(i) for i in json['aggregatableValues']], + aggregatable_filtering_id_max_bytes=int(json['aggregatableFilteringIdMaxBytes']), + debug_reporting=bool(json['debugReporting']), + source_registration_time_config=AttributionReportingSourceRegistrationTimeConfig.from_json(json['sourceRegistrationTimeConfig']), + aggregatable_debug_reporting_config=AttributionReportingAggregatableDebugReportingConfig.from_json(json['aggregatableDebugReportingConfig']), + scopes=[str(i) for i in json['scopes']], + debug_key=UnsignedInt64AsBase10.from_json(json['debugKey']) if 'debugKey' in json else None, + aggregation_coordinator_origin=str(json['aggregationCoordinatorOrigin']) if 'aggregationCoordinatorOrigin' in json else None, + trigger_context_id=str(json['triggerContextId']) if 'triggerContextId' in json else None, + ) + + +class AttributionReportingEventLevelResult(enum.Enum): + SUCCESS = "success" + SUCCESS_DROPPED_LOWER_PRIORITY = "successDroppedLowerPriority" + INTERNAL_ERROR = "internalError" + NO_CAPACITY_FOR_ATTRIBUTION_DESTINATION = "noCapacityForAttributionDestination" + NO_MATCHING_SOURCES = "noMatchingSources" + DEDUPLICATED = "deduplicated" + EXCESSIVE_ATTRIBUTIONS = "excessiveAttributions" + PRIORITY_TOO_LOW = "priorityTooLow" + NEVER_ATTRIBUTED_SOURCE = "neverAttributedSource" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + NO_MATCHING_SOURCE_FILTER_DATA = "noMatchingSourceFilterData" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + NO_MATCHING_CONFIGURATIONS = "noMatchingConfigurations" + EXCESSIVE_REPORTS = "excessiveReports" + FALSELY_ATTRIBUTED_SOURCE = "falselyAttributedSource" + REPORT_WINDOW_PASSED = "reportWindowPassed" + NOT_REGISTERED = "notRegistered" + REPORT_WINDOW_NOT_STARTED = "reportWindowNotStarted" + NO_MATCHING_TRIGGER_DATA = "noMatchingTriggerData" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AttributionReportingAggregatableResult(enum.Enum): + SUCCESS = "success" + INTERNAL_ERROR = "internalError" + NO_CAPACITY_FOR_ATTRIBUTION_DESTINATION = "noCapacityForAttributionDestination" + NO_MATCHING_SOURCES = "noMatchingSources" + EXCESSIVE_ATTRIBUTIONS = "excessiveAttributions" + EXCESSIVE_REPORTING_ORIGINS = "excessiveReportingOrigins" + NO_HISTOGRAMS = "noHistograms" + INSUFFICIENT_BUDGET = "insufficientBudget" + INSUFFICIENT_NAMED_BUDGET = "insufficientNamedBudget" + NO_MATCHING_SOURCE_FILTER_DATA = "noMatchingSourceFilterData" + NOT_REGISTERED = "notRegistered" + PROHIBITED_BY_BROWSER_POLICY = "prohibitedByBrowserPolicy" + DEDUPLICATED = "deduplicated" + REPORT_WINDOW_PASSED = "reportWindowPassed" + EXCESSIVE_REPORTS = "excessiveReports" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class RelatedWebsiteSet: + ''' + A single Related Website Set object. + ''' + #: The primary site of this set, along with the ccTLDs if there is any. + primary_sites: typing.List[str] + + #: The associated sites of this set, along with the ccTLDs if there is any. + associated_sites: typing.List[str] + + #: The service sites of this set, along with the ccTLDs if there is any. + service_sites: typing.List[str] + + def to_json(self): + json = dict() + json['primarySites'] = [i for i in self.primary_sites] + json['associatedSites'] = [i for i in self.associated_sites] + json['serviceSites'] = [i for i in self.service_sites] + return json + + @classmethod + def from_json(cls, json): + return cls( + primary_sites=[str(i) for i in json['primarySites']], + associated_sites=[str(i) for i in json['associatedSites']], + service_sites=[str(i) for i in json['serviceSites']], + ) + + +def get_storage_key_for_frame( + frame_id: page.FrameId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SerializedStorageKey]: + ''' + Returns a storage key given a frame id. + + :param frame_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['frameId'] = frame_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getStorageKeyForFrame', + 'params': params, + } + json = yield cmd_dict + return SerializedStorageKey.from_json(json['storageKey']) + + +def clear_data_for_origin( + origin: str, + storage_types: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears storage for origin. + + :param origin: Security origin. + :param storage_types: Comma separated list of StorageType to clear. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + params['storageTypes'] = storage_types + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearDataForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def clear_data_for_storage_key( + storage_key: str, + storage_types: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears storage for storage key. + + :param storage_key: Storage key. + :param storage_types: Comma separated list of StorageType to clear. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + params['storageTypes'] = storage_types + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearDataForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def get_cookies( + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[network.Cookie]]: + ''' + Returns all browser cookies. + + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + :returns: Array of cookie objects. + ''' + params: T_JSON_DICT = dict() + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getCookies', + 'params': params, + } + json = yield cmd_dict + return [network.Cookie.from_json(i) for i in json['cookies']] + + +def set_cookies( + cookies: typing.List[network.CookieParam], + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets given cookies. + + :param cookies: Cookies to be set. + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + ''' + params: T_JSON_DICT = dict() + params['cookies'] = [i.to_json() for i in cookies] + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setCookies', + 'params': params, + } + json = yield cmd_dict + + +def clear_cookies( + browser_context_id: typing.Optional[browser.BrowserContextID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears cookies. + + :param browser_context_id: *(Optional)* Browser context to use when called on the browser endpoint. + ''' + params: T_JSON_DICT = dict() + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearCookies', + 'params': params, + } + json = yield cmd_dict + + +def get_usage_and_quota( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[float, float, bool, typing.List[UsageForType]]]: + ''' + Returns usage and quota in bytes. + + :param origin: Security origin. + :returns: A tuple with the following items: + + 0. **usage** - Storage usage (bytes). + 1. **quota** - Storage quota (bytes). + 2. **overrideActive** - Whether or not the origin has an active storage quota override + 3. **usageBreakdown** - Storage usage per type (bytes). + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getUsageAndQuota', + 'params': params, + } + json = yield cmd_dict + return ( + float(json['usage']), + float(json['quota']), + bool(json['overrideActive']), + [UsageForType.from_json(i) for i in json['usageBreakdown']] + ) + + +def override_quota_for_origin( + origin: str, + quota_size: typing.Optional[float] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Override quota for the specified origin + + **EXPERIMENTAL** + + :param origin: Security origin. + :param quota_size: *(Optional)* The quota size (in bytes) to override the original quota with. If this is called multiple times, the overridden quota will be equal to the quotaSize provided in the final call. If this is called without specifying a quotaSize, the quota will be reset to the default value for the specified origin. If this is called multiple times with different origins, the override will be maintained for each origin until it is disabled (called without a quotaSize). + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + if quota_size is not None: + params['quotaSize'] = quota_size + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.overrideQuotaForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_cache_storage_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers origin to be notified when an update occurs to its cache storage list. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackCacheStorageForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_cache_storage_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers storage key to be notified when an update occurs to its cache storage list. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackCacheStorageForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def track_indexed_db_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers origin to be notified when an update occurs to its IndexedDB. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackIndexedDBForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def track_indexed_db_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Registers storage key to be notified when an update occurs to its IndexedDB. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.trackIndexedDBForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def untrack_cache_storage_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters origin from receiving notifications for cache storage. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackCacheStorageForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def untrack_cache_storage_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters storage key from receiving notifications for cache storage. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackCacheStorageForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def untrack_indexed_db_for_origin( + origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters origin from receiving notifications for IndexedDB. + + :param origin: Security origin. + ''' + params: T_JSON_DICT = dict() + params['origin'] = origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackIndexedDBForOrigin', + 'params': params, + } + json = yield cmd_dict + + +def untrack_indexed_db_for_storage_key( + storage_key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Unregisters storage key from receiving notifications for IndexedDB. + + :param storage_key: Storage key. + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.untrackIndexedDBForStorageKey', + 'params': params, + } + json = yield cmd_dict + + +def get_trust_tokens() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[TrustTokens]]: + ''' + Returns the number of stored Trust Tokens per issuer for the + current browsing context. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getTrustTokens', + } + json = yield cmd_dict + return [TrustTokens.from_json(i) for i in json['tokens']] + + +def clear_trust_tokens( + issuer_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Removes all Trust Tokens issued by the provided issuerOrigin. + Leaves other stored data, including the issuer's Redemption Records, intact. + + **EXPERIMENTAL** + + :param issuer_origin: + :returns: True if any tokens were deleted, false otherwise. + ''' + params: T_JSON_DICT = dict() + params['issuerOrigin'] = issuer_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearTrustTokens', + 'params': params, + } + json = yield cmd_dict + return bool(json['didDeleteTokens']) + + +def get_interest_group_details( + owner_origin: str, + name: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,dict]: + ''' + Gets details for a named interest group. + + **EXPERIMENTAL** + + :param owner_origin: + :param name: + :returns: This largely corresponds to: https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup but has absolute expirationTime instead of relative lifetimeMs and also adds joiningOrigin. + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['name'] = name + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getInterestGroupDetails', + 'params': params, + } + json = yield cmd_dict + return dict(json['details']) + + +def set_interest_group_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/Disables issuing of interestGroupAccessed events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setInterestGroupTracking', + 'params': params, + } + json = yield cmd_dict + + +def set_interest_group_auction_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/Disables issuing of interestGroupAuctionEventOccurred and + interestGroupAuctionNetworkRequestCreated. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setInterestGroupAuctionTracking', + 'params': params, + } + json = yield cmd_dict + + +def get_shared_storage_metadata( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SharedStorageMetadata]: + ''' + Gets metadata for an origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :returns: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getSharedStorageMetadata', + 'params': params, + } + json = yield cmd_dict + return SharedStorageMetadata.from_json(json['metadata']) + + +def get_shared_storage_entries( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[SharedStorageEntry]]: + ''' + Gets the entries in an given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :returns: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getSharedStorageEntries', + 'params': params, + } + json = yield cmd_dict + return [SharedStorageEntry.from_json(i) for i in json['entries']] + + +def set_shared_storage_entry( + owner_origin: str, + key: str, + value: str, + ignore_if_present: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets entry with ``key`` and ``value`` for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :param key: + :param value: + :param ignore_if_present: *(Optional)* If ```ignoreIfPresent```` is included and true, then only sets the entry if ````key``` doesn't already exist. + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['key'] = key + params['value'] = value + if ignore_if_present is not None: + params['ignoreIfPresent'] = ignore_if_present + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setSharedStorageEntry', + 'params': params, + } + json = yield cmd_dict + + +def delete_shared_storage_entry( + owner_origin: str, + key: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes entry for ``key`` (if it exists) for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + :param key: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + params['key'] = key + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.deleteSharedStorageEntry', + 'params': params, + } + json = yield cmd_dict + + +def clear_shared_storage_entries( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears all entries for a given origin's shared storage. + + **EXPERIMENTAL** + + :param owner_origin: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.clearSharedStorageEntries', + 'params': params, + } + json = yield cmd_dict + + +def reset_shared_storage_budget( + owner_origin: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Resets the budget for ``ownerOrigin`` by clearing all budget withdrawals. + + **EXPERIMENTAL** + + :param owner_origin: + ''' + params: T_JSON_DICT = dict() + params['ownerOrigin'] = owner_origin + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.resetSharedStorageBudget', + 'params': params, + } + json = yield cmd_dict + + +def set_shared_storage_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/disables issuing of sharedStorageAccessed events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setSharedStorageTracking', + 'params': params, + } + json = yield cmd_dict + + +def set_storage_bucket_tracking( + storage_key: str, + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Set tracking for a storage key's buckets. + + **EXPERIMENTAL** + + :param storage_key: + :param enable: + ''' + params: T_JSON_DICT = dict() + params['storageKey'] = storage_key + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setStorageBucketTracking', + 'params': params, + } + json = yield cmd_dict + + +def delete_storage_bucket( + bucket: StorageBucket + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes the Storage Bucket with the given storage key and bucket name. + + **EXPERIMENTAL** + + :param bucket: + ''' + params: T_JSON_DICT = dict() + params['bucket'] = bucket.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.deleteStorageBucket', + 'params': params, + } + json = yield cmd_dict + + +def run_bounce_tracking_mitigations() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Deletes state for sites identified as potential bounce trackers, immediately. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.runBounceTrackingMitigations', + } + json = yield cmd_dict + return [str(i) for i in json['deletedSites']] + + +def set_attribution_reporting_local_testing_mode( + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + https://wicg.github.io/attribution-reporting-api/ + + **EXPERIMENTAL** + + :param enabled: If enabled, noise is suppressed and reports are sent immediately. + ''' + params: T_JSON_DICT = dict() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setAttributionReportingLocalTestingMode', + 'params': params, + } + json = yield cmd_dict + + +def set_attribution_reporting_tracking( + enable: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables/disables issuing of Attribution Reporting events. + + **EXPERIMENTAL** + + :param enable: + ''' + params: T_JSON_DICT = dict() + params['enable'] = enable + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.setAttributionReportingTracking', + 'params': params, + } + json = yield cmd_dict + + +def send_pending_attribution_reports() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,int]: + ''' + Sends all pending Attribution Reports immediately, regardless of their + scheduled report time. + + **EXPERIMENTAL** + + :returns: The number of reports that were sent. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.sendPendingAttributionReports', + } + json = yield cmd_dict + return int(json['numSent']) + + +def get_related_website_sets() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[RelatedWebsiteSet]]: + ''' + 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. + + **EXPERIMENTAL** + + :returns: + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getRelatedWebsiteSets', + } + json = yield cmd_dict + return [RelatedWebsiteSet.from_json(i) for i in json['sets']] + + +def get_affected_urls_for_third_party_cookie_metadata( + first_party_url: str, + third_party_urls: typing.List[str] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + 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 + + **EXPERIMENTAL** + + :param first_party_url: The URL of the page currently being visited. + :param third_party_urls: The list of embedded resource URLs from the page. + :returns: Array of matching URLs. If there is a primary pattern match for the first- party URL, only the first-party URL is returned in the array. + ''' + params: T_JSON_DICT = dict() + params['firstPartyUrl'] = first_party_url + params['thirdPartyUrls'] = [i for i in third_party_urls] + cmd_dict: T_JSON_DICT = { + 'method': 'Storage.getAffectedUrlsForThirdPartyCookieMetadata', + 'params': params, + } + json = yield cmd_dict + return [str(i) for i in json['matchedUrls']] + + +@event_class('Storage.cacheStorageContentUpdated') +@dataclass +class CacheStorageContentUpdated: + ''' + A cache's contents have been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + #: Name of cache in origin. + cache_name: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CacheStorageContentUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']), + cache_name=str(json['cacheName']) + ) + + +@event_class('Storage.cacheStorageListUpdated') +@dataclass +class CacheStorageListUpdated: + ''' + A cache has been added/deleted. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CacheStorageListUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.indexedDBContentUpdated') +@dataclass +class IndexedDBContentUpdated: + ''' + The origin's IndexedDB object store has been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + #: Database to update. + database_name: str + #: ObjectStore to update. + object_store_name: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> IndexedDBContentUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']), + database_name=str(json['databaseName']), + object_store_name=str(json['objectStoreName']) + ) + + +@event_class('Storage.indexedDBListUpdated') +@dataclass +class IndexedDBListUpdated: + ''' + The origin's IndexedDB database list has been modified. + ''' + #: Origin to update. + origin: str + #: Storage key to update. + storage_key: str + #: Storage bucket to update. + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> IndexedDBListUpdated: + return cls( + origin=str(json['origin']), + storage_key=str(json['storageKey']), + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.interestGroupAccessed') +@dataclass +class InterestGroupAccessed: + ''' + One of the interest groups was accessed. Note that these events are global + to all targets sharing an interest group store. + ''' + access_time: network.TimeSinceEpoch + type_: InterestGroupAccessType + owner_origin: str + name: str + #: For topLevelBid/topLevelAdditionalBid, and when appropriate, + #: win and additionalBidWin + component_seller_origin: typing.Optional[str] + #: For bid or somethingBid event, if done locally and not on a server. + bid: typing.Optional[float] + bid_currency: typing.Optional[str] + #: For non-global events --- links to interestGroupAuctionEvent + unique_auction_id: typing.Optional[InterestGroupAuctionId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAccessed: + return cls( + access_time=network.TimeSinceEpoch.from_json(json['accessTime']), + type_=InterestGroupAccessType.from_json(json['type']), + owner_origin=str(json['ownerOrigin']), + name=str(json['name']), + component_seller_origin=str(json['componentSellerOrigin']) if 'componentSellerOrigin' in json else None, + bid=float(json['bid']) if 'bid' in json else None, + bid_currency=str(json['bidCurrency']) if 'bidCurrency' in json else None, + unique_auction_id=InterestGroupAuctionId.from_json(json['uniqueAuctionId']) if 'uniqueAuctionId' in json else None + ) + + +@event_class('Storage.interestGroupAuctionEventOccurred') +@dataclass +class InterestGroupAuctionEventOccurred: + ''' + An auction involving interest groups is taking place. These events are + target-specific. + ''' + event_time: network.TimeSinceEpoch + type_: InterestGroupAuctionEventType + unique_auction_id: InterestGroupAuctionId + #: Set for child auctions. + parent_auction_id: typing.Optional[InterestGroupAuctionId] + #: Set for started and configResolved + auction_config: typing.Optional[dict] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAuctionEventOccurred: + return cls( + event_time=network.TimeSinceEpoch.from_json(json['eventTime']), + type_=InterestGroupAuctionEventType.from_json(json['type']), + unique_auction_id=InterestGroupAuctionId.from_json(json['uniqueAuctionId']), + parent_auction_id=InterestGroupAuctionId.from_json(json['parentAuctionId']) if 'parentAuctionId' in json else None, + auction_config=dict(json['auctionConfig']) if 'auctionConfig' in json else None + ) + + +@event_class('Storage.interestGroupAuctionNetworkRequestCreated') +@dataclass +class InterestGroupAuctionNetworkRequestCreated: + ''' + 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). + ''' + type_: InterestGroupAuctionFetchType + request_id: network.RequestId + #: 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. + auctions: typing.List[InterestGroupAuctionId] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> InterestGroupAuctionNetworkRequestCreated: + return cls( + type_=InterestGroupAuctionFetchType.from_json(json['type']), + request_id=network.RequestId.from_json(json['requestId']), + auctions=[InterestGroupAuctionId.from_json(i) for i in json['auctions']] + ) + + +@event_class('Storage.sharedStorageAccessed') +@dataclass +class SharedStorageAccessed: + ''' + Shared storage was accessed by the associated page. + The following parameters are included in all events. + ''' + #: Time of the access. + access_time: network.TimeSinceEpoch + #: Enum value indicating the Shared Storage API method invoked. + type_: SharedStorageAccessType + #: DevTools Frame Token for the primary frame tree's root. + main_frame_id: page.FrameId + #: Serialized origin for the context that invoked the Shared Storage API. + owner_origin: str + #: The sub-parameters wrapped by ``params`` are all optional and their + #: presence/absence depends on ``type``. + params: SharedStorageAccessParams + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> SharedStorageAccessed: + return cls( + access_time=network.TimeSinceEpoch.from_json(json['accessTime']), + type_=SharedStorageAccessType.from_json(json['type']), + main_frame_id=page.FrameId.from_json(json['mainFrameId']), + owner_origin=str(json['ownerOrigin']), + params=SharedStorageAccessParams.from_json(json['params']) + ) + + +@event_class('Storage.storageBucketCreatedOrUpdated') +@dataclass +class StorageBucketCreatedOrUpdated: + bucket_info: StorageBucketInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> StorageBucketCreatedOrUpdated: + return cls( + bucket_info=StorageBucketInfo.from_json(json['bucketInfo']) + ) + + +@event_class('Storage.storageBucketDeleted') +@dataclass +class StorageBucketDeleted: + bucket_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> StorageBucketDeleted: + return cls( + bucket_id=str(json['bucketId']) + ) + + +@event_class('Storage.attributionReportingSourceRegistered') +@dataclass +class AttributionReportingSourceRegistered: + ''' + **EXPERIMENTAL** + + + ''' + registration: AttributionReportingSourceRegistration + result: AttributionReportingSourceRegistrationResult + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttributionReportingSourceRegistered: + return cls( + registration=AttributionReportingSourceRegistration.from_json(json['registration']), + result=AttributionReportingSourceRegistrationResult.from_json(json['result']) + ) + + +@event_class('Storage.attributionReportingTriggerRegistered') +@dataclass +class AttributionReportingTriggerRegistered: + ''' + **EXPERIMENTAL** + + + ''' + registration: AttributionReportingTriggerRegistration + event_level: AttributionReportingEventLevelResult + aggregatable: AttributionReportingAggregatableResult + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttributionReportingTriggerRegistered: + return cls( + registration=AttributionReportingTriggerRegistration.from_json(json['registration']), + event_level=AttributionReportingEventLevelResult.from_json(json['eventLevel']), + aggregatable=AttributionReportingAggregatableResult.from_json(json['aggregatable']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/system_info.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/system_info.py new file mode 100644 index 0000000..d1b2f6b --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/system_info.py @@ -0,0 +1,366 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: SystemInfo (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +@dataclass +class GPUDevice: + ''' + Describes a single graphics processor (GPU). + ''' + #: PCI ID of the GPU vendor, if available; 0 otherwise. + vendor_id: float + + #: PCI ID of the GPU device, if available; 0 otherwise. + device_id: float + + #: String description of the GPU vendor, if the PCI ID is not available. + vendor_string: str + + #: String description of the GPU device, if the PCI ID is not available. + device_string: str + + #: String description of the GPU driver vendor. + driver_vendor: str + + #: String description of the GPU driver version. + driver_version: str + + #: Sub sys ID of the GPU, only available on Windows. + sub_sys_id: typing.Optional[float] = None + + #: Revision of the GPU, only available on Windows. + revision: typing.Optional[float] = None + + def to_json(self): + json = dict() + json['vendorId'] = self.vendor_id + json['deviceId'] = self.device_id + json['vendorString'] = self.vendor_string + json['deviceString'] = self.device_string + json['driverVendor'] = self.driver_vendor + json['driverVersion'] = self.driver_version + if self.sub_sys_id is not None: + json['subSysId'] = self.sub_sys_id + if self.revision is not None: + json['revision'] = self.revision + return json + + @classmethod + def from_json(cls, json): + return cls( + vendor_id=float(json['vendorId']), + device_id=float(json['deviceId']), + vendor_string=str(json['vendorString']), + device_string=str(json['deviceString']), + driver_vendor=str(json['driverVendor']), + driver_version=str(json['driverVersion']), + sub_sys_id=float(json['subSysId']) if 'subSysId' in json else None, + revision=float(json['revision']) if 'revision' in json else None, + ) + + +@dataclass +class Size: + ''' + Describes the width and height dimensions of an entity. + ''' + #: Width in pixels. + width: int + + #: Height in pixels. + height: int + + def to_json(self): + json = dict() + json['width'] = self.width + json['height'] = self.height + return json + + @classmethod + def from_json(cls, json): + return cls( + width=int(json['width']), + height=int(json['height']), + ) + + +@dataclass +class VideoDecodeAcceleratorCapability: + ''' + Describes a supported video decoding profile with its associated minimum and + maximum resolutions. + ''' + #: Video codec profile that is supported, e.g. VP9 Profile 2. + profile: str + + #: Maximum video dimensions in pixels supported for this ``profile``. + max_resolution: Size + + #: Minimum video dimensions in pixels supported for this ``profile``. + min_resolution: Size + + def to_json(self): + json = dict() + json['profile'] = self.profile + json['maxResolution'] = self.max_resolution.to_json() + json['minResolution'] = self.min_resolution.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + profile=str(json['profile']), + max_resolution=Size.from_json(json['maxResolution']), + min_resolution=Size.from_json(json['minResolution']), + ) + + +@dataclass +class VideoEncodeAcceleratorCapability: + ''' + Describes a supported video encoding profile with its associated maximum + resolution and maximum framerate. + ''' + #: Video codec profile that is supported, e.g H264 Main. + profile: str + + #: Maximum video dimensions in pixels supported for this ``profile``. + max_resolution: Size + + #: 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. + max_framerate_numerator: int + + max_framerate_denominator: int + + def to_json(self): + json = dict() + json['profile'] = self.profile + json['maxResolution'] = self.max_resolution.to_json() + json['maxFramerateNumerator'] = self.max_framerate_numerator + json['maxFramerateDenominator'] = self.max_framerate_denominator + return json + + @classmethod + def from_json(cls, json): + return cls( + profile=str(json['profile']), + max_resolution=Size.from_json(json['maxResolution']), + max_framerate_numerator=int(json['maxFramerateNumerator']), + max_framerate_denominator=int(json['maxFramerateDenominator']), + ) + + +class SubsamplingFormat(enum.Enum): + ''' + YUV subsampling type of the pixels of a given image. + ''' + YUV420 = "yuv420" + YUV422 = "yuv422" + YUV444 = "yuv444" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ImageType(enum.Enum): + ''' + Image format of a given image. + ''' + JPEG = "jpeg" + WEBP = "webp" + UNKNOWN = "unknown" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ImageDecodeAcceleratorCapability: + ''' + Describes a supported image decoding profile with its associated minimum and + maximum resolutions and subsampling. + ''' + #: Image coded, e.g. Jpeg. + image_type: ImageType + + #: Maximum supported dimensions of the image in pixels. + max_dimensions: Size + + #: Minimum supported dimensions of the image in pixels. + min_dimensions: Size + + #: Optional array of supported subsampling formats, e.g. 4:2:0, if known. + subsamplings: typing.List[SubsamplingFormat] + + def to_json(self): + json = dict() + json['imageType'] = self.image_type.to_json() + json['maxDimensions'] = self.max_dimensions.to_json() + json['minDimensions'] = self.min_dimensions.to_json() + json['subsamplings'] = [i.to_json() for i in self.subsamplings] + return json + + @classmethod + def from_json(cls, json): + return cls( + image_type=ImageType.from_json(json['imageType']), + max_dimensions=Size.from_json(json['maxDimensions']), + min_dimensions=Size.from_json(json['minDimensions']), + subsamplings=[SubsamplingFormat.from_json(i) for i in json['subsamplings']], + ) + + +@dataclass +class GPUInfo: + ''' + Provides information about the GPU(s) on the system. + ''' + #: The graphics devices on the system. Element 0 is the primary GPU. + devices: typing.List[GPUDevice] + + #: An optional array of GPU driver bug workarounds. + driver_bug_workarounds: typing.List[str] + + #: Supported accelerated video decoding capabilities. + video_decoding: typing.List[VideoDecodeAcceleratorCapability] + + #: Supported accelerated video encoding capabilities. + video_encoding: typing.List[VideoEncodeAcceleratorCapability] + + #: Supported accelerated image decoding capabilities. + image_decoding: typing.List[ImageDecodeAcceleratorCapability] + + #: An optional dictionary of additional GPU related attributes. + aux_attributes: typing.Optional[dict] = None + + #: An optional dictionary of graphics features and their status. + feature_status: typing.Optional[dict] = None + + def to_json(self): + json = dict() + json['devices'] = [i.to_json() for i in self.devices] + json['driverBugWorkarounds'] = [i for i in self.driver_bug_workarounds] + json['videoDecoding'] = [i.to_json() for i in self.video_decoding] + json['videoEncoding'] = [i.to_json() for i in self.video_encoding] + json['imageDecoding'] = [i.to_json() for i in self.image_decoding] + if self.aux_attributes is not None: + json['auxAttributes'] = self.aux_attributes + if self.feature_status is not None: + json['featureStatus'] = self.feature_status + return json + + @classmethod + def from_json(cls, json): + return cls( + devices=[GPUDevice.from_json(i) for i in json['devices']], + driver_bug_workarounds=[str(i) for i in json['driverBugWorkarounds']], + video_decoding=[VideoDecodeAcceleratorCapability.from_json(i) for i in json['videoDecoding']], + video_encoding=[VideoEncodeAcceleratorCapability.from_json(i) for i in json['videoEncoding']], + image_decoding=[ImageDecodeAcceleratorCapability.from_json(i) for i in json['imageDecoding']], + aux_attributes=dict(json['auxAttributes']) if 'auxAttributes' in json else None, + feature_status=dict(json['featureStatus']) if 'featureStatus' in json else None, + ) + + +@dataclass +class ProcessInfo: + ''' + Represents process info. + ''' + #: Specifies process type. + type_: str + + #: Specifies process id. + id_: int + + #: Specifies cumulative CPU usage in seconds across all threads of the + #: process since the process start. + cpu_time: float + + def to_json(self): + json = dict() + json['type'] = self.type_ + json['id'] = self.id_ + json['cpuTime'] = self.cpu_time + return json + + @classmethod + def from_json(cls, json): + return cls( + type_=str(json['type']), + id_=int(json['id']), + cpu_time=float(json['cpuTime']), + ) + + +def get_info() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[GPUInfo, str, str, str]]: + ''' + Returns information about the system. + + :returns: A tuple with the following items: + + 0. **gpu** - Information about the GPUs on the system. + 1. **modelName** - A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported. + 2. **modelVersion** - A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported. + 3. **commandLine** - The command line string used to launch the browser. Will be the empty string if not supported. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getInfo', + } + json = yield cmd_dict + return ( + GPUInfo.from_json(json['gpu']), + str(json['modelName']), + str(json['modelVersion']), + str(json['commandLine']) + ) + + +def get_feature_state( + feature_state: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Returns information about the feature state. + + :param feature_state: + :returns: + ''' + params: T_JSON_DICT = dict() + params['featureState'] = feature_state + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getFeatureState', + 'params': params, + } + json = yield cmd_dict + return bool(json['featureEnabled']) + + +def get_process_info() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[ProcessInfo]]: + ''' + Returns information about all running processes. + + :returns: An array of process info blocks. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'SystemInfo.getProcessInfo', + } + json = yield cmd_dict + return [ProcessInfo.from_json(i) for i in json['processInfo']] diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/target.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/target.py new file mode 100644 index 0000000..0bdec2b --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/target.py @@ -0,0 +1,746 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Target +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import browser +from . import page + + +class TargetID(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> TargetID: + return cls(json) + + def __repr__(self): + return 'TargetID({})'.format(super().__repr__()) + + +class SessionID(str): + ''' + Unique identifier of attached debugging session. + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> SessionID: + return cls(json) + + def __repr__(self): + return 'SessionID({})'.format(super().__repr__()) + + +@dataclass +class TargetInfo: + target_id: TargetID + + #: 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 + type_: str + + title: str + + url: str + + #: Whether the target has an attached client. + attached: bool + + #: Whether the target has access to the originating window. + can_access_opener: bool + + #: Opener target Id + opener_id: typing.Optional[TargetID] = None + + #: Frame id of originating window (is only set if target has an opener). + opener_frame_id: typing.Optional[page.FrameId] = None + + browser_context_id: typing.Optional[browser.BrowserContextID] = None + + #: Provides additional details for specific target types. For example, for + #: the type of "page", this may be set to "prerender". + subtype: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['targetId'] = self.target_id.to_json() + json['type'] = self.type_ + json['title'] = self.title + json['url'] = self.url + json['attached'] = self.attached + json['canAccessOpener'] = self.can_access_opener + if self.opener_id is not None: + json['openerId'] = self.opener_id.to_json() + if self.opener_frame_id is not None: + json['openerFrameId'] = self.opener_frame_id.to_json() + if self.browser_context_id is not None: + json['browserContextId'] = self.browser_context_id.to_json() + if self.subtype is not None: + json['subtype'] = self.subtype + return json + + @classmethod + def from_json(cls, json): + return cls( + target_id=TargetID.from_json(json['targetId']), + type_=str(json['type']), + title=str(json['title']), + url=str(json['url']), + attached=bool(json['attached']), + can_access_opener=bool(json['canAccessOpener']), + opener_id=TargetID.from_json(json['openerId']) if 'openerId' in json else None, + opener_frame_id=page.FrameId.from_json(json['openerFrameId']) if 'openerFrameId' in json else None, + browser_context_id=browser.BrowserContextID.from_json(json['browserContextId']) if 'browserContextId' in json else None, + subtype=str(json['subtype']) if 'subtype' in json else None, + ) + + +@dataclass +class FilterEntry: + ''' + A filter used by target query/discovery/auto-attach operations. + ''' + #: If set, causes exclusion of matching targets from the list. + exclude: typing.Optional[bool] = None + + #: If not present, matches any type. + type_: typing.Optional[str] = None + + def to_json(self): + json = dict() + if self.exclude is not None: + json['exclude'] = self.exclude + if self.type_ is not None: + json['type'] = self.type_ + return json + + @classmethod + def from_json(cls, json): + return cls( + exclude=bool(json['exclude']) if 'exclude' in json else None, + type_=str(json['type']) if 'type' in json else None, + ) + + +class TargetFilter(list): + ''' + 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``). + ''' + def to_json(self) -> typing.List[FilterEntry]: + return self + + @classmethod + def from_json(cls, json: typing.List[FilterEntry]) -> TargetFilter: + return cls(json) + + def __repr__(self): + return 'TargetFilter({})'.format(super().__repr__()) + + +@dataclass +class RemoteLocation: + host: str + + port: int + + def to_json(self): + json = dict() + json['host'] = self.host + json['port'] = self.port + return json + + @classmethod + def from_json(cls, json): + return cls( + host=str(json['host']), + port=int(json['port']), + ) + + +class WindowState(enum.Enum): + ''' + The state of the target window. + ''' + NORMAL = "normal" + MINIMIZED = "minimized" + MAXIMIZED = "maximized" + FULLSCREEN = "fullscreen" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def activate_target( + target_id: TargetID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Activates (focuses) the target. + + :param target_id: + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.activateTarget', + 'params': params, + } + json = yield cmd_dict + + +def attach_to_target( + target_id: TargetID, + flatten: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SessionID]: + ''' + Attaches to the target with given id. + + :param target_id: + :param flatten: *(Optional)* 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: Id assigned to the session. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + if flatten is not None: + params['flatten'] = flatten + cmd_dict: T_JSON_DICT = { + 'method': 'Target.attachToTarget', + 'params': params, + } + json = yield cmd_dict + return SessionID.from_json(json['sessionId']) + + +def attach_to_browser_target() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,SessionID]: + ''' + Attaches to the browser target, only uses flat sessionId mode. + + **EXPERIMENTAL** + + :returns: Id assigned to the session. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Target.attachToBrowserTarget', + } + json = yield cmd_dict + return SessionID.from_json(json['sessionId']) + + +def close_target( + target_id: TargetID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,bool]: + ''' + Closes the target. If the target is a page that gets closed too. + + :param target_id: + :returns: Always set to true. If an error occurs, the response indicates protocol error. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.closeTarget', + 'params': params, + } + json = yield cmd_dict + return bool(json['success']) + + +def expose_dev_tools_protocol( + target_id: TargetID, + binding_name: typing.Optional[str] = None, + inherit_permissions: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + **EXPERIMENTAL** + + :param target_id: + :param binding_name: *(Optional)* Binding name, 'cdp' if not specified. + :param inherit_permissions: *(Optional)* If true, inherits the current root session's permissions (default: false). + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + if binding_name is not None: + params['bindingName'] = binding_name + if inherit_permissions is not None: + params['inheritPermissions'] = inherit_permissions + cmd_dict: T_JSON_DICT = { + 'method': 'Target.exposeDevToolsProtocol', + 'params': params, + } + json = yield cmd_dict + + +def create_browser_context( + dispose_on_detach: typing.Optional[bool] = None, + proxy_server: typing.Optional[str] = None, + proxy_bypass_list: typing.Optional[str] = None, + origins_with_universal_network_access: typing.Optional[typing.List[str]] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,browser.BrowserContextID]: + ''' + Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than + one. + + :param dispose_on_detach: **(EXPERIMENTAL)** *(Optional)* If specified, disposes this context when debugging session disconnects. + :param proxy_server: **(EXPERIMENTAL)** *(Optional)* Proxy server, similar to the one passed to --proxy-server + :param proxy_bypass_list: **(EXPERIMENTAL)** *(Optional)* Proxy bypass list, similar to the one passed to --proxy-bypass-list + :param origins_with_universal_network_access: **(EXPERIMENTAL)** *(Optional)* An optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored. + :returns: The id of the context created. + ''' + params: T_JSON_DICT = dict() + if dispose_on_detach is not None: + params['disposeOnDetach'] = dispose_on_detach + if proxy_server is not None: + params['proxyServer'] = proxy_server + if proxy_bypass_list is not None: + params['proxyBypassList'] = proxy_bypass_list + if origins_with_universal_network_access is not None: + params['originsWithUniversalNetworkAccess'] = [i for i in origins_with_universal_network_access] + cmd_dict: T_JSON_DICT = { + 'method': 'Target.createBrowserContext', + 'params': params, + } + json = yield cmd_dict + return browser.BrowserContextID.from_json(json['browserContextId']) + + +def get_browser_contexts() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[browser.BrowserContextID]]: + ''' + Returns all browser contexts created with ``Target.createBrowserContext`` method. + + :returns: An array of browser context ids. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getBrowserContexts', + } + json = yield cmd_dict + return [browser.BrowserContextID.from_json(i) for i in json['browserContextIds']] + + +def create_target( + url: str, + left: typing.Optional[int] = None, + top: typing.Optional[int] = None, + width: typing.Optional[int] = None, + height: typing.Optional[int] = None, + window_state: typing.Optional[WindowState] = None, + browser_context_id: typing.Optional[browser.BrowserContextID] = None, + enable_begin_frame_control: typing.Optional[bool] = None, + new_window: typing.Optional[bool] = None, + background: typing.Optional[bool] = None, + for_tab: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,TargetID]: + ''' + Creates a new page. + + :param url: The initial URL the page will be navigated to. An empty string indicates about:blank. + :param left: **(EXPERIMENTAL)** *(Optional)* Frame left origin in DIP (requires newWindow to be true or headless shell). + :param top: **(EXPERIMENTAL)** *(Optional)* Frame top origin in DIP (requires newWindow to be true or headless shell). + :param width: *(Optional)* Frame width in DIP (requires newWindow to be true or headless shell). + :param height: *(Optional)* Frame height in DIP (requires newWindow to be true or headless shell). + :param window_state: *(Optional)* Frame window state (requires newWindow to be true or headless shell). Default is normal. + :param browser_context_id: **(EXPERIMENTAL)** *(Optional)* The browser context to create the page in. + :param enable_begin_frame_control: **(EXPERIMENTAL)** *(Optional)* Whether BeginFrames for this target will be controlled via DevTools (headless shell only, not supported on MacOS yet, false by default). + :param new_window: *(Optional)* Whether to create a new Window or Tab (false by default, not supported by headless shell). + :param background: *(Optional)* Whether to create the target in background or foreground (false by default, not supported by headless shell). + :param for_tab: **(EXPERIMENTAL)** *(Optional)* Whether to create the target of type "tab". + :returns: The id of the page opened. + ''' + params: T_JSON_DICT = dict() + params['url'] = url + if left is not None: + params['left'] = left + if top is not None: + params['top'] = top + if width is not None: + params['width'] = width + if height is not None: + params['height'] = height + if window_state is not None: + params['windowState'] = window_state.to_json() + if browser_context_id is not None: + params['browserContextId'] = browser_context_id.to_json() + if enable_begin_frame_control is not None: + params['enableBeginFrameControl'] = enable_begin_frame_control + if new_window is not None: + params['newWindow'] = new_window + if background is not None: + params['background'] = background + if for_tab is not None: + params['forTab'] = for_tab + cmd_dict: T_JSON_DICT = { + 'method': 'Target.createTarget', + 'params': params, + } + json = yield cmd_dict + return TargetID.from_json(json['targetId']) + + +def detach_from_target( + session_id: typing.Optional[SessionID] = None, + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Detaches session with given id. + + :param session_id: *(Optional)* Session to detach. + :param target_id: *(Optional)* Deprecated. + ''' + params: T_JSON_DICT = dict() + if session_id is not None: + params['sessionId'] = session_id.to_json() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.detachFromTarget', + 'params': params, + } + json = yield cmd_dict + + +def dispose_browser_context( + browser_context_id: browser.BrowserContextID + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Deletes a BrowserContext. All the belonging pages will be closed without calling their + beforeunload hooks. + + :param browser_context_id: + ''' + params: T_JSON_DICT = dict() + params['browserContextId'] = browser_context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.disposeBrowserContext', + 'params': params, + } + json = yield cmd_dict + + +def get_target_info( + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,TargetInfo]: + ''' + Returns information about a target. + + **EXPERIMENTAL** + + :param target_id: *(Optional)* + :returns: + ''' + params: T_JSON_DICT = dict() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getTargetInfo', + 'params': params, + } + json = yield cmd_dict + return TargetInfo.from_json(json['targetInfo']) + + +def get_targets( + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[TargetInfo]]: + ''' + Retrieves a list of available targets. + + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be reported. If filter is not specified and target discovery is currently enabled, a filter used for target discovery is used for consistency. + :returns: The list of targets. + ''' + params: T_JSON_DICT = dict() + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.getTargets', + 'params': params, + } + json = yield cmd_dict + return [TargetInfo.from_json(i) for i in json['targetInfos']] + + +def send_message_to_target( + message: str, + session_id: typing.Optional[SessionID] = None, + target_id: typing.Optional[TargetID] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sends protocol message over session with given id. + Consider using flat mode instead; see commands attachToTarget, setAutoAttach, + and crbug.com/991325. + + :param message: + :param session_id: *(Optional)* Identifier of the session. + :param target_id: *(Optional)* Deprecated. + ''' + params: T_JSON_DICT = dict() + params['message'] = message + if session_id is not None: + params['sessionId'] = session_id.to_json() + if target_id is not None: + params['targetId'] = target_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.sendMessageToTarget', + 'params': params, + } + json = yield cmd_dict + + +def set_auto_attach( + auto_attach: bool, + wait_for_debugger_on_start: bool, + flatten: typing.Optional[bool] = None, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Controls whether to automatically attach to new targets which are considered to be related to + this one. 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. + + :param auto_attach: Whether to auto-attach to related targets. + :param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use ```Runtime.runIfWaitingForDebugger``` to run paused targets. + :param flatten: **(EXPERIMENTAL)** *(Optional)* 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. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. + ''' + params: T_JSON_DICT = dict() + params['autoAttach'] = auto_attach + params['waitForDebuggerOnStart'] = wait_for_debugger_on_start + if flatten is not None: + params['flatten'] = flatten + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setAutoAttach', + 'params': params, + } + json = yield cmd_dict + + +def auto_attach_related( + target_id: TargetID, + wait_for_debugger_on_start: bool, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + 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. + + **EXPERIMENTAL** + + :param target_id: + :param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use ```Runtime.runIfWaitingForDebugger``` to run paused targets. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. + ''' + params: T_JSON_DICT = dict() + params['targetId'] = target_id.to_json() + params['waitForDebuggerOnStart'] = wait_for_debugger_on_start + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.autoAttachRelated', + 'params': params, + } + json = yield cmd_dict + + +def set_discover_targets( + discover: bool, + filter_: typing.Optional[TargetFilter] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Controls whether to discover available targets and notify via + ``targetCreated/targetInfoChanged/targetDestroyed`` events. + + :param discover: Whether to discover available targets. + :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. If ```discover```` is false, ````filter``` must be omitted or empty. + ''' + params: T_JSON_DICT = dict() + params['discover'] = discover + if filter_ is not None: + params['filter'] = filter_.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setDiscoverTargets', + 'params': params, + } + json = yield cmd_dict + + +def set_remote_locations( + locations: typing.List[RemoteLocation] + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables target discovery for the specified locations, when ``setDiscoverTargets`` was set to + ``true``. + + **EXPERIMENTAL** + + :param locations: List of remote locations. + ''' + params: T_JSON_DICT = dict() + params['locations'] = [i.to_json() for i in locations] + cmd_dict: T_JSON_DICT = { + 'method': 'Target.setRemoteLocations', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Target.attachedToTarget') +@dataclass +class AttachedToTarget: + ''' + **EXPERIMENTAL** + + Issued when attached to target because of auto-attach or ``attachToTarget`` command. + ''' + #: Identifier assigned to the session used to send/receive messages. + session_id: SessionID + target_info: TargetInfo + waiting_for_debugger: bool + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AttachedToTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + target_info=TargetInfo.from_json(json['targetInfo']), + waiting_for_debugger=bool(json['waitingForDebugger']) + ) + + +@event_class('Target.detachedFromTarget') +@dataclass +class DetachedFromTarget: + ''' + **EXPERIMENTAL** + + 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. + ''' + #: Detached session identifier. + session_id: SessionID + #: Deprecated. + target_id: typing.Optional[TargetID] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DetachedFromTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + target_id=TargetID.from_json(json['targetId']) if 'targetId' in json else None + ) + + +@event_class('Target.receivedMessageFromTarget') +@dataclass +class ReceivedMessageFromTarget: + ''' + Notifies about a new protocol message received from the session (as reported in + ``attachedToTarget`` event). + ''' + #: Identifier of a session which sends a message. + session_id: SessionID + message: str + #: Deprecated. + target_id: typing.Optional[TargetID] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ReceivedMessageFromTarget: + return cls( + session_id=SessionID.from_json(json['sessionId']), + message=str(json['message']), + target_id=TargetID.from_json(json['targetId']) if 'targetId' in json else None + ) + + +@event_class('Target.targetCreated') +@dataclass +class TargetCreated: + ''' + Issued when a possible inspection target is created. + ''' + target_info: TargetInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetCreated: + return cls( + target_info=TargetInfo.from_json(json['targetInfo']) + ) + + +@event_class('Target.targetDestroyed') +@dataclass +class TargetDestroyed: + ''' + Issued when a target is destroyed. + ''' + target_id: TargetID + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetDestroyed: + return cls( + target_id=TargetID.from_json(json['targetId']) + ) + + +@event_class('Target.targetCrashed') +@dataclass +class TargetCrashed: + ''' + Issued when a target has crashed. + ''' + target_id: TargetID + #: Termination status type. + status: str + #: Termination error code. + error_code: int + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetCrashed: + return cls( + target_id=TargetID.from_json(json['targetId']), + status=str(json['status']), + error_code=int(json['errorCode']) + ) + + +@event_class('Target.targetInfoChanged') +@dataclass +class TargetInfoChanged: + ''' + Issued when some information about a target has changed. This only happens between + ``targetCreated`` and ``targetDestroyed``. + ''' + target_info: TargetInfo + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TargetInfoChanged: + return cls( + target_info=TargetInfo.from_json(json['targetInfo']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/tethering.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/tethering.py new file mode 100644 index 0000000..af358ad --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/tethering.py @@ -0,0 +1,63 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Tethering (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +def bind( + port: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Request browser port binding. + + :param port: Port number to bind. + ''' + params: T_JSON_DICT = dict() + params['port'] = port + cmd_dict: T_JSON_DICT = { + 'method': 'Tethering.bind', + 'params': params, + } + json = yield cmd_dict + + +def unbind( + port: int + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Request browser port unbinding. + + :param port: Port number to unbind. + ''' + params: T_JSON_DICT = dict() + params['port'] = port + cmd_dict: T_JSON_DICT = { + 'method': 'Tethering.unbind', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Tethering.accepted') +@dataclass +class Accepted: + ''' + Informs that port was successfully bound and got a specified connection id. + ''' + #: Port number that was successfully bound. + port: int + #: Connection id to be used. + connection_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> Accepted: + return cls( + port=int(json['port']), + connection_id=str(json['connectionId']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/tracing.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/tracing.py new file mode 100644 index 0000000..9952697 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/tracing.py @@ -0,0 +1,360 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: Tracing +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing +from . import io + + +class MemoryDumpConfig(dict): + ''' + Configuration for memory dump. Used only when "memory-infra" category is enabled. + ''' + def to_json(self) -> dict: + return self + + @classmethod + def from_json(cls, json: dict) -> MemoryDumpConfig: + return cls(json) + + def __repr__(self): + return 'MemoryDumpConfig({})'.format(super().__repr__()) + + +@dataclass +class TraceConfig: + #: Controls how the trace buffer stores data. + record_mode: typing.Optional[str] = None + + #: Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value + #: of 200 MB would be used. + trace_buffer_size_in_kb: typing.Optional[float] = None + + #: Turns on JavaScript stack sampling. + enable_sampling: typing.Optional[bool] = None + + #: Turns on system tracing. + enable_systrace: typing.Optional[bool] = None + + #: Turns on argument filter. + enable_argument_filter: typing.Optional[bool] = None + + #: Included category filters. + included_categories: typing.Optional[typing.List[str]] = None + + #: Excluded category filters. + excluded_categories: typing.Optional[typing.List[str]] = None + + #: Configuration to synthesize the delays in tracing. + synthetic_delays: typing.Optional[typing.List[str]] = None + + #: Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. + memory_dump_config: typing.Optional[MemoryDumpConfig] = None + + def to_json(self): + json = dict() + if self.record_mode is not None: + json['recordMode'] = self.record_mode + if self.trace_buffer_size_in_kb is not None: + json['traceBufferSizeInKb'] = self.trace_buffer_size_in_kb + if self.enable_sampling is not None: + json['enableSampling'] = self.enable_sampling + if self.enable_systrace is not None: + json['enableSystrace'] = self.enable_systrace + if self.enable_argument_filter is not None: + json['enableArgumentFilter'] = self.enable_argument_filter + if self.included_categories is not None: + json['includedCategories'] = [i for i in self.included_categories] + if self.excluded_categories is not None: + json['excludedCategories'] = [i for i in self.excluded_categories] + if self.synthetic_delays is not None: + json['syntheticDelays'] = [i for i in self.synthetic_delays] + if self.memory_dump_config is not None: + json['memoryDumpConfig'] = self.memory_dump_config.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + record_mode=str(json['recordMode']) if 'recordMode' in json else None, + trace_buffer_size_in_kb=float(json['traceBufferSizeInKb']) if 'traceBufferSizeInKb' in json else None, + enable_sampling=bool(json['enableSampling']) if 'enableSampling' in json else None, + enable_systrace=bool(json['enableSystrace']) if 'enableSystrace' in json else None, + enable_argument_filter=bool(json['enableArgumentFilter']) if 'enableArgumentFilter' in json else None, + included_categories=[str(i) for i in json['includedCategories']] if 'includedCategories' in json else None, + excluded_categories=[str(i) for i in json['excludedCategories']] if 'excludedCategories' in json else None, + synthetic_delays=[str(i) for i in json['syntheticDelays']] if 'syntheticDelays' in json else None, + memory_dump_config=MemoryDumpConfig.from_json(json['memoryDumpConfig']) if 'memoryDumpConfig' in json else None, + ) + + +class StreamFormat(enum.Enum): + ''' + 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. + ''' + JSON = "json" + PROTO = "proto" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class StreamCompression(enum.Enum): + ''' + Compression type to use for traces returned via streams. + ''' + NONE = "none" + GZIP = "gzip" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class MemoryDumpLevelOfDetail(enum.Enum): + ''' + Details exposed when memory request explicitly declared. + Keep consistent with memory_dump_request_args.h and + memory_instrumentation.mojom + ''' + BACKGROUND = "background" + LIGHT = "light" + DETAILED = "detailed" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class TracingBackend(enum.Enum): + ''' + 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``. + ''' + AUTO = "auto" + CHROME = "chrome" + SYSTEM = "system" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +def end() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Stop trace events collection. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.end', + } + json = yield cmd_dict + + +def get_categories() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]: + ''' + Gets supported tracing categories. + + **EXPERIMENTAL** + + :returns: A list of supported tracing categories. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.getCategories', + } + json = yield cmd_dict + return [str(i) for i in json['categories']] + + +def record_clock_sync_marker( + sync_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Record a clock sync marker in the trace. + + **EXPERIMENTAL** + + :param sync_id: The ID of this clock sync marker + ''' + params: T_JSON_DICT = dict() + params['syncId'] = sync_id + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.recordClockSyncMarker', + 'params': params, + } + json = yield cmd_dict + + +def request_memory_dump( + deterministic: typing.Optional[bool] = None, + level_of_detail: typing.Optional[MemoryDumpLevelOfDetail] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[str, bool]]: + ''' + Request a global memory dump. + + **EXPERIMENTAL** + + :param deterministic: *(Optional)* Enables more deterministic results by forcing garbage collection + :param level_of_detail: *(Optional)* Specifies level of details in memory dump. Defaults to "detailed". + :returns: A tuple with the following items: + + 0. **dumpGuid** - GUID of the resulting global memory dump. + 1. **success** - True iff the global memory dump succeeded. + ''' + params: T_JSON_DICT = dict() + if deterministic is not None: + params['deterministic'] = deterministic + if level_of_detail is not None: + params['levelOfDetail'] = level_of_detail.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.requestMemoryDump', + 'params': params, + } + json = yield cmd_dict + return ( + str(json['dumpGuid']), + bool(json['success']) + ) + + +def start( + categories: typing.Optional[str] = None, + options: typing.Optional[str] = None, + buffer_usage_reporting_interval: typing.Optional[float] = None, + transfer_mode: typing.Optional[str] = None, + stream_format: typing.Optional[StreamFormat] = None, + stream_compression: typing.Optional[StreamCompression] = None, + trace_config: typing.Optional[TraceConfig] = None, + perfetto_config: typing.Optional[str] = None, + tracing_backend: typing.Optional[TracingBackend] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Start trace events collection. + + :param categories: **(EXPERIMENTAL)** *(Optional)* Category/tag filter + :param options: **(EXPERIMENTAL)** *(Optional)* Tracing options + :param buffer_usage_reporting_interval: **(EXPERIMENTAL)** *(Optional)* If set, the agent will issue bufferUsage events at this interval, specified in milliseconds + :param transfer_mode: *(Optional)* Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ```ReportEvents````). + :param stream_format: *(Optional)* Trace data format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````json````). + :param stream_compression: **(EXPERIMENTAL)** *(Optional)* Compression format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````none````) + :param trace_config: *(Optional)* + :param perfetto_config: **(EXPERIMENTAL)** *(Optional)* Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters ````categories````, ````options````, ````traceConfig```` are ignored. + :param tracing_backend: **(EXPERIMENTAL)** *(Optional)* Backend type (defaults to ````auto```) + ''' + params: T_JSON_DICT = dict() + if categories is not None: + params['categories'] = categories + if options is not None: + params['options'] = options + if buffer_usage_reporting_interval is not None: + params['bufferUsageReportingInterval'] = buffer_usage_reporting_interval + if transfer_mode is not None: + params['transferMode'] = transfer_mode + if stream_format is not None: + params['streamFormat'] = stream_format.to_json() + if stream_compression is not None: + params['streamCompression'] = stream_compression.to_json() + if trace_config is not None: + params['traceConfig'] = trace_config.to_json() + if perfetto_config is not None: + params['perfettoConfig'] = perfetto_config + if tracing_backend is not None: + params['tracingBackend'] = tracing_backend.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'Tracing.start', + 'params': params, + } + json = yield cmd_dict + + +@event_class('Tracing.bufferUsage') +@dataclass +class BufferUsage: + ''' + **EXPERIMENTAL** + + + ''' + #: A number in range [0..1] that indicates the used size of event buffer as a fraction of its + #: total size. + percent_full: typing.Optional[float] + #: An approximate number of events in the trace log. + event_count: typing.Optional[float] + #: A number in range [0..1] that indicates the used size of event buffer as a fraction of its + #: total size. + value: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> BufferUsage: + return cls( + percent_full=float(json['percentFull']) if 'percentFull' in json else None, + event_count=float(json['eventCount']) if 'eventCount' in json else None, + value=float(json['value']) if 'value' in json else None + ) + + +@event_class('Tracing.dataCollected') +@dataclass +class DataCollected: + ''' + **EXPERIMENTAL** + + 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. + ''' + value: typing.List[dict] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> DataCollected: + return cls( + value=[dict(i) for i in json['value']] + ) + + +@event_class('Tracing.tracingComplete') +@dataclass +class TracingComplete: + ''' + Signals that tracing is stopped and there is no trace buffers pending flush, all data were + delivered via dataCollected events. + ''' + #: Indicates whether some trace data is known to have been lost, e.g. because the trace ring + #: buffer wrapped around. + data_loss_occurred: bool + #: A handle of the stream that holds resulting trace data. + stream: typing.Optional[io.StreamHandle] + #: Trace data format of returned stream. + trace_format: typing.Optional[StreamFormat] + #: Compression format of returned stream. + stream_compression: typing.Optional[StreamCompression] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> TracingComplete: + return cls( + data_loss_occurred=bool(json['dataLossOccurred']), + stream=io.StreamHandle.from_json(json['stream']) if 'stream' in json else None, + trace_format=StreamFormat.from_json(json['traceFormat']) if 'traceFormat' in json else None, + stream_compression=StreamCompression.from_json(json['streamCompression']) if 'streamCompression' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/util.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/util.py new file mode 100644 index 0000000..93a39ef --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/util.py @@ -0,0 +1,20 @@ + +import typing + + +T_JSON_DICT = typing.Dict[str, typing.Any] +_event_parsers = dict() + + +def event_class(method): + ''' A decorator that registers a class as an event class. ''' + def decorate(cls): + _event_parsers[method] = cls + cls.event_class = method + return cls + return decorate + + +def parse_json_event(json: T_JSON_DICT) -> typing.Any: + ''' Parse a JSON dictionary into a CDP event. ''' + return _event_parsers[json['method']].from_json(json['params']) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/web_audio.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/web_audio.py new file mode 100644 index 0000000..7e9c1c4 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/web_audio.py @@ -0,0 +1,604 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: WebAudio (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class GraphObjectId(str): + ''' + An unique ID for a graph object (AudioContext, AudioNode, AudioParam) in Web Audio API + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> GraphObjectId: + return cls(json) + + def __repr__(self): + return 'GraphObjectId({})'.format(super().__repr__()) + + +class ContextType(enum.Enum): + ''' + Enum of BaseAudioContext types + ''' + REALTIME = "realtime" + OFFLINE = "offline" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ContextState(enum.Enum): + ''' + Enum of AudioContextState from the spec + ''' + SUSPENDED = "suspended" + RUNNING = "running" + CLOSED = "closed" + INTERRUPTED = "interrupted" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class NodeType(str): + ''' + Enum of AudioNode types + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> NodeType: + return cls(json) + + def __repr__(self): + return 'NodeType({})'.format(super().__repr__()) + + +class ChannelCountMode(enum.Enum): + ''' + Enum of AudioNode::ChannelCountMode from the spec + ''' + CLAMPED_MAX = "clamped-max" + EXPLICIT = "explicit" + MAX_ = "max" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ChannelInterpretation(enum.Enum): + ''' + Enum of AudioNode::ChannelInterpretation from the spec + ''' + DISCRETE = "discrete" + SPEAKERS = "speakers" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class ParamType(str): + ''' + Enum of AudioParam types + ''' + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> ParamType: + return cls(json) + + def __repr__(self): + return 'ParamType({})'.format(super().__repr__()) + + +class AutomationRate(enum.Enum): + ''' + Enum of AudioParam::AutomationRate from the spec + ''' + A_RATE = "a-rate" + K_RATE = "k-rate" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class ContextRealtimeData: + ''' + Fields in AudioContext that change in real-time. + ''' + #: The current context time in second in BaseAudioContext. + current_time: float + + #: 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. + render_capacity: float + + #: A running mean of callback interval. + callback_interval_mean: float + + #: A running variance of callback interval. + callback_interval_variance: float + + def to_json(self): + json = dict() + json['currentTime'] = self.current_time + json['renderCapacity'] = self.render_capacity + json['callbackIntervalMean'] = self.callback_interval_mean + json['callbackIntervalVariance'] = self.callback_interval_variance + return json + + @classmethod + def from_json(cls, json): + return cls( + current_time=float(json['currentTime']), + render_capacity=float(json['renderCapacity']), + callback_interval_mean=float(json['callbackIntervalMean']), + callback_interval_variance=float(json['callbackIntervalVariance']), + ) + + +@dataclass +class BaseAudioContext: + ''' + Protocol object for BaseAudioContext + ''' + context_id: GraphObjectId + + context_type: ContextType + + context_state: ContextState + + #: Platform-dependent callback buffer size. + callback_buffer_size: float + + #: Number of output channels supported by audio hardware in use. + max_output_channel_count: float + + #: Context sample rate. + sample_rate: float + + realtime_data: typing.Optional[ContextRealtimeData] = None + + def to_json(self): + json = dict() + json['contextId'] = self.context_id.to_json() + json['contextType'] = self.context_type.to_json() + json['contextState'] = self.context_state.to_json() + json['callbackBufferSize'] = self.callback_buffer_size + json['maxOutputChannelCount'] = self.max_output_channel_count + json['sampleRate'] = self.sample_rate + if self.realtime_data is not None: + json['realtimeData'] = self.realtime_data.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + context_type=ContextType.from_json(json['contextType']), + context_state=ContextState.from_json(json['contextState']), + callback_buffer_size=float(json['callbackBufferSize']), + max_output_channel_count=float(json['maxOutputChannelCount']), + sample_rate=float(json['sampleRate']), + realtime_data=ContextRealtimeData.from_json(json['realtimeData']) if 'realtimeData' in json else None, + ) + + +@dataclass +class AudioListener: + ''' + Protocol object for AudioListener + ''' + listener_id: GraphObjectId + + context_id: GraphObjectId + + def to_json(self): + json = dict() + json['listenerId'] = self.listener_id.to_json() + json['contextId'] = self.context_id.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + listener_id=GraphObjectId.from_json(json['listenerId']), + context_id=GraphObjectId.from_json(json['contextId']), + ) + + +@dataclass +class AudioNode: + ''' + Protocol object for AudioNode + ''' + node_id: GraphObjectId + + context_id: GraphObjectId + + node_type: NodeType + + number_of_inputs: float + + number_of_outputs: float + + channel_count: float + + channel_count_mode: ChannelCountMode + + channel_interpretation: ChannelInterpretation + + def to_json(self): + json = dict() + json['nodeId'] = self.node_id.to_json() + json['contextId'] = self.context_id.to_json() + json['nodeType'] = self.node_type.to_json() + json['numberOfInputs'] = self.number_of_inputs + json['numberOfOutputs'] = self.number_of_outputs + json['channelCount'] = self.channel_count + json['channelCountMode'] = self.channel_count_mode.to_json() + json['channelInterpretation'] = self.channel_interpretation.to_json() + return json + + @classmethod + def from_json(cls, json): + return cls( + node_id=GraphObjectId.from_json(json['nodeId']), + context_id=GraphObjectId.from_json(json['contextId']), + node_type=NodeType.from_json(json['nodeType']), + number_of_inputs=float(json['numberOfInputs']), + number_of_outputs=float(json['numberOfOutputs']), + channel_count=float(json['channelCount']), + channel_count_mode=ChannelCountMode.from_json(json['channelCountMode']), + channel_interpretation=ChannelInterpretation.from_json(json['channelInterpretation']), + ) + + +@dataclass +class AudioParam: + ''' + Protocol object for AudioParam + ''' + param_id: GraphObjectId + + node_id: GraphObjectId + + context_id: GraphObjectId + + param_type: ParamType + + rate: AutomationRate + + default_value: float + + min_value: float + + max_value: float + + def to_json(self): + json = dict() + json['paramId'] = self.param_id.to_json() + json['nodeId'] = self.node_id.to_json() + json['contextId'] = self.context_id.to_json() + json['paramType'] = self.param_type.to_json() + json['rate'] = self.rate.to_json() + json['defaultValue'] = self.default_value + json['minValue'] = self.min_value + json['maxValue'] = self.max_value + return json + + @classmethod + def from_json(cls, json): + return cls( + param_id=GraphObjectId.from_json(json['paramId']), + node_id=GraphObjectId.from_json(json['nodeId']), + context_id=GraphObjectId.from_json(json['contextId']), + param_type=ParamType.from_json(json['paramType']), + rate=AutomationRate.from_json(json['rate']), + default_value=float(json['defaultValue']), + min_value=float(json['minValue']), + max_value=float(json['maxValue']), + ) + + +def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enables the WebAudio domain and starts sending context lifetime events. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.enable', + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disables the WebAudio domain. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.disable', + } + json = yield cmd_dict + + +def get_realtime_data( + context_id: GraphObjectId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,ContextRealtimeData]: + ''' + Fetch the realtime data from the registered contexts. + + :param context_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['contextId'] = context_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAudio.getRealtimeData', + 'params': params, + } + json = yield cmd_dict + return ContextRealtimeData.from_json(json['realtimeData']) + + +@event_class('WebAudio.contextCreated') +@dataclass +class ContextCreated: + ''' + Notifies that a new BaseAudioContext has been created. + ''' + context: BaseAudioContext + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextCreated: + return cls( + context=BaseAudioContext.from_json(json['context']) + ) + + +@event_class('WebAudio.contextWillBeDestroyed') +@dataclass +class ContextWillBeDestroyed: + ''' + Notifies that an existing BaseAudioContext will be destroyed. + ''' + context_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']) + ) + + +@event_class('WebAudio.contextChanged') +@dataclass +class ContextChanged: + ''' + Notifies that existing BaseAudioContext has changed some properties (id stays the same).. + ''' + context: BaseAudioContext + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> ContextChanged: + return cls( + context=BaseAudioContext.from_json(json['context']) + ) + + +@event_class('WebAudio.audioListenerCreated') +@dataclass +class AudioListenerCreated: + ''' + Notifies that the construction of an AudioListener has finished. + ''' + listener: AudioListener + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioListenerCreated: + return cls( + listener=AudioListener.from_json(json['listener']) + ) + + +@event_class('WebAudio.audioListenerWillBeDestroyed') +@dataclass +class AudioListenerWillBeDestroyed: + ''' + Notifies that a new AudioListener has been created. + ''' + context_id: GraphObjectId + listener_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioListenerWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + listener_id=GraphObjectId.from_json(json['listenerId']) + ) + + +@event_class('WebAudio.audioNodeCreated') +@dataclass +class AudioNodeCreated: + ''' + Notifies that a new AudioNode has been created. + ''' + node: AudioNode + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioNodeCreated: + return cls( + node=AudioNode.from_json(json['node']) + ) + + +@event_class('WebAudio.audioNodeWillBeDestroyed') +@dataclass +class AudioNodeWillBeDestroyed: + ''' + Notifies that an existing AudioNode has been destroyed. + ''' + context_id: GraphObjectId + node_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioNodeWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + node_id=GraphObjectId.from_json(json['nodeId']) + ) + + +@event_class('WebAudio.audioParamCreated') +@dataclass +class AudioParamCreated: + ''' + Notifies that a new AudioParam has been created. + ''' + param: AudioParam + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioParamCreated: + return cls( + param=AudioParam.from_json(json['param']) + ) + + +@event_class('WebAudio.audioParamWillBeDestroyed') +@dataclass +class AudioParamWillBeDestroyed: + ''' + Notifies that an existing AudioParam has been destroyed. + ''' + context_id: GraphObjectId + node_id: GraphObjectId + param_id: GraphObjectId + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> AudioParamWillBeDestroyed: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + node_id=GraphObjectId.from_json(json['nodeId']), + param_id=GraphObjectId.from_json(json['paramId']) + ) + + +@event_class('WebAudio.nodesConnected') +@dataclass +class NodesConnected: + ''' + Notifies that two AudioNodes are connected. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + destination_input_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodesConnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None, + destination_input_index=float(json['destinationInputIndex']) if 'destinationInputIndex' in json else None + ) + + +@event_class('WebAudio.nodesDisconnected') +@dataclass +class NodesDisconnected: + ''' + Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + destination_input_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodesDisconnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None, + destination_input_index=float(json['destinationInputIndex']) if 'destinationInputIndex' in json else None + ) + + +@event_class('WebAudio.nodeParamConnected') +@dataclass +class NodeParamConnected: + ''' + Notifies that an AudioNode is connected to an AudioParam. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodeParamConnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None + ) + + +@event_class('WebAudio.nodeParamDisconnected') +@dataclass +class NodeParamDisconnected: + ''' + Notifies that an AudioNode is disconnected to an AudioParam. + ''' + context_id: GraphObjectId + source_id: GraphObjectId + destination_id: GraphObjectId + source_output_index: typing.Optional[float] + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> NodeParamDisconnected: + return cls( + context_id=GraphObjectId.from_json(json['contextId']), + source_id=GraphObjectId.from_json(json['sourceId']), + destination_id=GraphObjectId.from_json(json['destinationId']), + source_output_index=float(json['sourceOutputIndex']) if 'sourceOutputIndex' in json else None + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/devtools/v135/web_authn.py b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/web_authn.py new file mode 100644 index 0000000..c577b6e --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/devtools/v135/web_authn.py @@ -0,0 +1,579 @@ +# DO NOT EDIT THIS FILE! +# +# This file is generated from the CDP specification. If you need to make +# changes, edit the generator and regenerate all of the modules. +# +# CDP domain: WebAuthn (experimental) +from __future__ import annotations +from .util import event_class, T_JSON_DICT +from dataclasses import dataclass +import enum +import typing + +class AuthenticatorId(str): + def to_json(self) -> str: + return self + + @classmethod + def from_json(cls, json: str) -> AuthenticatorId: + return cls(json) + + def __repr__(self): + return 'AuthenticatorId({})'.format(super().__repr__()) + + +class AuthenticatorProtocol(enum.Enum): + U2F = "u2f" + CTAP2 = "ctap2" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class Ctap2Version(enum.Enum): + CTAP2_0 = "ctap2_0" + CTAP2_1 = "ctap2_1" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +class AuthenticatorTransport(enum.Enum): + USB = "usb" + NFC = "nfc" + BLE = "ble" + CABLE = "cable" + INTERNAL = "internal" + + def to_json(self): + return self.value + + @classmethod + def from_json(cls, json): + return cls(json) + + +@dataclass +class VirtualAuthenticatorOptions: + protocol: AuthenticatorProtocol + + transport: AuthenticatorTransport + + #: Defaults to ctap2_0. Ignored if ``protocol`` == u2f. + ctap2_version: typing.Optional[Ctap2Version] = None + + #: Defaults to false. + has_resident_key: typing.Optional[bool] = None + + #: Defaults to false. + has_user_verification: typing.Optional[bool] = None + + #: If set to true, the authenticator will support the largeBlob extension. + #: https://w3c.github.io/webauthn#largeBlob + #: Defaults to false. + has_large_blob: typing.Optional[bool] = None + + #: 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. + has_cred_blob: typing.Optional[bool] = None + + #: 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. + has_min_pin_length: typing.Optional[bool] = None + + #: If set to true, the authenticator will support the prf extension. + #: https://w3c.github.io/webauthn/#prf-extension + #: Defaults to false. + has_prf: typing.Optional[bool] = None + + #: If set to true, tests of user presence will succeed immediately. + #: Otherwise, they will not be resolved. Defaults to true. + automatic_presence_simulation: typing.Optional[bool] = None + + #: Sets whether User Verification succeeds or fails for an authenticator. + #: Defaults to false. + is_user_verified: typing.Optional[bool] = None + + #: 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 + default_backup_eligibility: typing.Optional[bool] = None + + #: 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 + default_backup_state: typing.Optional[bool] = None + + def to_json(self): + json = dict() + json['protocol'] = self.protocol.to_json() + json['transport'] = self.transport.to_json() + if self.ctap2_version is not None: + json['ctap2Version'] = self.ctap2_version.to_json() + if self.has_resident_key is not None: + json['hasResidentKey'] = self.has_resident_key + if self.has_user_verification is not None: + json['hasUserVerification'] = self.has_user_verification + if self.has_large_blob is not None: + json['hasLargeBlob'] = self.has_large_blob + if self.has_cred_blob is not None: + json['hasCredBlob'] = self.has_cred_blob + if self.has_min_pin_length is not None: + json['hasMinPinLength'] = self.has_min_pin_length + if self.has_prf is not None: + json['hasPrf'] = self.has_prf + if self.automatic_presence_simulation is not None: + json['automaticPresenceSimulation'] = self.automatic_presence_simulation + if self.is_user_verified is not None: + json['isUserVerified'] = self.is_user_verified + if self.default_backup_eligibility is not None: + json['defaultBackupEligibility'] = self.default_backup_eligibility + if self.default_backup_state is not None: + json['defaultBackupState'] = self.default_backup_state + return json + + @classmethod + def from_json(cls, json): + return cls( + protocol=AuthenticatorProtocol.from_json(json['protocol']), + transport=AuthenticatorTransport.from_json(json['transport']), + ctap2_version=Ctap2Version.from_json(json['ctap2Version']) if 'ctap2Version' in json else None, + has_resident_key=bool(json['hasResidentKey']) if 'hasResidentKey' in json else None, + has_user_verification=bool(json['hasUserVerification']) if 'hasUserVerification' in json else None, + has_large_blob=bool(json['hasLargeBlob']) if 'hasLargeBlob' in json else None, + has_cred_blob=bool(json['hasCredBlob']) if 'hasCredBlob' in json else None, + has_min_pin_length=bool(json['hasMinPinLength']) if 'hasMinPinLength' in json else None, + has_prf=bool(json['hasPrf']) if 'hasPrf' in json else None, + automatic_presence_simulation=bool(json['automaticPresenceSimulation']) if 'automaticPresenceSimulation' in json else None, + is_user_verified=bool(json['isUserVerified']) if 'isUserVerified' in json else None, + default_backup_eligibility=bool(json['defaultBackupEligibility']) if 'defaultBackupEligibility' in json else None, + default_backup_state=bool(json['defaultBackupState']) if 'defaultBackupState' in json else None, + ) + + +@dataclass +class Credential: + credential_id: str + + is_resident_credential: bool + + #: The ECDSA P-256 private key in PKCS#8 format. + private_key: str + + #: Signature counter. This is incremented by one for each successful + #: assertion. + #: See https://w3c.github.io/webauthn/#signature-counter + sign_count: int + + #: Relying Party ID the credential is scoped to. Must be set when adding a + #: credential. + rp_id: typing.Optional[str] = None + + #: An opaque byte sequence with a maximum size of 64 bytes mapping the + #: credential to a specific user. + user_handle: typing.Optional[str] = None + + #: The large blob associated with the credential. + #: See https://w3c.github.io/webauthn/#sctn-large-blob-extension + large_blob: typing.Optional[str] = None + + #: Assertions returned by this credential will have the backup eligibility + #: (BE) flag set to this value. Defaults to the authenticator's + #: defaultBackupEligibility value. + backup_eligibility: typing.Optional[bool] = None + + #: Assertions returned by this credential will have the backup state (BS) + #: flag set to this value. Defaults to the authenticator's + #: defaultBackupState value. + backup_state: typing.Optional[bool] = None + + #: The credential's user.name property. Equivalent to empty if not set. + #: https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name + user_name: typing.Optional[str] = None + + #: The credential's user.displayName property. Equivalent to empty if + #: not set. + #: https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname + user_display_name: typing.Optional[str] = None + + def to_json(self): + json = dict() + json['credentialId'] = self.credential_id + json['isResidentCredential'] = self.is_resident_credential + json['privateKey'] = self.private_key + json['signCount'] = self.sign_count + if self.rp_id is not None: + json['rpId'] = self.rp_id + if self.user_handle is not None: + json['userHandle'] = self.user_handle + if self.large_blob is not None: + json['largeBlob'] = self.large_blob + if self.backup_eligibility is not None: + json['backupEligibility'] = self.backup_eligibility + if self.backup_state is not None: + json['backupState'] = self.backup_state + if self.user_name is not None: + json['userName'] = self.user_name + if self.user_display_name is not None: + json['userDisplayName'] = self.user_display_name + return json + + @classmethod + def from_json(cls, json): + return cls( + credential_id=str(json['credentialId']), + is_resident_credential=bool(json['isResidentCredential']), + private_key=str(json['privateKey']), + sign_count=int(json['signCount']), + rp_id=str(json['rpId']) if 'rpId' in json else None, + user_handle=str(json['userHandle']) if 'userHandle' in json else None, + large_blob=str(json['largeBlob']) if 'largeBlob' in json else None, + backup_eligibility=bool(json['backupEligibility']) if 'backupEligibility' in json else None, + backup_state=bool(json['backupState']) if 'backupState' in json else None, + user_name=str(json['userName']) if 'userName' in json else None, + user_display_name=str(json['userDisplayName']) if 'userDisplayName' in json else None, + ) + + +def enable( + enable_ui: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Enable the WebAuthn domain and start intercepting credential storage and + retrieval with a virtual authenticator. + + :param enable_ui: *(Optional)* Whether to enable the WebAuthn user interface. Enabling the UI is recommended for debugging and demo purposes, as it is closer to the real experience. Disabling the UI is recommended for automated testing. Supported at the embedder's discretion if UI is available. Defaults to false. + ''' + params: T_JSON_DICT = dict() + if enable_ui is not None: + params['enableUI'] = enable_ui + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.enable', + 'params': params, + } + json = yield cmd_dict + + +def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Disable the WebAuthn domain. + ''' + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.disable', + } + json = yield cmd_dict + + +def add_virtual_authenticator( + options: VirtualAuthenticatorOptions + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,AuthenticatorId]: + ''' + Creates and adds a virtual authenticator. + + :param options: + :returns: + ''' + params: T_JSON_DICT = dict() + params['options'] = options.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.addVirtualAuthenticator', + 'params': params, + } + json = yield cmd_dict + return AuthenticatorId.from_json(json['authenticatorId']) + + +def set_response_override_bits( + authenticator_id: AuthenticatorId, + is_bogus_signature: typing.Optional[bool] = None, + is_bad_uv: typing.Optional[bool] = None, + is_bad_up: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present. + + :param authenticator_id: + :param is_bogus_signature: *(Optional)* If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false. + :param is_bad_uv: *(Optional)* If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false. + :param is_bad_up: *(Optional)* If isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false. + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + if is_bogus_signature is not None: + params['isBogusSignature'] = is_bogus_signature + if is_bad_uv is not None: + params['isBadUV'] = is_bad_uv + if is_bad_up is not None: + params['isBadUP'] = is_bad_up + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setResponseOverrideBits', + 'params': params, + } + json = yield cmd_dict + + +def remove_virtual_authenticator( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Removes the given authenticator. + + :param authenticator_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.removeVirtualAuthenticator', + 'params': params, + } + json = yield cmd_dict + + +def add_credential( + authenticator_id: AuthenticatorId, + credential: Credential + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Adds the credential to the specified authenticator. + + :param authenticator_id: + :param credential: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credential'] = credential.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.addCredential', + 'params': params, + } + json = yield cmd_dict + + +def get_credential( + authenticator_id: AuthenticatorId, + credential_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,Credential]: + ''' + Returns a single credential stored in the given virtual authenticator that + matches the credential ID. + + :param authenticator_id: + :param credential_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.getCredential', + 'params': params, + } + json = yield cmd_dict + return Credential.from_json(json['credential']) + + +def get_credentials( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[Credential]]: + ''' + Returns all the credentials stored in the given virtual authenticator. + + :param authenticator_id: + :returns: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.getCredentials', + 'params': params, + } + json = yield cmd_dict + return [Credential.from_json(i) for i in json['credentials']] + + +def remove_credential( + authenticator_id: AuthenticatorId, + credential_id: str + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Removes a credential from the authenticator. + + :param authenticator_id: + :param credential_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.removeCredential', + 'params': params, + } + json = yield cmd_dict + + +def clear_credentials( + authenticator_id: AuthenticatorId + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Clears all the credentials from the specified device. + + :param authenticator_id: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.clearCredentials', + 'params': params, + } + json = yield cmd_dict + + +def set_user_verified( + authenticator_id: AuthenticatorId, + is_user_verified: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets whether User Verification succeeds or fails for an authenticator. + The default is true. + + :param authenticator_id: + :param is_user_verified: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['isUserVerified'] = is_user_verified + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setUserVerified', + 'params': params, + } + json = yield cmd_dict + + +def set_automatic_presence_simulation( + authenticator_id: AuthenticatorId, + enabled: bool + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. + The default is true. + + :param authenticator_id: + :param enabled: + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['enabled'] = enabled + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setAutomaticPresenceSimulation', + 'params': params, + } + json = yield cmd_dict + + +def set_credential_properties( + authenticator_id: AuthenticatorId, + credential_id: str, + backup_eligibility: typing.Optional[bool] = None, + backup_state: typing.Optional[bool] = None + ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]: + ''' + Allows setting credential properties. + https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties + + :param authenticator_id: + :param credential_id: + :param backup_eligibility: *(Optional)* + :param backup_state: *(Optional)* + ''' + params: T_JSON_DICT = dict() + params['authenticatorId'] = authenticator_id.to_json() + params['credentialId'] = credential_id + if backup_eligibility is not None: + params['backupEligibility'] = backup_eligibility + if backup_state is not None: + params['backupState'] = backup_state + cmd_dict: T_JSON_DICT = { + 'method': 'WebAuthn.setCredentialProperties', + 'params': params, + } + json = yield cmd_dict + + +@event_class('WebAuthn.credentialAdded') +@dataclass +class CredentialAdded: + ''' + Triggered when a credential is added to an authenticator. + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialAdded: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) + + +@event_class('WebAuthn.credentialDeleted') +@dataclass +class CredentialDeleted: + ''' + Triggered when a credential is deleted, e.g. through + PublicKeyCredential.signalUnknownCredential(). + ''' + authenticator_id: AuthenticatorId + credential_id: str + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialDeleted: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential_id=str(json['credentialId']) + ) + + +@event_class('WebAuthn.credentialUpdated') +@dataclass +class CredentialUpdated: + ''' + Triggered when a credential is updated, e.g. through + PublicKeyCredential.signalCurrentUserDetails(). + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialUpdated: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) + + +@event_class('WebAuthn.credentialAsserted') +@dataclass +class CredentialAsserted: + ''' + Triggered when a credential is used in a webauthn assertion. + ''' + authenticator_id: AuthenticatorId + credential: Credential + + @classmethod + def from_json(cls, json: T_JSON_DICT) -> CredentialAsserted: + return cls( + authenticator_id=AuthenticatorId.from_json(json['authenticatorId']), + credential=Credential.from_json(json['credential']) + ) diff --git a/selenium-4.31.0/selenium/webdriver/common/driver_finder.py b/selenium-4.31.0/selenium/webdriver/common/driver_finder.py new file mode 100644 index 0000000..5a5cb01 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/driver_finder.py @@ -0,0 +1,99 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import logging +from pathlib import Path + +from selenium.common.exceptions import NoSuchDriverException +from selenium.webdriver.common.options import BaseOptions +from selenium.webdriver.common.selenium_manager import SeleniumManager +from selenium.webdriver.common.service import Service + +logger = logging.getLogger(__name__) + + +class DriverFinder: + """A Driver finding class responsible for obtaining the correct driver and + associated browser. + + :param service: instance of the driver service class. + :param options: instance of the browser options class. + """ + + def __init__(self, service: Service, options: BaseOptions) -> None: + self._service = service + self._options = options + self._paths = {"driver_path": "", "browser_path": ""} + + """Utility to find if a given file is present and executable. + + This implementation is still in beta, and may change. + """ + + def get_browser_path(self) -> str: + return self._binary_paths()["browser_path"] + + def get_driver_path(self) -> str: + return self._binary_paths()["driver_path"] + + def _binary_paths(self) -> dict: + if self._paths["driver_path"]: + return self._paths + + browser = self._options.capabilities["browserName"] + try: + path = self._service.path + if path: + logger.debug( + "Skipping Selenium Manager; path to %s driver specified in Service class: %s", browser, path + ) + if not Path(path).is_file(): + raise ValueError(f"The path is not a valid file: {path}") + self._paths["driver_path"] = path + else: + output = SeleniumManager().binary_paths(self._to_args()) + if Path(output["driver_path"]).is_file(): + self._paths["driver_path"] = output["driver_path"] + else: + raise ValueError(f'The driver path is not a valid file: {output["driver_path"]}') + if Path(output["browser_path"]).is_file(): + self._paths["browser_path"] = output["browser_path"] + else: + raise ValueError(f'The browser path is not a valid file: {output["browser_path"]}') + except Exception as err: + msg = f"Unable to obtain driver for {browser}" + raise NoSuchDriverException(msg) from err + return self._paths + + def _to_args(self) -> list: + args = ["--browser", self._options.capabilities["browserName"]] + + if self._options.browser_version: + args.append("--browser-version") + args.append(str(self._options.browser_version)) + + binary_location = getattr(self._options, "binary_location", None) + if binary_location: + args.append("--browser-path") + args.append(str(binary_location)) + + proxy = self._options.proxy + if proxy and (proxy.http_proxy or proxy.ssl_proxy): + args.append("--proxy") + value = proxy.ssl_proxy if proxy.ssl_proxy else proxy.http_proxy + args.append(value) + + return args diff --git a/selenium-4.31.0/selenium/webdriver/common/fedcm/__init__.py b/selenium-4.31.0/selenium/webdriver/common/fedcm/__init__.py new file mode 100644 index 0000000..a5b1e6f --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/fedcm/__init__.py @@ -0,0 +1,16 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/selenium-4.31.0/selenium/webdriver/common/fedcm/account.py b/selenium-4.31.0/selenium/webdriver/common/fedcm/account.py new file mode 100644 index 0000000..7258ea6 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/fedcm/account.py @@ -0,0 +1,56 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from enum import Enum +from typing import Optional + + +class LoginState(Enum): + SIGN_IN = "SignIn" + SIGN_UP = "SignUp" + + +class _AccountDescriptor: + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls) -> Optional[str]: + return obj._account_data.get(self.name) + + def __set__(self, obj, value) -> None: + raise AttributeError("Cannot set readonly attribute") + + +class Account: + """Represents an account displayed in a FedCM account list. + + See: https://w3c-fedid.github.io/FedCM/#dictdef-identityprovideraccount + https://w3c-fedid.github.io/FedCM/#webdriver-accountlist + """ + + account_id = _AccountDescriptor("accountId") + email = _AccountDescriptor("email") + name = _AccountDescriptor("name") + given_name = _AccountDescriptor("givenName") + picture_url = _AccountDescriptor("pictureUrl") + idp_config_url = _AccountDescriptor("idpConfigUrl") + terms_of_service_url = _AccountDescriptor("termsOfServiceUrl") + privacy_policy_url = _AccountDescriptor("privacyPolicyUrl") + login_state = _AccountDescriptor("loginState") + + def __init__(self, account_data): + self._account_data = account_data diff --git a/selenium-4.31.0/selenium/webdriver/common/fedcm/dialog.py b/selenium-4.31.0/selenium/webdriver/common/fedcm/dialog.py new file mode 100644 index 0000000..fce069d --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/fedcm/dialog.py @@ -0,0 +1,64 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import List +from typing import Optional + +from .account import Account + + +class Dialog: + """Represents a FedCM dialog that can be interacted with.""" + + DIALOG_TYPE_ACCOUNT_LIST = "AccountChooser" + DIALOG_TYPE_AUTO_REAUTH = "AutoReauthn" + + def __init__(self, driver) -> None: + self._driver = driver + + @property + def type(self) -> Optional[str]: + """Gets the type of the dialog currently being shown.""" + return self._driver.fedcm.dialog_type + + @property + def title(self) -> str: + """Gets the title of the dialog.""" + return self._driver.fedcm.title + + @property + def subtitle(self) -> Optional[str]: + """Gets the subtitle of the dialog.""" + result = self._driver.fedcm.subtitle + return result.get("subtitle") if result else None + + def get_accounts(self) -> List[Account]: + """Gets the list of accounts shown in the dialog.""" + accounts = self._driver.fedcm.account_list + return [Account(account) for account in accounts] + + def select_account(self, index: int) -> None: + """Selects an account from the dialog by index.""" + self._driver.fedcm.select_account(index) + + def accept(self) -> None: + """Clicks the continue button in the dialog.""" + self._driver.fedcm.accept() + + def dismiss(self) -> None: + """Cancels/dismisses the dialog.""" + self._driver.fedcm.dismiss() diff --git a/selenium-4.31.0/selenium/webdriver/common/keys.py b/selenium-4.31.0/selenium/webdriver/common/keys.py new file mode 100644 index 0000000..c2e7e6e --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/keys.py @@ -0,0 +1,90 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""The Keys implementation.""" + + +class Keys: + """Set of special keys codes.""" + + NULL = "\ue000" + CANCEL = "\ue001" # ^break + HELP = "\ue002" + BACKSPACE = "\ue003" + BACK_SPACE = BACKSPACE + TAB = "\ue004" + CLEAR = "\ue005" + RETURN = "\ue006" + ENTER = "\ue007" + SHIFT = "\ue008" + LEFT_SHIFT = SHIFT + CONTROL = "\ue009" + LEFT_CONTROL = CONTROL + ALT = "\ue00a" + LEFT_ALT = ALT + PAUSE = "\ue00b" + ESCAPE = "\ue00c" + SPACE = "\ue00d" + PAGE_UP = "\ue00e" + PAGE_DOWN = "\ue00f" + END = "\ue010" + HOME = "\ue011" + LEFT = "\ue012" + ARROW_LEFT = LEFT + UP = "\ue013" + ARROW_UP = UP + RIGHT = "\ue014" + ARROW_RIGHT = RIGHT + DOWN = "\ue015" + ARROW_DOWN = DOWN + INSERT = "\ue016" + DELETE = "\ue017" + SEMICOLON = "\ue018" + EQUALS = "\ue019" + + NUMPAD0 = "\ue01a" # number pad keys + NUMPAD1 = "\ue01b" + NUMPAD2 = "\ue01c" + NUMPAD3 = "\ue01d" + NUMPAD4 = "\ue01e" + NUMPAD5 = "\ue01f" + NUMPAD6 = "\ue020" + NUMPAD7 = "\ue021" + NUMPAD8 = "\ue022" + NUMPAD9 = "\ue023" + MULTIPLY = "\ue024" + ADD = "\ue025" + SEPARATOR = "\ue026" + SUBTRACT = "\ue027" + DECIMAL = "\ue028" + DIVIDE = "\ue029" + + F1 = "\ue031" # function keys + F2 = "\ue032" + F3 = "\ue033" + F4 = "\ue034" + F5 = "\ue035" + F6 = "\ue036" + F7 = "\ue037" + F8 = "\ue038" + F9 = "\ue039" + F10 = "\ue03a" + F11 = "\ue03b" + F12 = "\ue03c" + + META = "\ue03d" + COMMAND = "\ue03d" + ZENKAKU_HANKAKU = "\ue040" diff --git a/selenium-4.31.0/selenium/webdriver/common/log.py b/selenium-4.31.0/selenium/webdriver/common/log.py new file mode 100644 index 0000000..f881ca6 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/log.py @@ -0,0 +1,152 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import json +import pkgutil +from contextlib import asynccontextmanager +from importlib import import_module +from typing import Any +from typing import AsyncGenerator +from typing import Dict +from typing import Optional + +from selenium.webdriver.common.by import By + +cdp = None + + +def import_cdp(): + global cdp + if not cdp: + cdp = import_module("selenium.webdriver.common.bidi.cdp") + + +class Log: + """This class allows access to logging APIs that use the new WebDriver Bidi + protocol. + + This class is not to be used directly and should be used from the + webdriver base classes. + """ + + def __init__(self, driver, bidi_session) -> None: + self.driver = driver + self.session = bidi_session.session + self.cdp = bidi_session.cdp + self.devtools = bidi_session.devtools + _pkg = ".".join(__name__.split(".")[:-1]) + # Ensure _mutation_listener_js is not None before decoding + _mutation_listener_js_bytes: Optional[bytes] = pkgutil.get_data(_pkg, "mutation-listener.js") + if _mutation_listener_js_bytes is None: + raise ValueError("Failed to load mutation-listener.js") + self._mutation_listener_js = _mutation_listener_js_bytes.decode("utf8").strip() + + @asynccontextmanager + async def mutation_events(self) -> AsyncGenerator[Dict[str, Any], None]: + """Listen for mutation events and emit them as they are found. + + :Usage: + :: + + async with driver.log.mutation_events() as event: + pages.load("dynamic.html") + driver.find_element(By.ID, "reveal").click() + WebDriverWait(driver, 5)\ + .until(EC.visibility_of(driver.find_element(By.ID, "revealed"))) + + assert event["attribute_name"] == "style" + assert event["current_value"] == "" + assert event["old_value"] == "display:none;" + """ + + page = self.cdp.get_session_context("page.enable") + await page.execute(self.devtools.page.enable()) + runtime = self.cdp.get_session_context("runtime.enable") + await runtime.execute(self.devtools.runtime.enable()) + await runtime.execute(self.devtools.runtime.add_binding("__webdriver_attribute")) + self.driver.pin_script(self._mutation_listener_js) + script_key = await page.execute( + self.devtools.page.add_script_to_evaluate_on_new_document(self._mutation_listener_js) + ) + self.driver.pin_script(self._mutation_listener_js, script_key) + self.driver.execute_script(f"return {self._mutation_listener_js}") + + event: Dict[str, Any] = {} + async with runtime.wait_for(self.devtools.runtime.BindingCalled) as evnt: + yield event + + payload = json.loads(evnt.value.payload) + elements: list = self.driver.find_elements(By.CSS_SELECTOR, f"*[data-__webdriver_id=\"{payload['target']}\"]") + if not elements: + elements.append(None) + event["element"] = elements[0] + event["attribute_name"] = payload["name"] + event["current_value"] = payload["value"] + event["old_value"] = payload["oldValue"] + + @asynccontextmanager + async def add_js_error_listener(self) -> AsyncGenerator[Dict[str, Any], None]: + """Listen for JS errors and when the contextmanager exits check if + there were JS Errors. + + :Usage: + :: + + async with driver.log.add_js_error_listener() as error: + driver.find_element(By.ID, "throwing-mouseover").click() + assert bool(error) + assert error.exception_details.stack_trace.call_frames[0].function_name == "onmouseover" + """ + + session = self.cdp.get_session_context("page.enable") + await session.execute(self.devtools.page.enable()) + session = self.cdp.get_session_context("runtime.enable") + await session.execute(self.devtools.runtime.enable()) + js_exception = self.devtools.runtime.ExceptionThrown(None, None) + async with session.wait_for(self.devtools.runtime.ExceptionThrown) as exception: + yield js_exception + js_exception.timestamp = exception.value.timestamp + js_exception.exception_details = exception.value.exception_details + + @asynccontextmanager + async def add_listener(self, event_type) -> AsyncGenerator[Dict[str, Any], None]: + """Listen for certain events that are passed in. + + :Args: + - event_type: The type of event that we want to look at. + + :Usage: + :: + + async with driver.log.add_listener(Console.log) as messages: + driver.execute_script("console.log('I like cheese')") + assert messages["message"] == "I love cheese" + """ + + from selenium.webdriver.common.bidi.console import Console + + session = self.cdp.get_session_context("page.enable") + await session.execute(self.devtools.page.enable()) + session = self.cdp.get_session_context("runtime.enable") + await session.execute(self.devtools.runtime.enable()) + console: Dict[str, Any] = {"message": None, "level": None} + async with session.wait_for(self.devtools.runtime.ConsoleAPICalled) as messages: + yield console + + if event_type == Console.ALL or event_type.value == messages.value.type_: + console["message"] = messages.value.args[0].value + console["level"] = messages.value.args[0].type_ diff --git a/selenium-4.31.0/selenium/webdriver/common/mutation-listener.js b/selenium-4.31.0/selenium/webdriver/common/mutation-listener.js new file mode 100644 index 0000000..64c02b3 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/mutation-listener.js @@ -0,0 +1,55 @@ +// Licensed to the Software Freedom Conservancy (SFC) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The SFC licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +(function () { + const observer = new MutationObserver((mutations) => { + for (const mutation of mutations) { + switch (mutation.type) { + case 'attributes': + // Don't report our own attribute has changed. + if (mutation.attributeName === "data-__webdriver_id") { + break; + } + const curr = mutation.target.getAttribute(mutation.attributeName); + var id = mutation.target.dataset.__webdriver_id + if (!id) { + id = Math.random().toString(36).substring(2) + Date.now().toString(36); + mutation.target.dataset.__webdriver_id = id; + } + const json = JSON.stringify({ + 'target': id, + 'name': mutation.attributeName, + 'value': curr, + 'oldValue': mutation.oldValue + }); + __webdriver_attribute(json); + break; + default: + break; + } + } + }); + + observer.observe(document, { + 'attributes': true, + 'attributeOldValue': true, + 'characterData': true, + 'characterDataOldValue': true, + 'childList': true, + 'subtree': true + }); +})(); diff --git a/selenium-4.31.0/selenium/webdriver/common/options.py b/selenium-4.31.0/selenium/webdriver/common/options.py new file mode 100644 index 0000000..111fd32 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/options.py @@ -0,0 +1,515 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import warnings +from abc import ABCMeta +from abc import abstractmethod +from enum import Enum +from typing import Optional + +from selenium.common.exceptions import InvalidArgumentException +from selenium.webdriver.common.proxy import Proxy + + +class PageLoadStrategy(str, Enum): + """Enum of possible page load strategies. + + Selenium support following strategies: + * normal (default) - waits for all resources to download + * eager - DOM access is ready, but other resources like images may still be loading + * none - does not block `WebDriver` at all + + Docs: https://www.selenium.dev/documentation/webdriver/drivers/options/#pageloadstrategy. + """ + + normal = "normal" + eager = "eager" + none = "none" + + +class _BaseOptionsDescriptor: + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls): + if self.name == "enableBidi": + # whether BiDi is or will be enabled + value = obj._caps.get("webSocketUrl") + return value is True or isinstance(value, str) + if self.name == "webSocketUrl": + # Return socket url or None if not created yet + value = obj._caps.get(self.name) + return None if not isinstance(value, str) else value + if self.name in ("acceptInsecureCerts", "strictFileInteractability", "setWindowRect", "se:downloadsEnabled"): + return obj._caps.get(self.name, False) + return obj._caps.get(self.name) + + def __set__(self, obj, value): + if self.name == "enableBidi": + obj.set_capability("webSocketUrl", value) + else: + obj.set_capability(self.name, value) + + +class _PageLoadStrategyDescriptor: + """Determines the point at which a navigation command is returned: + https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies. + + :param strategy: the strategy corresponding to a document readiness state + """ + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls): + return obj._caps.get(self.name) + + def __set__(self, obj, value): + if value in ("normal", "eager", "none"): + obj.set_capability(self.name, value) + else: + raise ValueError("Strategy can only be one of the following: normal, eager, none") + + +class _UnHandledPromptBehaviorDescriptor: + """How the driver should respond when an alert is present and the: + command sent is not handling the alert: + https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies: + + :param behavior: behavior to use when an alert is encountered + + :returns: Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds) + """ + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls): + return obj._caps.get(self.name) + + def __set__(self, obj, value): + if value in ("dismiss", "accept", "dismiss and notify", "accept and notify", "ignore"): + obj.set_capability(self.name, value) + else: + raise ValueError( + "Behavior can only be one of the following: dismiss, accept, dismiss and notify, " + "accept and notify, ignore" + ) + + +class _TimeoutsDescriptor: + """How long the driver should wait for actions to complete before: + returning an error https://w3c.github.io/webdriver/#timeouts: + + :param timeouts: values in milliseconds for implicit wait, page load and script timeout + + :returns: Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds) + """ + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls): + return obj._caps.get(self.name) + + def __set__(self, obj, value): + if all(x in ("implicit", "pageLoad", "script") for x in value.keys()): + obj.set_capability(self.name, value) + else: + raise ValueError("Timeout keys can only be one of the following: implicit, pageLoad, script") + + +class _ProxyDescriptor: + """:Returns: Proxy if set, otherwise None.""" + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls): + return obj._proxy + + def __set__(self, obj, value): + if not isinstance(value, Proxy): + raise InvalidArgumentException("Only Proxy objects can be passed in.") + obj._proxy = value + obj._caps[self.name] = value.to_capabilities() + + +class BaseOptions(metaclass=ABCMeta): + """Base class for individual browser options.""" + + browser_version = _BaseOptionsDescriptor("browserVersion") + """Gets and Sets the version of the browser. + + Usage: + ------ + - Get + - `self.browser_version` + - Set + - `self.browser_version` = `value` + + Parameters: + ----------- + `value`: `str` + + Returns: + -------- + - Get + - `str` + - Set + - `None` + """ + + platform_name = _BaseOptionsDescriptor("platformName") + """Gets and Sets name of the platform. + + Usage: + ------ + - Get + - `self.platform_name` + - Set + - `self.platform_name` = `value` + + Parameters: + ----------- + `value`: `str` + + Returns: + -------- + - Get + - `str` + - Set + - `None` + """ + + accept_insecure_certs = _BaseOptionsDescriptor("acceptInsecureCerts") + """Gets and Set whether the session accepts insecure certificates. + + Usage: + ------ + - Get + - `self.accept_insecure_certs` + - Set + - `self.accept_insecure_certs` = `value` + + Parameters: + ----------- + `value`: `bool` + + Returns: + -------- + - Get + - `bool` + - Set + - `None` + """ + + strict_file_interactability = _BaseOptionsDescriptor("strictFileInteractability") + """Gets and Sets whether session is about file interactability. + + Usage: + ------ + - Get + - `self.strict_file_interactability` + - Set + - `self.strict_file_interactability` = `value` + + Parameters: + ----------- + `value`: `bool` + + Returns: + -------- + - Get + - `bool` + - Set + - `None` + """ + + set_window_rect = _BaseOptionsDescriptor("setWindowRect") + """Gets and Sets window size and position. + + Usage: + ------ + - Get + - `self.set_window_rect` + - Set + - `self.set_window_rect` = `value` + + Parameters: + ----------- + `value`: `bool` + + Returns: + -------- + - Get + - `bool` + - Set + - `None` + """ + + enable_bidi = _BaseOptionsDescriptor("enableBidi") + """Gets and Set whether the session has WebDriverBiDi enabled. + + Usage: + ------ + - Get + - `self.enable_bidi` + - Set + - `self.enable_bidi` = `value` + + Parameters: + ----------- + `value`: `bool` + + Returns: + -------- + - Get + - `bool` + - Set + - `None` + """ + + page_load_strategy = _PageLoadStrategyDescriptor("pageLoadStrategy") + """:Gets and Sets page load strategy, the default is "normal". + + Usage: + ------ + - Get + - `self.page_load_strategy` + - Set + - `self.page_load_strategy` = `value` + + Parameters: + ----------- + `value`: `str` + + Returns: + -------- + - Get + - `str` + - Set + - `None` + """ + + unhandled_prompt_behavior = _UnHandledPromptBehaviorDescriptor("unhandledPromptBehavior") + """:Gets and Sets unhandled prompt behavior, the default is "dismiss and + notify". + + Usage: + ------ + - Get + - `self.unhandled_prompt_behavior` + - Set + - `self.unhandled_prompt_behavior` = `value` + + Parameters: + ----------- + `value`: `str` + + Returns: + -------- + - Get + - `str` + - Set + - `None` + """ + + timeouts = _TimeoutsDescriptor("timeouts") + """:Gets and Sets implicit timeout, pageLoad timeout and script timeout if + set (in milliseconds) + + Usage: + ------ + - Get + - `self.timeouts` + - Set + - `self.timeouts` = `value` + + Parameters: + ----------- + `value`: `dict` + + Returns: + -------- + - Get + - `dict` + - Set + - `None` + """ + + proxy = _ProxyDescriptor("proxy") + """Sets and Gets Proxy. + + Usage: + ------ + - Get + - `self.proxy` + - Set + - `self.proxy` = `value` + + Parameters: + ----------- + `value`: `Proxy` + + Returns: + -------- + - Get + - `Proxy` + - Set + - `None` + """ + + enable_downloads = _BaseOptionsDescriptor("se:downloadsEnabled") + """Gets and Sets whether session can download files. + + Usage: + ------ + - Get + - `self.enable_downloads` + - Set + - `self.enable_downloads` = `value` + + Parameters: + ----------- + `value`: `bool` + + Returns: + -------- + - Get + - `bool` + - Set + - `None` + """ + + web_socket_url = _BaseOptionsDescriptor("webSocketUrl") + """Gets and Sets WebSocket URL. + + Usage: + ------ + - Get + - `self.web_socket_url` + - Set + - `self.web_socket_url` = `value` + + Parameters: + ----------- + `value`: `str` + + Returns: + -------- + - Get + - `bool` + - Set + - `None` + """ + + def __init__(self) -> None: + super().__init__() + self._caps = self.default_capabilities + self._proxy = None + self.set_capability("pageLoadStrategy", PageLoadStrategy.normal) + self.mobile_options = None + self._ignore_local_proxy = False + + @property + def capabilities(self): + return self._caps + + def set_capability(self, name, value) -> None: + """Sets a capability.""" + self._caps[name] = value + + def enable_mobile( + self, + android_package: Optional[str] = None, + android_activity: Optional[str] = None, + device_serial: Optional[str] = None, + ) -> None: + """Enables mobile browser use for browsers that support it. + + :Args: + android_activity: The name of the android package to start + """ + if not android_package: + raise AttributeError("android_package must be passed in") + self.mobile_options = {"androidPackage": android_package} + if android_activity: + self.mobile_options["androidActivity"] = android_activity + if device_serial: + self.mobile_options["androidDeviceSerial"] = device_serial + + @abstractmethod + def to_capabilities(self): + """Convert options into capabilities dictionary.""" + + @property + @abstractmethod + def default_capabilities(self): + """Return minimal capabilities necessary as a dictionary.""" + + def ignore_local_proxy_environment_variables(self) -> None: + """By calling this you will ignore HTTP_PROXY and HTTPS_PROXY from + being picked up and used.""" + self._ignore_local_proxy = True + + +class ArgOptions(BaseOptions): + BINARY_LOCATION_ERROR = "Binary Location Must be a String" + # FedCM capability key + FEDCM_CAPABILITY = "fedcm:accounts" + + def __init__(self) -> None: + super().__init__() + self._arguments = [] + + @property + def arguments(self): + """:Returns: A list of arguments needed for the browser.""" + return self._arguments + + def add_argument(self, argument) -> None: + """Adds an argument to the list. + + :Args: + - Sets the arguments + """ + if argument: + self._arguments.append(argument) + else: + raise ValueError("argument can not be null") + + def ignore_local_proxy_environment_variables(self) -> None: + """By calling this you will ignore HTTP_PROXY and HTTPS_PROXY from + being picked up and used.""" + warnings.warn( + "using ignore_local_proxy_environment_variables in Options has been deprecated, " + "instead, create a Proxy instance with ProxyType.DIRECT to ignore proxy settings, " + "pass the proxy instance into a ClientConfig constructor, " + "pass the client config instance into the Webdriver constructor", + DeprecationWarning, + stacklevel=2, + ) + + super().ignore_local_proxy_environment_variables() + + def to_capabilities(self): + return self._caps + + @property + def default_capabilities(self): + return {} diff --git a/selenium-4.31.0/selenium/webdriver/common/print_page_options.py b/selenium-4.31.0/selenium/webdriver/common/print_page_options.py new file mode 100644 index 0000000..6a532aa --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/print_page_options.py @@ -0,0 +1,448 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +from typing import TYPE_CHECKING +from typing import List +from typing import Optional +from typing import Type + +if TYPE_CHECKING: + from typing import Literal + from typing import TypedDict + + Orientation = Literal["portrait", "landscape"] + + class _MarginOpts(TypedDict, total=False): + left: float + right: float + top: float + bottom: float + + class _PageOpts(TypedDict, total=False): + width: float + height: float + + class _PrintOpts(TypedDict, total=False): + margin: _MarginOpts + page: _PageOpts + background: bool + orientation: Orientation + scale: float + shrinkToFit: bool + pageRanges: List[str] + +else: + from typing import Any + from typing import Dict + + Orientation = str + _MarginOpts = _PageOpts = _PrintOpts = Dict[str, Any] + + +class _PageSettingsDescriptor: + """Descriptor which validates `height` and 'width' of page.""" + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls) -> Optional[float]: + return obj._page.get(self.name, None) + + def __set__(self, obj, value) -> None: + getattr(obj, "_validate_num_property")(self.name, value) + obj._page[self.name] = value + obj._print_options["page"] = obj._page + + +class _MarginSettingsDescriptor: + """Descriptor which validates below attributes. + + - top + - bottom + - left + - right + """ + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls) -> Optional[float]: + return obj._margin.get(self.name, None) + + def __set__(self, obj, value) -> None: + getattr(obj, "_validate_num_property")(f"Margin {self.name}", value) + obj._margin[self.name] = value + obj._print_options["margin"] = obj._margin + + +class _ScaleDescriptor: + """Scale descriptor which validates scale.""" + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls) -> Optional[float]: + return obj._print_options.get(self.name) + + def __set__(self, obj, value) -> None: + getattr(obj, "_validate_num_property")(self.name, value) + if value < 0.1 or value > 2: + raise ValueError("Value of scale should be between 0.1 and 2") + obj._print_options[self.name] = value + + +class _PageOrientationDescriptor: + """PageOrientation descriptor which validates orientation of page.""" + + ORIENTATION_VALUES = ["portrait", "landscape"] + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls) -> Optional[Orientation]: + return obj._print_options.get(self.name, None) + + def __set__(self, obj, value) -> None: + if value not in self.ORIENTATION_VALUES: + raise ValueError(f"Orientation value must be one of {self.ORIENTATION_VALUES}") + obj._print_options[self.name] = value + + +class _ValidateTypeDescriptor: + """Base Class Descriptor which validates type of any subclass attribute.""" + + def __init__(self, name, expected_type: Type): + self.name = name + self.expected_type = expected_type + + def __get__(self, obj, cls): + return obj._print_options.get(self.name, None) + + def __set__(self, obj, value) -> None: + if not isinstance(value, self.expected_type): + raise ValueError(f"{self.name} should be of type {self.expected_type.__name__}") + obj._print_options[self.name] = value + + +class _ValidateBackGround(_ValidateTypeDescriptor): + """Expected type of background attribute.""" + + def __init__(self, name): + super().__init__(name, bool) + + +class _ValidateShrinkToFit(_ValidateTypeDescriptor): + """Expected type of shrink to fit attribute.""" + + def __init__(self, name): + super().__init__(name, bool) + + +class _ValidatePageRanges(_ValidateTypeDescriptor): + """Expected type of page ranges attribute.""" + + def __init__(self, name): + super().__init__(name, list) + + +class PrintOptions: + page_height = _PageSettingsDescriptor("height") + """Gets and Sets page_height: + + Usage + ----- + - Get + - `self.page_height` + - Set + - `self.page_height` = `value` + + Parameters: + ----------- + `value`: `float` + + Returns: + -------- + - Get + - `Optional[float]` + - Set + - `None` + """ + + page_width = _PageSettingsDescriptor("width") + """Gets and Sets page_width: + + Usage: + ------ + - Get + - `self.page_width` + - Set + - `self.page_width` = `value` + + Parameters: + ----------- + `value`: `float` + + Returns: + -------- + - Get + - `Optional[float]` + - Set + - `None` + """ + + margin_top = _MarginSettingsDescriptor("top") + """Gets and Sets margin_top: + + Usage: + ------ + - Get + - `self.margin_top` + - Set + - `self.margin_top` = `value` + + Parameters: + ----------- + `value`: `float` + + Returns: + -------- + - Get + - `Optional[float]` + - Set + - `None` + """ + + margin_bottom = _MarginSettingsDescriptor("bottom") + """Gets and Sets margin_bottom: + + Usage: + ------ + - Get + - `self.margin_bottom` + - Set + - `self.margin_bottom` = `value` + + Parameters: + ----------- + `value`: `float` + + Returns: + -------- + - Get + - `Optional[float]` + - Set + - `None` + """ + + margin_left = _MarginSettingsDescriptor("left") + """Gets and Sets margin_left: + + Usage: + ------ + - Get + - `self.margin_left` + - Set + - `self.margin_left` = `value` + + Parameters: + ----------- + `value`: `float` + + Returns: + -------- + - Get + - `Optional[float]` + - Set + - `None` + """ + + margin_right = _MarginSettingsDescriptor("right") + """Gets and Sets margin_right: + + Usage: + ------ + - Get + - `self.margin_right` + - Set + - `self.margin_right` = `value` + + Parameters: + ----------- + `value`: `float` + + Returns: + -------- + - Get + - `Optional[float]` + - Set + - `None` + """ + + scale = _ScaleDescriptor("scale") + """Gets and Sets scale: + + Usage: + ------ + - Get + - `self.scale` + - Set + - `self.scale` = `value` + + Parameters: + ----------- + `value`: `float` + + Returns: + -------- + - Get + - `Optional[float]` + - Set + - `None` + """ + + orientation = _PageOrientationDescriptor("orientation") + """Gets and Sets orientation: + + Usage: + ------ + - Get + - `self.orientation` + - Set + - `self.orientation` = `value` + + Parameters: + ----------- + `value`: `Orientation` + + Returns: + -------- + - Get + - `Optional[Orientation]` + - Set + - `None` + """ + + background = _ValidateBackGround("background") + """Gets and Sets background: + + Usage: + ------ + - Get + - `self.background` + - Set + - `self.background` = `value` + + Parameters: + ----------- + `value`: `bool` + + Returns: + -------- + - Get + - `Optional[bool]` + - Set + - `None` + """ + + shrink_to_fit = _ValidateShrinkToFit("shrinkToFit") + """Gets and Sets shrink_to_fit: + + Usage: + ------ + - Get + - `self.shrink_to_fit` + - Set + - `self.shrink_to_fit` = `value` + + Parameters: + ----------- + `value`: `bool` + + Returns: + -------- + - Get + - `Optional[bool]` + - Set + - `None` + """ + + page_ranges = _ValidatePageRanges("pageRanges") + """Gets and Sets page_ranges: + + Usage: + ------ + - Get + - `self.page_ranges` + - Set + - `self.page_ranges` = `value` + + Parameters: + ----------- + `value`: ` List[str]` + + Returns: + -------- + - Get + - `Optional[List[str]]` + - Set + - `None` + """ + # Reference for predefined page size constants: https://www.agooddaytoprint.com/page/paper-size-chart-faq + A4 = {"height": 29.7, "width": 21.0} # size in cm + LEGAL = {"height": 35.56, "width": 21.59} # size in cm + LETTER = {"height": 27.94, "width": 21.59} # size in cm + TABLOID = {"height": 43.18, "width": 27.94} # size in cm + + def __init__(self) -> None: + self._print_options: _PrintOpts = {} + self._page: _PageOpts = { + "height": PrintOptions.A4["height"], + "width": PrintOptions.A4["width"], + } # Default page size set to A4 + self._margin: _MarginOpts = {} + + def to_dict(self) -> _PrintOpts: + """:Returns: A hash of print options configured.""" + return self._print_options + + def set_page_size(self, page_size: dict) -> None: + """Sets the page size to predefined or custom dimensions. + + Parameters: + ----------- + page_size: dict + A dictionary containing `height` and `width` as keys with respective values. + + Example: + -------- + self.set_page_size(PageSize.A4) # A4 predefined size + self.set_page_size({"height": 15.0, "width": 20.0}) # Custom size in cm + """ + self._validate_num_property("height", page_size["height"]) + self._validate_num_property("width", page_size["width"]) + self._page["height"] = page_size["height"] + self._page["width"] = page_size["width"] + self._print_options["page"] = self._page + + def _validate_num_property(self, property_name: str, value: float) -> None: + """Helper function to validate some of the properties.""" + if not isinstance(value, (int, float)): + raise ValueError(f"{property_name} should be an integer or a float") + + if value < 0: + raise ValueError(f"{property_name} cannot be less than 0") diff --git a/selenium-4.31.0/selenium/webdriver/common/proxy.py b/selenium-4.31.0/selenium/webdriver/common/proxy.py new file mode 100644 index 0000000..328a3a4 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/proxy.py @@ -0,0 +1,307 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""The Proxy implementation.""" + + +class ProxyTypeFactory: + """Factory for proxy types.""" + + @staticmethod + def make(ff_value, string): + return {"ff_value": ff_value, "string": string} + + +class ProxyType: + """Set of possible types of proxy. + + Each proxy type has 2 properties: 'ff_value' is value of Firefox + profile preference, 'string' is id of proxy type. + """ + + DIRECT = ProxyTypeFactory.make(0, "DIRECT") # Direct connection, no proxy (default on Windows). + MANUAL = ProxyTypeFactory.make(1, "MANUAL") # Manual proxy settings (e.g., for httpProxy). + PAC = ProxyTypeFactory.make(2, "PAC") # Proxy autoconfiguration from URL. + RESERVED_1 = ProxyTypeFactory.make(3, "RESERVED1") # Never used. + AUTODETECT = ProxyTypeFactory.make(4, "AUTODETECT") # Proxy autodetection (presumably with WPAD). + SYSTEM = ProxyTypeFactory.make(5, "SYSTEM") # Use system settings (default on Linux). + UNSPECIFIED = ProxyTypeFactory.make(6, "UNSPECIFIED") # Not initialized (for internal use). + + @classmethod + def load(cls, value): + if isinstance(value, dict) and "string" in value: + value = value["string"] + value = str(value).upper() + for attr in dir(cls): + attr_value = getattr(cls, attr) + if isinstance(attr_value, dict) and "string" in attr_value and attr_value["string"] == value: + return attr_value + raise Exception(f"No proxy type is found for {value}") + + +class _ProxyTypeDescriptor: + def __init__(self, name, p_type): + self.name = name + self.p_type = p_type + + def __get__(self, obj, cls): + return getattr(obj, self.name) + + def __set__(self, obj, value): + if self.name == "autodetect" and not isinstance(value, bool): + raise ValueError("Autodetect proxy value needs to be a boolean") + getattr(obj, "_verify_proxy_type_compatibility")(self.p_type) + setattr(obj, "proxyType", self.p_type) + setattr(obj, self.name, value) + + +class Proxy: + """Proxy contains information about proxy type and necessary proxy + settings.""" + + proxyType = ProxyType.UNSPECIFIED + autodetect = False + ftpProxy = "" + httpProxy = "" + noProxy = "" + proxyAutoconfigUrl = "" + sslProxy = "" + socksProxy = "" + socksUsername = "" + socksPassword = "" + socksVersion = None + + # create descriptor type objects + auto_detect = _ProxyTypeDescriptor("autodetect", ProxyType.AUTODETECT) + """Gets and Sets `auto_detect` + + Usage: + ------ + - Get + - `self.auto_detect` + - Set + - `self.auto_detect` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + ftp_proxy = _ProxyTypeDescriptor("ftpProxy", ProxyType.MANUAL) + """Gets and Sets `ftp_proxy` + + Usage: + ------ + - Get + - `self.ftp_proxy` + - Set + - `self.ftp_proxy` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + http_proxy = _ProxyTypeDescriptor("httpProxy", ProxyType.MANUAL) + """Gets and Sets `http_proxy` + + Usage: + ------ + - Get + - `self.http_proxy` + - Set + - `self.http_proxy` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + no_proxy = _ProxyTypeDescriptor("noProxy", ProxyType.MANUAL) + """Gets and Sets `no_proxy` + + Usage: + ------ + - Get + - `self.no_proxy` + - Set + - `self.no_proxy` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + proxy_autoconfig_url = _ProxyTypeDescriptor("proxyAutoconfigUrl", ProxyType.PAC) + """Gets and Sets `proxy_autoconfig_url` + + Usage: + ------ + - Get + - `self.proxy_autoconfig_url` + - Set + - `self.proxy_autoconfig_url` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + ssl_proxy = _ProxyTypeDescriptor("sslProxy", ProxyType.MANUAL) + """Gets and Sets `ssl_proxy` + + Usage: + ------ + - Get + - `self.ssl_proxy` + - Set + - `self.ssl_proxy` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + socks_proxy = _ProxyTypeDescriptor("socksProxy", ProxyType.MANUAL) + """Gets and Sets `socks_proxy` + + Usage: + ------ + - Get + - `self.sock_proxy` + - Set + - `self.socks_proxy` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + socks_username = _ProxyTypeDescriptor("socksUsername", ProxyType.MANUAL) + """Gets and Sets `socks_password` + + Usage: + ------ + - Get + - `self.socks_password` + - Set + - `self.socks_password` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + socks_password = _ProxyTypeDescriptor("socksPassword", ProxyType.MANUAL) + """Gets and Sets `socks_password` + + Usage: + ------ + - Get + - `self.socks_password` + - Set + - `self.socks_password` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + socks_version = _ProxyTypeDescriptor("socksVersion", ProxyType.MANUAL) + """Gets and Sets `socks_version` + + Usage: + ------ + - Get + - `self.socks_version` + - Set + - `self.socks_version` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + def __init__(self, raw=None): + """Creates a new Proxy. + + :Args: + - raw: raw proxy data. If None, default class values are used. + """ + if raw: + if "proxyType" in raw and raw["proxyType"]: + self.proxy_type = ProxyType.load(raw["proxyType"]) + if "ftpProxy" in raw and raw["ftpProxy"]: + self.ftp_proxy = raw["ftpProxy"] + if "httpProxy" in raw and raw["httpProxy"]: + self.http_proxy = raw["httpProxy"] + if "noProxy" in raw and raw["noProxy"]: + self.no_proxy = raw["noProxy"] + if "proxyAutoconfigUrl" in raw and raw["proxyAutoconfigUrl"]: + self.proxy_autoconfig_url = raw["proxyAutoconfigUrl"] + if "sslProxy" in raw and raw["sslProxy"]: + self.sslProxy = raw["sslProxy"] + if "autodetect" in raw and raw["autodetect"]: + self.auto_detect = raw["autodetect"] + if "socksProxy" in raw and raw["socksProxy"]: + self.socks_proxy = raw["socksProxy"] + if "socksUsername" in raw and raw["socksUsername"]: + self.socks_username = raw["socksUsername"] + if "socksPassword" in raw and raw["socksPassword"]: + self.socks_password = raw["socksPassword"] + if "socksVersion" in raw and raw["socksVersion"]: + self.socks_version = raw["socksVersion"] + + @property + def proxy_type(self): + """Returns proxy type as `ProxyType`.""" + return self.proxyType + + @proxy_type.setter + def proxy_type(self, value) -> None: + """Sets proxy type. + + :Args: + - value: The proxy type. + """ + self._verify_proxy_type_compatibility(value) + self.proxyType = value + + def _verify_proxy_type_compatibility(self, compatible_proxy): + if self.proxyType not in (ProxyType.UNSPECIFIED, compatible_proxy): + raise ValueError( + f"Specified proxy type ({compatible_proxy}) not compatible with current setting ({self.proxyType})" + ) + + def to_capabilities(self): + proxy_caps = {"proxyType": self.proxyType["string"].lower()} + proxies = [ + "autodetect", + "ftpProxy", + "httpProxy", + "proxyAutoconfigUrl", + "sslProxy", + "noProxy", + "socksProxy", + "socksUsername", + "socksPassword", + "socksVersion", + ] + for proxy in proxies: + attr_value = getattr(self, proxy) + if attr_value: + proxy_caps[proxy] = attr_value + return proxy_caps diff --git a/selenium-4.31.0/selenium/webdriver/common/selenium_manager.py b/selenium-4.31.0/selenium/webdriver/common/selenium_manager.py new file mode 100644 index 0000000..469965f --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/selenium_manager.py @@ -0,0 +1,140 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import json +import logging +import os +import platform +import subprocess +import sys +import sysconfig +from pathlib import Path +from typing import List +from typing import Optional + +from selenium.common import WebDriverException + +logger = logging.getLogger(__name__) + + +class SeleniumManager: + """Wrapper for getting information from the Selenium Manager binaries. + + This implementation is still in beta, and may change. + """ + + def binary_paths(self, args: List) -> dict: + """Determines the locations of the requested assets. + + :Args: + - args: the commands to send to the selenium manager binary. + :Returns: dictionary of assets and their path + """ + + args = [str(self._get_binary())] + args + if logger.getEffectiveLevel() == logging.DEBUG: + args.append("--debug") + args.append("--language-binding") + args.append("python") + args.append("--output") + args.append("json") + + return self._run(args) + + @staticmethod + def _get_binary() -> Path: + """Determines the path of the correct Selenium Manager binary. + + :Returns: The Selenium Manager executable location + + :Raises: WebDriverException if the platform is unsupported + """ + + compiled_path = Path(__file__).parent.joinpath("selenium-manager") + exe = sysconfig.get_config_var("EXE") + if exe is not None: + compiled_path = compiled_path.with_suffix(exe) + + path: Optional[Path] = None + + if (env_path := os.getenv("SE_MANAGER_PATH")) is not None: + logger.debug("Selenium Manager set by env SE_MANAGER_PATH to: %s", env_path) + path = Path(env_path) + elif compiled_path.exists(): + path = compiled_path + else: + allowed = { + ("darwin", "any"): "macos/selenium-manager", + ("win32", "any"): "windows/selenium-manager.exe", + ("cygwin", "any"): "windows/selenium-manager.exe", + ("linux", "x86_64"): "linux/selenium-manager", + ("freebsd", "x86_64"): "linux/selenium-manager", + ("openbsd", "x86_64"): "linux/selenium-manager", + } + + arch = platform.machine() if sys.platform in ("linux", "freebsd", "openbsd") else "any" + if sys.platform in ["freebsd", "openbsd"]: + logger.warning("Selenium Manager binary may not be compatible with %s; verify settings", sys.platform) + + location = allowed.get((sys.platform, arch)) + if location is None: + raise WebDriverException(f"Unsupported platform/architecture combination: {sys.platform}/{arch}") + + path = Path(__file__).parent.joinpath(location) + + if path is None or not path.is_file(): + raise WebDriverException(f"Unable to obtain working Selenium Manager binary; {path}") + + logger.debug("Selenium Manager binary found at: %s", path) + + return path + + @staticmethod + def _run(args: List[str]) -> dict: + """Executes the Selenium Manager Binary. + + :Args: + - args: the components of the command being executed. + :Returns: The log string containing the driver location. + """ + command = " ".join(args) + logger.debug("Executing process: %s", command) + try: + if sys.platform == "win32": + completed_proc = subprocess.run(args, capture_output=True, creationflags=subprocess.CREATE_NO_WINDOW) + else: + completed_proc = subprocess.run(args, capture_output=True) + stdout = completed_proc.stdout.decode("utf-8").rstrip("\n") + stderr = completed_proc.stderr.decode("utf-8").rstrip("\n") + output = json.loads(stdout) if stdout != "" else {"logs": [], "result": {}} + except Exception as err: + raise WebDriverException(f"Unsuccessful command executed: {command}") from err + + SeleniumManager._process_logs(output["logs"]) + result = output["result"] + if completed_proc.returncode: + raise WebDriverException( + f"Unsuccessful command executed: {command}; code: {completed_proc.returncode}\n{result}\n{stderr}" + ) + return result + + @staticmethod + def _process_logs(log_items: List[dict]): + for item in log_items: + if item["level"] == "WARN": + logger.warning(item["message"]) + elif item["level"] in ["DEBUG", "INFO"]: + logger.debug(item["message"]) diff --git a/selenium-4.31.0/selenium/webdriver/common/service.py b/selenium-4.31.0/selenium/webdriver/common/service.py new file mode 100644 index 0000000..d74b55e --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/service.py @@ -0,0 +1,252 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import errno +import logging +import os +import subprocess +from abc import ABC +from abc import abstractmethod +from io import IOBase +from platform import system +from subprocess import PIPE +from time import sleep +from typing import IO +from typing import Any +from typing import List +from typing import Mapping +from typing import Optional +from typing import Union +from typing import cast +from urllib import request +from urllib.error import URLError + +from selenium.common.exceptions import WebDriverException +from selenium.types import SubprocessStdAlias +from selenium.webdriver.common import utils + +logger = logging.getLogger(__name__) + + +class Service(ABC): + """The abstract base class for all service objects. Services typically + launch a child program in a new process as an interim process to + communicate with a browser. + + :param executable: install path of the executable. + :param port: Port for the service to run on, defaults to 0 where the operating system will decide. + :param log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file. + :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`. + :param driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable. + """ + + def __init__( + self, + executable_path: str = None, + port: int = 0, + log_output: SubprocessStdAlias = None, + env: Optional[Mapping[Any, Any]] = None, + driver_path_env_key: str = None, + **kwargs, + ) -> None: + if isinstance(log_output, str): + self.log_output = cast(IOBase, open(log_output, "a+", encoding="utf-8")) + elif log_output == subprocess.STDOUT: + self.log_output = cast(Optional[Union[int, IOBase]], None) + elif log_output is None or log_output == subprocess.DEVNULL: + self.log_output = cast(Optional[Union[int, IOBase]], subprocess.DEVNULL) + else: + self.log_output = log_output + + self.port = port or utils.free_port() + # Default value for every python subprocess: subprocess.Popen(..., creationflags=0) + self.popen_kw = kwargs.pop("popen_kw", {}) + self.creation_flags = self.popen_kw.pop("creation_flags", 0) + self.env = env or os.environ + self.DRIVER_PATH_ENV_KEY = driver_path_env_key + self._path = self.env_path() or executable_path + + @property + def service_url(self) -> str: + """Gets the url of the Service.""" + return f"http://{utils.join_host_port('localhost', self.port)}" + + @abstractmethod + def command_line_args(self) -> List[str]: + """A List of program arguments (excluding the executable).""" + raise NotImplementedError("This method needs to be implemented in a sub class") + + @property + def path(self) -> str: + return self._path or "" + + @path.setter + def path(self, value: str) -> None: + self._path = str(value) + + def start(self) -> None: + """Starts the Service. + + :Exceptions: + - WebDriverException : Raised either when it can't start the service + or when it can't connect to the service + """ + if self._path is None: + raise WebDriverException("Service path cannot be None.") + self._start_process(self._path) + + count = 0 + while True: + self.assert_process_still_running() + if self.is_connectable(): + break + # sleep increasing: 0.01, 0.06, 0.11, 0.16, 0.21, 0.26, 0.31, 0.36, 0.41, 0.46, 0.5 + sleep(min(0.01 + 0.05 * count, 0.5)) + count += 1 + if count == 70: + raise WebDriverException(f"Can not connect to the Service {self._path}") + + def assert_process_still_running(self) -> None: + """Check if the underlying process is still running.""" + return_code = self.process.poll() + if return_code: + raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}") + + def is_connectable(self) -> bool: + """Establishes a socket connection to determine if the service running + on the port is accessible.""" + return utils.is_connectable(self.port) + + def send_remote_shutdown_command(self) -> None: + """Dispatch an HTTP request to the shutdown endpoint for the service in + an attempt to stop it.""" + try: + request.urlopen(f"{self.service_url}/shutdown") + except URLError: + return + + for _ in range(30): + if not self.is_connectable(): + break + sleep(1) + + def stop(self) -> None: + """Stops the service.""" + + if self.log_output not in {PIPE, subprocess.DEVNULL}: + if isinstance(self.log_output, IOBase): + self.log_output.close() + elif isinstance(self.log_output, int): + os.close(self.log_output) + + if self.process is not None and self.process.poll() is None: + try: + self.send_remote_shutdown_command() + except TypeError: + pass + finally: + self._terminate_process() + + def _terminate_process(self) -> None: + """Terminate the child process. + + On POSIX this attempts a graceful SIGTERM followed by a SIGKILL, + on a Windows OS kill is an alias to terminate. Terminating does + not raise itself if something has gone wrong but (currently) + silently ignores errors here. + """ + try: + stdin, stdout, stderr = ( + self.process.stdin, + self.process.stdout, + self.process.stderr, + ) + for stream in stdin, stdout, stderr: + try: + stream.close() # type: ignore + except AttributeError: + pass + self.process.terminate() + try: + self.process.wait(60) + except subprocess.TimeoutExpired: + logger.error( + "Service process refused to terminate gracefully with SIGTERM, escalating to SIGKILL.", + exc_info=True, + ) + self.process.kill() + except OSError: + logger.error("Error terminating service process.", exc_info=True) + + def __del__(self) -> None: + # `subprocess.Popen` doesn't send signal on `__del__`; + # so we attempt to close the launched process when `__del__` + # is triggered. + # do not use globals here; interpreter shutdown may have already cleaned them up + # and they would be `None`. This goes for anything this method is referencing internally. + try: + self.stop() + except Exception: + pass + + def _start_process(self, path: str) -> None: + """Creates a subprocess by executing the command provided. + + :param cmd: full command to execute + """ + cmd = [path] + cmd.extend(self.command_line_args()) + close_file_descriptors = self.popen_kw.pop("close_fds", system() != "Windows") + try: + start_info = None + if system() == "Windows": + start_info = subprocess.STARTUPINFO() # type: ignore[attr-defined] + start_info.dwFlags = subprocess.CREATE_NEW_CONSOLE | subprocess.STARTF_USESHOWWINDOW # type: ignore[attr-defined] + start_info.wShowWindow = subprocess.SW_HIDE # type: ignore[attr-defined] + + self.process = subprocess.Popen( + cmd, + env=self.env, + close_fds=close_file_descriptors, + stdout=cast(Optional[Union[int, IO[Any]]], self.log_output), + stderr=cast(Optional[Union[int, IO[Any]]], self.log_output), + stdin=PIPE, + creationflags=self.creation_flags, + startupinfo=start_info, + **self.popen_kw, + ) + logger.debug( + "Started executable: `%s` in a child process with pid: %s using %s to output %s", + self._path, + self.process.pid, + self.creation_flags, + self.log_output, + ) + except TypeError: + raise + except OSError as err: + if err.errno == errno.EACCES: + if self._path is None: + raise WebDriverException("Service path cannot be None.") + raise WebDriverException( + f"'{os.path.basename(self._path)}' executable may have wrong permissions." + ) from err + raise + + def env_path(self) -> Optional[str]: + if self.DRIVER_PATH_ENV_KEY: + return os.getenv(self.DRIVER_PATH_ENV_KEY, None) + return None diff --git a/selenium-4.31.0/selenium/webdriver/common/timeouts.py b/selenium-4.31.0/selenium/webdriver/common/timeouts.py new file mode 100644 index 0000000..baf6f4b --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/timeouts.py @@ -0,0 +1,142 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import TypedDict + + class JSONTimeouts(TypedDict, total=False): + implicit: int + pageLoad: int + script: int + +else: + from typing import Dict + + JSONTimeouts = Dict[str, int] + + +class _TimeoutsDescriptor: + """Get or set the value of the attributes listed below. + + _implicit_wait _page_load _script + + This does not set the value on the remote end. + """ + + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls) -> float: + return getattr(obj, self.name) / 1000 + + def __set__(self, obj, value) -> None: + converted_value = getattr(obj, "_convert")(value) + setattr(obj, self.name, converted_value) + + +class Timeouts: + def __init__(self, implicit_wait: float = 0, page_load: float = 0, script: float = 0) -> None: + """Create a new Timeouts object. + + This implements https://w3c.github.io/webdriver/#timeouts. + + :Args: + - implicit_wait - Either an int or a float. Set how many + seconds to wait when searching for elements before + throwing an error. + - page_load - Either an int or a float. Set how many seconds + to wait for a page load to complete before throwing + an error. + - script - Either an int or a float. Set how many seconds to + wait for an asynchronous script to finish execution + before throwing an error. + """ + + self._implicit_wait = self._convert(implicit_wait) + self._page_load = self._convert(page_load) + self._script = self._convert(script) + + # Creating descriptor objects + implicit_wait = _TimeoutsDescriptor("_implicit_wait") + """Get or set how many seconds to wait when searching for elements. + + This does not set the value on the remote end. + + Usage: + ------ + - Get + - `self.implicit_wait` + - Set + - `self.implicit_wait` = `value` + + Parameters: + ----------- + `value`: `float` + """ + + page_load = _TimeoutsDescriptor("_page_load") + """Get or set how many seconds to wait for the page to load. + + This does not set the value on the remote end. + + Usage: + ------ + - Get + - `self.page_load` + - Set + - `self.page_load` = `value` + + Parameters: + ----------- + `value`: `float` + """ + + script = _TimeoutsDescriptor("_script") + """Get or set how many seconds to wait for an asynchronous script to finish + execution. + + This does not set the value on the remote end. + + Usage: + ------ + - Get + - `self.script` + - Set + - `self.script` = `value` + + Parameters: + ----------- + `value`: `float` + """ + + def _convert(self, timeout: float) -> int: + if isinstance(timeout, (int, float)): + return int(float(timeout) * 1000) + raise TypeError("Timeouts can only be an int or a float") + + def _to_json(self) -> JSONTimeouts: + timeouts: JSONTimeouts = {} + if self._implicit_wait: + timeouts["implicit"] = self._implicit_wait + if self._page_load: + timeouts["pageLoad"] = self._page_load + if self._script: + timeouts["script"] = self._script + + return timeouts diff --git a/selenium-4.31.0/selenium/webdriver/common/utils.py b/selenium-4.31.0/selenium/webdriver/common/utils.py new file mode 100644 index 0000000..766dd1b --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/utils.py @@ -0,0 +1,142 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""The Utils methods.""" + +import socket +from typing import Iterable +from typing import List +from typing import Optional +from typing import Union + +from selenium.types import AnyKey +from selenium.webdriver.common.keys import Keys + +_is_connectable_exceptions = (socket.error, ConnectionResetError) + + +def free_port() -> int: + """Determines a free port using sockets.""" + free_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + free_socket.bind(("127.0.0.1", 0)) + free_socket.listen(5) + port: int = free_socket.getsockname()[1] + free_socket.close() + return port + + +def find_connectable_ip(host: Union[str, bytes, bytearray, None], port: Optional[int] = None) -> Optional[str]: + """Resolve a hostname to an IP, preferring IPv4 addresses. + + We prefer IPv4 so that we don't change behavior from previous IPv4-only + implementations, and because some drivers (e.g., FirefoxDriver) do not + support IPv6 connections. + + If the optional port number is provided, only IPs that listen on the given + port are considered. + + :Args: + - host - A hostname. + - port - Optional port number. + + :Returns: + A single IP address, as a string. If any IPv4 address is found, one is + returned. Otherwise, if any IPv6 address is found, one is returned. If + neither, then None is returned. + """ + try: + addrinfos = socket.getaddrinfo(host, None) + except socket.gaierror: + return None + + ip = None + for family, _, _, _, sockaddr in addrinfos: + connectable = True + if port: + connectable = is_connectable(port, sockaddr[0]) + + if connectable and family == socket.AF_INET: + return sockaddr[0] + if connectable and not ip and family == socket.AF_INET6: + ip = sockaddr[0] + return ip + + +def join_host_port(host: str, port: int) -> str: + """Joins a hostname and port together. + + This is a minimal implementation intended to cope with IPv6 literals. For + example, _join_host_port('::1', 80) == '[::1]:80'. + + :Args: + - host - A hostname. + - port - An integer port. + """ + if ":" in host and not host.startswith("["): + return f"[{host}]:{port}" + return f"{host}:{port}" + + +def is_connectable(port: int, host: Optional[str] = "localhost") -> bool: + """Tries to connect to the server at port to see if it is running. + + :Args: + - port - The port to connect. + """ + socket_ = None + try: + socket_ = socket.create_connection((host, port), 1) + result = True + except _is_connectable_exceptions: + result = False + finally: + if socket_: + try: + socket_.shutdown(socket.SHUT_RDWR) + except Exception: + pass + socket_.close() + return result + + +def is_url_connectable(port: Union[int, str]) -> bool: + """Tries to connect to the HTTP server at /status path and specified port + to see if it responds successfully. + + :Args: + - port - The port to connect. + """ + from urllib import request as url_request + + try: + res = url_request.urlopen(f"http://127.0.0.1:{port}/status") + return res.getcode() == 200 + except Exception: + return False + + +def keys_to_typing(value: Iterable[AnyKey]) -> List[str]: + """Processes the values that will be typed in the element.""" + characters: List[str] = [] + for val in value: + if isinstance(val, Keys): + # Todo: Does this even work? + characters.append(val) + elif isinstance(val, (int, float)): + characters.extend(str(val)) + else: + characters.extend(val) + return characters diff --git a/selenium-4.31.0/selenium/webdriver/common/virtual_authenticator.py b/selenium-4.31.0/selenium/webdriver/common/virtual_authenticator.py new file mode 100644 index 0000000..6e1deb6 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/virtual_authenticator.py @@ -0,0 +1,225 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import functools +from base64 import urlsafe_b64decode +from base64 import urlsafe_b64encode +from enum import Enum +from typing import Any +from typing import Dict +from typing import Optional +from typing import Union + + +class Protocol(str, Enum): + """Protocol to communicate with the authenticator.""" + + CTAP2: str = "ctap2" + U2F: str = "ctap1/u2f" + + +class Transport(str, Enum): + """Transport method to communicate with the authenticator.""" + + BLE: str = "ble" + USB: str = "usb" + NFC: str = "nfc" + INTERNAL: str = "internal" + + +class VirtualAuthenticatorOptions: + # These are so unnecessary but are now public API so we can't remove them without deprecating first. + # These should not be class level state in here. + Protocol = Protocol + Transport = Transport + + def __init__( + self, + protocol: str = Protocol.CTAP2, + transport: str = Transport.USB, + has_resident_key: bool = False, + has_user_verification: bool = False, + is_user_consenting: bool = True, + is_user_verified: bool = False, + ) -> None: + """Constructor. + + Initialize VirtualAuthenticatorOptions object. + """ + + self.protocol: str = protocol + self.transport: str = transport + self.has_resident_key: bool = has_resident_key + self.has_user_verification: bool = has_user_verification + self.is_user_consenting: bool = is_user_consenting + self.is_user_verified: bool = is_user_verified + + def to_dict(self) -> Dict[str, Union[str, bool]]: + return { + "protocol": self.protocol, + "transport": self.transport, + "hasResidentKey": self.has_resident_key, + "hasUserVerification": self.has_user_verification, + "isUserConsenting": self.is_user_consenting, + "isUserVerified": self.is_user_verified, + } + + +class Credential: + def __init__( + self, + credential_id: bytes, + is_resident_credential: bool, + rp_id: str, + user_handle: Optional[bytes], + private_key: bytes, + sign_count: int, + ): + """Constructor. A credential stored in a virtual authenticator. + https://w3c.github.io/webauthn/#credential-parameters. + + :Args: + - credential_id (bytes): Unique base64 encoded string. + - is_resident_credential (bool): Whether the credential is client-side discoverable. + - rp_id (str): Relying party identifier. + - user_handle (bytes): userHandle associated to the credential. Must be Base64 encoded string. Can be None. + - private_key (bytes): Base64 encoded PKCS#8 private key. + - sign_count (int): intital value for a signature counter. + """ + self._id = credential_id + self._is_resident_credential = is_resident_credential + self._rp_id = rp_id + self._user_handle = user_handle + self._private_key = private_key + self._sign_count = sign_count + + @property + def id(self) -> str: + return urlsafe_b64encode(self._id).decode() + + @property + def is_resident_credential(self) -> bool: + return self._is_resident_credential + + @property + def rp_id(self) -> str: + return self._rp_id + + @property + def user_handle(self) -> Optional[str]: + if self._user_handle: + return urlsafe_b64encode(self._user_handle).decode() + return None + + @property + def private_key(self) -> str: + return urlsafe_b64encode(self._private_key).decode() + + @property + def sign_count(self) -> int: + return self._sign_count + + @classmethod + def create_non_resident_credential(cls, id: bytes, rp_id: str, private_key: bytes, sign_count: int) -> "Credential": + """Creates a non-resident (i.e. stateless) credential. + + :Args: + - id (bytes): Unique base64 encoded string. + - rp_id (str): Relying party identifier. + - private_key (bytes): Base64 encoded PKCS + - sign_count (int): intital value for a signature counter. + + :Returns: + - Credential: A non-resident credential. + """ + return cls(id, False, rp_id, None, private_key, sign_count) + + @classmethod + def create_resident_credential( + cls, id: bytes, rp_id: str, user_handle: Optional[bytes], private_key: bytes, sign_count: int + ) -> "Credential": + """Creates a resident (i.e. stateful) credential. + + :Args: + - id (bytes): Unique base64 encoded string. + - rp_id (str): Relying party identifier. + - user_handle (bytes): userHandle associated to the credential. Must be Base64 encoded string. + - private_key (bytes): Base64 encoded PKCS + - sign_count (int): intital value for a signature counter. + + :returns: + - Credential: A resident credential. + """ + return cls(id, True, rp_id, user_handle, private_key, sign_count) + + def to_dict(self) -> Dict[str, Any]: + credential_data = { + "credentialId": self.id, + "isResidentCredential": self._is_resident_credential, + "rpId": self.rp_id, + "privateKey": self.private_key, + "signCount": self.sign_count, + } + + if self.user_handle: + credential_data["userHandle"] = self.user_handle + + return credential_data + + @classmethod + def from_dict(cls, data: Dict[str, Any]) -> "Credential": + _id = urlsafe_b64decode(f"{data['credentialId']}==") + is_resident_credential = bool(data["isResidentCredential"]) + rp_id = data.get("rpId", None) + private_key = urlsafe_b64decode(f"{data['privateKey']}==") + sign_count = int(data["signCount"]) + user_handle = urlsafe_b64decode(f"{data['userHandle']}==") if data.get("userHandle", None) else None + + return cls(_id, is_resident_credential, rp_id, user_handle, private_key, sign_count) + + def __str__(self) -> str: + return f"Credential(id={self.id}, is_resident_credential={self.is_resident_credential}, rp_id={self.rp_id},\ + user_handle={self.user_handle}, private_key={self.private_key}, sign_count={self.sign_count})" + + +def required_chromium_based_browser(func): + """A decorator to ensure that the client used is a chromium based + browser.""" + + @functools.wraps(func) + def wrapper(self, *args, **kwargs): + assert self.caps["browserName"].lower() not in [ + "firefox", + "safari", + ], "This only currently works in Chromium based browsers" + return func(self, *args, **kwargs) + + return wrapper + + +def required_virtual_authenticator(func): + """A decorator to ensure that the function is called with a virtual + authenticator.""" + + @functools.wraps(func) + @required_chromium_based_browser + def wrapper(self, *args, **kwargs): + if not self.virtual_authenticator_id: + raise ValueError("This function requires a virtual authenticator to be set.") + return func(self, *args, **kwargs) + + return wrapper diff --git a/selenium-4.31.0/selenium/webdriver/common/window.py b/selenium-4.31.0/selenium/webdriver/common/window.py new file mode 100644 index 0000000..64c7251 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/common/window.py @@ -0,0 +1,24 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""The WindowTypes implementation.""" + + +class WindowTypes: + """Set of supported window types.""" + + TAB = "tab" + WINDOW = "window" diff --git a/selenium-4.31.0/selenium/webdriver/edge/__init__.py b/selenium-4.31.0/selenium/webdriver/edge/__init__.py new file mode 100644 index 0000000..a5b1e6f --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/edge/__init__.py @@ -0,0 +1,16 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/selenium-4.31.0/selenium/webdriver/edge/options.py b/selenium-4.31.0/selenium/webdriver/edge/options.py new file mode 100644 index 0000000..bb4fe42 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/edge/options.py @@ -0,0 +1,48 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from selenium.webdriver.chromium.options import ChromiumOptions +from selenium.webdriver.common.desired_capabilities import DesiredCapabilities + + +class Options(ChromiumOptions): + KEY = "ms:edgeOptions" + + def __init__(self) -> None: + super().__init__() + self._use_webview = False + + @property + def use_webview(self) -> bool: + return self._use_webview + + @use_webview.setter + def use_webview(self, value: bool) -> None: + self._use_webview = bool(value) + + def to_capabilities(self) -> dict: + """Creates a capabilities with all the options that have been set and + :Returns: A dictionary with everything.""" + caps = super().to_capabilities() + if self._use_webview: + caps["browserName"] = "webview2" + + return caps + + @property + def default_capabilities(self) -> dict: + return DesiredCapabilities.EDGE.copy() diff --git a/selenium-4.31.0/selenium/webdriver/edge/remote_connection.py b/selenium-4.31.0/selenium/webdriver/edge/remote_connection.py new file mode 100644 index 0000000..8f74c9f --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/edge/remote_connection.py @@ -0,0 +1,42 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import Optional + +from selenium.webdriver import DesiredCapabilities +from selenium.webdriver.chromium.remote_connection import ChromiumRemoteConnection +from selenium.webdriver.remote.client_config import ClientConfig + + +class EdgeRemoteConnection(ChromiumRemoteConnection): + browser_name = DesiredCapabilities.EDGE["browserName"] + + def __init__( + self, + remote_server_addr: str, + keep_alive: bool = True, + ignore_proxy: Optional[bool] = False, + client_config: Optional[ClientConfig] = None, + ) -> None: + super().__init__( + remote_server_addr=remote_server_addr, + vendor_prefix="goog", + browser_name=EdgeRemoteConnection.browser_name, + keep_alive=keep_alive, + ignore_proxy=ignore_proxy, + client_config=client_config, + ) diff --git a/selenium-4.31.0/selenium/webdriver/edge/service.py b/selenium-4.31.0/selenium/webdriver/edge/service.py new file mode 100644 index 0000000..8d7b6b2 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/edge/service.py @@ -0,0 +1,59 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import List +from typing import Mapping +from typing import Optional + +from selenium.types import SubprocessStdAlias +from selenium.webdriver.chromium import service + + +class Service(service.ChromiumService): + """A Service class that is responsible for the starting and stopping of + `msedgedriver`. + + :param executable_path: install path of the msedgedriver executable, defaults to `msedgedriver`. + :param port: Port for the service to run on, defaults to 0 where the operating system will decide. + :param log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file. + :param service_args: (Optional) List of args to be passed to the subprocess when launching the executable. + :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`. + :param driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable. + """ + + def __init__( + self, + executable_path: str = None, + port: int = 0, + log_output: SubprocessStdAlias = None, + service_args: Optional[List[str]] = None, + env: Optional[Mapping[str, str]] = None, + driver_path_env_key: str = None, + **kwargs, + ) -> None: + self.service_args = service_args or [] + driver_path_env_key = driver_path_env_key or "SE_EDGEDRIVER" + + super().__init__( + executable_path=executable_path, + port=port, + service_args=service_args, + log_output=log_output, + env=env, + driver_path_env_key=driver_path_env_key, + **kwargs, + ) diff --git a/selenium-4.31.0/selenium/webdriver/edge/webdriver.py b/selenium-4.31.0/selenium/webdriver/edge/webdriver.py new file mode 100644 index 0000000..a40e723 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/edge/webdriver.py @@ -0,0 +1,51 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from selenium.webdriver.chromium.webdriver import ChromiumDriver +from selenium.webdriver.common.desired_capabilities import DesiredCapabilities + +from .options import Options +from .service import Service + + +class WebDriver(ChromiumDriver): + """Controls the MSEdgeDriver and allows you to drive the browser.""" + + def __init__( + self, + options: Options = None, + service: Service = None, + keep_alive: bool = True, + ) -> None: + """Creates a new instance of the edge driver. Starts the service and + then creates new instance of edge driver. + + :Args: + - options - this takes an instance of EdgeOptions + - service - Service object for handling the browser driver if you need to pass extra details + - keep_alive - Whether to configure EdgeRemoteConnection to use HTTP keep-alive. + """ + service = service if service else Service() + options = options if options else Options() + + super().__init__( + browser_name=DesiredCapabilities.EDGE["browserName"], + vendor_prefix="ms", + options=options, + service=service, + keep_alive=keep_alive, + ) diff --git a/selenium-4.31.0/selenium/webdriver/firefox/__init__.py b/selenium-4.31.0/selenium/webdriver/firefox/__init__.py new file mode 100644 index 0000000..a5b1e6f --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/firefox/__init__.py @@ -0,0 +1,16 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/selenium-4.31.0/selenium/webdriver/firefox/firefox_binary.py b/selenium-4.31.0/selenium/webdriver/firefox/firefox_binary.py new file mode 100644 index 0000000..d4cea33 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/firefox/firefox_binary.py @@ -0,0 +1,231 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +import os +import time +from platform import system +from subprocess import DEVNULL +from subprocess import STDOUT +from subprocess import Popen + +from typing_extensions import deprecated + +from selenium.common.exceptions import WebDriverException +from selenium.webdriver.common import utils + + +@deprecated("Use binary_location property in Firefox Options to set location") +class FirefoxBinary: + NO_FOCUS_LIBRARY_NAME = "x_ignore_nofocus.so" + + def __init__(self, firefox_path=None, log_file=None): + """Creates a new instance of Firefox binary. + + :Args: + - firefox_path - Path to the Firefox executable. By default, it will be detected from the standard locations. + - log_file - A file object to redirect the firefox process output to. It can be sys.stdout. + Please note that with parallel run the output won't be synchronous. + By default, it will be redirected to /dev/null. + """ + self._start_cmd = firefox_path + # We used to default to subprocess.PIPE instead of /dev/null, but after + # a while the pipe would fill up and Firefox would freeze. + self._log_file = log_file or DEVNULL + self.command_line = None + self.platform = system().lower() + if not self._start_cmd: + self._start_cmd = self._get_firefox_start_cmd() + if not self._start_cmd.strip(): + raise WebDriverException( + "Failed to find firefox binary. You can set it by specifying " + "the path to 'firefox_binary':\n\nfrom " + "selenium.webdriver.firefox.firefox_binary import " + "FirefoxBinary\n\nbinary = " + "FirefoxBinary('/path/to/binary')\ndriver = " + "webdriver.Firefox(firefox_binary=binary)" + ) + # Rather than modifying the environment of the calling Python process + # copy it and modify as needed. + self._firefox_env = os.environ.copy() + self._firefox_env["MOZ_CRASHREPORTER_DISABLE"] = "1" + self._firefox_env["MOZ_NO_REMOTE"] = "1" + self._firefox_env["NO_EM_RESTART"] = "1" + + def add_command_line_options(self, *args): + self.command_line = args + + def launch_browser(self, profile, timeout=30): + """Launches the browser for the given profile name. + + It is assumed the profile already exists. + """ + self.profile = profile + + self._start_from_profile_path(self.profile.path) + self._wait_until_connectable(timeout=timeout) + + def kill(self): + """Kill the browser. + + This is useful when the browser is stuck. + """ + if self.process: + self.process.kill() + self.process.wait() + + def _start_from_profile_path(self, path): + self._firefox_env["XRE_PROFILE_PATH"] = path + + if self.platform == "linux": + self._modify_link_library_path() + command = [self._start_cmd, "-foreground"] + if self.command_line: + for cli in self.command_line: + command.append(cli) + self.process = Popen(command, stdout=self._log_file, stderr=STDOUT, env=self._firefox_env) + + def _wait_until_connectable(self, timeout=30): + """Blocks until the extension is connectable in the firefox.""" + count = 0 + while not utils.is_connectable(self.profile.port): + if self.process.poll(): + # Browser has exited + raise WebDriverException( + "The browser appears to have exited " + "before we could connect. If you specified a log_file in " + "the FirefoxBinary constructor, check it for details." + ) + if count >= timeout: + self.kill() + raise WebDriverException( + "Can't load the profile. Possible firefox version mismatch. " + "You must use GeckoDriver instead for Firefox 48+. Profile " + f"Dir: {self.profile.path} If you specified a log_file in the " + "FirefoxBinary constructor, check it for details." + ) + count += 1 + time.sleep(1) + return True + + def _find_exe_in_registry(self): + try: + from _winreg import HKEY_CURRENT_USER + from _winreg import HKEY_LOCAL_MACHINE + from _winreg import OpenKey + from _winreg import QueryValue + except ImportError: + from winreg import OpenKey, QueryValue, HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER + import shlex + + keys = ( + r"SOFTWARE\Classes\FirefoxHTML\shell\open\command", + r"SOFTWARE\Classes\Applications\firefox.exe\shell\open\command", + ) + command = "" + for path in keys: + try: + key = OpenKey(HKEY_LOCAL_MACHINE, path) + command = QueryValue(key, "") + break + except OSError: + try: + key = OpenKey(HKEY_CURRENT_USER, path) + command = QueryValue(key, "") + break + except OSError: + pass + else: + return "" + + if not command: + return "" + + return shlex.split(command)[0] + + def _get_firefox_start_cmd(self): + """Return the command to start firefox.""" + start_cmd = "" + if self.platform == "darwin": # small darwin due to lower() in self.platform + ffname = "firefox" + start_cmd = self.which(ffname) + # use hardcoded path if nothing else was found by which() + if not start_cmd: + start_cmd = "/Applications/Firefox.app/Contents/MacOS/firefox" + # fallback to homebrew installation for mac users + if not os.path.exists(start_cmd): + start_cmd = os.path.expanduser("~") + start_cmd + elif self.platform == "windows": # same + start_cmd = self._find_exe_in_registry() or self._default_windows_location() + elif self.platform == "java" and os.name == "nt": + start_cmd = self._default_windows_location() + else: + for ffname in ["firefox", "iceweasel"]: + start_cmd = self.which(ffname) + if start_cmd: + break + else: + # couldn't find firefox on the system path + raise RuntimeError( + "Could not find firefox in your system PATH." + " Please specify the firefox binary location or install firefox" + ) + return start_cmd + + def _default_windows_location(self): + program_files = [ + os.getenv("PROGRAMFILES", r"C:\Program Files"), + os.getenv("PROGRAMFILES(X86)", r"C:\Program Files (x86)"), + ] + for path in program_files: + binary_path = os.path.join(path, r"Mozilla Firefox\firefox.exe") + if os.access(binary_path, os.X_OK): + return binary_path + return "" + + def _modify_link_library_path(self): + existing_ld_lib_path = os.environ.get("LD_LIBRARY_PATH", "") + + new_ld_lib_path = self._extract_and_check(self.profile, "x86", "amd64") + + new_ld_lib_path += existing_ld_lib_path + + self._firefox_env["LD_LIBRARY_PATH"] = new_ld_lib_path + self._firefox_env["LD_PRELOAD"] = self.NO_FOCUS_LIBRARY_NAME + + def _extract_and_check(self, profile, x86, amd64): + paths = [x86, amd64] + built_path = "" + for path in paths: + library_path = os.path.join(profile.path, path) + if not os.path.exists(library_path): + os.makedirs(library_path) + import shutil + + shutil.copy(os.path.join(os.path.dirname(__file__), path, self.NO_FOCUS_LIBRARY_NAME), library_path) + built_path += library_path + ":" + + return built_path + + def which(self, fname): + """Returns the fully qualified path by searching Path of the given + name.""" + for pe in os.environ["PATH"].split(os.pathsep): + checkname = os.path.join(pe, fname) + if os.access(checkname, os.X_OK) and not os.path.isdir(checkname): + return checkname + return None diff --git a/selenium-4.31.0/selenium/webdriver/firefox/firefox_profile.py b/selenium-4.31.0/selenium/webdriver/firefox/firefox_profile.py new file mode 100644 index 0000000..6b1dce3 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/firefox/firefox_profile.py @@ -0,0 +1,328 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import base64 +import copy +import json +import os +import re +import shutil +import sys +import tempfile +import warnings +import zipfile +from io import BytesIO +from xml.dom import minidom + +from typing_extensions import deprecated + +from selenium.common.exceptions import WebDriverException + +WEBDRIVER_PREFERENCES = "webdriver_prefs.json" + + +@deprecated("Addons must be added after starting the session") +class AddonFormatError(Exception): + """Exception for not well-formed add-on manifest files.""" + + +class FirefoxProfile: + DEFAULT_PREFERENCES = None + + def __init__(self, profile_directory=None): + """Initialises a new instance of a Firefox Profile. + + :args: + - profile_directory: Directory of profile that you want to use. If a + directory is passed in it will be cloned and the cloned directory + will be used by the driver when instantiated. + This defaults to None and will create a new + directory when object is created. + """ + self._desired_preferences = {} + if profile_directory: + newprof = os.path.join(tempfile.mkdtemp(), "webdriver-py-profilecopy") + shutil.copytree( + profile_directory, newprof, ignore=shutil.ignore_patterns("parent.lock", "lock", ".parentlock") + ) + self._profile_dir = newprof + os.chmod(self._profile_dir, 0o755) + else: + self._profile_dir = tempfile.mkdtemp() + if not FirefoxProfile.DEFAULT_PREFERENCES: + with open( + os.path.join(os.path.dirname(__file__), WEBDRIVER_PREFERENCES), encoding="utf-8" + ) as default_prefs: + FirefoxProfile.DEFAULT_PREFERENCES = json.load(default_prefs) + + self._desired_preferences = copy.deepcopy(FirefoxProfile.DEFAULT_PREFERENCES["mutable"]) + for key, value in FirefoxProfile.DEFAULT_PREFERENCES["frozen"].items(): + self._desired_preferences[key] = value + + # Public Methods + def set_preference(self, key, value): + """Sets the preference that we want in the profile.""" + self._desired_preferences[key] = value + + @deprecated("Addons must be added after starting the session") + def add_extension(self, extension=None): + self._install_extension(extension) + + def update_preferences(self): + """Writes the desired user prefs to disk.""" + user_prefs = os.path.join(self._profile_dir, "user.js") + if os.path.isfile(user_prefs): + os.chmod(user_prefs, 0o644) + self._read_existing_userjs(user_prefs) + with open(user_prefs, "w", encoding="utf-8") as f: + for key, value in self._desired_preferences.items(): + f.write(f'user_pref("{key}", {json.dumps(value)});\n') + + # Properties + + @property + def path(self): + """Gets the profile directory that is currently being used.""" + return self._profile_dir + + @property + @deprecated("The port is stored in the Service class") + def port(self): + """Gets the port that WebDriver is working on.""" + return self._port + + @port.setter + @deprecated("The port is stored in the Service class") + def port(self, port) -> None: + """Sets the port that WebDriver will be running on.""" + if not isinstance(port, int): + raise WebDriverException("Port needs to be an integer") + try: + port = int(port) + if port < 1 or port > 65535: + raise WebDriverException("Port number must be in the range 1..65535") + except (ValueError, TypeError): + raise WebDriverException("Port needs to be an integer") + self._port = port + self.set_preference("webdriver_firefox_port", self._port) + + @property + @deprecated("Allowing untrusted certs is toggled in the Options class") + def accept_untrusted_certs(self): + return self._desired_preferences["webdriver_accept_untrusted_certs"] + + @accept_untrusted_certs.setter + @deprecated("Allowing untrusted certs is toggled in the Options class") + def accept_untrusted_certs(self, value) -> None: + if not isinstance(value, bool): + raise WebDriverException("Please pass in a Boolean to this call") + self.set_preference("webdriver_accept_untrusted_certs", value) + + @property + @deprecated("Allowing untrusted certs is toggled in the Options class") + def assume_untrusted_cert_issuer(self): + return self._desired_preferences["webdriver_assume_untrusted_issuer"] + + @assume_untrusted_cert_issuer.setter + @deprecated("Allowing untrusted certs is toggled in the Options class") + def assume_untrusted_cert_issuer(self, value) -> None: + if not isinstance(value, bool): + raise WebDriverException("Please pass in a Boolean to this call") + + self.set_preference("webdriver_assume_untrusted_issuer", value) + + @property + def encoded(self) -> str: + """Updates preferences and creates a zipped, base64 encoded string of + profile directory.""" + if self._desired_preferences: + self.update_preferences() + fp = BytesIO() + with zipfile.ZipFile(fp, "w", zipfile.ZIP_DEFLATED, strict_timestamps=False) as zipped: + path_root = len(self.path) + 1 # account for trailing slash + for base, _, files in os.walk(self.path): + for fyle in files: + filename = os.path.join(base, fyle) + zipped.write(filename, filename[path_root:]) + return base64.b64encode(fp.getvalue()).decode("UTF-8") + + def _read_existing_userjs(self, userjs): + """Reads existing preferences and adds them to desired preference + dictionary.""" + pref_pattern = re.compile(r'user_pref\("(.*)",\s(.*)\)') + with open(userjs, encoding="utf-8") as f: + for usr in f: + matches = pref_pattern.search(usr) + try: + self._desired_preferences[matches.group(1)] = json.loads(matches.group(2)) + except Exception: + warnings.warn( + f"(skipping) failed to json.loads existing preference: {matches.group(1) + matches.group(2)}" + ) + + @deprecated("Addons must be added after starting the session") + def _install_extension(self, addon, unpack=True): + """Installs addon from a filepath, url or directory of addons in the + profile. + + - path: url, absolute path to .xpi, or directory of addons + - unpack: whether to unpack unless specified otherwise in the install.rdf + """ + tmpdir = None + xpifile = None + if addon.endswith(".xpi"): + tmpdir = tempfile.mkdtemp(suffix="." + os.path.split(addon)[-1]) + compressed_file = zipfile.ZipFile(addon, "r") + for name in compressed_file.namelist(): + if name.endswith("/"): + if not os.path.isdir(os.path.join(tmpdir, name)): + os.makedirs(os.path.join(tmpdir, name)) + else: + if not os.path.isdir(os.path.dirname(os.path.join(tmpdir, name))): + os.makedirs(os.path.dirname(os.path.join(tmpdir, name))) + data = compressed_file.read(name) + with open(os.path.join(tmpdir, name), "wb") as f: + f.write(data) + xpifile = addon + addon = tmpdir + + # determine the addon id + addon_details = self._addon_details(addon) + addon_id = addon_details.get("id") + assert addon_id, f"The addon id could not be found: {addon}" + + # copy the addon to the profile + extensions_dir = os.path.join(self._profile_dir, "extensions") + addon_path = os.path.join(extensions_dir, addon_id) + if not unpack and not addon_details["unpack"] and xpifile: + if not os.path.exists(extensions_dir): + os.makedirs(extensions_dir) + os.chmod(extensions_dir, 0o755) + shutil.copy(xpifile, addon_path + ".xpi") + else: + if not os.path.exists(addon_path): + shutil.copytree(addon, addon_path, symlinks=True) + + # remove the temporary directory, if any + if tmpdir: + shutil.rmtree(tmpdir) + + @deprecated("Addons must be added after starting the session") + def _addon_details(self, addon_path): + """Returns a dictionary of details about the addon. + + :param addon_path: path to the add-on directory or XPI + + Returns:: + + {'id': u'rainbow@colors.org', # id of the addon + 'version': u'1.4', # version of the addon + 'name': u'Rainbow', # name of the addon + 'unpack': False } # whether to unpack the addon + """ + + details = {"id": None, "unpack": False, "name": None, "version": None} + + def get_namespace_id(doc, url): + attributes = doc.documentElement.attributes + namespace = "" + for i in range(attributes.length): + if attributes.item(i).value == url: + if ":" in attributes.item(i).name: + # If the namespace is not the default one remove 'xlmns:' + namespace = attributes.item(i).name.split(":")[1] + ":" + break + return namespace + + def get_text(element): + """Retrieve the text value of a given node.""" + rc = [] + for node in element.childNodes: + if node.nodeType == node.TEXT_NODE: + rc.append(node.data) + return "".join(rc).strip() + + def parse_manifest_json(content): + """Extracts the details from the contents of a WebExtensions + `manifest.json` file.""" + manifest = json.loads(content) + try: + id = manifest["applications"]["gecko"]["id"] + except KeyError: + id = manifest["name"].replace(" ", "") + "@" + manifest["version"] + return { + "id": id, + "version": manifest["version"], + "name": manifest["version"], + "unpack": False, + } + + if not os.path.exists(addon_path): + raise OSError(f"Add-on path does not exist: {addon_path}") + + try: + if zipfile.is_zipfile(addon_path): + with zipfile.ZipFile(addon_path, "r") as compressed_file: + if "manifest.json" in compressed_file.namelist(): + return parse_manifest_json(compressed_file.read("manifest.json")) + + manifest = compressed_file.read("install.rdf") + elif os.path.isdir(addon_path): + manifest_json_filename = os.path.join(addon_path, "manifest.json") + if os.path.exists(manifest_json_filename): + with open(manifest_json_filename, encoding="utf-8") as f: + return parse_manifest_json(f.read()) + + with open(os.path.join(addon_path, "install.rdf"), encoding="utf-8") as f: + manifest = f.read() + else: + raise OSError(f"Add-on path is neither an XPI nor a directory: {addon_path}") + except (OSError, KeyError) as e: + raise AddonFormatError(str(e), sys.exc_info()[2]) + + try: + doc = minidom.parseString(manifest) + + # Get the namespaces abbreviations + em = get_namespace_id(doc, "http://www.mozilla.org/2004/em-rdf#") + rdf = get_namespace_id(doc, "http://www.w3.org/1999/02/22-rdf-syntax-ns#") + + description = doc.getElementsByTagName(rdf + "Description").item(0) + if not description: + description = doc.getElementsByTagName("Description").item(0) + for node in description.childNodes: + # Remove the namespace prefix from the tag for comparison + entry = node.nodeName.replace(em, "") + if entry in details: + details.update({entry: get_text(node)}) + if not details.get("id"): + for i in range(description.attributes.length): + attribute = description.attributes.item(i) + if attribute.name == em + "id": + details.update({"id": attribute.value}) + except Exception as e: + raise AddonFormatError(str(e), sys.exc_info()[2]) + + # turn unpack into a true/false value + if isinstance(details["unpack"], str): + details["unpack"] = details["unpack"].lower() == "true" + + # If no ID is set, the add-on is invalid + if not details.get("id"): + raise AddonFormatError("Add-on id could not be found.") + + return details diff --git a/selenium-4.31.0/selenium/webdriver/firefox/options.py b/selenium-4.31.0/selenium/webdriver/firefox/options.py new file mode 100644 index 0000000..4996af5 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/firefox/options.py @@ -0,0 +1,136 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from typing import Any +from typing import Dict +from typing import Optional +from typing import Union + +from typing_extensions import deprecated + +from selenium.webdriver.common.desired_capabilities import DesiredCapabilities +from selenium.webdriver.common.options import ArgOptions +from selenium.webdriver.firefox.firefox_binary import FirefoxBinary +from selenium.webdriver.firefox.firefox_profile import FirefoxProfile + + +class Log: + def __init__(self) -> None: + self.level = None + + def to_capabilities(self) -> dict: + if self.level: + return {"log": {"level": self.level}} + return {} + + +class Options(ArgOptions): + KEY = "moz:firefoxOptions" + + def __init__(self) -> None: + super().__init__() + self._binary_location = "" + self._preferences: dict = {} + # Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it. + # https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/. + self._preferences["remote.active-protocols"] = 3 + self._profile: Optional[FirefoxProfile] = None + self.log = Log() + + @property + @deprecated("use binary_location instead") + def binary(self) -> FirefoxBinary: + """Returns the FirefoxBinary instance.""" + return FirefoxBinary(self._binary_location) + + @binary.setter + @deprecated("use binary_location instead") + def binary(self, new_binary: Union[str, FirefoxBinary]) -> None: + """Sets location of the browser binary, either by string or + ``FirefoxBinary`` instance.""" + if isinstance(new_binary, FirefoxBinary): + new_binary = new_binary._start_cmd + self.binary_location = str(new_binary) + + @property + def binary_location(self) -> str: + """:Returns: The location of the binary.""" + return self._binary_location + + @binary_location.setter # noqa + def binary_location(self, value: str) -> None: + """Sets the location of the browser binary by string.""" + if not isinstance(value, str): + raise TypeError(self.BINARY_LOCATION_ERROR) + self._binary_location = value + + @property + def preferences(self) -> dict: + """:Returns: A dict of preferences.""" + return self._preferences + + def set_preference(self, name: str, value: Union[str, int, bool]): + """Sets a preference.""" + self._preferences[name] = value + + @property + def profile(self) -> Optional[FirefoxProfile]: + """:Returns: The Firefox profile to use.""" + return self._profile + + @profile.setter + def profile(self, new_profile: Union[str, FirefoxProfile]) -> None: + """Sets location of the browser profile to use, either by string or + ``FirefoxProfile``.""" + if not isinstance(new_profile, FirefoxProfile): + new_profile = FirefoxProfile(new_profile) + self._profile = new_profile + + def enable_mobile( + self, android_package: Optional[str] = "org.mozilla.firefox", android_activity=None, device_serial=None + ): + super().enable_mobile(android_package, android_activity, device_serial) + + def to_capabilities(self) -> dict: + """Marshals the Firefox options to a `moz:firefoxOptions` object.""" + # This intentionally looks at the internal properties + # so if a binary or profile has _not_ been set, + # it will defer to geckodriver to find the system Firefox + # and generate a fresh profile. + caps = self._caps + opts: Dict[str, Any] = {} + + if self._binary_location: + opts["binary"] = self._binary_location + if self._preferences: + opts["prefs"] = self._preferences + if self._profile: + opts["profile"] = self._profile.encoded + if self._arguments: + opts["args"] = self._arguments + if self.mobile_options: + opts.update(self.mobile_options) + + opts.update(self.log.to_capabilities()) + + if opts: + caps[Options.KEY] = opts + + return caps + + @property + def default_capabilities(self) -> dict: + return DesiredCapabilities.FIREFOX.copy() diff --git a/selenium-4.31.0/selenium/webdriver/firefox/remote_connection.py b/selenium-4.31.0/selenium/webdriver/firefox/remote_connection.py new file mode 100644 index 0000000..a749cce --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/firefox/remote_connection.py @@ -0,0 +1,47 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import Optional + +from selenium.webdriver.common.desired_capabilities import DesiredCapabilities +from selenium.webdriver.remote.client_config import ClientConfig +from selenium.webdriver.remote.remote_connection import RemoteConnection + + +class FirefoxRemoteConnection(RemoteConnection): + browser_name = DesiredCapabilities.FIREFOX["browserName"] + + def __init__( + self, + remote_server_addr: str, + keep_alive: bool = True, + ignore_proxy: Optional[bool] = False, + client_config: Optional[ClientConfig] = None, + ) -> None: + client_config = client_config or ClientConfig( + remote_server_addr=remote_server_addr, keep_alive=keep_alive, timeout=120 + ) + super().__init__( + ignore_proxy=ignore_proxy, + client_config=client_config, + ) + + self._commands["GET_CONTEXT"] = ("GET", "/session/$sessionId/moz/context") + self._commands["SET_CONTEXT"] = ("POST", "/session/$sessionId/moz/context") + self._commands["INSTALL_ADDON"] = ("POST", "/session/$sessionId/moz/addon/install") + self._commands["UNINSTALL_ADDON"] = ("POST", "/session/$sessionId/moz/addon/uninstall") + self._commands["FULL_PAGE_SCREENSHOT"] = ("GET", "/session/$sessionId/moz/screenshot/full") diff --git a/selenium-4.31.0/selenium/webdriver/firefox/service.py b/selenium-4.31.0/selenium/webdriver/firefox/service.py new file mode 100644 index 0000000..d9a715a --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/firefox/service.py @@ -0,0 +1,66 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from typing import List +from typing import Mapping +from typing import Optional + +from selenium.types import SubprocessStdAlias +from selenium.webdriver.common import service +from selenium.webdriver.common import utils + + +class Service(service.Service): + """A Service class that is responsible for the starting and stopping of + `geckodriver`. + + :param executable_path: install path of the geckodriver executable, defaults to `geckodriver`. + :param port: Port for the service to run on, defaults to 0 where the operating system will decide. + :param service_args: (Optional) List of args to be passed to the subprocess when launching the executable. + :param log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file. + :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`. + :param driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable. + """ + + def __init__( + self, + executable_path: str = None, + port: int = 0, + service_args: Optional[List[str]] = None, + log_output: SubprocessStdAlias = None, + env: Optional[Mapping[str, str]] = None, + driver_path_env_key: str = None, + **kwargs, + ) -> None: + self.service_args = service_args or [] + driver_path_env_key = driver_path_env_key or "SE_GECKODRIVER" + + super().__init__( + executable_path=executable_path, + port=port, + log_output=log_output, + env=env, + driver_path_env_key=driver_path_env_key, + **kwargs, + ) + + # Set a port for CDP + if "--connect-existing" not in self.service_args: + self.service_args.append("--websocket-port") + self.service_args.append(f"{utils.free_port()}") + + def command_line_args(self) -> List[str]: + return ["--port", f"{self.port}"] + self.service_args diff --git a/selenium-4.31.0/selenium/webdriver/firefox/webdriver.py b/selenium-4.31.0/selenium/webdriver/firefox/webdriver.py new file mode 100644 index 0000000..b119369 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/firefox/webdriver.py @@ -0,0 +1,222 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import base64 +import os +import warnings +import zipfile +from contextlib import contextmanager +from io import BytesIO + +from selenium.webdriver.common.driver_finder import DriverFinder +from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver + +from .options import Options +from .remote_connection import FirefoxRemoteConnection +from .service import Service + + +class WebDriver(RemoteWebDriver): + """Controls the GeckoDriver and allows you to drive the browser.""" + + CONTEXT_CHROME = "chrome" + CONTEXT_CONTENT = "content" + + def __init__( + self, + options: Options = None, + service: Service = None, + keep_alive: bool = True, + ) -> None: + """Creates a new instance of the Firefox driver. Starts the service and + then creates new instance of Firefox driver. + + :Args: + - options - Instance of ``options.Options``. + - service - (Optional) service instance for managing the starting and stopping of the driver. + - keep_alive - Whether to configure remote_connection.RemoteConnection to use HTTP keep-alive. + """ + + self.service = service if service else Service() + options = options if options else Options() + + finder = DriverFinder(self.service, options) + if finder.get_browser_path(): + options.binary_location = finder.get_browser_path() + options.browser_version = None + + self.service.path = self.service.env_path() or finder.get_driver_path() + self.service.start() + + executor = FirefoxRemoteConnection( + remote_server_addr=self.service.service_url, + keep_alive=keep_alive, + ignore_proxy=options._ignore_local_proxy, + ) + + try: + super().__init__(command_executor=executor, options=options) + except Exception: + self.quit() + raise + + self._is_remote = False + + def quit(self) -> None: + """Closes the browser and shuts down the GeckoDriver executable.""" + try: + super().quit() + except Exception: + # We don't care about the message because something probably has gone wrong + pass + finally: + self.service.stop() + + def set_context(self, context) -> None: + self.execute("SET_CONTEXT", {"context": context}) + + @contextmanager + def context(self, context): + """Sets the context that Selenium commands are running in using a + `with` statement. The state of the context on the server is saved + before entering the block, and restored upon exiting it. + + :param context: Context, may be one of the class properties + `CONTEXT_CHROME` or `CONTEXT_CONTENT`. + + Usage example:: + + with selenium.context(selenium.CONTEXT_CHROME): + # chrome scope + ... do stuff ... + """ + initial_context = self.execute("GET_CONTEXT").pop("value") + self.set_context(context) + try: + yield + finally: + self.set_context(initial_context) + + def install_addon(self, path, temporary=False) -> str: + """Installs Firefox addon. + + Returns identifier of installed addon. This identifier can later + be used to uninstall addon. + + :param temporary: allows you to load browser extensions temporarily during a session + :param path: Absolute path to the addon that will be installed. + + :Usage: + :: + + driver.install_addon('/path/to/firebug.xpi') + """ + + if os.path.isdir(path): + fp = BytesIO() + # filter all trailing slash found in path + path = os.path.normpath(path) + # account for trailing slash that will be added by os.walk() + path_root = len(path) + 1 + with zipfile.ZipFile(fp, "w", zipfile.ZIP_DEFLATED, strict_timestamps=False) as zipped: + for base, _, files in os.walk(path): + for fyle in files: + filename = os.path.join(base, fyle) + zipped.write(filename, filename[path_root:]) + addon = base64.b64encode(fp.getvalue()).decode("UTF-8") + else: + with open(path, "rb") as file: + addon = base64.b64encode(file.read()).decode("UTF-8") + + payload = {"addon": addon, "temporary": temporary} + return self.execute("INSTALL_ADDON", payload)["value"] + + def uninstall_addon(self, identifier) -> None: + """Uninstalls Firefox addon using its identifier. + + :Usage: + :: + + driver.uninstall_addon('addon@foo.com') + """ + self.execute("UNINSTALL_ADDON", {"id": identifier}) + + def get_full_page_screenshot_as_file(self, filename) -> bool: + """Saves a full document screenshot of the current window to a PNG + image file. Returns False if there is any IOError, else returns True. + Use full paths in your filename. + + :Args: + - filename: The full path you wish to save your screenshot to. This + should end with a `.png` extension. + + :Usage: + :: + + driver.get_full_page_screenshot_as_file('/Screenshots/foo.png') + """ + if not filename.lower().endswith(".png"): + warnings.warn( + "name used for saved screenshot does not match file type. It should end with a `.png` extension", + UserWarning, + ) + png = self.get_full_page_screenshot_as_png() + try: + with open(filename, "wb") as f: + f.write(png) + except OSError: + return False + finally: + del png + return True + + def save_full_page_screenshot(self, filename) -> bool: + """Saves a full document screenshot of the current window to a PNG + image file. Returns False if there is any IOError, else returns True. + Use full paths in your filename. + + :Args: + - filename: The full path you wish to save your screenshot to. This + should end with a `.png` extension. + + :Usage: + :: + + driver.save_full_page_screenshot('/Screenshots/foo.png') + """ + return self.get_full_page_screenshot_as_file(filename) + + def get_full_page_screenshot_as_png(self) -> bytes: + """Gets the full document screenshot of the current window as a binary + data. + + :Usage: + :: + + driver.get_full_page_screenshot_as_png() + """ + return base64.b64decode(self.get_full_page_screenshot_as_base64().encode("ascii")) + + def get_full_page_screenshot_as_base64(self) -> str: + """Gets the full document screenshot of the current window as a base64 + encoded string which is useful in embedded images in HTML. + + :Usage: + :: + + driver.get_full_page_screenshot_as_base64() + """ + return self.execute("FULL_PAGE_SCREENSHOT")["value"] diff --git a/selenium-4.31.0/selenium/webdriver/firefox/webdriver_prefs.json b/selenium-4.31.0/selenium/webdriver/firefox/webdriver_prefs.json new file mode 100644 index 0000000..f8d5c57 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/firefox/webdriver_prefs.json @@ -0,0 +1,69 @@ +{ + "frozen": { + "app.update.auto": false, + "app.update.enabled": false, + "browser.displayedE10SNotice": 4, + "browser.download.manager.showWhenStarting": false, + "browser.EULA.override": true, + "browser.EULA.3.accepted": true, + "browser.link.open_external": 2, + "browser.link.open_newwindow": 2, + "browser.offline": false, + "browser.reader.detectedFirstArticle": true, + "browser.safebrowsing.enabled": false, + "browser.safebrowsing.malware.enabled": false, + "browser.search.update": false, + "browser.selfsupport.url" : "", + "browser.sessionstore.resume_from_crash": false, + "browser.shell.checkDefaultBrowser": false, + "browser.tabs.warnOnClose": false, + "browser.tabs.warnOnOpen": false, + "datareporting.healthreport.service.enabled": false, + "datareporting.healthreport.uploadEnabled": false, + "datareporting.healthreport.service.firstRun": false, + "datareporting.healthreport.logging.consoleEnabled": false, + "datareporting.policy.dataSubmissionEnabled": false, + "datareporting.policy.dataSubmissionPolicyAccepted": false, + "devtools.errorconsole.enabled": true, + "dom.disable_open_during_load": false, + "extensions.autoDisableScopes": 10, + "extensions.blocklist.enabled": false, + "extensions.checkCompatibility.nightly": false, + "extensions.update.enabled": false, + "extensions.update.notifyUser": false, + "javascript.enabled": true, + "network.manage-offline-status": false, + "network.http.phishy-userpass-length": 255, + "offline-apps.allow_by_default": true, + "prompts.tab_modal.enabled": false, + "security.fileuri.origin_policy": 3, + "security.fileuri.strict_origin_policy": false, + "signon.rememberSignons": false, + "toolkit.networkmanager.disable": true, + "toolkit.telemetry.prompted": 2, + "toolkit.telemetry.enabled": false, + "toolkit.telemetry.rejected": true, + "xpinstall.signatures.required": false, + "xpinstall.whitelist.required": false + }, + "mutable": { + "browser.dom.window.dump.enabled": true, + "browser.laterrun.enabled": false, + "browser.newtab.url": "about:blank", + "browser.newtabpage.enabled": false, + "browser.startup.page": 0, + "browser.startup.homepage": "about:blank", + "browser.startup.homepage_override.mstone": "ignore", + "browser.usedOnWindows10.introURL": "about:blank", + "dom.max_chrome_script_run_time": 30, + "dom.max_script_run_time": 30, + "dom.report_all_js_exceptions": true, + "javascript.options.showInConsole": true, + "network.captive-portal-service.enabled": false, + "security.csp.enable": false, + "startup.homepage_welcome_url": "about:blank", + "startup.homepage_welcome_url.additional": "about:blank", + "webdriver_accept_untrusted_certs": true, + "webdriver_assume_untrusted_issuer": true + } +} diff --git a/selenium-4.31.0/selenium/webdriver/ie/__init__.py b/selenium-4.31.0/selenium/webdriver/ie/__init__.py new file mode 100644 index 0000000..a5b1e6f --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/ie/__init__.py @@ -0,0 +1,16 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/selenium-4.31.0/selenium/webdriver/ie/options.py b/selenium-4.31.0/selenium/webdriver/ie/options.py new file mode 100644 index 0000000..3e4dcbe --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/ie/options.py @@ -0,0 +1,406 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from enum import Enum +from typing import Any +from typing import Dict + +from selenium.webdriver.common.desired_capabilities import DesiredCapabilities +from selenium.webdriver.common.options import ArgOptions + + +class ElementScrollBehavior(Enum): + TOP = 0 + BOTTOM = 1 + + +class _IeOptionsDescriptor: + """_IeOptionsDescriptor is an implementation of Descriptor Protocol: + + : Any look-up or assignment to the below attributes in `Options` class will be intercepted + by `__get__` and `__set__` method respectively. + + - `browser_attach_timeout` + - `element_scroll_behavior` + - `ensure_clean_session` + - `file_upload_dialog_timeout` + - `force_create_process_api` + - `force_shell_windows_api` + - `full_page_screenshot` + - `ignore_protected_mode_settings` + - `ignore_zoom_level` + - `initial_browser_url` + - `native_events` + - `persistent_hover` + - `require_window_focus` + - `use_per_process_proxy` + - `use_legacy_file_upload_dialog_handling` + - `attach_to_edge_chrome` + - `edge_executable_path` + + + : When an attribute lookup happens, + Example: + `self. browser_attach_timeout` + `__get__` method does a dictionary look up in the dictionary `_options` in `Options` class + and returns the value of key `browserAttachTimeout` + : When an attribute assignment happens, + Example: + `self.browser_attach_timeout` = 30 + `__set__` method sets/updates the value of the key `browserAttachTimeout` in `_options` + dictionary in `Options` class. + """ + + def __init__(self, name, expected_type): + self.name = name + self.expected_type = expected_type + + def __get__(self, obj, cls): + return obj._options.get(self.name) + + def __set__(self, obj, value) -> None: + if not isinstance(value, self.expected_type): + raise ValueError(f"{self.name} should be of type {self.expected_type.__name__}") + + if self.name == "elementScrollBehavior" and value not in [ + ElementScrollBehavior.TOP, + ElementScrollBehavior.BOTTOM, + ]: + raise ValueError("Element Scroll Behavior out of range.") + obj._options[self.name] = value + + +class Options(ArgOptions): + KEY = "se:ieOptions" + SWITCHES = "ie.browserCommandLineSwitches" + + BROWSER_ATTACH_TIMEOUT = "browserAttachTimeout" + ELEMENT_SCROLL_BEHAVIOR = "elementScrollBehavior" + ENSURE_CLEAN_SESSION = "ie.ensureCleanSession" + FILE_UPLOAD_DIALOG_TIMEOUT = "ie.fileUploadDialogTimeout" + FORCE_CREATE_PROCESS_API = "ie.forceCreateProcessApi" + FORCE_SHELL_WINDOWS_API = "ie.forceShellWindowsApi" + FULL_PAGE_SCREENSHOT = "ie.enableFullPageScreenshot" + IGNORE_PROTECTED_MODE_SETTINGS = "ignoreProtectedModeSettings" + IGNORE_ZOOM_LEVEL = "ignoreZoomSetting" + INITIAL_BROWSER_URL = "initialBrowserUrl" + NATIVE_EVENTS = "nativeEvents" + PERSISTENT_HOVER = "enablePersistentHover" + REQUIRE_WINDOW_FOCUS = "requireWindowFocus" + USE_PER_PROCESS_PROXY = "ie.usePerProcessProxy" + USE_LEGACY_FILE_UPLOAD_DIALOG_HANDLING = "ie.useLegacyFileUploadDialogHandling" + ATTACH_TO_EDGE_CHROME = "ie.edgechromium" + EDGE_EXECUTABLE_PATH = "ie.edgepath" + IGNORE_PROCESS_MATCH = "ie.ignoreprocessmatch" + + # Creating descriptor objects for each of the above IE options + browser_attach_timeout = _IeOptionsDescriptor(BROWSER_ATTACH_TIMEOUT, int) + """Gets and Sets `browser_attach_timeout` + + Usage: + ------ + - Get + - `self.browser_attach_timeout` + - Set + - `self.browser_attach_timeout` = `value` + + Parameters: + ----------- + `value`: `int` (Timeout) in milliseconds + """ + + element_scroll_behavior = _IeOptionsDescriptor(ELEMENT_SCROLL_BEHAVIOR, Enum) + """Gets and Sets `element_scroll_behavior` + + Usage: + ------ + - Get + - `self.element_scroll_behavior` + - Set + - `self.element_scroll_behavior` = `value` + + Parameters: + ----------- + `value`: `int` either 0 - Top, 1 - Bottom + """ + + ensure_clean_session = _IeOptionsDescriptor(ENSURE_CLEAN_SESSION, bool) + """Gets and Sets `ensure_clean_session` + + Usage: + ------ + - Get + - `self.ensure_clean_session` + - Set + - `self.ensure_clean_session` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + file_upload_dialog_timeout = _IeOptionsDescriptor(FILE_UPLOAD_DIALOG_TIMEOUT, int) + """Gets and Sets `file_upload_dialog_timeout` + + Usage: + ------ + - Get + - `self.file_upload_dialog_timeout` + - Set + - `self.file_upload_dialog_timeout` = `value` + + Parameters: + ----------- + `value`: `int` (Timeout) in milliseconds + """ + + force_create_process_api = _IeOptionsDescriptor(FORCE_CREATE_PROCESS_API, bool) + """Gets and Sets `force_create_process_api` + + Usage: + ------ + - Get + - `self.force_create_process_api` + - Set + - `self.force_create_process_api` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + force_shell_windows_api = _IeOptionsDescriptor(FORCE_SHELL_WINDOWS_API, bool) + """Gets and Sets `force_shell_windows_api` + + Usage: + ------ + - Get + - `self.force_shell_windows_api` + - Set + - `self.force_shell_windows_api` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + full_page_screenshot = _IeOptionsDescriptor(FULL_PAGE_SCREENSHOT, bool) + """Gets and Sets `full_page_screenshot` + + Usage: + ------ + - Get + - `self.full_page_screenshot` + - Set + - `self.full_page_screenshot` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + ignore_protected_mode_settings = _IeOptionsDescriptor(IGNORE_PROTECTED_MODE_SETTINGS, bool) + """Gets and Sets `ignore_protected_mode_settings` + + Usage: + ------ + - Get + - `self.ignore_protected_mode_settings` + - Set + - `self.ignore_protected_mode_settings` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + ignore_zoom_level = _IeOptionsDescriptor(IGNORE_ZOOM_LEVEL, bool) + """Gets and Sets `ignore_zoom_level` + + Usage: + ------ + - Get + - `self.ignore_zoom_level` + - Set + - `self.ignore_zoom_level` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + initial_browser_url = _IeOptionsDescriptor(INITIAL_BROWSER_URL, str) + """Gets and Sets `initial_browser_url` + + Usage: + ------ + - Get + - `self.initial_browser_url` + - Set + - `self.initial_browser_url` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + native_events = _IeOptionsDescriptor(NATIVE_EVENTS, bool) + """Gets and Sets `native_events` + + Usage: + ------ + - Get + - `self.native_events` + - Set + - `self.native_events` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + persistent_hover = _IeOptionsDescriptor(PERSISTENT_HOVER, bool) + """Gets and Sets `persistent_hover` + + Usage: + ------ + - Get + - `self.persistent_hover` + - Set + - `self.persistent_hover` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + require_window_focus = _IeOptionsDescriptor(REQUIRE_WINDOW_FOCUS, bool) + """Gets and Sets `require_window_focus` + + Usage: + ------ + - Get + - `self.require_window_focus` + - Set + - `self.require_window_focus` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + use_per_process_proxy = _IeOptionsDescriptor(USE_PER_PROCESS_PROXY, bool) + """Gets and Sets `use_per_process_proxy` + + Usage: + ------ + - Get + - `self.use_per_process_proxy` + - Set + - `self.use_per_process_proxy` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + use_legacy_file_upload_dialog_handling = _IeOptionsDescriptor(USE_LEGACY_FILE_UPLOAD_DIALOG_HANDLING, bool) + """Gets and Sets `use_legacy_file_upload_dialog_handling` + + Usage: + ------ + - Get + - `self.use_legacy_file_upload_dialog_handling` + - Set + - `self.use_legacy_file_upload_dialog_handling` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + attach_to_edge_chrome = _IeOptionsDescriptor(ATTACH_TO_EDGE_CHROME, bool) + """Gets and Sets `attach_to_edge_chrome` + + Usage: + ------ + - Get + - `self.attach_to_edge_chrome` + - Set + - `self.attach_to_edge_chrome` = `value` + + Parameters: + ----------- + `value`: `bool` + """ + + edge_executable_path = _IeOptionsDescriptor(EDGE_EXECUTABLE_PATH, str) + """Gets and Sets `edge_executable_path` + + Usage: + ------ + - Get + - `self.edge_executable_path` + - Set + - `self.edge_executable_path` = `value` + + Parameters: + ----------- + `value`: `str` + """ + + def __init__(self) -> None: + super().__init__() + self._options: Dict[str, Any] = {} + self._additional: Dict[str, Any] = {} + + @property + def options(self) -> dict: + """:Returns: A dictionary of browser options.""" + return self._options + + @property + def additional_options(self) -> dict: + """:Returns: The additional options.""" + return self._additional + + def add_additional_option(self, name: str, value) -> None: + """Adds an additional option not yet added as a safe option for IE. + + :Args: + - name: name of the option to add + - value: value of the option to add + """ + self._additional[name] = value + + def to_capabilities(self) -> dict: + """Marshals the IE options to the correct object.""" + caps = self._caps + + opts = self._options.copy() + if self._arguments: + opts[self.SWITCHES] = " ".join(self._arguments) + + if self._additional: + opts.update(self._additional) + + if opts: + caps[Options.KEY] = opts + return caps + + @property + def default_capabilities(self) -> dict: + return DesiredCapabilities.INTERNETEXPLORER.copy() diff --git a/selenium-4.31.0/selenium/webdriver/ie/service.py b/selenium-4.31.0/selenium/webdriver/ie/service.py new file mode 100644 index 0000000..bd9c116 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/ie/service.py @@ -0,0 +1,66 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from typing import List +from typing import Optional + +from selenium.types import SubprocessStdAlias +from selenium.webdriver.common import service + + +class Service(service.Service): + """Object that manages the starting and stopping of the IEDriver.""" + + def __init__( + self, + executable_path: str = None, + port: int = 0, + host: Optional[str] = None, + service_args: Optional[List[str]] = None, + log_level: Optional[str] = None, + log_output: SubprocessStdAlias = None, + driver_path_env_key: str = None, + **kwargs, + ) -> None: + """Creates a new instance of the Service. + + :Args: + - executable_path : Path to the IEDriver + - port : Port the service is running on + - host : IP address the service port is bound + - log_level : Level of logging of service, may be "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE". + Default is "FATAL". + - log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file. + Default is "stdout". + """ + self.service_args = service_args or [] + driver_path_env_key = driver_path_env_key or "SE_IEDRIVER" + + if host: + self.service_args.append(f"--host={host}") + if log_level: + self.service_args.append(f"--log-level={log_level}") + + super().__init__( + executable_path=executable_path, + port=port, + log_output=log_output, + driver_path_env_key=driver_path_env_key, + **kwargs, + ) + + def command_line_args(self) -> List[str]: + return [f"--port={self.port}"] + self.service_args diff --git a/selenium-4.31.0/selenium/webdriver/ie/webdriver.py b/selenium-4.31.0/selenium/webdriver/ie/webdriver.py new file mode 100644 index 0000000..4df2c98 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/ie/webdriver.py @@ -0,0 +1,75 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from selenium.webdriver.common.driver_finder import DriverFinder +from selenium.webdriver.remote.client_config import ClientConfig +from selenium.webdriver.remote.remote_connection import RemoteConnection +from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver + +from .options import Options +from .service import Service + + +class WebDriver(RemoteWebDriver): + """Controls the IEServerDriver and allows you to drive Internet + Explorer.""" + + def __init__( + self, + options: Options = None, + service: Service = None, + keep_alive: bool = True, + ) -> None: + """Creates a new instance of the Ie driver. + + Starts the service and then creates new instance of Ie driver. + + :Args: + - options - IE Options instance, providing additional IE options + - service - (Optional) service instance for managing the starting and stopping of the driver. + - keep_alive - Whether to configure RemoteConnection to use HTTP keep-alive. + """ + + self.service = service if service else Service() + options = options if options else Options() + + self.service.path = self.service.env_path() or DriverFinder(self.service, options).get_driver_path() + self.service.start() + + client_config = ClientConfig(remote_server_addr=self.service.service_url, keep_alive=keep_alive, timeout=120) + executor = RemoteConnection( + ignore_proxy=options._ignore_local_proxy, + client_config=client_config, + ) + + try: + super().__init__(command_executor=executor, options=options) + except Exception: + self.quit() + raise + + self._is_remote = False + + def quit(self) -> None: + """Closes the browser and shuts down the IEServerDriver executable.""" + try: + super().quit() + except Exception: + # We don't care about the message because something probably has gone wrong + pass + finally: + self.service.stop() diff --git a/selenium-4.31.0/selenium/webdriver/remote/__init__.py b/selenium-4.31.0/selenium/webdriver/remote/__init__.py new file mode 100644 index 0000000..a5b1e6f --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/remote/__init__.py @@ -0,0 +1,16 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/selenium-4.31.0/selenium/webdriver/remote/bidi_connection.py b/selenium-4.31.0/selenium/webdriver/remote/bidi_connection.py new file mode 100644 index 0000000..da3df0d --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/remote/bidi_connection.py @@ -0,0 +1,23 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +class BidiConnection: + def __init__(self, session, cdp, devtools_import) -> None: + self.session = session + self.cdp = cdp + self.devtools = devtools_import diff --git a/selenium-4.31.0/selenium/webdriver/remote/client_config.py b/selenium-4.31.0/selenium/webdriver/remote/client_config.py new file mode 100644 index 0000000..f5eec5a --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/remote/client_config.py @@ -0,0 +1,162 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import base64 +import os +import socket +from enum import Enum +from typing import Optional +from urllib import parse + +import certifi + +from selenium.webdriver.common.proxy import Proxy +from selenium.webdriver.common.proxy import ProxyType + + +class AuthType(Enum): + BASIC = "Basic" + BEARER = "Bearer" + X_API_KEY = "X-API-Key" + + +class _ClientConfigDescriptor: + def __init__(self, name): + self.name = name + + def __get__(self, obj, cls): + return obj.__dict__[self.name] + + def __set__(self, obj, value) -> None: + obj.__dict__[self.name] = value + + +class ClientConfig: + remote_server_addr = _ClientConfigDescriptor("_remote_server_addr") + """Gets and Sets Remote Server.""" + keep_alive = _ClientConfigDescriptor("_keep_alive") + """Gets and Sets Keep Alive value.""" + proxy = _ClientConfigDescriptor("_proxy") + """Gets and Sets the proxy used for communicating to the driver/server.""" + ignore_certificates = _ClientConfigDescriptor("_ignore_certificates") + """Gets and Sets the ignore certificate check value.""" + init_args_for_pool_manager = _ClientConfigDescriptor("_init_args_for_pool_manager") + """Gets and Sets the ignore certificate check.""" + timeout = _ClientConfigDescriptor("_timeout") + """Gets and Sets the timeout (in seconds) used for communicating to the + driver/server.""" + ca_certs = _ClientConfigDescriptor("_ca_certs") + """Gets and Sets the path to bundle of CA certificates.""" + username = _ClientConfigDescriptor("_username") + """Gets and Sets the username used for basic authentication to the + remote.""" + password = _ClientConfigDescriptor("_password") + """Gets and Sets the password used for basic authentication to the + remote.""" + auth_type = _ClientConfigDescriptor("_auth_type") + """Gets and Sets the type of authentication to the remote server.""" + token = _ClientConfigDescriptor("_token") + """Gets and Sets the token used for authentication to the remote server.""" + user_agent = _ClientConfigDescriptor("_user_agent") + """Gets and Sets user agent to be added to the request headers.""" + extra_headers = _ClientConfigDescriptor("_extra_headers") + """Gets and Sets extra headers to be added to the request.""" + + def __init__( + self, + remote_server_addr: str, + keep_alive: Optional[bool] = True, + proxy: Optional[Proxy] = Proxy(raw={"proxyType": ProxyType.SYSTEM}), + ignore_certificates: Optional[bool] = False, + init_args_for_pool_manager: Optional[dict] = None, + timeout: Optional[int] = None, + ca_certs: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + auth_type: Optional[AuthType] = AuthType.BASIC, + token: Optional[str] = None, + user_agent: Optional[str] = None, + extra_headers: Optional[dict] = None, + ) -> None: + self.remote_server_addr = remote_server_addr + self.keep_alive = keep_alive + self.proxy = proxy + self.ignore_certificates = ignore_certificates + self.init_args_for_pool_manager = init_args_for_pool_manager or {} + self.timeout = timeout + self.username = username + self.password = password + self.auth_type = auth_type + self.token = token + self.user_agent = user_agent + self.extra_headers = extra_headers + + self.timeout = ( + ( + float(os.getenv("GLOBAL_DEFAULT_TIMEOUT", str(socket.getdefaulttimeout()))) + if os.getenv("GLOBAL_DEFAULT_TIMEOUT") is not None + else socket.getdefaulttimeout() + ) + if timeout is None + else timeout + ) + + self.ca_certs = ( + (os.getenv("REQUESTS_CA_BUNDLE") if "REQUESTS_CA_BUNDLE" in os.environ else certifi.where()) + if ca_certs is None + else ca_certs + ) + + def reset_timeout(self) -> None: + """Resets the timeout to the default value of socket.""" + self._timeout = socket.getdefaulttimeout() + + def get_proxy_url(self) -> Optional[str]: + """Returns the proxy URL to use for the connection.""" + proxy_type = self.proxy.proxy_type + remote_add = parse.urlparse(self.remote_server_addr) + if proxy_type is ProxyType.DIRECT: + return None + if proxy_type is ProxyType.SYSTEM: + _no_proxy = os.environ.get("no_proxy", os.environ.get("NO_PROXY")) + if _no_proxy: + for entry in map(str.strip, _no_proxy.split(",")): + if entry == "*": + return None + n_url = parse.urlparse(entry) + if n_url.netloc and remote_add.netloc == n_url.netloc: + return None + if n_url.path in remote_add.netloc: + return None + return os.environ.get( + "https_proxy" if self.remote_server_addr.startswith("https://") else "http_proxy", + os.environ.get("HTTPS_PROXY" if self.remote_server_addr.startswith("https://") else "HTTP_PROXY"), + ) + if proxy_type is ProxyType.MANUAL: + return self.proxy.sslProxy if self.remote_server_addr.startswith("https://") else self.proxy.http_proxy + return None + + def get_auth_header(self) -> Optional[dict]: + """Returns the authorization to add to the request headers.""" + if self.auth_type is AuthType.BASIC and self.username and self.password: + credentials = f"{self.username}:{self.password}" + encoded_credentials = base64.b64encode(credentials.encode("utf-8")).decode("utf-8") + return {"Authorization": f"{AuthType.BASIC.value} {encoded_credentials}"} + if self.auth_type is AuthType.BEARER and self.token: + return {"Authorization": f"{AuthType.BEARER.value} {self.token}"} + if self.auth_type is AuthType.X_API_KEY and self.token: + return {f"{AuthType.X_API_KEY.value}": f"{self.token}"} + return None diff --git a/selenium-4.31.0/selenium/webdriver/remote/command.py b/selenium-4.31.0/selenium/webdriver/remote/command.py new file mode 100644 index 0000000..b079ed5 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/remote/command.py @@ -0,0 +1,134 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +class Command: + """Defines constants for the standard WebDriver commands. + + While these constants have no meaning in and of themselves, they are + used to marshal commands through a service that implements WebDriver's + remote wire protocol: + + https://w3c.github.io/webdriver/ + """ + + NEW_SESSION: str = "newSession" + DELETE_SESSION: str = "deleteSession" + NEW_WINDOW: str = "newWindow" + CLOSE: str = "close" + QUIT: str = "quit" + GET: str = "get" + GO_BACK: str = "goBack" + GO_FORWARD: str = "goForward" + REFRESH: str = "refresh" + ADD_COOKIE: str = "addCookie" + GET_COOKIE: str = "getCookie" + GET_ALL_COOKIES: str = "getCookies" + DELETE_COOKIE: str = "deleteCookie" + DELETE_ALL_COOKIES: str = "deleteAllCookies" + FIND_ELEMENT: str = "findElement" + FIND_ELEMENTS: str = "findElements" + FIND_CHILD_ELEMENT: str = "findChildElement" + FIND_CHILD_ELEMENTS: str = "findChildElements" + CLEAR_ELEMENT: str = "clearElement" + CLICK_ELEMENT: str = "clickElement" + SEND_KEYS_TO_ELEMENT: str = "sendKeysToElement" + W3C_GET_CURRENT_WINDOW_HANDLE: str = "w3cGetCurrentWindowHandle" + W3C_GET_WINDOW_HANDLES: str = "w3cGetWindowHandles" + SET_WINDOW_RECT: str = "setWindowRect" + GET_WINDOW_RECT: str = "getWindowRect" + SWITCH_TO_WINDOW: str = "switchToWindow" + SWITCH_TO_FRAME: str = "switchToFrame" + SWITCH_TO_PARENT_FRAME: str = "switchToParentFrame" + W3C_GET_ACTIVE_ELEMENT: str = "w3cGetActiveElement" + GET_CURRENT_URL: str = "getCurrentUrl" + GET_PAGE_SOURCE: str = "getPageSource" + GET_TITLE: str = "getTitle" + W3C_EXECUTE_SCRIPT: str = "w3cExecuteScript" + W3C_EXECUTE_SCRIPT_ASYNC: str = "w3cExecuteScriptAsync" + GET_ELEMENT_TEXT: str = "getElementText" + GET_ELEMENT_TAG_NAME: str = "getElementTagName" + IS_ELEMENT_SELECTED: str = "isElementSelected" + IS_ELEMENT_ENABLED: str = "isElementEnabled" + GET_ELEMENT_RECT: str = "getElementRect" + GET_ELEMENT_ATTRIBUTE: str = "getElementAttribute" + GET_ELEMENT_PROPERTY: str = "getElementProperty" + GET_ELEMENT_VALUE_OF_CSS_PROPERTY: str = "getElementValueOfCssProperty" + GET_ELEMENT_ARIA_ROLE: str = "getElementAriaRole" + GET_ELEMENT_ARIA_LABEL: str = "getElementAriaLabel" + SCREENSHOT: str = "screenshot" + ELEMENT_SCREENSHOT: str = "elementScreenshot" + EXECUTE_ASYNC_SCRIPT: str = "executeAsyncScript" + SET_TIMEOUTS: str = "setTimeouts" + GET_TIMEOUTS: str = "getTimeouts" + W3C_MAXIMIZE_WINDOW: str = "w3cMaximizeWindow" + GET_LOG: str = "getLog" + GET_AVAILABLE_LOG_TYPES: str = "getAvailableLogTypes" + FULLSCREEN_WINDOW: str = "fullscreenWindow" + MINIMIZE_WINDOW: str = "minimizeWindow" + PRINT_PAGE: str = "printPage" + + # Alerts + W3C_DISMISS_ALERT: str = "w3cDismissAlert" + W3C_ACCEPT_ALERT: str = "w3cAcceptAlert" + W3C_SET_ALERT_VALUE: str = "w3cSetAlertValue" + W3C_GET_ALERT_TEXT: str = "w3cGetAlertText" + + # Advanced user interactions + W3C_ACTIONS: str = "actions" + W3C_CLEAR_ACTIONS: str = "clearActionState" + + # Screen Orientation + SET_SCREEN_ORIENTATION: str = "setScreenOrientation" + GET_SCREEN_ORIENTATION: str = "getScreenOrientation" + + # Mobile + GET_NETWORK_CONNECTION: str = "getNetworkConnection" + SET_NETWORK_CONNECTION: str = "setNetworkConnection" + CURRENT_CONTEXT_HANDLE: str = "getCurrentContextHandle" + CONTEXT_HANDLES: str = "getContextHandles" + SWITCH_TO_CONTEXT: str = "switchToContext" + + # Web Components + GET_SHADOW_ROOT: str = "getShadowRoot" + FIND_ELEMENT_FROM_SHADOW_ROOT: str = "findElementFromShadowRoot" + FIND_ELEMENTS_FROM_SHADOW_ROOT: str = "findElementsFromShadowRoot" + + # Virtual Authenticator + ADD_VIRTUAL_AUTHENTICATOR: str = "addVirtualAuthenticator" + REMOVE_VIRTUAL_AUTHENTICATOR: str = "removeVirtualAuthenticator" + ADD_CREDENTIAL: str = "addCredential" + GET_CREDENTIALS: str = "getCredentials" + REMOVE_CREDENTIAL: str = "removeCredential" + REMOVE_ALL_CREDENTIALS: str = "removeAllCredentials" + SET_USER_VERIFIED: str = "setUserVerified" + + # Remote File Management + UPLOAD_FILE: str = "uploadFile" + GET_DOWNLOADABLE_FILES: str = "getDownloadableFiles" + DOWNLOAD_FILE: str = "downloadFile" + DELETE_DOWNLOADABLE_FILES: str = "deleteDownloadableFiles" + + # Federated Credential Management (FedCM) + GET_FEDCM_TITLE: str = "getFedcmTitle" + GET_FEDCM_DIALOG_TYPE: str = "getFedcmDialogType" + GET_FEDCM_ACCOUNT_LIST: str = "getFedcmAccountList" + SELECT_FEDCM_ACCOUNT: str = "selectFedcmAccount" + CLICK_FEDCM_DIALOG_BUTTON: str = "clickFedcmDialogButton" + CANCEL_FEDCM_DIALOG: str = "cancelFedcmDialog" + SET_FEDCM_DELAY: str = "setFedcmDelay" + RESET_FEDCM_COOLDOWN: str = "resetFedcmCooldown" diff --git a/selenium-4.31.0/selenium/webdriver/remote/errorhandler.py b/selenium-4.31.0/selenium/webdriver/remote/errorhandler.py new file mode 100644 index 0000000..d2df3b1 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/remote/errorhandler.py @@ -0,0 +1,232 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import Any +from typing import Dict +from typing import Type + +from selenium.common.exceptions import DetachedShadowRootException +from selenium.common.exceptions import ElementClickInterceptedException +from selenium.common.exceptions import ElementNotInteractableException +from selenium.common.exceptions import ElementNotSelectableException +from selenium.common.exceptions import ElementNotVisibleException +from selenium.common.exceptions import ImeActivationFailedException +from selenium.common.exceptions import ImeNotAvailableException +from selenium.common.exceptions import InsecureCertificateException +from selenium.common.exceptions import InvalidArgumentException +from selenium.common.exceptions import InvalidCookieDomainException +from selenium.common.exceptions import InvalidCoordinatesException +from selenium.common.exceptions import InvalidElementStateException +from selenium.common.exceptions import InvalidSelectorException +from selenium.common.exceptions import InvalidSessionIdException +from selenium.common.exceptions import JavascriptException +from selenium.common.exceptions import MoveTargetOutOfBoundsException +from selenium.common.exceptions import NoAlertPresentException +from selenium.common.exceptions import NoSuchCookieException +from selenium.common.exceptions import NoSuchElementException +from selenium.common.exceptions import NoSuchFrameException +from selenium.common.exceptions import NoSuchShadowRootException +from selenium.common.exceptions import NoSuchWindowException +from selenium.common.exceptions import ScreenshotException +from selenium.common.exceptions import SessionNotCreatedException +from selenium.common.exceptions import StaleElementReferenceException +from selenium.common.exceptions import TimeoutException +from selenium.common.exceptions import UnableToSetCookieException +from selenium.common.exceptions import UnexpectedAlertPresentException +from selenium.common.exceptions import UnknownMethodException +from selenium.common.exceptions import WebDriverException + + +class ExceptionMapping: + """ + :Maps each errorcode in ErrorCode object to corresponding exception + Please refer to https://www.w3.org/TR/webdriver2/#errors for w3c specification + """ + + NO_SUCH_ELEMENT = NoSuchElementException + NO_SUCH_FRAME = NoSuchFrameException + NO_SUCH_SHADOW_ROOT = NoSuchShadowRootException + STALE_ELEMENT_REFERENCE = StaleElementReferenceException + ELEMENT_NOT_VISIBLE = ElementNotVisibleException + INVALID_ELEMENT_STATE = InvalidElementStateException + UNKNOWN_ERROR = WebDriverException + ELEMENT_IS_NOT_SELECTABLE = ElementNotSelectableException + JAVASCRIPT_ERROR = JavascriptException + TIMEOUT = TimeoutException + NO_SUCH_WINDOW = NoSuchWindowException + INVALID_COOKIE_DOMAIN = InvalidCookieDomainException + UNABLE_TO_SET_COOKIE = UnableToSetCookieException + UNEXPECTED_ALERT_OPEN = UnexpectedAlertPresentException + NO_ALERT_OPEN = NoAlertPresentException + SCRIPT_TIMEOUT = TimeoutException + IME_NOT_AVAILABLE = ImeNotAvailableException + IME_ENGINE_ACTIVATION_FAILED = ImeActivationFailedException + INVALID_SELECTOR = InvalidSelectorException + SESSION_NOT_CREATED = SessionNotCreatedException + MOVE_TARGET_OUT_OF_BOUNDS = MoveTargetOutOfBoundsException + INVALID_XPATH_SELECTOR = InvalidSelectorException + INVALID_XPATH_SELECTOR_RETURN_TYPER = InvalidSelectorException + ELEMENT_NOT_INTERACTABLE = ElementNotInteractableException + INSECURE_CERTIFICATE = InsecureCertificateException + INVALID_ARGUMENT = InvalidArgumentException + INVALID_COORDINATES = InvalidCoordinatesException + INVALID_SESSION_ID = InvalidSessionIdException + NO_SUCH_COOKIE = NoSuchCookieException + UNABLE_TO_CAPTURE_SCREEN = ScreenshotException + ELEMENT_CLICK_INTERCEPTED = ElementClickInterceptedException + UNKNOWN_METHOD = UnknownMethodException + DETACHED_SHADOW_ROOT = DetachedShadowRootException + + +class ErrorCode: + """Error codes defined in the WebDriver wire protocol.""" + + # Keep in sync with org.openqa.selenium.remote.ErrorCodes and errorcodes.h + SUCCESS = 0 + NO_SUCH_ELEMENT = [7, "no such element"] + NO_SUCH_FRAME = [8, "no such frame"] + NO_SUCH_SHADOW_ROOT = ["no such shadow root"] + UNKNOWN_COMMAND = [9, "unknown command"] + STALE_ELEMENT_REFERENCE = [10, "stale element reference"] + ELEMENT_NOT_VISIBLE = [11, "element not visible"] + INVALID_ELEMENT_STATE = [12, "invalid element state"] + UNKNOWN_ERROR = [13, "unknown error"] + ELEMENT_IS_NOT_SELECTABLE = [15, "element not selectable"] + JAVASCRIPT_ERROR = [17, "javascript error"] + XPATH_LOOKUP_ERROR = [19, "invalid selector"] + TIMEOUT = [21, "timeout"] + NO_SUCH_WINDOW = [23, "no such window"] + INVALID_COOKIE_DOMAIN = [24, "invalid cookie domain"] + UNABLE_TO_SET_COOKIE = [25, "unable to set cookie"] + UNEXPECTED_ALERT_OPEN = [26, "unexpected alert open"] + NO_ALERT_OPEN = [27, "no such alert"] + SCRIPT_TIMEOUT = [28, "script timeout"] + INVALID_ELEMENT_COORDINATES = [29, "invalid element coordinates"] + IME_NOT_AVAILABLE = [30, "ime not available"] + IME_ENGINE_ACTIVATION_FAILED = [31, "ime engine activation failed"] + INVALID_SELECTOR = [32, "invalid selector"] + SESSION_NOT_CREATED = [33, "session not created"] + MOVE_TARGET_OUT_OF_BOUNDS = [34, "move target out of bounds"] + INVALID_XPATH_SELECTOR = [51, "invalid selector"] + INVALID_XPATH_SELECTOR_RETURN_TYPER = [52, "invalid selector"] + + ELEMENT_NOT_INTERACTABLE = [60, "element not interactable"] + INSECURE_CERTIFICATE = ["insecure certificate"] + INVALID_ARGUMENT = [61, "invalid argument"] + INVALID_COORDINATES = ["invalid coordinates"] + INVALID_SESSION_ID = ["invalid session id"] + NO_SUCH_COOKIE = [62, "no such cookie"] + UNABLE_TO_CAPTURE_SCREEN = [63, "unable to capture screen"] + ELEMENT_CLICK_INTERCEPTED = [64, "element click intercepted"] + UNKNOWN_METHOD = ["unknown method exception"] + DETACHED_SHADOW_ROOT = [65, "detached shadow root"] + + METHOD_NOT_ALLOWED = [405, "unsupported operation"] + + +class ErrorHandler: + """Handles errors returned by the WebDriver server.""" + + def check_response(self, response: Dict[str, Any]) -> None: + """Checks that a JSON response from the WebDriver does not have an + error. + + :Args: + - response - The JSON response from the WebDriver server as a dictionary + object. + + :Raises: If the response contains an error message. + """ + status = response.get("status", None) + if not status or status == ErrorCode.SUCCESS: + return + value = None + message = response.get("message", "") + screen: str = response.get("screen", "") + stacktrace = None + if isinstance(status, int): + value_json = response.get("value", None) + if value_json and isinstance(value_json, str): + import json + + try: + value = json.loads(value_json) + if len(value) == 1: + value = value["value"] + status = value.get("error", None) + if not status: + status = value.get("status", ErrorCode.UNKNOWN_ERROR) + message = value.get("value") or value.get("message") + if not isinstance(message, str): + value = message + message = message.get("message") + else: + message = value.get("message", None) + except ValueError: + pass + + exception_class: Type[WebDriverException] + e = ErrorCode() + error_codes = [item for item in dir(e) if not item.startswith("__")] + for error_code in error_codes: + error_info = getattr(ErrorCode, error_code) + if isinstance(error_info, list) and status in error_info: + exception_class = getattr(ExceptionMapping, error_code, WebDriverException) + break + else: + exception_class = WebDriverException + + if not value: + value = response["value"] + if isinstance(value, str): + raise exception_class(value) + if message == "" and "message" in value: + message = value["message"] + + screen = None # type: ignore[assignment] + if "screen" in value: + screen = value["screen"] + + stacktrace = None + st_value = value.get("stackTrace") or value.get("stacktrace") + if st_value: + if isinstance(st_value, str): + stacktrace = st_value.split("\n") + else: + stacktrace = [] + try: + for frame in st_value: + line = frame.get("lineNumber", "") + file = frame.get("fileName", "") + if line: + file = f"{file}:{line}" + meth = frame.get("methodName", "") + if "className" in frame: + meth = f"{frame['className']}.{meth}" + msg = " at %s (%s)" + msg = msg % (meth, file) + stacktrace.append(msg) + except TypeError: + pass + if exception_class == UnexpectedAlertPresentException: + alert_text = None + if "data" in value: + alert_text = value["data"].get("text") + elif "alert" in value: + alert_text = value["alert"].get("text") + raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here + raise exception_class(message, screen, stacktrace) diff --git a/selenium-4.31.0/selenium/webdriver/remote/fedcm.py b/selenium-4.31.0/selenium/webdriver/remote/fedcm.py new file mode 100644 index 0000000..eb23319 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/remote/fedcm.py @@ -0,0 +1,70 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import List +from typing import Optional + +from .command import Command + + +class FedCM: + def __init__(self, driver) -> None: + self._driver = driver + + @property + def title(self) -> str: + """Gets the title of the dialog.""" + return self._driver.execute(Command.GET_FEDCM_TITLE)["value"].get("title") + + @property + def subtitle(self) -> Optional[str]: + """Gets the subtitle of the dialog.""" + return self._driver.execute(Command.GET_FEDCM_TITLE)["value"].get("subtitle") + + @property + def dialog_type(self) -> str: + """Gets the type of the dialog currently being shown.""" + return self._driver.execute(Command.GET_FEDCM_DIALOG_TYPE).get("value") + + @property + def account_list(self) -> List[dict]: + """Gets the list of accounts shown in the dialog.""" + return self._driver.execute(Command.GET_FEDCM_ACCOUNT_LIST).get("value") + + def select_account(self, index: int) -> None: + """Selects an account from the dialog by index.""" + self._driver.execute(Command.SELECT_FEDCM_ACCOUNT, {"accountIndex": index}) + + def accept(self) -> None: + """Clicks the continue button in the dialog.""" + self._driver.execute(Command.CLICK_FEDCM_DIALOG_BUTTON, {"dialogButton": "ConfirmIdpLoginContinue"}) + + def dismiss(self) -> None: + """Cancels/dismisses the FedCM dialog.""" + self._driver.execute(Command.CANCEL_FEDCM_DIALOG) + + def enable_delay(self) -> None: + """Re-enables the promise rejection delay for FedCM.""" + self._driver.execute(Command.SET_FEDCM_DELAY, {"enabled": True}) + + def disable_delay(self) -> None: + """Disables the promise rejection delay for FedCM.""" + self._driver.execute(Command.SET_FEDCM_DELAY, {"enabled": False}) + + def reset_cooldown(self) -> None: + """Resets the FedCM dialog cooldown, allowing immediate retriggers.""" + self._driver.execute(Command.RESET_FEDCM_COOLDOWN) diff --git a/selenium-4.31.0/selenium/webdriver/remote/file_detector.py b/selenium-4.31.0/selenium/webdriver/remote/file_detector.py new file mode 100644 index 0000000..77ce2a5 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/remote/file_detector.py @@ -0,0 +1,53 @@ +# Licensed to the Software Freedom Conservancy (SFC) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The SFC licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from abc import ABCMeta +from abc import abstractmethod +from contextlib import suppress +from pathlib import Path +from typing import Optional + +from selenium.types import AnyKey +from selenium.webdriver.common.utils import keys_to_typing + + +class FileDetector(metaclass=ABCMeta): + """Used for identifying whether a sequence of chars represents the path to + a file.""" + + @abstractmethod + def is_local_file(self, *keys: AnyKey) -> Optional[str]: + raise NotImplementedError + + +class UselessFileDetector(FileDetector): + """A file detector that never finds anything.""" + + def is_local_file(self, *keys: AnyKey) -> Optional[str]: + return None + + +class LocalFileDetector(FileDetector): + """Detects files on the local disk.""" + + def is_local_file(self, *keys: AnyKey) -> Optional[str]: + file_path = "".join(keys_to_typing(keys)) + + with suppress(OSError): + if Path(file_path).is_file(): + return file_path + return None diff --git a/selenium-4.31.0/selenium/webdriver/remote/findElements.js b/selenium-4.31.0/selenium/webdriver/remote/findElements.js new file mode 100644 index 0000000..54f9e24 --- /dev/null +++ b/selenium-4.31.0/selenium/webdriver/remote/findElements.js @@ -0,0 +1,54 @@ +function(){return (function(){var h=this||self; +function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"== +b&&"undefined"==typeof a.call)return"object";return b}function k(a){return"function"==aa(a)}function n(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};var ca=window;function q(a,b){this.code=a;this.a=r[a]||u;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(c){return c.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}ba(q,Error);var u="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=u;r[30]=u;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; +r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=u;r[9]="unknown command";var da;var ea=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;cb?null:"string"===typeof a?a.charAt(b):a[b]}function la(a,b){a.sort(b||ma)}function ma(a,b){return a>b?1:ab?1:0};var y;a:{var qa=h.navigator;if(qa){var ra=qa.userAgent;if(ra){y=ra;break a}}y=""}function C(a){return-1!=y.indexOf(a)};function sa(){return C("Firefox")||C("FxiOS")}function ta(){return(C("Chrome")||C("CriOS"))&&!C("Edge")};function ua(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function D(){return C("iPhone")&&!C("iPod")&&!C("iPad")};function va(a,b){var c=xa;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var ya=C("Opera"),E=C("Trident")||C("MSIE"),za=C("Edge"),Aa=C("Gecko")&&!(-1!=y.toLowerCase().indexOf("webkit")&&!C("Edge"))&&!(C("Trident")||C("MSIE"))&&!C("Edge"),Ba=-1!=y.toLowerCase().indexOf("webkit")&&!C("Edge");function Ca(){var a=h.document;return a?a.documentMode:void 0}var Da; +a:{var Ea="",Fa=function(){var a=y;if(Aa)return/rv:([^\);]+)(\)|;)/.exec(a);if(za)return/Edge\/([\d\.]+)/.exec(a);if(E)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ba)return/WebKit\/(\S+)/.exec(a);if(ya)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Fa&&(Ea=Fa?Fa[1]:"");if(E){var Ga=Ca();if(null!=Ga&&Ga>parseFloat(Ea)){Da=String(Ga);break a}}Da=Ea}var xa={};function Ha(a){return va(a,function(){return 0<=oa(Da,a)})}var F;F=h.document&&E?Ca():void 0;function G(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}G.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};G.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};G.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function H(a,b){this.width=a;this.height=b}H.prototype.aspectRatio=function(){return this.width/this.height};H.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};H.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};H.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function I(a){return a?new Ia(J(a)):da||(da=new Ia)}function Ja(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function Ka(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}function J(a){return 9==a.nodeType?a:a.ownerDocument||a.document} +function La(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function Ia(a){this.a=a||h.document||document} +function L(a,b,c,d){a=d||a.a;var e=b&&"*"!=b?String(b).toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(e||c))c=a.querySelectorAll(e+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(b=a.getElementsByClassName(c),e){a={};for(var f=d=0,g;g=b[f];f++)e==g.nodeName&&(a[d++]=g);a.length=d;c=a}else c=b;else if(b=a.getElementsByTagName(e||"*"),c){a={};for(f=d=0;g=b[f];f++){e=g.className;var l;if(l="function"==typeof e.split)l=0<=ea(e.split(/\s+/),c);l&&(a[d++]=g)}a.length=d;c=a}else c=b;return c} +;var Ma={l:function(a){return!(!a.querySelectorAll||!a.querySelector)},g:function(a,b){if(!a)throw new q(32,"No class name specified");a=x(a);if(-1!==a.indexOf(" "))throw new q(32,"Compound class names not permitted");if(Ma.l(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(c){throw new q(32,"An invalid or illegal class name was specified");}a=L(I(b),"*",a,b);return a.length?a[0]:null},c:function(a,b){if(!a)throw new q(32,"No class name specified");a=x(a);if(-1!==a.indexOf(" "))throw new q(32, +"Compound class names not permitted");if(Ma.l(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new q(32,"An invalid or illegal class name was specified");}return L(I(b),"*",a,b)}};var Na=sa(),Oa=D()||C("iPod"),Ra=C("iPad"),Sa=C("Android")&&!(ta()||sa()||C("Opera")||C("Silk")),Ta=ta(),Ua=C("Safari")&&!(ta()||C("Coast")||C("Opera")||C("Edge")||C("Edg/")||C("OPR")||sa()||C("Silk")||C("Android"))&&!(D()||C("iPad")||C("iPod"));function M(a){return(a=a.exec(y))?a[1]:""}(function(){if(Na)return M(/Firefox\/([0-9.]+)/);if(E||za||ya)return Da;if(Ta)return D()||C("iPad")||C("iPod")?M(/CriOS\/([0-9.]+)/):M(/Chrome\/([0-9.]+)/);if(Ua&&!(D()||C("iPad")||C("iPod")))return M(/Version\/([0-9.]+)/);if(Oa||Ra){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(y);if(a)return a[1]+"."+a[2]}else if(Sa)return(a=M(/Android\s+([0-9.]+)/))?a:M(/Version\/([0-9.]+)/);return""})();var Va=E&&!(8<=Number(F)),Wa=E&&!(9<=Number(F));var N={g:function(a,b){if(!k(b.querySelector)&&E&&(E?0<=oa(F,8):Ha(8))&&!n(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new q(32,"No selector specified");a=x(a);try{var c=b.querySelector(a)}catch(d){throw new q(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},c:function(a,b){if(!k(b.querySelectorAll)&&E&&(E?0<=oa(F,8):Ha(8))&&!n(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new q(32,"No selector specified"); +a=x(a);try{return b.querySelectorAll(a)}catch(c){throw new q(32,"An invalid or illegal selector was specified");}}};var Xa={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", +darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", +ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", +lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", +moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", +seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Ya="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Za=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,$a=/^#(?:[0-9a-f]{3}){1,2}$/i,ab=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,bb=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function O(a,b){b=b.toLowerCase();return"style"==b?cb(a.style.cssText):Va&&"value"==b&&P(a,"INPUT")?a.value:Wa&&!0===a[b]?String(a.getAttribute(b)):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var db=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; +function cb(a){var b=[];w(a.split(db),function(c){var d=c.indexOf(":");0=b&&0<=c&&255>=c&&0<=d&&255>=d&&0<=e&&1>=e)){b=[b,c,d,e];break b}b=null}if(!b)b:{if(d=a.match(bb))if(b= +Number(d[1]),c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d){b=[b,c,d,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=Xa[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(Za,"#$1$1$2$2$3$3")),!$a.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a} +function hb(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&k(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(a=gb(a))?hb(a,b):null} +function ib(a,b,c){function d(g){var l=S(g);return 0=v.a+v.width;v=e.j>=v.b+v.height;if(B&&"hidden"==t.x||v&&"hidden"==t.y)return T;if(B&&"visible"!=t.x||v&&"visible"!=t.y){if(A&&(t=d(a),e.h>=g.scrollWidth-t.x||e.a>=g.scrollHeight-t.y))return T;e=jb(a);return e==T?T:"scroll"}}}return"none"} +function S(a){var b=kb(a);if(b)return b.rect;if(P(a,"HTML"))return a=J(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new H(a.clientWidth,a.clientHeight),new Q(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new Q(0,0,0,0)}b=new Q(c.left,c.top,c.right-c.left,c.bottom-c.top);E&&a.ownerDocument.body&&(a=J(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop); +return b}function kb(a){var b=P(a,"MAP");if(!b&&!P(a,"AREA"))return null;var c=b?a:P(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=N.g('*[usemap="#'+c.name+'"]',J(c)))&&(e=S(d),b||"default"==a.shape.toLowerCase()||(a=ob(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new Q(b+e.a,c+e.b,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{image:d,rect:e||new Q(0,0,0,0)}} +function ob(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){b=a[0];var c=a[1];return new Q(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new Q(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2=~*^$|%&@`{}\-\/\[\]\(\)])/g, +"\\$1")}};var U={},zb={};U.v=function(a,b,c){try{var d=N.c("a",b)}catch(e){d=L(I(b),"A",null,b)}return ka(d,function(e){e=qb(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};U.u=function(a,b,c){try{var d=N.c("a",b)}catch(e){d=L(I(b),"A",null,b)}return fa(d,function(e){e=qb(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};U.g=function(a,b){return U.v(a,b,!1)};U.c=function(a,b){return U.u(a,b,!1)};zb.g=function(a,b){return U.v(a,b,!0)}; +zb.c=function(a,b){return U.u(a,b,!0)};var V={i:function(a,b){return function(c){var d=V.f(a);d=S(d);c=S(c);return b.call(null,d,c)}},C:function(a){return V.i(a,function(b,c){return c.b+c.height<=b.b})},D:function(a){return V.i(a,function(b,c){return c.b>=b.b+b.height})},H:function(a){return V.i(a,function(b,c){return c.a+c.width<=b.a})},J:function(a){return V.i(a,function(b,c){return c.a>=b.a+b.width})},L:function(a){return V.i(a,function(b,c){return c.ab.a&&c.b+c.height<=b.b})},M:function(a){return V.i(a,function(b, +c){return c.ab.a&&c.b>=b.b+b.height})},N:function(a){return V.i(a,function(b,c){return c.bb.b&&c.a+c.width<=b.a})},O:function(a){return V.i(a,function(b,c){return c.bb.b&&c.a>=b.a+b.width})},I:function(a,b){var c;b?c=b:"number"==typeof a.distance&&(c=a.distance);c||(c=50);return function(d){var e=V.f(a);if(e===d)return!1;e=S(e);d=S(d);e=new Q(e.a-c,e.b-c,e.width+2*c,e.height+2*c);return e.a<=d.a+d.width&&d.a<=e.a+e.width&& +e.b<=d.b+d.height&&d.b<=e.b+e.height}},f:function(a){if(n(a)&&1==a.nodeType)return a;if(k(a))return V.f(a.call(null));if(n(a)){var b;a:{if(b=Ab(a)){var c=Bb[b];if(c&&k(c.g)){b=c.g(a[b],ca.document);break a}}throw new q(61,"Unsupported locator strategy: "+b);}if(!b)throw new q(7,"No element has been found by "+JSON.stringify(a));return b}throw new q(61,"Selector is of wrong type: "+JSON.stringify(a));}}; +V.B={above:V.C,below:V.D,left:V.H,near:V.I,right:V.J,straightAbove:V.L,straightBelow:V.M,straightLeft:V.N,straightRight:V.O};V.A={above:V.f,below:V.f,left:V.f,near:V.f,right:V.f,straightAbove:V.f,straightBelow:V.f,straightLeft:V.f,straightRight:V.f}; +V.G=function(a,b){var c=[];w(a,function(e){e&&ja(b,function(f){var g=f.kind,l=V.B[g];if(!l)throw new q(61,"Cannot find filter suitable for "+g);return l.apply(null,f.args)(e)},null)&&c.push(e)},null);a=b[b.length-1];var d=V.A[a?a.kind:"unknown"];return d?(a=d.apply(null,a.args))?V.K(a,c):c:c}; +V.K=function(a,b){function c(f){f=S(f);return Math.sqrt(Math.pow(d-(f.a+Math.max(1,f.width)/2),2)+Math.pow(e-(f.b+Math.max(1,f.height)/2),2))}a=S(a);var d=a.a+Math.max(1,a.width)/2,e=a.b+Math.max(1,a.height)/2;la(b,function(f,g){return c(f)-c(g)});return b};V.g=function(a,b){a=V.c(a,b);return 0==a.length?null:a[0]}; +V.c=function(a,b){if(!a.hasOwnProperty("root")||!a.hasOwnProperty("filters"))throw new q(61,"Locator not suitable for relative locators: "+JSON.stringify(a));var c=a.filters,d=aa(c);if("array"!=d&&("object"!=d||"number"!=typeof c.length))throw new q(61,"Targets should be an array: "+JSON.stringify(a));var e;P(a.root)?e=[a.root]:e=Cb(a.root,b);return 0==e.length?[]:V.G(e,a.filters)};var Db={g:function(a,b){if(""===a)throw new q(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},c:function(a,b){if(""===a)throw new q(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var W={};W.m=function(){var a={P:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); +W.s=function(a,b,c){var d=J(a);if(!d.documentElement)return null;try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):W.m;if(E&&!Ha(7))return d.evaluate.call(d,b,a,e,c,null);if(!E||9<=Number(F)){for(var f={},g=d.getElementsByTagName("*"),l=0;lb||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}f(l,Error);var n="unknown error",m={15:"element not selectable",11:"element not visible"};m[31]=n;m[30]=n;m[24]="invalid cookie domain";m[29]="invalid element coordinates";m[12]="invalid element state";m[32]="invalid selector"; +m[51]="invalid selector";m[52]="invalid selector";m[17]="javascript error";m[405]="unsupported operation";m[34]="move target out of bounds";m[27]="no such alert";m[7]="no such element";m[8]="no such frame";m[23]="no such window";m[28]="script timeout";m[33]="session not created";m[10]="stale element reference";m[21]="timeout";m[25]="unable to set cookie";m[26]="unexpected alert open";m[13]=n;m[9]="unknown command";var p;a:{var q=d.navigator;if(q){var r=q.userAgent;if(r){p=r;break a}}p=""}function t(a){return-1!=p.indexOf(a)};function u(){return t("Firefox")||t("FxiOS")}function v(){return(t("Chrome")||t("CriOS"))&&!t("Edge")};function w(){return t("iPhone")&&!t("iPod")&&!t("iPad")};var y=t("Opera"),z=t("Trident")||t("MSIE"),A=t("Edge"),B=t("Gecko")&&!(-1!=p.toLowerCase().indexOf("webkit")&&!t("Edge"))&&!(t("Trident")||t("MSIE"))&&!t("Edge"),C=-1!=p.toLowerCase().indexOf("webkit")&&!t("Edge");function D(){var a=d.document;return a?a.documentMode:void 0}var E; +a:{var F="",G=function(){var a=p;if(B)return/rv:([^\);]+)(\)|;)/.exec(a);if(A)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(C)return/WebKit\/(\S+)/.exec(a);if(y)return/(?:Version)[ \/]?(\S+)/.exec(a)}();G&&(F=G?G[1]:"");if(z){var H=D();if(null!=H&&H>parseFloat(F)){E=String(H);break a}}E=F}var I;I=d.document&&z?D():void 0;var J=u(),K=w()||t("iPod"),L=t("iPad"),M=t("Android")&&!(v()||u()||t("Opera")||t("Silk")),N=v(),aa=t("Safari")&&!(v()||t("Coast")||t("Opera")||t("Edge")||t("Edg/")||t("OPR")||u()||t("Silk")||t("Android"))&&!(w()||t("iPad")||t("iPod"));function O(a){return(a=a.exec(p))?a[1]:""}(function(){if(J)return O(/Firefox\/([0-9.]+)/);if(z||A||y)return E;if(N)return w()||t("iPad")||t("iPod")?O(/CriOS\/([0-9.]+)/):O(/Chrome\/([0-9.]+)/);if(aa&&!(w()||t("iPad")||t("iPod")))return O(/Version\/([0-9.]+)/);if(K||L){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(p);if(a)return a[1]+"."+a[2]}else if(M)return(a=O(/Android\s+([0-9.]+)/))?a:O(/Version\/([0-9.]+)/);return""})();var P=z&&!(8<=Number(I)),ba=z&&!(9<=Number(I));var ca={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},Q={IMG:" ",BR:"\n"};function R(a,b,c){if(!(a.nodeName in ca))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in Q)b.push(Q[a.nodeName]);else for(a=a.firstChild;a;)R(a,b,c),a=a.nextSibling};function S(a,b){b=b.toLowerCase();return"style"==b?da(a.style.cssText):P&&"value"==b&&T(a,"INPUT")?a.value:ba&&!0===a[b]?String(a.getAttribute(b)):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var ea=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; +function da(a){var b=[];k(a.split(ea),function(c){var e=c.indexOf(":");0